@infinite-table/infinite-react 9.1.1 → 9.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.dev.js +138 -56
- package/index.dev.mjs +138 -56
- package/index.js +8 -8
- package/index.mjs +8 -8
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var Vb=Object.create;var gi=Object.defineProperty;var Gb=Object.getOwnPropertyDescriptor;var Hb=Object.getOwnPropertyNames;var Kb=Object.getPrototypeOf,Bb=Object.prototype.hasOwnProperty;var Wb=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),jb=(o,e)=>{for(var t in e)gi(o,t,{get:e[t],enumerable:!0})},Uu=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Hb(e))!Bb.call(o,r)&&r!==t&&gi(o,r,{get:()=>e[r],enumerable:!(n=Gb(e,r))||n.enumerable});return o};var W=(o,e,t)=>(t=o!=null?Vb(Kb(o)):{},Uu(e||!o||!o.__esModule?gi(t,"default",{value:o,enumerable:!0}):t,o)),$b=o=>Uu(gi({},"__esModule",{value:!0}),o);var ln=Wb((gx,qd)=>{"use strict";qd.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 $R={};jb($R,{AutoScroller:()=>mn,CellSelectionState:()=>je,DRAG_ITEM_ATTRIBUTE:()=>It,DataClient:()=>zu,DataSource:()=>pI,DataSourceActionType:()=>Sg,DeepMap:()=>te,DragDropProvider:()=>Ki,DragInteractionTarget:()=>Zn,DragList:()=>Ko,FixedSizeSet:()=>yl,FlashingColumnCell:()=>Tb,GroupRowsState:()=>Rt,INTERNAL_MatrixDebugger:()=>Ib,InfiniteTable:()=>lo,InfiniteTableClassName:()=>Xt,InfiniteTableComponent:()=>ub,Menu:()=>$t,RowDetailCache:()=>ur,RowDetailState:()=>Dt,RowDisabledState:()=>wt,RowSelectionState:()=>Oe,TreeDataSource:()=>VR,TreeExpandState:()=>st,TreeGrid:()=>pb,TreeSelectionState:()=>nt,WeakFixedSizeSet:()=>Sl,alignNode:()=>el,components:()=>jR,createDefaultProxy:()=>Ss,createFlashingColumnCellComponent:()=>Vu,debounce:()=>Mt,debug:()=>Ue,defaultDragProxyMove:()=>Ts,defaultFilterTypes:()=>ko,eventMatchesKeyboardShortcut:()=>Qa,filterDataArray:()=>Zs,filterTypes:()=>ko,flatten:()=>mm,getComponentStateRoot:()=>Ot,group:()=>Ia,interceptMap:()=>mb,keyboardShortcuts:()=>fb,multisort:()=>oo,multisortNested:()=>wa,queryKeyToCacheKey:()=>xn,toTreeDataArray:()=>Sm,useComponentState:()=>Nt,useDataSourceApi:()=>bg,useDataSourceInternal:()=>sr,useDataSourceSelector:()=>_e,useDataSourceState:()=>Ka,useDragDropProvider:()=>po,useDragListContext:()=>gn,useEffectWhen:()=>Cl,useEffectWhenSameDeps:()=>gb,useEffectWithChanges:()=>Rn,useEffectWithObject:()=>rI,useGridScroll:()=>cl,useInfiniteColumnApi:()=>ib,useInfiniteColumnCell:()=>Vr,useInfiniteColumnEditor:()=>Xi,useInfiniteColumnFilterEditor:()=>Hn,useInfiniteHeaderCell:()=>Mr,useInfinitePortalContainer:()=>Ay,useInfiniteTableApi:()=>rb,useLayoutEffectWithChanges:()=>nI,useManagedDataSource:()=>lu,useMasterRowInfo:()=>Mo,useOverlay:()=>io,useOverlayPortal:()=>Fh,usePrevious:()=>No,useRowInfoReducers:()=>fI,useVisibleColumnSizes:()=>Iy,withSelectedLeafNodesOnly:()=>ku});module.exports=$b($R);function Mt(o,{wait:e}){let t=null;return function(...n){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{o.apply(r,n)},e)}}var ve=W(require("react"));var oe=(...o)=>o.filter(e=>!!`${e}`).join(" ");var on=W(require("react")),Ol=require("react");var Ub=W(require("react")),xo=require("react");var Mn=(o,e,t={debounce:0})=>{let n=t.debounce??0,r=window.ResizeObserver,i=n?Mt(e,{wait:n}):e,a=new r(l=>{let s=l[0],{width:u,height:c}=s.contentRect;if(s.borderBoxSize?.[0])c=s.borderBoxSize[0].blockSize,u=s.borderBoxSize[0].inlineSize;else{let d=o.getBoundingClientRect();c=d.height,u=d.width}i({width:u,height:c})});return a.observe(o),()=>{a.disconnect()}};var hi=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=(0,xo.useRef)({width:0,height:0}),r=i=>{let a;return o.current&&(a=Mn(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,xo.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),(0,xo.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};function Se(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,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function pt(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var Yu=(o,e)=>o-e;var yi=(o,e)=>Yu(o.revision,e.revision),te=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),u=!a;if(i!==void 0){if(i<0)return;i--}let c=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,g=p===this.emptyKey;if(g&&!u)return;let y=g?[]:[...e,p],h=m?()=>this.visitWithNext(y,t,n,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let b=t(f.value,y,l,h,f);if(n&&b===!0)return!0;l++}else h?.()};s&&(c(void 0,this.emptyKey),u=!1,l=0);for(let[d,p]of r){let f=c(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,u)=>{!u.map&&u.hasOwnProperty("value")&&(r?i.push(u):a.push(t(u)))},n),r?i.sort(yi).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)},u=this.map,c,d=!1;if(e.length)for(let p=0,f=e.length;p<f;p++){let m=e[p];if(c=u.get(m),!c||!c.map)if(d=!0,p===f-1){d=!0;break}else return[];u=c.map}else if(!n&&u.has(this.emptyKey))return[[]];return c&&c.value!==void 0&&(n||(s({...c,keys:e}),d=!0)),d?i?a.sort(yi).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,y)=>{s({...y,keys:f})},!1,u,r,n),i?a.sort(yi).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 u=0,c=e.length;u<c;u++){let d=e[u];if(l=a.get(d),!l||!l.map)if(s=!0,u===c-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,(u,c,d,p,f)=>{t(c,u,{...f,keys:c}),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],u=a===l-1,c=t.get(s);if(u){c&&(c.hasOwnProperty("value")&&(delete c.value,delete c.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),c.map&&c.map.size===0&&delete c.map,c.map||t.delete(s));break}else{if(!c||!c.map){i=!1;break}r.push(c),t=c.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],u=e[e.length-1],c=s?.get(u);c&&(delete c.map,c.hasOwnProperty("value")||s.delete(u))}}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],u=pt(()=>{if(l)for(let[c]of l){let d=this.visitKey(c,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let c=r(a,s,u);if(i&&c===!0)return!0}u()}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(yi);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};globalThis.DeepMap=te;function Pe(){return globalThis}var Si=["#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"],qu=Symbol("color"),bi=new WeakMap,Pl=Se();function Dl(o=Si){bi.set(o,o.map(e=>0))}Dl();var Yb=(o=Si)=>{let e=[];bi.has(o)?e=bi.get(o):(e=o.map(n=>0),bi.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]??Si[0]},Rr=":",xl="*",Xu="-",qb=",",Xb="debug",Zb="diffdebug",Qu=!1,Ir=new te,wr=new Map;function El(o,e){let t=o.split(Rr),n=new te;n.set(t,!0);let r=e.split(Rr),i=new Set(r).has(xl),a=r.indexOf(xl),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(Rr)):!0}}function Ju(o,e){let t=`channel=${o}_permissions=${e}`;if(wr.has(t))return wr.get(t);let n=e.split(qb);function r(l){return wr.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(xl)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],u=s.startsWith(Xu);if(u&&(s=s.substring(Xu.length)),El(o,s))return r(!u)}for(let l=0;l<a.length;l++){let s=a[l],u=s.startsWith("-");if(u&&(s=s.substring(1)),El(o,s))return r(!u)}return r(!1)}var Al=()=>Ue.enable??(Pe()&&Pe().localStorage?.getItem(Xb))??"",Qb=()=>Ue.diffenable??(Pe()&&Pe().localStorage?.getItem(Zb))??`${Qu}`,Ml="",ec=Qu;function _l(o){ec=`${Qb()}`=="true",Ml!==o&&(Ml=o,wr.clear())}function tc(o){_l(Al()),typeof Pe()<"u"&&Pe().addEventListener&&Pe().addEventListener("storage",function(){_l(Al())});function e(t,n){let r=n?`${n}${Rr}${t}`:t,i=r.split(Rr),a=Ir.get(i);if(a)return a;let l=Ir.get(i.slice(0,-1)),s=(l?l.logFn:Ue.logFn)??oc,u=s,c,d=0,p=()=>c??Ju(r,Ml),f=Yb(Ue.colors),m=Object.defineProperties((...g)=>{let y=Pl.getListenersCount(),h;if(y>0&&(h=h??Date.now(),Pl({color:f,channel:r,args:g,timestamp:h})),p()){if(h=h??Date.now(),d&&ec){let S=h-d;u(`%c[${r}]`,`color: ${f}`,`+${S}ms:`)}d=h;let b=[],T;if(g.forEach(S=>{if(S[qu])T===void 0&&(T=!0),b.push(...S);else{if(typeof S!="string"&&typeof S!="number"){T=!1;return}b.push(`${S}%s`)}}),T){let S=[`%c[${r}]%c %s`,`color: ${f}`,"",...b,""];u(...S)}else u(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...y)=>{let h=[`%c${y.join(" ")}%c%s`,`color: ${g}`,""];return h.toString=()=>y.join(" "),h[qu]=!0,h}},extend:{value:g=>e(g,r)},enabled:{get:()=>p(),set:g=>{c=g}},logFn:{configurable:!1,get:()=>u,set:g=>{u=g??s}},destroy:{value:()=>{Ir.delete(i)}}});return Ir.set(i,m),m}return e(o)}var oc=console.log.bind(console),Zu;Object.defineProperty(tc,"enable",{get:()=>Zu,set:o=>{Zu=o,_l(Al())}});var Ue=tc;Ue.colors=Si;Ue.logFn=oc;var Jb=(o,e)=>Pl.onChange(t=>{if(!t)return;let{channel:n,args:r,color:i,timestamp:a}=t;El(n,o)&&e({channel:n,color:i,args:r,timestamp:a})});Ue.onLogIntent=Jb;Ue.isChannelEnabled=Ju;Ue.destroyAll=()=>{Dl(),Dl(Ue.colors),Ir.clear(),wr.clear()};var _t=o=>{let e=Ue(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},Eo=o=>{let e=Ue(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},vr=()=>vr;vr.extend=()=>vr;var yt=class{constructor(e){this.debug=vr,this.error=vr}};var nc=Eo("CSSVariableWatch"),rc=_t("CSSVariableWatch"),ic={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};var eS=o=>{let e=(0,Ol.useRef)(0),t=on.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);hi(o.ref,t,{earlyAttach:!0}),on.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n!=null)return e.current=n,rc(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);nc(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},Pr=o=>{let e=(0,Ol.useRef)(null);eS({...o,ref:e});let t=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`,{allowInts:n=!1}=o;return on.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:ic},on.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};var Nn=require("react");function Ao(){let o=null,e=new Set;return{getSnapshot(){return o},setSnapshot(t){o=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}var so=require("react");function bt(o,e,t){if(o===e)return!0;if(!o||!e)return!1;let n=typeof o;if(n!==typeof e||n!=="object")return!1;var i=Object.keys(o),a=Object.keys(e);t&&(i=i.filter(c=>!t.has(c)),a=a.filter(c=>!t.has(c)));var l=i.length;if(a.length!==l)return!1;for(var s=0;s<l;s++){var u=i[s];if(!(t&&t.has(u))&&(o[u]!==e[u]||!Object.prototype.hasOwnProperty.call(e,u)))return!1}return!0}function ac(o,e,t){let n=(0,so.useRef)(e);n.current=e;let r=(0,so.useRef)(t);r.current=t;let i=(0,so.useRef)(void 0),a=(0,so.useRef)(!1),l=(0,so.useCallback)(()=>{let s=o.getSnapshot(),u=n.current(s);return a.current&&r.current(i.current,u)?i.current:(i.current=u,a.current=!0,u)},[o]);return(0,so.useSyncExternalStore)(o.subscribe,l,l)}function Ti(o,e){return ac(o,e,Object.is)}function _n(o,e){return ac(o,e,bt)}var lc=W(require("react")),Nl;function On(){return Nl||(Nl=lc.createContext(null))}var sc=Ao(),uc=()=>{};function Ci(){let o=On();return(0,Nn.useContext)(o)||void 0}function Ii(){let o=Ci();return(0,Nn.useCallback)(()=>o?.getSnapshot(),[o])}function uo(o){let e=On(),t=(0,Nn.useContext)(e),n=_n(t||sc,t?o:uc);return t?n??void 0:void 0}function Mo(){let o=On(),e=(0,Nn.useContext)(o),n=Ti(e||sc,e?r=>r.masterRowInfo:uc);return e?n:void 0}var Fn=W(require("react")),ot=require("react");function _o(o){if(o==null)return!1;let e=o;return!0}var Oo=require("react");var Ri=require("react"),Ut=()=>{let[o,e]=(0,Ri.useState)(0);return[o,(0,Ri.useCallback)(()=>{e(t=>t+1)},[e])]};var cc=o=>{let e=(0,Oo.useCallback)(o,[]),t=(0,Oo.useRef)(!1),n=(0,Oo.useRef)(!1),r=(0,Oo.useRef)(void 0),[i,a]=Ut();t.current&&(n.current=!0),(0,Oo.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};var wi=require("react");function Fe(o){let e=(0,wi.useRef)(o);return e.current=o,(0,wi.useCallback)(()=>e.current,[])}var vi=require("react"),No=(o,e)=>{let t=(0,vi.useRef)(e===void 0?o:e);return(0,vi.useLayoutEffect)(()=>{t.current=o}),t.current};var Dr={DataSource:{track:"DataSource",labels:{RemoteDataLoad:"Remote data load",TreeUnfilteredTreePaths:"Computing unfiltered tree paths",Filter:"Filter",Sort:"Sort",Group:"Group",LazyGroup:"Lazy group",Tree:"Tree",FlattenTree:"Flatten tree",Flatten:"Flatten groups",PrepareData:"Preparing data",ComputeSelectionCount:"Computing selection count",ComputeSelectionCountLazy:"Computing selection count (lazy)",PrepareRowInfo:"Preparing row info array",DiffRowInfoInStore:"setDataArray diffing in RowInfoStore"}},InfiniteTable:{track:"InfiniteTable",labels:{Render:"Rendering"}},MatrixBrain:{track:"Layout Computations",labels:{ComputeRenderRange:"Computing render range"}},ComponentState:{track:"ComponentState",labels:{PropUpdate:"Prop update"}}};var Fl=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",u=e.track||this.markerDetails.track||"Unknown";return performance.measure(s,{start:t,end:n,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:u,color:r,properties:a.length>0?a.map(c=>[c.name,c.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(Dr).reduce((t,n)=>{let r={start:e.start,end:i=>e.end({...i,track:Dr[n].track,label:i.label}),get label(){let i=Dr[n];return Object.keys(i.labels).reduce((a,l)=>{let s={start:e.start,end:u=>e.end({...u,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=Dr[n];return e.markerDetails.track=i.track,r}}),t},{})}};function it(o){return Fl.create(o)}function dc(o,e){let t=new Set;function n(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(u,c){return t.add(c),u[c]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return o.apply(this,s)}return{fn:n,propertyReads:t}}var Ll=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function xr(o){return o!==void 0}function Fo(o,e){let t=e[o];return xr(t)}var pc=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)};function tS(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=Fo(r,e)?e[r]:e[`default${Ll(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function fc(o,e,t){let{fn:n,propertyReads:r}=dc(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),i=n(e);return r.forEach(a=>t.add(a)),i}function mc(o){let{props:e,initialSetupState:t,propsToForward:n,parentState:r,mapPropsToState:i,propsToStateSet:a}=o,l={};n&&(l=tS(n,e,t));let s={...t,...l};if(i){let u=fc(i,{props:e,state:s,oldState:null,parentState:r},a);return{...s,...u}}return s}function gc(o,e,t){let{getProps:n,getParentState:r,mapPropsToState:i,concludeReducer:a,propsToStateSet:l}=t;if(e.type==="REPLACE_STATE")return e.payload;let s=r?.()??null,u=e.payload.mappedState,c=e.payload.updatedPropsToState,d={...o};if(u&&Object.assign(d,u),i){let f=fc(i,{props:n(),state:d,oldState:o,parentState:s},l);Object.assign(d,f)}return e.type==="ASSIGN_STATE"&&Object.assign(d,e.payload),a?a({previousState:o,state:d,updatedProps:c,parentState:s}):d}function hc(o){let{dispatch:e,getState:t,getProps:n,propsToForward:r,allowedControlledPropOverrides:i,interceptedActions:a,mappedCallbacks:l,notify:s=pc}=o,u=t();return Object.keys(u).reduce((c,d)=>{let p=d;return Object.defineProperty(c,d,{set:m=>{let g=n(),y=t(),h=!0;if(a&&typeof a[p]=="function"&&a[p](m,{actions:c,state:y})===!1&&(h=!1),h){let S=[m],C=`on${Ll(d)}Change`;if(l&&l[p]){let I=l[p](m,y);C=I.callbackName||C,S=I.callbackParams}s(g,C,S)}let b=r[p];typeof b=="function"&&(m=b(m));let T=!!i?.[p];Fo(d,g)&&!T||e({payload:{updatedProps:null,mappedState:{[d]:m}}})}}),c},{})}function yc(o){let{currentProps:e,prevProps:t,state:n,propsToForward:r,propsToStateSet:i}=o,a={},l=0,s={},u=0,c={},d=0;return new Set([...Object.keys(e),...Object.keys(t)]).forEach(f=>{let m=f,g=t[m],y=e[m];if(m!=="children"&&g!==y&&(c[m]={newValue:y,oldValue:g},d++,Fo(m,e)||Fo(m,t)))if(r.hasOwnProperty(f)){let h=y,b=r[f];typeof b=="function"&&(h=b(y)),n[m]!==h&&(a[m]=h,l++)}else i.has(f)&&(s[m]=e[m],u++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:s,updatedPropsToStateCount:u,rawUpdatedProps:c,rawUpdatedPropsCount:d}}var kl;function bc(){return kl||(kl=(0,ot.createContext)(null))}function Ot(o){let e=o.getParentState||(()=>null);function t(r){let[i]=(0,ot.useState)(()=>o.initSetupState?o.initSetupState(r):{}),a=(0,ot.useRef)(new Set),l=(0,ot.useMemo)(()=>o.forwardProps?o.forwardProps(i,r):{},[i]),s=e(),u=Fe(s);function c(){return mc({props:r,initialSetupState:i,propsToForward:l,parentState:s,mapPropsToState:o.mapPropsToState,propsToStateSet:a.current})}let[d]=(0,ot.useState)(c),p=Fe(r),f=(v,P)=>gc(v,P,{getProps:p,getParentState:()=>u?.()??null,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:a.current}),[m,g]=(0,ot.useReducer)(f,d),y=Fe(m),{allowedControlledPropOverrides:h}=o,b=(0,ot.useMemo)(()=>hc({dispatch:g,getState:y,getProps:p,propsToForward:l,allowedControlledPropOverrides:h,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks}),[g,l,h]),T=o.Context??bc(),S=(0,ot.useMemo)(()=>({componentState:m,componentActions:b,getComponentState:y,replaceState:v=>{g({type:"REPLACE_STATE",payload:v})},assignState:v=>{g({type:"ASSIGN_STATE",payload:v})}}),[m,b,y]),C=No(r),I=(0,ot.useRef)(!1);I.current=!1;let R=o.layoutEffect?ot.useLayoutEffect:ot.useEffect;return R(()=>{let v=r,{newMappedState:P,newMappedStateCount:w,updatedPropsToState:x,updatedPropsToStateCount:A,rawUpdatedProps:E,rawUpdatedPropsCount:D}=yc({currentProps:v,prevProps:C,state:m,propsToForward:l,propsToStateSet:a.current});if(A>0||w>0){let _=m.debugId,N=_?it(_).track.ComponentState.label.PropUpdate.start():void 0,L=o.debugName?typeof o.debugName=="function"?`${o.debugName(v)}:rerender`:`${o.debugName}:rerender`:"rerender";_t(L)("Triggered by new values for the following props",...Object.keys(P??{}),...Object.keys(x??{})),N&&N.end({label:L,details:[w>0?{name:"Updated properties",value:Object.keys(P).join(", ")}:void 0,A>0?{name:"Updated props",value:Object.keys(x).join(", ")}:void 0,A>0||x?{name:"Details",value:"The time for this marker is not accurate. The marker is only displayed so you can easily identify the props that triggered the rerender."}:void 0].filter(_o)});let K={payload:{mappedState:w?P:null,updatedPropsToState:A?x:null}};if(I.current=!0,g(K),o.onPropChange){for(var M in E)if(E.hasOwnProperty(M)){let{newValue:j,oldValue:k}=E[M];o.onPropChange({name:M,newValue:j,oldValue:k},r,b,m)}}o.onPropsChange&&D&&o.onPropsChange(E,r,b,m)}}),R(()=>{s!=null&&!I.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),cc(()=>()=>{o.cleanup?.(y())}),{contextValue:S,ContextComponent:T}}return{ManagedComponentContextProvider:Fn.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return Fn.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function Nt(o){return o=o??bc(),Fn.useContext(o)}var Mc=W(require("react"));var ft="Infinite",ke={rootClassName:ft};var Pi=()=>ke;var Sc="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Tc={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var kt="_16lm1iw3b _16lm1iw3c _16lm1iw35",Cc={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},Ln={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Di={1:"_16lm1iw1c",none:"_16lm1iw1d"},Er={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Ic={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Rc={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},wc={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var vc={none:"_16lm1iwd"},Pc={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var xi={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Dc={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var xc={none:"_16lm1iw1x"};var Ec={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var Ac={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function _c(o){let{rootClassName:e}=Pi();return Mc.createElement("div",{...o,className:oe(`${e}Footer`,xi.relative,Ln.flex,Er.row,o.className)})}var De=W(require("react")),bo=require("react"),nm=require("react-dom");function Ei(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}function J(o){return o.slice(4,-1)}var Oc=W(require("react")),ze=o=>{let e=o.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...o.style};return Oc.createElement("svg",{viewBox:"0 0 24 24",...o,style:t},o.children)};var zl=W(require("react"));var Ve={includesOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29","M4 18V15H2V20H22V18Z","M20 14V18H2V20H22V14Z"],startsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"],endsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"],eqOperator:["M19,10H5V8H19V10M19,16H5V14H19V16Z"],neqOperator:["M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"],gtOperator:["M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"],gteOperator:["M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"],ltOperator:["M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"],lteOperator:["M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"],done:["m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"],hidden:["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"],clear:["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 Nc=o=>zl.createElement(ze,{...o},Ve.includesOperator.map(e=>zl.createElement("path",{key:e,d:e})));var Vl=W(require("react"));var Fc=o=>Vl.createElement(ze,{...o},Vl.createElement("path",{d:Ve.endsWithOperator[0]}));var Gl=W(require("react"));var Lc=o=>Gl.createElement(ze,{...o},Gl.createElement("path",{d:Ve.eqOperator[0]}));var Hl=W(require("react"));var kc=o=>Hl.createElement(ze,{...o},Hl.createElement("path",{d:Ve.gteOperator[0]}));var Kl=W(require("react"));var zc=o=>Kl.createElement(ze,{...o},Kl.createElement("path",{d:Ve.gtOperator[0]}));var Bl=W(require("react"));var Vc=o=>Bl.createElement(ze,{...o},Bl.createElement("path",{d:Ve.lteOperator[0]}));var Wl=W(require("react"));var Gc=o=>Wl.createElement(ze,{...o},Wl.createElement("path",{d:Ve.ltOperator[0]}));var jl=W(require("react"));var Hc=o=>jl.createElement(ze,{...o},jl.createElement("path",{d:Ve.neqOperator[0]}));var $l=W(require("react"));var Kc=o=>$l.createElement(ze,{...o},$l.createElement("path",{d:Ve.startsWithOperator[0]}));var ts=W(require("react"));var lt=W(require("react")),Ar=require("react");var kn=W(require("react")),nn=require("react");function oS(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 nS(o){var e=oS(o,"string");return typeof e=="symbol"?e:String(e)}function rS(o,e,t){return e=nS(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function Bc(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 Wc(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bc(Object(t),!0).forEach(function(n){rS(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Bc(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function jc(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var iS=(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},be=o=>{var e=t=>{var n=o.defaultClassName,r=Wc(Wc({},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 u=o.variantClassNames[i][s];u&&(n+=" "+u)}}for(var[c,d]of o.compoundVariants)iS(c,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 jc(o.variantClassNames,t=>jc(t,n=>n.split(" ")[0]))}},e};var $c="_1eexc2a6";var Uc=be({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:[]}),Yc="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",qc=be({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Xc=be({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"]]}),Zc=be({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"]]}),Qc="_12zfob12u _16lm1iw22 _16lm1iw1z";var Jc="_12zfob17",ed="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",td=be({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Ul=be({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),od="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",nd=be({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),rd="_12zfob1b _16lm1iw2",id="_16lm1iw1",ad="_12zfob16",ld=be({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),sd="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var Pt="InfiniteIcon";var ud="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var cd={transition:"width 0.25s, opacity 0.25s"},xP=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});function zn(o){let[e,t]=(0,nn.useState)(!0),[n,r]=(0,nn.useState)(0),{lineWidth:i=1,style:a,className:l,index:s}=o,u=s!=null&&s>0,c=o.size??16,d=Math.floor(c/4),p=[c-1*d,c-2*d,c-3*d],f={...cd,borderTop:`${i}px solid currentColor`,...o.lineStyle,opacity:n};if((0,nn.useEffect)(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),(0,nn.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return kn.createElement("div",{"data-name":"filter-icon",style:{...a,width:c},className:oe(l,Pt,ud,`${Pt}-filter`)},u?kn.createElement("div",{"data-name":"index",style:m,className:Jc},s):null,kn.createElement("div",{style:{width:p[0],...f}}),kn.createElement("div",{style:{width:p[1],...f}}),kn.createElement("div",{style:{width:p[2],...f}}))}var Ai=Object.freeze({}),aS={string:Ai,number:{}};function Vn(o,e){let t=e.default||Ai;return o.type===void 0?t:o.type===null?Ai:typeof o.type=="string"?e[o.type]||aS[o.type]||Ai:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var Yl=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=[],u=[];t.forEach((R,v)=>{let P=R.maxSize??r??void 0,w=R.minSize??n??void 0;s.push(w),u.push(P),R.size!=null&&(P!=null&&R.size>P&&(R.size=P),w!=null&&R.size<w&&(R.size=w));let x=R.flex==0?null:R.flex;if(R.size==null&&x==null)throw`Items must specify either a size or a flex property. Item at index ${v} doesn't have either of those.`;x!=null&&(l+=1),a+=x??0,i+=R.size??0});let c=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=c/a,p={},f={},m=0;t.forEach((R,v)=>{if(R.flex!=null){let P=d*R.flex,w=R.maxSize??r??void 0,x=R.minSize??n??void 0,A=!1,E=0;w!=null&&P>w&&(p[v]=!0,A=!0,E=w),x!=null&&P<x&&(f[v]=!0,A=!0,E=x),A&&(m+=1,l-=1,a-=R.flex,c-=E)}}),m&&(d=c/a);let g=[],y=0,h=c,b=a,T=0,S=0,C=[];return{items:t.map((R,v)=>{let P={...R},w=R.maxSize??r??void 0,x=R.minSize??n??void 0,A=0,E=p[v],D=f[v],M=E||D,_=R.size??0;if(R.flex!=null){if(M)D&&(A=x),E&&(A=w);else{y+=1;let N=L=>(w!=null&&L>w&&(L=w),x!=null&&L<x&&(L=x),L);y===l?A=N(h):(A=N(Math.round(R.flex*d)),S+=A,h=c-S,b-=R.flex,d=h/b)}_=A,P.flexSize=A}return g.push(A),C.push(_),P.computedSize=_,T+=_,P}),flexSizes:g,minSizes:s,maxSizes:u,computedSizes:C,remainingSize:Math.round(e-T)}};function Mi(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 ql=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((w,x)=>(w[x]={...o.columnSizing[x]},w),{});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],u=l.id,c=s?.id,d=l.computedWidth,p=l.computedMinWidth,f=l.computedMaxWidth,m=l.computedFlex?"flex":"width",g=s?.computedWidth,y=s?.computedMinWidth,h=s?.computedMaxWidth,b=s?.computedFlex?"flex":"width",T=!1,S=!1,C=r>0?1:-1,{value:I,clamped:R,diff:v}=Mi(d+r,p,f,C);if(o.shareSpaceOnResize){if(s==null)return n[u]={...n[u],[m]:I},S=R==="min",T=R==="max",{adjustedDiff:I-d,reservedWidth:t,columnSizing:n,minReached:S,maxReached:T,constrained:S||T};let{value:w,clamped:x,diff:A}=Mi(g-r,y,h,C);if(R&&x&&(Math.abs(v)>Math.abs(A)?x=!1:R=!1),!(!R&&!x)){if(R){let E=Mi(g-r-v,y,h,C);w=E.value,x=E.clamped,A=E.diff}else if(x){let E=Mi(d+r+A,p,f,C);I=E.value,R=E.clamped,v=E.diff}}n[u]={...n[u],[m]:I},n[c]={...n[c],[b]:w},S=R==="min"||x==="min",T=R==="max"||x==="max"}else n[u]={...n[u],[m]:I},S=R==="min",T=R==="max";let P=I-d;return{adjustedDiff:P,reservedWidth:o.shareSpaceOnResize?t:t-P,columnSizing:n,minReached:S,maxReached:T,constrained:S||T}};function dd(o,e){return o+e}function lS(o){return Object.keys(o).reduce((t,n)=>(t[n]={...o[n]},t),{})}var pd=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((h,b)=>(h[b]={...o.columnSizing[b]},h),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((h,b)=>o.dragHandlePositionAfter-b).reverse(),a=i.map(h=>o.items[h]),l=a.map(h=>h.computedWidth),s=a.map(h=>h.computedFlex?"flex":"width"),u=0,{computedSizes:c}=Yl({items:a.map(h=>(h.resizable===!1&&(u+=h.computedWidth),{maxSize:h.computedMaxWidth,minSize:h.computedMinWidth,flex:h.resizable?h.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(dd,0)+r-u,0)}),d=a.map((h,b)=>c[b]-h.computedWidth),p=!0,f=!0,m=!0,g=[];d.forEach((h,b)=>{let T=a[b];if(!T.resizable){g.push(0);return}let S=s[b],C=l[b],I=lS(n),{maxReached:R,minReached:v,constrained:P,adjustedDiff:w}=ql({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:h,dragHandlePositionAfter:i[b],shareSpaceOnResize:!1,items:o.items,columnSizing:I});n[T.id]={...I[T.id],[S]:C+w},g.push(w),R||(f=!1),v||(p=!1),P||(m=!1)});let y=g.reduce(dd,0);return{minReached:p,maxReached:f,constrained:m,adjustedDiffs:g,adjustedDiff:y,columnSizing:n,reservedWidth:t-y}};var _i;function Lo(){if(_i!=null)return _i;let o=Pe().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),_i=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),_i}var fd=["start",void 0,"end"],md=(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:fd.indexOf(r)-fd.indexOf(i)}),o);function gd(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 Xl(o,...e){return gd(t=>t!=null,o,...e)}function hd(o,e,...t){return gd((n,r)=>!(r in o),e,...t)}var Oi=!0,sS=!0,uS=!0,yd="string",co="unknown";var cS=Eo("getComputedVisibleColumns"),dS=(o,e,t)=>o[t]!==!1,Zl=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1};function rn(o,e){if(o)return o[e]?o[e]:Object.values(o).find(t=>t.field===e)}function pS(o,e){let t=Vn(o,e);return o.sortType?o.sortType:t.sortType?t.sortType:typeof o.type=="string"?o.type:yd}function fS(o,e,t){let r=(Array.isArray(o)?o:o?[o]:[]).flatMap(i=>{let a=i.field??i.groupField;if(!a)return[co];let l=rn(e,a);if(!l)return[co];let s=pS(l,t);return Array.isArray(s)?s:[s]});return r.every(i=>i===co)?co:r.length===1?r[0]:r}function Ql(o,e){let{colType:t,sortable:n,columnDefaultSortable:r}=e,i=o.defaultSortable??t.defaultSortable,a=!!o.groupByForColumn;if(i==null&&!a){let l=o.field??t.field,s=o.valueGetter??t.valueGetter;l==null&&s==null&&(i=!1)}return n??i??r??Oi}var bd=({columns:o,userColumns:e,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,scrollbarWidth:l,columnCssEllipsis:s,columnHeaderCssEllipsis:u,pinnedStartMaxWidth:c,pinnedEndMaxWidth:d,filterValue:p,sortable:f,sortInfo:m,multiSort:g,filterTypes:y=ko,viewportReservedWidth:h,resizableColumns:b,draggableColumns:T,columnDefaultDraggable:S,columnOrder:C,columnPinning:I,editable:R,columnDefaultEditable:v,columnDefaultFilterable:P,columnDefaultGroupable:w,columnDefaultSortable:x,columnSizing:A,columnTypes:E,columnVisibility:D,columnVisibilityAssumeVisible:M,groupBy:_})=>{let N=0,L={};_.forEach((B,ne)=>{B.field&&(L[B.field]=ne)});let O=(p||[]).reduce((B,ne)=>{let{id:ye,field:Te}=ne;return Te&&(B[Te]=ne),ye&&(B[ye]=ne),B},{}),K=md(C===!0?Object.keys(o):C,I),j=K.filter(B=>o[B]?dS(D,M,B):(cS(`Column with id "${B}" specified in columnOrder array cannot be found in the columns map.`),!1)),k=new Map,Q=j.map((B,ne)=>{let ye=o[B];return k.set(B,ne),ye}),G=(m??[]).reduce((B,ne,ye)=>(ne.id?B[ne.id]={sortInfo:ne,index:ye}:ne.field&&(B[ne.field]={sortInfo:ne,index:ye}),B),{});function $(B){let ne=o[B],ye=Vn(ne,E),Te={minWidth:ye?.minWidth,maxWidth:ye?.maxWidth,width:ye?.defaultWidth,flex:ye?.defaultFlex},$e=Xl({width:ne?.defaultWidth,flex:ne?.defaultFlex,minWidth:ne?.minWidth,maxWidth:ne?.maxWidth},A[B]);$e.width!=null&&delete Te.flex,$e.flex!=null&&delete Te.width,$e=Xl(Te,$e);let H=$e.flex??void 0,Xe=$e.minWidth??ne?.minWidth??n,Lt=$e.maxWidth??ne?.maxWidth??r,se=H!=null?void 0:$e.width??(a?void 0:i);return!se&&H==null&&(a?H=a:se=Xe),{size:se,flex:H,minSize:Xe,maxSize:Lt}}let ie=Yl({availableSize:Math.max(t.width-(h??0)-(l??Lo()),0),maxSize:r,minSize:n,items:j.map($)}),{computedSizes:pe,flexSizes:ue,minSizes:le,maxSizes:de}=ie,ce=[],U=[],z=[],q=[];q.length=j.length;let Y=new Map,Z=new Map,X=0,me=0,he=0,ae=null,V=[],F=0,ge=0,xe=0;Q.forEach((B,ne)=>{let ye=j[ne],Te=pe[ne],$e=V[ne]=Zl(ye,I);$e==="start"?F+=Te:$e==="end"?xe+=Te:ge+=Te});let Ee=t.width-xe,Ae=[],Me=new Map;j.forEach((B,ne)=>{let ye=Q[ne];Me.set(B,ye)});let He=[];Object.keys(o).forEach(B=>{let ne=o[B];He.push(B),Me.has(B)||Me.set(B,ne)});let tt=new Map;Me.forEach((B,ne)=>{let ye=k.get(ne);ye==null&&(ye=-1);let Te=ye!=-1,$e=j[ye+1],H=Vn(B,E),Xe=ye,Lt=G[ne]?G[ne]:B.field?G[B.field]??null:null,se=Lt?.sortInfo??null,Ne=!!se,dt=Ne&&se.dir===1,Do=Ne&&!dt,Gu=Lt?.index??-1,Il=Te?{}:$(ne),Hu=Te?pe[ye]:Il.size||0,wb=Te&&ue[ye]||null,vb=Te?le[ye]||0:Il.minSize||0,Pb=Te?de[ye]||1e4:Il.maxSize||1e4,vt=Te?Zl(ne,I):!1,Ku=Te?ye===j.length-1:!1,fi=Xe,Db=Te?vt==="start"?me:vt==="end"?he:N-me:0;vt=="start"?fi=Te?Xe:-1:vt==="end"?fi=Te?Xe-(ce.length+z.length):-1:fi=Te?Xe-ce.length:-1;let xb=Te?vt==="start"||vt===!1?N:Ee+he:-1,Eb=Te?vt!==ae:!1,Ab=Te?Ku||vt!==Zl($e,I):!1,Bu=B.cssEllipsis??H.cssEllipsis??s,Mb=B.headerCssEllipsis??H.cssEllipsis??B.cssEllipsis??H.headerCssEllipsis??u??Bu,mi=Te&&(O[ne]||B.field||B.groupByForColumn)&&(O[ne]||O[B.field||B.groupByForColumn])||null,_b=B.defaultFilterable??H.defaultFilterable??P??!0,Ob=R??B.defaultEditable??H.defaultEditable??v??!1,Rl=B.dataType||H.dataType||(Array.isArray(B.type)?B.type[0]:B.type)||yd,Nb=B.sortType||H.sortType||Rl,Wu=B.filterType||H.filterType||Rl,ju=!1;if(mi!=null&&!mi.disabled){let vl=y[Wu];vl&&(!vl.emptyValues||!vl.emptyValues.includes(mi.filter.value))&&(ju=!0)}let An=B.field??H.field,Fb=B.valueGetter??H.valueGetter,wl=B.defaultGroupable??H.defaultGroupable??w??!!An;An||(wl=!1),B.groupByForColumn&&(wl=!1);let $u=An?L[An]!==void 0:!1,Lb=$u?L[An]:void 0,kb=Ql(B,{colType:H,sortable:f,columnDefaultSortable:x}),zb=B.resizable??H.resizable??b??sS,Ze={colType:H,align:H.align,headerAlign:H.headerAlign,computedVisible:Te,verticalAlign:H.verticalAlign,defaultHiddenWhenGroupedBy:H.defaultHiddenWhenGroupedBy,valueGetter:Fb,valueFormatter:H.valueFormatter,renderValue:H.renderValue,render:H.render,style:H.style,className:H.className,contentFocusable:H.contentFocusable,renderMenuIcon:H.renderMenuIcon,renderSortIcon:H.renderSortIcon,renderRowDetailIcon:H.renderRowDetailIcon,renderSelectionCheckBox:H.renderSelectionCheckBox,renderHeaderSelectionCheckBox:H.renderHeaderSelectionCheckBox,headerStyle:H.headerStyle,headerClassName:H.headerClassName,columnGroup:H.columnGroup,getValueToEdit:H.getValueToEdit,getValueToPersist:H.getValueToPersist,shouldAcceptEdit:H.shouldAcceptEdit,field:An,...B,components:{...H.components,...B.components},computedResizable:zb,computedMinWidth:vb,computedMaxWidth:Pb,computedFlex:wb,computedDataType:Rl,computedEditable:Ob,computedSortType:Nb,computedFilterType:Wu,cssEllipsis:Bu,headerCssEllipsis:Mb,computedFilterValue:mi,computedFiltered:ju,computedFilterable:_b,computedGroupable:wl,computedGroupedBy:$u,computedGroupedByIndex:Lb,computedWidth:Hu,computedAbsoluteOffset:xb,computedPinningOffset:Db,computedVisibleIndexInCategory:fi,computedOffset:N,computedSortable:kb,computedSortInfo:se,computedSortIndex:Gu,computedMultiSort:g,computedSorted:Ne,computedSortedAsc:dt,computedSortedDesc:Do,computedVisibleIndex:Xe,computedPinned:vt,computedDraggable:T??B.defaultDraggable??S??uS,computedFirstInCategory:Eb,computedLastInCategory:Ab,computedFirst:ye===0,computedLast:Ku,id:ne,header:B.header??H.header??B.name??B.field};Te&&(N+=Hu,Y.set(Ze.id,Ze),q[ye]=Ze,vt==="start"&&(ce.push(Ze),me+=Ze.computedWidth),vt==="end"&&(U.push(Ze),he+=Ze.computedWidth),vt||(z.push(Ze),X+=Ze.computedWidth),ae=vt),Ze.groupByForColumn&&(Ze.computedSortType=B.sortType||H.sortType||fS(Ze.groupByForColumn,e,E),Ae.push(Ze)),Z.set(Ze.id,Ze),Ze.field&&!Ze.groupByForColumn&&!tt.has(Ze.field)&&tt.set(Ze.field,Ze)}),Ae.forEach(B=>{B.computedSortable=Sd(B,{fieldsToColumn:tt,userColumns:e,columnTypes:E,sortable:f,columnDefaultSortable:x})});let Qe=new Map;He.forEach(B=>{let ne=Z.get(B);ne&&Qe.set(B,ne)}),Z.forEach(B=>{Qe.has(B.id)||Qe.set(B.id,B)});let rt=c!=null?Math.min(c,me):me,Je=d!=null?Math.min(d,he):he;return{computedRemainingSpace:t.width-(F+xe+ge),computedPinnedStartColumnsWidth:me,computedPinnedEndColumnsWidth:he,computedUnpinnedColumnsWidth:X,computedColumnOrder:K,computedPinnedStartColumns:ce,computedPinnedEndColumns:U,computedUnpinnedOffset:me,computedPinnedEndOffset:me+X,computedUnpinnedColumns:z,computedVisibleColumns:q,computedColumnsMap:Z,computedColumnsMapInInitialOrder:Qe,computedVisibleColumnsMap:Y,computedPinnedEndWidth:Je,computedPinnedStartWidth:rt,renderSelectionCheckBox:q.reduce((B,ne)=>B||!!ne.renderSelectionCheckBox,!1),fieldsToColumn:tt}};function Sd(o,e){let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r,userColumns:i,columnTypes:a}=e;if(t)return t;let l=o.defaultSortable??o.colType.defaultSortable;if(l!=null)return l;let s=r??Oi,u=o.sortType??o.colType.sortType;return u!=null&&u!==co&&s?!0:d=>{let{column:p,api:f}=d,m=p.groupByForColumn||[];return m!=null&&!Array.isArray(m)&&(m=[m]),(m||[]).reduce((g,y)=>{if(!g)return!1;let h=y.field||y.groupField,b;if(h){let T=n.get(h),S=T?f.getColumnApi(T.id):void 0;if(T&&S)b=S.isSortable();else{let C=rn(i,h);if(C){let I=Ql(C,{colType:Vn(C,a??{}),sortable:t,columnDefaultSortable:r});b=typeof I=="boolean"?I:void 0}else b=!1}}return b===void 0&&y.valueGetter&&(b=!0),b??r??Oi},!0)}}function mt(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)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function an(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:u}=e,c=a(),{allRowsSelected:d,someRowsSelected:p,selectionMode:f}=c,m=i(),g=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let y=mt(n.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:u});g=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:y,dataSourceApi:u,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 Td=W(require("react"));var Gn=`${ft}HeaderCell__filter`,Ni=`${ft}HeaderCell__filterOperator`,nD=`${Gn}__input`;var Jl=Td.createContext(null);var Id=require("react");var Cd=require("react"),es;function Fi(){return es||(es=(0,Cd.createContext)(null))}function re(o){let e=Fi(),t=(0,Id.useContext)(e);return _n(t,o)}function Ke(){return re(o=>({getState:o.getState,actions:o.actions,getComputed:o.getComputed,getDataSourceState:o.getDataSourceState,dataSourceApi:o.dataSourceApi,dataSourceActions:o.dataSourceActions,api:o.api,getDataSourceMasterContext:o.getDataSourceMasterContext}))}var mS=`${Gn}__input`,Li=o=>o.stopPropagation();function Rd(o){let{filterOperatorMenuVisibleForColumnId:e}=re(c=>({filterOperatorMenuVisibleForColumnId:c.state.filterOperatorMenuVisibleForColumnId})),{column:t}=Mr(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=(0,Ar.useState)(!1),l=lt.useCallback(()=>{a(!0)},[]),s=lt.useCallback(()=>{a(!1)},[]),u=e===t.id||i;return lt.createElement("div",{onPointerUp:Li,onPointerDown:Li,onFocus:l,onBlur:s,className:`${Gn} ${Ul({active:u})}`,style:{height:o.columnHeaderHeight}},lt.createElement(Jl.Provider,{value:o},lt.createElement(r,null),lt.createElement(n,null)))}function wd(){let{columnApi:o,disabled:e,operator:t}=Hn(),n=t?.components?.Icon??zn;return lt.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&o.toggleFilterOperatorMenu(r.target)},className:oe(Ni,ed,e?`${Ni}--disabled`:"")},lt.createElement(n,{size:20,className:`${td({disabled:e})}`}))}function vd(){return lt.createElement("div",{onPointerUp:Li,onPointerDown:Li,className:`${Gn} ${Ul({active:!1})} ${Ic["50%"]}`})}function Hn(){let o=Ke(),{column:e,columnApi:t}=Mr(),n=an(e,o,"column-filter"),r=lt.useContext(Jl),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[u,c]=(0,Ar.useState)(l?.filter.value??""),d=lt.useCallback(y=>{c(y),r.onChange(y)},[r.onChange]),p=lt.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),f=lt.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);(0,Ar.useEffect)(()=>{if(l)u!==l.filter.value&&c(l.filter.value);else if(s){let y=[...s.emptyValues][0];y!==u&&c(y)}},[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:u,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${n}`,className:`${Qc} ${mS}`}}function Kn(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Hn();return ts.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function ki(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Hn();return ts.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})}var Yt=(o,e)=>{let t=o?.[e];return t?{components:{Icon:t}}:{}};function Pd(o={}){let{StringFilterEditor:e,NumberFilterEditor:t,icons:n}=o;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:e?{FilterEditor:e}:void 0,operators:[{name:"includes",...Yt(n,"includes"),label:"Includes",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&typeof i=="string"&&r.toLowerCase().includes(i.toLowerCase())},{label:"Equals",...Yt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&r===i},{name:"startsWith",...Yt(n,"startsWith"),label:"Starts With",fn:({currentValue:r,filterValue:i})=>r.startsWith(i)},{name:"endsWith",...Yt(n,"endsWith"),label:"Ends With",fn:({currentValue:r,filterValue:i})=>r.endsWith(i)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:t?{FilterEditor:t}:void 0,operators:[{label:"Equals",...Yt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>r==i},{label:"Not Equals",...Yt(n,"neq"),name:"neq",fn:({currentValue:r,filterValue:i})=>r!=i},{name:"gt",label:"Greater Than",...Yt(n,"gt"),fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>i},{name:"gte",...Yt(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>=i},{name:"lt",...Yt(n,"lt"),label:"Less Than",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<i},{name:"lte",...Yt(n,"lte"),label:"Less Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<=i}]}}}var ko=Pd({StringFilterEditor:Kn,NumberFilterEditor:ki,icons:{includes:Nc,eq:Lc,neq:Hc,startsWith:Kc,endsWith:Fc,gt:zc,gte:kc,lt:Gc,lte:Vc}});function zi(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 Un=require("react"),pp=require("react-dom");function zo(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 Dd(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 ee={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 xd="true",fe={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)"}}},Ed="column-header-height";var Ad=`.${ke.rootClassName}`;function os(o){return zo(o,Ad)}var Md=J(ee.scrollLeft),gS=J(ee.scrollTop),hS=J(ee.columnWidthAtIndex),ns=J(ee.columnOffsetAtIndex),_d=J(ee.columnReorderEffectDurationAtIndex),yS=J(ee.columnOffsetAtIndexWhileReordering),bS=J(ee.columnVisibilityAtIndex),SS=J(ee.columnZIndexAtIndex);function qt(o,e,t){let n=t?os(t):document.querySelector(Ad);TS(o,e,n)}function TS(o,e,t){if(t){let n=o,r=ee[n]?J(ee[n]):o;t.style.setProperty(r,`${e}`)}}function Bn(o,e){if(e)for(var t in o){let n=ee[t]?J(ee[t]):t,r=`${o[t]}`;e.style.setProperty(n,r)}}function rs(o,e,t){qt(`${ns}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${Md}))`:`${o.computedAbsoluteOffset+e}px`,t)}function is(o,e,t){qt(`${SS}-${o}`,`${e}`,t)}function _r(o,e,t){qt(`${yS}-${o}`,typeof e=="number"?`calc( var(${ns}-${o}) + ${e}px )`:e,t)}function Or(o,e,t){qt(`${bS}-${o}`,e,t)}function Vi(o,e,t){qt(`${_d}-${o}`,t??"",e)}function as(o,e){let t=`${_d}-${o}`;qt(t,fe.components.Cell.reorderEffectDuration,e)}var Ie={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${hS}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,qt(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`${ns}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,qt(this.varName.get(o),e,t)}}};function Od(o,e){Bn({[Md]:`${o.scrollLeft}px`,[gS]:`${o.scrollTop}px`},e)}var Nd="_16lm1iw1",Fd="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",Ld="_1yeub2vs",kd="_1yeub2vr",zd=be({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 ls="_1yeub2vp";var ZD=be({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var Ud=require("react");var Nr={bodyWidth:{name:J(fe.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:J(fe.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:J(fe.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:J(fe.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:J(fe.runtime.browserScrollbarWidth),value:""}},CS=J(ee.scrollbarWidthHorizontal),Vd=J(ee.scrollbarWidthVertical),IS=J(ee.columnWidthAtIndex),RS=J(ee.columnZIndexAtIndex),Gd=J(ee.scrollLeft),wS=J(ee.activeCellColWidth),Hd=J(ee.activeCellColOffset),jd=J(ee.baseZIndexForCells),vS=J(ee.pinnedStartWidth),Kd=J(ee.bodyWidth),PS=J(ee.bodyHeight),Bd=J(ee.pinnedEndOffset),Wd=J(ee.pinnedEndWidth),DS=J(ee.computedVisibleColumnsCount);function Gi(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(${jd}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function $d(o){let{computedVisibleColumns:e,computedPinnedStartColumns:t,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:r,computedPinnedEndColumnsWidth:i,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:s,brain:u,scrollbars:c}=o,d=Lo(),p=[],f=e.reduce((m,g)=>{let y=g.computedVisibleIndex;m[Ie.columnWidths.varName.get(y)]=g.computedWidth+"px",m[Ie.columnOffsets.varName.get(y)]=g.computedPinned==="start"?`calc( ${g.computedOffset}px + var(${Gd}) )`:g.computedPinned==="end"?`calc( var(${Bd}) ${p.length?"+":""} ${p.map(b=>Ie.columnWidths.get(b.computedVisibleIndex)).join(" + ")} + var(${Gd}) )`:`${g.computedOffset}px`;let h=Gi(g,{pinnedStartColsCount:t.length,visibleColsCount:e.length});return m[`${RS}-${y}`]=`${h}`,g.computedPinned==="end"&&p.push(g),m},{});if(l.width&&(f[Nr.browserScrollbarWidth.name]=`${Lo()}px`),f[Nr.bodyWidth.name]=`calc(${ee.bodyWidth} - ${ee.scrollbarWidthVertical})`,f[Nr.totalVisibleColumnsWidthValue.name]=`${r+i+a}px`,f[Nr.totalVisibleColumnsWidthVar.name]=`calc(${e.map((m,g)=>`var(${IS}-${g})`).join(" + ")})`,f[Nr.visibleColumnsCount.name]=e.length,s!=null){f[wS]=Ie.columnWidths.get(s[1]);let m=Ie.columnOffsets.get(s[1]);if(u.isHorizontalLayoutBrain){let g=u.getPageIndexForRow(s[0]);f[Hd]=g?`calc( ${fe.runtime.totalVisibleColumnsWidthVar} * ${g} + ${m})`:m}else f[Hd]=m}return f[DS]=e.length,f[CS]=c.horizontal?`${d}px`:"0px",f[Vd]=c.vertical?`${d}px`:"0px",f[vS]="calc( "+t.map(m=>Ie.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Wd]="calc( "+n.map(m=>Ie.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[jd]=e.length*10,f[Bd]=`calc( var(${Kd}) - var(${Wd}) - var(${Vd}) )`,f[Kd]=`${l.width}px`,f[PS]=`${l.height}px`,f}var ss=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};function Yd(o){let{actions:e,getState:t,focused:n,focusedWithin:r,domRef:i,scrollerDOMRef:a,onBlurWithin:l,onFocusWithin:s,onSelfFocus:u,onSelfBlur:c,bodySize:d,activeCellIndex:p,wrapRowsHorizontally:f,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedPinnedStartColumns:y,computedPinnedEndColumns:h,computedVisibleColumns:b,computedUnpinnedColumnsWidth:T,scrollbars:S,focusedClassName:C,focusedWithinClassName:I,computedPinnedStartOverflow:R,computedPinnedEndOverflow:v,focusedStyle:P,focusedWithinStyle:w,brain:x}=re(O=>{let{state:K,computed:j}=O;return{brain:K.brain,actions:O.actions,getState:O.getState,focused:K.focused,focusedWithin:K.focusedWithin,domRef:K.domRef,scrollerDOMRef:K.scrollerDOMRef,onBlurWithin:K.onBlurWithin,onFocusWithin:K.onFocusWithin,onSelfFocus:K.onSelfFocus,onSelfBlur:K.onSelfBlur,bodySize:K.bodySize,activeCellIndex:K.activeCellIndex,wrapRowsHorizontally:K.wrapRowsHorizontally,computedPinnedStartColumnsWidth:j.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:j.computedPinnedEndColumnsWidth,computedPinnedStartColumns:j.computedPinnedStartColumns,computedPinnedEndColumns:j.computedPinnedEndColumns,computedVisibleColumns:j.computedVisibleColumns,computedUnpinnedColumnsWidth:j.computedUnpinnedColumnsWidth,scrollbars:j.scrollbars,focusedClassName:O.state.focusedClassName,focusedWithinClassName:O.state.focusedWithinClassName,computedPinnedStartOverflow:j.computedPinnedStartOverflow,computedPinnedEndOverflow:j.computedPinnedEndOverflow,focusedStyle:O.state.focusedStyle,focusedWithinStyle:O.state.focusedWithinStyle}}),A=(0,Ud.useMemo)(()=>$d({computedVisibleColumns:b,computedPinnedStartColumns:y,computedPinnedEndColumns:h,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedUnpinnedColumnsWidth:T,bodySize:d,activeCellIndex:p,brain:x,scrollbars:S}),[b,y,h,m,g,T,d,p,x,S]),E=ss(O=>{e.focused=O}),D=ss(O=>{e.focusedWithin=O}),N={...o,onFocus:O=>{if(o?.onFocus?.(O),O.target===i.current||O.target===a.current){if(t().focused)return;E(!0),u?.(O),r&&(D(!1),l?.(O));return}r||(D(!0),s?.(O))},onBlur:O=>{if(o?.onBlur?.(O),O.target===i.current||O.target===a.current){if(!t().focused)return;E(!1),c?.(O),r&&(D(!1),l?.(O));return}i.current?.contains(O.relatedTarget)||(D(!1),l?.(O))}},L=oe(Xt,Fd,f?`${Xt}--horizontal-layout`:null,N?.className,m?`${Xt}--has-pinned-start ${kd}`:null,g?`${Xt}--has-pinned-end ${Ld}`:null,n?`${Xt}--focused`:null,r?`${Xt}--focused-within`:null,n&&C?C:null,r&&I?I:null,R?`${Xt}--has-pinned-start-overflow`:null,v?`${Xt}--has-pinned-end-overflow`:null,zd({horizontalLayout:!!f,hasPinnedStart:!!m,hasPinnedEnd:!!g,focused:n,focusedWithin:r}));return N.className=L,N.style={...o?.style,...A},n&&P&&Object.assign(N.style,P),r&&w&&Object.assign(N.style,w),N}var np=W(ln());function Hi(o){return o.map(e=>e instanceof Vo?e:new Vo(null,[e]))}var Vo=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=>xS(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 xS(o,e){return typeof o=="string"||typeof o=="number"?`${o}`:e?o.__get(e):o.done()}var ES=(...o)=>new Vo("+",Hi(o)),Xd=(...o)=>new Vo("-",Hi(o)),AS=(...o)=>new Vo("*",Hi(o)),MS=(...o)=>new Vo("/",Hi(o)),Fr={add:ES,subtract:Xd,minus:Xd,multiply:AS,divide:MS};var sn=(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 Ge=Pe().requestAnimationFrame||(o=>setTimeout(o,16)),zt=Pe().cancelAnimationFrame||(o=>clearTimeout(o));var Zd=o=>{let e=null,t=null;return{stop(){e!==null&&zt(e),t!=null&&zt(t)},scroll(n){e!==null&&zt(e),t!=null&&zt(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 c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft-p,e=Ge(()=>{i.scroll(n)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft+p,t=Ge(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var We=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 Qd(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Jd(o,e){return Math.sqrt((e.top-o.top)**2+(e.left-o.left)**2)}function _S(o,e,t){let n=Qd(o,t),r=Qd(e,t);return n===r?Jd(t,e)-Jd(t,o):n-r}function ep(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)=>_S(n,r,t)),e}function OS(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 NS(o,e){if(o.length<2)return o[0]?o[0].left===e.left&&o[0].top===e.top:!1;o=ep(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 tp(o,e){if(OS(o))return NS(o,e);o=ep(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(FS([t,i,a],e))return!0}return!1}function FS(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 Wn=class{containsPoint(e){return tp(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 jn=class o extends Wn{static clone(e){return new o(e)}constructor(e){super(),this.points=e.map(We.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function LS(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,u=Math.max(l,s);return new Re({top:n,left:t,width:a-t,height:u-n})}var Re=class o extends Wn{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=LS(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 jn(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(We.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var op=10,kS=J(ee.pinnedStartWidth);function rp(o){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:u,tableRect:c,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:y,horizontalLayoutPageIndex:h,pageWidth:b}=o;function T(z){let q=z==="start"?L:O;return M===N?q:N===z?q+E.computedWidth:M===z?q-E.computedWidth:q}function S(z){if(z.columnIndex===D||h!=null)return!0;let q=e[z.columnIndex];if(q.computedPinned)return!0;let Y=l.getScrollPosition().scrollLeft,Z=q.computedOffset+(h!=null&&b!=null?b*h:0);return Z>=Y+T("start")&&Z+q.computedWidth<=Y+c.width-T("end")}let C=(z,q)=>{let{restrictToParentGroup:Y,dragColumn:Z}=q,X=[];if(z.forEach(he=>{if(he.computedVisibleIndex===D)return;let ae={columnId:he.id,columnIndex:he.computedVisibleIndex,offsetX:he.computedOffset+Math.round(he.computedWidth/2)};S(ae)&&X.push(ae)}),Y){let ae=function(F,ge,xe){let Ee=z[F];Ee&&(Ee.columnGroup!==Z.columnGroup&&xe.add(Ee.id),ae(F+ge,ge,xe))};var me=ae;let he=Z.computedVisibleIndex,V=new Set;ae(he-1,-1,V),ae(he+1,1,V),X=X.filter(F=>!V.has(F.columnId))}return X},R=r.length,v={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},P={left:v.clientX-c.left-(v.clientX-s.left)+op,top:v.clientY-c.top-(v.clientY-s.top)+op},w=l.getScrollPosition(),x=e.map(z=>z.computedVisibleIndex),A=x,E=t.get(i),D=E.computedVisibleIndex,M=E?.computedPinned,_=D,N=M,L=l.getFixedStartColsWidth(),O=l.getFixedEndColsWidth(),K=v,j={x:0,y:0},k=1,Q=0;function G(z){let q=Math.round(z.clientX),Y=Math.round(z.clientY);if(q===K.clientX&&Y===K.clientY)return Re.from(s).shift({left:j.x,top:j.y});K={clientX:q,clientY:Y};let X=l.getScrollPosition().scrollLeft-w.scrollLeft;return j.x=K.clientX-v.clientX,j.y=K.clientY-v.clientY,Q=j.x+X,k=Q<0?-1:1,f({left:P.left+j.x,top:P.top+j.y}),Re.from(s).shift({left:j.x,top:j.y})}function $(z){let q=0;M?M==="start"&&z.forEach((Y,Z)=>{q||e[Y]?.computedPinned!=="start"&&(q=Z)}):z.forEach((Y,Z)=>{e[Y]?.computedPinned==="start"&&(q=Z+1)}),R=q,ie("start",z,q)}function ie(z,q,Y){if(z==="start"){let Z=0;for(let X=0;X<Y;X++){let me=q[X],he=e[me];Z+=he.computedWidth}qt(kS,`${Z}px`,a)}}function pe(z){if(z==null||z===_)return;if(_===-1&&z!==-1&&(Or(D,"",a),m(!1)),_=z,z===-1){ue(D);return}let q=sn(x,D,_>D?_-1:_);R=0;let Z=new Set;return q.forEach((X,me)=>{let he=A[me];X!==he&&Z.add(X),$(q)}),A=q,le(Z),{newColumnIndexes:q,indexesWithTransition:Z,pinnedStartCount:R}}function ue(z){A=A.filter(Y=>Y!==z),e.forEach(Y=>{let Z=Y.computedVisibleIndex,X=Z>z;as(Z,a);let me="";X&&(me=Fr.minus(Ie.columnOffsets.get(Z),Ie.columnWidths.get(z)).done()),_r(Z,me,a)}),Or(z,"hidden",a),m(!0)}function le(z){e.forEach(q=>{let Y=q.computedVisibleIndex;z.has(Y)?as(Y,a):Vi(Y,a);let Z=Y===D,X=k===-1?Y<_||Y>D:Y<D||Y>=_,me="";k===-1?me=Z?Ie.columnOffsets.get(_):X?Ie.columnOffsets.get(Y):Fr.add(Ie.columnOffsets.get(Y),Ie.columnWidths.get(D)).done():me=X?Ie.columnOffsets.get(Y):Z?Fr.add(Ie.columnOffsets.get(_-1),Ie.columnWidths.get(_-1)).minus(Ie.columnWidths.get(D)).done():Fr.minus(Ie.columnOffsets.get(Y),Ie.columnWidths.get(D)).done(),_r(Y,me,a)})}let de=c.left+T("start"),ce=c.right-T("end"),U=Zd({scrollOffsetStart:de,scrollOffsetEnd:ce});return G(v),{speedScroller:U,stop(){U.stop()},onMove(z){let q=G(z);if(g().dropTargetListId==="grouping-toolbar"||p&&!d.containsPoint(q.getCenter()))return p&&pe(-1),null;U.scroll({mousePosition:K,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(ae){y.scrollLeft=ae}});let Y=C(e,{dragColumn:E,restrictToParentGroup:u==="group"}),Z=k===-1?E.computedOffset+Q:E.computedOffset+E.computedWidth+Q,X=(0,np.default)(Y,Z,({offsetX:ae},V)=>ae<V?-1:ae>V?1:0);X<0&&(X=~X),Y.length?X=Y[X]?Y[X].columnIndex:Y[Y.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),X=0),X===D+1&&(X=D),pe(X);let me={};n.forEach(ae=>{me[ae.id]="end"});for(let ae=0;ae<R;ae++){let V=A[ae],F=e[V];me[F.id]="start"}let he=A.map(ae=>e[ae].id);return{columnPinning:me,columnOrder:he}}}}function us(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],u=n.indexOf(s),c=n.indexOf(r);return sn(n,c,u)}else{let l=e.indexOf(r),s=e[l+1],u=n.indexOf(s),c=n.indexOf(r);return sn(n,c,u)}return e}var Tt=W(require("react"));var un=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 ip=W(ln());var ap=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:u,dragIndex:c,dragRectangle:d}=n,p=u===a,f=We.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(),y=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)),b=(0,ip.default)(y,h,(R,v)=>R-v);b<0&&(b=~b),m===1&&b===c+1&&p&&b--;let T=Math.min(c,b),S=Math.max(c,b),C=p?i.map((R,v)=>{if(v===c&&p)return t;if(v<T||v>=S)return{left:0,top:0};let P=b<=v?1:-1;return r==="horizontal"?{left:Math.round(P*g.width),top:0}:{left:0,top:Math.round(P*g.height)}}):i.map((R,v)=>{let P=b<=v?1:0;return r==="horizontal"?{left:Math.round(P*g.width),top:0}:{left:0,top:Math.round(P*g.height)}}),I={offset:t,dropIndex:b,dragSourceListId:u,dropTargetListId:a,dragIndex:c,outside:!1,items:i,dragItem:s,offsetsForItems:C,dragRect:g,status:"accepted"};return e.acceptsDrop(I)?{event:I,error:null,success:!0}:(I.status="rejected",{event:I,error:"rejected by interaction target",success:!1})},lp=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:u,listId:c}=n,d=We.from(s.getCenter()),p=c===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(),y={offset:t,dropIndex:-1,dragIndex:m,dragItem:u,outside:!f,items:l,dragSourceListId:c,dropTargetListId:i,offsetsForItems:p?l.map((h,b)=>h.id===u.id?t:f?{left:0,top:0}:b>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-u.rect.width,top:0}:{left:0,top:-u.rect.height}:{left:0,top:0}):l.map(h=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(y)?{event:y,error:null,success:!0}:(y.status="rejected",{event:y,error:"rejected by interaction target",success:!1})};var we=class we{static startDrag(e,t){let n=e instanceof $n?e:new $n(e),r=new cs({activeDragSource:n,startPoint:t});return we.currentDragOperation=r,r.on("start",we.onDragStart),r.on("move",we.onDragMove),r.on("drop",we.onDragDrop),r.start(),r}static retriggerMove(){let e=we.currentDragOperation;e&&e.phase==="move"&&we.onDragMove(e)}static emit(e,...t){we.emitter.emit(e,...t)}static on(e,t){return we.emitter.on(e,t)}static registerDragInteractionTarget(e){if(we.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} already registered`);return}return we.dragInteractionTargetsMap.set(e.listId,e),we.emit("register",e),()=>{we.unregisterDragInteractionTarget(e)}}static unregisterAll(){we.dragInteractionTargetsMap.forEach(e=>{we.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(e){if(!we.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} not found`);return}we.dragInteractionTargetsMap.delete(e.listId),e.unregister(),we.emit("unregister",e)}}static onDragStart(e){let{dragItem:t,dragIndex:n}=e.activeDragSource,r=e.activeDragSource.listId,a=we.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;we.dragInteractionTargetsMap.forEach(u=>{let c=u.getData();u.start({dragIndex:c.listId===r?n:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),we.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=we.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(we.dragInteractionTargetsMap.get(r))),we.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let u=ap(e,s);if(u){t(s,u),i.splice(i.indexOf(s),1);break}}a||i.unshift(l);for(let s of i){let u=lp(e,s);u&&t(s,u)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];we.withDragMove(e,(u,{event:c})=>{u.move(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null,s=l?.dropTargetListId??null;we.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=[];we.withDragMove(e,(s,{event:u})=>{s.drop(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null;we.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}),we.currentDragOperation=null,we.unregisterAll()}};we.dragInteractionTargetsMap=new Map,we.currentDragOperation=null,we.emitter=new un;var St=we,$n=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){bt(this.data,e)||(this.data=e,this.dragRectangle=new Re(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let n=o.clone(e),r=Re.from(n.dragRectangle);return r.shift(t),n.dragRectangle=r,n}},cs=class extends un{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=$n.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=$n.shift(this.initialDragSource,n),this.currentOffset=n,this.emit("move",this)}};globalThis.DragManager=St;var sp=require("react"),up=Tt.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:o=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),po=()=>Tt.useContext(up),Ki=o=>{let[e,t]=Tt.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),n=Tt.useRef(e);n.current=e;let r=Tt.useCallback(()=>{let a=n.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=Tt.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return(0,sp.useEffect)(()=>{let a=St.on("drag-start",u=>{t({dragSourceListId:u.dragSourceListId,dropTargetListId:u.dropTargetListId,dragItemId:u.dragItem.id,status:"accepted"})}),l=St.on("drag-move",u=>{let c=n.current,d={dragSourceListId:u.dragSourceListId,dropTargetListId:u.dropTargetListId,dragItemId:u.dragItem.id,status:u.status};JSON.stringify(c)!==JSON.stringify(d)&&t(d)}),s=St.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[St,t]),Tt.createElement(up.Provider,{value:i},typeof o.children=="function"?o.children(i):o.children)};var ds=`${ft}Body`,cp=o=>o.querySelector(`.${ds}`);var cn=`${ft}HeaderCell`,ps=`${ft}HeaderWrapper`,dp=o=>Array.from(o.querySelectorAll(`.${ps}`));function Bi(o){if(!o)return!1;let e=o.tagName;return e==="INPUT"||e==="BUTTON"}var zS=J(ee.baseZIndexForCells),VS=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:bt(o,e)},fp=({columnId:o,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n})=>{let[r,i]=(0,Un.useState)(null),[a,l]=(0,Un.useState)(!1),{getCurrentDragSourceAndTarget:s}=po(),{getComputed:u,getState:c,api:d,computedDraggable:p,rootRef:f,actions:m}=re(h=>({actions:h.actions,getComputed:h.getComputed,getState:h.getState,api:h.api,computedDraggable:h.computed.computedVisibleColumnsMap.get(o)?.computedDraggable,rootRef:h.state.domRef})),g=(0,Un.useCallback)(h=>{let b=u().computedVisibleColumnsMap.get(o);if(!b||!b.computedSortable)return;let{multiSortBehavior:T}=c();d.toggleSortingForColumn(o,{multiSortBehavior:T==="replace"&&(h.ctrlKey||h.metaKey)?"append":T})},[]),y=(0,Un.useCallback)(h=>{if(Bi(h.target))return;let{brain:b,draggableColumnsRestrictTo:T}=c(),{computedVisibleColumns:S,computedVisibleColumnsMap:C,computedPinnedStartColumns:I,computedUnpinnedColumns:R,computedPinnedEndColumns:v}=u(),P=C.get(o);if(!P.computedDraggable){g(h);return}let w=e.current,x=w.getBoundingClientRect(),A=f.current.getBoundingClientRect(),E=b.getAvailableSize(),D=P.computedVisibleIndex,M=b.getVirtualColIndex(P.computedVisibleIndex,{pageIndex:t||0}),_=b.isHorizontalLayoutBrain?b.getPageWidth():null,N=w.style.cursor??"auto",L=!1,O=f.current,K=Re.from(cp(O).getBoundingClientRect()),j=dp(O).map(de=>Re.from(de.getBoundingClientRect())),k=K.getMinimumBoundingRectangle(...j),Q=rp({brain:b,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n,pageWidth:_,draggableColumnsRestrictTo:T,computedPinnedEndColumns:v,computedPinnedStartColumns:I,computedUnpinnedColumns:R,computedVisibleColumns:S,computedVisibleColumnsMap:C,dragColumnHeaderTargetRect:x,dragColumnId:o,getCurrentDragSourceAndTarget:s,api:d,infiniteDOMNode:f.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:A,acceptDropToReorderRect:k,initialMousePosition:{clientX:h.clientX,clientY:h.clientY}}),G=null,$,ie;function pe(de){let{columnPinning:ce,columnOrder:U}=de;VS(c().columnPinning,ce)||(m.columnPinning=ce);let z=u().computedColumnOrder;JSON.stringify(U,z)&&(m.columnOrder=us({newColumnOrder:U,visibleColumnOrder:u().computedVisibleColumns.map(q=>q.id),existingColumnOrder:z,dragColumnId:o}))}let ue=de=>{let{headerBrain:ce,brain:U}=c();if(!L){L=!0;let z=U.keepColumnRendered(M),q=ce.keepColumnRendered(M);if(U.isHorizontalLayoutBrain){let Z=U.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),X=ce.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ie=()=>{Z(),X()}}$=()=>{z(),q()},m.columnReorderDragColumnId=P.id,t!=null&&(m.columnReorderInPageIndex=t),is(D,`calc( var(${zS}) + 10000 )`,f.current),f.current?.classList.add(ls),w.style.cursor="grabbing"}G=Q.onMove(de)},le=de=>{let ce=de.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:U}=c(),z=f.current;z?.classList.remove(ls),Q.stop(),b.update({...E}),$?.(),ie?.(),w.style.cursor=N,w.hasPointerCapture?.(ce)&&w.releasePointerCapture(ce),w.removeEventListener("pointermove",ue),w.removeEventListener("pointerup",le),i(null);let q=d.getColumnApi(P.id)?.isSortable()??!1;!L&&q&&d.toggleSortingForColumn(P.id,{multiSortBehavior:U==="replace"&&(de.ctrlKey||de.metaKey)?"append":U}),(0,pp.flushSync)(()=>{G?pe(G):L&&n&&d.setVisibilityForColumn(P.id,!1),m.columnReorderDragColumnId=!1,t!=null&&(m.columnReorderInPageIndex=null)}),S.forEach(Y=>{Vi(Y.computedVisibleIndex,z),Or(Y.computedVisibleIndex,"",z),_r(Y.computedVisibleIndex,"",z)}),is(D,Gi(P,{pinnedStartColsCount:I.length,visibleColsCount:S.length}),z)})};w.addEventListener("pointermove",ue),w.addEventListener("pointerup",le),w.setPointerCapture(h.pointerId)},[o,t]);return{onPointerDown:p?y:g,dragColumnOutside:a,proxyPosition:r}};var qn=W(require("react"));var Ce=W(require("react")),Le=require("react");var gp=Symbol("REPAINT_CELLS_KEY_NO_ROW");function hp(o){return typeof o=="function"}function mp(o,e){let{column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i}=e,a=r.getRowInfoAtIndex(n);if(!a)return gp;let l=r.getDataSourceStates();return o({rowInfo:a,column:t,dataSourceState:l.dataSourceState??i(),previousDataSourceState:l.previousDataSourceState})}function yp(o,e,t){let n=mp(o,e);return e.rowInfoStore.subscribeToDataArrayChange(()=>{let r=mp(o,e);r!==gp&&(Object.is(r,n)||(n=r,t()))})}var bp="_1eexc2a7 _1eexc2a6",Sp=be({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"]]}),Tp=be({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 Cp="_1eexc2a5",Wi=be({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),ji="_1eexc2a8";var $i=W(require("react")),Ui=require("react");var Ip="qz8ht90 _16lm1iwk";function GS(){return{checked:1,disabled:o=>o??!1,domProps:1}}var{ManagedComponentContextProvider:HS}=Ot({forwardProps:GS,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function KS(){let{componentState:o,componentActions:e}=Nt(),{checked:t,domProps:n,disabled:r}=o,i=(0,Ui.useRef)(null);return(0,Ui.useEffect)(()=>{i.current.indeterminate=t==null},[t]),$i.createElement("input",{...n,className:oe("InfiniteCheckBox",Ip,n?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function fo(o){return $i.createElement(HS,{...o},$i.createElement(KS,null))}var Lr=W(require("react")),Pp=require("react");var Rp="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",wp=be({defaultClassName:"_96uiwi1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_96uiwi3"},direction:{end:"_96uiwi4",start:"_96uiwi5"},disabled:{true:"_96uiwi6",false:"_96uiwi7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var vp="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",$E=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var Yi=`${Pt}-expand-collapse`;function dn(o){let{size:e=24,direction:t="start",disabled:n=!1}=o,[r,i]=(0,Pp.useState)(o.expanded??o.defaultExpanded),a=()=>{o.onChange?.(!r),Fo("expanded",o)||i(!r)};Lr.useEffect(()=>{Fo("expanded",o)&&i(o.expanded)},[o.expanded]);let l=r?"expanded":"collapsed";return Lr.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:oe(o.className,Rp,wp({direction:t||"start",expanded:r,disabled:n}),`${Pt}`,`${Yi}`,`${Yi}--${l}`,`${Yi}--${t==="end"?"end":"start"}`,n?`${Yi}--disabled`:"")},Lr.createElement("path",{d:vp}))}function Dp(o){return typeof o.field=="string"}function xp(o){let{column:e,rowInfo:t,fieldsToColumn:n}=o,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];(Array.isArray(e.groupByForColumn)||e.groupByForColumn===i)&&(r=i?n.get(i.field||i.groupField):void 0)}!r&&e.field&&(r=n.get(e.field))}return r}function Zt(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),u=s[r],{isGroupRow:c,isTreeNode:d}=u,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=n(),y=r===f&&m==="row",h=!g||typeof g=="function"&&!g(u)?!1:a.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",{formattedValue:b,formattedValueContext:{rawValue:T}}=Yn({column:p,rowInfo:u,rowDetailState:h,columnsMap:e().computedColumnsMap,context:o}),S=mt(p.id,o);return c?{api:a,dataSourceApi:l,column:p,columnApi:S,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:u.data,rowActive:y,rowInfo:u,rowSelected:u.rowSelected,value:b,rawValue:T}:d?u.isParentNode?{api:a,dataSourceApi:l,columnApi:S,column:p,nodeExpanded:u.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:h,data:u.data,rowActive:y,rowInfo:u,rowSelected:u.rowSelected,value:b,rawValue:T}:{api:a,dataSourceApi:l,columnApi:S,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:h,data:u.data,rowActive:y,rowInfo:u,rowSelected:u.rowSelected,value:b,rawValue:T}:{api:a,dataSourceApi:l,columnApi:S,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:h,data:u.data,rowActive:y,rowInfo:u,rowSelected:u.rowSelected,value:b,rawValue:T}}function Ep(o){return Mp(o.column,o.rowInfo)}function Ap(o){let{column:e,context:t,rowInfo:n,visibleColumnIds:r}=o,i=xp({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=Yn(o),{formattedValueContext:u}=s,c=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:c,rowHasSelectedCells:!1},u,{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:c,stylingParam:d,formattedValueContext:u,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:BS({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:p,verticalAlign:f,formattedValueContext:u}),groupByColumnReference:i}}function BS(o){let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:u}=o,{value:c}=u,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:y}=n,h=p(),{selectionMode:b,cellSelection:T}=h,S=xp({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),C=d.toggleGroupRow,I=T?.isCellSelected(n.id,e.id)??!1,R={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:I,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...u,editError:g&&g.primaryKey===n.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:S,selectionMode:b,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 c=="boolean"?`${c}`:c,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:y,toggleGroupRow:C,toggleCurrentGroupRow:()=>{n.isGroupRow&&C(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(R,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),R}function WS(o,e){if(!o.isGroupRow)return;let t=o.groupData;if(!t.length)return;let n=t[0][e];for(let r=1,i=t.length;r<i;r++)if(t[r][e]!==n)return;return n}function Mp(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:Dp(o)?t?.[o.field]:null;return o.field&&e.isGroupRow&&e.reducerData&&e.reducerData[o.field]!=null&&(a=e.reducerData[o.field]),a===void 0&&e.isGroupRow&&o.groupByForColumn&&Dp(o)&&(a=WS(e,o.field)),o.valueGetter&&!e.isGroupRow&&e.data&&(a=o.valueGetter({data:e.data,field:o.field})),a}function jS(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.getState(),u=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:u,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:u,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:u,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:o,rawValue:o,field:e.field}}function Yn(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=Mp(e,t),a=jS(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var _p=be({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Op="_7pupv00",Np=be({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Fp}=ke,mo=`${Fp}Cell`,kr=`${Fp}Cell_content`;var{rootClassName:$S}=ke,Qt=`${$S}ColumnCell`;var US=J(ee.columnZIndexAtIndex),YS=J(ee.columnVisibilityAtIndex);function Lp({rowInfo:o,column:e}){let t=0;if(o.dataSourceHasGrouping)if(o.isGroupRow){let n=e?.groupByForColumn,r=o.groupBy[o.groupBy.length-1],i=!!o.pivotValuesMap,a=i&&!!e?.field&&!!n&&!Array.isArray(n)&&(n.field??n.groupField)!==(r?.field??r?.groupField),l=i&&Array.isArray(n)&&o.groupNesting===o.rootGroupBy.length;t=a||l?o.groupNesting:o.groupNesting-1}else t=o.groupNesting;return{[J(fe.components.Row.groupNesting)]:t}}function kp({rowInfo:o}){return{[J(fe.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function fs(o,e){return o?typeof o=="function"?o(e):o:void 0}function ms(o,e,t){return typeof e=="function"?{...o,...e(t)}:{...o,...e}}function zp(o){let{column:e,rowInfo:t,rowIndex:n,rowHeight:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:l,verticalAlign:s,stylingParam:u,formattedValueContext:c,groupByColumnReference:d,rowStyle:p,rowClassName:f,cellStyle:m,cellClassName:g,showZebraRows:y,rowActive:h,rowDisabled:b,rowSelected:T,cellSelected:S,cellSelection:C,getData:I,computedVisibleColumns:R,visibleColumnIds:v,computedColumnOrder:P,columnReorderInPageIndex:w}=o,x=v??R.map(ue=>ue.id),A=P,E,D={...c,visibleColumnIds:x,allColumnIds:A,rowIndex:n,get rowHasSelectedCells(){return E===void 0&&(E=t.hasSelectedCells(x)),E}},M=!!(t.isTreeNode&&(e.renderTreeIcon||e.renderTreeIconForLeafNode||e.renderTreeIconForParentNode)),_=typeof f=="function"?f(D):f,N;d?.className&&(N=fs(d.className,u)),g&&(N=oe(N,fs(g,u))),e.className&&(N=oe(N,fs(e.className,u))),M&&(N=oe(N,Np({align:l})));let L;t.dataSourceHasGrouping&&e.groupByForColumn&&(L=Lp({rowInfo:t,column:e})),M&&(L=kp({rowInfo:t})),p&&(L=typeof p=="function"?{...L,...p(D)}:{...L,...p}),m&&(L=ms(L,m,u)),d?.style&&(L=ms(L,d.style,u)),e.style&&(L=ms(L,e.style,u)),L=L||{},L.height=r,L.zIndex=`var(${US}-${e.computedVisibleIndex})`,L.visibility=`var(${YS}-${e.computedVisibleIndex}, visible)`;let O=i!=null?i%2===1:(t.indexInAll!=null?t.indexInAll:n)%2===1,K=y?O?"odd":"even":!1,j=!1,k=!1,Q=!1,G=!1;if(C&&S){let ue=I(),le=ue[t.indexInAll-1],de=ue[t.indexInAll+1],ce=R[e.computedVisibleIndex+1],U=R[e.computedVisibleIndex-1];j=le?!C.isCellSelected(le.id,e.id):!0,e.computedPinned==="end"&&e.computedFirstInCategory?k=!0:k=U?!C.isCellSelected(t.id,U.id):!0,e.computedPinned==="start"&&e.computedLastInCategory?Q=!0:Q=ce?!C.isCellSelected(t.id,ce.id):!0,G=de?!C.isCellSelected(de.id,e.id):!0}let $=C&&S?{top:j,left:k,right:Q,bottom:G}:null,ie=w!=null?a!==w:!1,pe=oe($?Tp($):"",zi(e,[Qt,mo],Sp,{dragging:!1,insideDisabledDraggingPage:ie,zebra:K,align:l,verticalAlign:s,rowDisabled:b,rowActive:h,cellSelected:S,rowSelected:T,treeNode:t.isTreeNode?t.isParentNode?"parent":"leaf":!1,firstRow:t.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:t.isGroupRow,groupCell:t.isGroupRow?!!e.groupByForColumn:!1,rowExpanded:t.isGroupRow?!t.collapsed:!1}),N,_);return{style:L,className:pe,cellSelectionBorders:$,zebra:K,columnIsTree:M}}var go=W(require("react"));var qS=J(ee.columnWidthAtIndex),XS=J(ee.columnReorderEffectDurationAtIndex);function ZS(o){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:u,afterChildren:c,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:g,...y}=o,h=typeof m=="function"?m():m,b={width:`var(${qS}-${i.computedVisibleIndex})`,transition:`transform var(${XS}-${i.computedVisibleIndex}, 0s)`,...y.style},T={...y,style:b,"data-column-id":i.id,"data-z-index":b.zIndex,className:oe(y.className,mo,bp),children:go.createElement(go.Fragment,null,d,go.createElement("div",{className:oe(kr,e?kt:Pc.hidden,s),style:r},h),c)};u!=null&&(T["data-row-id"]=`${u}`);let S=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return S?go.createElement(S,{...T,ref:a}):go.createElement("div",{...T,ref:a})}var qi=go.memo(ZS);var fn=W(require("react")),pn=require("react");function Vp(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=Xi(),i=(0,pn.useRef)(null),a=(0,pn.useRef)(!1),l=fn.useCallback(c=>{i.current=c,c&&c.focus()},[]),s=(0,pn.useCallback)(c=>{let{key:d}=c;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,n()):c.stopPropagation()},[]),u=(0,pn.useCallback)(()=>{a.current||t()},[]);return fn.createElement(fn.Fragment,null,fn.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:u,className:oe(Sc,vc.none),type:"text",defaultValue:o,onChange:(0,pn.useCallback)(c=>{e(c.target.value)},[])}))}function Gp(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}var zr=Ce.createContext(null),QS=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return Ce.createElement(dn,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},JS={display:"inline-block",visibility:"visible"},gs=o=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:n,api:r}=o,i=r.getDataSourceState().isNodeReadOnly;return Ce.createElement(dn,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:JS,expanded:n,onChange:t})},eT=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(),u=l.getDataSourceState().isNodeSelectable,c=s?.CheckBox||fo;return Ce.createElement(c,{domProps:{className:ji},disabled:e.isTreeNode?!u(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 tT(o){let{repaintCellsKey:e,column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i}=o,[,a]=(0,Le.useReducer)(s=>s+1,0),l=hp(e)?e:void 0;(0,Le.useEffect)(()=>{if(l)return yp(l,{column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i},a)},[l,t,n,r,i])}function oT(o){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:n,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,visibleColumnIds:s,computedColumnOrder:u,cellStyle:c,cellClassName:d,repaintCellsKey:p,rowDetailState:f,width:m,column:g,onMouseLeave:y,onMouseEnter:h,onRowMouseEnter:b,onRowMouseLeave:T,rowIndex:S,rowHeight:C,columnsMap:I,fieldsToColumn:R,domRef:v,hidden:P,showZebraRows:w,getDataSourceState:x,dataSourceApi:A,dataSourceActions:E,getState:D,imperativeApi:M,componentActions:_,getComputed:N,getDataSourceMasterContext:L}=o,O=(0,Le.useSyncExternalStore)((0,Le.useCallback)(se=>t.subscribeToRowIndex(S,se),[t,S]),(0,Le.useCallback)(()=>t.getRowInfoAtIndex(S),[t,S]));tT({repaintCellsKey:p,column:g,rowIndex:S,rowInfoStore:t,getDataSourceState:x});let K=!O,j=!g,k=Ce.useRef(null),Q=(0,Le.useCallback)(se=>{k.current=se,v&&v(se)},[v]),G=O??{id:"",indexInAll:S,rowSelected:!1,rowDisabled:!1,isCellSelected:()=>!1,hasSelectedCells:()=>!1,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,treeNesting:0,nodePath:[],collapsed:!1,dataSourceHasGrouping:!1,selfLoaded:!0,data:{}},{rowSelected:$}=G,ie=N(),{activeRowIndex:pe,keyboardNavigation:ue,columnReorderInPageIndex:le}=D(),de=S===pe&&ue==="row",ce={getState:D,getDataSourceState:x,getDataSourceMasterContext:L,actions:_,dataSourceActions:E,api:M,dataSourceApi:A},U=G.rowDisabled,z=Ap({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:g,rowInfo:G,rowDetailState:f,columnsMap:I,visibleColumnIds:s,fieldsToColumn:R,context:ce}),{stylingParam:q,renderParams:Y,formattedValueContext:Z,renderFunctions:X,groupByColumnReference:me,inEdit:he}=z,{align:ae,verticalAlign:V}=Y,F=Y,ge=Ce.useRef(F),xe=b&&h?se=>{let dt={...Z,rowIndex:S};b(dt,se),h(se)}:h,Ee=T&&y?se=>{let Ne={...Z,rowIndex:S,rowInfo:G};T(Ne,se),y(se)}:y,Ae=(0,Le.useCallback)(se=>{let Ne=g.computedVisibleIndex;D().cellClick({rowIndex:S,colIndex:Ne,event:se})},[S,g.computedVisibleIndex,ue]),Me=(0,Le.useCallback)(se=>{let Ne=g.computedVisibleIndex;if(D().cellMouseDown({rowIndex:S,colIndex:Ne,event:se}),ue==="row"){U||(_.activeRowIndex=S);return}ue==="cell"&&(_.activeCellIndex=[S,Ne])},[S,U,g.computedVisibleIndex,ue]),{selectionMode:He,cellSelection:tt,isNodeReadOnly:Qe}=e,rt=F.cellSelected;F.domRef=Q,F.htmlElementRef=k,F.toggleCurrentTreeNode=(0,Le.useCallback)(F.toggleCurrentTreeNode,[G]),F.selectCell=(0,Le.useCallback)(F.selectCell,[G]),F.deselectCell=(0,Le.useCallback)(F.deselectCell,[G]),F.selectCurrentRow=(0,Le.useCallback)(F.selectCurrentRow,[G]),F.deselectCurrentRow=(0,Le.useCallback)(F.deselectCurrentRow,[G]),F.toggleCurrentGroupRow=(0,Le.useCallback)(F.toggleCurrentGroupRow,[G]),F.toggleCurrentRowSelection=(0,Le.useCallback)(F.toggleCurrentRowSelection,[G]),F.toggleCurrentGroupRowSelection=(0,Le.useCallback)(F.toggleCurrentGroupRowSelection,[G]),F.toggleCurrentTreeNodeSelection=(0,Le.useCallback)(F.toggleCurrentTreeNodeSelection,[G]);let Je=g.components?.Editor??Vp,qe=he?Ce.createElement(Kp,{contextValue:F},Ce.createElement(Je,null)):null,B=(0,Le.useCallback)(pt(()=>{if(P||he)return null;if(ge.current=F,X.renderGroupIcon&&(F.renderBag.groupIcon=Ce.createElement(Ct,{render:X.renderGroupIcon,renderParam:{...F,renderBag:{...F.renderBag}}})),X.renderSelectionCheckBox&&He=="multi-row"&&(F.renderBag.selectionCheckBox=Ce.createElement(Ct,{render:eT,renderParam:F}),X.renderSelectionCheckBox!==!0&&(F.renderBag.selectionCheckBox=Ce.createElement(Ct,{render:X.renderSelectionCheckBox,renderParam:{...F,renderBag:{...F.renderBag}}}))),G.isTreeNode){let{isParentNode:dt}=G,Do;Do=(dt?X.renderTreeIconForParentNode:X.renderTreeIconForLeafNode)||typeof X.renderTreeIcon=="function"?X.renderTreeIcon:dt&&X.renderTreeIcon===!0?gs:void 0,Do===!0?Do=gs:Do&&(F.renderBag.treeIcon=Ce.createElement(Ct,{render:gs,renderParam:F})),Do&&(F.renderBag.treeIcon=Ce.createElement(Ct,{render:Do,renderParam:{...F,renderBag:{...F.renderBag}}}))}X.renderRowDetailIcon&&(F.renderBag.rowDetailsIcon=Ce.createElement(Ct,{render:QS,renderParam:{...F,renderBag:{...F.renderBag}}}),typeof X.renderRowDetailIcon=="function"&&(F.renderBag.rowDetailsIcon=Ce.createElement(Ct,{render:X.renderRowDetailIcon,renderParam:{...F,renderBag:{...F.renderBag}}}))),X.renderValue&&(F.renderBag.value=Ce.createElement(Ct,{render:X.renderValue,renderParam:{...F,renderBag:{...F.renderBag}}})),G.isGroupRow&&X.renderGroupValue&&(F.renderBag.value=Ce.createElement(Ct,{render:X.renderGroupValue,renderParam:{...F,renderBag:{...F.renderBag}}})),!G.isGroupRow&&X.renderLeafValue&&(F.renderBag.value=Ce.createElement(Ct,{render:X.renderLeafValue,renderParam:{...F,renderBag:{...F.renderBag}}})),ge.current=F;let se=F.renderBag.value;se instanceof Date&&(se=se.toLocaleDateString());let Ne=Ce.createElement(Ce.Fragment,null,ae!=="end"?F.renderBag.treeIcon:null,ae!=="end"?F.renderBag.groupIcon:null,ae!=="end"?F.renderBag.rowDetailsIcon:null,ae!=="end"?F.renderBag.selectionCheckBox:null,se,ae==="end"?F.renderBag.selectionCheckBox:null,ae==="end"?F.renderBag.rowDetailsIcon:null,ae==="end"?F.renderBag.groupIcon:null,ae==="end"?F.renderBag.treeIcon:null);return g.render?Ce.createElement(Ct,{render:g.render,renderParam:{...F,renderBag:{...F.renderBag,all:Ne}}}):Ne}),[g,P,he,f,g.renderTreeIcon||g.renderTreeIconForParentNode?Qe:!1,...Gp(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})]),{style:ne,className:ye}=zp({column:g,rowInfo:G,rowIndex:S,rowHeight:C,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:ae,verticalAlign:V,stylingParam:q,formattedValueContext:Z,groupByColumnReference:me,rowStyle:n,rowClassName:r,cellStyle:c,cellClassName:d,showZebraRows:w,rowActive:de,rowDisabled:U,rowSelected:$,cellSelected:rt,cellSelection:tt,getData:l,visibleColumnIds:s,computedVisibleColumns:ie.computedVisibleColumns,computedColumnOrder:u,columnReorderInPageIndex:le}),Te=(0,Le.useMemo)(()=>ne,[ne?JSON.stringify(ne):null]),$e=qe,H=B(),Xe={domRef:Q,cellType:"body",column:g,width:m,rowId:G.id,horizontalLayoutPageIndex:a,style:Te,onMouseLeave:Ee,onMouseEnter:xe,onClick:Ae,afterChildren:$e,onMouseDown:Me,cssEllipsis:g.cssEllipsis??!0,className:ye,renderChildren:(0,Le.useCallback)(()=>H,[B])},Lt=zr.Provider;return j||K?Ce.createElement("div",{ref:Q,style:{display:"none"}}):Ce.createElement(Lt,{value:ge.current},Ce.createElement(qi,{...Xe}))}var Hp=Ce.memo(oT);function Vr(){return(0,Le.useContext)(zr)}function Xi(){let{api:o,editingValueRef:e,editingCell:t}=re(f=>({api:f.api,editingCell:f.state.editingCell,editingValueRef:f.state.editingValueRef})),{column:n,rowInfo:r}=Vr(),[i]=Ce.useState(()=>t?.value),[a,l]=Ce.useState(i),s=t?!t.active&&!!t.waiting:!1,u=Ce.useCallback(f=>{e.current=f,l(f)},[]);Ce.useLayoutEffect(()=>{e.current=i},[]);let c=o.confirmEdit,d=o.cancelEdit,p=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:u,confirmEdit:c,cancelEdit:d,rejectEdit:p}}function Gr(o){return o.render(o.renderParam)??null}function Ct(o){let e=zr.Provider;return qn.createElement(e,{value:o.renderParam},qn.createElement(Gr,{render:o.render,renderParam:o.renderParam}))}function Kp(o){let e=zr.Provider;return qn.createElement(e,{value:o.contextValue},o.children)}function Go(o){let e=Zi.Provider;return qn.createElement(e,{value:o.renderParam},qn.createElement(Gr,{render:o.render,renderParam:o.renderParam}))}var Ho=W(require("react"));var Hr=Ei({"data-name":""}),Kr={[Hr["data-name"]]:"menu-icon"},eM=`[${Hr["data-name"]}="${Kr["data-name"]}"]`;var nT={width:"100%",pointerEvents:"none"},hs=`${Pt}-menu`;function Br(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l={...nT,borderTop:`${fe.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle};return Ho.createElement("div",{...n,style:e,...Kr,onPointerDown:s=>s.stopPropagation(),className:oe(t,nd({menuVisible:i,reserveSpaceWhenHidden:r}),Pt,`${Pt}-menu`)},a??Ho.createElement(Ho.Fragment,null,Ho.createElement("div",{className:hs,style:l}),Ho.createElement("div",{className:hs,style:l}),Ho.createElement("div",{className:hs,style:l})))}var Xn=W(require("react")),Wr=require("react");var Bp="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Wp={transition:"width 0.25s, opacity 0.25s"},fM=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});function Qi(o){let[e,t]=(0,Wr.useState)(!0),[n,r]=(0,Wr.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:u}=o,c=u!=null&&u>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={...Wp,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:n};(0,Wr.useEffect)(()=>{let h=i!=0?1:0;if(!e&&h&&t(!0),h!==n){let b=requestAnimationFrame(()=>{r(h)});return()=>{cancelAnimationFrame(b)}}return()=>{}},[i,e]);let g=()=>{let b=!(n===0&&i===0);b!==e&&t(b)};if(!e&&!o.forceSize)return null;let y={};return i===-1&&(y.top="100%"),Xn.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:oe(s,Pt,Bp,`${Pt}-sort`)},c?Xn.createElement("div",{"data-name":"index",style:y,className:ad},u):null,Xn.createElement("div",{style:{width:f[0],...m},onTransitionEnd:g}),Xn.createElement("div",{style:{width:f[1],...m}}),Xn.createElement("div",{style:{width:f[2],...m}}))}var qp=W(require("react")),ys=require("react");function jp(o){let{context:e,column:t,diff:n,shareSpaceOnResize:r}=o,i=e.getState(),{columnSizing:a,viewportReservedWidth:l,bodySize:s}=i,u=e.getComputed().computedVisibleColumns,c=!1,d=u.reduce((f,m)=>(m.computedFlex&&(f[m.id]={...a[m.id],flex:m.computedWidth},c=!0),f),{}),p=c?{...a,...d}:a;return ql({shareSpaceOnResize:r,availableSize:s.width,reservedWidth:l||0,dragHandleOffset:n,dragHandlePositionAfter:t.computedVisibleIndex,columnSizing:p,items:u.map(f=>({id:f.id,computedFlex:f.computedFlex,computedWidth:f.computedWidth,computedMinWidth:f.computedMinWidth,computedMaxWidth:f.computedMaxWidth}))})}var jr=require("react"),$r=W(require("react"));function $p(o,{columns:e,shareSpaceOnResize:t,domRef:n}){let r=e[o];return{resize(i){Ie.columnWidths.set(o,r.computedWidth+i,n.current);let a=o+1;if(t){let l=e[a];if(!l)return;Ie.columnWidths.set(a,l.computedWidth-i,n.current),l.computedPinned==="start"?rs(l,i,n.current):Ie.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 u=e[l];if(u.computedPinned==="start"){rs(u,i,n.current);continue}u.computedPinned!=="end"&&Ie.columnOffsets.set(l,u.computedOffset+i,n.current)}return}for(let l=a,s=e.length;l<s;l++){let u=e[l];u.computedPinned||Ie.columnOffsets.set(l,u.computedOffset+i,n.current)}}}}}function Up(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,u=i.current;if(n.forEach((c,d)=>{s+=c;let p=o[d],f=r[p],m=f.computedWidth+c;Ie.columnWidths.set(p,m,u),f.computedPinned!=="end"&&(l&&Ie.columnOffsets.set(p,l,u),l+=m)}),a.computedPinned!=="end")for(let c=t+1;c<r.length;c++){let d=r[c];d.computedPinned!=="end"&&Ie.columnOffsets.set(c,d.computedOffset+s,u)}}}}var Ji="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",ea=be({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw23 _16lm1iw2a",variantClassNames:{constrained:{false:"zneyzhd",true:"zneyzhe"},computedPinned:{start:"zneyzhf",end:"zneyzhg",false:"zneyzhh"},computedFirstInCategory:{true:"zneyzhi",false:"zneyzhj"},computedLastInCategory:{true:"zneyzhk",false:"zneyzhl"}},defaultVariants:{},compoundVariants:[[{computedPinned:"start",computedLastInCategory:!0,computedFirstInCategory:!1},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0,computedLastInCategory:!1},"zneyzhn"]]}),ta=be({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:rT}=ke,iT=`${rT}HeaderCell_ResizeHandle`;function aT(o){let{brain:e,headerBrain:t}=re(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),n=(0,jr.useRef)(null),[r,i]=(0,jr.useState)(!1),a=(0,jr.useRef)(r);a.current=r;let l=o.columns[o.columnIndex],s=o.horizontalLayoutPageIndex;if(!l)return null;let u=l.computedPinned,c=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let y=!!g.shiftKey,h=g.pointerId,b=g.clientX,T=g.target;if(e.isHorizontalLayoutBrain){let v=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),P=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{v(),P()}}T.setPointerCapture(h);let S=$p(o.columnIndex,{columns:o.columns,shareSpaceOnResize:y,domRef:n}),C=(v,{done:P}={})=>{s&&(v=v/(s+1),P&&(v=Math.round(v))),u==="end"&&(v*=-1);let{adjustedDiff:w,constrained:x}=o.computeResize({diff:v,shareSpaceOnResize:y});return a.current!==x&&i(x),S.resize(w),w},I=v=>{C(Math.round(v.clientX-b))},R=v=>{T.releasePointerCapture(h),T.removeEventListener("pointermove",I),T.removeEventListener("pointerup",R);let P=Math.round(v.clientX-b),w=C(P,{done:!0});p(),o.onResize({diff:w,shareSpaceOnResize:y})};T.addEventListener("pointermove",I),T.addEventListener("pointerup",R)},m=(u===!1||u==="start")&&d?{right:u==="start"?void 0:0}:u==="end"&&c?{right:void 0}:void 0;return $r.createElement("div",{ref:n,className:`${iT} ${Ji} ${ta({computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}`,onPointerDown:f},$r.createElement("div",{style:m,className:ea({constrained:r,computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}))}var Yp=$r.memo(aT);function Xp(o,e){let{computedVisibleColumns:t,getState:n,getComputed:r,actions:i}=re(u=>({computedVisibleColumns:u.computed.computedVisibleColumns,getState:u.getState,getComputed:u.getComputed,actions:u.actions})),a=(0,ys.useCallback)(({diff:u,shareSpaceOnResize:c})=>jp({context:{getState:n,getComputed:r},column:o,diff:u,shareSpaceOnResize:c}),[o,n,r]),l=(0,ys.useCallback)(({diff:u,shareSpaceOnResize:c})=>{let{columnSizing:d,reservedWidth:p}=a({diff:u,shareSpaceOnResize:c});c||(i.viewportReservedWidth=p),i.columnSizing=d},[a,i]);return o.computedResizable?qp.createElement(Yp,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:o.computedVisibleIndex,computeResize:a,onResize:l}):null}var Ye=W(require("react"));var Jt=require("react");var Zp=be({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),Qp=be({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function Jp(o,e){return bt(o,e)}var Zn=class extends un{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 Jp(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return Jp(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}adjustForScroll(t){this.breakpoints=this.breakpoints.map(n=>n-t),this.data.orientation==="vertical"?this.data.listRectangle.shift({top:-t,left:0}):this.data.listRectangle.shift({top:0,left:-t})}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let 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:u}=t,c=Array.from({length:i.length},(f,m)=>m),d=[];n===-1?d=c.filter(f=>f!==r):d=sn(c,r,n>r?n-1:n);let p={dragIndex:r,dropIndex:n,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:u,status:t.status};this.emit("drop",p)}};var lT={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:o=>o**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function sT(o,e){let t=getComputedStyle(o),n=e==="vertical"?t.overflowY:t.overflowX;return n!=="auto"&&n!=="scroll"?!1:e==="vertical"?o.scrollHeight>o.clientHeight:o.scrollWidth>o.clientWidth}function uT(o,e){let t=o;for(;t&&!(t===document.documentElement||t===document.body);){if(sT(t,e))return t;t=t.parentElement}return null}function cT(o,e){return{startScrollingFrom:o*e.startFromPercentage,maxScrollValueAt:o*e.maxScrollAtPercentage}}var of=1;function ef(o,e,t){if(o>e.startScrollingFrom)return 0;if(o<=e.maxScrollValueAt)return t.maxPixelScroll;if(o===e.startScrollingFrom)return of;let r=1-(o-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function dT(o,e,t){let{accelerateAt:n,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return o;if(i<n)return of;let a=(i-n)/(r-n);return Math.ceil(o*t.ease(a))}function tf(o,e,t,n,r,i,a){if(o<e||o>t)return 0;let l=cT(n,r),s=o-e,u=t-o,c=u<s,d;return c?d=ef(u,l,r):d=-ef(s,l,r),d===0?0:a?(d>0?1:-1)*dT(Math.abs(d),i,r):d}var mn=class{constructor(e){this.scrollContainer=null;this.rafId=null;this.lastPointer={left:0,top:0};this.dragStartTime=0;this.shouldUseDampening=!1;this.active=!1;this.maxScrollTop=0;this.maxScrollLeft=0;this.orientation=e.orientation,this.onScroll=e.onScroll,this.config={...lT,...e.config}}start(e){this.scrollContainer=uT(e,this.orientation),this.scrollContainer&&(this.maxScrollTop=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight,this.maxScrollLeft=this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth),this.dragStartTime=Date.now(),this.shouldUseDampening=!0,this.active=!0}getScrollContainer(){return this.scrollContainer}updatePointer(e){this.lastPointer=e,!this.rafId&&this.active&&this.scheduleScroll()}scheduleScroll(){this.rafId=requestAnimationFrame(()=>{if(this.rafId=null,!this.active||!this.scrollContainer)return;let e=this.computeScroll();if(e.top===0&&e.left===0)return;let t={top:this.scrollContainer.scrollTop,left:this.scrollContainer.scrollLeft},n=Math.max(0,Math.min(this.maxScrollTop,t.top+e.top)),r=Math.max(0,Math.min(this.maxScrollLeft,t.left+e.left));this.scrollContainer.scrollTop=n,this.scrollContainer.scrollLeft=r;let i={top:this.scrollContainer.scrollTop-t.top,left:this.scrollContainer.scrollLeft-t.left},a=i.top!==0||i.left!==0;a&&this.onScroll(i),this.active&&a&&this.scheduleScroll()})}computeScroll(){if(!this.scrollContainer)return{top:0,left:0};let e=this.scrollContainer.getBoundingClientRect();if(this.orientation==="vertical"){if(this.lastPointer.left<e.left||this.lastPointer.left>e.right)return{top:0,left:0}}else if(this.lastPointer.top<e.top||this.lastPointer.top>e.bottom)return{top:0,left:0};let t=0,n=0;return this.orientation==="vertical"?t=tf(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):n=tf(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:n}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var af=Ye.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),gn=()=>Ye.useContext(af),pT=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)`},fT=o=>`${o.getAttribute(It)}`;function bs(o,e){let t=o.current?.querySelectorAll(sf)??[];return Array.from(t).filter(r=>r.getAttribute(Ur)===`${e}`)}function mT(o,e){let t=bs(o,e);return!t||t.length,Array.from(t).map(r=>{let i=fT(r),a=r.getBoundingClientRect();return{id:i,rect:a}})}function gT(o){let{domRef:e,orientation:t,dragListId:n}=o,r=mT(e,n),i=e.current.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,u=i.right;for(let p of r){let f=p.rect;f.top<a&&(a=f.top),f.left<l&&(l=f.left),f.bottom>s&&(s=f.bottom),f.right>u&&(u=f.right)}let c=Re.from({top:a,left:l,width:u-l,height:s-a});return{draggableItems:r,orientation:t,listId:n,listRectangle:c,acceptDropsFrom:o.acceptDropsFrom,shouldAcceptDrop:o.shouldAcceptDrop,initial:o.initial,preserveDragSpace:o.preserveDragSpace}}function lf(o){return new Zn(gT(o))}function hT(o,e){let t=Fe(e),[n,r]=Ye.useState(null),i=(0,Jt.useCallback)(l=>{if(l)St.registerDragInteractionTarget(l);else{let s=a();s&&St.unregisterDragInteractionTarget(s)}r(l)},[]),a=Fe(n);return(0,Jt.useEffect)(()=>St.on("register",l=>{let{dragListId:s,acceptDropsFrom:u,orientation:c,shouldAcceptDrop:d}=t(),p=l.getData();if(p.initial&&p.listId!==s&&u?.includes(p.listId)){let f=lf({domRef:o,orientation:c,dragListId:s,initial:!1,acceptDropsFrom:u,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(f)}}),[t]),{interactionTarget:n,setInteractionTarget:i,getInteractionTarget:a}}function Ss(o,e){let t=o.cloneNode(!0);return t.removeAttribute(It),t.style.position="fixed",t.style.top=`${e.top}px`,t.style.left=`${e.left}px`,t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.zIndex="999999",t.style.pointerEvents="none",t.style.margin="0",t.style.boxSizing="border-box",t.style.transform="none",document.body.appendChild(t),t}function Ts({proxyElement:o,dx:e,dy:t}){o.style.transform=`translate3d(${e}px, ${t}px, 0)`}function nf(o){let e=o.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",o.current=null)}var Ko=o=>{let e=Ye.useRef(null),t=Ye.useRef(null),[n,r]=(0,Jt.useState)(null),i=Ye.useRef({top:0,left:0}),a=Ye.useRef(null),l=Ye.useCallback(w=>{a.current=w},[]),{dropTargetListId:s,dragSourceListId:u}=po(),{updateDragOperationSourceAndTarget:c,dragItemId:d,status:p}=po(),f=Fe(o.onDrop),m=Fe(o.onAcceptDrop),g=Fe(o.onRemove),y=Fe(o.updatePosition??pT),{interactionTarget:h,setInteractionTarget:b}=hT(e,o);(0,Jt.useEffect)(()=>{let w=document.querySelector(`[${rf}="${o.dragListId}"]`);w?e.current=w: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,Jt.useEffect)(()=>{if(h){let w=o.dragListId,x=h.on("start",({dragItem:L,dragSourceListId:O,dropTargetListId:K})=>{c({dragSourceListId:O,dropTargetListId:K,dragItemId:L.id,status:"accepted"})}),A=h.on("move",({offsetsForItems:L,items:O,status:K,dragItem:j})=>{if(K==="rejected")return;let k=S(),Q=y(),G=t.current;O.forEach(($,ie)=>{let pe=L[ie],ue=k[ie];if(ue&&!(G&&$.id===G.dragItemId)){if(!G&&$.id===j.id){let le=i.current;pe={left:pe.left+le.left,top:pe.top+le.top}}Q({id:$.id,node:ue,offset:pe})}})}),E=h.on("drop",L=>{let{sortedIndexes:O,dragIndex:K,dropIndex:j,dragItem:k,items:Q,dragSourceListId:G,dropTargetListId:$,outside:ie,status:pe}=L,ue=S();T.current=[];let le=m(),de=g(),ce=f(),U=y();Q.forEach((Y,Z)=>{let X=ue[Z];X&&U({id:Y.id,node:X,offset:null})}),nf(t),r(Y=>Y&&(requestAnimationFrame(()=>r(null)),{...Y,dragItemId:null})),w===$&&G!==w&&le&&pe==="accepted"&&le({dragItemId:k.id,dragSourceListId:G,dropTargetListId:$,dragIndex:K,dropIndex:j,dropItemId:Q[j]?.id});let q=null;j===-1&&G===w&&$===w&&ie&&(q=de),j!==-1&&$===w&&G===w&&(q=ce),q&&q?.(O,{dragIndex:K,dropIndex:j,dragItemId:Q[K].id,dropItemId:Q[j]?.id})}),D=null,M=null,_=null,N=null;if(!h.getData().initial&&e.current){if(D=new mn({orientation:o.orientation,onScroll:()=>{}}),D.start(e.current),M=D.getScrollContainer(),M){let L=o.orientation==="vertical"?M.scrollTop:M.scrollLeft;_=()=>{let O=o.orientation==="vertical"?M.scrollTop:M.scrollLeft,K=O-L;L=O,K!==0&&(h.adjustForScroll(K),St.retriggerMove())},M.addEventListener("scroll",_)}N=L=>{D.updatePointer({left:L.clientX,top:L.clientY})},Pe().addEventListener("pointermove",N)}return()=>{x(),A(),E(),D&&D.stop(),M&&_&&M.removeEventListener("scroll",_),N&&Pe().removeEventListener("pointermove",N)}}},[h,o.dragListId]);let T=Ye.useRef([]),S=(0,Jt.useCallback)(()=>{let w=T.current;return(!w||w.length===0)&&(w=bs(e,o.dragListId),T.current=w),w},[o.dragListId]),C=(0,Jt.useCallback)(w=>{let x=w.currentTarget,A=x.getAttribute(It);if(A==null){let z=zo(x,sf);z&&(A=z.getAttribute(It))}if(A==null){console.warn("Could not find drag item id for element",x,`Make sure you have a parent element with a ${It} attribute`);return}A=`${A}`;let E=null,D=bs(e,o.dragListId);T.current=D;let M=lf({domRef:e,orientation:o.orientation,dragListId:o.dragListId,acceptDropsFrom:o.acceptDropsFrom,initial:!0,preserveDragSpace:o.preserveDragSpace}),_=M.getData().draggableItems,N=_.findIndex(z=>z.id===A);if(N===-1)return;let L=_[N],O=D[N]?.getAttribute(It)===`${A}`?D[N]:D.find(z=>z.getAttribute(It)===`${A}`);b(M);let K={left:w.clientX,top:w.clientY},j={left:w.clientX,top:w.clientY};i.current={top:0,left:0};let k=new mn({orientation:o.orientation,onScroll:()=>{}});e.current&&k.start(e.current);let Q=k.getScrollContainer(),G=Q?o.orientation==="vertical"?Q.scrollTop:Q.scrollLeft:0;function $(){E&&E.move({left:j.left,top:j.top})}let ie=()=>{if(!Q)return;let z=o.orientation==="vertical"?Q.scrollTop:Q.scrollLeft,q=z-G;G=z,q!==0&&(M.adjustForScroll(q),o.orientation==="vertical"?i.current.top+=q:i.current.left+=q),$()};Q?.addEventListener("scroll",ie);let pe=o.dragStrategy??"proxy",ue=pe==="proxy"&&!o.renderDragProxy,le=pe==="proxy"&&!!o.renderDragProxy,de=o.onDragProxyMove??Ts,ce=z=>{if(j={left:z.clientX,top:z.clientY},!E){if(E=St.startDrag({listId:o.dragListId,dragItem:L,dragIndex:N},K),O&&ue){let Z=O.getBoundingClientRect(),X=null,me={dragItemNode:O,dragItemId:`${A}`,initialRect:Z,initialCoords:K,get proxyElement(){return X||(X=Ss(O,Z)),X}},he=o.onDragProxySetup?.(me),ae=he?.proxyElement??me.proxyElement;O.style.visibility="hidden",t.current={proxyElement:ae,originalNode:O,dragItemId:`${A}`,initialRect:Z,cleanup:he?.cleanup}}if(O&&le){let Z=O.getBoundingClientRect();O.style.visibility="hidden",t.current={proxyElement:O,originalNode:O,dragItemId:`${A}`,initialRect:Z,cleanup:()=>{}},r({dragItemId:`${A}`,initialRect:Z,dx:0,dy:0})}}let q=z.clientX-K.left,Y=z.clientY-K.top;if(le)r(Z=>Z&&{...Z,dx:q,dy:Y});else{let Z=t.current;Z&&de({proxyElement:Z.proxyElement,dx:q,dy:Y})}k.updatePointer({left:z.clientX,top:z.clientY}),$()},U=()=>{if(k.stop(),Q?.removeEventListener("scroll",ie),Pe().removeEventListener("pointermove",ce),le&&(r(z=>z&&{...z,dragItemId:null}),requestAnimationFrame(()=>{r(null)})),!E){nf(t),b(null);return}E.drop(),E=null};Pe().addEventListener("pointermove",ce),Pe().addEventListener("pointerup",U,{once:!0})},[o.orientation,o.dragListId,o.acceptDropsFrom,o.removeOnDropOutside,o.dragStrategy,o.renderDragProxy,o.onDragProxySetup,o.onDragProxyMove]),I=!!d,R=Ye.useMemo(()=>({dragItemId:d,onDragItemPointerDown:C,dragSourceListId:u,dropTargetListId:s,status:p,dragListId:o.dragListId,draggingInProgress:I}),[d,C,I,u,s,o.dragListId]),v={className:oe("DragList",I?"DragList--dragging":"",Zp({dragging:I})),[rf]:o.dragListId},P=typeof o.children=="function"?o.children(v,R):o.children;return Ye.createElement(af.Provider,{value:R},P,n&&o.renderDragProxy?o.renderDragProxy({...n,ref:l}):null)},rf="data-drag-list-id",It="data-drag-item-id",Ur="data-drag-item-list-id",sf=`[${It}]`,yT=Ye.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),bT=o=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:n,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=gn(),l=o.dragListId??n,s=i===l&&r===`${o.id}`,u=Ye.useMemo(()=>({dragItemId:o.id,active:s,dragListId:l,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[o.id,s,l,t,i,a]),c={[It]:`${o.id}`,[Ur]:l,onPointerDown:e,className:oe("DraggableItem",s?"DraggableItem--active":"",Qp({active:s,draggingInProgress:t}))},d=typeof o.children=="function"?o.children(c,u):o.children;return Ye.createElement(yT.Provider,{value:u},d)};Ko.DraggableItem=bT;var Cs=W(require("react"));var uf=o=>Cs.createElement(ze,{...o,viewBox:"0 -960 960 960"},Cs.createElement("path",{d:Ve.hidden[0]}));var ti=W(require("react"));function cf(){return{}}var df=o=>({allowColumnHideWhileDragging:e=>e??!0});var pf=require("react"),ST=(0,pf.createContext)(null);function Is(){return ST}var Gt=W(require("react"));var Sn=W(require("react")),Vt=require("react");var oa=W(require("react"));function TT(o){let{height:e,width:t,count:n}=o;return oa.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 ff=oa.memo(TT);var mf="mlx2t3";var na=W(require("react")),If=require("react");var gf=require("react"),hf=(o,e)=>{(0,gf.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 yf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},bf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},Sf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Rs="_1ueijco1",Tf="_1ueijco0 _16lm1iw0";var Cf=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=yf[`${o}`]:e=oe(bf[`${o.horizontal}`],Sf[`${o.vertical}`]),e};var CT="InfiniteVirtualScrollContainer";var Rf=na.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:u}=e,c=t??(0,If.useRef)(null);return hf(c,i),na.createElement("div",{ref:c,style:s,autoFocus:u,tabIndex:l,className:oe(a,CT,Tf,Cf(r))},n)});var ma=W(require("react")),bn=require("react");var wf=W(require("react")),Qn=require("react");function IT(o){let[e,t]=(0,Qn.useState)(o.updater.get),n=(0,Qn.useRef)(null);return(0,Qn.useLayoutEffect)(()=>{function r(a){o.useraf?(n.current!=null&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=o.updater.onChange(r);return()=>{n.current!=null&&cancelAnimationFrame(n.current),i()}},[o.updater,o.useraf]),e??null}var Bo=wf.memo(IT);var vf=W(ln());var ws=(o,e)=>o-e,ho={horizontal:!0,vertical:!0};function ra(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 vs="DebugID=";function Wo(o,e){return e&&e.startsWith(vs)?e:e?`${vs}${o}:${e}`:`${vs}${o}`}var ia={start:0,end:0},Ps=o=>{o()},Ds=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},Pf=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},Yr=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function RT(o){return o.horizontalChange||o.verticalChange}var hn=class extends yt{constructor(t){let n=Wo(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=ia;this.verticalExtendRangeBy=ia;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=t=>{let 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=>{Yr(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Ps:Yr;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?Ps:Yr;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 c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=this.getColWidth(c);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let u=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=s+l;i[c]=d,l+=a[u],u++}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 c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=this.getRowHeight(c);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let u=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=s+l;i[c]=d,l+=a[u],u++}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=ho)=>{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=ho)=>{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,u=t.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(l,c,"vertical");let d=this.rowspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,c])}}}if(r){let l=t.startIndex,s=n.startIndex,u=n.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(c,l,"horizontal");let d=this.colspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([c,p])}}}return a};this.computeRenderRange=(t=ho)=>{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",u=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,c=this.getItemAt(l,t),d=u.start||0,p=u.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(c=Math.max(0,c-d),r+=d),p&&(r+=p);let f=c+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,c=Math.max(a,f-r)),{startIndex:c,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,u=l.length-1,c=a[s],d;for(;c<t;)if(s>=i||(u+=1,this.computeCacheFor(u,n),d=c,c=a[u],d===c&&d!=0))return i-1;let p=(0,vf.default)(a,t,ws);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],u=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),u==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let c=s+u;a[t]=c}};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 u=r==="horizontal"?this.colspanParent:this.rowspanParent;u.has(a)||u.set(a,[]);let c=r==="horizontal"?this.colspanValue:this.rowspanValue;c.has(a)||c.set(a,[]);let d=u.get(a),p=c.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 y=s(g);d[f]=f,p[f]=y;let h=f;for(;y>1;)h+=1,d[h]=f,p[h]=0,y-=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,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),u||(u=s.get(l)),u[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,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),u||(u=s.get(l)),u[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,u=Math.min(t,r-1);for(;s<=u;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=Ds;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=ho){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:u}=t,c=typeof s=="number",d=typeof u=="number",p=c&&s!==this.availableWidth,f=d&&u!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=u,this.availableRenderHeight=u),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",y=m&&r!==this.rows,h=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let b=a!=null,T=l!=null,S=b&&a!==this.rowHeight,C=T&&l!==this.colWidth;b&&(this.rowHeight=a),T&&(this.colWidth=l);let I=t.rowspan!=null,R=t.colspan!=null,v=I&&t.rowspan!=this.rowspan,P=R&&t.colspan!=this.colspan;v&&(this.rowspan=t.rowspan),P&&(this.colspan=t.colspan);let w=h||C||p||P,x=y||S||f||v;(n||RT)({horizontalChange:w,verticalChange:x,colsChanged:h,colWidthChanged:C,widthChanged:p,colspanChanged:P,rowsChanged:y,rowHeightChanged:S,heightChanged:f,rowspanChanged:v})&&this.updateRenderCount({horizontal:w,vertical:x})}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=ho){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=ho){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?Ps:Yr;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,u=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let c=[],d=0,p=r;d+=s,p-=u;for(let f=d;f<p;f++)c.push(this.getItemSize(f,t));a=ra(l,c)}else a=(n?Math.ceil(l/n):0)+1;return a+=s+u,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=>{Yr(()=>{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,u=l+s;return t==="horizontal"?this.horizontalTotalSize=u:this.verticalTotalSize=u,u}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=ia,this.verticalExtendRangeBy=ia,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var xs=W(ln());function Df(...o){if(!o.length)return new Set;let[e,...t]=o;return new Set([...e].filter(n=>t.every(r=>r.has(n))))}function xf(o,e){let t=new Set;for(let n of o)e(n)&&t.add(n);return t}function qr(o,e){for(let t of o)if(e(t))return t}var aa=(o,e)=>o-e,la=class extends yt{constructor(t,n){super(`${t}:GridCellManager`);this.matrix=new te;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,u=new Set;return this.matrix.visit(({value:c},d)=>{if(!c)return;let[p,f]=d,m=p<i,g=p>=l,y=f<a,h=f>=s;(m||g||y||h)&&u.add(c)}),u};this.debugId=t,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(r=>this.onRemoveCell(r))}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=qr(l,s=>!this.isCellAttached(s)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=qr(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,u)=>{let c=[a,u],d=this.getCellAt(c);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(aa)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(aa)}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,xs.default)(n,t,aa);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let n=this.getColumnsWithCells().sort(),r=(0,xs.default)(n,t,aa);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 qr(t,r=>this.getCellPosition(r)?.[0]===n)}getCellFromListForColumn(t,n){return qr(t,r=>this.getCellPosition(r)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}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 Ef=W(ln());var sa=class extends yt{constructor(t,n){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(r=>this.onRemoveRow(r))}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,Ef.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 Af=!0,yn=J(ee.y),Mf=J(ee.scrollTop),C_=J(ee.columnOffsetAtIndex),Es=J(ee.columnOffsetAtIndexWhileReordering),Jn=class extends yt{constructor(t,n,r){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(yn,i?`calc( ${r}px + var(${Mf}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${yn}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},u)=>{let c=Ie.columnOffsets.get(r),d=`${Es}-${r}`,p=s?`calc( ${a}px + var(${Mf}) )`:`${a}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(yn,p));let f=`translate3d(var(${d}, ${c}), var(${yn}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),u!=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 u=r.getItemOffsetFor(t,"vertical"),c=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=u>g-p?"end":u<f+d?"start":"end");let y=i.scrollTop;if(l==="center"?y=u-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,y+=u-f+s-d):(s+=c,y+=u-g+s+p),this.brain.isHorizontalLayoutBrain){let h=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),b=this.getScrollPositionForScrollColumnIntoView(h,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});b&&(a=b.scrollLeft)}return{scrollLeft:a,scrollTop:y}};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 u=r.getItemOffsetFor(t,"horizontal"),c=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=u>g-p?"end":u<f+d?"start":"end");let y=i.scrollLeft;return l==="center"?y=u-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,y+=u-f+s-d):(s+=c,y+=u-g+s+p),{...i,scrollLeft:y}};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 u=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-n,"vertical");return t<=u}if(t<s){let u=i.getItemAt(i.getScrollPosition().scrollTop+n,"vertical");return t>=u}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,u]}=i.getRenderRange();if(t<l||t>=u)return!1;let c=Math.floor((l+u)/2);if(t>=c){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-n-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<c){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:u,end:c}=t,[d,p]=u,[f,m]=c,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 y={start:[0,p],end:[n,m],rowFixed:"start",colFixed:!1};g.push(y)}if(r){let y={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};g.push(y)}return g};this.isCellFixed=(t,n)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),u=this.brain.getRowCount(),c=!1,d=!1,p=!1;if(t<r&&(c=!0,p="start"),i&&!c){let f=u-i;t>=f&&(c=!0,p="end")}if(n<a&&(d=!0,p="start"),l&&!d){let f=s-l;n>=f&&(d=!0,p="end")}return{row:c?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.onMouseEnterNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(n)};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))};Ge(()=>{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:u,y:c}=s;if(r){let d=()=>{this.updateHoverClassNamesForRow(a);let p=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=p.rowIndex,r.dataset.colIndex=p.colIndex,Af){this.setTransform(r,a,l,{x:u,y:c},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let m=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==m&&(r.__zIndex=m,r.style.zIndex=m)}else r.style.display="",r.style.left=`${u}px`,r.style.top=`${c}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?t.setPendingAfterCommitWork(d):d()}};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,Af&&(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:u,fixedRowsStart:c,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(D=>{let M=i.getRowIndex(D);if(M!=null){let _=this.brain.getItemOffsetFor(M,"vertical");if(_==null)return;let N=D.getElement();if(!N)return;this.setDetailTransform(N,M,{y:_,scrollLeft:t.scrollLeft})}}),!s&&!u&&!c&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&Od(t,this.getInfiniteNode(p.getElement()));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:y}=this.brain.getRenderRange(),[h,b]=g,[T,S]=y;function C(D,M,_){let N=r.getCellAt([D,M]);if(N==null)return;let L=n.getCellOffset(D,M),O=N.getElement();O&&L&&_(D,M,O,L)}let I=(D,M,_,{x:N,y:L})=>{this.setTransform(_,D,M,{x:N,y:L,scrollLeft:!0},s-M)},R=(D,M,_,N)=>{this.setTransform(_,D,M,{x:N.x,y:N.y,scrollTop:!0},c-D)},v=(D,M,_,{y:N})=>{let L=f[M];this.setTransform(_,D,M,{x:L,y:N,scrollLeft:!0},a-M)},P=(D,M,_,N)=>{this.setTransform(_,D,M,{x:N.x,y:m[D],scrollTop:!0},l-D)},w=(D,M,_,{x:N,y:L})=>{this.setTransform(_,D,M,{x:N,scrollLeft:!0,y:L,scrollTop:!0},1e5)},x=(D,M,_,{x:N})=>{this.setTransform(_,D,M,{x:N,scrollLeft:!0,y:m[D],scrollTop:!0},2e5)},A=(D,M,_,N)=>{this.setTransform(_,D,M,{x:f[M],y:N.y,scrollLeft:!0,scrollTop:!0},3e5)},E=(D,M,_)=>{this.setTransform(_,D,M,{x:f[M],y:m[D],scrollLeft:!0,scrollTop:!0},4e5)};if(s||u)for(let D=h;D<T;D++){for(let M=0;M<s;M++)C(D,M,I);if(u){let M=a-u;for(let _=M;_<a;_++)C(D,_,v)}}if(c||d)for(let D=b;D<S;D++){for(let M=0;M<c;M++)C(M,D,R);if(d){let M=l-d;for(let _=M;_<l;_++)C(_,D,P)}}if(s&&c)for(let D=0;D<c;D++)for(let M=0;M<s;M++)C(D,M,w);if(s&&d){let D=l-d;for(let M=D;M<l;M++)for(let _=0;_<s;_++)C(M,_,x)}if(u&&c){let D=a-u;for(let M=0;M<c;M++)for(let _=D;_<a;_++)C(M,_,A)}if(u&&d){let D=l-d,M=a-u;for(let _=D;_<l;_++)for(let N=M;N<a;N++)C(_,N,E)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};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 la(n,r.cellPool),this.cellManager.onCellAttachmentChange((u,c)=>{c?this.onCellAttached(u):this.onCellDetached(u)}),this.rowManager=new sa(n,r.rowPool),this.rowManager.onRowAttachmentChange((u,c)=>{c?this.onRowAttached(u):this.onRowDetached(u)}),this.renderRange=this.renderRange.bind(this);let i=t.onScroll(this.adjustFixedElementsOnScroll),a=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Ge(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=t.onScrollStart(this.onScrollStart),s=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{i(),a(),l(),s()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=os(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,u=this.brain.isHorizontalLayoutBrain,{rowManager:c,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let w=t.start[1],x=t.end[1];m.forEach(A=>{w<=A&&A<x||f.push({start:[t.start[0],A],end:[t.end[0],A+1]})})}let g=new Map,y=f.map(this.getExtraSpanCellsForRange).flat();y&&y.forEach(([w,x])=>{g.set(`${w}:${x}`,!0)});let h=f.reduce((w,x)=>w+Ds(x),0),b=r?f.reduce((w,x)=>w+Pf(x),0):0,T=this.brain.getRowCount(),S=this.brain.getColCount();d.detachCellsStartingAt([T,S]);let C=Math.min(T*S,h);r&&(c.detachStartingWith(this.brain.getRowCount()),c.poolSize>b&&(c.poolSize=b));let I=Df(...f.map(w=>d.getCellsOutsideRenderRange(w)));I=xf(I,w=>{let x=d.getCellPosition(w);return!(x&&g.has(`${x[0]}:${x[1]}`))}),d.detachCells(I),d.poolSize=C;let R=new Map,v=new Map;f.forEach(w=>{let{start:x,end:A}=w,[E,D]=x,[M,_]=A;for(let N=E;N<M;N++){for(let O=D;O<_;O++){let K=`${N}:${O}`;if(R.has(K))continue;R.set(K,!0);let{rendered:j,mapped:k}=this.isCellRenderedAndMappedCorrectly(N,O);if(N===E||O===D){let G=this.isCellCovered(N,O);if(G&&g.has(`${G[0]}:${G[1]}`)){let $=d.getCellAt([N,O]);$!=null&&d.detachCell($);continue}}if(j&&!i&&k)continue;let Q;j?Q=d.getCellAt([N,O]):Q=d.getCellFor([N,O],u?"row":"column"),Q==null&&(Q=d.getDetachedCell()),this.renderCellAt(N,O,Q,n)}!r||v.has(N)||(v.set(N,!0),c.isRowAttachedAt(N)&&!i)||this.renderDetailRowAtElement(N,this.rowManager.getRowFor(N),r)}}),y.forEach(([w,x])=>{let{rendered:A,mapped:E}=this.isCellRenderedAndMappedCorrectly(w,x);if(A){if(i||!E){let M=[w,x],_=d.getCellAt(M);this.renderCellAt(w,x,_,n)}return}let D=d.getCellFor([w,x],u?"row":"column");D!=null&&this.renderCellAt(w,x,D,n)});let P=d.getAllCells().map(w=>w.getNode());return r&&c.getAllRows().forEach(w=>{P.push(w.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(P),P}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,u=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(c=>{let d=c.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(c)}),!u){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(u,n,t),this.updateDetailElementPosition(n)}getCellRealCoordinates(t,n){return{rowIndex:t,colIndex:n}}getMatrixRowIndexFromElement(t){let n=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):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),u=this.brain.getRowspan(t,n),c=this.brain.getColspan(t,n),d=u===1?l:this.brain.getRowHeightWithSpan(t,n,u),p=c===1?s:this.brain.getColWidthWithSpan(t,n,c),{row:f,col:m}=this.isCellFixed(t,n),g=!!a,{rowIndex:y,colIndex:h}=this.getCellRealCoordinates(t,n),b=i({rowIndex:y,colIndex:h,height:l,width:s,rowspan:u,colspan:c,rowFixed:f,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:r.ref});r.isMounted()||r.onMount(C=>{let I=C.getElement();I&&(I.style.position="absolute",I.style.left="0px",I.style.top="0px"),this.updateElementPosition(C)});let T=this.brain.isHorizontalLayoutBrain?{renderRowIndex:y,renderColIndex:h}:void 0,S=this.brain.isHorizontalLayoutBrain;if(!b){S?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(b,r,[t,n],T),this.updateElementPosition(r,{hidden:g,rowspan:u,colspan:c})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var ua=class extends Jn{constructor(t,n,r){super(t,n,r);this.setTransform=(t,n,r,i,a)=>{let l=this.getCellRealCoordinates(n,r),{y:s}=i,u=Math.floor(l.rowIndex/this.brain.rowsPerPage),c=fe.runtime.totalVisibleColumnsWidthVar,d=u?`calc(${c} * ${u})`:"0px",p=Ie.columnOffsets.get(l.colIndex),f=`${Es}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(yn,m));let g=`calc(var(${f}, ${p}) + ${d})`,y=`var(${yn})`,h=`translate3d(${g}, ${y}, 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}}};var Of=W(require("react"));var er=class er extends yt{constructor(t){super(t);this.cellRemoveSubscription=Se();this.cellAttachmentChangeSubscription=Se();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=this.createCellInstance();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+=er.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}flushPendingAfterCommitWork(){for(let t of this.attachedCells)t.flushPendingAfterCommitWork()}set poolSize(t){t=Math.ceil(t/er.POOL_SIZE_INCREMENT)*er.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--}};er.POOL_SIZE_INCREMENT=1;var ca=er;var _f=new Map,wT=()=>{},As=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=Se();let n=_f.get(e)??0,r=`${e}:GridCellReact:${n}`;_f.set(e,n+1),this.debugId=r,this.cellInfo=t,this.updater=Se(),this.node=Of.createElement(Bo,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(e){this.pendingAfterCommitWork=e}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let e=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,e()}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=wT,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}},da=class extends ca{constructor(t){super(`${t}:GridCellPoolForReact`);this.cellDebugId=t}createCellInstance(){return new As(this.cellDebugId)}};var Ff=W(require("react"));var tr=class tr extends yt{constructor(t){super(t);this.rowRemoveSubscription=Se();this.rowAttachmentChangeSubscription=Se();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=this.createRowInstance();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+=tr.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/tr.POOL_SIZE_INCREMENT)*tr.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--}};tr.POOL_SIZE_INCREMENT=1;var pa=tr;var Nf=new Map,vT=()=>{},Ms=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=Se();let t=Nf.get(e)??0,n=`${e}:ListRowReact:${t}`;Nf.set(e,t+1),this.debugId=n,this.updater=Se(),this.node=Ff.createElement(Bo,{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=vT,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},fa=class extends pa{constructor(t){super(`${t}:ListRowPoolForReact`);this.rowDebugId=t}createRowInstance(){return new Ms(this.rowDebugId)}};function Lf(o){return{cellPool:new da(o),rowPool:new fa(o)}}function Xr(o){let e=o.isHorizontalLayoutBrain?new ua(o,`${o.name}:HorizontalLayoutTableRenderer`,Lf(`${o.name}:HorizontalLayoutTableRenderer`)):new Jn(o,`${o.name}:ReactHeadlessTableRenderer`,Lf(`${o.name}:ReactHeadlessTableRenderer`)),t=Se();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function PT(o){let{brain:e,renderCell:t,renderDetailRow:n,forceRerenderTimestamp:r}=o,{renderer:i,onRenderUpdater:a}=(0,bn.useMemo)(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:Xr(e),[e,o.onRenderUpdater,o.renderer]);return(0,bn.useLayoutEffect)(()=>{i.cellHoverClassNames=o.cellHoverClassNames||[]},[i,o.cellHoverClassNames]),(0,bn.useLayoutEffect)(()=>{i.cellDetachedClassNames=o.cellDetachedClassNames||[]},[i,o.cellDetachedClassNames]),(0,bn.useLayoutEffect)(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:n}),e.onRenderRangeChange(u=>{i.renderRange(u,{force:!1,onRender:c=>{let d=a.get();d&&c&&d.length===c.length||a(c)},renderCell:t,renderDetailRow:n})})},[i,e,t,n,a,r]),(0,bn.useLayoutEffect)(()=>{i.flushPendingAfterCommitWork()}),ma.createElement(Bo,{updater:a})}var ga=ma.memo(PT);var Zr=W(require("react")),or=require("react");var kf=be({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),ha="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var zf=be({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:DT}=ke,xT=`${DT}-ActiveRowIndicator`,ET=`calc(${ee.activeCellRowOffsetX} + var(${J(ee.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,AT={[J(ee.activeCellOffsetY)]:ee.activeCellRowOffset,transform:`translate3d(${ET}, calc( ${ee.activeCellOffsetY} + var(${J(ee.scrollTopForActiveRow)}, 0px)), 0px)`,height:ee.activeCellRowHeight,maxWidth:fe.runtime.totalVisibleColumnsWidthVar},MT=o=>{let{brain:e}=o,t=(0,or.useRef)(null),n=o.activeRowIndex!=null&&e.getInitialRows()>o.activeRowIndex,[r,i]=Ut();return(0,or.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(${fe.runtime.totalVisibleColumnsWidthVar} * ${p})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),u=e.getItemOffsetFor(l,"vertical"),c=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${u}px`,activeCellRowOffsetX:a};Bn(d,c)},[o.activeRowIndex,e]),(0,or.useEffect)(()=>{let a=u=>{Bn({scrollTopForActiveRow:`${-u.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:e.isHorizontalLayoutBrain?`${-u.scrollLeft}px`:"0px"},t.current)};a(e.getScrollPosition());let l=e.onScroll(a),s=e.onRenderCountChange(i);return()=>{s(),l()}},[e]),Zr.createElement("div",{className:ha,"data-name":"active-row"},Zr.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${xT} ${zf({active:n})}`,style:n?AT:void 0}))},Vf=Zr.memo(MT);var Qr=W(require("react")),nr=require("react");var{rootClassName:_T}=ke,OT=`${_T}-ActiveCellIndicator`,NT=J(ee.columnZIndexAtIndex),FT=(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;Bn({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},LT=o=>{let{brain:e}=o,[t,n]=Ut(),r=(0,nr.useRef)(null),i=o.activeCellIndex!=null&&e.getInitialRows()>o.activeCellIndex[0];return(0,nr.useLayoutEffect)(()=>{FT(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight,e]),(0,nr.useEffect)(()=>{let a=e.onRenderCountChange(()=>{n()});return()=>{a()}},[e]),Qr.createElement("div",{className:ha,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${NT}-${o.activeCellIndex[1]})`}:void 0},Qr.createElement("div",{"data-name":"active-cell-indicator",className:`${OT} ${kf({visible:i})}`}))},Gf=Qr.memo(LT);var ya=[Cp,`${ft}DetachedCell`];function ba(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 kT=oe(mf,Rs);function Hf(o){let{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:u,activeCellIndex:c,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=o,{autoFocus:y}=g,h=(0,Vt.useRef)(null),[b,T]=(0,Vt.useState)({width:0,height:0});(0,Vt.useEffect)(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),(0,Vt.useEffect)(()=>{let I=h.current?.parentNode;return I?(y&&document.activeElement!==I&&I.focus(),Mn(I,()=>{let P={height:I.clientHeight,width:I.clientWidth};e.update(P)},{debounce:50})):void 0},[p,e]);let S=(0,Vt.useCallback)(I=>{requestAnimationFrame(()=>{h.current&&h.current.style.setProperty("transform",`translate3d(${-I.scrollLeft}px, ${-I.scrollTop}px, 0px)`)})},[]),C=(0,Vt.useCallback)(I=>{e.setScrollPosition(I,S)},[e,S]);return(0,Vt.useEffect)(()=>{let I=e.onRenderCountChange(()=>{T(e.getVirtualizedContentSize())});return T(e.getVirtualizedContentSize()),S(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),I},[e]),Sn.createElement(Rf,{onContainerScroll:C,...g,ref:t},Sn.createElement("div",{ref:h,className:kT,"data-name":"scroll-transform-target"},Sn.createElement(ga,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:ya}),c!=null?Sn.createElement(Gf,{brain:e,rowHeight:a,activeCellIndex:c}):null),u!=null?Sn.createElement(Vf,{brain:e,activeRowIndex:u}):null,Sn.createElement(ff,{width:b.width,height:b.height}))}function Kf(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((c,d)=>{let p=c.id,f=o[d-1],m=f?.id??"",g=new Set,y=f?.computedPinned!==c.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let h={type:"column",id:p,ref:c,groupOffset:0,computedPinned:c.computedPinned,computedWidth:c.computedWidth,depth:c.columnGroup?(t.get(c.columnGroup)??0)+1:0};r.set([p],h);let b=c.columnGroup,T,S=h;for(;b;){let C=e[b];if(C){g.add(b);let I=[p,...g];T=y.has(b)?i.get(b):void 0,T||(T={id:b,type:"group",ref:C,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[b],computedWidth:0,computedPinned:h.computedPinned,depth:t.get(b)??0},r.set(I,T),i.set(b,T)),T.columnItems.push(h),T.uniqueGroupId.push(h.id),S&&!y.has(S.id)&&T.children.push(S),S=T,b=C.columnGroup}else break}});let l=[],s=new te,u=0;return r.forEach(c=>{if(!c.ref.columnGroup){let d=c.type==="column"?c.ref.computedWidth:c.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);c.groupOffset=u,c.computedWidth=d,c.type==="group"&&Bf(c.children),l.push(c),u+=d}if(c.type==="group")c.columnItems.forEach(d=>{s.set([c.depth,d.ref.computedVisibleIndex],c)});else for(let d=c.depth;d<=n+1;d++)s.set([d,c.ref.computedVisibleIndex],c)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function Bf(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"&&Bf(t.children),e+=n})}var jo=W(require("react")),yo=require("react");var Os=W(require("react"));var jf=W(require("react")),_s=require("react");var Jr=require("react"),ei=W(require("react"));var{rootClassName:zT}=ke,VT=`${zT}HeaderCell_ResizeHandle`;function GT(o){let e=(0,Jr.useRef)(null),[t,n]=(0,Jr.useState)(!1),r=(0,Jr.useRef)(t);r.current=t;let i=o.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,u=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let g=!0,y=Up(o.groupColumns.map(S=>S.computedVisibleIndex),{columns:o.columns,domRef:e}),h=S=>{a==="end"&&(S*=-1);let{constrained:C,adjustedDiffs:I,adjustedDiff:R}=o.computeResize(S);return r.current!==C&&n(C),y.resize(I),R},b=S=>{if(g){let C=o.groupColumns.reduce((v,P)=>v+P.computedWidth-P.computedMinWidth,0),I=o.brain.getAvailableSize(),R={width:I.width+C,height:I.height};o.brain.update(R),g=!1}h(Math.round(S.clientX-f))},T=S=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",b),m.removeEventListener("pointerup",T);let C=Math.round(S.clientX-f),I=h(C);o.onResize(I)};m.addEventListener("pointermove",b),m.addEventListener("pointerup",T)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:fe.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return ei.createElement("div",{ref:e,className:`${VT} ${Ji} ${ta({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},ei.createElement("div",{style:{...c,...o.style},className:ea({constrained:t})}))}var Wf=ei.memo(GT);function $f(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:u}=re(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),c=o[o.length-1],d=(0,_s.useCallback)(g=>{let y=l(),{columnSizing:h,viewportReservedWidth:b,bodySize:T}=y,S=s().computedVisibleColumns,C=!1,I=S.reduce((P,w)=>(w.computedFlex&&(P[w.id]={...h[w.id],flex:w.computedWidth},C=!0),P),{}),R=C?{...h,...I}:h;return pd({availableSize:T.width,reservedWidth:b||0,dragHandleOffset:g,dragHandlePositionAfter:c.computedVisibleIndex,columnSizing:R,columnGroupSize:o.length,items:S.map(P=>({id:P.id,resizable:P.computedResizable,computedFlex:P.computedFlex,computedWidth:P.computedWidth,computedMinWidth:P.computedMinWidth,computedMaxWidth:P.computedMaxWidth}))})},[c]),p=(0,_s.useCallback)(g=>{let{columnSizing:y,reservedWidth:h}=d(g);u.viewportReservedWidth=h,u.columnSizing=y},[d]);return o.some(g=>g.computedResizable)?jf.createElement(Wf,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:p}):null}var Uf=`${ft}HeaderGroup`,Yf=J(ee.columnWidthAtIndex),HT=J(ee.columnZIndexAtIndex);function qf(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=$f(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),u=n[0],c=n.length>1?"calc( "+n.map(f=>`var(${Yf}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${Yf}-${u.computedVisibleIndex})`,d=`calc(var(${HT}-${u.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=c,p.height=t,Os.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:oe(od,Uf),style:p,"data-z-index":d},Os.createElement("div",{className:oe(`${Uf}__header-content`,kt)},a),s)}var Xf=require("react");var Ls=W(require("react")),Ns;function ks(){return Ns||(Ns=Ls.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var Fs;function Sa(){return Fs||(Fs=Ls.createContext(null))}function _e(o){let e=Sa(),t=(0,Xf.useContext)(e);return _n(t,o)}function eo(){return _e(o=>({getDataSourceState:o.getDataSourceState,getDataSourceMasterContext:o.getDataSourceMasterContext,dataSourceActions:o.dataSourceActions,dataSourceApi:o.dataSourceApi,assignState:o.assignState}))}var{rootClassName:KT}=ke,BT=[],Zf=`${KT}Header`,WT=Zc({overflow:!1}),Qf=()=>{};function jT(o){let{bodyBrain:e,headerBrain:t,columns:n,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=o,{getState:u,headerOptions:c,headerRenderer:d,headerOnRenderUpdater:p,showColumnFilters:f,computedColumnsMap:m}=re(A=>({computedColumnsMap:A.computed.computedColumnsMap,getState:A.getState,headerOptions:A.state.headerOptions,headerRenderer:A.state.headerRenderer,headerOnRenderUpdater:A.state.headerOnRenderUpdater,showColumnFilters:A.state.showColumnFilters})),g=(0,yo.useRef)(null),y=(0,yo.useCallback)(A=>{g.current&&(g.current.style.transform=`translate3d(-${A.scrollLeft}px, 0px, 0px)`)},[]);(0,yo.useEffect)(()=>{let A=t.onScroll(y);return y(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),A},[t]);let h={ref:g,className:oe(Zf,`${Zf}--virtualized`,i,WT),style:{...r,height:a}},{getDataSourceState:b,dataSourceApi:T,dataSourceActions:S}=eo(),{allRowsSelected:C,someRowsSelected:I,selectionMode:R,filterTypes:v,filterDelay:P}=_e(A=>({allRowsSelected:A.dataSourceState.allRowsSelected,someRowsSelected:A.dataSourceState.someRowsSelected,selectionMode:A.dataSourceState.selectionMode,filterTypes:A.dataSourceState.filterTypes,filterDelay:A.dataSourceState.filterDelay})),w=(0,yo.useMemo)(()=>({allRowsSelected:C,someRowsSelected:I,selectionMode:R}),[C,I,R]),x=(0,yo.useCallback)(A=>{let{rowIndex:E,colIndex:D,domRef:M,height:_,widthWithColspan:N,heightWithRowspan:L,hidden:O}=A,K=n[D];if(!K||O)return null;let j=t.isHorizontalLayoutBrain?t.getPageIndexForRow(E):null,k=l?l.pathsToCells.get([E,D]):null;if(k&&k.type==="group"){let Q=k.columnItems.map(ie=>ie.ref),G={...k.ref,id:k.id,uniqueGroupId:k.uniqueGroupId,depth:k.depth,columns:Q.map(ie=>ie.id),computedWidth:k.computedWidth,groupOffset:k.groupOffset};return u().columnGroupVisibility[k.id]!==!1?jo.createElement(qf,{horizontalLayoutPageIndex:j,bodyBrain:e,columnGroupsMaxDepth:s,domRef:M,columns:Q,width:N,height:_,columnGroup:G}):null}return jo.createElement(em,{domRef:M,column:K,horizontalLayoutPageIndex:j,headerOptions:c,dataSourceStatePartialForHeaderCell:w,filterTypes:v,filterDelay:P,getDataSourceState:b,dataSourceApi:T,dataSourceActions:S,width:N,height:L,columnsMap:m})},[c,n,a,l,s,f,t,b,T,S,v,P,w]);return jo.createElement(Ko,{orientation:"horizontal",dragListId:"header",dragStrategy:"inline",onDrop:Qf,updatePosition:Qf},A=>jo.createElement("div",{...A,...h,className:oe(A.className,h.className)},jo.createElement(ga,{name:"header",renderCell:x,brain:t,renderer:d,onRenderUpdater:p,cellHoverClassNames:BT,cellDetachedClassNames:ya})))}var Jf=jo.memo(jT);function tm(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=re(I=>({computedPinnedStartColumns:I.computed.computedPinnedStartColumns,computedPinnedEndColumns:I.computed.computedPinnedEndColumns,computedVisibleColumns:I.computed.computedVisibleColumns,columnSize:I.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:u,columnGroupsMaxDepth:c,computedColumnGroups:d,showColumnFilters:p}=re(I=>({columnHeaderHeight:I.state.columnHeaderHeight,columnGroupsDepthsMap:I.state.columnGroupsDepthsMap,columnGroupsMaxDepth:I.state.columnGroupsMaxDepth,computedColumnGroups:I.state.computedColumnGroups,showColumnFilters:I.state.showColumnFilters})),f=!d||!Object.keys(d).length?1:c+2,m=f*s+(p?s:0),g=Gt.useMemo(()=>{if(!(!d||!Object.keys(d).length))return Kf(a,d,u,c)},[a,d,u]),y=Gt.useCallback(({rowIndex:I,colIndex:R})=>{let v=a[R],P=1,w=1;if(!v||!g)return{rowspan:P,colspan:w};let x=g.pathsToCells.get([I,R]);if(!x)return{rowspan:P,colspan:w};if(x.type==="column")return{colspan:w,rowspan:f-x.depth};let A=x.columnItems.findIndex(E=>E.id===v.id);return{rowspan:P,colspan:A===0?x.columnItems.length:1}},[d,c,a,g,f,u]),h=Gt.useCallback(({rowIndex:I,colIndex:R})=>y({rowIndex:I,colIndex:R}).rowspan,[y]),b=Gt.useCallback(({rowIndex:I,colIndex:R})=>y({rowIndex:I,colIndex:R}).colspan,[y]),T=Gt.useCallback(I=>p?I<f-1?s:2*s:s,[f,p,s]);ba(e,{colWidth:l,rowHeight:T,rows:f,cols:a.length,height:m,rowspan:h,colspan:b},{fixedColsEnd:i.length,fixedColsStart:r.length});let S=Gt.createElement(Jf,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:c,columnAndGroupTreeInfo:g}),C=n.vertical&&Lo()?Gt.createElement("div",{className:rd,style:{zIndex:1e3,width:Lo()}}):null;return Gt.createElement("div",{className:`${ps} ${sd}`,style:{height:m}},S,C)}var{ManagedComponentContextProvider:$T}=Ot({initSetupState:cf,forwardProps:df,Context:Is()});function zs(o){let{getComputed:e,header:t,brain:n,headerBrain:r,wrapRowsHorizontally:i}=re(l=>({getComputed:l.getComputed,header:l.state.header,brain:l.state.brain,headerBrain:l.state.headerBrain,wrapRowsHorizontally:l.state.wrapRowsHorizontally})),{scrollbars:a}=e();return t?ti.createElement($T,{...o},ti.createElement(tm,{wrapRowsHorizontally:!!i,bodyBrain:n,headerBrain:r,scrollbars:a})):null}function om(){return ti.useContext(Is()).componentState}var UT=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||fo;return De.createElement(s,{domProps:{className:ji},onChange:u=>{if(l){u?r.treeApi.selectAll():r.treeApi.deselectAll();return}u?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:i})},Zi=De.createContext(null);var YT=J(ee.columnZIndexAtIndex),qT=J(ee.columnVisibilityAtIndex),Vs=De.createElement("div",{className:Di[1]}),rm=Ei({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[It]:"",[Ur]:""});function XT(o){let e=o.column,{allowColumnHideWhileDragging:t}=om(),{dataSourceStatePartialForHeaderCell:n,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:u}=o,{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=n,{onDragItemPointerDown:f}=gn(),{api:m,getComputed:g,getState:y,actions:h,getDataSourceMasterContext:b,showColumnFilters:T,components:S,portalDOMRef:C,columnHeaderHeight:I,columnReorderDragColumnId:R,columnMenuVisibleForColumnId:v,columnReorderInPageIndex:P}=re(H=>({api:H.api,getComputed:H.getComputed,getState:H.getState,actions:H.actions,getDataSourceMasterContext:H.getDataSourceMasterContext,showColumnFilters:H.state.showColumnFilters,components:H.state.components,portalDOMRef:H.state.portalDOMRef,columnHeaderHeight:H.state.columnHeaderHeight,columnReorderDragColumnId:H.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:H.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:H.state.columnReorderInPageIndex})),w=R===e.id,x=P!=null?r!==P:!1,{onResize:A,height:E,width:D,headerOptions:M,columnsMap:_}=o,N=e.computedSortInfo,L=e.header,O=(0,bo.useCallback)(H=>{z.current=H,o.domRef?.(H)},[o.domRef]),K=M.alwaysReserveSpaceForSortIcon,j=e.headerAlign??e.align,k=(typeof j=="function"?j({isHeader:!0,column:e}):j)??"start",Q=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",G=mt(e,{actions:h,api:m,dataSourceActions:l,dataSourceApi:a,getComputed:g,getDataSourceState:i,getDataSourceMasterContext:b,getState:y}),$=G.isSortable(),ie=$&&(e.computedSorted||K)?De.createElement(Qi,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:fe.spacing[2],marginInlineEnd:fe.spacing[2]},className:`${cn}__sort-icon ${id} ${ld({align:k})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,ue=e.computedFilterable&&e.computedFiltered?De.createElement(zn,null):null,le=e.headerCssEllipsis??e.cssEllipsis??!0,de={reserveSpaceWhenHidden:k==="center",menuVisible:v===e.id,style:k==="end"?{marginInlineStart:`calc(${fe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:fe.spacing[2]}:{marginInlineEnd:`calc(${fe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:fe.spacing[2]},domProps:{onMouseDown:H=>{H.stopPropagation(),G.toggleContextMenu(H.target)}}},ce=e.components?.MenuIcon||S?.MenuIcon||Br,U=De.createElement(ce,{...de}),z=(0,bo.useRef)(null),q={horizontalLayoutPageIndex:r,dragging:w,domRef:O,htmlElementRef:z,renderLocation:"column-header",column:e,columnsMap:_,columnSortInfo:N,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:c,selectionMode:p,api:m,dataSourceApi:a,columnApi:G,renderBag:{sortIcon:ie,filterIcon:ue,menuIcon:U,menuIconProps:de,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},Y=q,Z=Y.renderBag.header,X=()=>{let H={...q,renderBag:{...q.renderBag}};if(e.renderSortIcon&&(H.renderBag.sortIcon=De.createElement(Go,{render:e.renderSortIcon,renderParam:{...H,renderBag:{...H.renderBag}}})),e.renderFilterIcon&&(H.renderBag.filterIcon=De.createElement(Go,{render:e.renderFilterIcon,renderParam:{...H,renderBag:{...H.renderBag}}})),typeof e.renderMenuIcon=="function"&&(H.renderBag.menuIcon=De.createElement(Go,{render:Ne=>{if(typeof e.renderMenuIcon!="function")return null;let dt=e.renderMenuIcon(Ne);return dt?dt.type===ce||dt.type===Br?dt:De.createElement(ce,{...de},dt):null},renderParam:{...H,renderBag:{...H.renderBag}}})),e.renderSelectionCheckBox&&p==="multi-row"){H.renderBag.selectionCheckBox=De.createElement(Go,{render:UT,renderParam:{...H,renderBag:{...H.renderBag}}});let Ne=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;Ne&&Ne!==!0&&(H.renderBag.selectionCheckBox=De.createElement(Go,{render:Ne,renderParam:{...H,renderBag:{...H.renderBag}}}))}L instanceof Function&&(H.renderBag.header=Z=De.createElement(Go,{render:L,renderParam:{...H,renderBag:{...H.renderBag}}}));let Xe=e.renderMenuIcon===!1?null:H.renderBag.menuIcon,Lt=le?De.createElement("div",{className:kt},H.renderBag.header):H.renderBag.header,se=De.createElement(De.Fragment,null,k==="center"?Vs:null,H.renderBag.selectionCheckBox,Lt,H.renderBag.sortIcon,H.renderBag.filterIcon,k==="center"?Vs:null,k!=="center"?Vs:null,Xe);return e.renderHeader?De.createElement(Go,{render:e.renderHeader,renderParam:{...H,renderBag:{...H.renderBag,all:se}}}):se};(0,bo.useEffect)(()=>{let H=null,Xe=z.current;return A&&Xe&&(H=Mn(Xe,A)),()=>{H?.()}},[z.current,o.onResize]);let me={height:E};e.headerStyle&&(me=typeof e.headerStyle=="function"?{...me,...e.headerStyle(Y)||{}}:{...me,...e.headerStyle});let he=typeof e.headerClassName=="function"?e.headerClassName(Y):e.headerClassName,{onPointerDown:ae,proxyPosition:V,dragColumnOutside:F}=fp({columnId:e.id,domRef:z,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),ge=null,xe=Zi.Provider,Ee={filtered:e.computedFiltered,verticalAlign:Q,align:k},Ae=De.useMemo(()=>{let H=Xe=>{m.setColumnFilter(e.id,Xe)};return u>0?Mt(H,{wait:u}):H},[u,e.id]),Me=e.computedFilterType,He=s[Me],tt=e.computedFilterable?e.computedFilterValue?.filter.operator??He?.defaultOperator:void 0,Qe=e.computedFilterable&&He?He.operators.find(H=>H.name===tt):void 0,rt=Qe?.components?.FilterEditor||He?.components?.FilterEditor||e.components?.FilterEditor||Kn,Je=He?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,qe=Xp(e,{horizontalLayoutPageIndex:r}),B=`var(${YT}-${e.computedVisibleIndex})`;me.zIndex=B,me.visibility=`var(${qT}-${e.computedVisibleIndex}, visible)`;let ne={"data-field":`${e.field||""}`,"data-column-id":e.id,[It]:e.id,[Ur]:"header","data-header-align":k,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},ye=e.computedFilterable?De.createElement(Rd,{horizontalLayoutPageIndex:r,filterEditor:rt,filterOperatorSwitch:Je??wd,operator:Qe,filterTypes:s,onChange:Ae,columnFilterType:Me,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:I}):De.createElement(vd,null);Y.renderBag.filterEditor=ye;let Te=(0,bo.useCallback)(H=>{ae(H),f(H)},[ae,f]),$e=X();return w&&V&&(ge=De.createElement("div",{key:e.id,className:`${cn}Proxy ${Yc}`,style:{height:E,width:D,left:V.left??0,top:V.top??0}},De.createElement("div",{className:qc({visible:F})},De.createElement(uf,{size:16})),Z),ge=(0,nm.createPortal)(ge,C.current)),De.createElement(xe,{value:Y},De.createElement(qi,{domRef:O,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,cellType:"header",column:e,...ne,"data-z-index":B,style:me,width:D,onPointerDown:Te,contentClassName:oe(Uc(Ee),Rc[k]),contentStyle:T?{height:E/2}:void 0,className:oe(cn,xc.none,$?Cc.pointer:"",he,zi(e,[cn,mo],Xc,{dragging:w,insideDisabledDraggingPage:x,align:k,verticalAlign:Q,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),$c),cssEllipsis:le,afterChildren:De.createElement(De.Fragment,null,T?ye:null,qe),renderChildren:$e}),ge)}var em=De.memo(XT);function Mr(){return(0,bo.useContext)(Zi)}var So=W(require("react")),sm=require("react");function im(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 am={padding:fe.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},ZT={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},lm=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(im(t),n,"important")},um=So.forwardRef(function(e,t){let{rootClassName:n}=Pi(),r=So.useRef(null),i=So.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return(0,sm.useEffect)(()=>{let a=()=>{setTimeout(()=>{lm(r.current,am),lm(r.current?.firstElementChild,ZT)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),So.createElement("div",{ref:i,...e,className:oe(`${n}-Footer`,Nd,e.className),style:am},"Powered by"," ",So.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});function Gs(o){return o.map(to)}function to(o){if(Pe().structuredClone)return Pe().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Gs(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Gs(Array.from(o)));if(o instanceof Map)return new Map(Gs(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=to(o[t]));return e}function oi(o){return o}var Tn=Object.seal({data:null,field:null});var Uo="____root____",dm="____not_loaded_yet____";function $o(){return!1}function Hs(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 Ta(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 pm(o,e){let{marker:t,reducers:n={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:u}=o;t&&t.start();let c=new te;function d(h,b,T,S=0,C=[]){let I=!T.length||S===T.length-1,R=b[u?.values||"values"]||{};for(let v in R)if(R.hasOwnProperty(v)){let P=v;C.push(P),p.set(C,!0),h.set(C,{reducerResults:R[v][u?.totals||"totals"]||{},items:[]}),I||d(h,R[v],T,S+1,C),C.pop()}}let p=r?new te:void 0,f=[],m=Hs(n),g=to(m);e.visitDepthFirst((h,b,T,S)=>{let[C,...I]=b,R=h.children,v=c.get(I);if(v&&(v.cache=h.cache,v.childrenLoading=h.childrenLoading,v.childrenAvailable=h.childrenAvailable,v.error=h.error),I.length==i.length&&i.length){if(v){v.items=R;for(let w=0,x=I.length;w<x;w++){let A=I.slice(0,w),E=c.get(A);E&&(E.items=E.items||[],E.items=E.items.concat(R))}R=a.indexArray(R,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return S?.()}for(let P=0,w=R.length;P<w;P++){if(!R[P]){let D={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};c.set([...I,`${dm}${P}`],D);continue}let x=R[P].data,A=R[P].keys||[];if(A.length){let D=A[A.length-1];I.push(D)}let E={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:x,totalChildrenCount:R[P].totalChildrenCount,reducerResults:R[P].aggregations||{},isTree:!1,isGroupBy:!0};if(c.set(I,E),r){let D=E.pivotDeepMap=new te,M=R[P].pivot;d(D,M,r,0,f)}A.length&&I.pop()}S?.()});let y={deepMap:c,groupParams:o,initialData:e,reducerResults:g};return r&&(y.topLevelPivotColumns=p,y.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(h=>h.field).join(", ")}]}),y}function cm(o,e,t,n,r,i,a,l,s,u=oi){let{items:c,reducerResults:d,pivotDeepMap:p}=o.get(e);if(c.push(n),a&&Ta(n,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:y,toKey:h}=i[f],b=g?n[g]:null;y&&(Tn.data=n,Tn.field=g,b=y(Tn));let T=(h||u)(b,n);t.push(T),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:to(s),items:[]}));let{reducerResults:S,items:C}=p.get(t);C.push(n),a&&Ta(n,r,a,S,e)}t.length=0}}function fm(o,e,t,n,r,i,a,l){let{isLeafNode:s,getNodeChildren:u,toKey:c}=o,d=c(r),p=[...n,d],f=s(r);if(t.set(p,!0),f){for(let h=0,b=n.length;h<=b;h++){let T=n.slice(0,h),S=e.get(T),{reducerResults:C,items:I}=S;I.push(r),S.leavesAvailableCount++,S.totalLeafNodesCount++,a&&Ta(r,i,a,C,T)}return}let m=to(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 y=u(r);if(!(!y||!Array.isArray(y))){for(let h=0,b=y.length;h<b;h++){let T=y[h];fm(o,e,t,p,T,h,a,l)}a&&ni(a,m,g)}}function Ks(o,e){let{reducers:t,marker:n}=o;if(n){let u=Object.keys(t??{});n.start({details:u.length>0?[{name:"Reducers",value:u.join(", ")}]:void 0})}let r=Hs(t),i=to(r),a=new te,l=new te;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 u=0,c=e.length;u<c;u++)fm(o,a,l,[],e[u],u,t,r);t&&ni(t,i,e);let s={deepMap:a,treeParams:o,treePaths:l,initialData:e,reducerResults:i};return n&&n.end(),s}function Ia(o,e){let{marker:t,groupBy:n,defaultToKey:r=oi,pivot:i,reducers:a}=o;t&&t.start();let l=n.length,s=i?new te:void 0,u=new te,c=[],d=[],p=Hs(a),f=to(p);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:to(p)};i&&(g.pivotDeepMap=new te),u.set(c,g)}for(let g=0,y=e.length;g<y;g++){let h=e[g],b={};for(let T=0;T<l;T++){let{field:S,groupField:C,valueGetter:I,toKey:R}=n[T],v=S?h[S]:null;I&&(Tn.data=h,Tn.field=S,v=I(Tn));let P=(R||r)(v,h);if(b[S||C]=P,c.push(P),!u.has(c)){let w={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...b},childrenLoading:!1,childrenAvailable:!1,reducerResults:to(p)};i&&(w.pivotDeepMap=new te),u.set(c,w)}cm(u,c,d,h,g,i,a,s,p,r)}l||cm(u,c,d,h,g,i,a,s,p,r),a&&Ta(h,g,a,f,c),c.length=0}a&&(u.visitDepthFirst((g,y,h,b)=>{ni(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:T,reducerResults:S},C,I,R)=>{ni(a,S,T),R?.()}),b?.()}),ni(a,f,e));let m={deepMap:u,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 mm(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 QT(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.length,{items:s,reducerResults:u,pivotDeepMap:c,commonData:d}=e,p=d??null,f;if(Object.keys(u).length>0){p={...d},f={};for(let b in i)if(i.hasOwnProperty(b)){let S=i[b].field;S&&(f[S]=u[b]),S&&p[S]==null&&(p[S]=u[b])}}let m=!0,g=n[n.length-1],y=g;if(p!=null){let b=t[n.length-1];b&&b.field&&(y=p[b.field]),b&&b.toKey&&(y=b.toKey(y,p)),y=y??g}return typeof y=="string"&&y.startsWith(dm)&&(m=!1,y=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:$o,hasSelectedCells:$o,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:y,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:c,groupNesting:l,reducerResults:u}}function Ca(o,e,t){return{...o,id:`duplicate_row_on_page_${t}_for__${o.id}`,indexInAll:e,duplicateOf:o.id}}function ni(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 gm(o,e,t,n,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:u,treeResult:c,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:y,rowsPerPage:h}=r,{deepMap:b}=c,T=o.length,S=t[t.length-1],C=S?S.nodeExpanded:!0;for(let I=0;I<T;I++){let R=o[I],v=u(R,I),P=[...e,v];if(l(R)){let _={id:v,nodePath:P,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:$o,hasSelectedCells:$o,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...n,I],indexInParent:I,indexInAll:C?i.length:-1};p&&(_.rowSelected=p(_)),d&&(_.rowDisabled=d(_)),f&&f(_);let N=y&&h!=null&&h>0&&_.indexInAll%h===0?_.indexInAll/h:null;for(let L=0,O=t.length;L<O;L++){let K=t[L];if(C||(K.collapsedLeafNodesCount+=1),K.deepRowInfoArray.push(_),N!=null&&C){if(typeof y=="function"&&y(K)!==!0)continue;let j=Ca(K,_.indexInAll,N);i[j.indexInAll]=j,_.indexInAll++}}C&&(i[_.indexInAll]=_);continue}let A=b.get(P)?.totalLeafNodesCount??0,E={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:P,id:v,data:R,indexInAll:i.length,indexInParent:I,indexInParentNodes:[...n,I],totalLeafNodesCount:A,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:$o,hasSelectedCells:$o,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(E.rowSelected=p(E),g)){let _=g.getSelectionCountFor(E.nodePath);E.selectedLeafNodesCount=_.selectedCount,E.deselectedLeafNodesCount=_.deselectedCount}d&&(E.rowDisabled=d(E)),f&&f(E);let D=!0;if(m&&(E.selfExpanded=D=m(E)),C||(D=!1),E.nodeExpanded=D,C&&y&&h!=null&&h>0){let _=E.indexInAll,N=E.parentNodes;if(N.length>0&&_%h===0){let L=_/h,O=0;N.forEach(K=>{typeof y=="function"&&y(K)!==!0||(i.push(Ca(K,_+O,L)),O++,E.indexInAll++)})}}C&&(i[E.indexInAll]=E);let M=s(R);Array.isArray(M)&&gm(M,P,[...t,E],E.indexInParentNodes,r,i)}return i}function hm(o){let{dataArray:e,marker:t}=o;t&&t.start();let n=[];return gm(e,[],[],[],o,n),t&&t.end(),{data:n}}function ym(o){let{marker:e,lazyLoad:t,groupResult:n,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:u,isRowSelected:c,rowSelectionState:d,generateGroupRows:p,reducers:f={}}=o,{groupParams:m,deepMap:g,pivot:y}=n,{groupBy:h}=m;e&&e.start({details:[{name:"Group by fields",value:h.map(I=>I.field).join(", ")}]});let b=[],T=[],S=[],C=[];return g.visitDepthFirst((I,R,v,P)=>{let w=I.items,x=R.length,A=s?.isGroupRowCollapsed(R)??!1;C.push(v);let E=QT({lazyLoad:t,groupBy:h,parents:Array.from(S),reducers:f,indexInGroup:v,indexInParentGroups:Array.from(C),indexInAll:b.length,groupKeys:R,error:I.error,totalChildrenCount:I.totalChildrenCount,childrenLoading:(I.childrenLoading||!A&&!I.childrenAvailable)&&t,childrenAvailable:I.childrenAvailable,directChildrenCount:R.length===h.length?I.items.length:g.getDirectChildrenSizeFor(R),directChildrenLoadedCount:0},I);if(c&&(E.rowSelected=c(E),d)){let L=d.getSelectionCountFor(E.groupKeys);E.selectedChildredCount=L.selectedCount,E.deselectedChildredCount=L.deselectedCount}u&&(E.rowDisabled=u(E));let D=S[S.length-1],M=D?.collapsed??!1;M&&(A=!0),E.collapsed=A;let _=p||A;if(M&&(_=!1),_){if(i&&r!=null&&r>0){let L=E.indexInAll,O=E.parents;if(O.length>0&&L%r===0){let K=L/r,j=0;O.forEach(k=>{typeof i=="function"&&i(k)!==!0||(b.push(Ca(k,L+j,K)),j++,E.indexInAll++)})}}b.push(E),T.push(b.length-1)}E.collapsedChildrenCount=0,S.forEach(L=>{L.deepRowInfoArray.push(E),L.collapsedGroupsCount+=A?1:0}),D&&E.selfLoaded&&t&&(D.directChildrenLoadedCount+=1),a&&a(E),S.push(E);let N=!0;if(N){if(P)P();else if(!y){let L=b.length;A||(b.length+=w.length);let O=0;for(let K=0,j=w.length;K<j;K++){let k=w[K];if(!A&&i&&r!=null&&r>0){let ie=L+K+O;if(ie%r===0){let pe=ie/r;S.forEach(ue=>{if(typeof i=="function"&&i(ue)!==!0)return;let le=L+K+O;b[le]=Ca(ue,le,pe),O++,b.length++})}}let Q=L+K+O,$={id:k?l(k,Q):`${R}-${K}`,data:k,isCellSelected:$o,hasSelectedCells:$o,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!k,rowSelected:!1,rowDisabled:!1,rootGroupBy:h,collapsed:A,groupKeys:R,parents:Array.from(S),indexInParentGroups:[...C,K],indexInGroup:K,indexInAll:Q,groupBy:h,groupNesting:x+1,groupCount:E.groupCount};c&&($.rowSelected=c($)),u&&($.rowDisabled=u($)),a&&a($),S.forEach((ie,pe)=>{pe===S.length-1&&k&&(ie.directChildrenLoadedCount+=1),A&&(ie.collapsedChildrenCount+=1),ie.deepRowInfoArray.push($)}),A||(b[L+K+O]=$)}}}S.pop(),C.pop()}),e&&e.end(),{data:b,groupRowsIndexes:T}}var Ra=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 te(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 te(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 Rt=class extends Ra{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 Ht(){let o=Pe().performance?.now();return`${Date.now()}:${o}`}function Bs(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function Ws(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 js(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 bm({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={},u={},c=pt(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Ws({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")&&c();let d=!i&&l.length===1;return o.visitDepthFirst((f,m,g,y)=>{if(m=[...m],t==="end"&&y?.(),m.length===a){let h=e[m.length-1],T=m.slice(0,-1).join("/");if(!d){let S=T;T=m.join("/");let C=m[m.length-1];u[T]=js({header:`${C}`,columnGroup:S,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:h,pivotIndex:m.length-1,pivotGroupKey:C})}l.forEach((S,C)=>{let I=d?`${m[m.length-1]}`:S.name||S.id,R=Ws({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:S,pivotAggregatorIndex:C,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:h,columnGroup:T,header:I,valueFormatter:({rowInfo:P})=>P.isGroupRow?P.pivotValuesMap?.get(m)?.reducerResults[S.id]:null}),v=`${S.id}:${m.join("/")}`;s[v]=R})}else{let h=m.join("/"),b=m.slice(0,-1);if(u[h]=js({columnGroup:b.length?b.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 T=e[m.length-1],S=b.length?b.join("/"):void 0;if(!d){let C=S;S=`total:${m.join("/")}`,u[S]=js({header:`${m[m.length-1]} total`,columnGroup:C,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:T,pivotGroupKey:m[m.length-1]})}l.forEach((C,I)=>{let R=d?`${m[m.length-1]} total `:`${C.name||C.id} total`,v=Ws({columnGroup:S,header:R,pivotAggregator:C,pivotAggregatorIndex:I,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:T,pivotIndex:m.length-1,pivotBy:e,valueFormatter:({rowInfo:P})=>P.isGroupRow?P.pivotValuesMap?.get(m)?.reducerResults[C.id]:null});s[`total:${C.id}:${m.join("/")}`]=v})}}(t==="start"||t===!1)&&y?.()}),(!a&&t==="end"||n==="end")&&c(),{columns:s,columnGroups:u}}var JT=()=>{};function Sm(o,e){let t=new te,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 u=0;u<s.length;u++){let c=s.slice(0,u);t.has(c)||t.set(c,void 0)}t.set(s,l)}function a(l,s){let u=t.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let c of u){let d=[...l,c[c.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 Tm(o,e,t,n){let{isLeafNode:r,getNodeChildren:i,toKey:a}=o,{onParentNode:l,onNode:s,onLeafNode:u}=e,c=a(n),d=[...t,c],p=r(n),f=pt(()=>{let m=i(n);if(!(!m||!Array.isArray(m)))for(let g=0,y=m.length;g<y;g++){let h=m[g];Tm(o,e,d,h)}});p?(u?.(n),s?.(n,JT)):(l?.(n,f,i(n)),s?.(n,f))}function Cm(o,e,t){for(let n=0,r=t.length;n<r;n++)Tm(o,e,[],t[n])}var eC=function(o,e){return o-e},tC=function(o,e){return o=`${o}`,e=`${e}`,o.localeCompare(e)},oC=function(o,e){return o-e},nC={number:eC,string:tC,date:oC},Yo=nC;function Im(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 oo=(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(Rm(Im(o),n)),r&&r.end(),e},wa=(o,e,t)=>{let{marker:n}=t;n&&n.start();let r=Rm(Im(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,u=d=>d[l],c=d=>d[l]===void 0;return Cm({isLeafNode:t.isLeafNode??c,getNodeChildren:t.getNodeChildren??u,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};oo.knownTypes=Yo;var rC=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=oo.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(oo.knownTypes).join(", ")}`)}return r||(r=Yo.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,u=r(l,s);return u===0?u:n*u}},iC=o=>o.map(rC).filter(e=>e instanceof Function),Rm=(o,e)=>{let t=iC(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}};function rr(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||oi)(l,o);return t.push(s),t},[])}var Oe=class o{constructor(e,t,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new te;this.deselectedMap=new te;this.onlyUsePrimaryKeys=!1;this.selectionCache=new te;this.selectionCountCache=new te;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?rr(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 u=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,u),u}if(r&&this.onlyUsePrimaryKeys){let u=this.getAllPrimaryKeysInsideGroup(e),c=0,d=0;u.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}c++}else{if(this.selectedMap.has([f])){c++;return}d++}});let p={selectedCount:c,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 u=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,c=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,f=c-(d+p),m={selectedCount:d+(u?f:0),deselectedCount:p+(u?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let u=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=u,l=this.deselectedMap.getAllChildrenSizeFor(e),l===u&&(a=0)):(l=u,a=this.selectedMap.getAllChildrenSizeFor(e),a===u&&(l=0))}i.forEach(u=>{let c=this.selectedMap.get(u),d=this.deselectedMap.get(u),p=c?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(u,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};function va(o,e){return new Oe(o,gt(e))}function gt(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 wm(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 Oe))throw"Invalid row selection";let a=new Oe(r,gt(e));a.selectAll(),t.rowSelection=a},deselectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Oe))throw"Invalid row selection";let a=new Oe(r,gt(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=e();if(l==="single-row")return a===r;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Oe))throw"Invalid row selection";if(!i){let c=s.getDataForPrimaryKey(r);i=c?rr(c,u):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=e();if(l==="single-row"){t.rowSelection=r;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof Oe))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?rr(d,u):[]}let c=new Oe(a,gt(e));c.selectRow(r,i),t.rowSelection=c},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:u}=e();if(a==="single-row"){t.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof Oe))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?rr(d,u):[]}let c=new Oe(l,gt(e));c.deselectRow(r,i),t.rowSelection=c}},toggleRowSelection(r,i){this.isRowSelected(r,i)?this.deselectRow(r,i):this.selectRow(r,i)},selectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Oe))throw"Invalid row selection";let s=new Oe(a,gt(e));s.selectGroupRow(r),t.rowSelection=s},deselectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Oe))throw"Invalid row selection";let s=new Oe(a,gt(e));s.deselectGroupRow(r),t.rowSelection=s},toggleGroupRowSelection(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof Oe))throw"Invalid row selection";let s=new Oe(a,gt(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,u=i?new Oe(i,gt(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(u instanceof Oe))throw"Invalid row selection";return u.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Oe(r,gt(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 u=i.toPrimaryKey(s);a.isRowSelected(u)&&l.push(u)}),l}}}var aC="*",je=class{constructor(e){this.wildcard=aC;this.cache=new te;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 u=this.deselectedColumnsToRows.get(t),c=this.selectedColumnsToRows.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),c?.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 u=this.deselectedRowsToColumns.get(t),c=this.selectedRowsToColumns.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),c?.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(u=>{this.cache.delete(u)}),this.cache.delete(s),n)if(this.defaultSelection){let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1);let c=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(c?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let u=this.deselectedRowsToColumns.get(e);u&&u.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 c=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(c?.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){Eo(`${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),u=this.deselectedRowsToColumns.get(this.wildcard),c=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)||u?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():c?.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 vm=Symbol("CLEAR"),Cn=class o{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new te;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=vm,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(vm);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=()=>te.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:te.clone(e.nodePathToData),n}};function qo(o,e){return e().dataArray[o]}function Pa(o){return o().dataArray}var st=class{constructor(e){this.collapsedPathsMap=new te;this.expandedPathsMap=new te;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 lC=(o,e)=>o.length-e.length,nt=class o{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new te;this.cache=new te;this.strictMode=!1;let n=e instanceof Object.getPrototypeOf(this).constructor,r=n?e.getState():e;this.setConfig(t||(n?e.config:{treePaths:new te})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?Array.isArray(e)?new te(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 te(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(lC);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,u=0,c=this.getNodeBooleanSelectionStateFromParent(e);c?s+=r:u+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(f);if(c?(s-=g,u+=g):(u-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:u})}if(!s&&!u)return this.cacheIt(e,{selected:c,selectedCount:c?r:0,deselectedCount:c?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:u,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 xa(o,e){return new nt(o,ir(e))}function ir(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 nt))throw"Invalid tree selection";let a=new nt(r,ir(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 st({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new st({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new st(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 st(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 st(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?qo(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 nt))throw"Invalid node selection";let n=new nt(e,ir(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 nt))throw"Invalid node selection";let n=new nt(e,ir(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 nt))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 ar=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 wt=class extends ar{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 $s=1e3;function Pm(o){return new Us(o)}var Us=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=>qo(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?$s:r;return isNaN(a)||(a=$s),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 u=c=>t.position==="start"?[...e,...c||[]]:[...c||[],...e];return this.updateChildrenByNodePath(u,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 wt(n):new wt({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 wt({enabledRows:!0,disabledRows:[]});return}let t=new wt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new wt({disabledRows:!0,enabledRows:[]});return}let t=new wt(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?Cn.clone(t,{light:!0}):new Cn({nodesKey:n?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((c,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],c,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof c=="function"?i.updateChildren(a.nodePaths[d],c,p,a.metadata):i.updateNodePath(a.nodePaths[d],c,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(c=>{let d=this.getDataByPrimaryKey(c);d&&i.delete(c,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(c=>{let d=this.getDataByNodePath(c);d&&i.deleteNodePath(c,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,u=a.nodePath;u?a.array.forEach(c=>{i.insertNodePath([...u],c,s,a.metadata),l=this.toPrimaryKey(c),u.pop(),u.push(l),s="after"}):a.array.forEach(c=>{i.insert(l,c,s,a.metadata),l=this.toPrimaryKey(c),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??$s,i=n.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(u=>{let c,d;l=p=>{clearTimeout(d),c=p,n.waitForNodePathPromises.delete(e),u(p)},d=setTimeout(()=>{c===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 Dm(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:u,filterValue:c,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((y,h)=>y||typeof h!="function"?l.has(h):!1,!1),t))break}if(u&&u.length){if(l===!0)n=!0;else for(let m of u)if(m.field&&l.has(m.field)){n=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),c&&c.length)if(l===!0)i=!0;else for(let m of c){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 Ea(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 Aa(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 Ma(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 sC=Ue("IT:InfiniteTable"),uC="#dc3545",cC="#eb9316";var Em="Warn",Am="Error",dC="Info",pC="Success",fC="Logs",_a=sC.extend(fC),kL=_a.extend(dC),mC=_a.extend(Em),gC=_a.extend(Am),zL=_a.extend(pC);var hC=cC,yC=uC;var bC=(o,e)=>{e=e?e.extend?e.extend(Em):e:mC,e(typeof e.color=="function"?e.color(hC,o):o)},SC=(o,e)=>{e=e?e.extend?e.extend(Am):e:gC,e(typeof e.color=="function"?e.color(yC,o):o)};var xm=new te,Mm=(o,...e)=>{xm.has(e)||(xm.set(e,!0),o())};var lr=(o,e=o,t)=>{Mm(()=>bC(o,t),e,"warn")},_m=(o,e=o,t)=>{Mm(()=>SC(o,t),e,"error")};var Ys=new WeakMap,TC=o=>o;function Om(o,e=50,t){Ys.set(o,{lastCallTime:0,lastCallArg:null});let n=t??TC;return r=>{let{lastCallTime:i,lastCallArg:a}=Ys.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,u=bt(n(a),n(r));s<e&&u||(Ys.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var Oa=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new te;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 u=n&&!n.isEmpty();if(u&&(e=e.concat()),!e.length&&n){if(!n.isEmpty()){let c=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let d=0,p=c.length;d<p;d++){let f=c[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 c=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];u&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let g=!1;if(m!=null){let y=r(m),h=s?[...p,y]:void 0,b=s&&!!h,T=b?n?.getMutationsForNodePath(h):n?.getMutationsForPrimaryKey(y);if(T&&T.length){for(let S=0,C=T.length;S<C;S++){let I=T[S];if(I.type==="delete"&&!g&&(b?this.removeNodePath(h,t):this.remove(y),g=!0,d.splice(f,1),f--),I.type==="update"&&!g&&(m={...m,...I.data},d[f]=m),I.type==="update-children"&&!g){let R=I.children(m[l],m);m={...m},R!==void 0?m[l]=R:delete m[l],d[f]=m}I.type==="insert"&&(I.position==="before"?(d.splice(f,0,I.data),f--):d.splice(f+1,0,I.data))}b?n?.removeNodePathInfo(h):n?.removeInfo(y)}if(!g)if(b){this.addNodePath(h,m);let S=a(m),C=S?null:i(m);!S&&Array.isArray(C)&&(p.push(y),u&&(m[l]=C=C.concat()),c(C,p),p.pop())}else this.add(y,m)}}};c(e,[])}return e}}};var CC=Object.freeze([]),Nm=(o,e)=>{let t=o??CC,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};function Na(o,e){if(o===e)return!0;if(o==null||e==null)return o===e;if(typeof o!=typeof e)return!1;if(Array.isArray(o)&&Array.isArray(e)){if(o.length!==e.length)return!1;for(let t=0,n=o.length;t<n;t++)if(!Na(o[t],e[t]))return!1;return!0}if(typeof o=="object"){let t=Object.keys(o),n=Object.keys(e);if(t.length!==n.length)return!1;for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!Na(o[r],e[r]))return!1;return!0}return!1}function IC(o,e){return!(o===void 0||e===void 0||o.isGroupRow!==e.isGroupRow||o.dataSourceHasGrouping!==e.dataSourceHasGrouping||o.isTreeNode!==e.isTreeNode||o.isTreeNode&&o.isParentNode!==e.isParentNode)}var Fa={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},Fm={...Fa,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},RC={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},wC={...Fa,...RC,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,reducerData:!0,isGroupRow:!0,duplicateOf:!1,deepRowInfoArray:!1,error:!0,reducerResults:!0,groupCount:!0,groupData:!0,selectedChildredCount:!0,deselectedChildredCount:!0,totalChildrenCount:!0,collapsedChildrenCount:!0,collapsedGroupsCount:!0,directChildrenCount:!0,directChildrenLoadedCount:!0,pivotValuesMap:!0,childrenAvailable:!0,childrenLoading:!0},Lm={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},vC={...Fa,...Lm,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},PC={...Fa,...Lm,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},DC=Object.entries(Fm).map(([o,e])=>e?o:void 0).filter(Boolean),xC=Object.entries(Fm).map(([o,e])=>e?o:void 0),EC=Object.entries(wC).map(([o,e])=>e?o:void 0),AC=Object.entries(vC).map(([o,e])=>e?o:void 0),MC=Object.entries(PC).map(([o,e])=>e?o:void 0);function _C(o,e){if(o===e)return!0;if(!o||!e||!IC(o,e)||o.id!==e.id||o.data!==e.data&&!Na(o.data,e.data))return!1;let t=[];o.dataSourceHasGrouping?t=o.isGroupRow?EC:xC:o.isTreeNode?t=o.isTreeNode&&o.isParentNode?MC:AC:t=DC;for(let n of t){let r=o[n],i=e[n];if(!(typeof r=="function"||typeof i=="function")&&!Na(r,i))return!1}return!0}function km(){let o=[],e=new Map,t=new Set,n={dataSourceState:void 0,previousDataSourceState:void 0},r=(p,f)=>{let m=o,g=f?.marker,h=p!==m&&t.size>0;h&&(n={dataSourceState:f?.dataSourceState,previousDataSourceState:f?.previousDataSourceState}),g&&g.start({details:[{name:"new dataArray length",value:p.length},{name:"old dataArray length",value:m.length}]});let b=[],T=l();for(let S of T){let C=m[S],I=p[S];if(I===void 0){b.push(S);continue}_C(C,I)||b.push(S)}o=p,(b.length>0||h)&&queueMicrotask(()=>{for(let S=0,C=b.length;S<C;S++){let I=b[S],R=e.get(I);if(R)for(let v of R)v()}if(h)for(let S of Array.from(t))S()}),g&&g.end({details:[{name:"updated row infos",value:b.length}]})},i=p=>o[p],a=(p,f)=>{let m=e.get(p);return m||(m=new Set,e.set(p,m)),m.add(f),()=>{let g=e.get(p);g&&(g.delete(f),g.size===0&&e.delete(p))}},l=()=>Array.from(e.keys());return{notifyDataArray:r,getRowInfoAtIndex:i,subscribeToRowIndex:a,subscribeToDataArrayChange:p=>(t.add(p),()=>{t.delete(p),t.size===0&&(n={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>n,getDataArray:()=>o,clear:()=>{o=[],e.clear(),t.clear(),n={dataSourceState:void 0,previousDataSourceState:void 0}}}}var To=new Map,Co=new Map,Xo=new Map,Io=new Map,no=new Map;var OC=Symbol("cursorId"),zm=o=>o.totalLeafNodesCount===0,NC=o=>o.isParentNode?!zm(o):!0;function Vm(o){let e=Date.now(),t=[],n=[],r=new te;return{logger:_t(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:km(),indexer:new Oa,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 te,waitForNodePathPromises:new te,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new te,dataParams:void 0,onCleanup:Se(),notifyScrollbarsChange:Se(),notifyScrollStop:Se(),notifyRenderRangeChange:Se(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:OC,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 FC(o){let e={...o};return delete e.originalDataArray,e}var LC=[],Gm=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(),o.rowInfoStore.clear()},Hm=(o,e)=>({onDataParamsChange:t=>t?Om(t,100,FC):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??zm,isNodeSelectable:t=>t??NC,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=>({...ko,...t}),sortTypes:t=>({...Yo,...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 wt)return t;let n=o.propsCache.get("rowDisabledState")??Kt,r=n.get(t);return r||(r=new wt(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=>Nm(t,o.propsCache.get("sortInfo")),groupBy:t=>t??LC});function kC(o,e){return typeof o=="function"?o({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):o}var Kt=new WeakMap;function zC(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 VC={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Km(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.
|
|
1
|
+
"use strict";var jb=Object.create;var hi=Object.defineProperty;var $b=Object.getOwnPropertyDescriptor;var Ub=Object.getOwnPropertyNames;var Yb=Object.getPrototypeOf,qb=Object.prototype.hasOwnProperty;var Xb=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),Zb=(o,e)=>{for(var t in e)hi(o,t,{get:e[t],enumerable:!0})},Xu=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ub(e))!qb.call(o,r)&&r!==t&&hi(o,r,{get:()=>e[r],enumerable:!(n=$b(e,r))||n.enumerable});return o};var W=(o,e,t)=>(t=o!=null?jb(Yb(o)):{},Xu(e||!o||!o.__esModule?hi(t,"default",{value:o,enumerable:!0}):t,o)),Qb=o=>Xu(hi({},"__esModule",{value:!0}),o);var ln=Xb((Cx,Jd)=>{"use strict";Jd.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 QR={};Zb(QR,{AutoScroller:()=>mn,CellSelectionState:()=>$e,DRAG_ITEM_ATTRIBUTE:()=>Rt,DataClient:()=>Hu,DataSource:()=>bI,DataSourceActionType:()=>vg,DeepMap:()=>te,DragDropProvider:()=>Bi,DragInteractionTarget:()=>Zn,DragList:()=>Ko,FixedSizeSet:()=>yl,FlashingColumnCell:()=>Pb,GroupRowsState:()=>wt,INTERNAL_MatrixDebugger:()=>xb,InfiniteTable:()=>so,InfiniteTableClassName:()=>Zt,InfiniteTableComponent:()=>gb,Menu:()=>$t,RowDetailCache:()=>ur,RowDetailState:()=>xt,RowDisabledState:()=>vt,RowSelectionState:()=>Ne,TreeDataSource:()=>jR,TreeExpandState:()=>ut,TreeGrid:()=>bb,TreeSelectionState:()=>rt,WeakFixedSizeSet:()=>Sl,alignNode:()=>el,components:()=>ZR,createDefaultProxy:()=>Cs,createFlashingColumnCellComponent:()=>Ku,debounce:()=>_t,debug:()=>Ue,defaultDragProxyMove:()=>Is,defaultFilterTypes:()=>ko,eventMatchesKeyboardShortcut:()=>Qa,filterDataArray:()=>Js,filterTypes:()=>ko,flatten:()=>bm,getComponentStateRoot:()=>Nt,group:()=>Ra,interceptMap:()=>Tb,keyboardShortcuts:()=>Sb,multisort:()=>no,multisortNested:()=>va,queryKeyToCacheKey:()=>xn,toTreeDataArray:()=>Rm,useComponentState:()=>Ft,useDataSourceApi:()=>wg,useDataSourceInternal:()=>sr,useDataSourceSelector:()=>Oe,useDataSourceState:()=>Ka,useDragDropProvider:()=>fo,useDragListContext:()=>gn,useEffectWhen:()=>Cl,useEffectWhenSameDeps:()=>Cb,useEffectWithChanges:()=>Rn,useEffectWithObject:()=>cI,useGridScroll:()=>cl,useInfiniteColumnApi:()=>db,useInfiniteColumnCell:()=>Gr,useInfiniteColumnEditor:()=>Zi,useInfiniteColumnFilterEditor:()=>Hn,useInfiniteHeaderCell:()=>_r,useInfinitePortalContainer:()=>Ly,useInfiniteTableApi:()=>cb,useLayoutEffectWithChanges:()=>uI,useManagedDataSource:()=>cu,useMasterRowInfo:()=>_o,useOverlay:()=>ao,useOverlayPortal:()=>Hh,usePrevious:()=>Fo,useRowInfoReducers:()=>SI,useVisibleColumnSizes:()=>xy,withSelectedLeafNodesOnly:()=>Gu});module.exports=Qb(QR);function _t(o,{wait:e}){let t=null;return function(...n){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{o.apply(r,n)},e)}}var ve=W(require("react"));var oe=(...o)=>o.filter(e=>!!`${e}`).join(" ");var on=W(require("react")),Ol=require("react");var Jb=W(require("react")),Eo=require("react");var An=(o,e,t={debounce:0})=>{let n=t.debounce??0,r=window.ResizeObserver,i=n?_t(e,{wait:n}):e,a=new r(l=>{let s=l[0],{width:u,height:c}=s.contentRect;if(s.borderBoxSize?.[0])c=s.borderBoxSize[0].blockSize,u=s.borderBoxSize[0].inlineSize;else{let d=o.getBoundingClientRect();c=d.height,u=d.width}i({width:u,height:c})});return a.observe(o),()=>{a.disconnect()}};var yi=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=(0,Eo.useRef)({width:0,height:0}),r=i=>{let a;return o.current&&(a=An(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,Eo.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),(0,Eo.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};function Se(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,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,u=t.length;s<u;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function pt(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var Zu=(o,e)=>o-e;var bi=(o,e)=>Zu(o.revision,e.revision),te=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),u=!a;if(i!==void 0){if(i<0)return;i--}let c=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,g=p===this.emptyKey;if(g&&!u)return;let h=g?[]:[...e,p],y=m?()=>this.visitWithNext(h,t,n,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let b=t(f.value,h,l,y,f);if(n&&b===!0)return!0;l++}else y?.()};s&&(c(void 0,this.emptyKey),u=!1,l=0);for(let[d,p]of r){let f=c(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,u)=>{!u.map&&u.hasOwnProperty("value")&&(r?i.push(u):a.push(t(u)))},n),r?i.sort(bi).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)},u=this.map,c,d=!1;if(e.length)for(let p=0,f=e.length;p<f;p++){let m=e[p];if(c=u.get(m),!c||!c.map)if(d=!0,p===f-1){d=!0;break}else return[];u=c.map}else if(!n&&u.has(this.emptyKey))return[[]];return c&&c.value!==void 0&&(n||(s({...c,keys:e}),d=!0)),d?i?a.sort(bi).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,h)=>{s({...h,keys:f})},!1,u,r,n),i?a.sort(bi).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 u=0,c=e.length;u<c;u++){let d=e[u];if(l=a.get(d),!l||!l.map)if(s=!0,u===c-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,(u,c,d,p,f)=>{t(c,u,{...f,keys:c}),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],u=a===l-1,c=t.get(s);if(u){c&&(c.hasOwnProperty("value")&&(delete c.value,delete c.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),c.map&&c.map.size===0&&delete c.map,c.map||t.delete(s));break}else{if(!c||!c.map){i=!1;break}r.push(c),t=c.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],u=e[e.length-1],c=s?.get(u);c&&(delete c.map,c.hasOwnProperty("value")||s.delete(u))}}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],u=pt(()=>{if(l)for(let[c]of l){let d=this.visitKey(c,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let c=r(a,s,u);if(i&&c===!0)return!0}u()}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(bi);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};globalThis.DeepMap=te;function Pe(){return globalThis}var Ti=["#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"],Qu=Symbol("color"),Si=new WeakMap,Pl=Se();function Dl(o=Ti){Si.set(o,o.map(e=>0))}Dl();var eS=(o=Ti)=>{let e=[];Si.has(o)?e=Si.get(o):(e=o.map(n=>0),Si.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]??Ti[0]},Rr=":",xl="*",Ju="-",tS=",",oS="debug",nS="diffdebug",tc=!1,Ir=new te,wr=new Map;function El(o,e){let t=o.split(Rr),n=new te;n.set(t,!0);let r=e.split(Rr),i=new Set(r).has(xl),a=r.indexOf(xl),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(Rr)):!0}}function oc(o,e){let t=`channel=${o}_permissions=${e}`;if(wr.has(t))return wr.get(t);let n=e.split(tS);function r(l){return wr.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(xl)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],u=s.startsWith(Ju);if(u&&(s=s.substring(Ju.length)),El(o,s))return r(!u)}for(let l=0;l<a.length;l++){let s=a[l],u=s.startsWith("-");if(u&&(s=s.substring(1)),El(o,s))return r(!u)}return r(!1)}var Ml=()=>Ue.enable??(Pe()&&Pe().localStorage?.getItem(oS))??"",rS=()=>Ue.diffenable??(Pe()&&Pe().localStorage?.getItem(nS))??`${tc}`,Al="",nc=tc;function _l(o){nc=`${rS()}`=="true",Al!==o&&(Al=o,wr.clear())}function rc(o){_l(Ml()),typeof Pe()<"u"&&Pe().addEventListener&&Pe().addEventListener("storage",function(){_l(Ml())});function e(t,n){let r=n?`${n}${Rr}${t}`:t,i=r.split(Rr),a=Ir.get(i);if(a)return a;let l=Ir.get(i.slice(0,-1)),s=(l?l.logFn:Ue.logFn)??ic,u=s,c,d=0,p=()=>c??oc(r,Al),f=eS(Ue.colors),m=Object.defineProperties((...g)=>{let h=Pl.getListenersCount(),y;if(h>0&&(y=y??Date.now(),Pl({color:f,channel:r,args:g,timestamp:y})),p()){if(y=y??Date.now(),d&&nc){let T=y-d;u(`%c[${r}]`,`color: ${f}`,`+${T}ms:`)}d=y;let b=[],S;if(g.forEach(T=>{if(T[Qu])S===void 0&&(S=!0),b.push(...T);else{if(typeof T!="string"&&typeof T!="number"){S=!1;return}b.push(`${T}%s`)}}),S){let T=[`%c[${r}]%c %s`,`color: ${f}`,"",...b,""];u(...T)}else u(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...h)=>{let y=[`%c${h.join(" ")}%c%s`,`color: ${g}`,""];return y.toString=()=>h.join(" "),y[Qu]=!0,y}},extend:{value:g=>e(g,r)},enabled:{get:()=>p(),set:g=>{c=g}},logFn:{configurable:!1,get:()=>u,set:g=>{u=g??s}},destroy:{value:()=>{Ir.delete(i)}}});return Ir.set(i,m),m}return e(o)}var ic=console.log.bind(console),ec;Object.defineProperty(rc,"enable",{get:()=>ec,set:o=>{ec=o,_l(Ml())}});var Ue=rc;Ue.colors=Ti;Ue.logFn=ic;var iS=(o,e)=>Pl.onChange(t=>{if(!t)return;let{channel:n,args:r,color:i,timestamp:a}=t;El(n,o)&&e({channel:n,color:i,args:r,timestamp:a})});Ue.onLogIntent=iS;Ue.isChannelEnabled=oc;Ue.destroyAll=()=>{Dl(),Dl(Ue.colors),Ir.clear(),wr.clear()};var Ot=o=>{let e=Ue(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},Mo=o=>{let e=Ue(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},vr=()=>vr;vr.extend=()=>vr;var bt=class{constructor(e){this.debug=vr,this.error=vr}};var ac=Mo("CSSVariableWatch"),lc=Ot("CSSVariableWatch"),sc={position:"absolute",pointerEvents:"none",width:"0px",height:"0px",lineHeight:0,fontSize:0,overflow:"hidden"};var aS=o=>{let e=(0,Ol.useRef)(0),t=on.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);yi(o.ref,t,{earlyAttach:!0}),on.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n!=null)return e.current=n,lc(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);ac(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},Pr=o=>{let e=(0,Ol.useRef)(null);aS({...o,ref:e});let t=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`,{allowInts:n=!1}=o;return on.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:sc},on.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};var Nn=require("react");function Ao(){let o=null,e=new Set;return{getSnapshot(){return o},setSnapshot(t){o=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}var uo=require("react");function St(o,e,t){if(o===e)return!0;if(!o||!e)return!1;let n=typeof o;if(n!==typeof e||n!=="object")return!1;var i=Object.keys(o),a=Object.keys(e);t&&(i=i.filter(c=>!t.has(c)),a=a.filter(c=>!t.has(c)));var l=i.length;if(a.length!==l)return!1;for(var s=0;s<l;s++){var u=i[s];if(!(t&&t.has(u))&&(o[u]!==e[u]||!Object.prototype.hasOwnProperty.call(e,u)))return!1}return!0}function uc(o,e,t){let n=(0,uo.useRef)(e);n.current=e;let r=(0,uo.useRef)(t);r.current=t;let i=(0,uo.useRef)(void 0),a=(0,uo.useRef)(!1),l=(0,uo.useCallback)(()=>{let s=o.getSnapshot(),u=n.current(s);return a.current&&r.current(i.current,u)?i.current:(i.current=u,a.current=!0,u)},[o]);return(0,uo.useSyncExternalStore)(o.subscribe,l,l)}function Ci(o,e){return uc(o,e,Object.is)}function _n(o,e){return uc(o,e,St)}var cc=W(require("react")),Nl;function On(){return Nl||(Nl=cc.createContext(null))}var dc=Ao(),pc=()=>{};function Ii(){let o=On();return(0,Nn.useContext)(o)||void 0}function Ri(){let o=Ii();return(0,Nn.useCallback)(()=>o?.getSnapshot(),[o])}function co(o){let e=On(),t=(0,Nn.useContext)(e),n=_n(t||dc,t?o:pc);return t?n??void 0:void 0}function _o(){let o=On(),e=(0,Nn.useContext)(o),n=Ci(e||dc,e?r=>r.masterRowInfo:pc);return e?n:void 0}var Fn=W(require("react")),nt=require("react");function Oo(o){if(o==null)return!1;let e=o;return!0}var No=require("react");var wi=require("react"),Ut=()=>{let[o,e]=(0,wi.useState)(0);return[o,(0,wi.useCallback)(()=>{e(t=>t+1)},[e])]};var fc=o=>{let e=(0,No.useCallback)(o,[]),t=(0,No.useRef)(!1),n=(0,No.useRef)(!1),r=(0,No.useRef)(void 0),[i,a]=Ut();t.current&&(n.current=!0),(0,No.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};var vi=require("react");function Fe(o){let e=(0,vi.useRef)(o);return e.current=o,(0,vi.useCallback)(()=>e.current,[])}var Pi=require("react"),Fo=(o,e)=>{let t=(0,Pi.useRef)(e===void 0?o:e);return(0,Pi.useLayoutEffect)(()=>{t.current=o}),t.current};var Dr={DataSource:{track:"DataSource",labels:{RemoteDataLoad:"Remote data load",TreeUnfilteredTreePaths:"Computing unfiltered tree paths",Filter:"Filter",Sort:"Sort",Group:"Group",LazyGroup:"Lazy group",Tree:"Tree",FlattenTree:"Flatten tree",Flatten:"Flatten groups",PrepareData:"Preparing data",ComputeSelectionCount:"Computing selection count",ComputeSelectionCountLazy:"Computing selection count (lazy)",PrepareRowInfo:"Preparing row info array",DiffRowInfoInStore:"setDataArray diffing in RowInfoStore"}},InfiniteTable:{track:"InfiniteTable",labels:{Render:"Rendering"}},MatrixBrain:{track:"Layout Computations",labels:{ComputeRenderRange:"Computing render range"}},ComponentState:{track:"ComponentState",labels:{PropUpdate:"Prop update"}}};var Fl=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",u=e.track||this.markerDetails.track||"Unknown";return performance.measure(s,{start:t,end:n,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:u,color:r,properties:a.length>0?a.map(c=>[c.name,c.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(Dr).reduce((t,n)=>{let r={start:e.start,end:i=>e.end({...i,track:Dr[n].track,label:i.label}),get label(){let i=Dr[n];return Object.keys(i.labels).reduce((a,l)=>{let s={start:e.start,end:u=>e.end({...u,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=Dr[n];return e.markerDetails.track=i.track,r}}),t},{})}};function at(o){return Fl.create(o)}function mc(o,e){let t=new Set;function n(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(u,c){return t.add(c),u[c]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return o.apply(this,s)}return{fn:n,propertyReads:t}}var Ll=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function xr(o){return o!==void 0}function Lo(o,e){let t=e[o];return xr(t)}var gc=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)};function lS(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=Lo(r,e)?e[r]:e[`default${Ll(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function hc(o,e,t){let{fn:n,propertyReads:r}=mc(o,{getProxyTargetFromArgs:a=>a.props,putProxyToArgs:(a,l)=>[{...l,props:a}]}),i=n(e);return r.forEach(a=>t.add(a)),i}function yc(o){let{props:e,initialSetupState:t,propsToForward:n,parentState:r,mapPropsToState:i,propsToStateSet:a}=o,l={};n&&(l=lS(n,e,t));let s={...t,...l};if(i){let u=hc(i,{props:e,state:s,oldState:null,parentState:r},a);return{...s,...u}}return s}function bc(o,e,t){let{getProps:n,getParentState:r,mapPropsToState:i,concludeReducer:a,propsToStateSet:l}=t;if(e.type==="REPLACE_STATE")return e.payload;let s=r?.()??null,u=e.payload.mappedState,c=e.payload.updatedPropsToState,d={...o};if(u&&Object.assign(d,u),i){let f=hc(i,{props:n(),state:d,oldState:o,parentState:s},l);Object.assign(d,f)}return e.type==="ASSIGN_STATE"&&Object.assign(d,e.payload),a?a({previousState:o,state:d,updatedProps:c,parentState:s}):d}function Sc(o){let{dispatch:e,getState:t,getProps:n,propsToForward:r,allowedControlledPropOverrides:i,interceptedActions:a,mappedCallbacks:l,notify:s=gc}=o,u=t();return Object.keys(u).reduce((c,d)=>{let p=d;return Object.defineProperty(c,d,{set:m=>{let g=n(),h=t(),y=!0;if(a&&typeof a[p]=="function"&&a[p](m,{actions:c,state:h})===!1&&(y=!1),y){let T=[m],C=`on${Ll(d)}Change`;if(l&&l[p]){let I=l[p](m,h);C=I.callbackName||C,T=I.callbackParams}s(g,C,T)}let b=r[p];typeof b=="function"&&(m=b(m));let S=!!i?.[p];Lo(d,g)&&!S||e({payload:{updatedProps:null,mappedState:{[d]:m}}})}}),c},{})}function Tc(o){let{currentProps:e,prevProps:t,state:n,propsToForward:r,propsToStateSet:i}=o,a={},l=0,s={},u=0,c={},d=0;return new Set([...Object.keys(e),...Object.keys(t)]).forEach(f=>{let m=f,g=t[m],h=e[m];if(m!=="children"&&g!==h&&(c[m]={newValue:h,oldValue:g},d++,Lo(m,e)||Lo(m,t)))if(r.hasOwnProperty(f)){let y=h,b=r[f];typeof b=="function"&&(y=b(h)),n[m]!==y&&(a[m]=y,l++)}else i.has(f)&&(s[m]=e[m],u++)}),{newMappedState:a,newMappedStateCount:l,updatedPropsToState:s,updatedPropsToStateCount:u,rawUpdatedProps:c,rawUpdatedPropsCount:d}}var kl;function Cc(){return kl||(kl=(0,nt.createContext)(null))}function Nt(o){let e=o.getParentState||(()=>null);function t(r){let[i]=(0,nt.useState)(()=>o.initSetupState?o.initSetupState(r):{}),a=(0,nt.useRef)(new Set),l=(0,nt.useMemo)(()=>o.forwardProps?o.forwardProps(i,r):{},[i]),s=e(),u=Fe(s);function c(){return yc({props:r,initialSetupState:i,propsToForward:l,parentState:s,mapPropsToState:o.mapPropsToState,propsToStateSet:a.current})}let[d]=(0,nt.useState)(c),p=Fe(r),f=(w,D)=>bc(w,D,{getProps:p,getParentState:()=>u?.()??null,mapPropsToState:o.mapPropsToState,concludeReducer:o.concludeReducer,propsToStateSet:a.current}),[m,g]=(0,nt.useReducer)(f,d),h=Fe(m),{allowedControlledPropOverrides:y}=o,b=(0,nt.useMemo)(()=>Sc({dispatch:g,getState:h,getProps:p,propsToForward:l,allowedControlledPropOverrides:y,interceptedActions:o.interceptActions,mappedCallbacks:o.mappedCallbacks}),[g,l,y]),S=o.Context??Cc(),T=(0,nt.useMemo)(()=>({componentState:m,componentActions:b,getComponentState:h,replaceState:w=>{g({type:"REPLACE_STATE",payload:w})},assignState:w=>{g({type:"ASSIGN_STATE",payload:w})}}),[m,b,h]),C=Fo(r),I=(0,nt.useRef)(!1);I.current=!1;let R=o.layoutEffect?nt.useLayoutEffect:nt.useEffect;return R(()=>{let w=r,{newMappedState:D,newMappedStateCount:v,updatedPropsToState:M,updatedPropsToStateCount:x,rawUpdatedProps:E,rawUpdatedPropsCount:P}=Tc({currentProps:w,prevProps:C,state:m,propsToForward:l,propsToStateSet:a.current});if(x>0||v>0){let _=m.debugId,N=_?at(_).track.ComponentState.label.PropUpdate.start():void 0,F=o.debugName?typeof o.debugName=="function"?`${o.debugName(w)}:rerender`:`${o.debugName}:rerender`:"rerender";Ot(F)("Triggered by new values for the following props",...Object.keys(D??{}),...Object.keys(M??{})),N&&N.end({label:F,details:[v>0?{name:"Updated properties",value:Object.keys(D).join(", ")}:void 0,x>0?{name:"Updated props",value:Object.keys(M).join(", ")}:void 0,x>0||M?{name:"Details",value:"The time for this marker is not accurate. The marker is only displayed so you can easily identify the props that triggered the rerender."}:void 0].filter(Oo)});let K={payload:{mappedState:v?D:null,updatedPropsToState:x?M:null}};if(I.current=!0,g(K),o.onPropChange){for(var A in E)if(E.hasOwnProperty(A)){let{newValue:j,oldValue:k}=E[A];o.onPropChange({name:A,newValue:j,oldValue:k},r,b,m)}}o.onPropsChange&&P&&o.onPropsChange(E,r,b,m)}}),R(()=>{s!=null&&!I.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),fc(()=>()=>{o.cleanup?.(h())}),{contextValue:T,ContextComponent:S}}return{ManagedComponentContextProvider:Fn.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return Fn.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function Ft(o){return o=o??Cc(),Fn.useContext(o)}var Nc=W(require("react"));var ft="Infinite",ze={rootClassName:ft};var Di=()=>ze;var Ic="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Rc={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var kt="_16lm1iw3b _16lm1iw3c _16lm1iw35",wc={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},Ln={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var xi={1:"_16lm1iw1c",none:"_16lm1iw1d"},Er={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var vc={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Pc={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Dc={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var xc={none:"_16lm1iwd"},Ec={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Ei={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Mc={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var Ac={none:"_16lm1iw1x"};var _c={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var Oc={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function Fc(o){let{rootClassName:e}=Di();return Nc.createElement("div",{...o,className:oe(`${e}Footer`,Ei.relative,Ln.flex,Er.row,o.className)})}var De=W(require("react")),So=require("react"),lm=require("react-dom");function Mi(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}function J(o){return o.slice(4,-1)}var Lc=W(require("react")),Ve=o=>{let e=o.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...o.style};return Lc.createElement("svg",{viewBox:"0 0 24 24",...o,style:t},o.children)};var zl=W(require("react"));var Ge={includesOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29","M4 18V15H2V20H22V18Z","M20 14V18H2V20H22V14Z"],startsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"],endsWithOperator:["M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"],eqOperator:["M19,10H5V8H19V10M19,16H5V14H19V16Z"],neqOperator:["M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"],gtOperator:["M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"],gteOperator:["M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"],ltOperator:["M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"],lteOperator:["M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"],done:["m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"],hidden:["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"],clear:["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 kc=o=>zl.createElement(Ve,{...o},Ge.includesOperator.map(e=>zl.createElement("path",{key:e,d:e})));var Vl=W(require("react"));var zc=o=>Vl.createElement(Ve,{...o},Vl.createElement("path",{d:Ge.endsWithOperator[0]}));var Gl=W(require("react"));var Vc=o=>Gl.createElement(Ve,{...o},Gl.createElement("path",{d:Ge.eqOperator[0]}));var Hl=W(require("react"));var Gc=o=>Hl.createElement(Ve,{...o},Hl.createElement("path",{d:Ge.gteOperator[0]}));var Kl=W(require("react"));var Hc=o=>Kl.createElement(Ve,{...o},Kl.createElement("path",{d:Ge.gtOperator[0]}));var Bl=W(require("react"));var Kc=o=>Bl.createElement(Ve,{...o},Bl.createElement("path",{d:Ge.lteOperator[0]}));var Wl=W(require("react"));var Bc=o=>Wl.createElement(Ve,{...o},Wl.createElement("path",{d:Ge.ltOperator[0]}));var jl=W(require("react"));var Wc=o=>jl.createElement(Ve,{...o},jl.createElement("path",{d:Ge.neqOperator[0]}));var $l=W(require("react"));var jc=o=>$l.createElement(Ve,{...o},$l.createElement("path",{d:Ge.startsWithOperator[0]}));var os=W(require("react"));var st=W(require("react")),Ar=require("react");var kn=W(require("react")),nn=require("react");function sS(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 uS(o){var e=sS(o,"string");return typeof e=="symbol"?e:String(e)}function cS(o,e,t){return e=uS(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function $c(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 Uc(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$c(Object(t),!0).forEach(function(n){cS(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):$c(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function Yc(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var dS=(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},be=o=>{var e=t=>{var n=o.defaultClassName,r=Uc(Uc({},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 u=o.variantClassNames[i][s];u&&(n+=" "+u)}}for(var[c,d]of o.compoundVariants)dS(c,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 Yc(o.variantClassNames,t=>Yc(t,n=>n.split(" ")[0]))}},e};var qc="_1eexc2a6";var Xc=be({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:[]}),Zc="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",Qc=be({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Jc=be({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"]]}),ed=be({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"]]}),td="_12zfob12u _16lm1iw22 _16lm1iw1z";var od="_12zfob17",nd="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",rd=be({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Ul=be({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),id="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",ad=be({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),ld="_12zfob1b _16lm1iw2",sd="_16lm1iw1",ud="_12zfob16",cd=be({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),dd="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var Dt="InfiniteIcon";var pd="_1nnkya20 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var fd={transition:"width 0.25s, opacity 0.25s"},NP=Object.keys({size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1});function zn(o){let[e,t]=(0,nn.useState)(!0),[n,r]=(0,nn.useState)(0),{lineWidth:i=1,style:a,className:l,index:s}=o,u=s!=null&&s>0,c=o.size??16,d=Math.floor(c/4),p=[c-1*d,c-2*d,c-3*d],f={...fd,borderTop:`${i}px solid currentColor`,...o.lineStyle,opacity:n};if((0,nn.useEffect)(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),(0,nn.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return kn.createElement("div",{"data-name":"filter-icon",style:{...a,width:c},className:oe(l,Dt,pd,`${Dt}-filter`)},u?kn.createElement("div",{"data-name":"index",style:m,className:od},s):null,kn.createElement("div",{style:{width:p[0],...f}}),kn.createElement("div",{style:{width:p[1],...f}}),kn.createElement("div",{style:{width:p[2],...f}}))}var Ai=Object.freeze({}),pS={string:Ai,number:{}};function Vn(o,e){let t=e.default||Ai;return o.type===void 0?t:o.type===null?Ai:typeof o.type=="string"?e[o.type]||pS[o.type]||Ai:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var ql=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=[],u=[];t.forEach((R,w)=>{let D=R.maxSize??r??void 0,v=R.minSize??n??void 0;s.push(v),u.push(D),R.size!=null&&(D!=null&&R.size>D&&(R.size=D),v!=null&&R.size<v&&(R.size=v));let M=R.flex==0?null:R.flex;if(R.size==null&&M==null)throw`Items must specify either a size or a flex property. Item at index ${w} doesn't have either of those.`;M!=null&&(l+=1),a+=M??0,i+=R.size??0});let c=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=c/a,p={},f={},m=0;t.forEach((R,w)=>{if(R.flex!=null){let D=d*R.flex,v=R.maxSize??r??void 0,M=R.minSize??n??void 0,x=!1,E=0;v!=null&&D>v&&(p[w]=!0,x=!0,E=v),M!=null&&D<M&&(f[w]=!0,x=!0,E=M),x&&(m+=1,l-=1,a-=R.flex,c-=E)}}),m&&(d=c/a);let g=[],h=0,y=c,b=a,S=0,T=0,C=[];return{items:t.map((R,w)=>{let D={...R},v=R.maxSize??r??void 0,M=R.minSize??n??void 0,x=0,E=p[w],P=f[w],A=E||P,_=R.size??0;if(R.flex!=null){if(A)P&&(x=M),E&&(x=v);else{h+=1;let N=F=>(v!=null&&F>v&&(F=v),M!=null&&F<M&&(F=M),F);h===l?x=N(y):(x=N(Math.round(R.flex*d)),T+=x,y=c-T,b-=R.flex,d=y/b)}_=x,D.flexSize=x}return g.push(x),C.push(_),D.computedSize=_,S+=_,D}),flexSizes:g,minSizes:s,maxSizes:u,computedSizes:C,remainingSize:Math.round(e-S)}};function _i(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}}function gd(o,e,t){let n=!1,r=0;for(let i of o)i.computedFlex&&(n=!0),r+=i.computedWidth;return n&&Math.round(r)>Math.round(e-t)}function Yl(o,e){return o.computedFlex&&!e?"flex":"width"}function Mr(o,e,t){if(e==="width"){let{flex:n,...r}=o??{};return{...r,width:t}}return{...o,flex:t}}var Xl=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((M,x)=>(M[x]={...o.columnSizing[x]},M),{});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],u=l.id,c=s?.id,d=gd(o.items,e,t),p=l.computedWidth,f=l.computedMinWidth,m=l.computedMaxWidth,g=Yl(l,d),h=s?.computedWidth,y=s?.computedMinWidth,b=s?.computedMaxWidth,S=s?Yl(s,d):"width",T=!1,C=!1,I=r>0?1:-1,{value:R,clamped:w,diff:D}=_i(Math.round(p+r),f,m,I);if(o.shareSpaceOnResize){if(s==null)return n[u]=Mr(n[u],g,R),C=w==="min",T=w==="max",{adjustedDiff:R-p,reservedWidth:t,columnSizing:n,minReached:C,maxReached:T,constrained:C||T};let{value:M,clamped:x,diff:E}=_i(Math.round(h-r),y,b,I);if(w&&x&&(Math.abs(D)>Math.abs(E)?x=!1:w=!1),!(!w&&!x)){if(w){let P=_i(Math.round(h-r-D),y,b,I);M=P.value,x=P.clamped,E=P.diff}else if(x){let P=_i(Math.round(p+r+E),f,m,I);R=P.value,w=P.clamped,D=P.diff}}n[u]=Mr(n[u],g,R),n[c]=Mr(n[c],S,M),C=w==="min"||x==="min",T=w==="max"||x==="max"}else n[u]=Mr(n[u],g,R),C=w==="min",T=w==="max";let v=R-p;return{adjustedDiff:v,reservedWidth:o.shareSpaceOnResize?t:Math.round(t-v),columnSizing:n,minReached:C,maxReached:T,constrained:C||T}};function md(o,e){return o+e}function fS(o){return Object.keys(o).reduce((t,n)=>(t[n]={...o[n]},t),{})}var hd=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((b,S)=>(b[S]={...o.columnSizing[S]},b),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((b,S)=>o.dragHandlePositionAfter-S).reverse(),a=i.map(b=>o.items[b]),l=a.map(b=>b.computedWidth),s=gd(o.items,e,t),u=a.map(b=>Yl(b,s)),c=0,{computedSizes:d}=ql({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(md,0)+r-c,0)}),p=a.map((b,S)=>d[S]-b.computedWidth),f=!0,m=!0,g=!0,h=[];p.forEach((b,S)=>{let T=a[S];if(!T.resizable){h.push(0);return}let C=u[S],I=l[S],R=fS(n),{maxReached:w,minReached:D,constrained:v,adjustedDiff:M}=Xl({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:b,dragHandlePositionAfter:i[S],shareSpaceOnResize:!1,items:o.items,columnSizing:R});n[T.id]=Mr(R[T.id],C,Math.round(I+M)),h.push(M),w||(m=!1),D||(f=!1),v||(g=!1)});let y=h.reduce(md,0);return{minReached:f,maxReached:m,constrained:g,adjustedDiffs:h,adjustedDiff:y,columnSizing:n,reservedWidth:Math.round(t-y)}};var Oi;function Yt(){if(Oi!=null)return Oi;let o=Pe().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),Oi=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Oi}var yd=["start",void 0,"end"],bd=(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:yd.indexOf(r)-yd.indexOf(i)}),o);function Sd(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 Zl(o,...e){return Sd(t=>t!=null,o,...e)}function Td(o,e,...t){return Sd((n,r)=>!(r in o),e,...t)}var Ni=!0,mS=!0,gS=!0,Cd="string",po="unknown";var hS=Mo("getComputedVisibleColumns"),yS=(o,e,t)=>o[t]!==!1,Ql=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1};function rn(o,e){if(o)return o[e]?o[e]:Object.values(o).find(t=>t.field===e)}function bS(o,e){let t=Vn(o,e);return o.sortType?o.sortType:t.sortType?t.sortType:typeof o.type=="string"?o.type:Cd}function SS(o,e,t){let r=(Array.isArray(o)?o:o?[o]:[]).flatMap(i=>{let a=i.field??i.groupField;if(!a)return[po];let l=rn(e,a);if(!l)return[po];let s=bS(l,t);return Array.isArray(s)?s:[s]});return r.every(i=>i===po)?po:r.length===1?r[0]:r}function Jl(o,e){let{colType:t,sortable:n,columnDefaultSortable:r}=e,i=o.defaultSortable??t.defaultSortable,a=!!o.groupByForColumn;if(i==null&&!a){let l=o.field??t.field,s=o.valueGetter??t.valueGetter;l==null&&s==null&&(i=!1)}return n??i??r??Ni}var Id=({columns:o,userColumns:e,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,scrollbarWidth:l,columnCssEllipsis:s,columnHeaderCssEllipsis:u,pinnedStartMaxWidth:c,pinnedEndMaxWidth:d,filterValue:p,sortable:f,sortInfo:m,multiSort:g,filterTypes:h=ko,viewportReservedWidth:y,resizableColumns:b,draggableColumns:S,columnDefaultDraggable:T,columnOrder:C,columnPinning:I,editable:R,columnDefaultEditable:w,columnDefaultFilterable:D,columnDefaultGroupable:v,columnDefaultSortable:M,columnSizing:x,columnTypes:E,columnVisibility:P,columnVisibilityAssumeVisible:A,groupBy:_})=>{let N=0,F={};_.forEach((B,ne)=>{B.field&&(F[B.field]=ne)});let O=(p||[]).reduce((B,ne)=>{let{id:ye,field:Te}=ne;return Te&&(B[Te]=ne),ye&&(B[ye]=ne),B},{}),K=bd(C===!0?Object.keys(o):C,I),j=K.filter(B=>o[B]?yS(P,A,B):(hS(`Column with id "${B}" specified in columnOrder array cannot be found in the columns map.`),!1)),k=new Map,Q=j.map((B,ne)=>{let ye=o[B];return k.set(B,ne),ye}),G=(m??[]).reduce((B,ne,ye)=>(ne.id?B[ne.id]={sortInfo:ne,index:ye}:ne.field&&(B[ne.field]={sortInfo:ne,index:ye}),B),{});function $(B){let ne=o[B],ye=Vn(ne,E),Te={minWidth:ye?.minWidth,maxWidth:ye?.maxWidth,width:ye?.defaultWidth,flex:ye?.defaultFlex},lt={width:ne?.defaultWidth,flex:ne?.defaultFlex,minWidth:ne?.minWidth,maxWidth:ne?.maxWidth},H=x[B];H?.width!=null&&H.flex==null&&delete lt.flex,H?.flex!=null&&H.width==null&&delete lt.width;let ke=Zl(lt,H);ke.width!=null&&delete Te.flex,ke.flex!=null&&delete Te.width,ke=Zl(Te,ke);let yt=ke.flex??void 0,se=ke.minWidth??ne?.minWidth??n,_e=ke.maxWidth??ne?.maxWidth??r,Je=yt!=null?void 0:ke.width??(a?void 0:i);return!Je&&yt==null&&(a?yt=a:Je=se),{size:Je,flex:yt,minSize:se,maxSize:_e}}let ie=ql({availableSize:Math.max(t.width-(y??0)-(l??Yt()),0),maxSize:r,minSize:n,items:j.map($)}),{computedSizes:pe,flexSizes:ue,minSizes:le,maxSizes:de}=ie,ce=[],U=[],z=[],q=[];q.length=j.length;let Y=new Map,Z=new Map,X=0,me=0,he=0,ae=null,V=[],L=0,ge=0,xe=0;Q.forEach((B,ne)=>{let ye=j[ne],Te=pe[ne],lt=V[ne]=Ql(ye,I);lt==="start"?L+=Te:lt==="end"?xe+=Te:ge+=Te});let Ee=t.width-xe,Me=[],Ae=new Map;j.forEach((B,ne)=>{let ye=Q[ne];Ae.set(B,ye)});let Ke=[];Object.keys(o).forEach(B=>{let ne=o[B];Ke.push(B),Ae.has(B)||Ae.set(B,ne)});let ot=new Map;Ae.forEach((B,ne)=>{let ye=k.get(ne);ye==null&&(ye=-1);let Te=ye!=-1,lt=j[ye+1],H=Vn(B,E),ke=ye,yt=G[ne]?G[ne]:B.field?G[B.field]??null:null,se=yt?.sortInfo??null,_e=!!se,Je=_e&&se.dir===1,xo=_e&&!Je,Bu=yt?.index??-1,Il=Te?{}:$(ne),Wu=Te?pe[ye]:Il.size||0,Mb=Te&&ue[ye]||null,Ab=Te?le[ye]||0:Il.minSize||0,_b=Te?de[ye]||1e4:Il.maxSize||1e4,Pt=Te?Ql(ne,I):!1,ju=Te?ye===j.length-1:!1,mi=ke,Ob=Te?Pt==="start"?me:Pt==="end"?he:N-me:0;Pt=="start"?mi=Te?ke:-1:Pt==="end"?mi=Te?ke-(ce.length+z.length):-1:mi=Te?ke-ce.length:-1;let Nb=Te?Pt==="start"||Pt===!1?N:Ee+he:-1,Fb=Te?Pt!==ae:!1,Lb=Te?ju||Pt!==Ql(lt,I):!1,$u=B.cssEllipsis??H.cssEllipsis??s,kb=B.headerCssEllipsis??H.cssEllipsis??B.cssEllipsis??H.headerCssEllipsis??u??$u,gi=Te&&(O[ne]||B.field||B.groupByForColumn)&&(O[ne]||O[B.field||B.groupByForColumn])||null,zb=B.defaultFilterable??H.defaultFilterable??D??!0,Vb=R??B.defaultEditable??H.defaultEditable??w??!1,Rl=B.dataType||H.dataType||(Array.isArray(B.type)?B.type[0]:B.type)||Cd,Gb=B.sortType||H.sortType||Rl,Uu=B.filterType||H.filterType||Rl,Yu=!1;if(gi!=null&&!gi.disabled){let vl=h[Uu];vl&&(!vl.emptyValues||!vl.emptyValues.includes(gi.filter.value))&&(Yu=!0)}let Mn=B.field??H.field,Hb=B.valueGetter??H.valueGetter,wl=B.defaultGroupable??H.defaultGroupable??v??!!Mn;Mn||(wl=!1),B.groupByForColumn&&(wl=!1);let qu=Mn?F[Mn]!==void 0:!1,Kb=qu?F[Mn]:void 0,Bb=Jl(B,{colType:H,sortable:f,columnDefaultSortable:M}),Wb=B.resizable??H.resizable??b??mS,Xe={colType:H,align:H.align,headerAlign:H.headerAlign,computedVisible:Te,verticalAlign:H.verticalAlign,defaultHiddenWhenGroupedBy:H.defaultHiddenWhenGroupedBy,valueGetter:Hb,valueFormatter:H.valueFormatter,renderValue:H.renderValue,render:H.render,style:H.style,className:H.className,contentFocusable:H.contentFocusable,renderMenuIcon:H.renderMenuIcon,renderSortIcon:H.renderSortIcon,renderRowDetailIcon:H.renderRowDetailIcon,renderSelectionCheckBox:H.renderSelectionCheckBox,renderHeaderSelectionCheckBox:H.renderHeaderSelectionCheckBox,headerStyle:H.headerStyle,headerClassName:H.headerClassName,columnGroup:H.columnGroup,getValueToEdit:H.getValueToEdit,getValueToPersist:H.getValueToPersist,shouldAcceptEdit:H.shouldAcceptEdit,field:Mn,...B,components:{...H.components,...B.components},computedResizable:Wb,computedMinWidth:Ab,computedMaxWidth:_b,computedFlex:Mb,computedDataType:Rl,computedEditable:Vb,computedSortType:Gb,computedFilterType:Uu,cssEllipsis:$u,headerCssEllipsis:kb,computedFilterValue:gi,computedFiltered:Yu,computedFilterable:zb,computedGroupable:wl,computedGroupedBy:qu,computedGroupedByIndex:Kb,computedWidth:Wu,computedAbsoluteOffset:Nb,computedPinningOffset:Ob,computedVisibleIndexInCategory:mi,computedOffset:N,computedSortable:Bb,computedSortInfo:se,computedSortIndex:Bu,computedMultiSort:g,computedSorted:_e,computedSortedAsc:Je,computedSortedDesc:xo,computedVisibleIndex:ke,computedPinned:Pt,computedDraggable:S??B.defaultDraggable??T??gS,computedFirstInCategory:Fb,computedLastInCategory:Lb,computedFirst:ye===0,computedLast:ju,id:ne,header:B.header??H.header??B.name??B.field};Te&&(N+=Wu,Y.set(Xe.id,Xe),q[ye]=Xe,Pt==="start"&&(ce.push(Xe),me+=Xe.computedWidth),Pt==="end"&&(U.push(Xe),he+=Xe.computedWidth),Pt||(z.push(Xe),X+=Xe.computedWidth),ae=Pt),Xe.groupByForColumn&&(Xe.computedSortType=B.sortType||H.sortType||SS(Xe.groupByForColumn,e,E),Me.push(Xe)),Z.set(Xe.id,Xe),Xe.field&&!Xe.groupByForColumn&&!ot.has(Xe.field)&&ot.set(Xe.field,Xe)}),Me.forEach(B=>{B.computedSortable=Rd(B,{fieldsToColumn:ot,userColumns:e,columnTypes:E,sortable:f,columnDefaultSortable:M})});let Ze=new Map;Ke.forEach(B=>{let ne=Z.get(B);ne&&Ze.set(B,ne)}),Z.forEach(B=>{Ze.has(B.id)||Ze.set(B.id,B)});let it=c!=null?Math.min(c,me):me,Qe=d!=null?Math.min(d,he):he;return{computedRemainingSpace:t.width-(L+xe+ge),computedPinnedStartColumnsWidth:me,computedPinnedEndColumnsWidth:he,computedUnpinnedColumnsWidth:X,computedColumnOrder:K,computedPinnedStartColumns:ce,computedPinnedEndColumns:U,computedUnpinnedOffset:me,computedPinnedEndOffset:me+X,computedUnpinnedColumns:z,computedVisibleColumns:q,computedColumnsMap:Z,computedColumnsMapInInitialOrder:Ze,computedVisibleColumnsMap:Y,computedPinnedEndWidth:Qe,computedPinnedStartWidth:it,renderSelectionCheckBox:q.reduce((B,ne)=>B||!!ne.renderSelectionCheckBox,!1),fieldsToColumn:ot}};function Rd(o,e){let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r,userColumns:i,columnTypes:a}=e;if(t)return t;let l=o.defaultSortable??o.colType.defaultSortable;if(l!=null)return l;let s=r??Ni,u=o.sortType??o.colType.sortType;return u!=null&&u!==po&&s?!0:d=>{let{column:p,api:f}=d,m=p.groupByForColumn||[];return m!=null&&!Array.isArray(m)&&(m=[m]),(m||[]).reduce((g,h)=>{if(!g)return!1;let y=h.field||h.groupField,b;if(y){let S=n.get(y),T=S?f.getColumnApi(S.id):void 0;if(S&&T)b=T.isSortable();else{let C=rn(i,y);if(C){let I=Jl(C,{colType:Vn(C,a??{}),sortable:t,columnDefaultSortable:r});b=typeof I=="boolean"?I:void 0}else b=!1}}return b===void 0&&h.valueGetter&&(b=!0),b??r??Ni},!0)}}function mt(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)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function an(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:u}=e,c=a(),{allRowsSelected:d,someRowsSelected:p,selectionMode:f}=c,m=i(),g=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let h=mt(n.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:u});g=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:h,dataSourceApi:u,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 wd=W(require("react"));var Gn=`${ft}HeaderCell__filter`,Fi=`${ft}HeaderCell__filterOperator`,uD=`${Gn}__input`;var es=wd.createContext(null);var Pd=require("react");var vd=require("react"),ts;function Li(){return ts||(ts=(0,vd.createContext)(null))}function re(o){let e=Li(),t=(0,Pd.useContext)(e);return _n(t,o)}function Be(){return re(o=>({getState:o.getState,actions:o.actions,getComputed:o.getComputed,getDataSourceState:o.getDataSourceState,dataSourceApi:o.dataSourceApi,dataSourceActions:o.dataSourceActions,api:o.api,getDataSourceMasterContext:o.getDataSourceMasterContext}))}var TS=`${Gn}__input`,ki=o=>o.stopPropagation();function Dd(o){let{filterOperatorMenuVisibleForColumnId:e}=re(c=>({filterOperatorMenuVisibleForColumnId:c.state.filterOperatorMenuVisibleForColumnId})),{column:t}=_r(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=(0,Ar.useState)(!1),l=st.useCallback(()=>{a(!0)},[]),s=st.useCallback(()=>{a(!1)},[]),u=e===t.id||i;return st.createElement("div",{onPointerUp:ki,onPointerDown:ki,onFocus:l,onBlur:s,className:`${Gn} ${Ul({active:u})}`,style:{height:o.columnHeaderHeight}},st.createElement(es.Provider,{value:o},st.createElement(r,null),st.createElement(n,null)))}function xd(){let{columnApi:o,disabled:e,operator:t}=Hn(),n=t?.components?.Icon??zn;return st.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&o.toggleFilterOperatorMenu(r.target)},className:oe(Fi,nd,e?`${Fi}--disabled`:"")},st.createElement(n,{size:20,className:`${rd({disabled:e})}`}))}function Ed(){return st.createElement("div",{onPointerUp:ki,onPointerDown:ki,className:`${Gn} ${Ul({active:!1})} ${vc["50%"]}`})}function Hn(){let o=Be(),{column:e,columnApi:t}=_r(),n=an(e,o,"column-filter"),r=st.useContext(es),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[u,c]=(0,Ar.useState)(l?.filter.value??""),d=st.useCallback(h=>{c(h),r.onChange(h)},[r.onChange]),p=st.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),f=st.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);(0,Ar.useEffect)(()=>{if(l)u!==l.filter.value&&c(l.filter.value);else if(s){let h=[...s.emptyValues][0];h!==u&&c(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:u,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${n}`,className:`${td} ${TS}`}}function Kn(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Hn();return os.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function zi(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Hn();return os.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})}var qt=(o,e)=>{let t=o?.[e];return t?{components:{Icon:t}}:{}};function Md(o={}){let{StringFilterEditor:e,NumberFilterEditor:t,icons:n}=o;return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:e?{FilterEditor:e}:void 0,operators:[{name:"includes",...qt(n,"includes"),label:"Includes",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&typeof i=="string"&&r.toLowerCase().includes(i.toLowerCase())},{label:"Equals",...qt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>typeof r=="string"&&r===i},{name:"startsWith",...qt(n,"startsWith"),label:"Starts With",fn:({currentValue:r,filterValue:i})=>r.startsWith(i)},{name:"endsWith",...qt(n,"endsWith"),label:"Ends With",fn:({currentValue:r,filterValue:i})=>r.endsWith(i)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:t?{FilterEditor:t}:void 0,operators:[{label:"Equals",...qt(n,"eq"),name:"eq",fn:({currentValue:r,filterValue:i})=>r==i},{label:"Not Equals",...qt(n,"neq"),name:"neq",fn:({currentValue:r,filterValue:i})=>r!=i},{name:"gt",label:"Greater Than",...qt(n,"gt"),fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>i},{name:"gte",...qt(n,"gte"),label:"Greater Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r>=i},{name:"lt",...qt(n,"lt"),label:"Less Than",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<i},{name:"lte",...qt(n,"lte"),label:"Less Than or Equal",fn:({currentValue:r,filterValue:i,emptyValues:a})=>a.includes(r)?!0:r<=i}]}}}var ko=Md({StringFilterEditor:Kn,NumberFilterEditor:zi,icons:{includes:kc,eq:Vc,neq:Wc,startsWith:jc,endsWith:zc,gt:Hc,gte:Gc,lt:Bc,lte:Kc}});function Vi(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 Un=require("react"),hp=require("react-dom");function zo(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 Ad(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 ee={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 _d="true",fe={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)"}}},Od="column-header-height";var Nd=`.${ze.rootClassName}`;function ns(o){return zo(o,Nd)}var Fd=J(ee.scrollLeft),CS=J(ee.scrollTop),IS=J(ee.columnWidthAtIndex),rs=J(ee.columnOffsetAtIndex),Ld=J(ee.columnReorderEffectDurationAtIndex),RS=J(ee.columnOffsetAtIndexWhileReordering),wS=J(ee.columnVisibilityAtIndex),vS=J(ee.columnZIndexAtIndex);function Xt(o,e,t){let n=t?ns(t):document.querySelector(Nd);PS(o,e,n)}function PS(o,e,t){if(t){let n=o,r=ee[n]?J(ee[n]):o;t.style.setProperty(r,`${e}`)}}function Bn(o,e){if(e)for(var t in o){let n=ee[t]?J(ee[t]):t,r=`${o[t]}`;e.style.setProperty(n,r)}}function is(o,e,t){Xt(`${rs}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${Fd}))`:`${o.computedAbsoluteOffset+e}px`,t)}function as(o,e,t){Xt(`${vS}-${o}`,`${e}`,t)}function Or(o,e,t){Xt(`${RS}-${o}`,typeof e=="number"?`calc( var(${rs}-${o}) + ${e}px )`:e,t)}function Nr(o,e,t){Xt(`${wS}-${o}`,e,t)}function Gi(o,e,t){Xt(`${Ld}-${o}`,t??"",e)}function ls(o,e){let t=`${Ld}-${o}`;Xt(t,fe.components.Cell.reorderEffectDuration,e)}var Ie={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${IS}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Xt(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`${rs}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Xt(this.varName.get(o),e,t)}}};function kd(o,e){Bn({[Fd]:`${o.scrollLeft}px`,[CS]:`${o.scrollTop}px`},e)}var zd="_16lm1iw1",Vd="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",Gd="_1yeub2vs",Hd="_1yeub2vr",Kd=be({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 ss="_1yeub2vp";var nx=be({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var Zd=require("react");var Fr={bodyWidth:{name:J(fe.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:J(fe.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:J(fe.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:J(fe.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:J(fe.runtime.browserScrollbarWidth),value:""}},DS=J(ee.scrollbarWidthHorizontal),Bd=J(ee.scrollbarWidthVertical),xS=J(ee.columnWidthAtIndex),ES=J(ee.columnZIndexAtIndex),Wd=J(ee.scrollLeft),MS=J(ee.activeCellColWidth),jd=J(ee.activeCellColOffset),qd=J(ee.baseZIndexForCells),AS=J(ee.pinnedStartWidth),$d=J(ee.bodyWidth),_S=J(ee.bodyHeight),Ud=J(ee.pinnedEndOffset),Yd=J(ee.pinnedEndWidth),OS=J(ee.computedVisibleColumnsCount);function Hi(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(${qd}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Xd(o){let{computedVisibleColumns:e,computedPinnedStartColumns:t,computedPinnedEndColumns:n,computedPinnedStartColumnsWidth:r,computedPinnedEndColumnsWidth:i,computedUnpinnedColumnsWidth:a,bodySize:l,activeCellIndex:s,brain:u,scrollbars:c}=o,d=Yt(),p=[],f=e.reduce((m,g)=>{let h=g.computedVisibleIndex;m[Ie.columnWidths.varName.get(h)]=g.computedWidth+"px",m[Ie.columnOffsets.varName.get(h)]=g.computedPinned==="start"?`calc( ${g.computedOffset}px + var(${Wd}) )`:g.computedPinned==="end"?`calc( var(${Ud}) ${p.length?"+":""} ${p.map(b=>Ie.columnWidths.get(b.computedVisibleIndex)).join(" + ")} + var(${Wd}) )`:`${g.computedOffset}px`;let y=Hi(g,{pinnedStartColsCount:t.length,visibleColsCount:e.length});return m[`${ES}-${h}`]=`${y}`,g.computedPinned==="end"&&p.push(g),m},{});if(l.width&&(f[Fr.browserScrollbarWidth.name]=`${Yt()}px`),f[Fr.bodyWidth.name]=`calc(${ee.bodyWidth} - ${ee.scrollbarWidthVertical})`,f[Fr.totalVisibleColumnsWidthValue.name]=`${r+i+a}px`,f[Fr.totalVisibleColumnsWidthVar.name]=`calc(${e.map((m,g)=>`var(${xS}-${g})`).join(" + ")})`,f[Fr.visibleColumnsCount.name]=e.length,s!=null){f[MS]=Ie.columnWidths.get(s[1]);let m=Ie.columnOffsets.get(s[1]);if(u.isHorizontalLayoutBrain){let g=u.getPageIndexForRow(s[0]);f[jd]=g?`calc( ${fe.runtime.totalVisibleColumnsWidthVar} * ${g} + ${m})`:m}else f[jd]=m}return f[OS]=e.length,f[DS]=c.horizontal?`${d}px`:"0px",f[Bd]=c.vertical?`${d}px`:"0px",f[AS]="calc( "+t.map(m=>Ie.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[Yd]="calc( "+n.map(m=>Ie.columnWidths.get(m.computedVisibleIndex)).join(" + ")+")",f[qd]=e.length*10,f[Ud]=`calc( var(${$d}) - var(${Yd}) - var(${Bd}) )`,f[$d]=`${l.width}px`,f[_S]=`${l.height}px`,f}var us=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};function Qd(o){let{actions:e,getState:t,focused:n,focusedWithin:r,domRef:i,scrollerDOMRef:a,onBlurWithin:l,onFocusWithin:s,onSelfFocus:u,onSelfBlur:c,bodySize:d,activeCellIndex:p,wrapRowsHorizontally:f,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedPinnedStartColumns:h,computedPinnedEndColumns:y,computedVisibleColumns:b,computedUnpinnedColumnsWidth:S,scrollbars:T,focusedClassName:C,focusedWithinClassName:I,computedPinnedStartOverflow:R,computedPinnedEndOverflow:w,focusedStyle:D,focusedWithinStyle:v,brain:M}=re(O=>{let{state:K,computed:j}=O;return{brain:K.brain,actions:O.actions,getState:O.getState,focused:K.focused,focusedWithin:K.focusedWithin,domRef:K.domRef,scrollerDOMRef:K.scrollerDOMRef,onBlurWithin:K.onBlurWithin,onFocusWithin:K.onFocusWithin,onSelfFocus:K.onSelfFocus,onSelfBlur:K.onSelfBlur,bodySize:K.bodySize,activeCellIndex:K.activeCellIndex,wrapRowsHorizontally:K.wrapRowsHorizontally,computedPinnedStartColumnsWidth:j.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:j.computedPinnedEndColumnsWidth,computedPinnedStartColumns:j.computedPinnedStartColumns,computedPinnedEndColumns:j.computedPinnedEndColumns,computedVisibleColumns:j.computedVisibleColumns,computedUnpinnedColumnsWidth:j.computedUnpinnedColumnsWidth,scrollbars:j.scrollbars,focusedClassName:O.state.focusedClassName,focusedWithinClassName:O.state.focusedWithinClassName,computedPinnedStartOverflow:j.computedPinnedStartOverflow,computedPinnedEndOverflow:j.computedPinnedEndOverflow,focusedStyle:O.state.focusedStyle,focusedWithinStyle:O.state.focusedWithinStyle}}),x=(0,Zd.useMemo)(()=>Xd({computedVisibleColumns:b,computedPinnedStartColumns:h,computedPinnedEndColumns:y,computedPinnedStartColumnsWidth:m,computedPinnedEndColumnsWidth:g,computedUnpinnedColumnsWidth:S,bodySize:d,activeCellIndex:p,brain:M,scrollbars:T}),[b,h,y,m,g,S,d,p,M,T]),E=us(O=>{e.focused=O}),P=us(O=>{e.focusedWithin=O}),N={...o,onFocus:O=>{if(o?.onFocus?.(O),O.target===i.current||O.target===a.current){if(t().focused)return;E(!0),u?.(O),r&&(P(!1),l?.(O));return}r||(P(!0),s?.(O))},onBlur:O=>{if(o?.onBlur?.(O),O.target===i.current||O.target===a.current){if(!t().focused)return;E(!1),c?.(O),r&&(P(!1),l?.(O));return}i.current?.contains(O.relatedTarget)||(P(!1),l?.(O))}},F=oe(Zt,Vd,f?`${Zt}--horizontal-layout`:null,N?.className,m?`${Zt}--has-pinned-start ${Hd}`:null,g?`${Zt}--has-pinned-end ${Gd}`:null,n?`${Zt}--focused`:null,r?`${Zt}--focused-within`:null,n&&C?C:null,r&&I?I:null,R?`${Zt}--has-pinned-start-overflow`:null,w?`${Zt}--has-pinned-end-overflow`:null,Kd({horizontalLayout:!!f,hasPinnedStart:!!m,hasPinnedEnd:!!g,focused:n,focusedWithin:r}));return N.className=F,N.style={...o?.style,...x},n&&D&&Object.assign(N.style,D),r&&v&&Object.assign(N.style,v),N}var lp=W(ln());function Ki(o){return o.map(e=>e instanceof Vo?e:new Vo(null,[e]))}var Vo=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=>NS(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 NS(o,e){return typeof o=="string"||typeof o=="number"?`${o}`:e?o.__get(e):o.done()}var FS=(...o)=>new Vo("+",Ki(o)),ep=(...o)=>new Vo("-",Ki(o)),LS=(...o)=>new Vo("*",Ki(o)),kS=(...o)=>new Vo("/",Ki(o)),Lr={add:FS,subtract:ep,minus:ep,multiply:LS,divide:kS};var sn=(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 He=Pe().requestAnimationFrame||(o=>setTimeout(o,16)),zt=Pe().cancelAnimationFrame||(o=>clearTimeout(o));var tp=o=>{let e=null,t=null;return{stop(){e!==null&&zt(e),t!=null&&zt(t)},scroll(n){e!==null&&zt(e),t!=null&&zt(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 c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft-p,e=He(()=>{i.scroll(n)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let c=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/c),p=0;for(let f=0;f<c;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft+p,t=He(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var je=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 op(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function np(o,e){return Math.sqrt((e.top-o.top)**2+(e.left-o.left)**2)}function zS(o,e,t){let n=op(o,t),r=op(e,t);return n===r?np(t,e)-np(t,o):n-r}function rp(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)=>zS(n,r,t)),e}function VS(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 GS(o,e){if(o.length<2)return o[0]?o[0].left===e.left&&o[0].top===e.top:!1;o=rp(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 ip(o,e){if(VS(o))return GS(o,e);o=rp(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(HS([t,i,a],e))return!0}return!1}function HS(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 Wn=class{containsPoint(e){return ip(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 jn=class o extends Wn{static clone(e){return new o(e)}constructor(e){super(),this.points=e.map(je.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function KS(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,u=Math.max(l,s);return new Re({top:n,left:t,width:a-t,height:u-n})}var Re=class o extends Wn{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=KS(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 jn(this.getPoints()).containsPoint(t)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(je.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var ap=10,BS=J(ee.pinnedStartWidth);function sp(o){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:u,tableRect:c,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:h,horizontalLayoutPageIndex:y,pageWidth:b}=o;function S(z){let q=z==="start"?F:O;return A===N?q:N===z?q+E.computedWidth:A===z?q-E.computedWidth:q}function T(z){if(z.columnIndex===P||y!=null)return!0;let q=e[z.columnIndex];if(q.computedPinned)return!0;let Y=l.getScrollPosition().scrollLeft,Z=q.computedOffset+(y!=null&&b!=null?b*y:0);return Z>=Y+S("start")&&Z+q.computedWidth<=Y+c.width-S("end")}let C=(z,q)=>{let{restrictToParentGroup:Y,dragColumn:Z}=q,X=[];if(z.forEach(he=>{if(he.computedVisibleIndex===P)return;let ae={columnId:he.id,columnIndex:he.computedVisibleIndex,offsetX:he.computedOffset+Math.round(he.computedWidth/2)};T(ae)&&X.push(ae)}),Y){let ae=function(L,ge,xe){let Ee=z[L];Ee&&(Ee.columnGroup!==Z.columnGroup&&xe.add(Ee.id),ae(L+ge,ge,xe))};var me=ae;let he=Z.computedVisibleIndex,V=new Set;ae(he-1,-1,V),ae(he+1,1,V),X=X.filter(L=>!V.has(L.columnId))}return X},R=r.length,w={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},D={left:w.clientX-c.left-(w.clientX-s.left)+ap,top:w.clientY-c.top-(w.clientY-s.top)+ap},v=l.getScrollPosition(),M=e.map(z=>z.computedVisibleIndex),x=M,E=t.get(i),P=E.computedVisibleIndex,A=E?.computedPinned,_=P,N=A,F=l.getFixedStartColsWidth(),O=l.getFixedEndColsWidth(),K=w,j={x:0,y:0},k=1,Q=0;function G(z){let q=Math.round(z.clientX),Y=Math.round(z.clientY);if(q===K.clientX&&Y===K.clientY)return Re.from(s).shift({left:j.x,top:j.y});K={clientX:q,clientY:Y};let X=l.getScrollPosition().scrollLeft-v.scrollLeft;return j.x=K.clientX-w.clientX,j.y=K.clientY-w.clientY,Q=j.x+X,k=Q<0?-1:1,f({left:D.left+j.x,top:D.top+j.y}),Re.from(s).shift({left:j.x,top:j.y})}function $(z){let q=0;A?A==="start"&&z.forEach((Y,Z)=>{q||e[Y]?.computedPinned!=="start"&&(q=Z)}):z.forEach((Y,Z)=>{e[Y]?.computedPinned==="start"&&(q=Z+1)}),R=q,ie("start",z,q)}function ie(z,q,Y){if(z==="start"){let Z=0;for(let X=0;X<Y;X++){let me=q[X],he=e[me];Z+=he.computedWidth}Xt(BS,`${Z}px`,a)}}function pe(z){if(z==null||z===_)return;if(_===-1&&z!==-1&&(Nr(P,"",a),m(!1)),_=z,z===-1){ue(P);return}let q=sn(M,P,_>P?_-1:_);R=0;let Z=new Set;return q.forEach((X,me)=>{let he=x[me];X!==he&&Z.add(X),$(q)}),x=q,le(Z),{newColumnIndexes:q,indexesWithTransition:Z,pinnedStartCount:R}}function ue(z){x=x.filter(Y=>Y!==z),e.forEach(Y=>{let Z=Y.computedVisibleIndex,X=Z>z;ls(Z,a);let me="";X&&(me=Lr.minus(Ie.columnOffsets.get(Z),Ie.columnWidths.get(z)).done()),Or(Z,me,a)}),Nr(z,"hidden",a),m(!0)}function le(z){e.forEach(q=>{let Y=q.computedVisibleIndex;z.has(Y)?ls(Y,a):Gi(Y,a);let Z=Y===P,X=k===-1?Y<_||Y>P:Y<P||Y>=_,me="";k===-1?me=Z?Ie.columnOffsets.get(_):X?Ie.columnOffsets.get(Y):Lr.add(Ie.columnOffsets.get(Y),Ie.columnWidths.get(P)).done():me=X?Ie.columnOffsets.get(Y):Z?Lr.add(Ie.columnOffsets.get(_-1),Ie.columnWidths.get(_-1)).minus(Ie.columnWidths.get(P)).done():Lr.minus(Ie.columnOffsets.get(Y),Ie.columnWidths.get(P)).done(),Or(Y,me,a)})}let de=c.left+S("start"),ce=c.right-S("end"),U=tp({scrollOffsetStart:de,scrollOffsetEnd:ce});return G(w),{speedScroller:U,stop(){U.stop()},onMove(z){let q=G(z);if(g().dropTargetListId==="grouping-toolbar"||p&&!d.containsPoint(q.getCenter()))return p&&pe(-1),null;U.scroll({mousePosition:K,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(ae){h.scrollLeft=ae}});let Y=C(e,{dragColumn:E,restrictToParentGroup:u==="group"}),Z=k===-1?E.computedOffset+Q:E.computedOffset+E.computedWidth+Q,X=(0,lp.default)(Y,Z,({offsetX:ae},V)=>ae<V?-1:ae>V?1:0);X<0&&(X=~X),Y.length?X=Y[X]?Y[X].columnIndex:Y[Y.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),X=0),X===P+1&&(X=P),pe(X);let me={};n.forEach(ae=>{me[ae.id]="end"});for(let ae=0;ae<R;ae++){let V=x[ae],L=e[V];me[L.id]="start"}let he=x.map(ae=>e[ae].id);return{columnPinning:me,columnOrder:he}}}}function cs(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],u=n.indexOf(s),c=n.indexOf(r);return sn(n,c,u)}else{let l=e.indexOf(r),s=e[l+1],u=n.indexOf(s),c=n.indexOf(r);return sn(n,c,u)}return e}var Ct=W(require("react"));var un=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 up=W(ln());var cp=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:u,dragIndex:c,dragRectangle:d}=n,p=u===a,f=je.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,y=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)),b=(0,up.default)(h,y,(R,w)=>R-w);b<0&&(b=~b),m===1&&b===c+1&&p&&b--;let S=Math.min(c,b),T=Math.max(c,b),C=p?i.map((R,w)=>{if(w===c&&p)return t;if(w<S||w>=T)return{left:0,top:0};let D=b<=w?1:-1;return r==="horizontal"?{left:Math.round(D*g.width),top:0}:{left:0,top:Math.round(D*g.height)}}):i.map((R,w)=>{let D=b<=w?1:0;return r==="horizontal"?{left:Math.round(D*g.width),top:0}:{left:0,top:Math.round(D*g.height)}}),I={offset:t,dropIndex:b,dragSourceListId:u,dropTargetListId:a,dragIndex:c,outside:!1,items:i,dragItem:s,offsetsForItems:C,dragRect:g,status:"accepted"};return e.acceptsDrop(I)?{event:I,error:null,success:!0}:(I.status="rejected",{event:I,error:"rejected by interaction target",success:!1})},dp=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:u,listId:c}=n,d=je.from(s.getCenter()),p=c===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:u,outside:!f,items:l,dragSourceListId:c,dropTargetListId:i,offsetsForItems:p?l.map((y,b)=>y.id===u.id?t:f?{left:0,top:0}:b>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-u.rect.width,top:0}:{left:0,top:-u.rect.height}:{left:0,top:0}):l.map(y=>({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 we=class we{static startDrag(e,t){let n=e instanceof $n?e:new $n(e),r=new ds({activeDragSource:n,startPoint:t});return we.currentDragOperation=r,r.on("start",we.onDragStart),r.on("move",we.onDragMove),r.on("drop",we.onDragDrop),r.start(),r}static retriggerMove(){let e=we.currentDragOperation;e&&e.phase==="move"&&we.onDragMove(e)}static emit(e,...t){we.emitter.emit(e,...t)}static on(e,t){return we.emitter.on(e,t)}static registerDragInteractionTarget(e){if(we.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} already registered`);return}return we.dragInteractionTargetsMap.set(e.listId,e),we.emit("register",e),()=>{we.unregisterDragInteractionTarget(e)}}static unregisterAll(){we.dragInteractionTargetsMap.forEach(e=>{we.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(e){if(!we.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} not found`);return}we.dragInteractionTargetsMap.delete(e.listId),e.unregister(),we.emit("unregister",e)}}static onDragStart(e){let{dragItem:t,dragIndex:n}=e.activeDragSource,r=e.activeDragSource.listId,a=we.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;we.dragInteractionTargetsMap.forEach(u=>{let c=u.getData();u.start({dragIndex:c.listId===r?n:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),we.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=we.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(we.dragInteractionTargetsMap.get(r))),we.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let u=cp(e,s);if(u){t(s,u),i.splice(i.indexOf(s),1);break}}a||i.unshift(l);for(let s of i){let u=dp(e,s);u&&t(s,u)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];we.withDragMove(e,(u,{event:c})=>{u.move(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null,s=l?.dropTargetListId??null;we.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=[];we.withDragMove(e,(s,{event:u})=>{s.drop(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null;we.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}),we.currentDragOperation=null,we.unregisterAll()}};we.dragInteractionTargetsMap=new Map,we.currentDragOperation=null,we.emitter=new un;var Tt=we,$n=class o{static clone(e){let t=e.getData();return new o(t)}constructor(e){this.setData(e)}get listId(){return this.data.listId}get dragIndex(){return this.data.dragIndex??-1}get dragItem(){return this.data.dragItem}setData(e){St(this.data,e)||(this.data=e,this.dragRectangle=new Re(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let n=o.clone(e),r=Re.from(n.dragRectangle);return r.shift(t),n.dragRectangle=r,n}},ds=class extends un{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=$n.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=$n.shift(this.initialDragSource,n),this.currentOffset=n,this.emit("move",this)}};globalThis.DragManager=Tt;var pp=require("react"),fp=Ct.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:o=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),fo=()=>Ct.useContext(fp),Bi=o=>{let[e,t]=Ct.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),n=Ct.useRef(e);n.current=e;let r=Ct.useCallback(()=>{let a=n.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=Ct.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return(0,pp.useEffect)(()=>{let a=Tt.on("drag-start",u=>{t({dragSourceListId:u.dragSourceListId,dropTargetListId:u.dropTargetListId,dragItemId:u.dragItem.id,status:"accepted"})}),l=Tt.on("drag-move",u=>{let c=n.current,d={dragSourceListId:u.dragSourceListId,dropTargetListId:u.dropTargetListId,dragItemId:u.dragItem.id,status:u.status};JSON.stringify(c)!==JSON.stringify(d)&&t(d)}),s=Tt.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[Tt,t]),Ct.createElement(fp.Provider,{value:i},typeof o.children=="function"?o.children(i):o.children)};var ps=`${ft}Body`,mp=o=>o.querySelector(`.${ps}`);var cn=`${ft}HeaderCell`,fs=`${ft}HeaderWrapper`,gp=o=>Array.from(o.querySelectorAll(`.${fs}`));function Wi(o){if(!o)return!1;let e=o.tagName;return e==="INPUT"||e==="BUTTON"}var WS=J(ee.baseZIndexForCells),jS=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:St(o,e)},yp=({columnId:o,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n})=>{let[r,i]=(0,Un.useState)(null),[a,l]=(0,Un.useState)(!1),{getCurrentDragSourceAndTarget:s}=fo(),{getComputed:u,getState:c,api:d,computedDraggable:p,rootRef:f,actions:m}=re(y=>({actions:y.actions,getComputed:y.getComputed,getState:y.getState,api:y.api,computedDraggable:y.computed.computedVisibleColumnsMap.get(o)?.computedDraggable,rootRef:y.state.domRef})),g=(0,Un.useCallback)(y=>{let b=u().computedVisibleColumnsMap.get(o);if(!b||!b.computedSortable)return;let{multiSortBehavior:S}=c();d.toggleSortingForColumn(o,{multiSortBehavior:S==="replace"&&(y.ctrlKey||y.metaKey)?"append":S})},[]),h=(0,Un.useCallback)(y=>{if(Wi(y.target))return;let{brain:b,draggableColumnsRestrictTo:S}=c(),{computedVisibleColumns:T,computedVisibleColumnsMap:C,computedPinnedStartColumns:I,computedUnpinnedColumns:R,computedPinnedEndColumns:w}=u(),D=C.get(o);if(!D.computedDraggable){g(y);return}let v=e.current,M=v.getBoundingClientRect(),x=f.current.getBoundingClientRect(),E=b.getAvailableSize(),P=D.computedVisibleIndex,A=b.getVirtualColIndex(D.computedVisibleIndex,{pageIndex:t||0}),_=b.isHorizontalLayoutBrain?b.getPageWidth():null,N=v.style.cursor??"auto",F=!1,O=f.current,K=Re.from(mp(O).getBoundingClientRect()),j=gp(O).map(de=>Re.from(de.getBoundingClientRect())),k=K.getMinimumBoundingRectangle(...j),Q=sp({brain:b,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n,pageWidth:_,draggableColumnsRestrictTo:S,computedPinnedEndColumns:w,computedPinnedStartColumns:I,computedUnpinnedColumns:R,computedVisibleColumns:T,computedVisibleColumnsMap:C,dragColumnHeaderTargetRect:M,dragColumnId:o,getCurrentDragSourceAndTarget:s,api:d,infiniteDOMNode:f.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:x,acceptDropToReorderRect:k,initialMousePosition:{clientX:y.clientX,clientY:y.clientY}}),G=null,$,ie;function pe(de){let{columnPinning:ce,columnOrder:U}=de;jS(c().columnPinning,ce)||(m.columnPinning=ce);let z=u().computedColumnOrder;JSON.stringify(U,z)&&(m.columnOrder=cs({newColumnOrder:U,visibleColumnOrder:u().computedVisibleColumns.map(q=>q.id),existingColumnOrder:z,dragColumnId:o}))}let ue=de=>{let{headerBrain:ce,brain:U}=c();if(!F){F=!0;let z=U.keepColumnRendered(A),q=ce.keepColumnRendered(A);if(U.isHorizontalLayoutBrain){let Z=U.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),X=ce.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ie=()=>{Z(),X()}}$=()=>{z(),q()},m.columnReorderDragColumnId=D.id,t!=null&&(m.columnReorderInPageIndex=t),as(P,`calc( var(${WS}) + 10000 )`,f.current),f.current?.classList.add(ss),v.style.cursor="grabbing"}G=Q.onMove(de)},le=de=>{let ce=de.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:U}=c(),z=f.current;z?.classList.remove(ss),Q.stop(),b.update({...E}),$?.(),ie?.(),v.style.cursor=N,v.hasPointerCapture?.(ce)&&v.releasePointerCapture(ce),v.removeEventListener("pointermove",ue),v.removeEventListener("pointerup",le),i(null);let q=d.getColumnApi(D.id)?.isSortable()??!1;!F&&q&&d.toggleSortingForColumn(D.id,{multiSortBehavior:U==="replace"&&(de.ctrlKey||de.metaKey)?"append":U}),(0,hp.flushSync)(()=>{G?pe(G):F&&n&&d.setVisibilityForColumn(D.id,!1),m.columnReorderDragColumnId=!1,t!=null&&(m.columnReorderInPageIndex=null)}),T.forEach(Y=>{Gi(Y.computedVisibleIndex,z),Nr(Y.computedVisibleIndex,"",z),Or(Y.computedVisibleIndex,"",z)}),as(P,Hi(D,{pinnedStartColsCount:I.length,visibleColsCount:T.length}),z)})};v.addEventListener("pointermove",ue),v.addEventListener("pointerup",le),v.setPointerCapture(y.pointerId)},[o,t]);return{onPointerDown:p?h:g,dragColumnOutside:a,proxyPosition:r}};var qn=W(require("react"));var Ce=W(require("react")),Le=require("react");var Sp=Symbol("REPAINT_CELLS_KEY_NO_ROW");function Tp(o){return typeof o=="function"}function bp(o,e){let{column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i}=e,a=r.getRowInfoAtIndex(n);if(!a)return Sp;let l=r.getDataSourceStates();return o({rowInfo:a,column:t,dataSourceState:l.dataSourceState??i(),previousDataSourceState:l.previousDataSourceState})}function Cp(o,e,t){let n=bp(o,e);return e.rowInfoStore.subscribeToDataArrayChange(()=>{let r=bp(o,e);r!==Sp&&(Object.is(r,n)||(n=r,t()))})}var Ip="_1eexc2a7 _1eexc2a6",Rp=be({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"]]}),wp=be({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 vp="_1eexc2a5",ji=be({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),$i="_1eexc2a8";var Ui=W(require("react")),Yi=require("react");var Pp="qz8ht90 _16lm1iwk";function $S(){return{checked:1,disabled:o=>o??!1,domProps:1}}var{ManagedComponentContextProvider:US}=Nt({forwardProps:$S,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function YS(){let{componentState:o,componentActions:e}=Ft(),{checked:t,domProps:n,disabled:r}=o,i=(0,Yi.useRef)(null);return(0,Yi.useEffect)(()=>{i.current.indeterminate=t==null},[t]),Ui.createElement("input",{...n,className:oe("InfiniteCheckBox",Pp,n?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function mo(o){return Ui.createElement(US,{...o},Ui.createElement(YS,null))}var kr=W(require("react")),Mp=require("react");var Dp="_96uiwi0 _16lm1iw1d _16lm1iwk _16lm1iw9",xp=be({defaultClassName:"_96uiwi1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_96uiwi3"},direction:{end:"_96uiwi4",start:"_96uiwi5"},disabled:{true:"_96uiwi6",false:"_96uiwi7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var Ep="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",QE=Object.keys({size:1,expanded:1,defaultExpanded:1,onChange:1,style:1,disabled:1,className:1,direction:1});var qi=`${Dt}-expand-collapse`;function dn(o){let{size:e=24,direction:t="start",disabled:n=!1}=o,[r,i]=(0,Mp.useState)(o.expanded??o.defaultExpanded),a=()=>{o.onChange?.(!r),Lo("expanded",o)||i(!r)};kr.useEffect(()=>{Lo("expanded",o)&&i(o.expanded)},[o.expanded]);let l=r?"expanded":"collapsed";return kr.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:oe(o.className,Dp,xp({direction:t||"start",expanded:r,disabled:n}),`${Dt}`,`${qi}`,`${qi}--${l}`,`${qi}--${t==="end"?"end":"start"}`,n?`${qi}--disabled`:"")},kr.createElement("path",{d:Ep}))}function Ap(o){return typeof o.field=="string"}function _p(o){let{column:e,rowInfo:t,fieldsToColumn:n}=o,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];(Array.isArray(e.groupByForColumn)||e.groupByForColumn===i)&&(r=i?n.get(i.field||i.groupField):void 0)}!r&&e.field&&(r=n.get(e.field))}return r}function Qt(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),u=s[r],{isGroupRow:c,isTreeNode:d}=u,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=n(),h=r===f&&m==="row",y=!g||typeof g=="function"&&!g(u)?!1:a.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",{formattedValue:b,formattedValueContext:{rawValue:S}}=Yn({column:p,rowInfo:u,rowDetailState:y,columnsMap:e().computedColumnsMap,context:o}),T=mt(p.id,o);return c?{api:a,dataSourceApi:l,column:p,columnApi:T,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:b,rawValue:S}:d?u.isParentNode?{api:a,dataSourceApi:l,columnApi:T,column:p,nodeExpanded:u.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:y,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:b,rawValue:S}:{api:a,dataSourceApi:l,columnApi:T,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:y,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:b,rawValue:S}:{api:a,dataSourceApi:l,columnApi:T,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:y,data:u.data,rowActive:h,rowInfo:u,rowSelected:u.rowSelected,value:b,rawValue:S}}function Op(o){return Fp(o.column,o.rowInfo)}function Np(o){let{column:e,context:t,rowInfo:n,visibleColumnIds:r}=o,i=_p({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=Yn(o),{formattedValueContext:u}=s,c=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:c,rowHasSelectedCells:!1},u,{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:c,stylingParam:d,formattedValueContext:u,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:qS({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnIds:o.visibleColumnIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:p,verticalAlign:f,formattedValueContext:u}),groupByColumnReference:i}}function qS(o){let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:u}=o,{value:c}=u,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:h}=n,y=p(),{selectionMode:b,cellSelection:S}=y,T=_p({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),C=d.toggleGroupRow,I=S?.isCellSelected(n.id,e.id)??!1,R={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:I,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...u,editError:g&&g.primaryKey===n.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:T,selectionMode:b,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 c=="boolean"?`${c}`:c,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:C,toggleCurrentGroupRow:()=>{n.isGroupRow&&C(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:y.groupBy,pivotBy:y.pivotBy};return Object.defineProperty(R,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),R}function XS(o,e){if(!o.isGroupRow)return;let t=o.groupData;if(!t.length)return;let n=t[0][e];for(let r=1,i=t.length;r<i;r++)if(t[r][e]!==n)return;return n}function Fp(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:Ap(o)?t?.[o.field]:null;return o.field&&e.isGroupRow&&e.reducerData&&e.reducerData[o.field]!=null&&(a=e.reducerData[o.field]),a===void 0&&e.isGroupRow&&o.groupByForColumn&&Ap(o)&&(a=XS(e,o.field)),o.valueGetter&&!e.isGroupRow&&e.data&&(a=o.valueGetter({data:e.data,field:o.field})),a}function ZS(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.getState(),u=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:u,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:u,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:u,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:u,value:o,rawValue:o,field:e.field}}function Yn(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=Fp(e,t),a=ZS(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var Lp=be({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),kp="_7pupv00",zp=be({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Vp}=ze,go=`${Vp}Cell`,zr=`${Vp}Cell_content`;var{rootClassName:QS}=ze,Jt=`${QS}ColumnCell`;var JS=J(ee.columnZIndexAtIndex),eT=J(ee.columnVisibilityAtIndex);function Gp({rowInfo:o,column:e}){let t=0;if(o.dataSourceHasGrouping)if(o.isGroupRow){let n=e?.groupByForColumn,r=o.groupBy[o.groupBy.length-1],i=!!o.pivotValuesMap,a=i&&!!e?.field&&!!n&&!Array.isArray(n)&&(n.field??n.groupField)!==(r?.field??r?.groupField),l=i&&Array.isArray(n)&&o.groupNesting===o.rootGroupBy.length;t=a||l?o.groupNesting:o.groupNesting-1}else t=o.groupNesting;return{[J(fe.components.Row.groupNesting)]:t}}function Hp({rowInfo:o}){return{[J(fe.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}function ms(o,e){return o?typeof o=="function"?o(e):o:void 0}function gs(o,e,t){return typeof e=="function"?{...o,...e(t)}:{...o,...e}}function Kp(o){let{column:e,rowInfo:t,rowIndex:n,rowHeight:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:l,verticalAlign:s,stylingParam:u,formattedValueContext:c,groupByColumnReference:d,rowStyle:p,rowClassName:f,cellStyle:m,cellClassName:g,showZebraRows:h,rowActive:y,rowDisabled:b,rowSelected:S,cellSelected:T,cellSelection:C,getData:I,computedVisibleColumns:R,visibleColumnIds:w,computedColumnOrder:D,columnReorderInPageIndex:v}=o,M=w??R.map(ue=>ue.id),x=D,E,P={...c,visibleColumnIds:M,allColumnIds:x,rowIndex:n,get rowHasSelectedCells(){return E===void 0&&(E=t.hasSelectedCells(M)),E}},A=!!(t.isTreeNode&&(e.renderTreeIcon||e.renderTreeIconForLeafNode||e.renderTreeIconForParentNode)),_=typeof f=="function"?f(P):f,N;d?.className&&(N=ms(d.className,u)),g&&(N=oe(N,ms(g,u))),e.className&&(N=oe(N,ms(e.className,u))),A&&(N=oe(N,zp({align:l})));let F;t.dataSourceHasGrouping&&e.groupByForColumn&&(F=Gp({rowInfo:t,column:e})),A&&(F=Hp({rowInfo:t})),p&&(F=typeof p=="function"?{...F,...p(P)}:{...F,...p}),m&&(F=gs(F,m,u)),d?.style&&(F=gs(F,d.style,u)),e.style&&(F=gs(F,e.style,u)),F=F||{},F.height=r,F.zIndex=`var(${JS}-${e.computedVisibleIndex})`,F.visibility=`var(${eT}-${e.computedVisibleIndex}, visible)`;let O=i!=null?i%2===1:(t.indexInAll!=null?t.indexInAll:n)%2===1,K=h?O?"odd":"even":!1,j=!1,k=!1,Q=!1,G=!1;if(C&&T){let ue=I(),le=ue[t.indexInAll-1],de=ue[t.indexInAll+1],ce=R[e.computedVisibleIndex+1],U=R[e.computedVisibleIndex-1];j=le?!C.isCellSelected(le.id,e.id):!0,e.computedPinned==="end"&&e.computedFirstInCategory?k=!0:k=U?!C.isCellSelected(t.id,U.id):!0,e.computedPinned==="start"&&e.computedLastInCategory?Q=!0:Q=ce?!C.isCellSelected(t.id,ce.id):!0,G=de?!C.isCellSelected(de.id,e.id):!0}let $=C&&T?{top:j,left:k,right:Q,bottom:G}:null,ie=v!=null?a!==v:!1,pe=oe($?wp($):"",Vi(e,[Jt,go],Rp,{dragging:!1,insideDisabledDraggingPage:ie,zebra:K,align:l,verticalAlign:s,rowDisabled:b,rowActive:y,cellSelected:T,rowSelected:S,treeNode:t.isTreeNode?t.isParentNode?"parent":"leaf":!1,firstRow:t.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:t.isGroupRow,groupCell:t.isGroupRow?!!e.groupByForColumn:!1,rowExpanded:t.isGroupRow?!t.collapsed:!1}),N,_);return{style:F,className:pe,cellSelectionBorders:$,zebra:K,columnIsTree:A}}var ho=W(require("react"));var tT=J(ee.columnWidthAtIndex),oT=J(ee.columnReorderEffectDurationAtIndex);function nT(o){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:u,afterChildren:c,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:g,...h}=o,y=typeof m=="function"?m():m,b={width:`var(${tT}-${i.computedVisibleIndex})`,transition:`transform var(${oT}-${i.computedVisibleIndex}, 0s)`,...h.style},S={...h,style:b,"data-column-id":i.id,"data-z-index":b.zIndex,className:oe(h.className,go,Ip),children:ho.createElement(ho.Fragment,null,d,ho.createElement("div",{className:oe(zr,e?kt:Ec.hidden,s),style:r},y),c)};u!=null&&(S["data-row-id"]=`${u}`);let T=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return T?ho.createElement(T,{...S,ref:a}):ho.createElement("div",{...S,ref:a})}var Xi=ho.memo(nT);var fn=W(require("react")),pn=require("react");function Bp(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=Zi(),i=(0,pn.useRef)(null),a=(0,pn.useRef)(!1),l=fn.useCallback(c=>{i.current=c,c&&c.focus()},[]),s=(0,pn.useCallback)(c=>{let{key:d}=c;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,n()):c.stopPropagation()},[]),u=(0,pn.useCallback)(()=>{a.current||t()},[]);return fn.createElement(fn.Fragment,null,fn.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:u,className:oe(Ic,xc.none),type:"text",defaultValue:o,onChange:(0,pn.useCallback)(c=>{e(c.target.value)},[])}))}function Wp(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}var Vr=Ce.createContext(null),rT=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return Ce.createElement(dn,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},iT={display:"inline-block",visibility:"visible"},hs=o=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:n,api:r}=o,i=r.getDataSourceState().isNodeReadOnly;return Ce.createElement(dn,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:iT,expanded:n,onChange:t})},aT=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(),u=l.getDataSourceState().isNodeSelectable,c=s?.CheckBox||mo;return Ce.createElement(c,{domProps:{className:$i},disabled:e.isTreeNode?!u(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 lT(o){let{repaintCellsKey:e,column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i}=o,[,a]=(0,Le.useReducer)(s=>s+1,0),l=Tp(e)?e:void 0;(0,Le.useEffect)(()=>{if(l)return Cp(l,{column:t,rowIndex:n,rowInfoStore:r,getDataSourceState:i},a)},[l,t,n,r,i])}function sT(o){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:n,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,visibleColumnIds:s,computedColumnOrder:u,cellStyle:c,cellClassName:d,repaintCellsKey:p,rowDetailState:f,width:m,column:g,onMouseLeave:h,onMouseEnter:y,onRowMouseEnter:b,onRowMouseLeave:S,rowIndex:T,rowHeight:C,columnsMap:I,fieldsToColumn:R,domRef:w,hidden:D,showZebraRows:v,getDataSourceState:M,dataSourceApi:x,dataSourceActions:E,getState:P,imperativeApi:A,componentActions:_,getComputed:N,getDataSourceMasterContext:F}=o,O=(0,Le.useSyncExternalStore)((0,Le.useCallback)(se=>t.subscribeToRowIndex(T,se),[t,T]),(0,Le.useCallback)(()=>t.getRowInfoAtIndex(T),[t,T]));lT({repaintCellsKey:p,column:g,rowIndex:T,rowInfoStore:t,getDataSourceState:M});let K=!O,j=!g,k=Ce.useRef(null),Q=(0,Le.useCallback)(se=>{k.current=se,w&&w(se)},[w]),G=O??{id:"",indexInAll:T,rowSelected:!1,rowDisabled:!1,isCellSelected:()=>!1,hasSelectedCells:()=>!1,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,treeNesting:0,nodePath:[],collapsed:!1,dataSourceHasGrouping:!1,selfLoaded:!0,data:{}},{rowSelected:$}=G,ie=N(),{activeRowIndex:pe,keyboardNavigation:ue,columnReorderInPageIndex:le}=P(),de=T===pe&&ue==="row",ce={getState:P,getDataSourceState:M,getDataSourceMasterContext:F,actions:_,dataSourceActions:E,api:A,dataSourceApi:x},U=G.rowDisabled,z=Np({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:g,rowInfo:G,rowDetailState:f,columnsMap:I,visibleColumnIds:s,fieldsToColumn:R,context:ce}),{stylingParam:q,renderParams:Y,formattedValueContext:Z,renderFunctions:X,groupByColumnReference:me,inEdit:he}=z,{align:ae,verticalAlign:V}=Y,L=Y,ge=Ce.useRef(L),xe=b&&y?se=>{let Je={...Z,rowIndex:T};b(Je,se),y(se)}:y,Ee=S&&h?se=>{let _e={...Z,rowIndex:T,rowInfo:G};S(_e,se),h(se)}:h,Me=(0,Le.useCallback)(se=>{let _e=g.computedVisibleIndex;P().cellClick({rowIndex:T,colIndex:_e,event:se})},[T,g.computedVisibleIndex,ue]),Ae=(0,Le.useCallback)(se=>{let _e=g.computedVisibleIndex;if(P().cellMouseDown({rowIndex:T,colIndex:_e,event:se}),ue==="row"){U||(_.activeRowIndex=T);return}ue==="cell"&&(_.activeCellIndex=[T,_e])},[T,U,g.computedVisibleIndex,ue]),{selectionMode:Ke,cellSelection:ot,isNodeReadOnly:Ze}=e,it=L.cellSelected;L.domRef=Q,L.htmlElementRef=k,L.toggleCurrentTreeNode=(0,Le.useCallback)(L.toggleCurrentTreeNode,[G]),L.selectCell=(0,Le.useCallback)(L.selectCell,[G]),L.deselectCell=(0,Le.useCallback)(L.deselectCell,[G]),L.selectCurrentRow=(0,Le.useCallback)(L.selectCurrentRow,[G]),L.deselectCurrentRow=(0,Le.useCallback)(L.deselectCurrentRow,[G]),L.toggleCurrentGroupRow=(0,Le.useCallback)(L.toggleCurrentGroupRow,[G]),L.toggleCurrentRowSelection=(0,Le.useCallback)(L.toggleCurrentRowSelection,[G]),L.toggleCurrentGroupRowSelection=(0,Le.useCallback)(L.toggleCurrentGroupRowSelection,[G]),L.toggleCurrentTreeNodeSelection=(0,Le.useCallback)(L.toggleCurrentTreeNodeSelection,[G]);let Qe=g.components?.Editor??Bp,qe=he?Ce.createElement($p,{contextValue:L},Ce.createElement(Qe,null)):null,B=(0,Le.useCallback)(pt(()=>{if(D||he)return null;if(ge.current=L,X.renderGroupIcon&&(L.renderBag.groupIcon=Ce.createElement(It,{render:X.renderGroupIcon,renderParam:{...L,renderBag:{...L.renderBag}}})),X.renderSelectionCheckBox&&Ke=="multi-row"&&(L.renderBag.selectionCheckBox=Ce.createElement(It,{render:aT,renderParam:L}),X.renderSelectionCheckBox!==!0&&(L.renderBag.selectionCheckBox=Ce.createElement(It,{render:X.renderSelectionCheckBox,renderParam:{...L,renderBag:{...L.renderBag}}}))),G.isTreeNode){let{isParentNode:Je}=G,xo;xo=(Je?X.renderTreeIconForParentNode:X.renderTreeIconForLeafNode)||typeof X.renderTreeIcon=="function"?X.renderTreeIcon:Je&&X.renderTreeIcon===!0?hs:void 0,xo===!0?xo=hs:xo&&(L.renderBag.treeIcon=Ce.createElement(It,{render:hs,renderParam:L})),xo&&(L.renderBag.treeIcon=Ce.createElement(It,{render:xo,renderParam:{...L,renderBag:{...L.renderBag}}}))}X.renderRowDetailIcon&&(L.renderBag.rowDetailsIcon=Ce.createElement(It,{render:rT,renderParam:{...L,renderBag:{...L.renderBag}}}),typeof X.renderRowDetailIcon=="function"&&(L.renderBag.rowDetailsIcon=Ce.createElement(It,{render:X.renderRowDetailIcon,renderParam:{...L,renderBag:{...L.renderBag}}}))),X.renderValue&&(L.renderBag.value=Ce.createElement(It,{render:X.renderValue,renderParam:{...L,renderBag:{...L.renderBag}}})),G.isGroupRow&&X.renderGroupValue&&(L.renderBag.value=Ce.createElement(It,{render:X.renderGroupValue,renderParam:{...L,renderBag:{...L.renderBag}}})),!G.isGroupRow&&X.renderLeafValue&&(L.renderBag.value=Ce.createElement(It,{render:X.renderLeafValue,renderParam:{...L,renderBag:{...L.renderBag}}})),ge.current=L;let se=L.renderBag.value;se instanceof Date&&(se=se.toLocaleDateString());let _e=Ce.createElement(Ce.Fragment,null,ae!=="end"?L.renderBag.treeIcon:null,ae!=="end"?L.renderBag.groupIcon:null,ae!=="end"?L.renderBag.rowDetailsIcon:null,ae!=="end"?L.renderBag.selectionCheckBox:null,se,ae==="end"?L.renderBag.selectionCheckBox:null,ae==="end"?L.renderBag.rowDetailsIcon:null,ae==="end"?L.renderBag.groupIcon:null,ae==="end"?L.renderBag.treeIcon:null);return g.render?Ce.createElement(It,{render:g.render,renderParam:{...L,renderBag:{...L.renderBag,all:_e}}}):_e}),[g,D,he,f,g.renderTreeIcon||g.renderTreeIconForParentNode?Ze:!1,...Wp(L,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),{style:ne,className:ye}=Kp({column:g,rowInfo:G,rowIndex:T,rowHeight:C,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,align:ae,verticalAlign:V,stylingParam:q,formattedValueContext:Z,groupByColumnReference:me,rowStyle:n,rowClassName:r,cellStyle:c,cellClassName:d,showZebraRows:v,rowActive:de,rowDisabled:U,rowSelected:$,cellSelected:it,cellSelection:ot,getData:l,visibleColumnIds:s,computedVisibleColumns:ie.computedVisibleColumns,computedColumnOrder:u,columnReorderInPageIndex:le}),Te=(0,Le.useMemo)(()=>ne,[ne?JSON.stringify(ne):null]),lt=qe,H=B(),ke={domRef:Q,cellType:"body",column:g,width:m,rowId:G.id,horizontalLayoutPageIndex:a,style:Te,onMouseLeave:Ee,onMouseEnter:xe,onClick:Me,afterChildren:lt,onMouseDown:Ae,cssEllipsis:g.cssEllipsis??!0,className:ye,renderChildren:(0,Le.useCallback)(()=>H,[B])},yt=Vr.Provider;return j||K?Ce.createElement("div",{ref:Q,style:{display:"none"}}):Ce.createElement(yt,{value:ge.current},Ce.createElement(Xi,{...ke}))}var jp=Ce.memo(sT);function Gr(){return(0,Le.useContext)(Vr)}function Zi(){let{api:o,editingValueRef:e,editingCell:t}=re(f=>({api:f.api,editingCell:f.state.editingCell,editingValueRef:f.state.editingValueRef})),{column:n,rowInfo:r}=Gr(),[i]=Ce.useState(()=>t?.value),[a,l]=Ce.useState(i),s=t?!t.active&&!!t.waiting:!1,u=Ce.useCallback(f=>{e.current=f,l(f)},[]);Ce.useLayoutEffect(()=>{e.current=i},[]);let c=o.confirmEdit,d=o.cancelEdit,p=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:u,confirmEdit:c,cancelEdit:d,rejectEdit:p}}function Hr(o){return o.render(o.renderParam)??null}function It(o){let e=Vr.Provider;return qn.createElement(e,{value:o.renderParam},qn.createElement(Hr,{render:o.render,renderParam:o.renderParam}))}function $p(o){let e=Vr.Provider;return qn.createElement(e,{value:o.contextValue},o.children)}function Go(o){let e=Qi.Provider;return qn.createElement(e,{value:o.renderParam},qn.createElement(Hr,{render:o.render,renderParam:o.renderParam}))}var Ho=W(require("react"));var Kr=Mi({"data-name":""}),Br={[Kr["data-name"]]:"menu-icon"},aA=`[${Kr["data-name"]}="${Br["data-name"]}"]`;var uT={width:"100%",pointerEvents:"none"},ys=`${Dt}-menu`;function Wr(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l={...uT,borderTop:`${fe.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle};return Ho.createElement("div",{...n,style:e,...Br,onPointerDown:s=>s.stopPropagation(),className:oe(t,ad({menuVisible:i,reserveSpaceWhenHidden:r}),Dt,`${Dt}-menu`)},a??Ho.createElement(Ho.Fragment,null,Ho.createElement("div",{className:ys,style:l}),Ho.createElement("div",{className:ys,style:l}),Ho.createElement("div",{className:ys,style:l})))}var Xn=W(require("react")),jr=require("react");var Up="_1b8djff0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Yp={transition:"width 0.25s, opacity 0.25s"},SA=Object.keys({direction:1,size:1,lineWidth:1,lineStyle:1,style:1,className:1,index:1,forceSize:1});function Ji(o){let[e,t]=(0,jr.useState)(!0),[n,r]=(0,jr.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:u}=o,c=u!=null&&u>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={...Yp,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:n};(0,jr.useEffect)(()=>{let y=i!=0?1:0;if(!e&&y&&t(!0),y!==n){let b=requestAnimationFrame(()=>{r(y)});return()=>{cancelAnimationFrame(b)}}return()=>{}},[i,e]);let g=()=>{let b=!(n===0&&i===0);b!==e&&t(b)};if(!e&&!o.forceSize)return null;let h={};return i===-1&&(h.top="100%"),Xn.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:oe(s,Dt,Up,`${Dt}-sort`)},c?Xn.createElement("div",{"data-name":"index",style:h,className:ud},u):null,Xn.createElement("div",{style:{width:f[0],...m},onTransitionEnd:g}),Xn.createElement("div",{style:{width:f[1],...m}}),Xn.createElement("div",{style:{width:f[2],...m}}))}var Jp=W(require("react")),Ss=require("react");function bs(o){return Math.max(o.width-Yt(),0)}function qp(o){let{context:e,column:t,diff:n,shareSpaceOnResize:r}=o,i=e.getState(),{columnSizing:a,viewportReservedWidth:l,bodySize:s}=i,u=e.getComputed().computedVisibleColumns,c=!1,d=u.reduce((f,m)=>(m.computedFlex&&(f[m.id]={...a[m.id],flex:m.computedWidth},c=!0),f),{}),p=c?{...a,...d}:a;return Xl({shareSpaceOnResize:r,availableSize:bs(s),reservedWidth:l||0,dragHandleOffset:n,dragHandlePositionAfter:t.computedVisibleIndex,columnSizing:p,items:u.map(f=>({id:f.id,computedFlex:f.computedFlex,computedWidth:f.computedWidth,computedMinWidth:f.computedMinWidth,computedMaxWidth:f.computedMaxWidth}))})}var $r=require("react"),Ur=W(require("react"));function Xp(o,{columns:e,shareSpaceOnResize:t,domRef:n}){let r=e[o];return{resize(i){Ie.columnWidths.set(o,r.computedWidth+i,n.current);let a=o+1;if(t){let l=e[a];if(!l)return;Ie.columnWidths.set(a,l.computedWidth-i,n.current),l.computedPinned==="start"?is(l,i,n.current):Ie.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 u=e[l];if(u.computedPinned==="start"){is(u,i,n.current);continue}u.computedPinned!=="end"&&Ie.columnOffsets.set(l,u.computedOffset+i,n.current)}return}for(let l=a,s=e.length;l<s;l++){let u=e[l];u.computedPinned||Ie.columnOffsets.set(l,u.computedOffset+i,n.current)}}}}}function Zp(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,u=i.current;if(n.forEach((c,d)=>{s+=c;let p=o[d],f=r[p],m=f.computedWidth+c;Ie.columnWidths.set(p,m,u),f.computedPinned!=="end"&&(l&&Ie.columnOffsets.set(p,l,u),l+=m)}),a.computedPinned!=="end")for(let c=t+1;c<r.length;c++){let d=r[c];d.computedPinned!=="end"&&Ie.columnOffsets.set(c,d.computedOffset+s,u)}}}}var ea="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",ta=be({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"]]}),oa=be({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:cT}=ze,dT=`${cT}HeaderCell_ResizeHandle`;function pT(o){let{brain:e,headerBrain:t}=re(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),n=(0,$r.useRef)(null),[r,i]=(0,$r.useState)(!1),a=(0,$r.useRef)(r);a.current=r;let l=o.columns[o.columnIndex],s=o.horizontalLayoutPageIndex;if(!l)return null;let u=l.computedPinned,c=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let h=!!g.shiftKey,y=g.pointerId,b=g.clientX,S=g.target;if(e.isHorizontalLayoutBrain){let w=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),D=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{w(),D()}}S.setPointerCapture(y);let T=Xp(o.columnIndex,{columns:o.columns,shareSpaceOnResize:h,domRef:n}),C=(w,{done:D}={})=>{s&&(w=w/(s+1),D&&(w=Math.round(w))),u==="end"&&(w*=-1);let{adjustedDiff:v,constrained:M}=o.computeResize({diff:w,shareSpaceOnResize:h});return a.current!==M&&i(M),T.resize(v),v},I=w=>{C(Math.round(w.clientX-b))},R=w=>{S.releasePointerCapture(y),S.removeEventListener("pointermove",I),S.removeEventListener("pointerup",R);let D=Math.round(w.clientX-b),v=C(D,{done:!0});p(),T.resize(0),o.onResize({diff:v,shareSpaceOnResize:h})};S.addEventListener("pointermove",I),S.addEventListener("pointerup",R)},m=(u===!1||u==="start")&&d?{right:u==="start"?void 0:0}:u==="end"&&c?{right:void 0}:void 0;return Ur.createElement("div",{ref:n,className:`${dT} ${ea} ${oa({computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}`,onPointerDown:f},Ur.createElement("div",{style:m,className:ta({constrained:r,computedPinned:u,computedFirstInCategory:c,computedLastInCategory:d})}))}var Qp=Ur.memo(pT);function ef(o,e){let{computedVisibleColumns:t,getState:n,getComputed:r,actions:i}=re(u=>({computedVisibleColumns:u.computed.computedVisibleColumns,getState:u.getState,getComputed:u.getComputed,actions:u.actions})),a=(0,Ss.useCallback)(({diff:u,shareSpaceOnResize:c})=>qp({context:{getState:n,getComputed:r},column:o,diff:u,shareSpaceOnResize:c}),[o,n,r]),l=(0,Ss.useCallback)(({diff:u,shareSpaceOnResize:c})=>{let{columnSizing:d,reservedWidth:p}=a({diff:u,shareSpaceOnResize:c});c||(i.viewportReservedWidth=p),i.columnSizing=d},[a,i]);return o.computedResizable?Jp.createElement(Qp,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:o.computedVisibleIndex,computeResize:a,onResize:l}):null}var Ye=W(require("react"));var eo=require("react");var tf=be({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),of=be({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function nf(o,e){return St(o,e)}var Zn=class extends un{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 nf(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return nf(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}adjustForScroll(t){this.breakpoints=this.breakpoints.map(n=>n-t),this.data.orientation==="vertical"?this.data.listRectangle.shift({top:-t,left:0}):this.data.listRectangle.shift({top:0,left:-t})}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let 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:u}=t,c=Array.from({length:i.length},(f,m)=>m),d=[];n===-1?d=c.filter(f=>f!==r):d=sn(c,r,n>r?n-1:n);let p={dragIndex:r,dropIndex:n,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:u,status:t.status};this.emit("drop",p)}};var fT={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:o=>o**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function mT(o,e){let t=getComputedStyle(o),n=e==="vertical"?t.overflowY:t.overflowX;return n!=="auto"&&n!=="scroll"?!1:e==="vertical"?o.scrollHeight>o.clientHeight:o.scrollWidth>o.clientWidth}function gT(o,e){let t=o;for(;t&&!(t===document.documentElement||t===document.body);){if(mT(t,e))return t;t=t.parentElement}return null}function hT(o,e){return{startScrollingFrom:o*e.startFromPercentage,maxScrollValueAt:o*e.maxScrollAtPercentage}}var lf=1;function rf(o,e,t){if(o>e.startScrollingFrom)return 0;if(o<=e.maxScrollValueAt)return t.maxPixelScroll;if(o===e.startScrollingFrom)return lf;let r=1-(o-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function yT(o,e,t){let{accelerateAt:n,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return o;if(i<n)return lf;let a=(i-n)/(r-n);return Math.ceil(o*t.ease(a))}function af(o,e,t,n,r,i,a){if(o<e||o>t)return 0;let l=hT(n,r),s=o-e,u=t-o,c=u<s,d;return c?d=rf(u,l,r):d=-rf(s,l,r),d===0?0:a?(d>0?1:-1)*yT(Math.abs(d),i,r):d}var mn=class{constructor(e){this.scrollContainer=null;this.rafId=null;this.lastPointer={left:0,top:0};this.dragStartTime=0;this.shouldUseDampening=!1;this.active=!1;this.maxScrollTop=0;this.maxScrollLeft=0;this.orientation=e.orientation,this.onScroll=e.onScroll,this.config={...fT,...e.config}}start(e){this.scrollContainer=gT(e,this.orientation),this.scrollContainer&&(this.maxScrollTop=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight,this.maxScrollLeft=this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth),this.dragStartTime=Date.now(),this.shouldUseDampening=!0,this.active=!0}getScrollContainer(){return this.scrollContainer}updatePointer(e){this.lastPointer=e,!this.rafId&&this.active&&this.scheduleScroll()}scheduleScroll(){this.rafId=requestAnimationFrame(()=>{if(this.rafId=null,!this.active||!this.scrollContainer)return;let e=this.computeScroll();if(e.top===0&&e.left===0)return;let t={top:this.scrollContainer.scrollTop,left:this.scrollContainer.scrollLeft},n=Math.max(0,Math.min(this.maxScrollTop,t.top+e.top)),r=Math.max(0,Math.min(this.maxScrollLeft,t.left+e.left));this.scrollContainer.scrollTop=n,this.scrollContainer.scrollLeft=r;let i={top:this.scrollContainer.scrollTop-t.top,left:this.scrollContainer.scrollLeft-t.left},a=i.top!==0||i.left!==0;a&&this.onScroll(i),this.active&&a&&this.scheduleScroll()})}computeScroll(){if(!this.scrollContainer)return{top:0,left:0};let e=this.scrollContainer.getBoundingClientRect();if(this.orientation==="vertical"){if(this.lastPointer.left<e.left||this.lastPointer.left>e.right)return{top:0,left:0}}else if(this.lastPointer.top<e.top||this.lastPointer.top>e.bottom)return{top:0,left:0};let t=0,n=0;return this.orientation==="vertical"?t=af(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):n=af(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:n}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var cf=Ye.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),gn=()=>Ye.useContext(cf),bT=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)`},ST=o=>`${o.getAttribute(Rt)}`;function Ts(o,e){let t=o.current?.querySelectorAll(pf)??[];return Array.from(t).filter(r=>r.getAttribute(Yr)===`${e}`)}function TT(o,e){let t=Ts(o,e);return!t||t.length,Array.from(t).map(r=>{let i=ST(r),a=r.getBoundingClientRect();return{id:i,rect:a}})}function CT(o){let{domRef:e,orientation:t,dragListId:n}=o,r=TT(e,n),i=e.current.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,u=i.right;for(let p of r){let f=p.rect;f.top<a&&(a=f.top),f.left<l&&(l=f.left),f.bottom>s&&(s=f.bottom),f.right>u&&(u=f.right)}let c=Re.from({top:a,left:l,width:u-l,height:s-a});return{draggableItems:r,orientation:t,listId:n,listRectangle:c,acceptDropsFrom:o.acceptDropsFrom,shouldAcceptDrop:o.shouldAcceptDrop,initial:o.initial,preserveDragSpace:o.preserveDragSpace}}function df(o){return new Zn(CT(o))}function IT(o,e){let t=Fe(e),[n,r]=Ye.useState(null),i=(0,eo.useCallback)(l=>{if(l)Tt.registerDragInteractionTarget(l);else{let s=a();s&&Tt.unregisterDragInteractionTarget(s)}r(l)},[]),a=Fe(n);return(0,eo.useEffect)(()=>Tt.on("register",l=>{let{dragListId:s,acceptDropsFrom:u,orientation:c,shouldAcceptDrop:d}=t(),p=l.getData();if(p.initial&&p.listId!==s&&u?.includes(p.listId)){let f=df({domRef:o,orientation:c,dragListId:s,initial:!1,acceptDropsFrom:u,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(f)}}),[t]),{interactionTarget:n,setInteractionTarget:i,getInteractionTarget:a}}function Cs(o,e){let t=o.cloneNode(!0);return t.removeAttribute(Rt),t.style.position="fixed",t.style.top=`${e.top}px`,t.style.left=`${e.left}px`,t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.zIndex="999999",t.style.pointerEvents="none",t.style.margin="0",t.style.boxSizing="border-box",t.style.transform="none",document.body.appendChild(t),t}function Is({proxyElement:o,dx:e,dy:t}){o.style.transform=`translate3d(${e}px, ${t}px, 0)`}function sf(o){let e=o.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",o.current=null)}var Ko=o=>{let e=Ye.useRef(null),t=Ye.useRef(null),[n,r]=(0,eo.useState)(null),i=Ye.useRef({top:0,left:0}),a=Ye.useRef(null),l=Ye.useCallback(v=>{a.current=v},[]),{dropTargetListId:s,dragSourceListId:u}=fo(),{updateDragOperationSourceAndTarget:c,dragItemId:d,status:p}=fo(),f=Fe(o.onDrop),m=Fe(o.onAcceptDrop),g=Fe(o.onRemove),h=Fe(o.updatePosition??bT),{interactionTarget:y,setInteractionTarget:b}=IT(e,o);(0,eo.useEffect)(()=>{let v=document.querySelector(`[${uf}="${o.dragListId}"]`);v?e.current=v: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,eo.useEffect)(()=>{if(y){let v=o.dragListId,M=y.on("start",({dragItem:F,dragSourceListId:O,dropTargetListId:K})=>{c({dragSourceListId:O,dropTargetListId:K,dragItemId:F.id,status:"accepted"})}),x=y.on("move",({offsetsForItems:F,items:O,status:K,dragItem:j})=>{if(K==="rejected")return;let k=T(),Q=h(),G=t.current;O.forEach(($,ie)=>{let pe=F[ie],ue=k[ie];if(ue&&!(G&&$.id===G.dragItemId)){if(!G&&$.id===j.id){let le=i.current;pe={left:pe.left+le.left,top:pe.top+le.top}}Q({id:$.id,node:ue,offset:pe})}})}),E=y.on("drop",F=>{let{sortedIndexes:O,dragIndex:K,dropIndex:j,dragItem:k,items:Q,dragSourceListId:G,dropTargetListId:$,outside:ie,status:pe}=F,ue=T();S.current=[];let le=m(),de=g(),ce=f(),U=h();Q.forEach((Y,Z)=>{let X=ue[Z];X&&U({id:Y.id,node:X,offset:null})}),sf(t),r(Y=>Y&&(requestAnimationFrame(()=>r(null)),{...Y,dragItemId:null})),v===$&&G!==v&&le&&pe==="accepted"&&le({dragItemId:k.id,dragSourceListId:G,dropTargetListId:$,dragIndex:K,dropIndex:j,dropItemId:Q[j]?.id});let q=null;j===-1&&G===v&&$===v&&ie&&(q=de),j!==-1&&$===v&&G===v&&(q=ce),q&&q?.(O,{dragIndex:K,dropIndex:j,dragItemId:Q[K].id,dropItemId:Q[j]?.id})}),P=null,A=null,_=null,N=null;if(!y.getData().initial&&e.current){if(P=new mn({orientation:o.orientation,onScroll:()=>{}}),P.start(e.current),A=P.getScrollContainer(),A){let F=o.orientation==="vertical"?A.scrollTop:A.scrollLeft;_=()=>{let O=o.orientation==="vertical"?A.scrollTop:A.scrollLeft,K=O-F;F=O,K!==0&&(y.adjustForScroll(K),Tt.retriggerMove())},A.addEventListener("scroll",_)}N=F=>{P.updatePointer({left:F.clientX,top:F.clientY})},Pe().addEventListener("pointermove",N)}return()=>{M(),x(),E(),P&&P.stop(),A&&_&&A.removeEventListener("scroll",_),N&&Pe().removeEventListener("pointermove",N)}}},[y,o.dragListId]);let S=Ye.useRef([]),T=(0,eo.useCallback)(()=>{let v=S.current;return(!v||v.length===0)&&(v=Ts(e,o.dragListId),S.current=v),v},[o.dragListId]),C=(0,eo.useCallback)(v=>{let M=v.currentTarget,x=M.getAttribute(Rt);if(x==null){let z=zo(M,pf);z&&(x=z.getAttribute(Rt))}if(x==null){console.warn("Could not find drag item id for element",M,`Make sure you have a parent element with a ${Rt} attribute`);return}x=`${x}`;let E=null,P=Ts(e,o.dragListId);S.current=P;let A=df({domRef:e,orientation:o.orientation,dragListId:o.dragListId,acceptDropsFrom:o.acceptDropsFrom,initial:!0,preserveDragSpace:o.preserveDragSpace}),_=A.getData().draggableItems,N=_.findIndex(z=>z.id===x);if(N===-1)return;let F=_[N],O=P[N]?.getAttribute(Rt)===`${x}`?P[N]:P.find(z=>z.getAttribute(Rt)===`${x}`);b(A);let K={left:v.clientX,top:v.clientY},j={left:v.clientX,top:v.clientY};i.current={top:0,left:0};let k=new mn({orientation:o.orientation,onScroll:()=>{}});e.current&&k.start(e.current);let Q=k.getScrollContainer(),G=Q?o.orientation==="vertical"?Q.scrollTop:Q.scrollLeft:0;function $(){E&&E.move({left:j.left,top:j.top})}let ie=()=>{if(!Q)return;let z=o.orientation==="vertical"?Q.scrollTop:Q.scrollLeft,q=z-G;G=z,q!==0&&(A.adjustForScroll(q),o.orientation==="vertical"?i.current.top+=q:i.current.left+=q),$()};Q?.addEventListener("scroll",ie);let pe=o.dragStrategy??"proxy",ue=pe==="proxy"&&!o.renderDragProxy,le=pe==="proxy"&&!!o.renderDragProxy,de=o.onDragProxyMove??Is,ce=z=>{if(j={left:z.clientX,top:z.clientY},!E){if(E=Tt.startDrag({listId:o.dragListId,dragItem:F,dragIndex:N},K),O&&ue){let Z=O.getBoundingClientRect(),X=null,me={dragItemNode:O,dragItemId:`${x}`,initialRect:Z,initialCoords:K,get proxyElement(){return X||(X=Cs(O,Z)),X}},he=o.onDragProxySetup?.(me),ae=he?.proxyElement??me.proxyElement;O.style.visibility="hidden",t.current={proxyElement:ae,originalNode:O,dragItemId:`${x}`,initialRect:Z,cleanup:he?.cleanup}}if(O&&le){let Z=O.getBoundingClientRect();O.style.visibility="hidden",t.current={proxyElement:O,originalNode:O,dragItemId:`${x}`,initialRect:Z,cleanup:()=>{}},r({dragItemId:`${x}`,initialRect:Z,dx:0,dy:0})}}let q=z.clientX-K.left,Y=z.clientY-K.top;if(le)r(Z=>Z&&{...Z,dx:q,dy:Y});else{let Z=t.current;Z&&de({proxyElement:Z.proxyElement,dx:q,dy:Y})}k.updatePointer({left:z.clientX,top:z.clientY}),$()},U=()=>{if(k.stop(),Q?.removeEventListener("scroll",ie),Pe().removeEventListener("pointermove",ce),le&&(r(z=>z&&{...z,dragItemId:null}),requestAnimationFrame(()=>{r(null)})),!E){sf(t),b(null);return}E.drop(),E=null};Pe().addEventListener("pointermove",ce),Pe().addEventListener("pointerup",U,{once:!0})},[o.orientation,o.dragListId,o.acceptDropsFrom,o.removeOnDropOutside,o.dragStrategy,o.renderDragProxy,o.onDragProxySetup,o.onDragProxyMove]),I=!!d,R=Ye.useMemo(()=>({dragItemId:d,onDragItemPointerDown:C,dragSourceListId:u,dropTargetListId:s,status:p,dragListId:o.dragListId,draggingInProgress:I}),[d,C,I,u,s,o.dragListId]),w={className:oe("DragList",I?"DragList--dragging":"",tf({dragging:I})),[uf]:o.dragListId},D=typeof o.children=="function"?o.children(w,R):o.children;return Ye.createElement(cf.Provider,{value:R},D,n&&o.renderDragProxy?o.renderDragProxy({...n,ref:l}):null)},uf="data-drag-list-id",Rt="data-drag-item-id",Yr="data-drag-item-list-id",pf=`[${Rt}]`,RT=Ye.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),wT=o=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:n,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=gn(),l=o.dragListId??n,s=i===l&&r===`${o.id}`,u=Ye.useMemo(()=>({dragItemId:o.id,active:s,dragListId:l,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[o.id,s,l,t,i,a]),c={[Rt]:`${o.id}`,[Yr]:l,onPointerDown:e,className:oe("DraggableItem",s?"DraggableItem--active":"",of({active:s,draggingInProgress:t}))},d=typeof o.children=="function"?o.children(c,u):o.children;return Ye.createElement(RT.Provider,{value:u},d)};Ko.DraggableItem=wT;var Rs=W(require("react"));var ff=o=>Rs.createElement(Ve,{...o,viewBox:"0 -960 960 960"},Rs.createElement("path",{d:Ge.hidden[0]}));var oi=W(require("react"));function mf(){return{}}var gf=o=>({allowColumnHideWhileDragging:e=>e??!0});var hf=require("react"),vT=(0,hf.createContext)(null);function ws(){return vT}var Gt=W(require("react"));var Sn=W(require("react")),Vt=require("react");var na=W(require("react"));function PT(o){let{height:e,width:t,count:n}=o;return na.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 yf=na.memo(PT);var bf="mlx2t3";var ra=W(require("react")),Pf=require("react");var Sf=require("react"),Tf=(o,e)=>{(0,Sf.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 Cf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},If={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},Rf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},vs="_1ueijco1",wf="_1ueijco0 _16lm1iw0";var vf=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=Cf[`${o}`]:e=oe(If[`${o.horizontal}`],Rf[`${o.vertical}`]),e};var DT="InfiniteVirtualScrollContainer";var Df=ra.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:u}=e,c=t??(0,Pf.useRef)(null);return Tf(c,i),ra.createElement("div",{ref:c,style:s,autoFocus:u,tabIndex:l,className:oe(a,DT,wf,vf(r))},n)});var ga=W(require("react")),bn=require("react");var xf=W(require("react")),Qn=require("react");function xT(o){let[e,t]=(0,Qn.useState)(o.updater.get),n=(0,Qn.useRef)(null);return(0,Qn.useLayoutEffect)(()=>{function r(a){o.useraf?(n.current!=null&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=o.updater.onChange(r);return()=>{n.current!=null&&cancelAnimationFrame(n.current),i()}},[o.updater,o.useraf]),e??null}var Bo=xf.memo(xT);var Ef=W(ln());var Ps=(o,e)=>o-e,yo={horizontal:!0,vertical:!0};function ia(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 Ds="DebugID=";function Wo(o,e){return e&&e.startsWith(Ds)?e:e?`${Ds}${o}:${e}`:`${Ds}${o}`}var aa={start:0,end:0},xs=o=>{o()},Es=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},Mf=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},qr=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function ET(o){return o.horizontalChange||o.verticalChange}var hn=class extends bt{constructor(t){let n=Wo(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=aa;this.verticalExtendRangeBy=aa;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=>{qr(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?xs:qr;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?xs:qr;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 c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=this.getColWidth(c);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let u=0;for(let c=this.cols-this.fixedColsEnd;c<this.cols;c++){let d=s+l;i[c]=d,l+=a[u],u++}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 c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=this.getRowHeight(c);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let u=0;for(let c=this.rows-this.fixedRowsEnd;c<this.rows;c++){let d=s+l;i[c]=d,l+=a[u],u++}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=yo)=>{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=yo)=>{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,u=t.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(l,c,"vertical");let d=this.rowspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,c])}}}if(r){let l=t.startIndex,s=n.startIndex,u=n.endIndex;for(let c=s;c<u;c++){this.computeItemSpanUpTo(c,l,"horizontal");let d=this.colspanParent.get(c);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([c,p])}}}return a};this.computeRenderRange=(t=yo)=>{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",u=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,c=this.getItemAt(l,t),d=u.start||0,p=u.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(c=Math.max(0,c-d),r+=d),p&&(r+=p);let f=c+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,c=Math.max(a,f-r)),{startIndex:c,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,u=l.length-1,c=a[s],d;for(;c<t;)if(s>=i||(u+=1,this.computeCacheFor(u,n),d=c,c=a[u],d===c&&d!=0))return i-1;let p=(0,Ef.default)(a,t,Ps);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],u=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),u==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let c=s+u;a[t]=c}};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 u=r==="horizontal"?this.colspanParent:this.rowspanParent;u.has(a)||u.set(a,[]);let c=r==="horizontal"?this.colspanValue:this.rowspanValue;c.has(a)||c.set(a,[]);let d=u.get(a),p=c.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 y=f;for(;h>1;)y+=1,d[y]=f,p[y]=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,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),u||(u=s.get(l)),u[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,u=s.get(l);return(!u||u[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),u||(u=s.get(l)),u[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,u=Math.min(t,r-1);for(;s<=u;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=Es;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=yo){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:u}=t,c=typeof s=="number",d=typeof u=="number",p=c&&s!==this.availableWidth,f=d&&u!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=u,this.availableRenderHeight=u),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",h=m&&r!==this.rows,y=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let b=a!=null,S=l!=null,T=b&&a!==this.rowHeight,C=S&&l!==this.colWidth;b&&(this.rowHeight=a),S&&(this.colWidth=l);let I=t.rowspan!=null,R=t.colspan!=null,w=I&&t.rowspan!=this.rowspan,D=R&&t.colspan!=this.colspan;w&&(this.rowspan=t.rowspan),D&&(this.colspan=t.colspan);let v=y||C||p||D,M=h||T||f||w;(n||ET)({horizontalChange:v,verticalChange:M,colsChanged:y,colWidthChanged:C,widthChanged:p,colspanChanged:D,rowsChanged:h,rowHeightChanged:T,heightChanged:f,rowspanChanged:w})&&this.updateRenderCount({horizontal:v,vertical:M})}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=yo){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=yo){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?xs:qr;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,u=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let c=[],d=0,p=r;d+=s,p-=u;for(let f=d;f<p;f++)c.push(this.getItemSize(f,t));a=ia(l,c)}else a=(n?Math.ceil(l/n):0)+1;return a+=s+u,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=>{qr(()=>{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,u=l+s;return t==="horizontal"?this.horizontalTotalSize=u:this.verticalTotalSize=u,u}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=aa,this.verticalExtendRangeBy=aa,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var Ms=W(ln());function Af(...o){if(!o.length)return new Set;let[e,...t]=o;return new Set([...e].filter(n=>t.every(r=>r.has(n))))}function _f(o,e){let t=new Set;for(let n of o)e(n)&&t.add(n);return t}function Xr(o,e){for(let t of o)if(e(t))return t}var la=(o,e)=>o-e,sa=class extends bt{constructor(t,n){super(`${t}:GridCellManager`);this.matrix=new te;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,u=new Set;return this.matrix.visit(({value:c},d)=>{if(!c)return;let[p,f]=d,m=p<i,g=p>=l,h=f<a,y=f>=s;(m||g||h||y)&&u.add(c)}),u};this.debugId=t,this.pool=n,this.offRemoveCell=this.pool.onRemoveCell(r=>this.onRemoveCell(r))}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=Xr(l,s=>!this.isCellAttached(s)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=Xr(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,u)=>{let c=[a,u],d=this.getCellAt(c);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(la)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(la)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((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,Ms.default)(n,t,la);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let n=this.getColumnsWithCells().sort(),r=(0,Ms.default)(n,t,la);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 Xr(t,r=>this.getCellPosition(r)?.[0]===n)}getCellFromListForColumn(t,n){return Xr(t,r=>this.getCellPosition(r)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}flushPendingAfterCommitWork(){this.pool.flushPendingAfterCommitWork()}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 Of=W(ln());var ua=class extends bt{constructor(t,n){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=n,this.offRemoveRow=this.pool.onRemoveRow(r=>this.onRemoveRow(r))}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,Of.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 Nf=!0,yn=J(ee.y),Ff=J(ee.scrollTop),x_=J(ee.columnOffsetAtIndex),As=J(ee.columnOffsetAtIndexWhileReordering),Jn=class extends bt{constructor(t,n,r){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(yn,i?`calc( ${r}px + var(${Ff}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${yn}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},u)=>{let c=Ie.columnOffsets.get(r),d=`${As}-${r}`,p=s?`calc( ${a}px + var(${Ff}) )`:`${a}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(yn,p));let f=`translate3d(var(${d}, ${c}), var(${yn}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),u!=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 u=r.getItemOffsetFor(t,"vertical"),c=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=u>g-p?"end":u<f+d?"start":"end");let h=i.scrollTop;if(l==="center"?h=u-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,h+=u-f+s-d):(s+=c,h+=u-g+s+p),this.brain.isHorizontalLayoutBrain){let y=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),b=this.getScrollPositionForScrollColumnIntoView(y,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});b&&(a=b.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 u=r.getItemOffsetFor(t,"horizontal"),c=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=u>g-p?"end":u<f+d?"start":"end");let h=i.scrollLeft;return l==="center"?h=u-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,h+=u-f+s-d):(s+=c,h+=u-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 u=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-n,"vertical");return t<=u}if(t<s){let u=i.getItemAt(i.getScrollPosition().scrollTop+n,"vertical");return t>=u}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,u]}=i.getRenderRange();if(t<l||t>=u)return!1;let c=Math.floor((l+u)/2);if(t>=c){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-n-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<c){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:u,end:c}=t,[d,p]=u,[f,m]=c,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(),u=this.brain.getRowCount(),c=!1,d=!1,p=!1;if(t<r&&(c=!0,p="start"),i&&!c){let f=u-i;t>=f&&(c=!0,p="end")}if(n<a&&(d=!0,p="start"),l&&!d){let f=s-l;n>=f&&(d=!0,p="end")}return{row:c?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.onMouseEnterNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(n)};this.onMouseLeaveNotBound=t=>{let n=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(n)};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))};He(()=>{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:u,y:c}=s;if(r){let d=()=>{this.updateHoverClassNamesForRow(a);let p=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=p.rowIndex,r.dataset.colIndex=p.colIndex,Nf){this.setTransform(r,a,l,{x:u,y:c},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let m=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==m&&(r.__zIndex=m,r.style.zIndex=m)}else r.style.display="",r.style.left=`${u}px`,r.style.top=`${c}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?t.setPendingAfterCommitWork(d):d()}};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,Nf&&(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:u,fixedRowsStart:c,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(P=>{let A=i.getRowIndex(P);if(A!=null){let _=this.brain.getItemOffsetFor(A,"vertical");if(_==null)return;let N=P.getElement();if(!N)return;this.setDetailTransform(N,A,{y:_,scrollLeft:t.scrollLeft})}}),!s&&!u&&!c&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&kd(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(),[y,b]=g,[S,T]=h;function C(P,A,_){let N=r.getCellAt([P,A]);if(N==null)return;let F=n.getCellOffset(P,A),O=N.getElement();O&&F&&_(P,A,O,F)}let I=(P,A,_,{x:N,y:F})=>{this.setTransform(_,P,A,{x:N,y:F,scrollLeft:!0},s-A)},R=(P,A,_,N)=>{this.setTransform(_,P,A,{x:N.x,y:N.y,scrollTop:!0},c-P)},w=(P,A,_,{y:N})=>{let F=f[A];this.setTransform(_,P,A,{x:F,y:N,scrollLeft:!0},a-A)},D=(P,A,_,N)=>{this.setTransform(_,P,A,{x:N.x,y:m[P],scrollTop:!0},l-P)},v=(P,A,_,{x:N,y:F})=>{this.setTransform(_,P,A,{x:N,scrollLeft:!0,y:F,scrollTop:!0},1e5)},M=(P,A,_,{x:N})=>{this.setTransform(_,P,A,{x:N,scrollLeft:!0,y:m[P],scrollTop:!0},2e5)},x=(P,A,_,N)=>{this.setTransform(_,P,A,{x:f[A],y:N.y,scrollLeft:!0,scrollTop:!0},3e5)},E=(P,A,_)=>{this.setTransform(_,P,A,{x:f[A],y:m[P],scrollLeft:!0,scrollTop:!0},4e5)};if(s||u)for(let P=y;P<S;P++){for(let A=0;A<s;A++)C(P,A,I);if(u){let A=a-u;for(let _=A;_<a;_++)C(P,_,w)}}if(c||d)for(let P=b;P<T;P++){for(let A=0;A<c;A++)C(A,P,R);if(d){let A=l-d;for(let _=A;_<l;_++)C(_,P,D)}}if(s&&c)for(let P=0;P<c;P++)for(let A=0;A<s;A++)C(P,A,v);if(s&&d){let P=l-d;for(let A=P;A<l;A++)for(let _=0;_<s;_++)C(A,_,M)}if(u&&c){let P=a-u;for(let A=0;A<c;A++)for(let _=P;_<a;_++)C(A,_,x)}if(u&&d){let P=l-d,A=a-u;for(let _=P;_<l;_++)for(let N=A;N<a;N++)C(_,N,E)}};this.flushPendingAfterCommitWork=()=>{this.destroyed||this.cellManager.flushPendingAfterCommitWork()};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 sa(n,r.cellPool),this.cellManager.onCellAttachmentChange((u,c)=>{c?this.onCellAttached(u):this.onCellDetached(u)}),this.rowManager=new ua(n,r.rowPool),this.rowManager.onRowAttachmentChange((u,c)=>{c?this.onRowAttached(u):this.onRowDetached(u)}),this.renderRange=this.renderRange.bind(this);let i=t.onScroll(this.adjustFixedElementsOnScroll),a=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),He(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),l=t.onScrollStart(this.onScrollStart),s=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{i(),a(),l(),s()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=ns(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,u=this.brain.isHorizontalLayoutBrain,{rowManager:c,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let v=t.start[1],M=t.end[1];m.forEach(x=>{v<=x&&x<M||f.push({start:[t.start[0],x],end:[t.end[0],x+1]})})}let g=new Map,h=f.map(this.getExtraSpanCellsForRange).flat();h&&h.forEach(([v,M])=>{g.set(`${v}:${M}`,!0)});let y=f.reduce((v,M)=>v+Es(M),0),b=r?f.reduce((v,M)=>v+Mf(M),0):0,S=this.brain.getRowCount(),T=this.brain.getColCount();d.detachCellsStartingAt([S,T]);let C=Math.min(S*T,y);r&&(c.detachStartingWith(this.brain.getRowCount()),c.poolSize>b&&(c.poolSize=b));let I=Af(...f.map(v=>d.getCellsOutsideRenderRange(v)));I=_f(I,v=>{let M=d.getCellPosition(v);return!(M&&g.has(`${M[0]}:${M[1]}`))}),d.detachCells(I),d.poolSize=C;let R=new Map,w=new Map;f.forEach(v=>{let{start:M,end:x}=v,[E,P]=M,[A,_]=x;for(let N=E;N<A;N++){for(let O=P;O<_;O++){let K=`${N}:${O}`;if(R.has(K))continue;R.set(K,!0);let{rendered:j,mapped:k}=this.isCellRenderedAndMappedCorrectly(N,O);if(N===E||O===P){let G=this.isCellCovered(N,O);if(G&&g.has(`${G[0]}:${G[1]}`)){let $=d.getCellAt([N,O]);$!=null&&d.detachCell($);continue}}if(j&&!i&&k)continue;let Q;j?Q=d.getCellAt([N,O]):Q=d.getCellFor([N,O],u?"row":"column"),Q==null&&(Q=d.getDetachedCell()),this.renderCellAt(N,O,Q,n)}!r||w.has(N)||(w.set(N,!0),c.isRowAttachedAt(N)&&!i)||this.renderDetailRowAtElement(N,this.rowManager.getRowFor(N),r)}}),h.forEach(([v,M])=>{let{rendered:x,mapped:E}=this.isCellRenderedAndMappedCorrectly(v,M);if(x){if(i||!E){let A=[v,M],_=d.getCellAt(A);this.renderCellAt(v,M,_,n)}return}let P=d.getCellFor([v,M],u?"row":"column");P!=null&&this.renderCellAt(v,M,P,n)});let D=d.getAllCells().map(v=>v.getNode());return r&&c.getAllRows().forEach(v=>{D.push(v.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(D),D}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,u=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(c=>{let d=c.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(c)}),!u){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(u,n,t),this.updateDetailElementPosition(n)}getCellRealCoordinates(t,n){return{rowIndex:t,colIndex:n}}getMatrixRowIndexFromElement(t){let n=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(n):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),u=this.brain.getRowspan(t,n),c=this.brain.getColspan(t,n),d=u===1?l:this.brain.getRowHeightWithSpan(t,n,u),p=c===1?s:this.brain.getColWidthWithSpan(t,n,c),{row:f,col:m}=this.isCellFixed(t,n),g=!!a,{rowIndex:h,colIndex:y}=this.getCellRealCoordinates(t,n),b=i({rowIndex:h,colIndex:y,height:l,width:s,rowspan:u,colspan:c,rowFixed:f,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:r.ref});r.isMounted()||r.onMount(C=>{let I=C.getElement();I&&(I.style.position="absolute",I.style.left="0px",I.style.top="0px"),this.updateElementPosition(C)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:h,renderColIndex:y}:void 0,T=this.brain.isHorizontalLayoutBrain;if(!b){T?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(b,r,[t,n],S),this.updateElementPosition(r,{hidden:g,rowspan:u,colspan:c})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var ca=class extends Jn{constructor(t,n,r){super(t,n,r);this.setTransform=(t,n,r,i,a)=>{let l=this.getCellRealCoordinates(n,r),{y:s}=i,u=Math.floor(l.rowIndex/this.brain.rowsPerPage),c=fe.runtime.totalVisibleColumnsWidthVar,d=u?`calc(${c} * ${u})`:"0px",p=Ie.columnOffsets.get(l.colIndex),f=`${As}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(yn,m));let g=`calc(var(${f}, ${p}) + ${d})`,h=`var(${yn})`,y=`translate3d(${g}, ${h}, 0px)`;t.__transformValue!==y&&(t.__transformValue=y,t.style.transform=y)};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}}};var kf=W(require("react"));var er=class er extends bt{constructor(t){super(t);this.cellRemoveSubscription=Se();this.cellAttachmentChangeSubscription=Se();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=this.createCellInstance();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+=er.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}flushPendingAfterCommitWork(){for(let t of this.attachedCells)t.flushPendingAfterCommitWork()}set poolSize(t){t=Math.ceil(t/er.POOL_SIZE_INCREMENT)*er.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--}};er.POOL_SIZE_INCREMENT=1;var da=er;var Lf=new Map,MT=()=>{},_s=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=Se();let n=Lf.get(e)??0,r=`${e}:GridCellReact:${n}`;Lf.set(e,n+1),this.debugId=r,this.cellInfo=t,this.updater=Se(),this.node=kf.createElement(Bo,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(e){this.pendingAfterCommitWork=e}flushPendingAfterCommitWork(){if(this.pendingAfterCommitWork){let e=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,e()}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=MT,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}},pa=class extends da{constructor(t){super(`${t}:GridCellPoolForReact`);this.cellDebugId=t}createCellInstance(){return new _s(this.cellDebugId)}};var Vf=W(require("react"));var tr=class tr extends bt{constructor(t){super(t);this.rowRemoveSubscription=Se();this.rowAttachmentChangeSubscription=Se();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=this.createRowInstance();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+=tr.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/tr.POOL_SIZE_INCREMENT)*tr.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--}};tr.POOL_SIZE_INCREMENT=1;var fa=tr;var zf=new Map,AT=()=>{},Os=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=Se();let t=zf.get(e)??0,n=`${e}:ListRowReact:${t}`;zf.set(e,t+1),this.debugId=n,this.updater=Se(),this.node=Vf.createElement(Bo,{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=AT,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},ma=class extends fa{constructor(t){super(`${t}:ListRowPoolForReact`);this.rowDebugId=t}createRowInstance(){return new Os(this.rowDebugId)}};function Gf(o){return{cellPool:new pa(o),rowPool:new ma(o)}}function Zr(o){let e=o.isHorizontalLayoutBrain?new ca(o,`${o.name}:HorizontalLayoutTableRenderer`,Gf(`${o.name}:HorizontalLayoutTableRenderer`)):new Jn(o,`${o.name}:ReactHeadlessTableRenderer`,Gf(`${o.name}:ReactHeadlessTableRenderer`)),t=Se();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function _T(o){let{brain:e,renderCell:t,renderDetailRow:n,forceRerenderTimestamp:r}=o,{renderer:i,onRenderUpdater:a}=(0,bn.useMemo)(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:Zr(e),[e,o.onRenderUpdater,o.renderer]);return(0,bn.useLayoutEffect)(()=>{i.cellHoverClassNames=o.cellHoverClassNames||[]},[i,o.cellHoverClassNames]),(0,bn.useLayoutEffect)(()=>{i.cellDetachedClassNames=o.cellDetachedClassNames||[]},[i,o.cellDetachedClassNames]),(0,bn.useLayoutEffect)(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:n}),e.onRenderRangeChange(u=>{i.renderRange(u,{force:!1,onRender:c=>{let d=a.get();d&&c&&d.length===c.length||a(c)},renderCell:t,renderDetailRow:n})})},[i,e,t,n,a,r]),(0,bn.useLayoutEffect)(()=>{i.flushPendingAfterCommitWork()}),ga.createElement(Bo,{updater:a})}var ha=ga.memo(_T);var Qr=W(require("react")),or=require("react");var Hf=be({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),ya="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Kf=be({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:OT}=ze,NT=`${OT}-ActiveRowIndicator`,FT=`calc(${ee.activeCellRowOffsetX} + var(${J(ee.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,LT={[J(ee.activeCellOffsetY)]:ee.activeCellRowOffset,transform:`translate3d(${FT}, calc( ${ee.activeCellOffsetY} + var(${J(ee.scrollTopForActiveRow)}, 0px)), 0px)`,height:ee.activeCellRowHeight,maxWidth:fe.runtime.totalVisibleColumnsWidthVar},kT=o=>{let{brain:e}=o,t=(0,or.useRef)(null),n=o.activeRowIndex!=null&&e.getInitialRows()>o.activeRowIndex,[r,i]=Ut();return(0,or.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(${fe.runtime.totalVisibleColumnsWidthVar} * ${p})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),u=e.getItemOffsetFor(l,"vertical"),c=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${u}px`,activeCellRowOffsetX:a};Bn(d,c)},[o.activeRowIndex,e]),(0,or.useEffect)(()=>{let a=u=>{Bn({scrollTopForActiveRow:`${-u.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:e.isHorizontalLayoutBrain?`${-u.scrollLeft}px`:"0px"},t.current)};a(e.getScrollPosition());let l=e.onScroll(a),s=e.onRenderCountChange(i);return()=>{s(),l()}},[e]),Qr.createElement("div",{className:ya,"data-name":"active-row"},Qr.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${NT} ${Kf({active:n})}`,style:n?LT:void 0}))},Bf=Qr.memo(kT);var Jr=W(require("react")),nr=require("react");var{rootClassName:zT}=ze,VT=`${zT}-ActiveCellIndicator`,GT=J(ee.columnZIndexAtIndex),HT=(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;Bn({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},KT=o=>{let{brain:e}=o,[t,n]=Ut(),r=(0,nr.useRef)(null),i=o.activeCellIndex!=null&&e.getInitialRows()>o.activeCellIndex[0];return(0,nr.useLayoutEffect)(()=>{HT(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight,e]),(0,nr.useEffect)(()=>{let a=e.onRenderCountChange(()=>{n()});return()=>{a()}},[e]),Jr.createElement("div",{className:ya,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${GT}-${o.activeCellIndex[1]})`}:void 0},Jr.createElement("div",{"data-name":"active-cell-indicator",className:`${VT} ${Hf({visible:i})}`}))},Wf=Jr.memo(KT);var ba=[vp,`${ft}DetachedCell`];function Sa(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 BT=oe(bf,vs);function jf(o){let{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:u,activeCellIndex:c,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=o,{autoFocus:h}=g,y=(0,Vt.useRef)(null),[b,S]=(0,Vt.useState)({width:0,height:0});(0,Vt.useEffect)(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),(0,Vt.useEffect)(()=>{let I=y.current?.parentNode;return I?(h&&document.activeElement!==I&&I.focus(),An(I,()=>{let D={height:I.clientHeight,width:I.clientWidth};e.update(D)},{debounce:50})):void 0},[p,e]);let T=(0,Vt.useCallback)(I=>{requestAnimationFrame(()=>{y.current&&y.current.style.setProperty("transform",`translate3d(${-I.scrollLeft}px, ${-I.scrollTop}px, 0px)`)})},[]),C=(0,Vt.useCallback)(I=>{e.setScrollPosition(I,T)},[e,T]);return(0,Vt.useEffect)(()=>{let I=e.onRenderCountChange(()=>{S(e.getVirtualizedContentSize())});return S(e.getVirtualizedContentSize()),T(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),I},[e]),Sn.createElement(Df,{onContainerScroll:C,...g,ref:t},Sn.createElement("div",{ref:y,className:BT,"data-name":"scroll-transform-target"},Sn.createElement(ha,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:ba}),c!=null?Sn.createElement(Wf,{brain:e,rowHeight:a,activeCellIndex:c}):null),u!=null?Sn.createElement(Bf,{brain:e,activeRowIndex:u}):null,Sn.createElement(yf,{width:b.width,height:b.height}))}function $f(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((c,d)=>{let p=c.id,f=o[d-1],m=f?.id??"",g=new Set,h=f?.computedPinned!==c.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let y={type:"column",id:p,ref:c,groupOffset:0,computedPinned:c.computedPinned,computedWidth:c.computedWidth,depth:c.columnGroup?(t.get(c.columnGroup)??0)+1:0};r.set([p],y);let b=c.columnGroup,S,T=y;for(;b;){let C=e[b];if(C){g.add(b);let I=[p,...g];S=h.has(b)?i.get(b):void 0,S||(S={id:b,type:"group",ref:C,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[b],computedWidth:0,computedPinned:y.computedPinned,depth:t.get(b)??0},r.set(I,S),i.set(b,S)),S.columnItems.push(y),S.uniqueGroupId.push(y.id),T&&!h.has(T.id)&&S.children.push(T),T=S,b=C.columnGroup}else break}});let l=[],s=new te,u=0;return r.forEach(c=>{if(!c.ref.columnGroup){let d=c.type==="column"?c.ref.computedWidth:c.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);c.groupOffset=u,c.computedWidth=d,c.type==="group"&&Uf(c.children),l.push(c),u+=d}if(c.type==="group")c.columnItems.forEach(d=>{s.set([c.depth,d.ref.computedVisibleIndex],c)});else for(let d=c.depth;d<=n+1;d++)s.set([d,c.ref.computedVisibleIndex],c)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function Uf(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"&&Uf(t.children),e+=n})}var jo=W(require("react")),bo=require("react");var Fs=W(require("react"));var qf=W(require("react")),Ns=require("react");var ei=require("react"),ti=W(require("react"));var{rootClassName:WT}=ze,jT=`${WT}HeaderCell_ResizeHandle`;function $T(o){let e=(0,ei.useRef)(null),[t,n]=(0,ei.useState)(!1),r=(0,ei.useRef)(t);r.current=t;let i=o.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,u=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let g=!0,h=Zp(o.groupColumns.map(T=>T.computedVisibleIndex),{columns:o.columns,domRef:e}),y=T=>{a==="end"&&(T*=-1);let{constrained:C,adjustedDiffs:I,adjustedDiff:R}=o.computeResize(T);return r.current!==C&&n(C),h.resize(I),R},b=T=>{if(g){let C=o.groupColumns.reduce((w,D)=>w+D.computedWidth-D.computedMinWidth,0),I=o.brain.getAvailableSize(),R={width:I.width+C,height:I.height};o.brain.update(R),g=!1}y(Math.round(T.clientX-f))},S=T=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",b),m.removeEventListener("pointerup",S);let C=Math.round(T.clientX-f),I=y(C);h.resize(o.groupColumns.map(()=>0)),o.onResize(I)};m.addEventListener("pointermove",b),m.addEventListener("pointerup",S)},c=(a===!1||a==="start")&&s?{right:a==="start"?void 0:fe.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return ti.createElement("div",{ref:e,className:`${jT} ${ea} ${oa({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:u},ti.createElement("div",{style:{...c,...o.style},className:ta({constrained:t})}))}var Yf=ti.memo($T);function Xf(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:u}=re(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),c=o[o.length-1],d=(0,Ns.useCallback)(g=>{let h=l(),{columnSizing:y,viewportReservedWidth:b,bodySize:S}=h,T=s().computedVisibleColumns,C=!1,I=T.reduce((D,v)=>(v.computedFlex&&(D[v.id]={...y[v.id],flex:v.computedWidth},C=!0),D),{}),R=C?{...y,...I}:y;return hd({availableSize:bs(S),reservedWidth:b||0,dragHandleOffset:g,dragHandlePositionAfter:c.computedVisibleIndex,columnSizing:R,columnGroupSize:o.length,items:T.map(D=>({id:D.id,resizable:D.computedResizable,computedFlex:D.computedFlex,computedWidth:D.computedWidth,computedMinWidth:D.computedMinWidth,computedMaxWidth:D.computedMaxWidth}))})},[c]),p=(0,Ns.useCallback)(g=>{let{columnSizing:h,reservedWidth:y}=d(g);u.viewportReservedWidth=y,u.columnSizing=h},[d]);return o.some(g=>g.computedResizable)?qf.createElement(Yf,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:p}):null}var Zf=`${ft}HeaderGroup`,Qf=J(ee.columnWidthAtIndex),UT=J(ee.columnZIndexAtIndex);function Jf(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=Xf(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),u=n[0],c=n.length>1?"calc( "+n.map(f=>`var(${Qf}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${Qf}-${u.computedVisibleIndex})`,d=`calc(var(${UT}-${u.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=c,p.height=t,Fs.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:oe(id,Zf),style:p,"data-z-index":d},Fs.createElement("div",{className:oe(`${Zf}__header-content`,kt)},a),s)}var em=require("react");var zs=W(require("react")),Ls;function Vs(){return Ls||(Ls=zs.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var ks;function Ta(){return ks||(ks=zs.createContext(null))}function Oe(o){let e=Ta(),t=(0,em.useContext)(e);return _n(t,o)}function to(){return Oe(o=>({getDataSourceState:o.getDataSourceState,getDataSourceMasterContext:o.getDataSourceMasterContext,dataSourceActions:o.dataSourceActions,dataSourceApi:o.dataSourceApi,assignState:o.assignState}))}var{rootClassName:YT}=ze,qT=[],tm=`${YT}Header`,XT=ed({overflow:!1}),om=()=>{};function ZT(o){let{bodyBrain:e,headerBrain:t,columns:n,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=o,{getState:u,headerOptions:c,headerRenderer:d,headerOnRenderUpdater:p,showColumnFilters:f,computedColumnsMap:m}=re(x=>({computedColumnsMap:x.computed.computedColumnsMap,getState:x.getState,headerOptions:x.state.headerOptions,headerRenderer:x.state.headerRenderer,headerOnRenderUpdater:x.state.headerOnRenderUpdater,showColumnFilters:x.state.showColumnFilters})),g=(0,bo.useRef)(null),h=(0,bo.useCallback)(x=>{g.current&&(g.current.style.transform=`translate3d(-${x.scrollLeft}px, 0px, 0px)`)},[]);(0,bo.useEffect)(()=>{let x=t.onScroll(h);return h(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),x},[t]);let y={ref:g,className:oe(tm,`${tm}--virtualized`,i,XT),style:{...r,height:a}},{getDataSourceState:b,dataSourceApi:S,dataSourceActions:T}=to(),{allRowsSelected:C,someRowsSelected:I,selectionMode:R,filterTypes:w,filterDelay:D}=Oe(x=>({allRowsSelected:x.dataSourceState.allRowsSelected,someRowsSelected:x.dataSourceState.someRowsSelected,selectionMode:x.dataSourceState.selectionMode,filterTypes:x.dataSourceState.filterTypes,filterDelay:x.dataSourceState.filterDelay})),v=(0,bo.useMemo)(()=>({allRowsSelected:C,someRowsSelected:I,selectionMode:R}),[C,I,R]),M=(0,bo.useCallback)(x=>{let{rowIndex:E,colIndex:P,domRef:A,height:_,widthWithColspan:N,heightWithRowspan:F,hidden:O}=x,K=n[P];if(!K||O)return null;let j=t.isHorizontalLayoutBrain?t.getPageIndexForRow(E):null,k=l?l.pathsToCells.get([E,P]):null;if(k&&k.type==="group"){let Q=k.columnItems.map(ie=>ie.ref),G={...k.ref,id:k.id,uniqueGroupId:k.uniqueGroupId,depth:k.depth,columns:Q.map(ie=>ie.id),computedWidth:k.computedWidth,groupOffset:k.groupOffset};return u().columnGroupVisibility[k.id]!==!1?jo.createElement(Jf,{horizontalLayoutPageIndex:j,bodyBrain:e,columnGroupsMaxDepth:s,domRef:A,columns:Q,width:N,height:_,columnGroup:G}):null}return jo.createElement(rm,{domRef:A,column:K,horizontalLayoutPageIndex:j,headerOptions:c,dataSourceStatePartialForHeaderCell:v,filterTypes:w,filterDelay:D,getDataSourceState:b,dataSourceApi:S,dataSourceActions:T,width:N,height:F,columnsMap:m})},[c,n,a,l,s,f,t,b,S,T,w,D,v]);return jo.createElement(Ko,{orientation:"horizontal",dragListId:"header",dragStrategy:"inline",onDrop:om,updatePosition:om},x=>jo.createElement("div",{...x,...y,className:oe(x.className,y.className)},jo.createElement(ha,{name:"header",renderCell:M,brain:t,renderer:d,onRenderUpdater:p,cellHoverClassNames:qT,cellDetachedClassNames:ba})))}var nm=jo.memo(ZT);function im(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=re(I=>({computedPinnedStartColumns:I.computed.computedPinnedStartColumns,computedPinnedEndColumns:I.computed.computedPinnedEndColumns,computedVisibleColumns:I.computed.computedVisibleColumns,columnSize:I.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:u,columnGroupsMaxDepth:c,computedColumnGroups:d,showColumnFilters:p}=re(I=>({columnHeaderHeight:I.state.columnHeaderHeight,columnGroupsDepthsMap:I.state.columnGroupsDepthsMap,columnGroupsMaxDepth:I.state.columnGroupsMaxDepth,computedColumnGroups:I.state.computedColumnGroups,showColumnFilters:I.state.showColumnFilters})),f=!d||!Object.keys(d).length?1:c+2,m=f*s+(p?s:0),g=Gt.useMemo(()=>{if(!(!d||!Object.keys(d).length))return $f(a,d,u,c)},[a,d,u]),h=Gt.useCallback(({rowIndex:I,colIndex:R})=>{let w=a[R],D=1,v=1;if(!w||!g)return{rowspan:D,colspan:v};let M=g.pathsToCells.get([I,R]);if(!M)return{rowspan:D,colspan:v};if(M.type==="column")return{colspan:v,rowspan:f-M.depth};let x=M.columnItems.findIndex(E=>E.id===w.id);return{rowspan:D,colspan:x===0?M.columnItems.length:1}},[d,c,a,g,f,u]),y=Gt.useCallback(({rowIndex:I,colIndex:R})=>h({rowIndex:I,colIndex:R}).rowspan,[h]),b=Gt.useCallback(({rowIndex:I,colIndex:R})=>h({rowIndex:I,colIndex:R}).colspan,[h]),S=Gt.useCallback(I=>p?I<f-1?s:2*s:s,[f,p,s]);Sa(e,{colWidth:l,rowHeight:S,rows:f,cols:a.length,height:m,rowspan:y,colspan:b},{fixedColsEnd:i.length,fixedColsStart:r.length});let T=Gt.createElement(nm,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:c,columnAndGroupTreeInfo:g}),C=n.vertical&&Yt()?Gt.createElement("div",{className:ld,style:{zIndex:1e3,width:Yt()}}):null;return Gt.createElement("div",{className:`${fs} ${dd}`,style:{height:m}},T,C)}var{ManagedComponentContextProvider:QT}=Nt({initSetupState:mf,forwardProps:gf,Context:ws()});function Gs(o){let{getComputed:e,header:t,brain:n,headerBrain:r,wrapRowsHorizontally:i}=re(l=>({getComputed:l.getComputed,header:l.state.header,brain:l.state.brain,headerBrain:l.state.headerBrain,wrapRowsHorizontally:l.state.wrapRowsHorizontally})),{scrollbars:a}=e();return t?oi.createElement(QT,{...o},oi.createElement(im,{wrapRowsHorizontally:!!i,bodyBrain:n,headerBrain:r,scrollbars:a})):null}function am(){return oi.useContext(ws()).componentState}var JT=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||mo;return De.createElement(s,{domProps:{className:$i},onChange:u=>{if(l){u?r.treeApi.selectAll():r.treeApi.deselectAll();return}u?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:i})},Qi=De.createContext(null);var eC=J(ee.columnZIndexAtIndex),tC=J(ee.columnVisibilityAtIndex),Hs=De.createElement("div",{className:xi[1]}),sm=Mi({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[Rt]:"",[Yr]:""});function oC(o){let e=o.column,{allowColumnHideWhileDragging:t}=am(),{dataSourceStatePartialForHeaderCell:n,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:u}=o,{allRowsSelected:c,someRowsSelected:d,selectionMode:p}=n,{onDragItemPointerDown:f}=gn(),{api:m,getComputed:g,getState:h,actions:y,getDataSourceMasterContext:b,showColumnFilters:S,components:T,portalDOMRef:C,columnHeaderHeight:I,columnReorderDragColumnId:R,columnMenuVisibleForColumnId:w,columnReorderInPageIndex:D}=re(H=>({api:H.api,getComputed:H.getComputed,getState:H.getState,actions:H.actions,getDataSourceMasterContext:H.getDataSourceMasterContext,showColumnFilters:H.state.showColumnFilters,components:H.state.components,portalDOMRef:H.state.portalDOMRef,columnHeaderHeight:H.state.columnHeaderHeight,columnReorderDragColumnId:H.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:H.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:H.state.columnReorderInPageIndex})),v=R===e.id,M=D!=null?r!==D:!1,{onResize:x,height:E,width:P,headerOptions:A,columnsMap:_}=o,N=e.computedSortInfo,F=e.header,O=(0,So.useCallback)(H=>{z.current=H,o.domRef?.(H)},[o.domRef]),K=A.alwaysReserveSpaceForSortIcon,j=e.headerAlign??e.align,k=(typeof j=="function"?j({isHeader:!0,column:e}):j)??"start",Q=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",G=mt(e,{actions:y,api:m,dataSourceActions:l,dataSourceApi:a,getComputed:g,getDataSourceState:i,getDataSourceMasterContext:b,getState:h}),$=G.isSortable(),ie=$&&(e.computedSorted||K)?De.createElement(Ji,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:fe.spacing[2],marginInlineEnd:fe.spacing[2]},className:`${cn}__sort-icon ${sd} ${cd({align:k})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,ue=e.computedFilterable&&e.computedFiltered?De.createElement(zn,null):null,le=e.headerCssEllipsis??e.cssEllipsis??!0,de={reserveSpaceWhenHidden:k==="center",menuVisible:w===e.id,style:k==="end"?{marginInlineStart:`calc(${fe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:fe.spacing[2]}:{marginInlineEnd:`calc(${fe.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:fe.spacing[2]},domProps:{onMouseDown:H=>{H.stopPropagation(),G.toggleContextMenu(H.target)}}},ce=e.components?.MenuIcon||T?.MenuIcon||Wr,U=De.createElement(ce,{...de}),z=(0,So.useRef)(null),q={horizontalLayoutPageIndex:r,dragging:v,domRef:O,htmlElementRef:z,renderLocation:"column-header",column:e,columnsMap:_,columnSortInfo:N,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:c,selectionMode:p,api:m,dataSourceApi:a,columnApi:G,renderBag:{sortIcon:ie,filterIcon:ue,menuIcon:U,menuIconProps:de,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},Y=q,Z=Y.renderBag.header,X=()=>{let H={...q,renderBag:{...q.renderBag}};if(e.renderSortIcon&&(H.renderBag.sortIcon=De.createElement(Go,{render:e.renderSortIcon,renderParam:{...H,renderBag:{...H.renderBag}}})),e.renderFilterIcon&&(H.renderBag.filterIcon=De.createElement(Go,{render:e.renderFilterIcon,renderParam:{...H,renderBag:{...H.renderBag}}})),typeof e.renderMenuIcon=="function"&&(H.renderBag.menuIcon=De.createElement(Go,{render:_e=>{if(typeof e.renderMenuIcon!="function")return null;let Je=e.renderMenuIcon(_e);return Je?Je.type===ce||Je.type===Wr?Je:De.createElement(ce,{...de},Je):null},renderParam:{...H,renderBag:{...H.renderBag}}})),e.renderSelectionCheckBox&&p==="multi-row"){H.renderBag.selectionCheckBox=De.createElement(Go,{render:JT,renderParam:{...H,renderBag:{...H.renderBag}}});let _e=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;_e&&_e!==!0&&(H.renderBag.selectionCheckBox=De.createElement(Go,{render:_e,renderParam:{...H,renderBag:{...H.renderBag}}}))}F instanceof Function&&(H.renderBag.header=Z=De.createElement(Go,{render:F,renderParam:{...H,renderBag:{...H.renderBag}}}));let ke=e.renderMenuIcon===!1?null:H.renderBag.menuIcon,yt=le?De.createElement("div",{className:kt},H.renderBag.header):H.renderBag.header,se=De.createElement(De.Fragment,null,k==="center"?Hs:null,H.renderBag.selectionCheckBox,yt,H.renderBag.sortIcon,H.renderBag.filterIcon,k==="center"?Hs:null,k!=="center"?Hs:null,ke);return e.renderHeader?De.createElement(Go,{render:e.renderHeader,renderParam:{...H,renderBag:{...H.renderBag,all:se}}}):se};(0,So.useEffect)(()=>{let H=null,ke=z.current;return x&&ke&&(H=An(ke,x)),()=>{H?.()}},[z.current,o.onResize]);let me={height:E};e.headerStyle&&(me=typeof e.headerStyle=="function"?{...me,...e.headerStyle(Y)||{}}:{...me,...e.headerStyle});let he=typeof e.headerClassName=="function"?e.headerClassName(Y):e.headerClassName,{onPointerDown:ae,proxyPosition:V,dragColumnOutside:L}=yp({columnId:e.id,domRef:z,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),ge=null,xe=Qi.Provider,Ee={filtered:e.computedFiltered,verticalAlign:Q,align:k},Me=De.useMemo(()=>{let H=ke=>{m.setColumnFilter(e.id,ke)};return u>0?_t(H,{wait:u}):H},[u,e.id]),Ae=e.computedFilterType,Ke=s[Ae],ot=e.computedFilterable?e.computedFilterValue?.filter.operator??Ke?.defaultOperator:void 0,Ze=e.computedFilterable&&Ke?Ke.operators.find(H=>H.name===ot):void 0,it=Ze?.components?.FilterEditor||Ke?.components?.FilterEditor||e.components?.FilterEditor||Kn,Qe=Ke?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,qe=ef(e,{horizontalLayoutPageIndex:r}),B=`var(${eC}-${e.computedVisibleIndex})`;me.zIndex=B,me.visibility=`var(${tC}-${e.computedVisibleIndex}, visible)`;let ne={"data-field":`${e.field||""}`,"data-column-id":e.id,[Rt]:e.id,[Yr]:"header","data-header-align":k,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},ye=e.computedFilterable?De.createElement(Dd,{horizontalLayoutPageIndex:r,filterEditor:it,filterOperatorSwitch:Qe??xd,operator:Ze,filterTypes:s,onChange:Me,columnFilterType:Ae,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:I}):De.createElement(Ed,null);Y.renderBag.filterEditor=ye;let Te=(0,So.useCallback)(H=>{ae(H),f(H)},[ae,f]),lt=X();return v&&V&&(ge=De.createElement("div",{key:e.id,className:`${cn}Proxy ${Zc}`,style:{height:E,width:P,left:V.left??0,top:V.top??0}},De.createElement("div",{className:Qc({visible:L})},De.createElement(ff,{size:16})),Z),ge=(0,lm.createPortal)(ge,C.current)),De.createElement(xe,{value:Y},De.createElement(Xi,{domRef:O,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,cellType:"header",column:e,...ne,"data-z-index":B,style:me,width:P,onPointerDown:Te,contentClassName:oe(Xc(Ee),Pc[k]),contentStyle:S?{height:E/2}:void 0,className:oe(cn,Ac.none,$?wc.pointer:"",he,Vi(e,[cn,go],Jc,{dragging:v,insideDisabledDraggingPage:M,align:k,verticalAlign:Q,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),qc),cssEllipsis:le,afterChildren:De.createElement(De.Fragment,null,S?ye:null,qe),renderChildren:lt}),ge)}var rm=De.memo(oC);function _r(){return(0,So.useContext)(Qi)}var To=W(require("react")),pm=require("react");function um(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 cm={padding:fe.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},nC={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},dm=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(um(t),n,"important")},fm=To.forwardRef(function(e,t){let{rootClassName:n}=Di(),r=To.useRef(null),i=To.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return(0,pm.useEffect)(()=>{let a=()=>{setTimeout(()=>{dm(r.current,cm),dm(r.current?.firstElementChild,nC)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),To.createElement("div",{ref:i,...e,className:oe(`${n}-Footer`,zd,e.className),style:cm},"Powered by"," ",To.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});function Ks(o){return o.map(oo)}function oo(o){if(Pe().structuredClone)return Pe().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Ks(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Ks(Array.from(o)));if(o instanceof Map)return new Map(Ks(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=oo(o[t]));return e}function ni(o){return o}var Tn=Object.seal({data:null,field:null});var Uo="____root____",gm="____not_loaded_yet____";function $o(){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 Ca(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 hm(o,e){let{marker:t,reducers:n={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:u}=o;t&&t.start();let c=new te;function d(y,b,S,T=0,C=[]){let I=!S.length||T===S.length-1,R=b[u?.values||"values"]||{};for(let w in R)if(R.hasOwnProperty(w)){let D=w;C.push(D),p.set(C,!0),y.set(C,{reducerResults:R[w][u?.totals||"totals"]||{},items:[]}),I||d(y,R[w],S,T+1,C),C.pop()}}let p=r?new te:void 0,f=[],m=Bs(n),g=oo(m);e.visitDepthFirst((y,b,S,T)=>{let[C,...I]=b,R=y.children,w=c.get(I);if(w&&(w.cache=y.cache,w.childrenLoading=y.childrenLoading,w.childrenAvailable=y.childrenAvailable,w.error=y.error),I.length==i.length&&i.length){if(w){w.items=R;for(let v=0,M=I.length;v<M;v++){let x=I.slice(0,v),E=c.get(x);E&&(E.items=E.items||[],E.items=E.items.concat(R))}R=a.indexArray(R,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return T?.()}for(let D=0,v=R.length;D<v;D++){if(!R[D]){let P={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};c.set([...I,`${gm}${D}`],P);continue}let M=R[D].data,x=R[D].keys||[];if(x.length){let P=x[x.length-1];I.push(P)}let E={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:M,totalChildrenCount:R[D].totalChildrenCount,reducerResults:R[D].aggregations||{},isTree:!1,isGroupBy:!0};if(c.set(I,E),r){let P=E.pivotDeepMap=new te,A=R[D].pivot;d(P,A,r,0,f)}x.length&&I.pop()}T?.()});let h={deepMap:c,groupParams:o,initialData:e,reducerResults:g};return r&&(h.topLevelPivotColumns=p,h.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(y=>y.field).join(", ")}]}),h}function mm(o,e,t,n,r,i,a,l,s,u=ni){let{items:c,reducerResults:d,pivotDeepMap:p}=o.get(e);if(c.push(n),a&&Ca(n,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:h,toKey:y}=i[f],b=g?n[g]:null;h&&(Tn.data=n,Tn.field=g,b=h(Tn));let S=(y||u)(b,n);t.push(S),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:oo(s),items:[]}));let{reducerResults:T,items:C}=p.get(t);C.push(n),a&&Ca(n,r,a,T,e)}t.length=0}}function ym(o,e,t,n,r,i,a,l){let{isLeafNode:s,getNodeChildren:u,toKey:c}=o,d=c(r),p=[...n,d],f=s(r);if(t.set(p,!0),f){for(let y=0,b=n.length;y<=b;y++){let S=n.slice(0,y),T=e.get(S),{reducerResults:C,items:I}=T;I.push(r),T.leavesAvailableCount++,T.totalLeafNodesCount++,a&&Ca(r,i,a,C,S)}return}let m=oo(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=u(r);if(!(!h||!Array.isArray(h))){for(let y=0,b=h.length;y<b;y++){let S=h[y];ym(o,e,t,p,S,y,a,l)}a&&ri(a,m,g)}}function Ws(o,e){let{reducers:t,marker:n}=o;if(n){let u=Object.keys(t??{});n.start({details:u.length>0?[{name:"Reducers",value:u.join(", ")}]:void 0})}let r=Bs(t),i=oo(r),a=new te,l=new te;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 u=0,c=e.length;u<c;u++)ym(o,a,l,[],e[u],u,t,r);t&&ri(t,i,e);let s={deepMap:a,treeParams:o,treePaths:l,initialData:e,reducerResults:i};return n&&n.end(),s}function Ra(o,e){let{marker:t,groupBy:n,defaultToKey:r=ni,pivot:i,reducers:a}=o;t&&t.start();let l=n.length,s=i?new te:void 0,u=new te,c=[],d=[],p=Bs(a),f=oo(p);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:oo(p)};i&&(g.pivotDeepMap=new te),u.set(c,g)}for(let g=0,h=e.length;g<h;g++){let y=e[g],b={};for(let S=0;S<l;S++){let{field:T,groupField:C,valueGetter:I,toKey:R}=n[S],w=T?y[T]:null;I&&(Tn.data=y,Tn.field=T,w=I(Tn));let D=(R||r)(w,y);if(b[T||C]=D,c.push(D),!u.has(c)){let v={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...b},childrenLoading:!1,childrenAvailable:!1,reducerResults:oo(p)};i&&(v.pivotDeepMap=new te),u.set(c,v)}mm(u,c,d,y,g,i,a,s,p,r)}l||mm(u,c,d,y,g,i,a,s,p,r),a&&Ca(y,g,a,f,c),c.length=0}a&&(u.visitDepthFirst((g,h,y,b)=>{ri(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:S,reducerResults:T},C,I,R)=>{ri(a,T,S),R?.()}),b?.()}),ri(a,f,e));let m={deepMap:u,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 bm(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 rC(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.length,{items:s,reducerResults:u,pivotDeepMap:c,commonData:d}=e,p=d??null,f;if(Object.keys(u).length>0){p={...d},f={};for(let b in i)if(i.hasOwnProperty(b)){let T=i[b].field;T&&(f[T]=u[b]),T&&p[T]==null&&(p[T]=u[b])}}let m=!0,g=n[n.length-1],h=g;if(p!=null){let b=t[n.length-1];b&&b.field&&(h=p[b.field]),b&&b.toKey&&(h=b.toKey(h,p)),h=h??g}return typeof h=="string"&&h.startsWith(gm)&&(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:$o,hasSelectedCells:$o,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:c,groupNesting:l,reducerResults:u}}function Ia(o,e,t){return{...o,id:`duplicate_row_on_page_${t}_for__${o.id}`,indexInAll:e,duplicateOf:o.id}}function ri(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 Sm(o,e,t,n,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:u,treeResult:c,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:h,rowsPerPage:y}=r,{deepMap:b}=c,S=o.length,T=t[t.length-1],C=T?T.nodeExpanded:!0;for(let I=0;I<S;I++){let R=o[I],w=u(R,I),D=[...e,w];if(l(R)){let _={id:w,nodePath:D,isGroupRow:!1,data:R,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:$o,hasSelectedCells:$o,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...n,I],indexInParent:I,indexInAll:C?i.length:-1};p&&(_.rowSelected=p(_)),d&&(_.rowDisabled=d(_)),f&&f(_);let N=h&&y!=null&&y>0&&_.indexInAll%y===0?_.indexInAll/y:null;for(let F=0,O=t.length;F<O;F++){let K=t[F];if(C||(K.collapsedLeafNodesCount+=1),K.deepRowInfoArray.push(_),N!=null&&C){if(typeof h=="function"&&h(K)!==!0)continue;let j=Ia(K,_.indexInAll,N);i[j.indexInAll]=j,_.indexInAll++}}C&&(i[_.indexInAll]=_);continue}let x=b.get(D)?.totalLeafNodesCount??0,E={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:D,id:w,data:R,indexInAll:i.length,indexInParent:I,indexInParentNodes:[...n,I],totalLeafNodesCount:x,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:$o,hasSelectedCells:$o,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(E.rowSelected=p(E),g)){let _=g.getSelectionCountFor(E.nodePath);E.selectedLeafNodesCount=_.selectedCount,E.deselectedLeafNodesCount=_.deselectedCount}d&&(E.rowDisabled=d(E)),f&&f(E);let P=!0;if(m&&(E.selfExpanded=P=m(E)),C||(P=!1),E.nodeExpanded=P,C&&h&&y!=null&&y>0){let _=E.indexInAll,N=E.parentNodes;if(N.length>0&&_%y===0){let F=_/y,O=0;N.forEach(K=>{typeof h=="function"&&h(K)!==!0||(i.push(Ia(K,_+O,F)),O++,E.indexInAll++)})}}C&&(i[E.indexInAll]=E);let A=s(R);Array.isArray(A)&&Sm(A,D,[...t,E],E.indexInParentNodes,r,i)}return i}function Tm(o){let{dataArray:e,marker:t}=o;t&&t.start();let n=[];return Sm(e,[],[],[],o,n),t&&t.end(),{data:n}}function Cm(o){let{marker:e,lazyLoad:t,groupResult:n,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:u,isRowSelected:c,rowSelectionState:d,generateGroupRows:p,reducers:f={}}=o,{groupParams:m,deepMap:g,pivot:h}=n,{groupBy:y}=m;e&&e.start({details:[{name:"Group by fields",value:y.map(I=>I.field).join(", ")}]});let b=[],S=[],T=[],C=[];return g.visitDepthFirst((I,R,w,D)=>{let v=I.items,M=R.length,x=s?.isGroupRowCollapsed(R)??!1;C.push(w);let E=rC({lazyLoad:t,groupBy:y,parents:Array.from(T),reducers:f,indexInGroup:w,indexInParentGroups:Array.from(C),indexInAll:b.length,groupKeys:R,error:I.error,totalChildrenCount:I.totalChildrenCount,childrenLoading:(I.childrenLoading||!x&&!I.childrenAvailable)&&t,childrenAvailable:I.childrenAvailable,directChildrenCount:R.length===y.length?I.items.length:g.getDirectChildrenSizeFor(R),directChildrenLoadedCount:0},I);if(c&&(E.rowSelected=c(E),d)){let F=d.getSelectionCountFor(E.groupKeys);E.selectedChildredCount=F.selectedCount,E.deselectedChildredCount=F.deselectedCount}u&&(E.rowDisabled=u(E));let P=T[T.length-1],A=P?.collapsed??!1;A&&(x=!0),E.collapsed=x;let _=p||x;if(A&&(_=!1),_){if(i&&r!=null&&r>0){let F=E.indexInAll,O=E.parents;if(O.length>0&&F%r===0){let K=F/r,j=0;O.forEach(k=>{typeof i=="function"&&i(k)!==!0||(b.push(Ia(k,F+j,K)),j++,E.indexInAll++)})}}b.push(E),S.push(b.length-1)}E.collapsedChildrenCount=0,T.forEach(F=>{F.deepRowInfoArray.push(E),F.collapsedGroupsCount+=x?1:0}),P&&E.selfLoaded&&t&&(P.directChildrenLoadedCount+=1),a&&a(E),T.push(E);let N=!0;if(N){if(D)D();else if(!h){let F=b.length;x||(b.length+=v.length);let O=0;for(let K=0,j=v.length;K<j;K++){let k=v[K];if(!x&&i&&r!=null&&r>0){let ie=F+K+O;if(ie%r===0){let pe=ie/r;T.forEach(ue=>{if(typeof i=="function"&&i(ue)!==!0)return;let le=F+K+O;b[le]=Ia(ue,le,pe),O++,b.length++})}}let Q=F+K+O,$={id:k?l(k,Q):`${R}-${K}`,data:k,isCellSelected:$o,hasSelectedCells:$o,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!k,rowSelected:!1,rowDisabled:!1,rootGroupBy:y,collapsed:x,groupKeys:R,parents:Array.from(T),indexInParentGroups:[...C,K],indexInGroup:K,indexInAll:Q,groupBy:y,groupNesting:M+1,groupCount:E.groupCount};c&&($.rowSelected=c($)),u&&($.rowDisabled=u($)),a&&a($),T.forEach((ie,pe)=>{pe===T.length-1&&k&&(ie.directChildrenLoadedCount+=1),x&&(ie.collapsedChildrenCount+=1),ie.deepRowInfoArray.push($)}),x||(b[F+K+O]=$)}}}T.pop(),C.pop()}),e&&e.end(),{data:b,groupRowsIndexes:S}}var wa=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 te(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 te(t.map(r=>[r,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var wt=class extends wa{constructor(e){super(e)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(e){return this.isItemPositive(e)}isGroupRowCollapsed(e){return!this.isGroupRowExpanded(e)}setGroupRowExpanded(e,t){return this.setItemValue(e,t)}collapseGroupRow(e){this.setGroupRowExpanded(e,!1)}expandGroupRow(e){this.setGroupRowExpanded(e,!0)}toggleGroupRow(e){this.toggleItem(e)}};function Ht(){let o=Pe().performance?.now();return`${Date.now()}:${o}`}function js(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function $s(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 Us(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 Im({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={},u={},c=pt(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=$s({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")&&c();let d=!i&&l.length===1;return o.visitDepthFirst((f,m,g,h)=>{if(m=[...m],t==="end"&&h?.(),m.length===a){let y=e[m.length-1],S=m.slice(0,-1).join("/");if(!d){let T=S;S=m.join("/");let C=m[m.length-1];u[S]=Us({header:`${C}`,columnGroup:T,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:y,pivotIndex:m.length-1,pivotGroupKey:C})}l.forEach((T,C)=>{let I=d?`${m[m.length-1]}`:T.name||T.id,R=$s({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:T,pivotAggregatorIndex:C,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:y,columnGroup:S,header:I,valueFormatter:({rowInfo:D})=>D.isGroupRow?D.pivotValuesMap?.get(m)?.reducerResults[T.id]:null}),w=`${T.id}:${m.join("/")}`;s[w]=R})}else{let y=m.join("/"),b=m.slice(0,-1);if(u[y]=Us({columnGroup:b.length?b.join("/"):void 0,header:`${m[m.length-1]}`,pivotBy:e,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:e[m.length-1],pivotGroupKey:m[m.length-1]}),t!==!1){let S=e[m.length-1],T=b.length?b.join("/"):void 0;if(!d){let C=T;T=`total:${m.join("/")}`,u[T]=Us({header:`${m[m.length-1]} total`,columnGroup:C,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:S,pivotGroupKey:m[m.length-1]})}l.forEach((C,I)=>{let R=d?`${m[m.length-1]} total `:`${C.name||C.id} total`,w=$s({columnGroup:T,header:R,pivotAggregator:C,pivotAggregatorIndex:I,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,valueFormatter:({rowInfo:D})=>D.isGroupRow?D.pivotValuesMap?.get(m)?.reducerResults[C.id]:null});s[`total:${C.id}:${m.join("/")}`]=w})}}(t==="start"||t===!1)&&h?.()}),(!a&&t==="end"||n==="end")&&c(),{columns:s,columnGroups:u}}var iC=()=>{};function Rm(o,e){let t=new te,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 u=0;u<s.length;u++){let c=s.slice(0,u);t.has(c)||t.set(c,void 0)}t.set(s,l)}function a(l,s){let u=t.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let c of u){let d=[...l,c[c.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 wm(o,e,t,n){let{isLeafNode:r,getNodeChildren:i,toKey:a}=o,{onParentNode:l,onNode:s,onLeafNode:u}=e,c=a(n),d=[...t,c],p=r(n),f=pt(()=>{let m=i(n);if(!(!m||!Array.isArray(m)))for(let g=0,h=m.length;g<h;g++){let y=m[g];wm(o,e,d,y)}});p?(u?.(n),s?.(n,iC)):(l?.(n,f,i(n)),s?.(n,f))}function vm(o,e,t){for(let n=0,r=t.length;n<r;n++)wm(o,e,[],t[n])}var aC=function(o,e){return o-e},lC=function(o,e){return o=`${o}`,e=`${e}`,o.localeCompare(e)},sC=function(o,e){return o-e},uC={number:aC,string:lC,date:sC},Yo=uC;function Pm(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 no=(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(Dm(Pm(o),n)),r&&r.end(),e},va=(o,e,t)=>{let{marker:n}=t;n&&n.start();let r=Dm(Pm(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,u=d=>d[l],c=d=>d[l]===void 0;return vm({isLeafNode:t.isLeafNode??c,getNodeChildren:t.getNodeChildren??u,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};no.knownTypes=Yo;var cC=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=no.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(no.knownTypes).join(", ")}`)}return r||(r=Yo.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,u=r(l,s);return u===0?u:n*u}},dC=o=>o.map(cC).filter(e=>e instanceof Function),Dm=(o,e)=>{let t=dC(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}};function rr(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||ni)(l,o);return t.push(s),t},[])}var Ne=class o{constructor(e,t,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new te;this.deselectedMap=new te;this.onlyUsePrimaryKeys=!1;this.selectionCache=new te;this.selectionCountCache=new te;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?rr(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 u=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,u),u}if(r&&this.onlyUsePrimaryKeys){let u=this.getAllPrimaryKeysInsideGroup(e),c=0,d=0;u.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}c++}else{if(this.selectedMap.has([f])){c++;return}d++}});let p={selectedCount:c,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 u=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,c=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,f=c-(d+p),m={selectedCount:d+(u?f:0),deselectedCount:p+(u?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let u=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=u,l=this.deselectedMap.getAllChildrenSizeFor(e),l===u&&(a=0)):(l=u,a=this.selectedMap.getAllChildrenSizeFor(e),a===u&&(l=0))}i.forEach(u=>{let c=this.selectedMap.get(u),d=this.deselectedMap.get(u),p=c?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(u,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};function Pa(o,e){return new Ne(o,gt(e))}function gt(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 xm(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 Ne))throw"Invalid row selection";let a=new Ne(r,gt(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 Ne))throw"Invalid row selection";let a=new Ne(r,gt(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=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 Ne))throw"Invalid row selection";if(!i){let c=s.getDataForPrimaryKey(r);i=c?rr(c,u):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:u}=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 Ne))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?rr(d,u):[]}let c=new Ne(a,gt(e));c.selectRow(r,i),t.rowSelection=c},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:u}=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 Ne))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?rr(d,u):[]}let c=new Ne(l,gt(e));c.deselectRow(r,i),t.rowSelection=c}},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 Ne))throw"Invalid row selection";let s=new Ne(a,gt(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 Ne))throw"Invalid row selection";let s=new Ne(a,gt(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 Ne))throw"Invalid row selection";let s=new Ne(a,gt(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,u=i?new Ne(i,gt(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(u instanceof Ne))throw"Invalid row selection";return u.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Ne(r,gt(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 u=i.toPrimaryKey(s);a.isRowSelected(u)&&l.push(u)}),l}}}var pC="*",$e=class{constructor(e){this.wildcard=pC;this.cache=new te;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 u=this.deselectedColumnsToRows.get(t),c=this.selectedColumnsToRows.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),c?.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 u=this.deselectedRowsToColumns.get(t),c=this.selectedRowsToColumns.get(t);u?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),c?.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(u=>{this.cache.delete(u)}),this.cache.delete(s),n)if(this.defaultSelection){let u=this.deselectedRowsToColumns.get(e);u&&u.has(t)&&this.setCellInDeselection(e,t,!1);let c=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(c?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let u=this.deselectedRowsToColumns.get(e);u&&u.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 c=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(c?.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){Mo(`${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),u=this.deselectedRowsToColumns.get(this.wildcard),c=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)||u?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():c?.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 Em=Symbol("CLEAR"),Cn=class o{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new te;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=Em,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(Em);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=()=>te.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:te.clone(e.nodePathToData),n}};function qo(o,e){return e().dataArray[o]}function Da(o){return o().dataArray}var ut=class{constructor(e){this.collapsedPathsMap=new te;this.expandedPathsMap=new te;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 fC=(o,e)=>o.length-e.length,rt=class o{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new te;this.cache=new te;this.strictMode=!1;let n=e instanceof Object.getPrototypeOf(this).constructor,r=n?e.getState():e;this.setConfig(t||(n?e.config:{treePaths:new te})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?Array.isArray(e)?new te(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 te(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(fC);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,u=0,c=this.getNodeBooleanSelectionStateFromParent(e);c?s+=r:u+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(f);if(c?(s-=g,u+=g):(u-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:u})}if(!s&&!u)return this.cacheIt(e,{selected:c,selectedCount:c?r:0,deselectedCount:c?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:u,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 Ea(o,e){return new rt(o,ir(e))}function ir(o){return()=>({treePaths:(typeof o=="function"?o():o).treePaths})}var xa=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 rt))throw"Invalid tree selection";let a=new rt(r,ir(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 ut({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new ut({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 ut(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 ut(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 ut(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?qo(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 rt))throw"Invalid node selection";let n=new rt(e,ir(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 rt))throw"Invalid node selection";let n=new rt(e,ir(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 rt))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 ar=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 vt=class extends ar{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 Ys=1e3;function Mm(o){return new qs(o)}var qs=class{constructor(e){this.pendingOperations=[];this.batchOperationRafId=0;this.batchOperationTimeoutId=0;this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=e=>this.getState().toPrimaryKey(e);this.getRowInfoArray=()=>Da(this.getState);this.getRowInfoByIndex=e=>qo(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?Ys:r;return isNaN(a)||(a=Ys),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,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 u=c=>t.position==="start"?[...e,...c||[]]:[...c||[],...e];return this.updateChildrenByNodePath(u,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 vt(n):new vt({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 vt({enabledRows:!0,disabledRows:[]});return}let t=new vt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new vt({disabledRows:!0,enabledRows:[]});return}let t=new vt(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 xa({...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?Cn.clone(t,{light:!0}):new Cn({nodesKey:n?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((c,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],c,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof c=="function"?i.updateChildren(a.nodePaths[d],c,p,a.metadata):i.updateNodePath(a.nodePaths[d],c,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(c=>{let d=this.getDataByPrimaryKey(c);d&&i.delete(c,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(c=>{let d=this.getDataByNodePath(c);d&&i.deleteNodePath(c,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,u=a.nodePath;u?a.array.forEach(c=>{i.insertNodePath([...u],c,s,a.metadata),l=this.toPrimaryKey(c),u.pop(),u.push(l),s="after"}):a.array.forEach(c=>{i.insert(l,c,s,a.metadata),l=this.toPrimaryKey(c),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??Ys,i=n.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(u=>{let c,d;l=p=>{clearTimeout(d),c=p,n.waitForNodePathPromises.delete(e),u(p)},d=setTimeout(()=>{c===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 Am(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:u,filterValue:c,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,y)=>h||typeof y!="function"?l.has(y):!1,!1),t))break}if(u&&u.length){if(l===!0)n=!0;else for(let m of u)if(m.field&&l.has(m.field)){n=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),c&&c.length)if(l===!0)i=!0;else for(let m of c){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 Ma(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 Aa(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 _a(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 mC=Ue("IT:InfiniteTable"),gC="#dc3545",hC="#eb9316";var Om="Warn",Nm="Error",yC="Info",bC="Success",SC="Logs",Oa=mC.extend(SC),jL=Oa.extend(yC),TC=Oa.extend(Om),CC=Oa.extend(Nm),$L=Oa.extend(bC);var IC=hC,RC=gC;var wC=(o,e)=>{e=e?e.extend?e.extend(Om):e:TC,e(typeof e.color=="function"?e.color(IC,o):o)},vC=(o,e)=>{e=e?e.extend?e.extend(Nm):e:CC,e(typeof e.color=="function"?e.color(RC,o):o)};var _m=new te,Fm=(o,...e)=>{_m.has(e)||(_m.set(e,!0),o())};var lr=(o,e=o,t)=>{Fm(()=>wC(o,t),e,"warn")},Lm=(o,e=o,t)=>{Fm(()=>vC(o,t),e,"error")};var Xs=new WeakMap,PC=o=>o;function km(o,e=50,t){Xs.set(o,{lastCallTime:0,lastCallArg:null});let n=t??PC;return r=>{let{lastCallTime:i,lastCallArg:a}=Xs.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,u=St(n(a),n(r));s<e&&u||(Xs.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var Na=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new te;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 u=n&&!n.isEmpty();if(u&&(e=e.concat()),!e.length&&n){if(!n.isEmpty()){let c=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let d=0,p=c.length;d<p;d++){let f=c[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 c=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];u&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let g=!1;if(m!=null){let h=r(m),y=s?[...p,h]:void 0,b=s&&!!y,S=b?n?.getMutationsForNodePath(y):n?.getMutationsForPrimaryKey(h);if(S&&S.length){for(let T=0,C=S.length;T<C;T++){let I=S[T];if(I.type==="delete"&&!g&&(b?this.removeNodePath(y,t):this.remove(h),g=!0,d.splice(f,1),f--),I.type==="update"&&!g&&(m={...m,...I.data},d[f]=m),I.type==="update-children"&&!g){let R=I.children(m[l],m);m={...m},R!==void 0?m[l]=R:delete m[l],d[f]=m}I.type==="insert"&&(I.position==="before"?(d.splice(f,0,I.data),f--):d.splice(f+1,0,I.data))}b?n?.removeNodePathInfo(y):n?.removeInfo(h)}if(!g)if(b){this.addNodePath(y,m);let T=a(m),C=T?null:i(m);!T&&Array.isArray(C)&&(p.push(h),u&&(m[l]=C=C.concat()),c(C,p),p.pop())}else this.add(h,m)}}};c(e,[])}return e}}};var DC=Object.freeze([]),zm=(o,e)=>{let t=o??DC,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};function Fa(o,e){if(o===e)return!0;if(o==null||e==null)return o===e;if(typeof o!=typeof e)return!1;if(Array.isArray(o)&&Array.isArray(e)){if(o.length!==e.length)return!1;for(let t=0,n=o.length;t<n;t++)if(!Fa(o[t],e[t]))return!1;return!0}if(typeof o=="object"){let t=Object.keys(o),n=Object.keys(e);if(t.length!==n.length)return!1;for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!Fa(o[r],e[r]))return!1;return!0}return!1}function xC(o,e){return!(o===void 0||e===void 0||o.isGroupRow!==e.isGroupRow||o.dataSourceHasGrouping!==e.dataSourceHasGrouping||o.isTreeNode!==e.isTreeNode||o.isTreeNode&&o.isParentNode!==e.isParentNode)}var La={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},Vm={...La,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},EC={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},MC={...La,...EC,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,reducerData:!0,isGroupRow:!0,duplicateOf:!1,deepRowInfoArray:!1,error:!0,reducerResults:!0,groupCount:!0,groupData:!0,selectedChildredCount:!0,deselectedChildredCount:!0,totalChildrenCount:!0,collapsedChildrenCount:!0,collapsedGroupsCount:!0,directChildrenCount:!0,directChildrenLoadedCount:!0,pivotValuesMap:!0,childrenAvailable:!0,childrenLoading:!0},Gm={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},AC={...La,...Gm,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},_C={...La,...Gm,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},OC=Object.entries(Vm).map(([o,e])=>e?o:void 0).filter(Boolean),NC=Object.entries(Vm).map(([o,e])=>e?o:void 0),FC=Object.entries(MC).map(([o,e])=>e?o:void 0),LC=Object.entries(AC).map(([o,e])=>e?o:void 0),kC=Object.entries(_C).map(([o,e])=>e?o:void 0);function zC(o,e){if(o===e)return!0;if(!o||!e||!xC(o,e)||o.id!==e.id||o.data!==e.data&&!Fa(o.data,e.data))return!1;let t=[];o.dataSourceHasGrouping?t=o.isGroupRow?FC:NC:o.isTreeNode?t=o.isTreeNode&&o.isParentNode?kC:LC:t=OC;for(let n of t){let r=o[n],i=e[n];if(!(typeof r=="function"||typeof i=="function")&&!Fa(r,i))return!1}return!0}function Hm(){let o=[],e=new Map,t=new Set,n={dataSourceState:void 0,previousDataSourceState:void 0},r=(p,f)=>{let m=o,g=f?.marker,y=p!==m&&t.size>0;y&&(n={dataSourceState:f?.dataSourceState,previousDataSourceState:f?.previousDataSourceState}),g&&g.start({details:[{name:"new dataArray length",value:p.length},{name:"old dataArray length",value:m.length}]});let b=[],S=l();for(let T of S){let C=m[T],I=p[T];if(I===void 0){b.push(T);continue}zC(C,I)||b.push(T)}o=p,(b.length>0||y)&&queueMicrotask(()=>{for(let T=0,C=b.length;T<C;T++){let I=b[T],R=e.get(I);if(R)for(let w of R)w()}if(y)for(let T of Array.from(t))T()}),g&&g.end({details:[{name:"updated row infos",value:b.length}]})},i=p=>o[p],a=(p,f)=>{let m=e.get(p);return m||(m=new Set,e.set(p,m)),m.add(f),()=>{let g=e.get(p);g&&(g.delete(f),g.size===0&&e.delete(p))}},l=()=>Array.from(e.keys());return{notifyDataArray:r,getRowInfoAtIndex:i,subscribeToRowIndex:a,subscribeToDataArrayChange:p=>(t.add(p),()=>{t.delete(p),t.size===0&&(n={dataSourceState:void 0,previousDataSourceState:void 0})}),getDataSourceStates:()=>n,getDataArray:()=>o,clear:()=>{o=[],e.clear(),t.clear(),n={dataSourceState:void 0,previousDataSourceState:void 0}}}}var Co=new Map,Io=new Map,Xo=new Map,Ro=new Map,ro=new Map;var VC=Symbol("cursorId"),Km=o=>o.totalLeafNodesCount===0,GC=o=>o.isParentNode?!Km(o):!0;function Bm(o){let e=Date.now(),t=[],n=[],r=new te;return{logger:Ot(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:Hm(),indexer:new Na,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 te,waitForNodePathPromises:new te,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new te,dataParams:void 0,onCleanup:Se(),notifyScrollbarsChange:Se(),notifyScrollStop:Se(),notifyRenderRangeChange:Se(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:VC,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 HC(o){let e={...o};return delete e.originalDataArray,e}var KC=[],Wm=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(),o.rowInfoStore.clear()},jm=(o,e)=>({onDataParamsChange:t=>t?km(t,100,HC):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??Km,isNodeSelectable:t=>t??GC,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=>({...ko,...t}),sortTypes:t=>({...Yo,...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 vt)return t;let n=o.propsCache.get("rowDisabledState")??Kt,r=n.get(t);return r||(r=new vt(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=>zm(t,o.propsCache.get("sortInfo")),groupBy:t=>t??KC});function BC(o,e){return typeof o=="function"?o({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):o}var Kt=new WeakMap;function WC(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 jC={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function $m(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.
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
`);let n=ir(t);if(o instanceof
|
|
4
|
+
`);let n=ir(t);if(o instanceof rt)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let r=o??jC,i=Kt.get(r);return i&&i.setConfig(n),i=i??new rt(r,n),Kt.set(r,i),i}function Um(o){let{props:e,state:t,oldState:n}=o,r=!!t.nodesKey,i=xr(e.sortInfo),a=xr(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((P,A)=>{let _=l[A].operators;P[A]=P[A]||{};let N=P[A];return _.forEach(F=>{N[F.name]=F}),P},{}),u=e,c=e.selectionMode;if(c===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)c="multi-cell";else{let P=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(P!==void 0&&(P&&typeof P=="object"?c="multi-row":c="single-row"),!c){let A=u.treeSelection??u.defaultTreeSelection;A!==void 0&&(c=typeof A=="object"?"multi-row":"single-row")}c=c??!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&&(c!==!1&&(c==="single-row"||c==="multi-row")&&(f===null?d=c==="single-row"?null:new Ne({selectedRows:[],deselectedRows:[],defaultSelection:!1},gt(t)):c==="single-row"||f instanceof Ne?d=f:d=new Ne(f,gt(t))),c==="single-cell"||c==="multi-cell"))if(m===null)p=c==="single-cell"?null:new $e;else if(m instanceof $e)p=m;else{let P=Kt.get(m)??new $e(m);Kt.set(m,P),p=P}let g=t.primaryKey,h=typeof g=="function"?P=>g(P):P=>P[g],y=u.treeExpandState||t.treeExpandState||u.defaultTreeExpandState;if(y&&!(y instanceof ut)){let P=Kt.get(y)??new ut(y);Kt.set(y,P),y=P}y=y||new ut({defaultExpanded:!0,collapsedPaths:[]});let b=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(b&&!(b instanceof wt)){let P=Kt.get(b)??new wt(b);Kt.set(b,P),b=P}b=b||new wt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=WC(e.shouldReloadData||{}),T=e.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),C=e.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,I=e.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;e.groupMode&&lr('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",t.logger),e.sortMode&&lr('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",t.logger),e.filterMode&&lr('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",t.logger);let R=typeof e.data=="function"?T??"local":"local",w=e.sortFunction?"local":C??(i?"remote":"local"),D=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":I??(typeof e.data=="function"?"remote":"local"),v=S.pivotBy?"remote":"local",M=t.rowDisabledState,x=e.isRowDisabled;if(!x&&M){let P=Kt.get(M);P?x=P:(x=A=>M.isRowDisabled(A.id),Kt.set(M,x))}let E={debugId:t.debugId??e.debugId,isTree:r,selectionMode:c,groupRowsState:b,treeExpandState:y,treeExpandMode:y.mode,shouldReloadData:{filterValue:S?.filterValue??D==="remote",sortInfo:S?.sortInfo??w==="remote",groupBy:S?.groupBy??R==="remote",pivotBy:S?.pivotBy??v==="remote"},isRowDisabled:x,rowSelection:d,cellSelection:p,groupMode:R,sortMode:w,filterMode:D,pivotMode:v,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,A=typeof e.livePaginationCursor=="function"?P?BC(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;E.livePaginationCursor=A}if(t.devToolsDetected&&t.debugId){let P=Io.get(t.debugId);P&&(E={...E,...P})}return E}var $C=Ot("DataSource:fullLazyLoad");function Ym(o,e,t){let{name:n,newValue:r}=o;n==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&$C('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new wt({collapsedRows:!0,expandedRows:[]})))}function qm(){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 $e?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function Xm(){return{sortInfo:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{sortInfo:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},groupBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{groupBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},pivotBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{pivotBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},filterValue:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{filterValue:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&He(()=>{e.livePaginationCursor=null})},cursorId:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{__cursorId:o},n());e.dataParams=r},livePaginationCursor:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Bt(t,{livePaginationCursor:o},n());e.dataParams=r},dataParams:(o,{state:e})=>St(o,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Ot(Wo(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function Zm(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}var UC="group-by",Qm="group-by-";function Jm(o){let e=o.map(t=>t.valueGetter?n=>t.valueGetter({data:n,field:t.field}):t.field??t.groupField).filter(Boolean);if(e.length)return e.length===1&&typeof e[0]!="function"?e[0]:e}function ka(o,e){if(!o?.length||!e?.length)return o;let t=!1,n=o.map(r=>{if(r.field!=null||!r.id)return r;if(r.id===UC){let i=Jm(e);return i==null?r:(t=!0,{...r,field:i})}if(r.id.startsWith(Qm)){let i=r.id.slice(Qm.length),a=e.find(s=>String(s.field)===i||s.groupField===i);if(!a)return r;let l=Jm([a]);return l==null?r:(t=!0,{...r,field:l})}return r});return t?n:o}function eg(o){return"groupNesting"in o?o.groupNesting??0:0}function tg(o,e){if(!(!o.isGroupRow||!e.reducerId))return e.pivotTotalColumn&&(!e.pivotGroupKeys||e.pivotGroupKeys.length===0)?o.reducerResults?.[e.reducerId]:o.pivotValuesMap?.get(e.pivotGroupKeys)?.reducerResults?.[e.reducerId]}function YC(o,e,t,n){if(o==null&&e==null)return 0;if(o==null)return 1;if(e==null)return-1;let r=Array.isArray(t.type)?t.type[0]:t.type,a=(t.fn||r&&n[r]||n.string||Yo.string)(o,e);return a===0?0:t.dir*a}function qC(o,e){if(!o?.length||!e)return[];let t=[];for(let n of o){let r=n.id?e[n.id]:void 0;!r?.pivotColumn||!r.pivotAggregator||t.push({dir:n.dir,type:n.type,fn:n.fn,pivotGroupKeys:r.pivotGroupKeys??[],reducerId:r.pivotAggregator.id,pivotTotalColumn:!!r.pivotTotalColumn})}return t}function XC(o){let e=[],t=[];for(let n of o){let r={row:n,children:[]},i=eg(n);for(;t.length&&eg(t[t.length-1].row)>=i;)t.pop();t.length?t[t.length-1].children.push(r):e.push(r),t.push(r)}return e}function ZC(o){let e=[],t=(n,r)=>{n.forEach((i,a)=>{let l=[...r,a],s=i.row;s.indexInGroup=a,s.indexInParentGroups=l,s.indexInAll=e.length,e.push(s),t(i.children,l)})};return t(o,[]),e}function og(o,e,t,n){let r=qC(e,t);if(!r.length||!o.length)return o;let i={...Yo,...n},a=XC(o),l=(u,c)=>{for(let d of r){let p=YC(tg(u.row,d),tg(c.row,d),d,i);if(p!==0)return p}return 0},s=u=>{u.sort(l);for(let c of u)s(c.children)};return s(a),ZC(a)}function Qs(o,e){return o&&o.filter(t=>{let n=e[t.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(t.filter.value))})}var io=(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 Zs(){return!1}function QC(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:Zs,hasSelectedCells:Zs};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 JC=pt(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
5
5
|
|
|
6
6
|
Your filtering function probably looks like this:
|
|
7
7
|
|
|
@@ -13,18 +13,18 @@ function treeFilterFunction({ data }) {
|
|
|
13
13
|
|
|
14
14
|
Make sure you avoid mutations.
|
|
15
15
|
|
|
16
|
-
`)});function Jm(o){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:n,getNodeChildren:r,isLeafNode:i,nodesKey:a}=o,l=[],s=u=>{let c=r(u);if(i(u)||!Array.isArray(c))return u;let d=Jm({...o,dataArray:c});return d.length===0?!1:(u={...u,[a]:d},u)};for(let u=0,c=e.length;u<c;u++){let d=e[u],p=r(d),f=t({data:d,index:u,dataArray:e,primaryKey:n(d,u),filterTreeNode:s});f&&(f===!0?f=d:typeof f=="object"&&f===d&&p!==r(f)&&UC(),l.push(f))}return l}function Zs(o){let{filterTypes:e,marker:t,operatorsByFilterType:n,filterFunction:r,toPrimaryKey:i,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:u}=o,{dataArray:c}=o;t?.start({details:[{name:"Count before",value:c.length}]}),r&&(c=c.filter((p,f,m)=>r({data:p,index:f,dataArray:m,primaryKey:i(p,f)}))),a&&(c=Jm({...o,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:u}));let d=Xs(o.filterValue,e)||[];if(d&&d.length){let p=c.filter((f,m,g)=>{let y={data:f,index:m,dataArray:g,primaryKey:i(f,m),field:void 0};for(let h=0,b=d.length;h<b;h++){let T=d[h],{disabled:S,field:C,valueGetter:I,filter:{type:R,value:v,operator:P}}=T,w=e[R];if(S||!w)continue;let x=n[R]?.[P];if(!x)continue;let E=I||w.valueGetter||(({data:M,field:_})=>_?M[_]:M);y.field=C;let D=y;if(D.filterValue=v,D.currentValue=E(D),D.emptyValues=w.emptyValues,!x.fn(D))return!1}return!0});return t?.end({details:[{name:"Count after",value:p.length}]}),p}return t?.end({details:[{name:"Count after",value:c.length}]}),c}function eg(o){let e,{state:t,previousState:n}=o,r=t.debugId,i;r&&(i=it(r).track.DataSource.label.PrepareData.start());let a=Dm(t),l=La(t.sortInfo,t.groupBy),s=t.sortMode,u=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(u=!1);let c=ro(n,t,["refetchKey"]),d=ro(n,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&c&&(d=!0),!1&&(t.originalLazyGroupData=new te,d=!0);let f=t.cache?Cn.clone(t.cache):void 0;f&&!f.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,y=t.isTree,h=g?V=>V[g]:void 0,b=g?V=>V[g]===void 0:void 0,T,S;d&&(t.indexer.clear(),t.lazyLoad||(T=f?.getMutations(),S=f?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:f,getNodeChildren:h,isLeafNode:b,nodesKey:g}),y&&t.waitForNodePathPromises.visit(({value:V},F)=>{V&&t.indexer.getDataForNodePath(F)!==void 0&&V.resolve(!0)}))),f&&(f.clear(),t.cache=void 0);let{filterFunction:I,treeFilterFunction:R,filterValue:v,filterTypes:P,operatorsByFilterType:w}=t,x=!!I||!!R||Array.isArray(v)&&v.length,A=x&&t.filterMode==="local",E=ro(n,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),D=d||E,M=ro(n,t,["sortInfo"]),_=d||E||M,N=t.filterMode==="local"&&(D||!t.lastFilterDataArray),L=u&&(_||!t.lastSortDataArray||a.sortInfo),O=t.groupBy,K=t.pivotBy,j=!y&&(O.length>0||!!K),k=y,Q=ro(n,t,["rowDisabledState","isRowDisabled"]),G=ro(n,t,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),$=ro(n,t,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),ie=d||_||ro(n,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),pe=d||_||ro(n,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),ue=ro(n,t,["rowInfoReducers"]),le=j&&(ie||!t.lastGroupDataArray||a.groupBy)||G||Q||ue,de=k&&(pe||a.tree||!t.lastTreeDataArray)||$||Q||ue,ce=Date.now(),U=t.originalDataArray;if(k&&de){let V={marker:r?it(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:b,getNodeChildren:h,toKey:m};t.unfilteredTreePaths=Ks(V,U).treePaths}if(x||(t.unfilteredCount=U.length),A){t.unfilteredCount=U.length;let V=ce;N?(t.devToolsDetected&&(V=Date.now()),U=Zs({marker:r?it(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:h,isLeafNode:b,nodesKey:g,treeFilterFunction:R,dataArray:U,toPrimaryKey:m,filterTypes:P,operatorsByFilterType:w,filterFunction:I,filterValue:v}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-V)):U=t.lastFilterDataArray,t.lastFilterDataArray=U,t.filteredAt=ce}if(t.filteredCount=U.length,t.postFilterDataArray=U,u){let V=oo.knownTypes;if(oo.knownTypes={...V,...t.sortTypes},L){let F=ce;if(t.devToolsDetected&&(F=Date.now()),r&&(e=it(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:U.length}]})),t.sortFunction?(U=t.sortFunction(l,[...U]),e&&(e.end(),e=void 0)):y?U=wa(l,U,{marker:e,inplace:!1,isLeafNode:b,getNodeChildren:h,toKey:m,nodesKey:g}):U=oo(l,[...U],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let ge=Date.now()-F;t.debugTimings.set("sort",ge)}}else U=t.lastSortDataArray;oo.knownTypes=V,t.lastSortDataArray=U,t.sortedAt=ce}t.postSortDataArray=U;let z=t.dataArray,q=t.rowSelection instanceof Oe?t.rowSelection:void 0,Y=t.treeExpandState instanceof st?t.treeExpandState:void 0,Z=t.cellSelection instanceof je?t.cellSelection:void 0;q?.xcache();let X=t.selectionMode==="single-row"?V=>V.id===t.rowSelection:t.selectionMode==="multi-row"?V=>{let F=q;return V.isGroupRow?F.getGroupRowSelectionState(V.groupKeys):F.isRowSelected(V.id,V.dataSourceHasGrouping?V.groupKeys:void 0)}:void 0,me=t.isRowDisabled||qs;t.isRowSelected&&t.selectionMode==="multi-row"&&(X=V=>t.isRowSelected(V,q,t.selectionMode));let he;t.isNodeExpanded&&(he=V=>t.isNodeExpanded(V,Y)),t.isNodeCollapsed&&(he=V=>!t.isNodeExpanded(V,Y)),he||(he=F=>Y.isNodeExpanded(F.nodePath));let ae=t.rowInfoReducers;if(j){if(le){let V=ce;t.devToolsDetected&&(V=Date.now());let F=t.aggregationReducers,ge=t.lazyLoad?pm({groupBy:O,pivot:K,mappings:t.pivotMappings,reducers:F,indexer:t.indexer,toPrimaryKey:m,cache:f,marker:r?it(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):Ia({groupBy:O,pivot:K,reducers:F,marker:r?it(r).track.DataSource.label.Group.start():void 0},U);t.groupDeepMap=ge.deepMap,q&&(q.getConfig=gt(t));let xe=Object.keys(ae||{}),Ee=Ea(ae),Ae={reducers:ae,results:Ee,reducerKeys:xe,rowInfo:{}},Me=Ee?qe=>{Ae.rowInfo=qe,Aa(Ae)}:void 0,He=Z?qe=>{qe.isCellSelected=B=>Z.isCellSelected(qe.id,B)}:void 0,tt=Me||He?Bs(Me,He):void 0,Qe=ym({marker:r?it(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:ge,lazyLoad:!!t.lazyLoad,reducers:F,toPrimaryKey:m,isRowSelected:X,rowSelectionState:q,withRowInfo:tt,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});z=Qe.data,t.rowInfoReducerResults=Ma({reducers:ae,results:Ee,array:z}),t.groupRowsIndexesInDataArray=Qe.groupRowsIndexes,t.reducerResults=ge.reducerResults;let rt=K?bm({deepMap:ge.topLevelPivotColumns,pivotBy:K,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=rt?.columns,t.pivotColumnGroups=rt?.columnGroups;let Je=Qm(z,l,t.pivotColumns,t.sortTypes);Je!==z&&(z=Je,t.groupRowsIndexesInDataArray=z.map((qe,B)=>qe.isGroupRow?B:-1).filter(qe=>qe>=0)),t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-V)}else z=t.lastGroupDataArray;t.lastGroupDataArray=z,t.groupedAt=ce}else if(k){if(de){let V=ce;t.devToolsDetected&&(V=Date.now());let F=t.aggregationReducers,ge={marker:r?it(r).track.DataSource.label.Tree.start():void 0,isLeafNode:b,getNodeChildren:h,toKey:m,reducers:F},xe=Ks(ge,U);t.treeDeepMap=xe.deepMap,t.treePaths=xe.treePaths;let Ee=t.selectionMode==="multi-row"?Km(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=Ee;let Ae=Object.keys(ae||{}),Me=Ea(ae),He={reducers:ae,results:Me,reducerKeys:Ae,rowInfo:{}},tt=Me?ne=>{He.rowInfo=ne,Aa(He)}:void 0,Qe=Z?ne=>{ne.isCellSelected=ye=>Z.isCellSelected(ne.id,ye)}:void 0,rt=tt||Qe?Bs(tt,Qe):void 0,Je=t.selectionMode==="single-row"?ne=>ne.id===t.treeSelection:t.selectionMode==="multi-row"?ne=>Ee.isNodeSelected(ne.nodePath):void 0,qe=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;z=hm({marker:r?it(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:xe,treeParams:ge,dataArray:U,reducers:F,toPrimaryKey:m,isNodeSelected:Je,isNodeExpanded:he,treeSelectionState:Ee,withRowInfo:rt,repeatWrappedGroupRows:qe,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=Ma({reducers:ae,results:Me,array:z}),t.reducerResults=xe.reducerResults,t.totalLeafNodesCount=xe.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=ce,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-V)}else z=t.lastTreeDataArray;t.lastTreeDataArray=z}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.groupRowsIndexesInDataArray=void 0,n.postSortDataArray!=t.postSortDataArray||ie||G||Q||ue){let F=Object.keys(ae||{}),ge=Ea(ae),xe={reducers:ae,results:ge,reducerKeys:F,rowInfo:{}};z=U.map((Ee,Ae)=>{let Me=$C(Ee,Ee?m(Ee):Ae,Ae,X,me,Z);return ge&&(xe.rowInfo=Me,Aa(xe)),Me}),t.rowInfoReducerResults=Ma({reducers:ae,results:ge,array:z})}if(t.postGroupDataArray=z,z!==t.dataArray&&(t.updatedAt=ce),t.dataArray=z,t.reducedAt=ce,t.selectionMode==="multi-row")if(j&&t.lazyLoad){r&&(e=it(r).track.DataSource.label.ComputeSelectionCountLazy.start());let V=!0,F=!1;t.dataArray.forEach(ge=>{if(!ge.isTreeNode&&ge.isGroupRow&&ge.groupKeys.length===1){let{rowSelected:xe}=ge;xe!==!0&&(V=!1),(xe===!0||xe===null)&&(F=!0)}}),t.allRowsSelected=V,t.someRowsSelected=F,r&&(e?.end(),e=void 0)}else{r&&(e=it(r).track.DataSource.label.ComputeSelectionCount.start());let V=t.isTree?t.totalLeafNodesCount:t.filteredCount,F=t.isTree?t.treeSelectionState?t.treeSelectionState.getSelectedCount():0:t.rowSelection.getSelectedCount();t.allRowsSelected=V===F,t.someRowsSelected=F>0,r&&(e?.end(),e=void 0)}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:ce,mutations:T?.size?T:void 0,treeMutations:S?.size?S:void 0}),t.rowInfoStore.notifyDataArray(z,{marker:r?it(r).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:t,previousDataSourceState:n}),i&&i?.track.DataSource.label.PrepareData.end({details:[N||L||le||de?{name:"Performed operations",value:[N?"filter":null,L?"sort":null,le?"group":null,de?"tree":null].filter(_o).join(", ")}:null,c?{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(_o)}),t}var tg=!0,YC={originalDataArray:!0,changes:!0},qC={filterValue:(o,e)=>JSON.stringify(o)===JSON.stringify(e),groupRowsState:(o,e)=>JSON.stringify(o)===JSON.stringify(e)};function Bt(o,e,t){let n=La(o.sortInfo,o.groupBy),r=o.multiSort?n:n?.[0]??null,i={append:!1,originalDataArray:o.originalDataArray,sortInfo:r,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(t&&(i.masterRowInfo=t.masterRowInfo),i.groupBy&&(i.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(i.livePaginationCursor=o.livePaginationCursor,i.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(i.lazyLoadBatchSize=o.lazyLoadBatchSize,i.lazyLoadStartIndex=0),i.groupKeys=[]),e&&Object.assign(i,e),i.filterValue&&i.filterValue.length){let s=ka(i.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});s&&s.length&&(i.filterValue=s)}let a={},l=o.dataParams||{};for(let s in i)if(i.hasOwnProperty(s)&&!YC[s]){let u=s,c=qC[u],d=i[u],p=l[u];(c?c(d,p):d===p)||(a[u]=!0)}return i.changes=a,i}function Ro(o,e,t,n,r){let i=Bt(e,n,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,u=[Uo,...i.groupKeys||[]],c=s.get(u);if(!c){let d=[...i.groupKeys||[],i.lazyLoadStartIndex];e.lazyLoadCacheOfLoadedBatches.set(d,!0)}if(c&&c.cache&&u.length>1){let d=c.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)}c?c.childrenLoading||(c.childrenLoading=!0):s.set(u,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:tg,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=Ht()}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 u=[],c=!1;if(Array.isArray(s.data)){let p=s;if(u=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,y,h){let b=[Uo,...g],T=y.data,S={cache:y.cache??tg,childrenLoading:!1,childrenAvailable:!0,totalCount:y.totalCount??T.length,totalCountUnfiltered:y.totalCount??T.length,children:T,error:y.error},C=[];if(i.lazyLoadBatchSize&&!h){let R=f.get(b),v=!R,P=hd({children:!0},R||{},S);v&&(P.chidren=[]),P.children.length=P.totalCount;let w=i.lazyLoadStartIndex??0,x=Math.min(y.totalCount??T.length,w+i.lazyLoadBatchSize);for(let A=w;A<x;A++){let E=S.children[A-w];if(!E)throw`lazily loaded item not found at index ${A-w}`;P.children[A]=E,E.dataset&&C.push({keys:E.keys,dataset:E.dataset})}v&&f.set(b,P)}else S.children.forEach(R=>{R&&R.dataset&&C.push({keys:R.keys,dataset:R.dataset})}),S.children.length=S.totalCount,f.set(b,S);let I=!1;if(!g||!g.length){let R=f.get([Uo]);t.originalDataArray=[...R.children],I=!0}if(I||(t.originalLazyGroupDataChangeDetect=Ht()),C.length){let R=g;C.forEach(({keys:v,dataset:P})=>{m(v,P,R)})}};var d=m;let f=e.originalLazyGroupData;c=!0,m(i.groupKeys||[],p)}}else u=s;c||(t.originalDataArray=a?e.originalDataArray.concat(u):u),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function ka(o,{filterTypes:e,filterMode:t}){return t==="local"?o:(Xs(o,e)||[]).map(n=>{let r={...n};return delete r.valueGetter,r})}var XC=()=>new Promise(o=>{Ge(o)});function Qs(o,e){let t=!!o,{stateReadyAsDetails:n}=e(),r=t&&o.shouldRestoreState?n:!0;return{isDetail:t,isDetailReady:r}}function og(o,e){let{startIndex:t,endIndex:n,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=o,{dataArray:s}=i,u=l?()=>!1:g=>s[g].data!=null,c=!l,d=new te,p=["_______xxx______"];for(let g=t;g<=n;g++){let y=s[g];if(!y)continue;let h=u(g),b=y.dataSourceHasGrouping&&y.groupKeys?[...y.groupKeys]:[];y.isGroupRow&&y.dataSourceHasGrouping&&y.groupKeys&&b.pop();let T=b.length?b:p,S=y.dataSourceHasGrouping?y.indexInGroup:y.indexInAll;if(y.isGroupRow&&!y.collapsed&&!y.childrenAvailable){let C={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:y.groupKeys,append:c},I=y.groupKeys,R=d.get(I);if(!R?.[y.id]){let v=!R;R=R||{},R[y.id]||(R[y.id]=C),v&&d.set(I,R)}}if(!h&&r!=null){let C=d.get(T),I=Math.floor(S/r)*r,R=S-I,v=s[y.indexInAll-R].indexInAll,P=u(v),w=s[v].id;if(P||C?.[w])continue;let x=!C;C=C||{};let A={lazyLoadStartIndex:I,lazyLoadBatchSize:r,groupKeys:b,append:c};C[w]||(C[w]=A),x&&d.set(T,C)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,y)=>{let h=[...y.groupKeys,y.lazyLoadStartIndex];if(e&&e.has(h))return g;e?.set(h,!0);let b=[i.data,i,a,y];return g.then(()=>XC()).then(()=>Ro(...b))},f)}function Js(o,e){let{rowIndex:t,primaryKey:n}=e,{dataArray:r}=o.getDataSourceState();if(n!==void 0){let i=o.dataSourceApi.getIndexByPrimaryKey(n);if(i!==-1)return i;if(r[t]?.id!==n)return-1}return r[t]?t:-1}function ri(o,e){let t=Js(o,e);return t===-1?null:Zt({...o,rowIndex:t,columnId:e.columnId})}function ii(o,e){console.warn(`Skipping "${o}": the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`)}function eu(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[u+f*m],y=a.get(g);if(y&&y.renderMenuIcon!==!1)return g}let u=l.indexOf(r),c=0,d=-1,p;for(;!p&&c<l.length&&(c++,p=s(c,d),p||(d*=-1,p=s(c,d)),!p););return p&&(n.columnMenuVisibleForColumnId=p),p}function za(o,e){let{rowIndex:t,colIndex:n}=o,{rowIndex:r,colIndex:i}=e,[a,l]=n>i?[i,n]:[n,i],[s,u]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:u,colIndex:l}]}function tu(o,e,t){let{rowsPerPage:n}=t;return n?Math.floor(o.rowIndex/n)===Math.floor(e.rowIndex/n):!0}function ng(o,e,t){if(tu(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:u,colIndex:c}=a,d=Math.floor(l/n),p=Math.floor(u/n),f=l%n,m=u%n,g=Math.min(f,m),y=Math.max(f,m),h=[];for(let b=d;b<=p;b++)for(let T=g;T<=y;T++){let S=b*n+T;if(b===d)for(let C=s;C<r;C++)h.push({rowIndex:S,colIndex:C});else if(b===p)for(let C=0;C<=c;C++)h.push({rowIndex:S,colIndex:C});else for(let C=0;C<r;C++)h.push({rowIndex:S,colIndex:C})}return h}function ZC(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}var ou=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??qo(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 je(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[u,c]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(c);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,g=qo(l,this.getDataSourceState),y=qo(u,this.getDataSourceState);if(!g||!y)return;let h=g.indexInAll,b=y.indexInAll,[T,S]=za({rowIndex:h,colIndex:f},{rowIndex:b,colIndex:m});for(let C=T.rowIndex;C<=S.rowIndex;C++)for(let I=T.colIndex;I<=S.colIndex;I++){let R={rowIndex:C,colIndex:I},[v,P]=this.getCellSelectionPosition(R);n?a.selectCell(v,P):a.deselectCell(v,P)}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 u=ZC(Array.from(a),i),c=l.map(d=>u.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:u,positions:c}};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 je(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 je(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 je:new je(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 je(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 je(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 je(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 rg(o){return new ou(o)}var Dt=class extends ar{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)}};function ig(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new Dt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new Dt({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 Dt(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 Dt(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 Zo(o,e,t){return Math.min(Math.max(o,e),t)}function Va(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 Zo(a,r,i)}function QC(o,e){let{getState:t,getDataSourceState:n,actions:r,api:i,dataSourceApi:a}=o,{key:l}=e,s=n().dataArray,u=s.length,c=t(),{brain:d}=c,{activeRowIndex:p}=c;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),g=p,y=m-f-1,h=0,b=u-1,T={ArrowDown:()=>{p=Va(n,p,1)},ArrowUp:()=>{p=Va(n,p,-1)},ArrowLeft:()=>{let C=s[p];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;p-I>=h?p=p-I:T.ArrowUp();return}return C&&C.isGroupRow?i.collapseGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.collapseRowDetail(C.id):!1},ArrowRight:()=>{let C=s[p];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;p+I<=b?p=p+I:T.ArrowDown();return}return C&&C.isGroupRow?i.expandGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.expandRowDetail(C.id):!1},Enter:()=>{let C=s[p];return C&&C.isGroupRow?i.toggleGroupRow(C.groupKeys):C&&C.isTreeNode&&C.isParentNode?a.treeApi.toggleNode(C.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.toggleRowDetail(C.id):!1},PageDown:()=>{p=Math.min(p+y,u-1)},PageUp:()=>{p=Math.max(p-y,h)},End:()=>{p=b},Home:()=>{p=h}},S=T[l];return S?(S(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function nu(o,e){let{api:t,getState:n,getComputed:r,getDataSourceState:i,dataSourceApi:a}=o,{key:l,shiftKey:s}=e,u=i().dataArray,c=n(),{activeCellIndex:d,brain:p}=c;if(!d)return!1;let[f,m]=d,{start:[g,y],end:[h,b]}=p.getRenderRange(),T=h-g-1,S=b-y-1,C=i().dataArray.length-1,I=r().computedVisibleColumns.length-1,R=0,v=0;f=Zo(f,0,C),m=Zo(m,0,I);let P={ArrowDown:()=>{f=Zo(f+1,R,C)},ArrowUp:()=>{f=Zo(f-1,R,C)},ArrowLeft:()=>{if(m===v)if(f!==R&&(m=I),p.isHorizontalLayoutBrain){let x=p.rowsPerPage;f-x>=R?f=f-x:P.ArrowUp()}else P.ArrowUp();else m=Zo(m-1,v,I)},ArrowRight:()=>{if(m===I)if(f!==C&&(m=v),p.isHorizontalLayoutBrain){let x=p.rowsPerPage;f+x<=C?f=f+x:P.ArrowDown()}else P.ArrowDown();else m=Zo(m+1,v,I)},Enter:()=>{let x=u[f];return x&&x.isGroupRow?t.toggleGroupRow(x.groupKeys):x&&x.isTreeNode&&x.isParentNode?a.treeApi.toggleNode(x.nodePath):x&&t.rowDetailApi.isRowDetailEnabledForRow(x.id)?t.rowDetailApi.toggleRowDetail(x.id):!1},PageDown:()=>{s?m=Math.min(m+S,I):f=Math.min(f+T,C)},PageUp:()=>{s?m=Math.max(m-S,v):f=Math.max(f-T,R)},End:()=>{s?m=I:f=C},Home:()=>{s?m=v:f=R}},w=P[l];return w?(w(),[f,m]):!1}function JC(o,e){let t=nu(o,e);return t?(o.actions.activeCellIndex=t,!0):!1}var eI={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function ag(o,e){let{key:t}=e,{getState:n}=o,r=n(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:u}=r;return s||u||!eI[t]?!1:i!=null&&l==="row"?QC(o,e):a!=null&&l==="cell"?JC(o,e):!1}var ru=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=Va(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=nu(this.param,{key:n,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function lg(o){return new ru(o)}function sg(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var iu=class{constructor(e){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(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(p=>requestAnimationFrame(p));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=Js({...this.context,api:this},t);if(a===-1){let p=new Error(`Cannot persist edit: the edited row (primaryKey: ${String(t.primaryKey)}, rowIndex: ${t.rowIndex}) is no longer in the data array.`);return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:p},Promise.resolve(p)}let l={...Zt({rowIndex:a,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},s=i;n.current=null,r.getValueToPersist&&(s=await r.getValueToPersist(l)),l.value=s,t.value=s;let u=this.getState().persistEdit??(()=>{if(!l.column.field)return i;let p=this.getDataSourceState().primaryKey,f=l.data&&typeof p=="string"?{[p]:l.data[p],[l.column.field]:s}:{...l.data,[l.column.field]:s};return this.context.dataSourceApi.updateData(f)}),c;try{c=await u(l)}catch(p){c=p}let d=c instanceof Error?c:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:d},Promise.resolve(d)};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(),u=s.get(l),c=t.shouldAcceptEdit??u.shouldAcceptEdit,d=c?c({...Zt({...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 u=l.computedEditable(Zt({...this.context,api:this,columnId:r,rowIndex:i}));return typeof u=="boolean"?Promise.resolve(u):u};this.getColumnApi=e=>{let t=typeof e=="string"?e:this.getComputed().computedVisibleColumns[e]?.id,n=this.columnApiById.get(t);if(n)return n;let r=mt(e,{...this.context,api:this});return r&&this.columnApiById.set(r.getColumnId(),r),r};this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(n),u=l.get(r),c=i.getRowInfoByIndex(s),d=c?.id;if(!c||!u)return u||console.warn(`No column found with id: "${r}"`),c||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(c)?!1:this.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",g=Yn({column:u,rowInfo:c,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 Rt(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 Rt(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[Uo,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i?.cache||Ro(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=te.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=Ht())}};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 u={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},c=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=u.scrollLeft>d+(n.offset||0),m=u.scrollTop>p+(n.offset||0);return f&&m?!1:(u.scrollLeft!==c.scrollLeft&&!f&&(r.scrollerDOMRef.current.scrollLeft=u.scrollLeft),u.scrollTop!==c.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=u.scrollTop),!0)};this.context=e,this.rowSelectionApi=wm({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=lg({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=ig({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=rg({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)&&(eu(t),e?.()),setTimeout(()=>{this.isDestroyed()||(eu(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,c=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??Ep({column:c,rowInfo:d}),f=p;c.getValueToEdit&&(p=await c.getValueToEdit(Zt({...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.pivotColumn,s=i.groupByForColumn,u=l?void 0:i.field,c=s?Array.isArray(s)?s:[s]:[],d=c.map(m=>m.valueGetter?g=>m.valueGetter({data:g,field:m.field}):m.field?m.field:m.groupField??void 0).filter(_o);d.length&&(u=d);let p=i.computedSortType;if(c.length&&p===co){let m=this.getState().initialColumns;p=c.flatMap(y=>{let h=y.field??y.groupField,b=h?r.get(h):null;if(b)return b.computedSortType;let T=h?rn(m,h):void 0;return T?T.sortType||(typeof T.type=="string"?T.type:"string"):[co]})}c.length&&!Array.isArray(p)&&(p=[p]);let f={dir:t,id:i.id,field:u,type:p};!l&&i.valueGetter&&(f.valueGetter=m=>i.valueGetter({data:m,field:i.field})),this.setSortInfoForColumn(e,f,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=>!sg(d,l)),this.dataSourceApi.setSortInfo(s);return}let u=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>u?d:sg(d,l)?(u=!0,t):d),u||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),u=s.name,c;n.computedFilterValue?(c={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:u}},s.defaultFilterValue!==void 0&&(c.filter.value=s.defaultFilterValue)):(c={filter:{operator:u,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(c.field=n.field)),c.id=n.id,this.setFilterValueForColumn(e,c)}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],u=n.filterTypes[l];if(i=!0,!u)return null;let c=a.filter.operator??u?.defaultOperator,p=s[c].defaultFilterValue??(u.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:c,value:p}}}return a}).filter(_o),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&&(t.scrollerDOMRef.current.scrollLeft=Math.max(e,0))}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){let t=this.getState();t.scrollerDOMRef.current&&(t.scrollerDOMRef.current.scrollTop=Math.max(e,0))}scrollRowIntoView(e,t={offset:0}){let 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 u=n.brain.scrollTopMax,c=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=u+(t.offset||0);return!d&&!c?!1:(d&&s.scrollTop!==i.scrollTop&&(n.scrollerDOMRef.current.scrollTop=s.scrollTop),c&&(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(),u=n.brain.scrollLeftMax;return l.scrollLeft>u+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function ug(o){return new iu(o)}var In=require("react");var tI=10;function cg(o,e){let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${mo} > .${kr}`,a=o.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(u=>{let c=u.parentElement,d=c.matches(`.${cn}`);if(t===!1&&d)return;let p=c.getAttribute("data-column-id"),f=u.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...kt.split(" ")),f.style.position="absolute",f.style.width="auto",c.appendChild(f);let m=f.offsetWidth;if(c.removeChild(f),!s[p]){let g=Pe().getComputedStyle(c);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+tI}if(m+=s[p],d){let g=0;c.childNodes.forEach(y=>{if(y!==u&&y.nodeType===1){let h=y,b=Math.max(h.offsetWidth,parseInt(h.style.width,10));if(isNaN(b)&&(b=0),g+=b,b>0){let T=Pe().getComputedStyle(h);g+=parseInt(T.marginLeft,10)+parseInt(T.marginRight,10)}}}),m+=g}r&&r.has(p)||n&&!n.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function dg(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=Nt(),[a,l]=(0,In.useState)(0),s=typeof r=="object"?r.key:r,u=Fe(s),c=(0,In.useRef)(null);(0,In.useEffect)(()=>{if(u()==null)return;let{current:p}=c,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),(0,In.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),c.current=s;let g=cg(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),y=Object.keys(g);if(!y.length)return;let h=o().columnSizing,b={...h},T=!1;y.forEach(S=>{b[S]={width:g[S]},T=T||b[S].width!==h[S]?.width}),T&&(e.columnSizing=b)},[s,n,a])}var Jo=require("react");var Ga=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&&!tu(e,t,r)){ng(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(c=>{let d=this.getCellSelectionPosition({rowIndex:c.rowIndex,colIndex:c.colIndex});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=za(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let u=i.rowIndex;u<=a.rowIndex;u++)for(let c=i.colIndex;c<=a.colIndex;c++){let d=this.getCellSelectionPosition({rowIndex:u,colIndex:c});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 pg(o,e){return o<e?[o,e]:[e,o]}var Ha=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]=pg(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]=pg(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 Cg=require("react");var Tg=W(require("react"));var oI=W(require("react"));function Ka(o){return _e(e=>o(e.dataSourceState))}var ut=W(require("react"));function fg(){return Ao()}var at=require("react");var Ft=require("react");function Rn(o,e){let t=(0,Ft.useRef)({}),n=(0,Ft.useRef)({}),r=n.current,i=(0,Ft.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,Ft.useEffect)(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=o(s,r)),i.current={},n.current={},u},l)}function nI(o,e){let t=(0,Ft.useRef)({}),n=(0,Ft.useRef)({}),r=n.current,i=(0,Ft.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,Ft.useLayoutEffect)(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=o(s,r)),i.current={},n.current={},u},l)}function rI(o,e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);(0,Ft.useEffect)(o,t)}function iI(o,e,t){return e=e.replaceAll("$ERR_CODE",o),e=`${e}
|
|
16
|
+
`)});function ng(o){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:n,getNodeChildren:r,isLeafNode:i,nodesKey:a}=o,l=[],s=u=>{let c=r(u);if(i(u)||!Array.isArray(c))return u;let d=ng({...o,dataArray:c});return d.length===0?!1:(u={...u,[a]:d},u)};for(let u=0,c=e.length;u<c;u++){let d=e[u],p=r(d),f=t({data:d,index:u,dataArray:e,primaryKey:n(d,u),filterTreeNode:s});f&&(f===!0?f=d:typeof f=="object"&&f===d&&p!==r(f)&&JC(),l.push(f))}return l}function Js(o){let{filterTypes:e,marker:t,operatorsByFilterType:n,filterFunction:r,toPrimaryKey:i,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:u}=o,{dataArray:c}=o;t?.start({details:[{name:"Count before",value:c.length}]}),r&&(c=c.filter((p,f,m)=>r({data:p,index:f,dataArray:m,primaryKey:i(p,f)}))),a&&(c=ng({...o,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:u}));let d=Qs(o.filterValue,e)||[];if(d&&d.length){let p=c.filter((f,m,g)=>{let h={data:f,index:m,dataArray:g,primaryKey:i(f,m),field:void 0};for(let y=0,b=d.length;y<b;y++){let S=d[y],{disabled:T,field:C,valueGetter:I,filter:{type:R,value:w,operator:D}}=S,v=e[R];if(T||!v)continue;let M=n[R]?.[D];if(!M)continue;let E=I||v.valueGetter||(({data:A,field:_})=>_?A[_]:A);h.field=C;let P=h;if(P.filterValue=w,P.currentValue=E(P),P.emptyValues=v.emptyValues,!M.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:c.length}]}),c}function rg(o){let e,{state:t,previousState:n}=o,r=t.debugId,i;r&&(i=at(r).track.DataSource.label.PrepareData.start());let a=Am(t),l=ka(t.sortInfo,t.groupBy),s=t.sortMode,u=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(u=!1);let c=io(n,t,["refetchKey"]),d=io(n,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&c&&(d=!0),!1&&(t.originalLazyGroupData=new te,d=!0);let f=t.cache?Cn.clone(t.cache):void 0;f&&!f.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,h=t.isTree,y=g?V=>V[g]:void 0,b=g?V=>V[g]===void 0:void 0,S,T;d&&(t.indexer.clear(),t.lazyLoad||(S=f?.getMutations(),T=f?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:f,getNodeChildren:y,isLeafNode:b,nodesKey:g}),h&&t.waitForNodePathPromises.visit(({value:V},L)=>{V&&t.indexer.getDataForNodePath(L)!==void 0&&V.resolve(!0)}))),f&&(f.clear(),t.cache=void 0);let{filterFunction:I,treeFilterFunction:R,filterValue:w,filterTypes:D,operatorsByFilterType:v}=t,M=!!I||!!R||Array.isArray(w)&&w.length,x=M&&t.filterMode==="local",E=io(n,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),P=d||E,A=io(n,t,["sortInfo"]),_=d||E||A,N=t.filterMode==="local"&&(P||!t.lastFilterDataArray),F=u&&(_||!t.lastSortDataArray||a.sortInfo),O=t.groupBy,K=t.pivotBy,j=!h&&(O.length>0||!!K),k=h,Q=io(n,t,["rowDisabledState","isRowDisabled"]),G=io(n,t,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),$=io(n,t,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),ie=d||_||io(n,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),pe=d||_||io(n,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),ue=io(n,t,["rowInfoReducers"]),le=j&&(ie||!t.lastGroupDataArray||a.groupBy)||G||Q||ue,de=k&&(pe||a.tree||!t.lastTreeDataArray)||$||Q||ue,ce=Date.now(),U=t.originalDataArray;if(k&&de){let V={marker:r?at(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:b,getNodeChildren:y,toKey:m};t.unfilteredTreePaths=Ws(V,U).treePaths}if(M||(t.unfilteredCount=U.length),x){t.unfilteredCount=U.length;let V=ce;N?(t.devToolsDetected&&(V=Date.now()),U=Js({marker:r?at(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:y,isLeafNode:b,nodesKey:g,treeFilterFunction:R,dataArray:U,toPrimaryKey:m,filterTypes:D,operatorsByFilterType:v,filterFunction:I,filterValue:w}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-V)):U=t.lastFilterDataArray,t.lastFilterDataArray=U,t.filteredAt=ce}if(t.filteredCount=U.length,t.postFilterDataArray=U,u){let V=no.knownTypes;if(no.knownTypes={...V,...t.sortTypes},F){let L=ce;if(t.devToolsDetected&&(L=Date.now()),r&&(e=at(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:U.length}]})),t.sortFunction?(U=t.sortFunction(l,[...U]),e&&(e.end(),e=void 0)):h?U=va(l,U,{marker:e,inplace:!1,isLeafNode:b,getNodeChildren:y,toKey:m,nodesKey:g}):U=no(l,[...U],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let ge=Date.now()-L;t.debugTimings.set("sort",ge)}}else U=t.lastSortDataArray;no.knownTypes=V,t.lastSortDataArray=U,t.sortedAt=ce}t.postSortDataArray=U;let z=t.dataArray,q=t.rowSelection instanceof Ne?t.rowSelection:void 0,Y=t.treeExpandState instanceof ut?t.treeExpandState:void 0,Z=t.cellSelection instanceof $e?t.cellSelection:void 0;q?.xcache();let X=t.selectionMode==="single-row"?V=>V.id===t.rowSelection:t.selectionMode==="multi-row"?V=>{let L=q;return V.isGroupRow?L.getGroupRowSelectionState(V.groupKeys):L.isRowSelected(V.id,V.dataSourceHasGrouping?V.groupKeys:void 0)}:void 0,me=t.isRowDisabled||Zs;t.isRowSelected&&t.selectionMode==="multi-row"&&(X=V=>t.isRowSelected(V,q,t.selectionMode));let he;t.isNodeExpanded&&(he=V=>t.isNodeExpanded(V,Y)),t.isNodeCollapsed&&(he=V=>!t.isNodeExpanded(V,Y)),he||(he=L=>Y.isNodeExpanded(L.nodePath));let ae=t.rowInfoReducers;if(j){if(le){let V=ce;t.devToolsDetected&&(V=Date.now());let L=t.aggregationReducers,ge=t.lazyLoad?hm({groupBy:O,pivot:K,mappings:t.pivotMappings,reducers:L,indexer:t.indexer,toPrimaryKey:m,cache:f,marker:r?at(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):Ra({groupBy:O,pivot:K,reducers:L,marker:r?at(r).track.DataSource.label.Group.start():void 0},U);t.groupDeepMap=ge.deepMap,q&&(q.getConfig=gt(t));let xe=Object.keys(ae||{}),Ee=Ma(ae),Me={reducers:ae,results:Ee,reducerKeys:xe,rowInfo:{}},Ae=Ee?qe=>{Me.rowInfo=qe,Aa(Me)}:void 0,Ke=Z?qe=>{qe.isCellSelected=B=>Z.isCellSelected(qe.id,B)}:void 0,ot=Ae||Ke?js(Ae,Ke):void 0,Ze=Cm({marker:r?at(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:ge,lazyLoad:!!t.lazyLoad,reducers:L,toPrimaryKey:m,isRowSelected:X,rowSelectionState:q,withRowInfo:ot,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});z=Ze.data,t.rowInfoReducerResults=_a({reducers:ae,results:Ee,array:z}),t.groupRowsIndexesInDataArray=Ze.groupRowsIndexes,t.reducerResults=ge.reducerResults;let it=K?Im({deepMap:ge.topLevelPivotColumns,pivotBy:K,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=it?.columns,t.pivotColumnGroups=it?.columnGroups;let Qe=og(z,l,t.pivotColumns,t.sortTypes);Qe!==z&&(z=Qe,t.groupRowsIndexesInDataArray=z.map((qe,B)=>qe.isGroupRow?B:-1).filter(qe=>qe>=0)),t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-V)}else z=t.lastGroupDataArray;t.lastGroupDataArray=z,t.groupedAt=ce}else if(k){if(de){let V=ce;t.devToolsDetected&&(V=Date.now());let L=t.aggregationReducers,ge={marker:r?at(r).track.DataSource.label.Tree.start():void 0,isLeafNode:b,getNodeChildren:y,toKey:m,reducers:L},xe=Ws(ge,U);t.treeDeepMap=xe.deepMap,t.treePaths=xe.treePaths;let Ee=t.selectionMode==="multi-row"?$m(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=Ee;let Me=Object.keys(ae||{}),Ae=Ma(ae),Ke={reducers:ae,results:Ae,reducerKeys:Me,rowInfo:{}},ot=Ae?ne=>{Ke.rowInfo=ne,Aa(Ke)}:void 0,Ze=Z?ne=>{ne.isCellSelected=ye=>Z.isCellSelected(ne.id,ye)}:void 0,it=ot||Ze?js(ot,Ze):void 0,Qe=t.selectionMode==="single-row"?ne=>ne.id===t.treeSelection:t.selectionMode==="multi-row"?ne=>Ee.isNodeSelected(ne.nodePath):void 0,qe=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;z=Tm({marker:r?at(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:xe,treeParams:ge,dataArray:U,reducers:L,toPrimaryKey:m,isNodeSelected:Qe,isNodeExpanded:he,treeSelectionState:Ee,withRowInfo:it,repeatWrappedGroupRows:qe,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=_a({reducers:ae,results:Ae,array:z}),t.reducerResults=xe.reducerResults,t.totalLeafNodesCount=xe.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=ce,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-V)}else z=t.lastTreeDataArray;t.lastTreeDataArray=z}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.groupRowsIndexesInDataArray=void 0,n.postSortDataArray!=t.postSortDataArray||ie||G||Q||ue){let L=Object.keys(ae||{}),ge=Ma(ae),xe={reducers:ae,results:ge,reducerKeys:L,rowInfo:{}};z=U.map((Ee,Me)=>{let Ae=QC(Ee,Ee?m(Ee):Me,Me,X,me,Z);return ge&&(xe.rowInfo=Ae,Aa(xe)),Ae}),t.rowInfoReducerResults=_a({reducers:ae,results:ge,array:z})}if(t.postGroupDataArray=z,z!==t.dataArray&&(t.updatedAt=ce),t.dataArray=z,t.reducedAt=ce,t.selectionMode==="multi-row")if(j&&t.lazyLoad){r&&(e=at(r).track.DataSource.label.ComputeSelectionCountLazy.start());let V=!0,L=!1;t.dataArray.forEach(ge=>{if(!ge.isTreeNode&&ge.isGroupRow&&ge.groupKeys.length===1){let{rowSelected:xe}=ge;xe!==!0&&(V=!1),(xe===!0||xe===null)&&(L=!0)}}),t.allRowsSelected=V,t.someRowsSelected=L,r&&(e?.end(),e=void 0)}else{r&&(e=at(r).track.DataSource.label.ComputeSelectionCount.start());let V=t.isTree?t.totalLeafNodesCount:t.filteredCount,L=t.isTree?t.treeSelectionState?t.treeSelectionState.getSelectedCount():0:t.rowSelection.getSelectedCount();t.allRowsSelected=V===L,t.someRowsSelected=L>0,r&&(e?.end(),e=void 0)}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:ce,mutations:S?.size?S:void 0,treeMutations:T?.size?T:void 0}),t.rowInfoStore.notifyDataArray(z,{marker:r?at(r).track.DataSource.label.DiffRowInfoInStore:void 0,dataSourceState:t,previousDataSourceState:n}),i&&i?.track.DataSource.label.PrepareData.end({details:[N||F||le||de?{name:"Performed operations",value:[N?"filter":null,F?"sort":null,le?"group":null,de?"tree":null].filter(Oo).join(", ")}:null,c?{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(Oo)}),t}var ig=!0,eI={originalDataArray:!0,changes:!0},tI={filterValue:(o,e)=>JSON.stringify(o)===JSON.stringify(e),groupRowsState:(o,e)=>JSON.stringify(o)===JSON.stringify(e)};function Bt(o,e,t){let n=ka(o.sortInfo,o.groupBy),r=o.multiSort?n:n?.[0]??null,i={append:!1,originalDataArray:o.originalDataArray,sortInfo:r,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(t&&(i.masterRowInfo=t.masterRowInfo),i.groupBy&&(i.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(i.livePaginationCursor=o.livePaginationCursor,i.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(i.lazyLoadBatchSize=o.lazyLoadBatchSize,i.lazyLoadStartIndex=0),i.groupKeys=[]),e&&Object.assign(i,e),i.filterValue&&i.filterValue.length){let s=eu(i.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});s&&s.length&&(i.filterValue=s)}let a={},l=o.dataParams||{};for(let s in i)if(i.hasOwnProperty(s)&&!eI[s]){let u=s,c=tI[u],d=i[u],p=l[u];(c?c(d,p):d===p)||(a[u]=!0)}return i.changes=a,i}function wo(o,e,t,n,r){let i=Bt(e,n,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,u=[Uo,...i.groupKeys||[]],c=s.get(u);if(!c){let d=[...i.groupKeys||[],i.lazyLoadStartIndex];e.lazyLoadCacheOfLoadedBatches.set(d,!0)}if(c&&c.cache&&u.length>1){let d=c.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)}c?c.childrenLoading||(c.childrenLoading=!0):s.set(u,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:ig,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=Ht()}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 u=[],c=!1;if(Array.isArray(s.data)){let p=s;if(u=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,y){let b=[Uo,...g],S=h.data,T={cache:h.cache??ig,childrenLoading:!1,childrenAvailable:!0,totalCount:h.totalCount??S.length,totalCountUnfiltered:h.totalCount??S.length,children:S,error:h.error},C=[];if(i.lazyLoadBatchSize&&!y){let R=f.get(b),w=!R,D=Td({children:!0},R||{},T);w&&(D.chidren=[]),D.children.length=D.totalCount;let v=i.lazyLoadStartIndex??0,M=Math.min(h.totalCount??S.length,v+i.lazyLoadBatchSize);for(let x=v;x<M;x++){let E=T.children[x-v];if(!E)throw`lazily loaded item not found at index ${x-v}`;D.children[x]=E,E.dataset&&C.push({keys:E.keys,dataset:E.dataset})}w&&f.set(b,D)}else T.children.forEach(R=>{R&&R.dataset&&C.push({keys:R.keys,dataset:R.dataset})}),T.children.length=T.totalCount,f.set(b,T);let I=!1;if(!g||!g.length){let R=f.get([Uo]);t.originalDataArray=[...R.children],I=!0}if(I||(t.originalLazyGroupDataChangeDetect=Ht()),C.length){let R=g;C.forEach(({keys:w,dataset:D})=>{m(w,D,R)})}};var d=m;let f=e.originalLazyGroupData;c=!0,m(i.groupKeys||[],p)}}else u=s;c||(t.originalDataArray=a?e.originalDataArray.concat(u):u),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function eu(o,{filterTypes:e,filterMode:t}){return t==="local"?o:(Qs(o,e)||[]).map(n=>{let r={...n};return delete r.valueGetter,r})}function ag(){let o;return(e,t,n)=>{if(o&&o.filterValue===e&&o.filterTypes===t&&o.filterMode===n)return o.result;let r=eu(e,{filterTypes:t,filterMode:n});return o&&o.filterValue===e&&JSON.stringify(o.result)===JSON.stringify(r)&&(r=o.result),o={filterValue:e,filterTypes:t,filterMode:n,result:r},r}}var oI=()=>new Promise(o=>{He(o)});function tu(o,e){let t=!!o,{stateReadyAsDetails:n}=e(),r=t&&o.shouldRestoreState?n:!0;return{isDetail:t,isDetailReady:r}}function lg(o){let{lazyLoad:e,lazyLoadBatchSize:t,lazyLoadCacheOfLoadedBatches:n}=o;return!!e&&!!t&&t>0&&n.has([0])}function sg(o,e){let{startIndex:t,endIndex:n,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=o,{dataArray:s}=i,u=l?()=>!1:g=>s[g].data!=null,c=!l,d=new te,p=["_______xxx______"];for(let g=t;g<=n;g++){let h=s[g];if(!h)continue;let y=u(g),b=h.dataSourceHasGrouping&&h.groupKeys?[...h.groupKeys]:[];h.isGroupRow&&h.dataSourceHasGrouping&&h.groupKeys&&b.pop();let S=b.length?b:p,T=h.dataSourceHasGrouping?h.indexInGroup:h.indexInAll;if(h.isGroupRow&&!h.collapsed&&!h.childrenAvailable){let C={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:h.groupKeys,append:c},I=h.groupKeys,R=d.get(I);if(!R?.[h.id]){let w=!R;R=R||{},R[h.id]||(R[h.id]=C),w&&d.set(I,R)}}if(!y&&r!=null){let C=d.get(S),I=Math.floor(T/r)*r,R=T-I,w=s[h.indexInAll-R].indexInAll,D=u(w),v=s[w].id;if(D||C?.[v])continue;let M=!C;C=C||{};let x={lazyLoadStartIndex:I,lazyLoadBatchSize:r,groupKeys:b,append:c};C[v]||(C[v]=x),M&&d.set(S,C)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,h)=>{let y=[...h.groupKeys,h.lazyLoadStartIndex];if(e&&e.has(y))return g;e?.set(y,!0);let b=[i.data,i,a,h];return g.then(()=>oI()).then(()=>wo(...b))},f)}function ou(o,e){let{rowIndex:t,primaryKey:n}=e,{dataArray:r}=o.getDataSourceState();if(n!==void 0){let i=o.dataSourceApi.getIndexByPrimaryKey(n);if(i!==-1)return i;if(r[t]?.id!==n)return-1}return r[t]?t:-1}function ii(o,e){let t=ou(o,e);return t===-1?null:Qt({...o,rowIndex:t,columnId:e.columnId})}function ai(o,e){console.warn(`Skipping "${o}": the edited row (primaryKey: ${String(e.primaryKey)}, rowIndex: ${e.rowIndex}) is no longer in the data array.`)}function nu(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[u+f*m],h=a.get(g);if(h&&h.renderMenuIcon!==!1)return g}let u=l.indexOf(r),c=0,d=-1,p;for(;!p&&c<l.length&&(c++,p=s(c,d),p||(d*=-1,p=s(c,d)),!p););return p&&(n.columnMenuVisibleForColumnId=p),p}function za(o,e){let{rowIndex:t,colIndex:n}=o,{rowIndex:r,colIndex:i}=e,[a,l]=n>i?[i,n]:[n,i],[s,u]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:u,colIndex:l}]}function ru(o,e,t){let{rowsPerPage:n}=t;return n?Math.floor(o.rowIndex/n)===Math.floor(e.rowIndex/n):!0}function ug(o,e,t){if(ru(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:u,colIndex:c}=a,d=Math.floor(l/n),p=Math.floor(u/n),f=l%n,m=u%n,g=Math.min(f,m),h=Math.max(f,m),y=[];for(let b=d;b<=p;b++)for(let S=g;S<=h;S++){let T=b*n+S;if(b===d)for(let C=s;C<r;C++)y.push({rowIndex:T,colIndex:C});else if(b===p)for(let C=0;C<=c;C++)y.push({rowIndex:T,colIndex:C});else for(let C=0;C<r;C++)y.push({rowIndex:T,colIndex:C})}return y}function nI(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}var iu=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??qo(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 $e(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[u,c]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(c);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,g=qo(l,this.getDataSourceState),h=qo(u,this.getDataSourceState);if(!g||!h)return;let y=g.indexInAll,b=h.indexInAll,[S,T]=za({rowIndex:y,colIndex:f},{rowIndex:b,colIndex:m});for(let C=S.rowIndex;C<=T.rowIndex;C++)for(let I=S.colIndex;I<=T.colIndex;I++){let R={rowIndex:C,colIndex:I},[w,D]=this.getCellSelectionPosition(R);n?a.selectCell(w,D):a.deselectCell(w,D)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let n=Da(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 u=nI(Array.from(a),i),c=l.map(d=>u.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:u,positions:c}};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 $e(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 $e(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 $e:new $e(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 $e(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 $e(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 $e(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 cg(o){return new iu(o)}var xt=class extends ar{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)}};function dg(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new xt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new xt({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 xt(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 xt(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 Zo(o,e,t){return Math.min(Math.max(o,e),t)}function Va(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 Zo(a,r,i)}function rI(o,e){let{getState:t,getDataSourceState:n,actions:r,api:i,dataSourceApi:a}=o,{key:l}=e,s=n().dataArray,u=s.length,c=t(),{brain:d}=c,{activeRowIndex:p}=c;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),g=p,h=m-f-1,y=0,b=u-1,S={ArrowDown:()=>{p=Va(n,p,1)},ArrowUp:()=>{p=Va(n,p,-1)},ArrowLeft:()=>{let C=s[p];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;p-I>=y?p=p-I:S.ArrowUp();return}return C&&C.isGroupRow?i.collapseGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.collapseRowDetail(C.id):!1},ArrowRight:()=>{let C=s[p];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;p+I<=b?p=p+I:S.ArrowDown();return}return C&&C.isGroupRow?i.expandGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.expandRowDetail(C.id):!1},Enter:()=>{let C=s[p];return C&&C.isGroupRow?i.toggleGroupRow(C.groupKeys):C&&C.isTreeNode&&C.isParentNode?a.treeApi.toggleNode(C.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.toggleRowDetail(C.id):!1},PageDown:()=>{p=Math.min(p+h,u-1)},PageUp:()=>{p=Math.max(p-h,y)},End:()=>{p=b},Home:()=>{p=y}},T=S[l];return T?(T(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function au(o,e){let{api:t,getState:n,getComputed:r,getDataSourceState:i,dataSourceApi:a}=o,{key:l,shiftKey:s}=e,u=i().dataArray,c=n(),{activeCellIndex:d,brain:p}=c;if(!d)return!1;let[f,m]=d,{start:[g,h],end:[y,b]}=p.getRenderRange(),S=y-g-1,T=b-h-1,C=i().dataArray.length-1,I=r().computedVisibleColumns.length-1,R=0,w=0;f=Zo(f,0,C),m=Zo(m,0,I);let D={ArrowDown:()=>{f=Zo(f+1,R,C)},ArrowUp:()=>{f=Zo(f-1,R,C)},ArrowLeft:()=>{if(m===w)if(f!==R&&(m=I),p.isHorizontalLayoutBrain){let M=p.rowsPerPage;f-M>=R?f=f-M:D.ArrowUp()}else D.ArrowUp();else m=Zo(m-1,w,I)},ArrowRight:()=>{if(m===I)if(f!==C&&(m=w),p.isHorizontalLayoutBrain){let M=p.rowsPerPage;f+M<=C?f=f+M:D.ArrowDown()}else D.ArrowDown();else m=Zo(m+1,w,I)},Enter:()=>{let M=u[f];return M&&M.isGroupRow?t.toggleGroupRow(M.groupKeys):M&&M.isTreeNode&&M.isParentNode?a.treeApi.toggleNode(M.nodePath):M&&t.rowDetailApi.isRowDetailEnabledForRow(M.id)?t.rowDetailApi.toggleRowDetail(M.id):!1},PageDown:()=>{s?m=Math.min(m+T,I):f=Math.min(f+S,C)},PageUp:()=>{s?m=Math.max(m-T,w):f=Math.max(f-S,R)},End:()=>{s?m=I:f=C},Home:()=>{s?m=w:f=R}},v=D[l];return v?(v(),[f,m]):!1}function iI(o,e){let t=au(o,e);return t?(o.actions.activeCellIndex=t,!0):!1}var aI={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function pg(o,e){let{key:t}=e,{getState:n}=o,r=n(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:u}=r;return s||u||!aI[t]?!1:i!=null&&l==="row"?rI(o,e):a!=null&&l==="cell"?iI(o,e):!1}var lu=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=Va(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=au(this.param,{key:n,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function fg(o){return new lu(o)}function mg(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var su=class{constructor(e){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(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(p=>requestAnimationFrame(p));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=ou({...this.context,api:this},t);if(a===-1){let p=new Error(`Cannot persist edit: the edited row (primaryKey: ${String(t.primaryKey)}, rowIndex: ${t.rowIndex}) is no longer in the data array.`);return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:p},Promise.resolve(p)}let l={...Qt({rowIndex:a,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},s=i;n.current=null,r.getValueToPersist&&(s=await r.getValueToPersist(l)),l.value=s,t.value=s;let u=this.getState().persistEdit??(()=>{if(!l.column.field)return i;let p=this.getDataSourceState().primaryKey,f=l.data&&typeof p=="string"?{[p]:l.data[p],[l.column.field]:s}:{...l.data,[l.column.field]:s};return this.context.dataSourceApi.updateData(f)}),c;try{c=await u(l)}catch(p){c=p}let d=c instanceof Error?c:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:d},Promise.resolve(d)};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(),u=s.get(l),c=t.shouldAcceptEdit??u.shouldAcceptEdit,d=c?c({...Qt({...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 u=l.computedEditable(Qt({...this.context,api:this,columnId:r,rowIndex:i}));return typeof u=="boolean"?Promise.resolve(u):u};this.getColumnApi=e=>{let t=typeof e=="string"?e:this.getComputed().computedVisibleColumns[e]?.id,n=this.columnApiById.get(t);if(n)return n;let r=mt(e,{...this.context,api:this});return r&&this.columnApiById.set(r.getColumnId(),r),r};this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(n),u=l.get(r),c=i.getRowInfoByIndex(s),d=c?.id;if(!c||!u)return u||console.warn(`No column found with id: "${r}"`),c||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(c)?!1:this.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",g=Yn({column:u,rowInfo:c,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 wt(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),n=new wt(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[Uo,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i?.cache||wo(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=te.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=Ht())}};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 u={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},c=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=u.scrollLeft>d+(n.offset||0),m=u.scrollTop>p+(n.offset||0);return f&&m?!1:(u.scrollLeft!==c.scrollLeft&&!f&&(r.scrollerDOMRef.current.scrollLeft=u.scrollLeft),u.scrollTop!==c.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=u.scrollTop),!0)};this.context=e,this.rowSelectionApi=xm({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=fg({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=dg({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=cg({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)&&(nu(t),e?.()),setTimeout(()=>{this.isDestroyed()||(nu(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,c=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??Op({column:c,rowInfo:d}),f=p;c.getValueToEdit&&(p=await c.getValueToEdit(Qt({...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.pivotColumn,s=i.groupByForColumn,u=l?void 0:i.field,c=s?Array.isArray(s)?s:[s]:[],d=c.map(m=>m.valueGetter?g=>m.valueGetter({data:g,field:m.field}):m.field?m.field:m.groupField??void 0).filter(Oo);d.length&&(u=d);let p=i.computedSortType;if(c.length&&p===po){let m=this.getState().initialColumns;p=c.flatMap(h=>{let y=h.field??h.groupField,b=y?r.get(y):null;if(b)return b.computedSortType;let S=y?rn(m,y):void 0;return S?S.sortType||(typeof S.type=="string"?S.type:"string"):[po]})}c.length&&!Array.isArray(p)&&(p=[p]);let f={dir:t,id:i.id,field:u,type:p};!l&&i.valueGetter&&(f.valueGetter=m=>i.valueGetter({data:m,field:i.field})),this.setSortInfoForColumn(e,f,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=>!mg(d,l)),this.dataSourceApi.setSortInfo(s);return}let u=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>u?d:mg(d,l)?(u=!0,t):d),u||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),u=s.name,c;n.computedFilterValue?(c={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:u}},s.defaultFilterValue!==void 0&&(c.filter.value=s.defaultFilterValue)):(c={filter:{operator:u,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(c.field=n.field)),c.id=n.id,this.setFilterValueForColumn(e,c)}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],u=n.filterTypes[l];if(i=!0,!u)return null;let c=a.filter.operator??u?.defaultOperator,p=s[c].defaultFilterValue??(u.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:c,value:p}}}return a}).filter(Oo),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&&(t.scrollerDOMRef.current.scrollLeft=Math.max(e,0))}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){let t=this.getState();t.scrollerDOMRef.current&&(t.scrollerDOMRef.current.scrollTop=Math.max(e,0))}scrollRowIntoView(e,t={offset:0}){let 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 u=n.brain.scrollTopMax,c=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=u+(t.offset||0);return!d&&!c?!1:(d&&s.scrollTop!==i.scrollTop&&(n.scrollerDOMRef.current.scrollTop=s.scrollTop),c&&(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(),u=n.brain.scrollLeftMax;return l.scrollLeft>u+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function gg(o){return new su(o)}var In=require("react");var lI=10;function hg(o,e){let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${go} > .${zr}`,a=o.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(u=>{let c=u.parentElement,d=c.matches(`.${cn}`);if(t===!1&&d)return;let p=c.getAttribute("data-column-id"),f=u.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...kt.split(" ")),f.style.position="absolute",f.style.width="auto",c.appendChild(f);let m=f.offsetWidth;if(c.removeChild(f),!s[p]){let g=Pe().getComputedStyle(c);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+lI}if(m+=s[p],d){let g=0;c.childNodes.forEach(h=>{if(h!==u&&h.nodeType===1){let y=h,b=Math.max(y.offsetWidth,parseInt(y.style.width,10));if(isNaN(b)&&(b=0),g+=b,b>0){let S=Pe().getComputedStyle(y);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 yg(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=Ft(),[a,l]=(0,In.useState)(0),s=typeof r=="object"?r.key:r,u=Fe(s),c=(0,In.useRef)(null);(0,In.useEffect)(()=>{if(u()==null)return;let{current:p}=c,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),(0,In.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),c.current=s;let g=hg(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),h=Object.keys(g);if(!h.length)return;let y=o().columnSizing,b={...y},S=!1;h.forEach(T=>{b[T]={width:g[T]},S=S||b[T].width!==y[T]?.width}),S&&(e.columnSizing=b)},[s,n,a])}var Jo=require("react");var Ga=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&&!ru(e,t,r)){ug(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(c=>{let d=this.getCellSelectionPosition({rowIndex:c.rowIndex,colIndex:c.colIndex});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=za(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let u=i.rowIndex;u<=a.rowIndex;u++)for(let c=i.colIndex;c<=a.colIndex;c++){let d=this.getCellSelectionPosition({rowIndex:u,colIndex:c});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 bg(o,e){return o<e?[o,e]:[e,o]}var Ha=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]=bg(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]=bg(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 Dg=require("react");var Pg=W(require("react"));var sI=W(require("react"));function Ka(o){return Oe(e=>o(e.dataSourceState))}var ct=W(require("react"));function Sg(){return Ao()}var et=require("react");var Lt=require("react");function Rn(o,e){let t=(0,Lt.useRef)({}),n=(0,Lt.useRef)({}),r=n.current,i=(0,Lt.useRef)({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,(0,Lt.useEffect)(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=o(s,r)),i.current={},n.current={},u},l)}function uI(o,e){let t=(0,Lt.useRef)({}),n=(0,Lt.useRef)({}),r=n.current,i=(0,Lt.useRef)({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,(0,Lt.useLayoutEffect)(()=>{let s=i.current,u;return Object.keys(s).length!==0&&(u=o(s,r)),i.current={},n.current={},u},l)}function cI(o,e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);(0,Lt.useEffect)(o,t)}function dI(o,e,t){return e=e.replaceAll("$ERR_CODE",o),e=`${e}
|
|
17
17
|
|
|
18
18
|
ERROR_CODE = ${o}
|
|
19
19
|
|
|
20
|
-
See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:e,type:t??"error"}}function
|
|
21
|
-
Make sure you don't pass a new reference on every render.`}),
|
|
20
|
+
See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:e,type:t??"error"}}function Tg(o){return Object.entries(o).reduce((e,[t,n])=>{let r=t,i=dI(r,typeof n=="string"?n:n.message,typeof n=="string"?void 0:n.type);return e[r]=i,e},{})}function pI(o){return{message:o.join(""),type:"warning"}}function fI(o){return{message:o.join(""),type:"error"}}var mI=Tg({DS001:pI`The "data" prop of your DataSource seems to be updating too frequently.
|
|
21
|
+
Make sure you don't pass a new reference on every render.`}),gI=Tg({CSS001_CSS:fI`It appears you have not loaded the CSS file for InfiniteTable.
|
|
22
22
|
In most environments, you should be able to fix this by adding the following line:
|
|
23
23
|
|
|
24
24
|
import '@infinite-table/infinite-react/index.css'
|
|
25
|
-
`}),
|
|
25
|
+
`}),Cg={...mI,...gI};var ht=new Map,Ig=o=>{ht.delete(o),Xo.delete(o),Co.delete(o),Ro.delete(o),Io.delete(o),ro.delete(o)};function uu(o,e,t){let n=ht.get(o);if(!n)return;let r=Xo.get(o);(!r||!Object.hasOwn(r,e))&&Xo.set(o,{...r||{},[e]:n.getState()[e]}),Co.set(o,{...Co.get(o)||{},[e]:t}),n.actions[e]=t}function Ba(o,e,t){let n=ht.get(o);if(!n)return;let r=Ro.get(o);(!r||!Object.hasOwn(r,e))&&Ro.set(o,{...r||{},[e]:n.getDataSourceState()[e]}),Io.set(o,{...Io.get(o)||{},[e]:t}),n.dataSourceActions[e]=t}var hI=o=>{let e=o.type==="error"?Mo(o.debugId):Ot(o.debugId),t=o.type==="error"?Lm:lr,n=o.debugId?`${o.code}-${o.debugId}`:o.code,r=o.message;o.debugId&&(r=`${r}
|
|
26
26
|
|
|
27
|
-
Component DEBUG_ID = "${o.debugId}"`),t(r,n,e)},ai=o=>{let{debugId:e,key:t}=o,n=gg[t];if(n&&(cI({...n,debugId:e}),e&&t)){let r=ht.get(e);r&&r.getState().devToolsDetected&&n&&(r.getState().debugWarnings.set(t,{...n,debugId:e,status:"new"}),Qo(e))}};globalThis.logDevToolsWarning=ai;var Qo=o=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=ht.get(o);t&&e(o,t)};function yg(o){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:n}=o,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:u,groupBy:c,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:g,filterTypes:y,cursorId:h}=n,[b,T]=(0,at.useState)({vertical:!1,horizontal:!1}),S=(0,at.useRef)(b);(0,at.useEffect)(()=>(a.onChange(w=>{w&&(S.current=w,T(w))}),()=>a.destroy()),[a]),(0,at.useEffect)(()=>{if(!m)return;let w=requestAnimationFrame(()=>{S.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(w)},[g]),(0,at.useEffect)(()=>{if(!m||g!==void 0)return;let w=requestAnimationFrame(()=>{S.current?.vertical||h!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(w)},[i.length,g]),(0,at.useEffect)(()=>{let w=e(),{livePaginationCursor:x,livePagination:A,dataArray:E}=w;!b.vertical&&A&&(x?t.cursorId=x:x===void 0&&E.length&&(t.cursorId=E.length))},[b.vertical]);let C=(0,at.useMemo)(()=>ka(p,{filterTypes:y,filterMode:f}),[p,f,y]),I={sortInfo:u.sortInfo?s:null,groupBy:u.groupBy?c:null,pivotBy:u.pivotBy?d:null,refetchKey:l,filterValue:u.filterValue?C:null,cursorId:m?h:null},R=(0,at.useRef)(!0);dI(o,{sortInfo:s,groupBy:c,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?h:null});let v=Ii(),P=(0,at.useRef)([]);Rn(()=>{let w=e(),x=v(),{isDetail:A,isDetailReady:E}=Qs(x,e);if(A&&!E)return;let D=Date.now(),M=P.current;M.length>=10&&M.splice(0,1),M.push(D),D-M[0]<200&&M.length>=10&&ai({debugId:w.debugId,key:"DS001"}),typeof w.data!="function"&&Ro(w.data,w,t,void 0,x)},{data:r}),Rn(w=>{let x=Object.keys(w),A=!1;if(x.length===1){if(A=!!w.cursorId,w.filterValue&&e().filterMode==="local")return;let N=e().data;if(Array.isArray(N)&&w.refetchKey){t.originalDataArray=N;return}}let E=v(),{isDetail:D,isDetailReady:M}=Qs(E,e);if(D&&!M)return;let _=e();if(typeof _.data=="function"){let N;_.debugId&&(N=it(_.debugId).track.DataSource.label.RemoteDataLoad.start()),Ro(_.data,_,t,{append:A},E).then(()=>{N?.end()})}},{...I,data:r}),Rn(()=>{let w=e();if(R.current){R.current=!1;let x=Bt(w,void 0,v());t.dataParams=x}},I)}function dI(o,e){let{getDataSourceState:t,dataSourceActions:n,dataSourceState:r}=o;(0,at.useEffect)(()=>{n.lazyLoadCacheOfLoadedBatches=new te},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:u,groupRowsState:c,scrollStopDelayUpdatedByTable:d}=r,p=(0,at.useRef)(null),f=(g,y,h=t().lazyLoadCacheOfLoadedBatches)=>{let b=t();if(g=g||p.current,!g)return;let{renderStartIndex:T,renderEndIndex:S}=g,{lazyLoadBatchSize:C,lazyLoad:I}=b;I&&((!C||C<=0)&&(!b.groupBy||b.groupBy.length===0)||og({startIndex:T,endIndex:S,lazyLoadBatchSize:C,componentState:b,componentActions:n,dismissLoadedRows:y?.dismissLoadedRows??!1},h))},m=(0,at.useMemo)(()=>Mt(f,{wait:d}),[d]);Rn(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(y=>{p.current=y,f(y)})},{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:c}),(0,at.useEffect)(()=>{i&&i>0&&m()},[u])}function sr(o){let e=Mo(),t=Ii(),n=!!e,r=n?e.id:"master",{contextValue:i,ContextComponent:a}=lu(o),{componentActions:l,componentState:s,assignState:u}=i;s.getDataSourceMasterContextRef.current=t;let c=Fe(s),[d]=(0,ut.useState)(()=>Pm({getState:c,actions:l})),p={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:c,assignState:u,dataSourceApi:d},f=Fe(i),m=Fe(p),g=ks(),y=(0,ut.useCallback)(({children:h})=>{let b=Sa(),[T]=(0,ut.useState)(()=>fg());typeof h=="function"&&(h=h(c()));let S=m();return T.setSnapshot(S),(0,ut.useLayoutEffect)(()=>{T.notify()}),ut.default.createElement(a.Provider,{key:r,value:f()},ut.default.createElement(g.Provider,{value:S},ut.default.createElement(b.Provider,{value:T},h)))},[a,n,r]);return(0,ut.useLayoutEffect)(()=>{let h=t();h&&h.registerDetail(p)},[]),(0,ut.useLayoutEffect)(()=>()=>{let h=c();h.onCleanup(h)},[]),yg({dataSourceState:s,dataSourceActions:l,getDataSourceState:c}),(0,ut.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,ut.useEffect)(()=>{s.onReady?.(d)},[]),{DataSource:y,state:p.dataSourceState}}function bg(){return _e(o=>o.dataSourceApi)}var ja=class ja{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;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.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}};ja.DEFAULT_SIZE=10;var Wa=ja;var su=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},$a=class{constructor(e){this.storage=new Wa(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)}},uu=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)}},ur=class{constructor(e){this.cacheStorage=e===!1?new su:e===!0?new uu:typeof e=="number"?new $a(e):new $a(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 Sg=(e=>(e.INIT="INIT",e))(Sg||{});var{useManagedComponent:lu}=Ot({debugName:"DataSource",initSetupState:Vm,forwardProps:Hm,concludeReducer:eg,mapPropsToState:Bm,onPropChange:Wm,cleanup:Gm,interceptActions:$m(),mappedCallbacks:jm()});function pI(o){let{DataSource:e}=sr(o);return Tg.createElement(e,null,o.children??null)}function fI(){let{rowInfoReducerResults:o}=_e(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return o}function Ig(o){let{getDataSourceState:e}=_e(n=>({getDataSourceState:n.getDataSourceState}));return(0,Cg.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,u=o[i];return!u||!u.rowspan?1:u.rowspan({column:u,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[o])}var Rg=require("react");var bV=_t("useColumnSizeFn");function wg(o){return(0,Rg.useCallback)(t=>{let n=o[t];return n?n.computedWidth:0},[o])}var Wt=require("react");var mI={scrollLeft:0,scrollTop:0},li=class{constructor(){this.scrollPosition=mI;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 vg(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 Pg=W(require("react"));function Dg(o){return(e,t)=>Pg.createElement(o,{key:e.id,rowInfo:e,cache:t})}var si=class extends hn{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 u=l-s*this.pageWidth,c=[];for(let d=0;d<this.initialCols;d++)c.push(this.getItemSize(d,t));return a+=ra(u,c.concat(c)),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,u=typeof l=="number",c=typeof s=="number",d=u&&l!==this.availableWidth,p=c&&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,y=m&&r!==this.initialCols;f&&g&&(this.initialRows=n,this.rows=n),m&&y&&(this.initialCols=r,this.cols=r);let h=i!=null,b=a!=null,T=h&&i!==this.rowHeight,S=b&&a!==this.initialColWidth;h&&(this.rowHeight=i),b&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let C=g||T||p,I=y||S||d||C;(I||C)&&this.updateRenderCount({horizontal:I,vertical:C})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=ho){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=>{Ge(()=>{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}};function wn(){return{current:null}}var xg={};function cu(o){return`.${Qt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function du(o,e){let t=Wo(o),n=e?new si(t,{isHeader:!1}):new hn(t),r=`${t}:header`,i=e?new si(r,{isHeader:!0,masterBrain:n}):new hn(r);n.onScroll(c=>{i.setScrollPosition({scrollLeft:c.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=Xr(n),{renderer:s,onRenderUpdater:u}=Xr(i);return n.onAvailableSizeChange(c=>{i.update({width:c.width})}),{brain:n,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:u}}function Eg({debugId:o,wrapRowsHorizontally:e}){let t={},{brain:n,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=du(o,!!e),u=wn(),c=Date.now();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,updatedAt:c,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:d=>{if(!u.current)return null;let p=cu(d);return u.current.querySelector(p)||null},brain:n,headerBrain:r,domRef:u,columnMenuTargetRef:wn(),editingValueRef:wn(),scrollerDOMRef:wn(),portalDOMRef:wn(),focusDetectDOMRef:wn(),activeCellIndicatorDOMRef:wn(),onColumnMenuClick:Se(),cellContextMenu:Se(),contextMenu:Se(),onFilterOperatorMenuClick:Se(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:Se(),onRowHeightCSSVarChange:Se(),onRowDetailHeightCSSVarChange:Se(),onColumnHeaderHeightCSSVarChange:Se(),cellClick:Se(),cellMouseDown:Se(),keyDown:Se(),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 li,pinnedEndScrollListener:new li,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Ag=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,repaintCellsKey: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 ur(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??xg,columnGroupVisibility:e=>e??xg,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 gI(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 Mg=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 _g(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 Ua=new WeakMap;function Og(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Ng=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?vg(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=gI({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),u,c=e.rowDetailRenderer,d=e.components?.RowDetail;if(!c&&d){let y=Ua.get(d);y||(y=Dg(d),Ua.set(d,y)),c=y}c&&(u=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,u&&!(u instanceof Dt)&&(u=new Dt(u)),u=u||new Dt({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=u?e.isRowDetailExpanded:void 0;!f&&u&&(f=Ua.get(u),f||(f=y=>u.isRowDetailsExpanded(y.id),typeof u=="object"&&Ua.set(u,f)));let m=c?e.isRowDetailEnabled||!0:!1,g={updatedAt:Date.now(),isTree:r.isTree,rowDetailRenderer:c,rowDetailState:u,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||fe.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let y=To.get(t.debugId);y&&(g={...g,...y})}return g};function Fg(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 Lg(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,u=0,c=r.length;for(let d=0;d<c;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(u=Math.max(u,f.groupNesting-1),u===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>u&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var wo=W(require("react"));var kg=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;var Ya=W(require("react"));var zg="_16lm1iwb _16lm1iw1d _16lm1iwk";var Vg="164.93361431346415 56.97787143782138",Gg={margin:"auto",display:"block",shapeRendering:"auto"},XV=Object.keys({size:1,style:1,className:1,viewBox:1});var Hg=o=>Ya.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...Gg,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",className:oe(o.className,zg,"InfiniteIcon","InfiniteIcon-loading")},Ya.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:Vg},Ya.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));function Kg(o,e,t,n){let{groupByForColumn:r,groupIndexForColumn:i,groupRenderStrategy:a}=o,l=r.column?{...r.column}:{},s={header:`Group by ${r.field||r.groupField}`,groupByForColumn:r,render:n.getGroupColumnRender({groupIndexForColumn:i,groupRenderStrategy:a}),...l,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:l?.renderGroupIcon,groupIndexForColumn:i,toggleGroupRow:e,groupRenderStrategy:a})};return t&&(typeof t=="function"?s={...s,...t(o,e)}:s={...s,...t}),s}function Bg(o,e,t,n){let r=typeof t=="function"?t(o,e):t,i={};return o.sortable!=null&&(i.sortable=o.sortable),{...i,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...r,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:r?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function pu({groupIndexForColumn:o,groupRenderStrategy:e}){return t=>{let{rowInfo:n,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:u}=r,c=n,d=e==="multi-column"&&c.isGroupRow&&o+1!==c.groupNesting,p=oe(Ln.flex,i.align==="end"?Er.rowReverse:Er.row,Tc.center,`${Qt}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||u||d&&i.field)?_p({align:a}):null);return d?i.field?wo.createElement("div",{className:p},u,wo.createElement("div",{className:kt},l??null)):u?wo.createElement("div",{className:p},u):null:(e==="single-column"&&c.isGroupRow,wo.createElement("div",{className:p},s,u,wo.createElement("div",{className:kt},l??null)))}}function fu({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:u}=r,c=e!=="inline"?i:i.isGroupRow&&i.parents?.[o]||i;if(!c)return null;let d=c.collapsed;if(e==="inline"){if(c.groupCount===1)return a;if(c.groupNesting===o&&d)return null}else if(!c.isGroupRow||e==="multi-column"&&o+1!==c.groupNesting)return null;let p=c.groupKeys,f=null,m=s?(c.groupKeys?.length||0)<l?.length:(c.groupKeys?.length||0)<=l?.length;return kg(c)?f=wo.createElement(Hg,null):m&&(f=wo.createElement(dn,{expanded:!d,direction:u.align==="end"?"end":"start",onChange:()=>{t(p)}})),n&&(r.renderBag.groupIcon=f,f=wo.createElement(Ct,{render:n,renderParam:r})),f}}function Wg(){return{getGroupColumnRender:pu,getGroupColumnRenderGroupIcon:fu}}function jg(o,e,t){return Kg(o,e,t,Wg())}function $g(o,e,t){return Bg(o,e,t,Wg())}function Ug(o){let{pivotColumns:e,groupBy:t,pivotBy:n,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:u,toggleGroupRow:c,columns:d}=o;if(u==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(u==="multi-column")t.forEach((m,g,y)=>{let h=jg({groupByForColumn:m,groupBy:t,pivotBy:n,groupIndexForColumn:g,groupCount:y.length,groupRenderStrategy:u,selectionMode:r},c,i),b=h.id||`group-by-${m.field||m.groupField}`;f.push(b),p[b]=h});else if(u==="single-column"&&t.length){let m=$g({groupCount:t.length,groupBy:t,pivotBy:n,groupRenderStrategy:u,selectionMode:r},c,i),g=m.id||"group-by";f.push(g),p[g]=m}return e?Object.keys(e).forEach(m=>{let g=e[m],y=g.pivotTotalColumn&&g.columnGroup,h=g.pivotTotalColumn&&!g.columnGroup;if(y&&a===!1||h&&l===!1)return;let b={...g};s&&(typeof s=="function"?b={...b,...s({column:b,pivotBy:n,groupBy:t})}:b={...b,...s}),b.inheritFromColumn!==!1&&(b={...typeof b.inheritFromColumn=="string"?d[b.inheritFromColumn]:b.pivotAggregator?.field?rn(d,b.pivotAggregator.field):void 0,...b}),!b.render&&b.renderValue&&(b.render=T=>b.renderValue(T)),p[m]=b}):Object.keys(d).forEach(m=>{let g=d[m];p[m]=g}),{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}var Yg=require("react");function mu(){let{getDataSourceState:o,dataSourceActions:e,getDataSourceMasterContext:t}=_e(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return(0,Yg.useCallback)(r=>{let i=o(),a=new Rt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[Uo,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||Ro(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(c=>{i.lazyLoadCacheOfLoadedBatches.delete(c)}),e.lazyLoadCacheOfLoadedBatches=te.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Ht())}},[])}function hI(o){return(0,Wt.useMemo)(()=>_g(o),[o])}function qg(o,e){let{groupBy:t,dataSourceActions:n}=_e(u=>({groupBy:u.dataSourceState.groupBy,dataSourceActions:u.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=o;(0,Wt.useEffect)(()=>{n.generateGroupRows=r!=="inline"},[r]),(0,Wt.useEffect)(()=>{n.pivotTotalColumnPosition=i},[i]),(0,Wt.useEffect)(()=>{a!=null&&(n.pivotGrandTotalColumnPosition=a)},[a]);let l=hI(t);yI(l,o,e);let{toggleGroupRow:s}=bI();return SI(l,o,e),{toggleGroupRow:s}}function yI(o,e,t){let n=mu(),{columns:r,groupRenderStrategy:i,isTree:a}=e,l=t;function s(u,c,d,p){let f={};if(d==="inline")return Object.keys(u).forEach(m=>{let g=u[m],y={},h=c.get(g.field);if(h&&d==="inline"){let{groupIndex:T}=h;y={groupByForColumn:h.groupBy,field:h.groupBy?.field,valueGetter:h.groupBy?.valueGetter,valueFormatter:({rowInfo:S})=>S.isGroupRow?S.groupKeys?.[T]:S.value,rowspan:({rowInfo:S,dataArray:C})=>{if(S.isTreeNode||!S.isGroupRow)return 1;let I=C[S.indexInAll-1]||{indexInParentGroups:[]};if(!I||!I.dataSourceHasGrouping)return 1;let R=I.indexInParentGroups||[],v=S.indexInParentGroups||[],P=!1;for(let A=0;A<=T;A++){let E=R[A];if(v[A]!==E){P=!0;break}}if(!P)return 1;let w=S.parents[T];return w?w.groupCount-(w.collapsedChildrenCount||0)+(w.collapsedGroupsCount||0):1},renderGroupIcon:fu({groupIndexForColumn:T,groupRenderStrategy:d,toggleGroupRow:p,initialRenderGroupIcon:g.renderGroupIcon}),render:pu({groupIndexForColumn:T,groupRenderStrategy:d})}}let b={...y,...g};f[m]=b}),Object.keys(f).length===0?void 0:f}(0,Wt.useEffect)(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,o,i,n)})()},[r,o,i,n])}function bI(){let{groupBy:o,pivotBy:e,selectionMode:t}=_e(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d},getComponentState:p}=Nt(),f=mu();return(0,Wt.useEffect)(()=>{(()=>{let{columns:g,groupColumnIds:y}=Ug({columns:r,groupColumn:i,pivotColumn:u,pivotTotalColumnPosition:c,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(y.length&&Array.isArray(h)){let b=new Set(h),T=!1;y.forEach(S=>{b.has(S)||(T=!0,h=[S,...h])}),T&&(n.columnOrder=h)}})()},[r,o,e,t,a,i,l,s,c,u]),{toggleGroupRow:f}}function SI(o,e,t){let{dataArray:n,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=_e(y=>({getDataSourceState:y.getDataSourceState,dataArray:y.dataSourceState.dataArray,groupRowsIndexesInDataArray:y.dataSourceState.groupRowsIndexesInDataArray,groupBy:y.dataSourceState.groupBy,groupRowsState:y.dataSourceState.groupRowsState,originalLazyGroupDataChangeDetect:y.dataSourceState.originalLazyGroupDataChangeDetect})),{columnTypes:u,computedColumns:c,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}=e,m=t,g=Fe(e);(0,Wt.useLayoutEffect)(()=>{if(f!=="multi-column")return;let y=g(),h=Fg(c,o),b=Lg({computedGroupColumns:h,columnVisibility:y.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:r,dataArray:n,groupBy:i,groupByMap:o});bt(y.columnVisibility,b)||(m.columnVisibility=b)},[s,f,l,i,o,c,p?n:null,p?a:null,p?r:null,p]),(0,Wt.useEffect)(()=>{let y=i.length>0,h=g(),{columnVisibility:b,columnVisibilityForGrouping:T,hideColumnWhenGrouped:S}=h,C={...b},I={...T},R=!1,v=new Set,P=new Set;Object.keys(c).forEach(w=>{let x=c[w];if(x.defaultHiddenWhenGroupedBy||S!=null)if(x.defaultHiddenWhenGroupedBy==="*"&&y||(x.defaultHiddenWhenGroupedBy===!0||S)&&x.field&&o.get(x.field)||typeof x.defaultHiddenWhenGroupedBy=="string"&&o.get(x.defaultHiddenWhenGroupedBy)||typeof x.defaultHiddenWhenGroupedBy=="object"&&Object.keys(x.defaultHiddenWhenGroupedBy).reduce((E,D)=>E||o.has(D),!1)){if(I[w]!==!1){if(b[w]===!1)return;I[w]=!1,R=!0,v.add(w)}}else I[w]===!1&&(delete I[w],R=!0,P.add(w))}),R&&(m.columnVisibilityForGrouping=I,P.forEach(w=>{delete C[w]}),v.forEach(w=>{C[w]=!1}),m.columnVisibility=C)},[c,u,i,o,d])}var Xg=require("react");var Zg=({columns:o,userColumns:e,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,sortable:l,columnCssEllipsis:s,columnHeaderCssEllipsis:u,draggableColumns:c,columnDefaultDraggable:d,sortInfo:p,multiSort:f,filterValue:m,filterTypes:g,columnOrder:y,columnPinning:h,editable:b,columnDefaultEditable:T,columnDefaultFilterable:S,columnDefaultGroupable:C,columnDefaultSortable:I,scrollbarWidth:R,columnTypes:v,pinnedEndMaxWidth:P,pinnedStartMaxWidth:w,viewportReservedWidth:x,resizableColumns:A,columnVisibility:E,columnVisibilityAssumeVisible:D,columnSizing:M,groupBy:_})=>{let{computedRemainingSpace:L,computedColumnOrder:O,computedVisibleColumns:K,computedVisibleColumnsMap:j,computedPinnedStartColumns:k,computedPinnedEndColumns:Q,computedUnpinnedColumns:G,computedPinnedStartColumnsWidth:$,computedPinnedEndColumnsWidth:ie,computedUnpinnedColumnsWidth:pe,computedUnpinnedOffset:ue,computedPinnedEndOffset:le,computedPinnedEndWidth:de,computedPinnedStartWidth:ce,renderSelectionCheckBox:U,computedColumnsMap:z,computedColumnsMapInInitialOrder:q,fieldsToColumn:Y}=(0,Xg.useMemo)(()=>bd({columns:o,userColumns:e,scrollbarWidth:R,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,columnCssEllipsis:s,columnHeaderCssEllipsis:u,viewportReservedWidth:x,resizableColumns:A,filterValue:m,filterTypes:g,sortable:l,sortInfo:p,multiSort:f,pinnedEndMaxWidth:P,pinnedStartMaxWidth:w,draggableColumns:c,columnDefaultDraggable:d,columnOrder:y,columnPinning:h,columnDefaultEditable:T,columnDefaultFilterable:S,columnDefaultGroupable:C,columnDefaultSortable:I,editable:b,columnSizing:M,columnTypes:v,columnVisibility:E,columnVisibilityAssumeVisible:D??!0,groupBy:_}),[o,e,t.width,n,r,i,x,R,l,p,f,m,g,y,E,D,d,c,A,P,w,M,v,h,T,S,C,b,_,1]);return{renderSelectionCheckBox:U,columns:o,computedColumnsMap:z,computedPinnedEndWidth:de,computedPinnedStartWidth:ce,computedRemainingSpace:L,computedUnpinnedOffset:ue,computedPinnedEndOffset:le,computedPinnedStartColumnsWidth:$,computedPinnedEndColumnsWidth:ie,computedUnpinnedColumnsWidth:pe,computedPinnedStartColumns:k,computedPinnedEndColumns:Q,computedUnpinnedColumns:G,computedVisibleColumns:K,computedVisibleColumnsMap:j,computedColumnOrder:O,computedColumnsMapInInitialOrder:q,fieldsToColumn:Y}};var Jg=require("react");var qa=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 TI(o,e){let t=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=o;if(!r)return typeof n=="function"?c=>{if(e&&e.rowHeight.has(c))return e.rowHeight.get(c);let d=a().dataArray[c],p=d?n(d):0;return e&&e.rowHeight.set(c,p),p}:n;let l=typeof n=="function",s=typeof t=="function";return c=>{if(e&&e.rowHeight.has(c)&&e.rowDetailHeight.has(c))return e.rowHeight.get(c)+e.rowDetailHeight.get(c);let d=a().dataArray[c];if(!d)return e&&(e.rowHeight.set(c,0),e.rowDetailHeight.set(c,0)),0;let p=l?n(d):n;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,m)),p+m}}function Qg(o){let e=new qa;return{computedRowHeight:TI(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}}function eh(o){return(0,Jg.useMemo)(()=>Qg(o),[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}var cr=require("react");var CI={vertical:!1,horizontal:!1};function th(o){let e=o().brain,{getDataSourceState:t}=eo(),[n,r]=(0,cr.useState)(CI);return(0,cr.useEffect)(()=>e.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=e,l=i>0,s=a>0;r(u=>u.vertical===l&&u.horizontal===s?u:{vertical:l,horizontal:s})}),[e]),(0,cr.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=o(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function oh(o){let{state:e,actions:t,getState:n}=o,{columnOrder:r,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:u,columnDefaultFlex:c,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,columnVisibility:g,columnPinning:y,columnSizing:h,editable:b,columnDefaultEditable:T,columnDefaultFilterable:S,columnDefaultGroupable:C,columnTypes:I,rowHeight:R,rowDetailHeight:v,isRowDetailExpanded:P,isRowDetailEnabled:w,bodySize:x,showSeparatePivotColumnForSingleAggregation:A,onRowHeightCSSVarChange:E,onFlashingDurationCSSVarChange:D,onRowDetailHeightCSSVarChange:M,onColumnHeaderHeightCSSVarChange:_,computedColumns:N,initialColumns:L,viewportReservedWidth:O,resizableColumns:K,sortable:j,draggableColumns:k}=e,Q=t,{multiSort:G,filterValue:$,filterTypes:ie,groupBy:pe,sortInfo:ue,dataSourceActions:le,getDataSourceState:de,dataSourceApi:ce}=_e(se=>({dataSourceActions:se.dataSourceActions,getDataSourceState:se.getDataSourceState,dataSourceApi:se.dataSourceApi,sortInfo:se.dataSourceState.sortInfo,multiSort:se.dataSourceState.multiSort,filterValue:se.dataSourceState.filterValue,filterTypes:se.dataSourceState.filterTypes,groupBy:se.dataSourceState.groupBy}));(0,Jo.useState)(()=>{E.onChange(se=>{se&&(Q.rowHeight=se)}),D.onChange(se=>{let Ne=se?se*1:null;Ne!=null&&!isNaN(Ne)&&(Q.flashingDurationCSSVarValue=Ne)}),M.onChange(se=>{se&&(Q.rowDetailHeight=se)}),_.onChange(se=>{se&&(Q.columnHeaderHeight=se)})}),(0,Jo.useEffect)(()=>{le.showSeparatePivotColumnForSingleAggregation=A},[A]);let{toggleGroupRow:U}=qg(e,t),z=N,{computedColumnOrder:q,computedVisibleColumns:Y,computedVisibleColumnsMap:Z,computedPinnedStartColumns:X,computedPinnedEndColumns:me,computedUnpinnedColumns:he,computedPinnedStartColumnsWidth:ae,computedPinnedEndColumnsWidth:V,computedUnpinnedColumnsWidth:F,computedUnpinnedOffset:ge,computedPinnedEndOffset:xe,computedRemainingSpace:Ee,computedPinnedStartWidth:Ae,computedPinnedEndWidth:Me,renderSelectionCheckBox:He,computedColumnsMap:tt,computedColumnsMapInInitialOrder:Qe,fieldsToColumn:rt}=Zg({columns:z,userColumns:L,scrollbarWidth:void 0,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:u,columnDefaultFlex:c,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,bodySize:x,viewportReservedWidth:O,resizableColumns:K,sortable:j,draggableColumns:k,sortInfo:ue??void 0,multiSort:G,groupBy:pe,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:y,editable:b,columnDefaultEditable:T,columnDefaultFilterable:S,columnDefaultGroupable:C,filterValue:$,filterTypes:ie,columnSizing:h,columnTypes:I}),Je=Ig(Y),qe=wg(Y),B=th(n),ne=Ae?ae>Ae:!1,ye=Me?V>Me:!1,[Te]=(0,Jo.useState)(()=>new Ha({isRowDisabledAt:Ne=>de().dataArray[Ne]?.rowDisabled??!1,getIdForIndex:Ne=>de().dataArray[Ne]?.id??-1})),$e=Fe(Y),[H]=(0,Jo.useState)(()=>new Ga({getPrimaryKeyByIndex:ce.getPrimaryKeyByIndex,getColumnIdByIndex:se=>$e()[se]?.id||""})),{computedRowHeight:Xe,computedRowSizeCacheForDetails:Lt}=eh({rowDetailHeight:v,rowHeight:R,isRowDetailsExpanded:P,isRowDetailsEnabled:w,getDataSourceState:de});return(0,Jo.useMemo)(()=>({multiRowSelector:Te,multiCellSelector:H,computedRowSizeCacheForDetails:Lt,computedRowHeight:Xe,scrollbars:B,columnSize:qe,rowspan:Je,toggleGroupRow:U,computedColumnsMap:tt,computedColumnsMapInInitialOrder:Qe,renderSelectionCheckBox:He,computedPinnedStartOverflow:ne,computedPinnedEndOverflow:ye,computedPinnedStartWidth:Ae,computedPinnedEndWidth:Me,computedVisibleColumns:Y,computedColumnOrder:q,computedRemainingSpace:Ee,computedVisibleColumnsMap:Z,computedPinnedStartColumns:X,computedPinnedEndColumns:me,computedUnpinnedColumns:he,computedPinnedStartColumnsWidth:ae,computedPinnedEndColumnsWidth:V,computedUnpinnedColumnsWidth:F,computedUnpinnedOffset:ge,computedPinnedEndOffset:xe,fieldsToColumn:rt}),[Te,H,Lt,Xe,B,qe,Je,U,tt,Qe,He,ne,ye,Ae,Me,Y,q,Ee,Z,X,me,he,ae,V,F,ge,xe,rt])}var ih=require("react");function II(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 RI(){return 4294967295}function wI(o,e,t){return e=e>>>8^o[t^e&255],e}function vI(o){return o=~o,o=o<0?4294967295+o+1:o,o}function gu(o,e=3988292384){var t=II(e),n=0,r;for(n=RI(),r=0;r<o.length;r++)n=wI(t,n,o.charCodeAt(r));return n=vI(n),`${n}`}var PI=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")??""}},nh=(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))},rh=(o="",e,t)=>{let n;try{n=DI(o)}catch{return nh(["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?(nh([`
|
|
27
|
+
Component DEBUG_ID = "${o.debugId}"`),t(r,n,e)},li=o=>{let{debugId:e,key:t}=o,n=Cg[t];if(n&&(hI({...n,debugId:e}),e&&t)){let r=ht.get(e);r&&r.getState().devToolsDetected&&n&&(r.getState().debugWarnings.set(t,{...n,debugId:e,status:"new"}),Qo(e))}};globalThis.logDevToolsWarning=li;var Qo=o=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=ht.get(o);t&&e(o,t)};function Rg(o){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:n}=o,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:u,groupBy:c,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:g,filterTypes:h,cursorId:y}=n,[b,S]=(0,et.useState)({vertical:!1,horizontal:!1}),T=(0,et.useRef)(b);(0,et.useEffect)(()=>(a.onChange(x=>{x&&(T.current=x,S(x))}),()=>a.destroy()),[a]),(0,et.useEffect)(()=>{if(!m)return;let x=requestAnimationFrame(()=>{T.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(x)},[g]),(0,et.useEffect)(()=>{if(!m||g!==void 0)return;let x=requestAnimationFrame(()=>{T.current?.vertical||y!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(x)},[i.length,g]),(0,et.useEffect)(()=>{let x=e(),{livePaginationCursor:E,livePagination:P,dataArray:A}=x;!b.vertical&&P&&(E?t.cursorId=E:E===void 0&&A.length&&(t.cursorId=A.length))},[b.vertical]);let I=(0,et.useMemo)(()=>ag(),[])(p,h,f),R={sortInfo:u.sortInfo?s:null,groupBy:u.groupBy?c:null,pivotBy:u.pivotBy?d:null,refetchKey:l,filterValue:u.filterValue?I:null,cursorId:m?y:null},w=(0,et.useRef)(!0),D=(0,et.useRef)(!1);yI(o,{sortInfo:s,groupBy:c,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?y:null},D);let v=Ri(),M=(0,et.useRef)([]);Rn(()=>{let x=e(),E=v(),{isDetail:P,isDetailReady:A}=tu(E,e);if(P&&!A)return;let _=Date.now(),N=M.current;N.length>=10&&N.splice(0,1),N.push(_),_-N[0]<200&&N.length>=10&&li({debugId:x.debugId,key:"DS001"}),typeof x.data!="function"&&wo(x.data,x,t,void 0,E)},{data:r}),Rn(x=>{let E=Object.keys(x),P=!1;if(E.length===1){if(P=!!x.cursorId,x.filterValue&&e().filterMode==="local")return;let O=e().data;if(Array.isArray(O)&&x.refetchKey){t.originalDataArray=O;return}}let A=v(),{isDetail:_,isDetailReady:N}=tu(A,e);if(_&&!N)return;let F=e();if(typeof F.data=="function"){if(D.current&&!P&&lg(F))return;let O;F.debugId&&(O=at(F.debugId).track.DataSource.label.RemoteDataLoad.start()),wo(F.data,F,t,{append:P},A).then(()=>{O?.end()})}},{...R,data:r}),(0,et.useEffect)(()=>{D.current=!1}),Rn(()=>{let x=e();if(w.current){w.current=!1;let E=Bt(x,void 0,v());t.dataParams=E}},R)}function yI(o,e,t){let{getDataSourceState:n,dataSourceActions:r,dataSourceState:i}=o;(0,et.useEffect)(()=>{r.lazyLoadCacheOfLoadedBatches=new te},[i.data,i.dataParams]);let{lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,notifyRenderRangeChange:u,dataArray:c,groupRowsState:d,scrollStopDelayUpdatedByTable:p}=i,f=(0,et.useRef)(null),m=(h,y,b=n().lazyLoadCacheOfLoadedBatches)=>{let S=n();if(h=h||f.current,!h)return;let{renderStartIndex:T,renderEndIndex:C}=h,{lazyLoadBatchSize:I,lazyLoad:R}=S;R&&((!I||I<=0)&&(!S.groupBy||S.groupBy.length===0)||sg({startIndex:T,endIndex:C,lazyLoadBatchSize:I,componentState:S,componentActions:r,dismissLoadedRows:y?.dismissLoadedRows??!1},b))},g=(0,et.useMemo)(()=>_t(m,{wait:p}),[p]);Rn(h=>{if(l)return h.sortInfo||h.filterValue||h.groupBy||h.pivotBy||h.refetchKey||h.cursorId?(n().lazyLoadCacheOfLoadedBatches.clear(),n().originalLazyGroupData.clear(),m(u.get(),{dismissLoadedRows:!0}),t.current=!0):(h.originalLazyGroupDataChangeDetect||h.groupRowsState)&&m(u.get()),u.onChange(y=>{f.current=y,m(y)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:a,lazyLoad:l,originalLazyGroupDataChangeDetect:s,groupRowsState:d}),(0,et.useEffect)(()=>{a&&a>0&&g()},[c])}function sr(o){let e=_o(),t=Ri(),n=!!e,r=n?e.id:"master",{contextValue:i,ContextComponent:a}=cu(o),{componentActions:l,componentState:s,assignState:u}=i;s.getDataSourceMasterContextRef.current=t;let c=Fe(s),[d]=(0,ct.useState)(()=>Mm({getState:c,actions:l})),p={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:c,assignState:u,dataSourceApi:d},f=Fe(i),m=Fe(p),g=Vs(),h=(0,ct.useCallback)(({children:y})=>{let b=Ta(),[S]=(0,ct.useState)(()=>Sg());typeof y=="function"&&(y=y(c()));let T=m();return S.setSnapshot(T),(0,ct.useLayoutEffect)(()=>{S.notify()}),ct.default.createElement(a.Provider,{key:r,value:f()},ct.default.createElement(g.Provider,{value:T},ct.default.createElement(b.Provider,{value:S},y)))},[a,n,r]);return(0,ct.useLayoutEffect)(()=>{let y=t();y&&y.registerDetail(p)},[]),(0,ct.useLayoutEffect)(()=>()=>{let y=c();y.onCleanup(y)},[]),Rg({dataSourceState:s,dataSourceActions:l,getDataSourceState:c}),(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.dataSourceState}}function wg(){return Oe(o=>o.dataSourceApi)}var ja=class ja{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;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.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}};ja.DEFAULT_SIZE=10;var Wa=ja;var du=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},$a=class{constructor(e){this.storage=new Wa(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)}},pu=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)}},ur=class{constructor(e){this.cacheStorage=e===!1?new du:e===!0?new pu:typeof e=="number"?new $a(e):new $a(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 vg=(e=>(e.INIT="INIT",e))(vg||{});var{useManagedComponent:cu}=Nt({debugName:"DataSource",initSetupState:Bm,forwardProps:jm,concludeReducer:rg,mapPropsToState:Um,onPropChange:Ym,cleanup:Wm,interceptActions:Xm(),mappedCallbacks:qm()});function bI(o){let{DataSource:e}=sr(o);return Pg.createElement(e,null,o.children??null)}function SI(){let{rowInfoReducerResults:o}=Oe(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return o}function xg(o){let{getDataSourceState:e}=Oe(n=>({getDataSourceState:n.getDataSourceState}));return(0,Dg.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,u=o[i];return!u||!u.rowspan?1:u.rowspan({column:u,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[o])}var Eg=require("react");var PV=Ot("useColumnSizeFn");function Mg(o){return(0,Eg.useCallback)(t=>{let n=o[t];return n?n.computedWidth:0},[o])}var Wt=require("react");var TI={scrollLeft:0,scrollTop:0},si=class{constructor(){this.scrollPosition=TI;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 Ag(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 _g=W(require("react"));function Og(o){return(e,t)=>_g.createElement(o,{key:e.id,rowInfo:e,cache:t})}var ui=class extends hn{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 u=l-s*this.pageWidth,c=[];for(let d=0;d<this.initialCols;d++)c.push(this.getItemSize(d,t));return a+=ia(u,c.concat(c)),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,u=typeof l=="number",c=typeof s=="number",d=u&&l!==this.availableWidth,p=c&&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 y=i!=null,b=a!=null,S=y&&i!==this.rowHeight,T=b&&a!==this.initialColWidth;y&&(this.rowHeight=i),b&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let C=g||S||p,I=h||T||d||C;(I||C)&&this.updateRenderCount({horizontal:I,vertical:C})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=yo){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=>{He(()=>{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}};function wn(){return{current:null}}var Ng={};function fu(o){return`.${Jt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function mu(o,e){let t=Wo(o),n=e?new ui(t,{isHeader:!1}):new hn(t),r=`${t}:header`,i=e?new ui(r,{isHeader:!0,masterBrain:n}):new hn(r);n.onScroll(c=>{i.setScrollPosition({scrollLeft:c.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=Zr(n),{renderer:s,onRenderUpdater:u}=Zr(i);return n.onAvailableSizeChange(c=>{i.update({width:c.width})}),{brain:n,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:u}}function Fg({debugId:o,wrapRowsHorizontally:e}){let t={},{brain:n,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=mu(o,!!e),u=wn(),c=Date.now();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,updatedAt:c,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:d=>{if(!u.current)return null;let p=fu(d);return u.current.querySelector(p)||null},brain:n,headerBrain:r,domRef:u,columnMenuTargetRef:wn(),editingValueRef:wn(),scrollerDOMRef:wn(),portalDOMRef:wn(),focusDetectDOMRef:wn(),activeCellIndicatorDOMRef:wn(),onColumnMenuClick:Se(),cellContextMenu:Se(),contextMenu:Se(),onFilterOperatorMenuClick:Se(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:Se(),onRowHeightCSSVarChange:Se(),onRowDetailHeightCSSVarChange:Se(),onColumnHeaderHeightCSSVarChange:Se(),cellClick:Se(),cellMouseDown:Se(),keyDown:Se(),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 si,pinnedEndScrollListener:new si,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Lg=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,repaintCellsKey: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 ur(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??Ng,columnGroupVisibility:e=>e??Ng,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 CI(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 kg=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 zg(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 Ua=new WeakMap;function Vg(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Gg=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?Ag(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=CI({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),u,c=e.rowDetailRenderer,d=e.components?.RowDetail;if(!c&&d){let h=Ua.get(d);h||(h=Og(d),Ua.set(d,h)),c=h}c&&(u=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,u&&!(u instanceof xt)&&(u=new xt(u)),u=u||new xt({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=u?e.isRowDetailExpanded:void 0;!f&&u&&(f=Ua.get(u),f||(f=h=>u.isRowDetailsExpanded(h.id),typeof u=="object"&&Ua.set(u,f)));let m=c?e.isRowDetailEnabled||!0:!1,g={updatedAt:Date.now(),isTree:r.isTree,rowDetailRenderer:c,rowDetailState:u,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||fe.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let h=Co.get(t.debugId);h&&(g={...g,...h})}return g};function Hg(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 Kg(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,u=0,c=r.length;for(let d=0;d<c;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(u=Math.max(u,f.groupNesting-1),u===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>u&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var vo=W(require("react"));var Bg=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;var Ya=W(require("react"));var Wg="_16lm1iwb _16lm1iw1d _16lm1iwk";var jg="164.93361431346415 56.97787143782138",$g={margin:"auto",display:"block",shapeRendering:"auto"},rG=Object.keys({size:1,style:1,className:1,viewBox:1});var Ug=o=>Ya.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{...$g,...o.style},width:"24px",height:"24px",viewBox:o.viewBox??"0 0 100 100",preserveAspectRatio:"xMidYMid",className:oe(o.className,Wg,"InfiniteIcon","InfiniteIcon-loading")},Ya.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:jg},Ya.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));function Yg(o,e,t,n){let{groupByForColumn:r,groupIndexForColumn:i,groupRenderStrategy:a}=o,l=r.column?{...r.column}:{},s={header:`Group by ${r.field||r.groupField}`,groupByForColumn:r,render:n.getGroupColumnRender({groupIndexForColumn:i,groupRenderStrategy:a}),...l,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:l?.renderGroupIcon,groupIndexForColumn:i,toggleGroupRow:e,groupRenderStrategy:a})};return t&&(typeof t=="function"?s={...s,...t(o,e)}:s={...s,...t}),s}function qg(o,e,t,n){let r=typeof t=="function"?t(o,e):t,i={};return o.sortable!=null&&(i.sortable=o.sortable),{...i,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:n.getGroupColumnRender({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...r,renderGroupIcon:n.getGroupColumnRenderGroupIcon({initialRenderGroupIcon:r?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function gu({groupIndexForColumn:o,groupRenderStrategy:e}){return t=>{let{rowInfo:n,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:u}=r,c=n,d=e==="multi-column"&&c.isGroupRow&&o+1!==c.groupNesting,p=oe(Ln.flex,i.align==="end"?Er.rowReverse:Er.row,Rc.center,`${Jt}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||u||d&&i.field)?Lp({align:a}):null);return d?i.field?vo.createElement("div",{className:p},u,vo.createElement("div",{className:kt},l??null)):u?vo.createElement("div",{className:p},u):null:(e==="single-column"&&c.isGroupRow,vo.createElement("div",{className:p},s,u,vo.createElement("div",{className:kt},l??null)))}}function hu({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:u}=r,c=e!=="inline"?i:i.isGroupRow&&i.parents?.[o]||i;if(!c)return null;let d=c.collapsed;if(e==="inline"){if(c.groupCount===1)return a;if(c.groupNesting===o&&d)return null}else if(!c.isGroupRow||e==="multi-column"&&o+1!==c.groupNesting)return null;let p=c.groupKeys,f=null,m=s?(c.groupKeys?.length||0)<l?.length:(c.groupKeys?.length||0)<=l?.length;return Bg(c)?f=vo.createElement(Ug,null):m&&(f=vo.createElement(dn,{expanded:!d,direction:u.align==="end"?"end":"start",onChange:()=>{t(p)}})),n&&(r.renderBag.groupIcon=f,f=vo.createElement(It,{render:n,renderParam:r})),f}}function Xg(){return{getGroupColumnRender:gu,getGroupColumnRenderGroupIcon:hu}}function Zg(o,e,t){return Yg(o,e,t,Xg())}function Qg(o,e,t){return qg(o,e,t,Xg())}function Jg(o){let{pivotColumns:e,groupBy:t,pivotBy:n,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:u,toggleGroupRow:c,columns:d}=o;if(u==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(u==="multi-column")t.forEach((m,g,h)=>{let y=Zg({groupByForColumn:m,groupBy:t,pivotBy:n,groupIndexForColumn:g,groupCount:h.length,groupRenderStrategy:u,selectionMode:r},c,i),b=y.id||`group-by-${m.field||m.groupField}`;f.push(b),p[b]=y});else if(u==="single-column"&&t.length){let m=Qg({groupCount:t.length,groupBy:t,pivotBy:n,groupRenderStrategy:u,selectionMode:r},c,i),g=m.id||"group-by";f.push(g),p[g]=m}return e?Object.keys(e).forEach(m=>{let g=e[m],h=g.pivotTotalColumn&&g.columnGroup,y=g.pivotTotalColumn&&!g.columnGroup;if(h&&a===!1||y&&l===!1)return;let b={...g};s&&(typeof s=="function"?b={...b,...s({column:b,pivotBy:n,groupBy:t})}:b={...b,...s}),b.inheritFromColumn!==!1&&(b={...typeof b.inheritFromColumn=="string"?d[b.inheritFromColumn]:b.pivotAggregator?.field?rn(d,b.pivotAggregator.field):void 0,...b}),!b.render&&b.renderValue&&(b.render=S=>b.renderValue(S)),p[m]=b}):Object.keys(d).forEach(m=>{let g=d[m];p[m]=g}),{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}var eh=require("react");function yu(){let{getDataSourceState:o,dataSourceActions:e,getDataSourceMasterContext:t}=Oe(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return(0,eh.useCallback)(r=>{let i=o(),a=new wt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[Uo,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||wo(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(c=>{i.lazyLoadCacheOfLoadedBatches.delete(c)}),e.lazyLoadCacheOfLoadedBatches=te.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Ht())}},[])}function II(o){return(0,Wt.useMemo)(()=>zg(o),[o])}function th(o,e){let{groupBy:t,dataSourceActions:n}=Oe(u=>({groupBy:u.dataSourceState.groupBy,dataSourceActions:u.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=o;(0,Wt.useEffect)(()=>{n.generateGroupRows=r!=="inline"},[r]),(0,Wt.useEffect)(()=>{n.pivotTotalColumnPosition=i},[i]),(0,Wt.useEffect)(()=>{a!=null&&(n.pivotGrandTotalColumnPosition=a)},[a]);let l=II(t);RI(l,o,e);let{toggleGroupRow:s}=wI();return vI(l,o,e),{toggleGroupRow:s}}function RI(o,e,t){let n=yu(),{columns:r,groupRenderStrategy:i,isTree:a}=e,l=t;function s(u,c,d,p){let f={};if(d==="inline")return Object.keys(u).forEach(m=>{let g=u[m],h={},y=c.get(g.field);if(y&&d==="inline"){let{groupIndex:S}=y;h={groupByForColumn:y.groupBy,field:y.groupBy?.field,valueGetter:y.groupBy?.valueGetter,valueFormatter:({rowInfo:T})=>T.isGroupRow?T.groupKeys?.[S]:T.value,rowspan:({rowInfo:T,dataArray:C})=>{if(T.isTreeNode||!T.isGroupRow)return 1;let I=C[T.indexInAll-1]||{indexInParentGroups:[]};if(!I||!I.dataSourceHasGrouping)return 1;let R=I.indexInParentGroups||[],w=T.indexInParentGroups||[],D=!1;for(let x=0;x<=S;x++){let E=R[x];if(w[x]!==E){D=!0;break}}if(!D)return 1;let v=T.parents[S];return v?v.groupCount-(v.collapsedChildrenCount||0)+(v.collapsedGroupsCount||0):1},renderGroupIcon:hu({groupIndexForColumn:S,groupRenderStrategy:d,toggleGroupRow:p,initialRenderGroupIcon:g.renderGroupIcon}),render:gu({groupIndexForColumn:S,groupRenderStrategy:d})}}let b={...h,...g};f[m]=b}),Object.keys(f).length===0?void 0:f}(0,Wt.useEffect)(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,o,i,n)})()},[r,o,i,n])}function wI(){let{groupBy:o,pivotBy:e,selectionMode:t}=Oe(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d},getComponentState:p}=Ft(),f=yu();return(0,Wt.useEffect)(()=>{(()=>{let{columns:g,groupColumnIds:h}=Jg({columns:r,groupColumn:i,pivotColumn:u,pivotTotalColumnPosition:c,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:o,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});n.columnsWhenGrouping=g;let y=p().columnOrder;if(h.length&&Array.isArray(y)){let b=new Set(y),S=!1;h.forEach(T=>{b.has(T)||(S=!0,y=[T,...y])}),S&&(n.columnOrder=y)}})()},[r,o,e,t,a,i,l,s,c,u]),{toggleGroupRow:f}}function vI(o,e,t){let{dataArray:n,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=Oe(h=>({getDataSourceState:h.getDataSourceState,dataArray:h.dataSourceState.dataArray,groupRowsIndexesInDataArray:h.dataSourceState.groupRowsIndexesInDataArray,groupBy:h.dataSourceState.groupBy,groupRowsState:h.dataSourceState.groupRowsState,originalLazyGroupDataChangeDetect:h.dataSourceState.originalLazyGroupDataChangeDetect})),{columnTypes:u,computedColumns:c,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}=e,m=t,g=Fe(e);(0,Wt.useLayoutEffect)(()=>{if(f!=="multi-column")return;let h=g(),y=Hg(c,o),b=Kg({computedGroupColumns:y,columnVisibility:h.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:r,dataArray:n,groupBy:i,groupByMap:o});St(h.columnVisibility,b)||(m.columnVisibility=b)},[s,f,l,i,o,c,p?n:null,p?a:null,p?r:null,p]),(0,Wt.useEffect)(()=>{let h=i.length>0,y=g(),{columnVisibility:b,columnVisibilityForGrouping:S,hideColumnWhenGrouped:T}=y,C={...b},I={...S},R=!1,w=new Set,D=new Set;Object.keys(c).forEach(v=>{let M=c[v];if(M.defaultHiddenWhenGroupedBy||T!=null)if(M.defaultHiddenWhenGroupedBy==="*"&&h||(M.defaultHiddenWhenGroupedBy===!0||T)&&M.field&&o.get(M.field)||typeof M.defaultHiddenWhenGroupedBy=="string"&&o.get(M.defaultHiddenWhenGroupedBy)||typeof M.defaultHiddenWhenGroupedBy=="object"&&Object.keys(M.defaultHiddenWhenGroupedBy).reduce((E,P)=>E||o.has(P),!1)){if(I[v]!==!1){if(b[v]===!1)return;I[v]=!1,R=!0,w.add(v)}}else I[v]===!1&&(delete I[v],R=!0,D.add(v))}),R&&(m.columnVisibilityForGrouping=I,D.forEach(v=>{delete C[v]}),w.forEach(v=>{C[v]=!1}),m.columnVisibility=C)},[c,u,i,o,d])}var oh=require("react");var nh=({columns:o,userColumns:e,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,sortable:l,columnCssEllipsis:s,columnHeaderCssEllipsis:u,draggableColumns:c,columnDefaultDraggable:d,sortInfo:p,multiSort:f,filterValue:m,filterTypes:g,columnOrder:h,columnPinning:y,editable:b,columnDefaultEditable:S,columnDefaultFilterable:T,columnDefaultGroupable:C,columnDefaultSortable:I,scrollbarWidth:R,columnTypes:w,pinnedEndMaxWidth:D,pinnedStartMaxWidth:v,viewportReservedWidth:M,resizableColumns:x,columnVisibility:E,columnVisibilityAssumeVisible:P,columnSizing:A,groupBy:_})=>{let{computedRemainingSpace:F,computedColumnOrder:O,computedVisibleColumns:K,computedVisibleColumnsMap:j,computedPinnedStartColumns:k,computedPinnedEndColumns:Q,computedUnpinnedColumns:G,computedPinnedStartColumnsWidth:$,computedPinnedEndColumnsWidth:ie,computedUnpinnedColumnsWidth:pe,computedUnpinnedOffset:ue,computedPinnedEndOffset:le,computedPinnedEndWidth:de,computedPinnedStartWidth:ce,renderSelectionCheckBox:U,computedColumnsMap:z,computedColumnsMapInInitialOrder:q,fieldsToColumn:Y}=(0,oh.useMemo)(()=>Id({columns:o,userColumns:e,scrollbarWidth:R,bodySize:t,columnMinWidth:n,columnMaxWidth:r,columnDefaultWidth:i,columnDefaultFlex:a,columnCssEllipsis:s,columnHeaderCssEllipsis:u,viewportReservedWidth:M,resizableColumns:x,filterValue:m,filterTypes:g,sortable:l,sortInfo:p,multiSort:f,pinnedEndMaxWidth:D,pinnedStartMaxWidth:v,draggableColumns:c,columnDefaultDraggable:d,columnOrder:h,columnPinning:y,columnDefaultEditable:S,columnDefaultFilterable:T,columnDefaultGroupable:C,columnDefaultSortable:I,editable:b,columnSizing:A,columnTypes:w,columnVisibility:E,columnVisibilityAssumeVisible:P??!0,groupBy:_}),[o,e,t.width,n,r,i,M,R,l,p,f,m,g,h,E,P,d,c,x,D,v,A,w,y,S,T,C,b,_,1]);return{renderSelectionCheckBox:U,columns:o,computedColumnsMap:z,computedPinnedEndWidth:de,computedPinnedStartWidth:ce,computedRemainingSpace:F,computedUnpinnedOffset:ue,computedPinnedEndOffset:le,computedPinnedStartColumnsWidth:$,computedPinnedEndColumnsWidth:ie,computedUnpinnedColumnsWidth:pe,computedPinnedStartColumns:k,computedPinnedEndColumns:Q,computedUnpinnedColumns:G,computedVisibleColumns:K,computedVisibleColumnsMap:j,computedColumnOrder:O,computedColumnsMapInInitialOrder:q,fieldsToColumn:Y}};var ih=require("react");var qa=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 PI(o,e){let t=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=o;if(!r)return typeof n=="function"?c=>{if(e&&e.rowHeight.has(c))return e.rowHeight.get(c);let d=a().dataArray[c],p=d?n(d):0;return e&&e.rowHeight.set(c,p),p}:n;let l=typeof n=="function",s=typeof t=="function";return c=>{if(e&&e.rowHeight.has(c)&&e.rowDetailHeight.has(c))return e.rowHeight.get(c)+e.rowDetailHeight.get(c);let d=a().dataArray[c];if(!d)return e&&(e.rowHeight.set(c,0),e.rowDetailHeight.set(c,0)),0;let p=l?n(d):n;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(c,p),e.rowDetailHeight.set(c,m)),p+m}}function rh(o){let e=new qa;return{computedRowHeight:PI(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}}function ah(o){return(0,ih.useMemo)(()=>rh(o),[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}var cr=require("react");var DI={vertical:!1,horizontal:!1};function lh(o){let e=o().brain,{getDataSourceState:t}=to(),[n,r]=(0,cr.useState)(DI);return(0,cr.useEffect)(()=>e.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=e,l=i>0,s=a>0;r(u=>u.vertical===l&&u.horizontal===s?u:{vertical:l,horizontal:s})}),[e]),(0,cr.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=o(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function sh(o){let{state:e,actions:t,getState:n}=o,{columnOrder:r,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:u,columnDefaultFlex:c,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,columnVisibility:g,columnPinning:h,columnSizing:y,editable:b,columnDefaultEditable:S,columnDefaultFilterable:T,columnDefaultGroupable:C,columnTypes:I,rowHeight:R,rowDetailHeight:w,isRowDetailExpanded:D,isRowDetailEnabled:v,bodySize:M,showSeparatePivotColumnForSingleAggregation:x,onRowHeightCSSVarChange:E,onFlashingDurationCSSVarChange:P,onRowDetailHeightCSSVarChange:A,onColumnHeaderHeightCSSVarChange:_,computedColumns:N,initialColumns:F,viewportReservedWidth:O,resizableColumns:K,sortable:j,draggableColumns:k}=e,Q=t,{multiSort:G,filterValue:$,filterTypes:ie,groupBy:pe,sortInfo:ue,dataSourceActions:le,getDataSourceState:de,dataSourceApi:ce}=Oe(se=>({dataSourceActions:se.dataSourceActions,getDataSourceState:se.getDataSourceState,dataSourceApi:se.dataSourceApi,sortInfo:se.dataSourceState.sortInfo,multiSort:se.dataSourceState.multiSort,filterValue:se.dataSourceState.filterValue,filterTypes:se.dataSourceState.filterTypes,groupBy:se.dataSourceState.groupBy}));(0,Jo.useState)(()=>{E.onChange(se=>{se&&(Q.rowHeight=se)}),P.onChange(se=>{let _e=se?se*1:null;_e!=null&&!isNaN(_e)&&(Q.flashingDurationCSSVarValue=_e)}),A.onChange(se=>{se&&(Q.rowDetailHeight=se)}),_.onChange(se=>{se&&(Q.columnHeaderHeight=se)})}),(0,Jo.useEffect)(()=>{le.showSeparatePivotColumnForSingleAggregation=x},[x]);let{toggleGroupRow:U}=th(e,t),z=N,{computedColumnOrder:q,computedVisibleColumns:Y,computedVisibleColumnsMap:Z,computedPinnedStartColumns:X,computedPinnedEndColumns:me,computedUnpinnedColumns:he,computedPinnedStartColumnsWidth:ae,computedPinnedEndColumnsWidth:V,computedUnpinnedColumnsWidth:L,computedUnpinnedOffset:ge,computedPinnedEndOffset:xe,computedRemainingSpace:Ee,computedPinnedStartWidth:Me,computedPinnedEndWidth:Ae,renderSelectionCheckBox:Ke,computedColumnsMap:ot,computedColumnsMapInInitialOrder:Ze,fieldsToColumn:it}=nh({columns:z,userColumns:F,scrollbarWidth:void 0,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:u,columnDefaultFlex:c,columnDefaultSortable:d,columnDefaultDraggable:p,pinnedStartMaxWidth:f,pinnedEndMaxWidth:m,bodySize:M,viewportReservedWidth:O,resizableColumns:K,sortable:j,draggableColumns:k,sortInfo:ue??void 0,multiSort:G,groupBy:pe,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:h,editable:b,columnDefaultEditable:S,columnDefaultFilterable:T,columnDefaultGroupable:C,filterValue:$,filterTypes:ie,columnSizing:y,columnTypes:I}),Qe=xg(Y),qe=Mg(Y),B=lh(n),ne=Me?ae>Me:!1,ye=Ae?V>Ae:!1,[Te]=(0,Jo.useState)(()=>new Ha({isRowDisabledAt:_e=>de().dataArray[_e]?.rowDisabled??!1,getIdForIndex:_e=>de().dataArray[_e]?.id??-1})),lt=Fe(Y),[H]=(0,Jo.useState)(()=>new Ga({getPrimaryKeyByIndex:ce.getPrimaryKeyByIndex,getColumnIdByIndex:se=>lt()[se]?.id||""})),{computedRowHeight:ke,computedRowSizeCacheForDetails:yt}=ah({rowDetailHeight:w,rowHeight:R,isRowDetailsExpanded:D,isRowDetailsEnabled:v,getDataSourceState:de});return(0,Jo.useMemo)(()=>({multiRowSelector:Te,multiCellSelector:H,computedRowSizeCacheForDetails:yt,computedRowHeight:ke,scrollbars:B,columnSize:qe,rowspan:Qe,toggleGroupRow:U,computedColumnsMap:ot,computedColumnsMapInInitialOrder:Ze,renderSelectionCheckBox:Ke,computedPinnedStartOverflow:ne,computedPinnedEndOverflow:ye,computedPinnedStartWidth:Me,computedPinnedEndWidth:Ae,computedVisibleColumns:Y,computedColumnOrder:q,computedRemainingSpace:Ee,computedVisibleColumnsMap:Z,computedPinnedStartColumns:X,computedPinnedEndColumns:me,computedUnpinnedColumns:he,computedPinnedStartColumnsWidth:ae,computedPinnedEndColumnsWidth:V,computedUnpinnedColumnsWidth:L,computedUnpinnedOffset:ge,computedPinnedEndOffset:xe,fieldsToColumn:it}),[Te,H,yt,ke,B,qe,Qe,U,ot,Ze,Ke,ne,ye,Me,Ae,Y,q,Ee,Z,X,me,he,ae,V,L,ge,xe,it])}var dh=require("react");function xI(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 EI(){return 4294967295}function MI(o,e,t){return e=e>>>8^o[t^e&255],e}function AI(o){return o=~o,o=o<0?4294967295+o+1:o,o}function bu(o,e=3988292384){var t=xI(e),n=0,r;for(n=EI(),r=0;r<o.length;r++)n=MI(t,n,o.charCodeAt(r));return n=AI(n),`${n}`}var _I=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")??""}},uh=(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))},ch=(o="",e,t)=>{let n;try{n=OI(o)}catch{return uh(["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?(uh([`
|
|
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},DI=o=>{let e="",t=o.split("|").map(l=>{let[s,u]=l.split("=");return s==="C"&&(e=u),{name:s,value:u}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let u=t[s];if(gu(u.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(gu(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),PI(t)};var xI=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,EI=/(https):\/\/\S+(\.csb\.app)/g,ah=typeof window<"u"?window.location.origin:"",AI=()=>{let[o,e,t]=Array.from(xI.exec(ah)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},MI=()=>{let[o,e,t]=Array.from(EI.exec(ah)||[]);return e==="https"&&t===".csb.app"},_I=MI()||AI(),lh=(o="")=>{let t=!!Mo();return(0,ih.useMemo)(()=>{if(t)return!0;let r=rh(o,{publishedAt:1624970570587,version:"9.1.1"});return!o&&!r&&_I?!0:r},[o,t])};var dr=require("react");var OI=10;function sh(o,e,t){let n=(0,dr.useRef)(!1),r=(0,dr.useRef)(null);(0,dr.useEffect)(()=>{o!=null&&(n.current=!1,zt(r.current))},[o]),(0,dr.useEffect)(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,zt(r.current),r.current=Ge(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<OI&&a(l)})};var i=a;a()}return()=>{zt(r.current)}},[o,e])}var pr=require("react"),NI=10;function uh(o,e,t){let n=(0,pr.useRef)(!1),r=(0,pr.useRef)(null);(0,pr.useEffect)(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),(0,pr.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<NI&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}function ch(){return Ao()}var fr=require("react");function dh(o,e){hu(o,e),LI(o,e),e.detail===2&&FI(o,e),o.getState().onCellClick?.(o,e)}function FI(o,e){if(Bi(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 LI(o,e){let{getDataSourceState:t,getState:n,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=o,s=t(),{selectionMode:u,cellSelection:c}=s;if(!c||u!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=n(),{rowsPerPage:g}=f,y=p.length,h=new je(c);h.debugId=m??"",d.cellSelectionState=h;let b={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(b);else if(e.shiftKey){let T=!!n().wrapRowsHorizontally;d.multiSelectClick(b,T?{horizontalLayout:T,rowsPerPage:g,columnsPerSet:y}:{horizontalLayout:T})}else d.resetClick(b);l.cellSelection=h}function hu(o,e){let{rowIndex:t,getDataSourceState:n,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=o,{multiRowSelector:s,renderSelectionCheckBox:u}=r(),c=n(),{selectionMode:d,groupBy:p,dataArray:f,isTree:m}=c;if(p.length||m||f[t]?.rowDisabled)return!1;if(d==="multi-row"){if(u&&!e.key)return!1;let{rowSelection:y}=c;if(y=l(y),s.rowSelectionState=y,y&&typeof y=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=y,!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 ph(o,e){e.detail!==2&&void 0}var kI={Enter:!0," ":!0,a:!0};function fh(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=o,{key:u,ctrlKey:c,metaKey:d}=e;if(!kI[u])return!1;let p=t(),f=n(),{activeRowIndex:m,activeCellIndex:g,keyboardNavigation:y,keyboardSelection:h}=p,{selectionMode:b,groupBy:T,rowSelection:S,treeSelectionState:C,isTree:I}=f;if(h===!1)return!1;let R=y==="row"&&m!=null?m:y==="cell"&&g!=null?g[0]:null,v=R!=null?f.dataArray[R]:null;if(!v||R==null)return!1;if(b==="single-row"&&u===" ")return i.rowSelectionApi.toggleRowSelection(v.id),!0;if(b!=="multi-row")return!1;if(u==="a"&&(c||d)){if(I&&C){let w=s(C);return w.selectAll(),r.treeSelection=w,!0}let P=l(S);return P.selectAll(),r.rowSelection=P,!0}if(u===" "){if(T.length)return v.isGroupRow&&v.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(v.groupKeys):i.rowSelectionApi.toggleRowSelection(v.id),!0;if(I){if(v.isTreeNode&&v.nodePath)return a.treeApi.toggleNodeSelection(v.nodePath),!0}else{let P={key:e.key,metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,preventDefault:()=>e.preventDefault()},{renderSelectionCheckBox:w}=o.getComputed();return w&&(P.metaKey=!1,P.ctrlKey=!0),hu({...o,rowIndex:R},P)}}return!1}var mh=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),gh=o=>Array.from(o.querySelectorAll(mh)).filter(t=>!!t.offsetParent),Xa=o=>o.querySelector(mh);var yh=W(ln());async function hh(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 zI=10,VI=(o,e)=>o-e;function Za(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:u}=n(),{computedVisibleColumns:c,computedColumnsMap:d}=t(),p=c[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=u[o.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=mt(p.id,e);return p.contentFocusable({column:p,...Yn({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function yu(o,e,t){let n=t.getState().editingCell;return GI(o,e,t,{isCellFocusable:Za,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function bh(o,e,t){let n=(0,yh.default)(t,o+e,VI);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:t[n]??null}globalThis.getNextCol=bh;function GI(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(),u=o.rowIndex,c=o.colIndex;for(;u!=null||c!=null;){if(c=c===null?a[e===-1?a.length-1:0]:bh(c,e,a),c===null){if(u+=e,u<0||u>=s.length)return null;continue}if(i({colIndex:c,rowIndex:u},t))return{colIndex:c,rowIndex:u}}return null}async function Sh(o){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=Za(e,o)?e:yu(e,-1,o);if(t){await bu([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;Xa(n)?.focus()}}async function bu([o,e],t){let{api:n}=t;return new Promise((r,i)=>{let a=zI,l=null,s=!1;function u(c=0){c++,zt(l),l=Ge(async()=>{if(s=n.scrollCellIntoView(o,e,{offset:30}),!s&&c<a&&u(c),s){try{await hh(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(d){i(d);return}r(!0)}})}u()})}var HI=`.${Qt}`;function Th(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:zo(n,HI),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:c}=o.getState();[l,s]=c||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let u=i&&Za({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:yu({rowIndex:l,colIndex:s},t,o);if(!u){if(t===-1)r.focus();else{let c=gh(document.body),d=o.getState().focusDetectDOMRef.current,p=c.findIndex(m=>m===d);c[p+1]?.focus()}return!0}return bu([u.rowIndex,u.colIndex],o).then(()=>{let c=o.getState().getDOMNodeForCell(u);if(!c)return;Xa(c)?.focus()}),!0}var Ch={control:"ctrl"},Ih={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},KI={esc:"escape"},wh={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},vh=Object.keys(wh),Su=new Set(vh),BI=new Set(["shift","alt"]);function Qa(o,e){return Array.isArray(e)?e.some(t=>Rh(o,t)):Rh(o,e)}function Rh(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(p=>p.toLowerCase().trim()),r=n.find(p=>Ih[p]),i=n.map(p=>Ch[p]||Ih[p]||KI[p]||p),a=i.filter(p=>Su.has(p)),l=i.filter(p=>!Su.has(p)),s=vh.reduce((p,f)=>(p[f]=wh[f](o),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let u=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(u.length<a.length||u.filter(f=>!BI.has(f)).length)return!1}else if(a.length!=u.length)return!1;return!l.length||Su.has(t)||t==="meta"||Ch[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function Ph(o,e){let t={...o,cloneRowSelection:a=>va(a,o.getDataSourceState),cloneTreeSelection:a=>xa(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&&fh(t,e)&&e.preventDefault(),(Th(t,e)||!o.getState().focusedWithin&&!r.preventNavigation&&ag(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,s]=a,u=o.getComputed().computedVisibleColumns[s];u.computedEditable&&o.api.startEdit({rowIndex:l,columnId:u.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(!Qa(e,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,e);if(l&&l.stopNext)break}}function WI(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=Ke(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=eo();return(0,fr.useMemo)(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:c=>xa(c,i),cloneRowSelection:c=>va(c,i)}),[o,e,i,a,t,l,n])}function jI(){let o=WI();(0,fr.useEffect)(()=>{let e=o.getState().keyDown.onChange(a=>{Ph(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],u=mt(s.id,o);dh({...o,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:u},{...l,key:""})}let n=o.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:u}=a,c=o.getComputed().computedVisibleColumns[u],d=mt(c.id,o);ph({...o,rowIndex:s,colIndex:u,column:c,columnApi:d},l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function $I(){let{getState:o}=re(t=>({getState:t.getState}));return{onKeyDown:(0,fr.useCallback)(t=>{o().keyDown(t)},[])}}function Dh(){return jI(),$I()}var vu=require("react");var Be=W(require("react")),xt=require("react"),Nh=require("react-dom");var Ja="__is_infinite_menu_component";function Tu(o){return!!o.tagName}function Ah(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=Re.from(Tu(e)?e.getBoundingClientRect():e),a=Re.from(Tu(t)?t.getBoundingClientRect():t),l=n?Re.from(Tu(n)?n.getBoundingClientRect():n):null;if(!l)return{...xh({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let u=0,c=r.length;u<c;u++){let d=xh({anchorRect:a,targetRect:i,position:r[u],constrainRect:l});if(u===0&&(s={...d,index:0}),d.valid)return{...d,index:u}}return s}function xh(o){let e=Re.from(o.targetRect),t=Re.from(o.anchorRect),n=o.constrainRect?Re.from(o.constrainRect):null,{position:r}=o,[i,a]=r,l=Eh(e,i),s=Eh(t,a),u=l.getDistanceToPoint(s);e.shift(u);let c=n?n.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:c,distance:u}}function Eh(o,e){return e==="TopLeft"?We.from({top:o.top,left:o.left}):e==="TopCenter"?We.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?We.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?We.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?We.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?We.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?We.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?We.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):We.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)})}function UI(o){return o&&typeof o.then=="function"||o instanceof Promise}function _h(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function Mh(o){return typeof o=="function"&&(o=o()),UI(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&_h(o)&&(o=o.getBoundingClientRect()),o?Re.from(o):null}async function Oh(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)),_h(n)&&(r=n),r||null}return t(await e)}async function el(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 Mh(t)||void 0,a=n?await Mh(n):void 0,l=Re.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Ah({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let u=o.getBoundingClientRect();if(u.left!==s.left||u.top!==s.top){let c=o.offsetParent;if(c){let d=c.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 YI(o){return Be.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function qI(o){let e=Be.useRef(null);return(0,xt.useEffect)(()=>o.realign.onChange(t=>{e.current&&t&&el(e.current,t)}),[o.realign]),Be.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,xt.useCallback)(t=>{t&&el(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}function Fh(o,e){let[t,n]=(0,xt.useState)(null);return(0,xt.useLayoutEffect)(()=>{async function r(){let i=e?await Oh(e):null;i!=null&&n(i)}e&&r()},[e]),e?t?(0,Nh.createPortal)(o,t):Be.createElement(Be.Fragment,null):e===null||e===!1?o:Be.createElement(YI,null,o)}function XI(o){if(Be.Children.count(o)===1){let e=Be.Children.only(o);if(Be.isValidElement(e))return e.props.id||e.key}return null}function ZI(o,e,t){if(Be.Children.count(o)===1){let n=Be.Children.only(o);if(Be.isValidElement(n)&&n.type[Ja]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),Be.cloneElement(n,r)}}return o}function io(o){let e=o,[t]=(0,xt.useState)(()=>new Map),[n,r]=(0,xt.useState)(null),[i,a]=(0,xt.useState)(0),l=(0,xt.useCallback)(()=>{let m=[];for(let[g,y]of t)m.push(Be.createElement(qI,{...y,key:y.key}));return m},[]),[s,u]=Ut(),c=Fh(l(),o.portalContainer),d=(0,xt.useCallback)((m,g)=>{let h=`${g.id||XI(m)||Ht()}`,b=t.get(h),T=I=>()=>{let R=typeof I=="function"?I():I;return ZI(R,e.portalContainer,g.constrainTo??e.constrainTo)},S=T(m),C=(I,R)=>{if(!b)return;let v=T(I);Object.assign(b,{children:v}),u(),!!!R?.skipRealign&&(r(b.key),a(Date.now()))};return b?(Object.assign(b,g),C(m),C):(b={key:h,children:S,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:Se()},t.set(b.key,b),u(),C)},[t,e.portalContainer,u]);Be.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),u())},f=()=>{t.clear(),u()};return Be.useEffect(()=>{},[]),{portal:c,hideOverlay:p,clearAll:f,rerenderOverlays:u,showOverlay:d}}var ry=W(require("react"));var hr=W(require("react"));var Yh=W(require("react"));var $h=W(require("react"));function tl(o){return null}tl.defaultProps={__is_menu_item:!0};var Lh="submenu",QI="-";function kh(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Ht(),focused:!1,destroyed:!1,domRef:{current:null}}}function zh(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var Cu=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r,i)=>{let a=r&&(r.key!=null||r.label!=null)?r:null,l=a===null?r===QI?i.renderSeparator():r:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===e,active:a.key===t,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},JI=[{name:"label"}],Vh=(o,e)=>{let{props:t,state:n}=o,{activeItemKey:r,keyboardActiveItemKey:i}=n,{items:a,children:l,addSubmenuColumnIfNeeded:s,parentMenuId:u}=t,c=t.id||n.generatedId;u&&(c=`${u}-${c}`);let d=[...t.columns||JI],p={columns:d,keyboardActiveItemKey:i??null,activeItemKey:r??null,menuId:c},f=[];a?f=a.map(g=>Cu(p,g,e)):!a&&typeof l!="function"&&(f=e.childrenToRuntimeItems?e.childrenToRuntimeItems(p,l):[]),s&&f.filter(y=>y.type==="item"&&y.menu!=null).length>0&&!d.find(y=>y.name==Lh)&&d.push({name:Lh,render:e.renderSubmenuColumn});let m=f.filter(g=>g.type==="item"&&!g.disabled);return{runtimeItems:f,runtimeSelectableItems:m,columns:d,menuId:c}};var mr=W(require("react"));var Gh="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",Hh=be({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"]]}),Kh="db3arf1",Bh="db3arfd";function Wh(){return mr.createElement("hr",{className:Bh})}var ol={renderSeparator:()=>mr.createElement(Wh,null),renderSubmenuColumn:({domProps:o,item:e})=>e.menu?mr.createElement("div",{...o},mr.createElement(dn,{expanded:!1})):mr.createElement("div",{...o})};var jh=(o,e)=>Cu(o,e,ol);function Uh(o,e){return $h.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===tl)){let n={...t.props};return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),jh(o,n)}return jh(o,t)})||[]}function qh(){return{...kh(),domRef:Yh.createRef()}}var Xh=()=>zh(),Zh=o=>Vh(o,{...ol,childrenToRuntimeItems:Uh});var jt=W(require("react")),ct=require("react");function Qh(o,e){let t=Jh(o,e);if(!t.length)return null;let n=Re.from(t[0]?.getBoundingClientRect()),r=Re.from(t[t.length-1].getBoundingClientRect()),i=n;return i.width=r.left+r.width-n.left,i}function Jh(o,e){let t=zo(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 ey(o,e){let t=Jh(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}var ui=class extends jn{constructor(e){super(e.slice(0,3))}};var eR=250;function tR(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}Ge(i)};Ge(()=>{i()})})}var oR=Pe(),nl=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||eR;this.getPointerMoveTarget=()=>document.documentElement||oR;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 We({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,c=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(c-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=c,(s?new ui([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new ui([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,tR(()=>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 We({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 rl=require("react"),Iu=(0,rl.createContext)(null);function Ru(){return(0,rl.useContext)(Iu)}var gr=require("react");function ty(){let o=(0,gr.useRef)(!0);return(0,gr.useEffect)(()=>(o.current=!0,()=>{o.current=!1}),[]),(0,gr.useCallback)(()=>o.current,[])}function nR(o,e){let{parentMenuId:t,setSubmenuApi:n,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,u=`${t}-submenu`,c=o.menu;return c?(typeof c=="function"&&(c=c()),jt.createElement($t,{key:u,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a,...c,autoFocus:!1,onShow:(d,p)=>{c?.onShow?.(d,p),n(p)},onHideIntent:d=>{c?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}})):null}function rR({onItemActivate:o}){let{getState:e}=Ru(),[{onItemEnter:t,onItemLeave:n}]=(0,ct.useState)(()=>new nl({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?Re.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:(0,ct.useCallback)(t,[]),onItemLeave:(0,ct.useCallback)(n,[])}}function oy(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:u,wrapLabels:c,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:g},componentActions:y,getState:h}=Ru(),b=(0,ct.useCallback)(G=>{y.keyboardActiveItemKey=G},[]),T=(0,ct.useCallback)(G=>{y.activeItemKey=G},[]),S=ty(),[C,I]=(0,ct.useState)(null),R=null;(0,ct.useLayoutEffect)(()=>{let{runtimeItems:G}=h(),$=G.filter(ie=>ie.type==="item"&&i===ie.key)[0];if(!$||!$.menu){I(null),x();return}if($){let ie=Qh(r,$.key);ie&&P(()=>nR($,{constrainTo:l,setSubmenuApi:I,setActiveItemKey:T,setKeyboardActiveItemKey:b,parentMenuId:r,onHideIntent:K,api:j}),{id:`${r}-submenu`,alignTo:ie,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let v=(G,$)=>{b($.key),T($.key),$.originalMenuItem.onClick&&$.originalMenuItem.onClick(G);let ie={key:$.key,item:$.originalMenuItem,hideMenu:K};$.originalMenuItem.onAction&&$.originalMenuItem.onAction(ie),u&&u(ie),$.originalMenuItem.hideMenuOnAction&&K()},{showOverlay:P,portal:w,clearAll:x}=io({portalContainer:!1}),{onItemEnter:A,onItemLeave:E}=rR({onItemActivate:G=>{if(!S())return;let $=G?G.key:null;T($)}});R=n.map((G,$)=>jt.createElement(iR,{key:G.type==="item"?G.key:$,onItemEnter:(ie,pe)=>{A(ie.key,pe)},onItemLeave:(ie,pe)=>{E(ie.key,pe)},columns:t,active:G.type==="item"&&G.key===i,keyboardActive:G.type==="item"&&G.key===a,item:G,index:$,onClick:v}));let D=t.map(G=>G.width||(typeof G.flex=="number"?`${G.flex}fr`:G.flex)||"auto").join(" "),M={...e.style,gridTemplateColumns:D,gridTemplateRows:n.map(()=>"auto").join(" ")};c||(M.whiteSpace="nowrap");function _(G){let{runtimeItems:$,runtimeSelectableItems:ie}=h(),pe=$.findIndex(U=>U.type==="item"&&U.key===a),ue=a,le=$[pe],de={ArrowUp:()=>{let U=$.slice(0,pe).filter(z=>z.type==="item"&&!z.disabled).pop();U&&U.type==="item"&&U.key&&(ue=U.key)},ArrowDown:()=>{let U=$.slice(pe+1).filter(z=>z.type==="item"&&!z.disabled)[0];U&&U.type==="item"&&U.key&&(ue=U.key)},Home:()=>{de.PageUp()},End:()=>{de.PageDown()},PageUp:()=>{ue=ie[0].key},PageDown:()=>{ue=ie[ie.length-1].key},ArrowLeft:()=>{T(null),h().parentMenuId&&(y.destroyed=!0)},ArrowRight:()=>{le&&(T(le.key),Ge(()=>{S()&&C&&C.getParentMenuId()===h().menuId&&C.focus()}))},Enter:()=>{if(le)if(le.originalMenuItem?.menu){if(le&&le.originalMenuItem.menu&&C){de.ArrowLeft();return}le&&T(le.key)}else v(G,le)}," ":()=>{if(!le)return;le.originalMenuItem.menu||v(G,le);let U=ey(r,le.key);U&&U.click()},Escape:()=>{de.ArrowLeft();let U=h();U.parentMenuId||U.onHideIntent?.(U)}},ce=de[G.key];ce&&(ce(),G.preventDefault()),ue!=a&&b(ue)}function N(){y.focused=!1}let L=(0,ct.useCallback)(function(){y.focused=!0,setTimeout(()=>{O.current&&g.current&&g.current===document.activeElement&&h().keyboardActiveItemKey==null&&b(h().runtimeSelectableItems[0]?.key??null)})},[]),O=(0,ct.useRef)(!0),K=(0,ct.useCallback)(()=>{let G=h();G.onHideIntent?.(G)},[h]),[j]=(0,ct.useState)(()=>({hideMenu:K,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),L())},getMenuId:()=>h().menuId,getParentMenuId:()=>h().parentMenuId})),k=(0,ct.useCallback)(G=>{G?(g.current=G,d?.(h(),j),f&&j.focus()):(p?.(h()),g.current=G)},[]),Q=jt.createElement("div",{className:Ln.contents},jt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:k,onKeyDown:G=>{e.onKeyDown?.(G),_(G)},onMouseDown:G=>{O.current=!1,e.onMouseDown?.(G)},onMouseUp:G=>{O.current=!0,e.onMouseUp?.(G)},onFocus:L,onBlur:N,className:oe(Gh,e.className,"InfiniteMenu"),style:M},R),w);return s?null:Q}function iR(o){let[e,t]=jt.useState(!1),{columns:n,item:r,index:i,active:a,keyboardActive:l}=o,s=r.type==="item"?r.value.key:i,u=null;if(r.type==="decoration")u=jt.createElement("div",{style:r.style},r.value);else{let c=0;u=n.map((d,p)=>{let f=r.value,m=d.field||d.name,g=p+1,y=g+r.span;if(g<c)return null;c=y;let b={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:y},"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:oe(Hh({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||o.active}),r.className),onPointerEnter:T=>{r.disabled||o.onItemEnter?.(r,T)},onPointerLeave:T=>{r.disabled||o.onItemLeave?.(r,T)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:T=>{r.disabled||o.onClick(T,r)}};return d.render?jt.createElement(Gr,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:b}}):jt.createElement("div",{key:`${s}-${m}`,...b},f[m])}).filter(Boolean)}return jt.createElement("div",{className:Kh},u)}var{ManagedComponentContextProvider:aR}=Ot({initSetupState:qh,forwardProps:Xh,mapPropsToState:Zh,layoutEffect:!0});function lR(o){let{componentActions:e,componentState:t}=Nt(),n=Fe(t);return hr.createElement(Iu.Provider,{value:{componentActions:e,componentState:t,getState:n}},hr.createElement(oy,{domProps:o.domProps}))}function $t(o){let{children:e,portalContainer:t,items:n,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:u=!1,onAction:c,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:g,onHideIntent:y,__is_infinite_menu_component:h,...b}=o;return hr.createElement(aR,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:u,...o},hr.createElement(lR,{domProps:b}))}$t[Ja]=!0;var wu=W(require("react"));function ny(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 c=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{let m=an(p,e,"column-menu");c.push({key:f,label:m,check:wu.createElement(fo,{key:p.id,disabled:p.computedVisible&&i.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:g=>{let y=!!g;i.setVisibilityForColumn(p.id,y),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:c}}},"-",{key:"group-by",label:"Group by",menu:()=>{let c=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{if(p.groupByForColumn)return;let m=an(p,e,"column-menu");c.push({key:f,label:m,check:wu.createElement(fo,{key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:c}}}].filter(c=>!!c)}function iy(o,e,t){if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??$t,s=n().computedColumnsMap.get(o);if(!s)return null;let u={column:s,columnApi:mt(s.id,e),...e},c=ny([],u),d=a?a(c,u):c,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:ry.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}var sR=`[${Hr["data-name"]}="${Kr["data-name"]}"]`;function uR(o){let{columnId:e,context:t,clearAll:n,showOverlay:r}=o,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function u(){n(),a.columnMenuVisibleForColumnId=null}let c=o.target;if(c||(c=l.current??void 0,c&&!s.current.contains(c)&&(c=void 0)),!c){let d=`[${rm["data-column-id"]}="${e}"] ${sR}`;c=i().domRef.current.querySelector(d)}if(!c){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>iy(e,t,u),{constrainTo:s.current,id:"column-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function ay(){let o=Ke(),{getState:e,actions:t,columnMenuVisibleForColumnId:n,columnMenuVisibleKey:r}=re(u=>({getState:u.getState,actions:u.actions,columnMenuVisibleForColumnId:u.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:u.state.columnMenuVisibleKey})),{portalDOMRef:i}=uo(u=>({portalDOMRef:u.getMasterState().portalDOMRef}))||{},{showOverlay:a,portal:l,clearAll:s}=io({portalContainer:i?.current??!1});return(0,vu.useEffect)(()=>{let u=e();return u.onColumnMenuClick.onChange(c=>{c&&(u.columnMenuTargetRef.current=c.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=c.column.id)})},[]),(0,vu.useEffect)(()=>{let{columnMenuVisibleForColumnId:u,columnMenuTargetRef:c}=e();if(u){let p=function(f){f.__insideMenu!==!0&&(s(),t.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),uR({columnId:u,context:o,clearAll:s,showOverlay:a}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else c.current=null,s();return()=>{}},[n,r]),{menuPortal:l}}var ly=W(require("react")),sy=require("react");var cR={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function uy(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=Ke(),{getDataSourceState:a,getDataSourceMasterContext:l}=eo(),{focusDetectDOMRef:s}=o(),u=(0,sy.useCallback)(async()=>{Sh({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})},[]);return ly.createElement("div",{onFocus:u,ref:s,tabIndex:0,style:cR})}var yr=require("react");function dR(){let o=Ke(),{getState:e,editingCell:t}=re(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active?t.cancelled:void 0;(0,yr.useEffect)(()=>{if(n){let{onEditCancelled:r}=e(),i=e().editingCell;if(!r)return;let a=ri(o,i);if(!a){ii("onEditCancelled",i);return}r({...a,initialValue:i.initialValue})}},[n])}function pR(){let o=Ke(),{getState:e,editingCell:t}=re(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,yr.useEffect)(()=>{if(n){let{onEditRejected:r}=e(),i=e().editingCell;if(!r)return;let a=ri(o,i);if(!a){ii("onEditRejected",i);return}r({...a,value:i.value,error:n,initialValue:i.initialValue})}},[n])}function fR(){let o=Ke(),{editingCell:e}=re(r=>({editingCell:r.state.editingCell})),t=e?.active,n=No(t);(0,yr.useEffect)(()=>{!t&&n&&o.api.focus()},[t,n])}function mR(){let o=Ke(),{editingCell:e,getState:t}=re(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,yr.useEffect)(()=>{if(n){let{onEditAccepted:r}=t(),i=t().editingCell,{value:a,initialValue:l}=i;if(r){let s=ri(o,i);s?r({...s,value:a,initialValue:l}):ii("onEditAccepted",i)}o.api.persistEdit({value:a})}},[n])}function gR(){let o=Ke(),{editingCell:e,getState:t}=re(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e?e.persisted:void 0;(0,yr.useEffect)(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let l=n instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(!t()[l])return;let s=ri(o,r);if(!s){ii(l,r);return}let u={...s,value:r.value,initialValue:r.initialValue};n instanceof Error?i?.({...u,error:n}):a?.(u)}},[n])}function cy(){dR(),pR(),mR(),gR(),fR()}var xu=require("react");var en=W(require("react"));var Pu=W(require("react"));var il=o=>Pu.createElement(ze,{...o},Pu.createElement("path",{d:Ve.clear[0]}));var Du=W(require("react"));var dy=o=>Du.createElement(ze,{...o},Du.createElement("path",{d:Ve.done[0]}));function py(o,e,t){if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:u}=e,{components:c,getFilterOperatorMenuItems:d}=r(),p=c?.Menu??$t,f=n().computedColumnsMap.get(o);if(!f)return null;let m=R=>{R.__insideMenu=!0},g=R=>{R.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:y}=i(),h=y[f.computedFilterType];if(!h)return null;let b=h.operators.map(R=>{let v=R.name,P=f.computedFilterValue?f.computedFilterValue.filter.operator===v:v===h.defaultOperator,w=R.components?.Icon??zn;return{key:v,icon:en.createElement(w,null),label:en.createElement(en.Fragment,null,R.label??R.name),onAction:()=>{u.setColumnFilterOperator(o,v)},checked:P?en.createElement(dy,{size:16}):null}}),S=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{u.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:en.createElement(il,null),disabled:!f.computedFiltered,onAction:()=>{u.clearColumnFilter(o)}},"-"],...b],C={column:f,api:u,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:y},I=d?d(S,C):S;return en.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:I,onShow:R=>{R.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:R=>{g(R),t?.()}})}var al=10;function fy(){let{portalDOMRef:o}=uo(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},e=Ke(),{getState:t,actions:n}=e,{showOverlay:r,portal:i,clearAll:a}=io({portalContainer:o?.current??!1});return(0,xu.useEffect)(()=>t().onFilterOperatorMenuClick.onChange(s=>{if(!s)return;let{target:u,column:c}=s;function d(){a(),n.filterOperatorMenuVisibleForColumnId=null}let p=u?.parentElement||u,f=Re.from(p.getBoundingClientRect());f.top-=al,f.left-=al,f.width+=2*al,f.height+=2*al,r(()=>py(c.id,e,d),{constrainTo:t().domRef.current,id:"filter-operator-menu",alignTo:f,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),n.contextMenuVisibleFor=null,n.cellContextMenuVisibleFor=null,n.columnMenuVisibleForColumnId=null,n.filterOperatorMenuVisibleForColumnId=c.id}),[]),(0,xu.useEffect)(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.filterOperatorMenuVisibleForColumnId=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}var di=require("react");var Mu=W(require("react"));var Eu=W(require("react"));function ci(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 ll(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 Au(o,e,t){if(!o)return null;let n=Se();return o.then(r=>{let{items:i,columns:a}=ci(r);i&&i.length&&n(Eu.createElement(t,{...e,items:i||[],columns:a}))}),Eu.createElement(Bo,{updater:n})}function my(o,e,t){let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:u}=l(),c=s?.Menu??$t,{computedColumnsMap:d}=a(),p=d.get(n),f={...Zt({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!u)return{cellContext:f,menu:null,preventDefault:!1};let m=ll({onHideIntent:t}),g=u(f,e),y=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:f,menu:Au(g,m,c),preventDefault:y};let{items:h,columns:b}=ci(g);return!h||!h.length?{cellContext:f,menu:null,preventDefault:Array.isArray(h)}:{preventDefault:y,menu:Mu.createElement(c,{...m,columns:b,items:h}),cellContext:f}}function gy(o,e,t){let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=i?.Menu??$t,{computedColumnsMap:s}=r(),u=o.columnId?s.get(o.columnId):void 0,c=u?{...o,...Zt({...e,rowIndex:o.rowIndex,columnId:u.id})}:o;if(!a)return{cellContext:c,menu:null,preventDefault:!1};let d=ll({onHideIntent:t}),p=a(c,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:c,menu:Au(p,d,l),preventDefault:f};let{items:m,columns:g}=ci(p);return!m||!m.length?{cellContext:c,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:Mu.createElement(l,{...d,columns:g,items:m}),cellContext:c}}var sl=5,hy=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function yy(){let o=Ke(),{portalDOMRef:e}=uo(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=io({portalContainer:e?.current??!1});return(0,di.useEffect)(()=>{let{actions:l,getState:s,getDataSourceState:u}=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:y}=my(d,o,f),h=Re.fromPoint({top:p.clientY,left:p.clientX});h.width+=sl,h.height+=sl,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:h,alignPosition:hy}),y&&p.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:b}=s();b&&b({...g,getState:s,getDataSourceState:u},p)})},[]),(0,di.useEffect)(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.cellContextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function by(){let o=Ke(),{portalDOMRef:e}=uo(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=io({portalContainer:e?.current??!1});return(0,di.useEffect)(()=>{let{actions:l,getState:s}=o;return s().contextMenu.onChange(c=>{if(!c)return;let{event:d}=c;function p(){a(),l.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:g}=gy(c,o,p),y={top:d.clientY,left:d.clientX},h=Re.fromPoint(y);h.width+=sl,h.height+=sl,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:h,alignPosition:hy}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:y,...c};let{onContextMenu:b}=s();b&&b({...o,...m},d)})},[]),(0,di.useEffect)(()=>{let{contextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.contextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}var Sy=require("react"),Ty=W(require("react"));var ul=require("react");function cl(o,e){let{brain:t}=re(r=>({brain:r.state.brain})),n=(0,ul.useCallback)(o,e);(0,ul.useEffect)(()=>t.onScroll(n),[t,n])}var _u="yzx0vj0";function Cy(o){let{width:e,maxWidth:t,minWidth:n,scrollable:r,...i}=o,a=(0,Sy.useRef)(null);cl(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=fe.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=fe.runtime.bodyWidth),n==="column"?l.minWidth=fe.runtime.totalVisibleColumnsWidthValue:n==="viewport"&&(l.minWidth=fe.runtime.bodyWidth),t==="column"?l.maxWidth=fe.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=fe.runtime.bodyWidth),Ty.createElement("div",{ref:a,...i,className:i.className?oe(i.className,_u):_u,style:l},i.children)}var hR=J(ee.columnWidthAtIndex),yR=J(ee.columnOffsetAtIndex);function Iy(){let{computedVisibleColumns:o}=re(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return o.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${hR}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${yR}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var dl="InfiniteTable";var Ry=require("react");function wy(){let{getState:o,actions:e,dataSourceActions:t,getDataSourceState:n}=re(c=>({getState:c.getState,actions:c.actions,dataSourceActions:c.dataSourceActions,getDataSourceState:c.getDataSourceState})),{groupBy:r,isTree:i}=n(),a=o(),{brain:l,wrapRowsHorizontally:s}=a,u=a.repeatWrappedGroupRows;s||(u=!1),(0,Ry.useEffect)(()=>{if(!s){n().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let c=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=n(),g=!1,y=l.rowsPerPage,h=(r&&r.length>0||i)&&y>0?y:null;return f!=h&&(t.rowsPerPage=h,g=!0),m!=u&&(t.repeatWrappedGroupRows=u??!1,g=!0),g};c();let d,p=l.onVerticalRenderRangeChange(()=>{c()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,u])}var vn=require("react");function bR(){let o=[],e=t=>{Object.keys(t).forEach(n=>{let r=t[n];if(typeof r=="string"){let i=J(r);if(i.includes("dont-override"))return;o.push(i)}else r&&typeof r=="object"&&e(r)})};return e({...fe,loaded:void 0,runtime:void 0}),o}function vy(o){if(!o)return{};let e=bR(),t=getComputedStyle(o),n={};return e.forEach(r=>{n[r]=t.getPropertyValue(r).trim()}),n}var pi=be({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),Py="_143ofgf5",Dy="_143ofgf3";var SR=J(fe.loaded),Ou={source:"infinite-table-page",target:"infinite-table-devtools-background"};function xy(o,e){let{type:t,debugId:n}=o;if(t==="unmount")return{...Ou,url:Nu(),type:t,payload:{debugId:n}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...Ou,url:Nu(),type:t,payload:{debugId:n,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(u=>u.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(u=>[u.id,{field:u.field,dataType:u.computedDataType,sortType:u.computedSortType,filtered:u.computedFiltered,sorted:u.computedSorted,width:u.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(u=>u.field?`${u.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(u=>typeof u.field=="string").map(u=>({field:`${u.field}`,dir:u.dir,type:Array.isArray(u.type)?u.type[0]:u.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)},themeVars:vy(l.domRef.current),themeVarOverrides:{...no.get(n)||{}}}}}var Nu=pt(function(){let o=new URL(window.location.href);return o.origin+o.pathname});function TR(o){window.postMessage(o)}var CR=pt(()=>{console.log("Infinite Table DevTools detected!");let o=(e,t)=>{if(t){ht.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(xy({type:"update",debugId:e},t))}else hg(e),window.postMessage(xy({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=o,Ue.onLogIntent("IT:*",e=>{TR({...Ou,url:Nu(),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 Ey(){let{getState:o,getDataSourceState:e,dataSourceActions:t}=re(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),n=o(),{domRef:r,debugId:i}=n;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(SR)!==`${xd}`&&ai({debugId:i,key:"CSS001_CSS"}),(0,vn.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),wR()}var pl=Se(),IR={revertAll:o=>{let e=ht.get(o.debugId);if(e){let t=Xo.get(o.debugId);Xo.delete(o.debugId),To.delete(o.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let n=Io.get(o.debugId);Io.delete(o.debugId),Co.delete(o.debugId),n&&Object.keys(n).forEach(r=>{e.dataSourceActions[r]=n[r],delete n[r]})}},revertProperty:o=>{let e=ht.get(o.debugId);if(e){let t=o.property,n=To.get(o.debugId),r=Xo.get(o.debugId),i=Co.get(o.debugId),a=Io.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 u=Io.get(o.debugId)||{};delete i[s],e.dataSourceActions[s]=u[s],delete u[s]}}},discardWarning:o=>{let e=ht.get(o.debugId);if(e){let t=o.warning,n=e.getDataSourceState().debugWarnings;if(n.get(t))n.delete(t),Qo(o.debugId);else{let i=o.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),Qo(o.debugId))}}},discardAllWarnings:o=>{let e=ht.get(o.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),Qo(o.debugId))},setColumnVisibility:o=>{au(o.debugId,"columnVisibility",o.columnVisibility)},setGroupBy:o=>{Ba(o.debugId,"groupBy",o.groupBy)},setGroupRenderStrategy:o=>{au(o.debugId,"groupRenderStrategy",o.groupRenderStrategy)},setSortInfo:o=>{Ba(o.debugId,"sortInfo",o.sortInfo)},setMultiSort:o=>{Ba(o.debugId,"multiSort",o.multiSort)},setCssVar:o=>{let e=ht.get(o.debugId),t=e?.getState().domRef.current;!e||!t||!o.name?.startsWith("--infinite-")||(t.style.setProperty(o.name,o.value),no.set(o.debugId,{...no.get(o.debugId)||{},[o.name]:o.value}),Qo(o.debugId))},revertCssVar:o=>{let e=ht.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;t.style.removeProperty(o.name);let n={...no.get(o.debugId)||{}};delete n[o.name],no.set(o.debugId,n),Qo(o.debugId)},revertAllCssVars:o=>{let e=ht.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;let n=no.get(o.debugId)||{};Object.keys(n).forEach(r=>{t.style.removeProperty(r)}),no.delete(o.debugId),Qo(o.debugId)},highlight:o=>{let e=ht.get(o.debugId);if(e){let t=e.getState().domRef.current;if(t){let n=t.getBoundingClientRect(),r=document.querySelector(`.${pi.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(pi.classNames.base),r.innerHTML=[`<div class="${Dy}"></div>`,`<div class="${Py}"></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(pi.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(pi.classNames.variants.active.true)}}}}};function RR(){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__||(CR(),pl(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof o.data.type=="string")){let e=o.data.type,t=IR[e];t&&t(o.data.payload)}})}RR();function wR(){let{getState:o,getComputed:e,getDataSourceState:t,dataSourceActions:n,actions:r,dataSourceApi:i,api:a}=re(c=>({getState:c.getState,getComputed:c.getComputed,getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions,actions:c.actions,dataSourceApi:c.dataSourceApi,api:c.api})),s=o().debugId,u=(0,vn.useRef)(s);return u.current=s,(0,vn.useEffect)(()=>{let c=u.current;if(!c)return;let d=f=>{f(c,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})},p=pl.get();if(p){d(p);return}return pl.onChange(f=>{f&&d(f)})},[]),(0,vn.useEffect)(()=>{let c=u.current;if(!c)return;let d=pl.get();d&&d(c,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})}),(0,vn.useEffect)(()=>{if(s)return()=>{let c=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;c&&c(s,null)}},[s]),s}function Ay(){let{masterPortalDOMRef:o}=uo(n=>({masterPortalDOMRef:n.getMasterState().portalDOMRef}))??{},e=re(n=>n.state.portalDOMRef);return o?.current??e?.current}var Et=W(require("react")),zy=require("react");var My="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",_y=be({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),Oy="hs68h81",Ny=be({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 Pn=W(require("react"));function Fy(o){return Pn.createElement("div",{...o.domProps})}function Ly(o){let{active:e}=o;return Pn.createElement("div",{className:Oy},e?"Drop to group":"Drag columns to group")}function ky(o){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),o.onClear?.())};return Pn.createElement("div",{...o.domProps},o.label,Pn.createElement("div",{className:Di[1]}),Pn.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${o.field}`,className:My,onKeyDown:e,onMouseDown:o.onClear},Pn.createElement(il,{size:20})))}var vR=(o,e)=>t=>{e&&e(t);let n=Date.now(),r=!1,i=()=>{r=!0};Pe().addEventListener("mousemove",i,{once:!0}),Pe().addEventListener("mouseup",()=>{r||(Pe().removeEventListener("mousemove",i),Date.now()-n<200&&requestAnimationFrame(()=>{o()}))},{once:!0})};function PR(o){let{column:e,onClear:t,components:n,field:r,id:i,toggleSorting:a}=o,{dragSourceListId:l,dragItemId:s}=gn(),u=l===br,c=Ke(),d=(e?an(e.id,c,"grouping-toolbar"):r)??i,p=e?Et.createElement(Qi,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,f=Et.createElement(Et.Fragment,null,d,p),m=s===i&&l===br,g=oe(_y({draggingInProgress:u,active:m}),o.domProps?.className),y=vR(a,o.domProps?.onMouseDown),h={...o.domProps,className:g,onMouseDown:y},b=n?.ToolbarItem??ky;return Et.createElement(b,{active:m,domProps:h,column:e,field:r,label:f,onClear:t})}var br="grouping-toolbar";function Vy(o){let{groupBy:e}=_e(T=>({groupBy:T.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:n,api:r}=re(T=>({getComputed:T.getComputed,dataSourceApi:T.dataSourceApi,api:T.api})),{dropTargetListId:i,dragSourceListId:a}=po(),{fieldsToColumn:l,computedColumnsMap:s}=t(),u=i===br,c=a===br,d=o.components?.Placeholder??Ly,p=o.components?.Host??Fy,f=e.length?Et.createElement(Et.Fragment,null,e.map((T,S)=>{let C=T.field?l.get(T.field):void 0,I=`${T.field??`idx-${S}`}`;return Et.createElement(Ko.DraggableItem,{key:I,id:I},R=>Et.createElement(PR,{id:I,components:o.components,domProps:R,field:T.field,column:C,toggleSorting:()=>{C&&r.toggleSortingForColumn(C.id)},onClear:()=>{let v=e.filter(P=>P!==T).filter(Boolean);n.setGroupBy(v)}}))})):Et.createElement(d,{draggingInProgress:c,active:u,groupBy:e}),m=T=>{let S=T.map(C=>e[C]);n.setGroupBy(S)},g=T=>{let{dragItemId:S}=T,C=S,I=s.get(C);if(!I||!I.field||!I.computedGroupable)return;let R=[...e];R.splice(T.dropIndex,0,{field:I.field}),n.setGroupBy(R)},y=(0,zy.useCallback)(T=>{let{computedColumnsMap:S}=t(),C=T.dragItem.id,I=S.get(C);return!(!I||!I.computedGroupable||e.some(R=>R.field===I.field))},[e]),h=o.orientation??"horizontal",{domProps:b}=o;return Et.createElement(Ko,{orientation:h,dragListId:br,acceptDropsFrom:["header",br],onDrop:m,dragStrategy:"inline",onAcceptDrop:g,shouldAcceptDrop:y},(T,{draggingInProgress:S,status:C})=>{let I=oe(Ny({active:u,orientation:h,draggingInProgress:S,dropRejected:C==="rejected"}),T.className,b?.className),R={...T,...b,className:I,children:f};return Et.createElement(p,{active:u,rejectDrop:C==="rejected",domProps:R,orientation:h})})}var Tr=W(require("react"));var fl=require("react"),ao=require("react"),ml=W(require("react"));function Gy(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return ba(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}var vo=W(require("react"));var Hy=be({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var Fu=require("react");function DR(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 xR(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=Um(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 Ky(o,e){let t={current:!1};return{currentRowCache:{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)},cacheCalledByRowDetailRenderer:t}}function By(o){let{rowInfo:e,currentRowCache:t,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:r,masterActions:i,getMasterState:a}=o,l=r().detailDataSourcesStateToRestore.has(e.id)&&t.has(),u={registerDetail:pt(c=>{if(n.current||t.add({all:!0}),!t.has()){requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)});return}DR(e.id,{masterState:r(),detailContext:c}),requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)}),c.dataSourceState.onCleanup.onChange(()=>{let d=t.get();d&&xR(e.id,{detailState:c.getDataSourceState(),masterActions:i,masterState:r(),cacheEntryForRow:d})})}),shouldRestoreState:l};return u.masterRowInfo=e,u.getMasterDataSourceState=r,u.getMasterState=a,u}function Wy(o){let{rowDetailsCache:e,rowInfo:t}=o,{getDataSourceState:n,dataSourceActions:r}=_e(u=>({getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions})),{getMasterState:i}=re(u=>({getMasterState:u.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=(0,Fu.useMemo)(()=>Ky(t.id,e),[e,t.id]),s=(0,Fu.useMemo)(()=>By({rowInfo:t,currentRowCache:a,cacheCalledByRowDetailRenderer:l,getMasterDataSourceState:n,masterActions:r,getMasterState:i}),[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function jy(){return Ao()}var{rootClassName:ER}=ke,AR=`${ER}RowDetail`;function MR(o){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:n,rowInfo:r,detailOffset:i,rowDetailsCache:a}=o,{masterDetailContextValue:l,currentRowCache:s}=Wy({rowDetailsCache:a,rowInfo:r}),u=On(),[c]=vo.useState(()=>jy());return c.setSnapshot(l),vo.useLayoutEffect(()=>{c.notify()},[l]),vo.createElement(u.Provider,{value:c},vo.createElement("div",{ref:e,className:oe(AR,Hy({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${ee.bodyWidth} - ${ee.scrollbarWidthVertical})`,height:n}},t(r,s)))}var $y=vo.memo(MR);var _R=1;function Uy(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{actions:r,getState:i,getComputed:a,getDataSourceMasterContext:l,rowHeight:s,rowDetailHeight:u,onRowMouseEnter:c,onRowMouseLeave:d,groupRenderStrategy:p,brain:f,showZebraRows:m,rowDetailRenderer:g,isRowDetailsExpanded:y,isRowDetailsEnabled:h,cellClassName:b,cellStyle:T,repaintCellsKey:S,rowStyle:C,rowDetailCache:I,rowClassName:R,onScrollToTop:v,onScrollToBottom:P,onScrollStop:w,scrollToBottomOffset:x,wrapRowsHorizontally:A,updatedAt:E,ready:D,editingCell:M}=re(V=>({actions:V.actions,getState:V.getState,getComputed:V.getComputed,getDataSourceMasterContext:V.getDataSourceMasterContext,rowHeight:V.state.rowHeight,rowDetailHeight:V.state.rowDetailHeight,onRowMouseEnter:V.state.onRowMouseEnter,onRowMouseLeave:V.state.onRowMouseLeave,groupRenderStrategy:V.state.groupRenderStrategy,brain:V.state.brain,showZebraRows:V.state.showZebraRows,rowDetailRenderer:V.state.rowDetailRenderer,isRowDetailsExpanded:V.state.isRowDetailExpanded,isRowDetailsEnabled:V.state.isRowDetailEnabled,cellClassName:V.state.cellClassName,cellStyle:V.state.cellStyle,repaintCellsKey:V.state.repaintCellsKey,rowStyle:V.state.rowStyle,rowDetailCache:V.state.rowDetailCache,rowClassName:V.state.rowClassName,onScrollToTop:V.state.onScrollToTop,onScrollToBottom:V.state.onScrollToBottom,onScrollStop:V.state.onScrollStop,scrollToBottomOffset:V.state.scrollToBottomOffset,wrapRowsHorizontally:V.state.wrapRowsHorizontally,updatedAt:V.state.updatedAt,ready:V.state.ready,editingCell:V.state.editingCell})),{computedPinnedStartColumns:_,computedPinnedEndColumns:N,computedVisibleColumns:L,computedColumnsMap:O,computedColumnOrder:K,computedRowHeight:j,computedRowSizeCacheForDetails:k,fieldsToColumn:Q,rowspan:G,toggleGroupRow:$,columnSize:ie}=e,pe=(0,fl.useMemo)(()=>L.map(V=>V.id),[L]),{dataArray:ue,rowInfoStore:le,selectionMode:de,cellSelection:ce,isNodeReadOnly:U,getDataSourceState:z,dataSourceApi:q,dataSourceActions:Y}=_e(V=>({dataSourceApi:V.dataSourceApi,dataSourceActions:V.dataSourceActions,getDataSourceState:V.getDataSourceState,dataArray:V.dataSourceState.dataArray,rowInfoStore:V.dataSourceState.rowInfoStore,selectionMode:V.dataSourceState.selectionMode,cellSelection:V.dataSourceState.cellSelection,isNodeReadOnly:V.dataSourceState.isNodeReadOnly})),Z=Fe(ue);Gy({columnSize:ie,brain:f,computedPinnedStartColumns:_,computedPinnedEndColumns:N,computedVisibleColumns:L,computedRowHeight:j,dataArray:ue,bodySize:t,rowspan:G});let X=(0,ao.useRef)(0);(0,ao.useEffect)(()=>f.onRenderCountChange(()=>{X.current=f.scrollTopMax}),[f]),(0,ao.useEffect)(()=>f.onRenderRangeChange(V=>{i().onRenderRangeChange?.(V)}),[f]),(0,ao.useEffect)(()=>f.onScrollStop(V=>{let{scrollTop:F,scrollLeft:ge}=V;if(F===0&&v?.(),F+(x??_R)>=X.current){P?.();let{livePagination:Ae,livePaginationCursor:Me,dataArray:He}=z();Ae&&(Y.cursorId=Me!==void 0?Date.now():He.length)}if(w){let Ae=f.getRenderRange();w({scrollTop:F,scrollLeft:ge,renderRange:Ae,viewportSize:i().bodySize,firstVisibleRowIndex:Ae.start[0],lastVisibleRowIndex:Ae.end[0],firstVisibleColIndex:Ae.start[1],lastVisibleColIndex:Ae.end[1]})}}),[f,v,P,w]),(0,ao.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,ao.useEffect)(()=>{let{onReady:V}=i();V&&V({api:n,dataSourceApi:q})},[D]);let me=(0,fl.useMemo)(()=>({isNodeReadOnly:U,selectionMode:de,cellSelection:ce}),[U,de,ce]),he=(0,ao.useCallback)(V=>{let{rowIndex:F,colIndex:ge,heightWithRowspan:xe,domRef:Ee,hidden:Ae,width:Me,onMouseLeave:He,onMouseEnter:tt}=V,rt=Z()[F],Je=L[ge];if(!rt||!Je)return null;let qe=k?k.getRowHeight(F):xe,B=!1;!h||typeof h=="function"&&!h(rt)?B=!1:y&&(B=y(rt)?"expanded":"collapsed");let ne=A?f.getRowIndexInPage(F):null,ye=A?f.getPageIndexForRow(F):null,Te=n.isEditorVisibleForCell({rowIndex:F,columnId:Je.id}),$e={getData:Z,virtualized:!0,showZebraRows:m,groupRenderStrategy:p,rowIndexInHorizontalLayoutPage:ne,horizontalLayoutPageIndex:ye,rowIndex:F,rowInfoStore:le,hidden:Ae,toggleGroupRow:$,rowHeight:qe,rowDetailState:B,onMouseEnter:tt,onMouseLeave:He,onRowMouseEnter:c,onRowMouseLeave:d,domRef:Ee,width:Me,column:Je,columnsMap:O,fieldsToColumn:Q,rowStyle:C,rowClassName:R,cellStyle:T,cellClassName:b,repaintCellsKey:Je.repaintCellsKey!==void 0?Je.repaintCellsKey:S,visibleColumnIds:pe,computedColumnOrder:K,inEditMode:Te,getDataSourceState:z,dataSourceApi:q,dataSourceActions:Y,getState:i,imperativeApi:n,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:me};return ml.createElement(Hp,{...$e})},[s,u,c,d,k,j,y,Z,L,O,Q,p,A,$,m,f,le,C,R,b,T,S,z,q,Y,i,n,r,a,l,pe,K,E,M,me]),ae=(0,fl.useMemo)(()=>{if(y)return V=>{let{rowIndex:F,domRef:ge}=V,Ee=Z()[F];if(!Ee||!y(Ee)||!k)return ml.createElement("div",{ref:ge,className:Ec.hidden});let{rowDetailHeight:Ae,rowHeight:Me}=k.getSize(F);return ml.createElement($y,{rowInfo:Ee,rowDetailsCache:I,rowIndex:F,domRef:ge,detailOffset:Me,rowDetailHeight:Ae,rowDetailRenderer:g})}},[D,he,g,u,y,I]);return{renderCell:he,renderDetailRow:ae}}var Yy=require("react");function qy(){let{state:o,getState:e,actions:t}=re(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:n}=o,r=No(n);(0,Yy.useEffect)(()=>{if(r!==n){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let u=du(dl,!!n);t.brain=u.brain,t.headerBrain=u.headerBrain,t.renderer=u.renderer,t.onRenderUpdater=u.onRenderUpdater,t.headerRenderer=u.headerRenderer,t.headerOnRenderUpdater=u.headerOnRenderUpdater}},[r,n])}var Qy=W(require("react"));var Xy="_16lm1iw1 _16lm1iw1c _16lm1iwe";var Zy=oe(Xy,ds);function Jy(o){return Qy.createElement("div",{...o,className:o.className?oe(Zy,o.className):Zy})}var Sr=W(require("react"));var eb={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},tb="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",ob="qy58ya4";var{rootClassName:OR}=ke,Lu=`${OR}-LoadMask`;function NR(o){let{visible:e,children:t="Loading"}=o;return Sr.createElement("div",{className:`${eb[e?"visible":"hidden"]} ${Lu}`},Sr.createElement("div",{className:`${tb} ${Lu}-Overlay`}),Sr.createElement("div",{className:`${ob} ${Lu}-Text`},t))}var gl=Sr.memo(NR);var nb=require("react");var FR=[Op,`${Qt}--hovered`];function LR(o){return Array.isArray(o)&&(o=o.join(" ")),o.split(" ").map(e=>e.trim()).filter(Boolean)}function Dn(o){let e=Ke(),t=Mo(),{getComputed:n,api:r}=e,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:u,loadingText:c,columnReorderDragColumnId:d,scrollStopDelay:p,brain:f,scrollerDOMRef:m,components:g,bodySize:y,activeCellIndex:h,rowDetailRenderer:b,showHoverRows:T,wrapRowsHorizontally:S,domProps:C,domRef:I,forceBodyRerenderTimestamp:R,rowHoverClassName:v,ready:P}=re(k=>({ready:k.state.ready,columnReorderDragColumnId:k.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:k.state.forceBodyRerenderTimestamp,renderer:k.state.renderer,onRenderUpdater:k.state.onRenderUpdater,debugId:k.state.debugId,keyboardNavigation:k.state.keyboardNavigation,activeRowIndex:k.state.activeRowIndex,loadingText:k.state.loadingText,scrollStopDelay:k.state.scrollStopDelay,brain:k.state.brain,scrollerDOMRef:k.state.scrollerDOMRef,components:k.state.components,bodySize:k.state.bodySize,activeCellIndex:k.state.activeCellIndex,rowDetailRenderer:k.state.rowDetailRenderer,showHoverRows:k.state.showHoverRows,wrapRowsHorizontally:k.state.wrapRowsHorizontally,domProps:k.state.domProps,domRef:k.state.domRef,rowHoverClassName:k.state.rowHoverClassName})),w=g?.LoadMask??gl,x=n(),{computedRowHeight:A,computedRowSizeCacheForDetails:E}=x,D=E?.getRowHeight||A,{loading:M}=_e(k=>({loading:k.dataSourceState.loading})),_=Tr.useCallback(k=>{let Q=e.getState(),G=k.target;if(!t&&k._from_row_detail)return;t&&(k._from_row_detail=!0);let $=Dd(G,cu(),Q.domRef.current),ie,pe,ue,le;$&&(pe=Number($.dataset.colIndex),le=Number($.dataset.rowIndex),ie=e.getComputed().computedVisibleColumns[pe].id,ue=e.dataSourceApi.getRowInfoArray()[le].id);let de={columnId:ie,colIndex:pe,rowId:ue,rowIndex:le,event:k,target:$??k.target};$&&Q.cellContextMenu(de),Q.contextMenu(de)},[]),{renderCell:N,renderDetailRow:L}=Uy({imperativeApi:r,getComputed:n,domRef:I,bodySize:y,computed:x}),{autoFocus:O,tabIndex:K}=C??{};qy();let j=(0,nb.useMemo)(()=>{if(!T)return;let k=[];return v&&(k=k.concat(v)),o.rowHoverClassName&&(k=k.concat(o.rowHoverClassName)),Dn.rowHoverClassName&&(k=k.concat(Dn.rowHoverClassName)),LR(k)},[T,v,o.rowHoverClassName,Dn.rowHoverClassName]);return Tr.createElement(Jy,{onContextMenu:_},Tr.createElement(Hf,{forceRerenderTimestamp:R,debugId:l,tabIndex:K??0,autoFocus:O??void 0,activeRowIndex:P&&s==="row"?u:null,activeCellIndex:P&&s==="cell"&&!d?h:null,scrollStopDelay:p,renderer:i,wrapRowsHorizontally:S,onRenderUpdater:a,brain:f,activeCellRowHeight:D,renderCell:N,renderDetailRow:b?L:void 0,cellHoverClassNames:j,scrollerDOMRef:m,scrollVarHostRef:I}),Tr.createElement(w,{visible:M},c))}Dn.rowHoverClassName=FR;function rb(){return re(o=>o.api)}function ib(o){return re(e=>e.api.getColumnApi(o))}var ab=o=>`--infinite-${o}`;var lb=40,sb=ab(Ed);var Xt=ke.rootClassName,{ManagedComponentContextProvider:kR}=Ot({initSetupState:Eg,forwardProps:Ag,mapPropsToState:Ng,cleanup:Mg,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Og(),getParentState:()=>Ka(o=>o),debugName:o=>Wo(o.debugId,dl)}),ub=ve.memo(function(){let e=Ci(),{componentState:t,api:n,initialChildren:r}=re(O=>({componentState:O.state,api:O.api,initialChildren:O.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=_e(O=>({dataArrayLength:O.dataSourceState.dataArray.length,getDataSourceState:O.getDataSourceState,dataSourceActions:O.dataSourceActions,dataSourceApi:O.dataSourceApi})),{domRef:u,portalDOMRef:c,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:y,columnHeaderHeightCSSVar:h,scrollStopDelay:b,brain:T,activeRowIndex:S,activeCellIndex:C}=t,{licenseKey:I}=t;!I&&lo.licenseKey&&(I=lo.licenseKey),uh(S,i,n),sh(C,i,n);let{onKeyDown:R}=Dh();ve.useEffect(()=>{let O=a(),K=Mt(j=>{O.notifyRenderRangeChange({renderStartIndex:j[0],renderEndIndex:j[1]})},{wait:b});return T.onVerticalRenderRangeChange(K)},[T,b]);let v=lh(I),{autoFocus:P,tabIndex:w,...x}=t.domProps??{},A=Yd(x);ve.useEffect(()=>{T.setScrollStopDelay(b),l.scrollStopDelayUpdatedByTable=b},[b]),dg(),wy(),cy();let{menuPortal:E}=ay(),{menuPortal:D}=yy(),{menuPortal:M}=by(),{menuPortal:_}=fy();ve.useEffect(()=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(t.id,t.ready,n,{dataSourceApi:s})},[t.ready,n,s]);let N=Ey();ve.useEffect(()=>{if(e){let O=e.getSnapshot();c.current=O.getMasterState().portalDOMRef.current}},[]);let L=r??ve.createElement(ve.Fragment,null,ve.createElement(zs,null),ve.createElement(Dn,null));return ve.createElement("div",{"data-debug-id":N,onKeyDown:R,ref:u,...A},L,ve.createElement("div",{ref:c,className:oe(`${ft}Portal`,Ac[1e7],xi.absolute,Dc[0],wc[0])},E,D,M,_),g?ve.createElement(Pr,{key:"row-height",varName:g,onChange:d}):null,ve.createElement(Pr,{key:"flashing-duration",allowInts:!0,varName:fe.components.Cell.flashingDuration,onChange:p}),y?ve.createElement(Pr,{key:"row-detail-height",varName:y,onChange:f}):null,h?ve.createElement(Pr,{key:"column-header-height",varName:h,onChange:m}):null,v?null:ve.createElement(um,null),ve.createElement(uy,null))});function zR({children:o,store:e}){let{componentActions:t,componentState:n}=Nt(),{scrollerDOMRef:r,scrollTopKey:i}=n,a=Fe(n),l=oh({state:n,actions:t,getState:a}),s=Fe(l),u=Ci(),{getDataSourceState:c,dataSourceActions:d,getDataSourceMasterContext:p,dataSourceApi:f}=eo(),[m]=ve.useState(()=>ug({getComputed:s,getState:a,getDataSourceState:c,getDataSourceMasterContext:p,dataSourceApi:f,actions:t,dataSourceActions:d})),g={actions:t,state:n,computed:l,dataSourceActions:d,getDataSourceMasterContext:p,getDataSourceState:c,getComputed:s,getState:a,api:m,dataSourceApi:f,children:o};return e.setSnapshot(g),ve.useLayoutEffect(()=>{e.notify()}),hi(r,y=>{let h={width:y.width,height:y.height};t.bodySize=h},{earlyAttach:!0,debounce:50}),ve.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),ve.createElement(ub,null)}var lo=function(o){let[e]=ve.useState(()=>ch()),t=Fi();return ve.createElement(kR,{repeatWrappedGroupRows:!!o.wrapRowsHorizontally,rowHeight:lb,columnHeaderHeight:sb,...o},ve.createElement(Ki,null,ve.createElement(t.Provider,{value:e},ve.createElement(zR,{children:o.children,store:e}))))};lo.Header=zs;lo.Body=Dn;lo.HScrollSyncContent=Cy;lo.Footer=()=>ve.createElement(_c,null);lo.GroupingToolbar=Vy;var cb=W(require("react"));function VR(o){let{DataSource:e}=sr({nodesKey:"children",...o});return cb.createElement(e,null,o.children??null)}var db=W(require("react"));var ku=o=>(t,{unfilteredTreePaths:n,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new nt(i,{treePaths:n});r.forEachLeafNodePath((c,{selected:d})=>{l.setNodeSelection(c,d)}),a&&r.forEachLeafNodePath(c=>{l.setNodeSelection(c,a.selected)},a.nodePath);let u={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};o(u)};function pb(o){return db.createElement(lo,{...o})}var hl=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=Ue(`IT:${e}:DataQuery`)}};function xn(o){if(Array.isArray(o))return o.map(xn);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]=xn(i))}),JSON.stringify(n)}return o instanceof Date?o.toISOString():o}var Po=class Po{constructor(e){this.queryCache=new te;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=xn(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 hl(`${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=xn(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=xn(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=xn(e);this.queryCache.delete(t)};if(this.options=e,Po.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)}Po.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=Po.clients.get(e);t&&t.destroy()}static destroyAll(){Po.clients.forEach(e=>{Po.destroy(e.name)})}destroy(){Po.clients.delete(this.options.name)}};Po.clients=new Map;var zu=Po;var GR={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})})}}}},fb={instantEdit:GR};var HR=require("react");function mb(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 bl=class bl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??bl.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}};bl.DEFAULT_SIZE=10;var yl=bl;var Tl=class Tl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Tl.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}};Tl.DEFAULT_SIZE=10;var Sl=Tl;var En=require("react"),KR=(o,e)=>o.every((t,n)=>t===e[n]),gb=(o,e)=>{let t=(0,En.useRef)(e),n=KR(e,t.current),r=(0,En.useRef)(!0);t.current=e;let i=(0,En.useRef)(["same"]),a=n?[Date.now()]:i.current;i.current=a;let l=(0,En.useRef)(o);l.current=o,(0,En.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var tn=require("react"),hb=(o,e,t)=>o.every((n,r)=>t?t(n,e[r]):n===e[r]),Cl=(o,e)=>{let{same:t,different:n,compare:r}=e,i=(0,tn.useRef)(t),a=(0,tn.useRef)(n),l=hb(t,i.current,r),s=!hb(n,a.current,r),u=(0,tn.useRef)(!0);i.current=t,a.current=n;let c=(0,tn.useRef)(["same"]),d=l&&s?[Date.now()]:c.current;c.current=d;let p=(0,tn.useRef)(o);p.current=o,l&&s&&(u.current=!1),(0,tn.useEffect)(()=>{if(!u.current)return p.current()},d)};var At=W(require("react"));var yb=J(ee.currentFlashingDuration),BR=({children:o})=>At.createElement(At.Fragment,null,o),bb=1e3,Sb={up:Wi({direction:"up"}).split(" "),down:Wi({direction:"down"}).split(" "),neutral:Wi({direction:"neutral"}).split(" ")},Vu=(o={})=>{let{flashDuration:e,flashClassName:t,render:n=BR}=o;return At.forwardRef((i,a)=>{let l=Vr(),{flashingDurationCSSVarValue:s}=re(R=>({flashingDurationCSSVarValue:R.state.flashingDurationCSSVarValue})),u=typeof s=="number"?s??e??bb:e??bb,{domRef:c,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,y=p.id,h=At.useRef(!0),b=At.useRef(d),T=h.current?null:b.current;h.current=!1;let S=At.useRef(void 0),C=At.useRef(void 0),I=At.useRef(void 0);return Cl(()=>{if(d===b.current)return;let R=()=>{let x=m.current;if(S.current&&(clearTimeout(S.current),S.current=void 0),I.current&&(clearTimeout(I.current),I.current=void 0),C.current&&x){let A=C.current,E=Sb[A];x.classList.remove(...t?[t,...E]:E),x.style.removeProperty(yb),C.current=void 0}};b.current=d;let v=m.current;if(!v)return;R();let P=typeof d=="number"?d>T?"up":"down":"neutral",w=Sb[P];return v.style.setProperty(yb,`${u}`),v.classList.add(...t?[t,...w]:w),C.current=P,S.current=setTimeout(R,u),R},{same:[y,g],different:[d]}),At.createElement("div",{ref:c,...i,className:oe(i.className)},n({children:i.children,oldValue:T}))})},Tb=Vu();var et=W(require("react")),Cr=require("react");var Cb=require("react-dom");function Ib(o){let[e,t]=et.useState(null);return(0,Cr.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"?et.createElement(Rb.Provider,{value:{getState:e}},et.createElement(WR,null)):null}var Rb=et.createContext({getState:()=>null});function WR(){let o=et.useContext(Rb),{getState:e}=o,[,t]=Ut(),n=e().renderer.cellManager;(0,Cr.useEffect)(()=>{let s=Mt(()=>{console.log("rerender"),t()},{wait:500});return n.onCellAttachmentChange(s)},[n,t]);let r=n.getRowsWithCells(),i=n.getColumnsWithCells(),a=(0,Cr.useRef)(null),l=(0,Cr.useRef)(null);return et.createElement("div",{style:{overflow:"auto"}},(0,Cb.createPortal)(et.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),et.createElement("table",{style:{borderCollapse:"collapse"}},et.createElement("thead",null,et.createElement("tr",null,i.map(s=>et.createElement("th",{key:s,"data-col-index":s},s)))),et.createElement("tbody",null,r.map(s=>et.createElement("tr",{key:s,"data-row-index":s},i.map(u=>et.createElement("td",{key:u,style:{padding:5,border:"1px solid gray",background:n.getCellAt([s,u])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":u},et.createElement("button",{onClick:()=>{let c=n.getCellAt([s,u])?.getElement();if(!c)return;let d=c.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(c)},style:{cursor:"pointer"}},"(",s,",",u,")"))))))))}var jR={CheckBox:fo,LoadMask:gl,MenuIcon:Br,StringFilterEditor:Kn,NumberFilterEditor:ki};0&&(module.exports={AutoScroller,CellSelectionState,DRAG_ITEM_ATTRIBUTE,DataClient,DataSource,DataSourceActionType,DeepMap,DragDropProvider,DragInteractionTarget,DragList,FixedSizeSet,FlashingColumnCell,GroupRowsState,INTERNAL_MatrixDebugger,InfiniteTable,InfiniteTableClassName,InfiniteTableComponent,Menu,RowDetailCache,RowDetailState,RowDisabledState,RowSelectionState,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,WeakFixedSizeSet,alignNode,components,createDefaultProxy,createFlashingColumnCellComponent,debounce,debug,defaultDragProxyMove,defaultFilterTypes,eventMatchesKeyboardShortcut,filterDataArray,filterTypes,flatten,getComponentStateRoot,group,interceptMap,keyboardShortcuts,multisort,multisortNested,queryKeyToCacheKey,toTreeDataArray,useComponentState,useDataSourceApi,useDataSourceInternal,useDataSourceSelector,useDataSourceState,useDragDropProvider,useDragListContext,useEffectWhen,useEffectWhenSameDeps,useEffectWithChanges,useEffectWithObject,useGridScroll,useInfiniteColumnApi,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfinitePortalContainer,useInfiniteTableApi,useLayoutEffectWithChanges,useManagedDataSource,useMasterRowInfo,useOverlay,useOverlayPortal,usePrevious,useRowInfoReducers,useVisibleColumnSizes,withSelectedLeafNodesOnly});
|
|
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},OI=o=>{let e="",t=o.split("|").map(l=>{let[s,u]=l.split("=");return s==="C"&&(e=u),{name:s,value:u}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let u=t[s];if(bu(u.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(bu(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),_I(t)};var NI=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,FI=/(https):\/\/\S+(\.csb\.app)/g,ph=typeof window<"u"?window.location.origin:"",LI=()=>{let[o,e,t]=Array.from(NI.exec(ph)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},kI=()=>{let[o,e,t]=Array.from(FI.exec(ph)||[]);return e==="https"&&t===".csb.app"},zI=kI()||LI(),fh=(o="")=>{let t=!!_o();return(0,dh.useMemo)(()=>{if(t)return!0;let r=ch(o,{publishedAt:1624970570587,version:"9.1.3"});return!o&&!r&&zI?!0:r},[o,t])};var dr=require("react");var VI=10;function mh(o,e,t){let n=(0,dr.useRef)(!1),r=(0,dr.useRef)(null);(0,dr.useEffect)(()=>{o!=null&&(n.current=!1,zt(r.current))},[o]),(0,dr.useEffect)(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,zt(r.current),r.current=He(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<VI&&a(l)})};var i=a;a()}return()=>{zt(r.current)}},[o,e])}var pr=require("react"),GI=10;function gh(o,e,t){let n=(0,pr.useRef)(!1),r=(0,pr.useRef)(null);(0,pr.useEffect)(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),(0,pr.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<GI&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}function hh(){return Ao()}var fr=require("react");function yh(o,e){Su(o,e),KI(o,e),e.detail===2&&HI(o,e),o.getState().onCellClick?.(o,e)}function HI(o,e){if(Wi(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 KI(o,e){let{getDataSourceState:t,getState:n,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=o,s=t(),{selectionMode:u,cellSelection:c}=s;if(!c||u!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=n(),{rowsPerPage:g}=f,h=p.length,y=new $e(c);y.debugId=m??"",d.cellSelectionState=y;let b={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(b);else if(e.shiftKey){let S=!!n().wrapRowsHorizontally;d.multiSelectClick(b,S?{horizontalLayout:S,rowsPerPage:g,columnsPerSet:h}:{horizontalLayout:S})}else d.resetClick(b);l.cellSelection=y}function Su(o,e){let{rowIndex:t,getDataSourceState:n,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=o,{multiRowSelector:s,renderSelectionCheckBox:u}=r(),c=n(),{selectionMode:d,groupBy:p,dataArray:f,isTree:m}=c;if(p.length||m||f[t]?.rowDisabled)return!1;if(d==="multi-row"){if(u&&!e.key)return!1;let{rowSelection:h}=c;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 y=f[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(y):a.rowSelectionApi.selectRow(y)}return!1}function bh(o,e){e.detail!==2&&void 0}var BI={Enter:!0," ":!0,a:!0};function Sh(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=o,{key:u,ctrlKey:c,metaKey:d}=e;if(!BI[u])return!1;let p=t(),f=n(),{activeRowIndex:m,activeCellIndex:g,keyboardNavigation:h,keyboardSelection:y}=p,{selectionMode:b,groupBy:S,rowSelection:T,treeSelectionState:C,isTree:I}=f;if(y===!1)return!1;let R=h==="row"&&m!=null?m:h==="cell"&&g!=null?g[0]:null,w=R!=null?f.dataArray[R]:null;if(!w||R==null)return!1;if(b==="single-row"&&u===" ")return i.rowSelectionApi.toggleRowSelection(w.id),!0;if(b!=="multi-row")return!1;if(u==="a"&&(c||d)){if(I&&C){let v=s(C);return v.selectAll(),r.treeSelection=v,!0}let D=l(T);return D.selectAll(),r.rowSelection=D,!0}if(u===" "){if(S.length)return w.isGroupRow&&w.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(w.groupKeys):i.rowSelectionApi.toggleRowSelection(w.id),!0;if(I){if(w.isTreeNode&&w.nodePath)return a.treeApi.toggleNodeSelection(w.nodePath),!0}else{let D={key:e.key,metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,preventDefault:()=>e.preventDefault()},{renderSelectionCheckBox:v}=o.getComputed();return v&&(D.metaKey=!1,D.ctrlKey=!0),Su({...o,rowIndex:R},D)}}return!1}var Th=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Ch=o=>Array.from(o.querySelectorAll(Th)).filter(t=>!!t.offsetParent),Xa=o=>o.querySelector(Th);var Rh=W(ln());async function Ih(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 WI=10,jI=(o,e)=>o-e;function Za(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:u}=n(),{computedVisibleColumns:c,computedColumnsMap:d}=t(),p=c[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=u[o.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=mt(p.id,e);return p.contentFocusable({column:p,...Yn({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function Tu(o,e,t){let n=t.getState().editingCell;return $I(o,e,t,{isCellFocusable:Za,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function wh(o,e,t){let n=(0,Rh.default)(t,o+e,jI);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:t[n]??null}globalThis.getNextCol=wh;function $I(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(),u=o.rowIndex,c=o.colIndex;for(;u!=null||c!=null;){if(c=c===null?a[e===-1?a.length-1:0]:wh(c,e,a),c===null){if(u+=e,u<0||u>=s.length)return null;continue}if(i({colIndex:c,rowIndex:u},t))return{colIndex:c,rowIndex:u}}return null}async function vh(o){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=Za(e,o)?e:Tu(e,-1,o);if(t){await Cu([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;Xa(n)?.focus()}}async function Cu([o,e],t){let{api:n}=t;return new Promise((r,i)=>{let a=WI,l=null,s=!1;function u(c=0){c++,zt(l),l=He(async()=>{if(s=n.scrollCellIntoView(o,e,{offset:30}),!s&&c<a&&u(c),s){try{await Ih(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(d){i(d);return}r(!0)}})}u()})}var UI=`.${Jt}`;function Ph(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:zo(n,UI),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:c}=o.getState();[l,s]=c||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let u=i&&Za({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:Tu({rowIndex:l,colIndex:s},t,o);if(!u){if(t===-1)r.focus();else{let c=Ch(document.body),d=o.getState().focusDetectDOMRef.current,p=c.findIndex(m=>m===d);c[p+1]?.focus()}return!0}return Cu([u.rowIndex,u.colIndex],o).then(()=>{let c=o.getState().getDOMNodeForCell(u);if(!c)return;Xa(c)?.focus()}),!0}var Dh={control:"ctrl"},xh={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},YI={esc:"escape"},Mh={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},Ah=Object.keys(Mh),Iu=new Set(Ah),qI=new Set(["shift","alt"]);function Qa(o,e){return Array.isArray(e)?e.some(t=>Eh(o,t)):Eh(o,e)}function Eh(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(p=>p.toLowerCase().trim()),r=n.find(p=>xh[p]),i=n.map(p=>Dh[p]||xh[p]||YI[p]||p),a=i.filter(p=>Iu.has(p)),l=i.filter(p=>!Iu.has(p)),s=Ah.reduce((p,f)=>(p[f]=Mh[f](o),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let u=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(u.length<a.length||u.filter(f=>!qI.has(f)).length)return!1}else if(a.length!=u.length)return!1;return!l.length||Iu.has(t)||t==="meta"||Dh[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function _h(o,e){let t={...o,cloneRowSelection:a=>Pa(a,o.getDataSourceState),cloneTreeSelection:a=>Ea(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&&Sh(t,e)&&e.preventDefault(),(Ph(t,e)||!o.getState().focusedWithin&&!r.preventNavigation&&pg(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,s]=a,u=o.getComputed().computedVisibleColumns[s];u.computedEditable&&o.api.startEdit({rowIndex:l,columnId:u.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(!Qa(e,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,e);if(l&&l.stopNext)break}}function XI(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=Be(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=to();return(0,fr.useMemo)(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:c=>Ea(c,i),cloneRowSelection:c=>Pa(c,i)}),[o,e,i,a,t,l,n])}function ZI(){let o=XI();(0,fr.useEffect)(()=>{let e=o.getState().keyDown.onChange(a=>{_h(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],u=mt(s.id,o);yh({...o,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:u},{...l,key:""})}let n=o.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:u}=a,c=o.getComputed().computedVisibleColumns[u],d=mt(c.id,o);bh({...o,rowIndex:s,colIndex:u,column:c,columnApi:d},l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function QI(){let{getState:o}=re(t=>({getState:t.getState}));return{onKeyDown:(0,fr.useCallback)(t=>{o().keyDown(t)},[])}}function Oh(){return ZI(),QI()}var xu=require("react");var We=W(require("react")),Et=require("react"),Gh=require("react-dom");var Ja="__is_infinite_menu_component";function Ru(o){return!!o.tagName}function Lh(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=Re.from(Ru(e)?e.getBoundingClientRect():e),a=Re.from(Ru(t)?t.getBoundingClientRect():t),l=n?Re.from(Ru(n)?n.getBoundingClientRect():n):null;if(!l)return{...Nh({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let u=0,c=r.length;u<c;u++){let d=Nh({anchorRect:a,targetRect:i,position:r[u],constrainRect:l});if(u===0&&(s={...d,index:0}),d.valid)return{...d,index:u}}return s}function Nh(o){let e=Re.from(o.targetRect),t=Re.from(o.anchorRect),n=o.constrainRect?Re.from(o.constrainRect):null,{position:r}=o,[i,a]=r,l=Fh(e,i),s=Fh(t,a),u=l.getDistanceToPoint(s);e.shift(u);let c=n?n.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:c,distance:u}}function Fh(o,e){return e==="TopLeft"?je.from({top:o.top,left:o.left}):e==="TopCenter"?je.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?je.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?je.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?je.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?je.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?je.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?je.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):je.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)})}function JI(o){return o&&typeof o.then=="function"||o instanceof Promise}function zh(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function kh(o){return typeof o=="function"&&(o=o()),JI(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&zh(o)&&(o=o.getBoundingClientRect()),o?Re.from(o):null}async function Vh(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)),zh(n)&&(r=n),r||null}return t(await e)}async function el(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 kh(t)||void 0,a=n?await kh(n):void 0,l=Re.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Lh({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let u=o.getBoundingClientRect();if(u.left!==s.left||u.top!==s.top){let c=o.offsetParent;if(c){let d=c.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 eR(o){return We.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function tR(o){let e=We.useRef(null);return(0,Et.useEffect)(()=>o.realign.onChange(t=>{e.current&&t&&el(e.current,t)}),[o.realign]),We.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,Et.useCallback)(t=>{t&&el(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}function Hh(o,e){let[t,n]=(0,Et.useState)(null);return(0,Et.useLayoutEffect)(()=>{async function r(){let i=e?await Vh(e):null;i!=null&&n(i)}e&&r()},[e]),e?t?(0,Gh.createPortal)(o,t):We.createElement(We.Fragment,null):e===null||e===!1?o:We.createElement(eR,null,o)}function oR(o){if(We.Children.count(o)===1){let e=We.Children.only(o);if(We.isValidElement(e))return e.props.id||e.key}return null}function nR(o,e,t){if(We.Children.count(o)===1){let n=We.Children.only(o);if(We.isValidElement(n)&&n.type[Ja]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),We.cloneElement(n,r)}}return o}function ao(o){let e=o,[t]=(0,Et.useState)(()=>new Map),[n,r]=(0,Et.useState)(null),[i,a]=(0,Et.useState)(0),l=(0,Et.useCallback)(()=>{let m=[];for(let[g,h]of t)m.push(We.createElement(tR,{...h,key:h.key}));return m},[]),[s,u]=Ut(),c=Hh(l(),o.portalContainer),d=(0,Et.useCallback)((m,g)=>{let y=`${g.id||oR(m)||Ht()}`,b=t.get(y),S=I=>()=>{let R=typeof I=="function"?I():I;return nR(R,e.portalContainer,g.constrainTo??e.constrainTo)},T=S(m),C=(I,R)=>{if(!b)return;let w=S(I);Object.assign(b,{children:w}),u(),!!!R?.skipRealign&&(r(b.key),a(Date.now()))};return b?(Object.assign(b,g),C(m),C):(b={key:y,children:T,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:Se()},t.set(b.key,b),u(),C)},[t,e.portalContainer,u]);We.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),u())},f=()=>{t.clear(),u()};return We.useEffect(()=>{},[]),{portal:c,hideOverlay:p,clearAll:f,rerenderOverlays:u,showOverlay:d}}var cy=W(require("react"));var hr=W(require("react"));var ey=W(require("react"));var Qh=W(require("react"));function tl(o){return null}tl.defaultProps={__is_menu_item:!0};var Kh="submenu",rR="-";function Bh(){return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Ht(),focused:!1,destroyed:!1,domRef:{current:null}}}function Wh(){return{parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}}var wu=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r,i)=>{let a=r&&(r.key!=null||r.label!=null)?r:null,l=a===null?r===rR?i.renderSeparator():r:null;return a!=null?{type:"item",parentMenuId:n,disabled:!!a.disabled,keyboardActive:a.key===e,active:a.key===t,value:a,span:a.span||1,key:a.key,menu:a.menu||null,style:a.style,className:a.className,originalMenuItem:a}:{type:"decoration",value:l,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}},iR=[{name:"label"}],jh=(o,e)=>{let{props:t,state:n}=o,{activeItemKey:r,keyboardActiveItemKey:i}=n,{items:a,children:l,addSubmenuColumnIfNeeded:s,parentMenuId:u}=t,c=t.id||n.generatedId;u&&(c=`${u}-${c}`);let d=[...t.columns||iR],p={columns:d,keyboardActiveItemKey:i??null,activeItemKey:r??null,menuId:c},f=[];a?f=a.map(g=>wu(p,g,e)):!a&&typeof l!="function"&&(f=e.childrenToRuntimeItems?e.childrenToRuntimeItems(p,l):[]),s&&f.filter(h=>h.type==="item"&&h.menu!=null).length>0&&!d.find(h=>h.name==Kh)&&d.push({name:Kh,render:e.renderSubmenuColumn});let m=f.filter(g=>g.type==="item"&&!g.disabled);return{runtimeItems:f,runtimeSelectableItems:m,columns:d,menuId:c}};var mr=W(require("react"));var $h="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",Uh=be({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"]]}),Yh="db3arf1",qh="db3arfd";function Xh(){return mr.createElement("hr",{className:qh})}var ol={renderSeparator:()=>mr.createElement(Xh,null),renderSubmenuColumn:({domProps:o,item:e})=>e.menu?mr.createElement("div",{...o},mr.createElement(dn,{expanded:!1})):mr.createElement("div",{...o})};var Zh=(o,e)=>wu(o,e,ol);function Jh(o,e){return Qh.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===tl)){let n={...t.props};return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),Zh(o,n)}return Zh(o,t)})||[]}function ty(){return{...Bh(),domRef:ey.createRef()}}var oy=()=>Wh(),ny=o=>jh(o,{...ol,childrenToRuntimeItems:Jh});var jt=W(require("react")),dt=require("react");function ry(o,e){let t=iy(o,e);if(!t.length)return null;let n=Re.from(t[0]?.getBoundingClientRect()),r=Re.from(t[t.length-1].getBoundingClientRect()),i=n;return i.width=r.left+r.width-n.left,i}function iy(o,e){let t=zo(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 ay(o,e){let t=iy(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}var ci=class extends jn{constructor(e){super(e.slice(0,3))}};var aR=250;function lR(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}He(i)};He(()=>{i()})})}var sR=Pe(),nl=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||aR;this.getPointerMoveTarget=()=>document.documentElement||sR;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=e=>{if(clearTimeout(this.mouseMoveTimeoutId),!e){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let t=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=t);let r=t-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=t;let i=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e)};if(r){i();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&i()},this.getTimeout());let l=new je({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,c=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(c-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=c,(s?new ci([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new ci([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,lR(()=>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 je({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 rl=require("react"),vu=(0,rl.createContext)(null);function Pu(){return(0,rl.useContext)(vu)}var gr=require("react");function ly(){let o=(0,gr.useRef)(!0);return(0,gr.useEffect)(()=>(o.current=!0,()=>{o.current=!1}),[]),(0,gr.useCallback)(()=>o.current,[])}function uR(o,e){let{parentMenuId:t,setSubmenuApi:n,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,u=`${t}-submenu`,c=o.menu;return c?(typeof c=="function"&&(c=c()),jt.createElement($t,{key:u,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a,...c,autoFocus:!1,onShow:(d,p)=>{c?.onShow?.(d,p),n(p)},onHideIntent:d=>{c?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}})):null}function cR({onItemActivate:o}){let{getState:e}=Pu(),[{onItemEnter:t,onItemLeave:n}]=(0,dt.useState)(()=>new nl({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?Re.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:(0,dt.useCallback)(t,[]),onItemLeave:(0,dt.useCallback)(n,[])}}function sy(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:u,wrapLabels:c,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:g},componentActions:h,getState:y}=Pu(),b=(0,dt.useCallback)(G=>{h.keyboardActiveItemKey=G},[]),S=(0,dt.useCallback)(G=>{h.activeItemKey=G},[]),T=ly(),[C,I]=(0,dt.useState)(null),R=null;(0,dt.useLayoutEffect)(()=>{let{runtimeItems:G}=y(),$=G.filter(ie=>ie.type==="item"&&i===ie.key)[0];if(!$||!$.menu){I(null),M();return}if($){let ie=ry(r,$.key);ie&&D(()=>uR($,{constrainTo:l,setSubmenuApi:I,setActiveItemKey:S,setKeyboardActiveItemKey:b,parentMenuId:r,onHideIntent:K,api:j}),{id:`${r}-submenu`,alignTo:ie,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let w=(G,$)=>{b($.key),S($.key),$.originalMenuItem.onClick&&$.originalMenuItem.onClick(G);let ie={key:$.key,item:$.originalMenuItem,hideMenu:K};$.originalMenuItem.onAction&&$.originalMenuItem.onAction(ie),u&&u(ie),$.originalMenuItem.hideMenuOnAction&&K()},{showOverlay:D,portal:v,clearAll:M}=ao({portalContainer:!1}),{onItemEnter:x,onItemLeave:E}=cR({onItemActivate:G=>{if(!T())return;let $=G?G.key:null;S($)}});R=n.map((G,$)=>jt.createElement(dR,{key:G.type==="item"?G.key:$,onItemEnter:(ie,pe)=>{x(ie.key,pe)},onItemLeave:(ie,pe)=>{E(ie.key,pe)},columns:t,active:G.type==="item"&&G.key===i,keyboardActive:G.type==="item"&&G.key===a,item:G,index:$,onClick:w}));let P=t.map(G=>G.width||(typeof G.flex=="number"?`${G.flex}fr`:G.flex)||"auto").join(" "),A={...e.style,gridTemplateColumns:P,gridTemplateRows:n.map(()=>"auto").join(" ")};c||(A.whiteSpace="nowrap");function _(G){let{runtimeItems:$,runtimeSelectableItems:ie}=y(),pe=$.findIndex(U=>U.type==="item"&&U.key===a),ue=a,le=$[pe],de={ArrowUp:()=>{let U=$.slice(0,pe).filter(z=>z.type==="item"&&!z.disabled).pop();U&&U.type==="item"&&U.key&&(ue=U.key)},ArrowDown:()=>{let U=$.slice(pe+1).filter(z=>z.type==="item"&&!z.disabled)[0];U&&U.type==="item"&&U.key&&(ue=U.key)},Home:()=>{de.PageUp()},End:()=>{de.PageDown()},PageUp:()=>{ue=ie[0].key},PageDown:()=>{ue=ie[ie.length-1].key},ArrowLeft:()=>{S(null),y().parentMenuId&&(h.destroyed=!0)},ArrowRight:()=>{le&&(S(le.key),He(()=>{T()&&C&&C.getParentMenuId()===y().menuId&&C.focus()}))},Enter:()=>{if(le)if(le.originalMenuItem?.menu){if(le&&le.originalMenuItem.menu&&C){de.ArrowLeft();return}le&&S(le.key)}else w(G,le)}," ":()=>{if(!le)return;le.originalMenuItem.menu||w(G,le);let U=ay(r,le.key);U&&U.click()},Escape:()=>{de.ArrowLeft();let U=y();U.parentMenuId||U.onHideIntent?.(U)}},ce=de[G.key];ce&&(ce(),G.preventDefault()),ue!=a&&b(ue)}function N(){h.focused=!1}let F=(0,dt.useCallback)(function(){h.focused=!0,setTimeout(()=>{O.current&&g.current&&g.current===document.activeElement&&y().keyboardActiveItemKey==null&&b(y().runtimeSelectableItems[0]?.key??null)})},[]),O=(0,dt.useRef)(!0),K=(0,dt.useCallback)(()=>{let G=y();G.onHideIntent?.(G)},[y]),[j]=(0,dt.useState)(()=>({hideMenu:K,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),F())},getMenuId:()=>y().menuId,getParentMenuId:()=>y().parentMenuId})),k=(0,dt.useCallback)(G=>{G?(g.current=G,d?.(y(),j),f&&j.focus()):(p?.(y()),g.current=G)},[]),Q=jt.createElement("div",{className:Ln.contents},jt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:k,onKeyDown:G=>{e.onKeyDown?.(G),_(G)},onMouseDown:G=>{O.current=!1,e.onMouseDown?.(G)},onMouseUp:G=>{O.current=!0,e.onMouseUp?.(G)},onFocus:F,onBlur:N,className:oe($h,e.className,"InfiniteMenu"),style:A},R),v);return s?null:Q}function dR(o){let[e,t]=jt.useState(!1),{columns:n,item:r,index:i,active:a,keyboardActive:l}=o,s=r.type==="item"?r.value.key:i,u=null;if(r.type==="decoration")u=jt.createElement("div",{style:r.style},r.value);else{let c=0;u=n.map((d,p)=>{let f=r.value,m=d.field||d.name,g=p+1,h=g+r.span;if(g<c)return null;c=h;let b={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:oe(Uh({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?jt.createElement(Hr,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:b}}):jt.createElement("div",{key:`${s}-${m}`,...b},f[m])}).filter(Boolean)}return jt.createElement("div",{className:Yh},u)}var{ManagedComponentContextProvider:pR}=Nt({initSetupState:ty,forwardProps:oy,mapPropsToState:ny,layoutEffect:!0});function fR(o){let{componentActions:e,componentState:t}=Ft(),n=Fe(t);return hr.createElement(vu.Provider,{value:{componentActions:e,componentState:t,getState:n}},hr.createElement(sy,{domProps:o.domProps}))}function $t(o){let{children:e,portalContainer:t,items:n,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:u=!1,onAction:c,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:g,onHideIntent:h,__is_infinite_menu_component:y,...b}=o;return hr.createElement(pR,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:u,...o},hr.createElement(fR,{domProps:b}))}$t[Ja]=!0;var Du=W(require("react"));function uy(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 c=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{let m=an(p,e,"column-menu");c.push({key:f,label:m,check:Du.createElement(mo,{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:c}}},"-",{key:"group-by",label:"Group by",menu:()=>{let c=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{if(p.groupByForColumn)return;let m=an(p,e,"column-menu");c.push({key:f,label:m,check:Du.createElement(mo,{key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:c}}}].filter(c=>!!c)}function dy(o,e,t){if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??$t,s=n().computedColumnsMap.get(o);if(!s)return null;let u={column:s,columnApi:mt(s.id,e),...e},c=uy([],u),d=a?a(c,u):c,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:cy.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}var mR=`[${Kr["data-name"]}="${Br["data-name"]}"]`;function gR(o){let{columnId:e,context:t,clearAll:n,showOverlay:r}=o,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function u(){n(),a.columnMenuVisibleForColumnId=null}let c=o.target;if(c||(c=l.current??void 0,c&&!s.current.contains(c)&&(c=void 0)),!c){let d=`[${sm["data-column-id"]}="${e}"] ${mR}`;c=i().domRef.current.querySelector(d)}if(!c){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>dy(e,t,u),{constrainTo:s.current,id:"column-menu",alignTo:c,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function py(){let o=Be(),{getState:e,actions:t,columnMenuVisibleForColumnId:n,columnMenuVisibleKey:r}=re(u=>({getState:u.getState,actions:u.actions,columnMenuVisibleForColumnId:u.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:u.state.columnMenuVisibleKey})),{portalDOMRef:i}=co(u=>({portalDOMRef:u.getMasterState().portalDOMRef}))||{},{showOverlay:a,portal:l,clearAll:s}=ao({portalContainer:i?.current??!1});return(0,xu.useEffect)(()=>{let u=e();return u.onColumnMenuClick.onChange(c=>{c&&(u.columnMenuTargetRef.current=c.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=c.column.id)})},[]),(0,xu.useEffect)(()=>{let{columnMenuVisibleForColumnId:u,columnMenuTargetRef:c}=e();if(u){let p=function(f){f.__insideMenu!==!0&&(s(),t.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),gR({columnId:u,context:o,clearAll:s,showOverlay:a}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else c.current=null,s();return()=>{}},[n,r]),{menuPortal:l}}var fy=W(require("react")),my=require("react");var hR={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function gy(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=Be(),{getDataSourceState:a,getDataSourceMasterContext:l}=to(),{focusDetectDOMRef:s}=o(),u=(0,my.useCallback)(async()=>{vh({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})},[]);return fy.createElement("div",{onFocus:u,ref:s,tabIndex:0,style:hR})}var yr=require("react");function yR(){let o=Be(),{getState:e,editingCell:t}=re(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active?t.cancelled:void 0;(0,yr.useEffect)(()=>{if(n){let{onEditCancelled:r}=e(),i=e().editingCell;if(!r)return;let a=ii(o,i);if(!a){ai("onEditCancelled",i);return}r({...a,initialValue:i.initialValue})}},[n])}function bR(){let o=Be(),{getState:e,editingCell:t}=re(r=>({getState:r.getState,editingCell:r.state.editingCell})),n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,yr.useEffect)(()=>{if(n){let{onEditRejected:r}=e(),i=e().editingCell;if(!r)return;let a=ii(o,i);if(!a){ai("onEditRejected",i);return}r({...a,value:i.value,error:n,initialValue:i.initialValue})}},[n])}function SR(){let o=Be(),{editingCell:e}=re(r=>({editingCell:r.state.editingCell})),t=e?.active,n=Fo(t);(0,yr.useEffect)(()=>{!t&&n&&o.api.focus()},[t,n])}function TR(){let o=Be(),{editingCell:e,getState:t}=re(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,yr.useEffect)(()=>{if(n){let{onEditAccepted:r}=t(),i=t().editingCell,{value:a,initialValue:l}=i;if(r){let s=ii(o,i);s?r({...s,value:a,initialValue:l}):ai("onEditAccepted",i)}o.api.persistEdit({value:a})}},[n])}function CR(){let o=Be(),{editingCell:e,getState:t}=re(r=>({editingCell:r.state.editingCell,getState:r.getState})),n=e?e.persisted:void 0;(0,yr.useEffect)(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let l=n instanceof Error?"onEditPersistError":"onEditPersistSuccess";if(!t()[l])return;let s=ii(o,r);if(!s){ai(l,r);return}let u={...s,value:r.value,initialValue:r.initialValue};n instanceof Error?i?.({...u,error:n}):a?.(u)}},[n])}function hy(){yR(),bR(),TR(),CR(),SR()}var Au=require("react");var en=W(require("react"));var Eu=W(require("react"));var il=o=>Eu.createElement(Ve,{...o},Eu.createElement("path",{d:Ge.clear[0]}));var Mu=W(require("react"));var yy=o=>Mu.createElement(Ve,{...o},Mu.createElement("path",{d:Ge.done[0]}));function by(o,e,t){if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:u}=e,{components:c,getFilterOperatorMenuItems:d}=r(),p=c?.Menu??$t,f=n().computedColumnsMap.get(o);if(!f)return null;let m=R=>{R.__insideMenu=!0},g=R=>{R.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:h}=i(),y=h[f.computedFilterType];if(!y)return null;let b=y.operators.map(R=>{let w=R.name,D=f.computedFilterValue?f.computedFilterValue.filter.operator===w:w===y.defaultOperator,v=R.components?.Icon??zn;return{key:w,icon:en.createElement(v,null),label:en.createElement(en.Fragment,null,R.label??R.name),onAction:()=>{u.setColumnFilterOperator(o,w)},checked:D?en.createElement(yy,{size:16}):null}}),T=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{u.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:en.createElement(il,null),disabled:!f.computedFiltered,onAction:()=>{u.clearColumnFilter(o)}},"-"],...b],C={column:f,api:u,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:h},I=d?d(T,C):T;return en.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:I,onShow:R=>{R.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:R=>{g(R),t?.()}})}var al=10;function Sy(){let{portalDOMRef:o}=co(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},e=Be(),{getState:t,actions:n}=e,{showOverlay:r,portal:i,clearAll:a}=ao({portalContainer:o?.current??!1});return(0,Au.useEffect)(()=>t().onFilterOperatorMenuClick.onChange(s=>{if(!s)return;let{target:u,column:c}=s;function d(){a(),n.filterOperatorMenuVisibleForColumnId=null}let p=u?.parentElement||u,f=Re.from(p.getBoundingClientRect());f.top-=al,f.left-=al,f.width+=2*al,f.height+=2*al,r(()=>by(c.id,e,d),{constrainTo:t().domRef.current,id:"filter-operator-menu",alignTo:f,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),n.contextMenuVisibleFor=null,n.cellContextMenuVisibleFor=null,n.columnMenuVisibleForColumnId=null,n.filterOperatorMenuVisibleForColumnId=c.id}),[]),(0,Au.useEffect)(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.filterOperatorMenuVisibleForColumnId=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}var pi=require("react");var Nu=W(require("react"));var _u=W(require("react"));function di(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 ll(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 Ou(o,e,t){if(!o)return null;let n=Se();return o.then(r=>{let{items:i,columns:a}=di(r);i&&i.length&&n(_u.createElement(t,{...e,items:i||[],columns:a}))}),_u.createElement(Bo,{updater:n})}function Ty(o,e,t){let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:u}=l(),c=s?.Menu??$t,{computedColumnsMap:d}=a(),p=d.get(n),f={...Qt({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!u)return{cellContext:f,menu:null,preventDefault:!1};let m=ll({onHideIntent:t}),g=u(f,e),h=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:f,menu:Ou(g,m,c),preventDefault:h};let{items:y,columns:b}=di(g);return!y||!y.length?{cellContext:f,menu:null,preventDefault:Array.isArray(y)}:{preventDefault:h,menu:Nu.createElement(c,{...m,columns:b,items:y}),cellContext:f}}function Cy(o,e,t){let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=i?.Menu??$t,{computedColumnsMap:s}=r(),u=o.columnId?s.get(o.columnId):void 0,c=u?{...o,...Qt({...e,rowIndex:o.rowIndex,columnId:u.id})}:o;if(!a)return{cellContext:c,menu:null,preventDefault:!1};let d=ll({onHideIntent:t}),p=a(c,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:c,menu:Ou(p,d,l),preventDefault:f};let{items:m,columns:g}=di(p);return!m||!m.length?{cellContext:c,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:Nu.createElement(l,{...d,columns:g,items:m}),cellContext:c}}var sl=5,Iy=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function Ry(){let o=Be(),{portalDOMRef:e}=co(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=ao({portalContainer:e?.current??!1});return(0,pi.useEffect)(()=>{let{actions:l,getState:s,getDataSourceState:u}=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}=Ty(d,o,f),y=Re.fromPoint({top:p.clientY,left:p.clientX});y.width+=sl,y.height+=sl,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:y,alignPosition:Iy}),h&&p.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:b}=s();b&&b({...g,getState:s,getDataSourceState:u},p)})},[]),(0,pi.useEffect)(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.cellContextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function wy(){let o=Be(),{portalDOMRef:e}=co(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=ao({portalContainer:e?.current??!1});return(0,pi.useEffect)(()=>{let{actions:l,getState:s}=o;return s().contextMenu.onChange(c=>{if(!c)return;let{event:d}=c;function p(){a(),l.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:g}=Cy(c,o,p),h={top:d.clientY,left:d.clientX},y=Re.fromPoint(h);y.width+=sl,y.height+=sl,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:y,alignPosition:Iy}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:h,...c};let{onContextMenu:b}=s();b&&b({...o,...m},d)})},[]),(0,pi.useEffect)(()=>{let{contextMenuVisibleFor:l}=t();if(l){let u=function(c){c.__insideMenu!==!0&&(a(),n.contextMenuVisibleFor=null)};var s=u;return document.documentElement.addEventListener("mousedown",u),()=>{document.documentElement.removeEventListener("mousedown",u)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}var vy=require("react"),Py=W(require("react"));var ul=require("react");function cl(o,e){let{brain:t}=re(r=>({brain:r.state.brain})),n=(0,ul.useCallback)(o,e);(0,ul.useEffect)(()=>t.onScroll(n),[t,n])}var Fu="yzx0vj0";function Dy(o){let{width:e,maxWidth:t,minWidth:n,scrollable:r,...i}=o,a=(0,vy.useRef)(null);cl(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=fe.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=fe.runtime.bodyWidth),n==="column"?l.minWidth=fe.runtime.totalVisibleColumnsWidthValue:n==="viewport"&&(l.minWidth=fe.runtime.bodyWidth),t==="column"?l.maxWidth=fe.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=fe.runtime.bodyWidth),Py.createElement("div",{ref:a,...i,className:i.className?oe(i.className,Fu):Fu,style:l},i.children)}var IR=J(ee.columnWidthAtIndex),RR=J(ee.columnOffsetAtIndex);function xy(){let{computedVisibleColumns:o}=re(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return o.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${IR}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${RR}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var dl="InfiniteTable";var Ey=require("react");function My(){let{getState:o,actions:e,dataSourceActions:t,getDataSourceState:n}=re(c=>({getState:c.getState,actions:c.actions,dataSourceActions:c.dataSourceActions,getDataSourceState:c.getDataSourceState})),{groupBy:r,isTree:i}=n(),a=o(),{brain:l,wrapRowsHorizontally:s}=a,u=a.repeatWrappedGroupRows;s||(u=!1),(0,Ey.useEffect)(()=>{if(!s){n().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let c=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=n(),g=!1,h=l.rowsPerPage,y=(r&&r.length>0||i)&&h>0?h:null;return f!=y&&(t.rowsPerPage=y,g=!0),m!=u&&(t.repeatWrappedGroupRows=u??!1,g=!0),g};c();let d,p=l.onVerticalRenderRangeChange(()=>{c()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,u])}var vn=require("react");function wR(){let o=[],e=t=>{Object.keys(t).forEach(n=>{let r=t[n];if(typeof r=="string"){let i=J(r);if(i.includes("dont-override"))return;o.push(i)}else r&&typeof r=="object"&&e(r)})};return e({...fe,loaded:void 0,runtime:void 0}),o}function Ay(o){if(!o)return{};let e=wR(),t=getComputedStyle(o),n={};return e.forEach(r=>{n[r]=t.getPropertyValue(r).trim()}),n}var fi=be({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),_y="_143ofgf5",Oy="_143ofgf3";var vR=J(fe.loaded),Lu={source:"infinite-table-page",target:"infinite-table-devtools-background"};function Ny(o,e){let{type:t,debugId:n}=o;if(t==="unmount")return{...Lu,url:ku(),type:t,payload:{debugId:n}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...Lu,url:ku(),type:t,payload:{debugId:n,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(u=>u.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(u=>[u.id,{field:u.field,dataType:u.computedDataType,sortType:u.computedSortType,filtered:u.computedFiltered,sorted:u.computedSorted,width:u.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(u=>u.field?`${u.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(u=>typeof u.field=="string").map(u=>({field:`${u.field}`,dir:u.dir,type:Array.isArray(u.type)?u.type[0]:u.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)},themeVars:Ay(l.domRef.current),themeVarOverrides:{...ro.get(n)||{}}}}}var ku=pt(function(){let o=new URL(window.location.href);return o.origin+o.pathname});function PR(o){window.postMessage(o)}var DR=pt(()=>{console.log("Infinite Table DevTools detected!");let o=(e,t)=>{if(t){ht.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(Ny({type:"update",debugId:e},t))}else Ig(e),window.postMessage(Ny({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=o,Ue.onLogIntent("IT:*",e=>{PR({...Lu,url:ku(),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 Fy(){let{getState:o,getDataSourceState:e,dataSourceActions:t}=re(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),n=o(),{domRef:r,debugId:i}=n;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(vR)!==`${_d}`&&li({debugId:i,key:"CSS001_CSS"}),(0,vn.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),MR()}var pl=Se(),xR={revertAll:o=>{let e=ht.get(o.debugId);if(e){let t=Xo.get(o.debugId);Xo.delete(o.debugId),Co.delete(o.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let n=Ro.get(o.debugId);Ro.delete(o.debugId),Io.delete(o.debugId),n&&Object.keys(n).forEach(r=>{e.dataSourceActions[r]=n[r],delete n[r]})}},revertProperty:o=>{let e=ht.get(o.debugId);if(e){let t=o.property,n=Co.get(o.debugId),r=Xo.get(o.debugId),i=Io.get(o.debugId),a=Ro.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 u=Ro.get(o.debugId)||{};delete i[s],e.dataSourceActions[s]=u[s],delete u[s]}}},discardWarning:o=>{let e=ht.get(o.debugId);if(e){let t=o.warning,n=e.getDataSourceState().debugWarnings;if(n.get(t))n.delete(t),Qo(o.debugId);else{let i=o.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),Qo(o.debugId))}}},discardAllWarnings:o=>{let e=ht.get(o.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),Qo(o.debugId))},setColumnVisibility:o=>{uu(o.debugId,"columnVisibility",o.columnVisibility)},setGroupBy:o=>{Ba(o.debugId,"groupBy",o.groupBy)},setGroupRenderStrategy:o=>{uu(o.debugId,"groupRenderStrategy",o.groupRenderStrategy)},setSortInfo:o=>{Ba(o.debugId,"sortInfo",o.sortInfo)},setMultiSort:o=>{Ba(o.debugId,"multiSort",o.multiSort)},setCssVar:o=>{let e=ht.get(o.debugId),t=e?.getState().domRef.current;!e||!t||!o.name?.startsWith("--infinite-")||(t.style.setProperty(o.name,o.value),ro.set(o.debugId,{...ro.get(o.debugId)||{},[o.name]:o.value}),Qo(o.debugId))},revertCssVar:o=>{let e=ht.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;t.style.removeProperty(o.name);let n={...ro.get(o.debugId)||{}};delete n[o.name],ro.set(o.debugId,n),Qo(o.debugId)},revertAllCssVars:o=>{let e=ht.get(o.debugId),t=e?.getState().domRef.current;if(!e||!t)return;let n=ro.get(o.debugId)||{};Object.keys(n).forEach(r=>{t.style.removeProperty(r)}),ro.delete(o.debugId),Qo(o.debugId)},highlight:o=>{let e=ht.get(o.debugId);if(e){let t=e.getState().domRef.current;if(t){let n=t.getBoundingClientRect(),r=document.querySelector(`.${fi.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(fi.classNames.base),r.innerHTML=[`<div class="${Oy}"></div>`,`<div class="${_y}"></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(fi.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(fi.classNames.variants.active.true)}}}}};function ER(){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__||(DR(),pl(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof o.data.type=="string")){let e=o.data.type,t=xR[e];t&&t(o.data.payload)}})}ER();function MR(){let{getState:o,getComputed:e,getDataSourceState:t,dataSourceActions:n,actions:r,dataSourceApi:i,api:a}=re(c=>({getState:c.getState,getComputed:c.getComputed,getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions,actions:c.actions,dataSourceApi:c.dataSourceApi,api:c.api})),s=o().debugId,u=(0,vn.useRef)(s);return u.current=s,(0,vn.useEffect)(()=>{let c=u.current;if(!c)return;let d=f=>{f(c,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})},p=pl.get();if(p){d(p);return}return pl.onChange(f=>{f&&d(f)})},[]),(0,vn.useEffect)(()=>{let c=u.current;if(!c)return;let d=pl.get();d&&d(c,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})}),(0,vn.useEffect)(()=>{if(s)return()=>{let c=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;c&&c(s,null)}},[s]),s}function Ly(){let{masterPortalDOMRef:o}=co(n=>({masterPortalDOMRef:n.getMasterState().portalDOMRef}))??{},e=re(n=>n.state.portalDOMRef);return o?.current??e?.current}var Mt=W(require("react")),Wy=require("react");var ky="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",zy=be({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),Vy="hs68h81",Gy=be({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 Pn=W(require("react"));function Hy(o){return Pn.createElement("div",{...o.domProps})}function Ky(o){let{active:e}=o;return Pn.createElement("div",{className:Vy},e?"Drop to group":"Drag columns to group")}function By(o){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),o.onClear?.())};return Pn.createElement("div",{...o.domProps},o.label,Pn.createElement("div",{className:xi[1]}),Pn.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${o.field}`,className:ky,onKeyDown:e,onMouseDown:o.onClear},Pn.createElement(il,{size:20})))}var AR=(o,e)=>t=>{e&&e(t);let n=Date.now(),r=!1,i=()=>{r=!0};Pe().addEventListener("mousemove",i,{once:!0}),Pe().addEventListener("mouseup",()=>{r||(Pe().removeEventListener("mousemove",i),Date.now()-n<200&&requestAnimationFrame(()=>{o()}))},{once:!0})};function _R(o){let{column:e,onClear:t,components:n,field:r,id:i,toggleSorting:a}=o,{dragSourceListId:l,dragItemId:s}=gn(),u=l===br,c=Be(),d=(e?an(e.id,c,"grouping-toolbar"):r)??i,p=e?Mt.createElement(Ji,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,f=Mt.createElement(Mt.Fragment,null,d,p),m=s===i&&l===br,g=oe(zy({draggingInProgress:u,active:m}),o.domProps?.className),h=AR(a,o.domProps?.onMouseDown),y={...o.domProps,className:g,onMouseDown:h},b=n?.ToolbarItem??By;return Mt.createElement(b,{active:m,domProps:y,column:e,field:r,label:f,onClear:t})}var br="grouping-toolbar";function jy(o){let{groupBy:e}=Oe(S=>({groupBy:S.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:n,api:r}=re(S=>({getComputed:S.getComputed,dataSourceApi:S.dataSourceApi,api:S.api})),{dropTargetListId:i,dragSourceListId:a}=fo(),{fieldsToColumn:l,computedColumnsMap:s}=t(),u=i===br,c=a===br,d=o.components?.Placeholder??Ky,p=o.components?.Host??Hy,f=e.length?Mt.createElement(Mt.Fragment,null,e.map((S,T)=>{let C=S.field?l.get(S.field):void 0,I=`${S.field??`idx-${T}`}`;return Mt.createElement(Ko.DraggableItem,{key:I,id:I},R=>Mt.createElement(_R,{id:I,components:o.components,domProps:R,field:S.field,column:C,toggleSorting:()=>{C&&r.toggleSortingForColumn(C.id)},onClear:()=>{let w=e.filter(D=>D!==S).filter(Boolean);n.setGroupBy(w)}}))})):Mt.createElement(d,{draggingInProgress:c,active:u,groupBy:e}),m=S=>{let T=S.map(C=>e[C]);n.setGroupBy(T)},g=S=>{let{dragItemId:T}=S,C=T,I=s.get(C);if(!I||!I.field||!I.computedGroupable)return;let R=[...e];R.splice(S.dropIndex,0,{field:I.field}),n.setGroupBy(R)},h=(0,Wy.useCallback)(S=>{let{computedColumnsMap:T}=t(),C=S.dragItem.id,I=T.get(C);return!(!I||!I.computedGroupable||e.some(R=>R.field===I.field))},[e]),y=o.orientation??"horizontal",{domProps:b}=o;return Mt.createElement(Ko,{orientation:y,dragListId:br,acceptDropsFrom:["header",br],onDrop:m,dragStrategy:"inline",onAcceptDrop:g,shouldAcceptDrop:h},(S,{draggingInProgress:T,status:C})=>{let I=oe(Gy({active:u,orientation:y,draggingInProgress:T,dropRejected:C==="rejected"}),S.className,b?.className),R={...S,...b,className:I,children:f};return Mt.createElement(p,{active:u,rejectDrop:C==="rejected",domProps:R,orientation:y})})}var Tr=W(require("react"));var fl=require("react"),lo=require("react"),ml=W(require("react"));function $y(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return Sa(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}var Po=W(require("react"));var Uy=be({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var zu=require("react");function OR(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 NR(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=Zm(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 Yy(o,e){let t={current:!1};return{currentRowCache:{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)},cacheCalledByRowDetailRenderer:t}}function qy(o){let{rowInfo:e,currentRowCache:t,cacheCalledByRowDetailRenderer:n,getMasterDataSourceState:r,masterActions:i,getMasterState:a}=o,l=r().detailDataSourcesStateToRestore.has(e.id)&&t.has(),u={registerDetail:pt(c=>{if(n.current||t.add({all:!0}),!t.has()){requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)});return}OR(e.id,{masterState:r(),detailContext:c}),requestAnimationFrame(()=>{c.dataSourceState.destroyedRef.current||(c.dataSourceActions.stateReadyAsDetails=!0)}),c.dataSourceState.onCleanup.onChange(()=>{let d=t.get();d&&NR(e.id,{detailState:c.getDataSourceState(),masterActions:i,masterState:r(),cacheEntryForRow:d})})}),shouldRestoreState:l};return u.masterRowInfo=e,u.getMasterDataSourceState=r,u.getMasterState=a,u}function Xy(o){let{rowDetailsCache:e,rowInfo:t}=o,{getDataSourceState:n,dataSourceActions:r}=Oe(u=>({getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions})),{getMasterState:i}=re(u=>({getMasterState:u.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=(0,zu.useMemo)(()=>Yy(t.id,e),[e,t.id]),s=(0,zu.useMemo)(()=>qy({rowInfo:t,currentRowCache:a,cacheCalledByRowDetailRenderer:l,getMasterDataSourceState:n,masterActions:r,getMasterState:i}),[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function Zy(){return Ao()}var{rootClassName:FR}=ze,LR=`${FR}RowDetail`;function kR(o){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:n,rowInfo:r,detailOffset:i,rowDetailsCache:a}=o,{masterDetailContextValue:l,currentRowCache:s}=Xy({rowDetailsCache:a,rowInfo:r}),u=On(),[c]=Po.useState(()=>Zy());return c.setSnapshot(l),Po.useLayoutEffect(()=>{c.notify()},[l]),Po.createElement(u.Provider,{value:c},Po.createElement("div",{ref:e,className:oe(LR,Uy({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${ee.bodyWidth} - ${ee.scrollbarWidthVertical})`,height:n}},t(r,s)))}var Qy=Po.memo(kR);var zR=1;function Jy(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{actions:r,getState:i,getComputed:a,getDataSourceMasterContext:l,rowHeight:s,rowDetailHeight:u,onRowMouseEnter:c,onRowMouseLeave:d,groupRenderStrategy:p,brain:f,showZebraRows:m,rowDetailRenderer:g,isRowDetailsExpanded:h,isRowDetailsEnabled:y,cellClassName:b,cellStyle:S,repaintCellsKey:T,rowStyle:C,rowDetailCache:I,rowClassName:R,onScrollToTop:w,onScrollToBottom:D,onScrollStop:v,scrollToBottomOffset:M,wrapRowsHorizontally:x,updatedAt:E,ready:P,editingCell:A}=re(V=>({actions:V.actions,getState:V.getState,getComputed:V.getComputed,getDataSourceMasterContext:V.getDataSourceMasterContext,rowHeight:V.state.rowHeight,rowDetailHeight:V.state.rowDetailHeight,onRowMouseEnter:V.state.onRowMouseEnter,onRowMouseLeave:V.state.onRowMouseLeave,groupRenderStrategy:V.state.groupRenderStrategy,brain:V.state.brain,showZebraRows:V.state.showZebraRows,rowDetailRenderer:V.state.rowDetailRenderer,isRowDetailsExpanded:V.state.isRowDetailExpanded,isRowDetailsEnabled:V.state.isRowDetailEnabled,cellClassName:V.state.cellClassName,cellStyle:V.state.cellStyle,repaintCellsKey:V.state.repaintCellsKey,rowStyle:V.state.rowStyle,rowDetailCache:V.state.rowDetailCache,rowClassName:V.state.rowClassName,onScrollToTop:V.state.onScrollToTop,onScrollToBottom:V.state.onScrollToBottom,onScrollStop:V.state.onScrollStop,scrollToBottomOffset:V.state.scrollToBottomOffset,wrapRowsHorizontally:V.state.wrapRowsHorizontally,updatedAt:V.state.updatedAt,ready:V.state.ready,editingCell:V.state.editingCell})),{computedPinnedStartColumns:_,computedPinnedEndColumns:N,computedVisibleColumns:F,computedColumnsMap:O,computedColumnOrder:K,computedRowHeight:j,computedRowSizeCacheForDetails:k,fieldsToColumn:Q,rowspan:G,toggleGroupRow:$,columnSize:ie}=e,pe=(0,fl.useMemo)(()=>F.map(V=>V.id),[F]),{dataArray:ue,rowInfoStore:le,selectionMode:de,cellSelection:ce,isNodeReadOnly:U,getDataSourceState:z,dataSourceApi:q,dataSourceActions:Y}=Oe(V=>({dataSourceApi:V.dataSourceApi,dataSourceActions:V.dataSourceActions,getDataSourceState:V.getDataSourceState,dataArray:V.dataSourceState.dataArray,rowInfoStore:V.dataSourceState.rowInfoStore,selectionMode:V.dataSourceState.selectionMode,cellSelection:V.dataSourceState.cellSelection,isNodeReadOnly:V.dataSourceState.isNodeReadOnly})),Z=Fe(ue);$y({columnSize:ie,brain:f,computedPinnedStartColumns:_,computedPinnedEndColumns:N,computedVisibleColumns:F,computedRowHeight:j,dataArray:ue,bodySize:t,rowspan:G});let X=(0,lo.useRef)(0);(0,lo.useEffect)(()=>f.onRenderCountChange(()=>{X.current=f.scrollTopMax}),[f]),(0,lo.useEffect)(()=>f.onRenderRangeChange(V=>{i().onRenderRangeChange?.(V)}),[f]),(0,lo.useEffect)(()=>f.onScrollStop(V=>{let{scrollTop:L,scrollLeft:ge}=V;if(L===0&&w?.(),L+(M??zR)>=X.current){D?.();let{livePagination:Me,livePaginationCursor:Ae,dataArray:Ke}=z();Me&&(Y.cursorId=Ae!==void 0?Date.now():Ke.length)}if(v){let Me=f.getRenderRange();v({scrollTop:L,scrollLeft:ge,renderRange:Me,viewportSize:i().bodySize,firstVisibleRowIndex:Me.start[0],lastVisibleRowIndex:Me.end[0],firstVisibleColIndex:Me.start[1],lastVisibleColIndex:Me.end[1]})}}),[f,w,D,v]),(0,lo.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,lo.useEffect)(()=>{let{onReady:V}=i();V&&V({api:n,dataSourceApi:q})},[P]);let me=(0,fl.useMemo)(()=>({isNodeReadOnly:U,selectionMode:de,cellSelection:ce}),[U,de,ce]),he=(0,lo.useCallback)(V=>{let{rowIndex:L,colIndex:ge,heightWithRowspan:xe,domRef:Ee,hidden:Me,width:Ae,onMouseLeave:Ke,onMouseEnter:ot}=V,it=Z()[L],Qe=F[ge];if(!it||!Qe)return null;let qe=k?k.getRowHeight(L):xe,B=!1;!y||typeof y=="function"&&!y(it)?B=!1:h&&(B=h(it)?"expanded":"collapsed");let ne=x?f.getRowIndexInPage(L):null,ye=x?f.getPageIndexForRow(L):null,Te=n.isEditorVisibleForCell({rowIndex:L,columnId:Qe.id}),lt={getData:Z,virtualized:!0,showZebraRows:m,groupRenderStrategy:p,rowIndexInHorizontalLayoutPage:ne,horizontalLayoutPageIndex:ye,rowIndex:L,rowInfoStore:le,hidden:Me,toggleGroupRow:$,rowHeight:qe,rowDetailState:B,onMouseEnter:ot,onMouseLeave:Ke,onRowMouseEnter:c,onRowMouseLeave:d,domRef:Ee,width:Ae,column:Qe,columnsMap:O,fieldsToColumn:Q,rowStyle:C,rowClassName:R,cellStyle:S,cellClassName:b,repaintCellsKey:Qe.repaintCellsKey!==void 0?Qe.repaintCellsKey:T,visibleColumnIds:pe,computedColumnOrder:K,inEditMode:Te,getDataSourceState:z,dataSourceApi:q,dataSourceActions:Y,getState:i,imperativeApi:n,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:me};return ml.createElement(jp,{...lt})},[s,u,c,d,k,j,h,Z,F,O,Q,p,x,$,m,f,le,C,R,b,S,T,z,q,Y,i,n,r,a,l,pe,K,E,A,me]),ae=(0,fl.useMemo)(()=>{if(h)return V=>{let{rowIndex:L,domRef:ge}=V,Ee=Z()[L];if(!Ee||!h(Ee)||!k)return ml.createElement("div",{ref:ge,className:_c.hidden});let{rowDetailHeight:Me,rowHeight:Ae}=k.getSize(L);return ml.createElement(Qy,{rowInfo:Ee,rowDetailsCache:I,rowIndex:L,domRef:ge,detailOffset:Ae,rowDetailHeight:Me,rowDetailRenderer:g})}},[P,he,g,u,h,I]);return{renderCell:he,renderDetailRow:ae}}var eb=require("react");function tb(){let{state:o,getState:e,actions:t}=re(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:n}=o,r=Fo(n);(0,eb.useEffect)(()=>{if(r!==n){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let u=mu(dl,!!n);t.brain=u.brain,t.headerBrain=u.headerBrain,t.renderer=u.renderer,t.onRenderUpdater=u.onRenderUpdater,t.headerRenderer=u.headerRenderer,t.headerOnRenderUpdater=u.headerOnRenderUpdater}},[r,n])}var rb=W(require("react"));var ob="_16lm1iw1 _16lm1iw1c _16lm1iwe";var nb=oe(ob,ps);function ib(o){return rb.createElement("div",{...o,className:o.className?oe(nb,o.className):nb})}var Sr=W(require("react"));var ab={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},lb="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",sb="qy58ya4";var{rootClassName:VR}=ze,Vu=`${VR}-LoadMask`;function GR(o){let{visible:e,children:t="Loading"}=o;return Sr.createElement("div",{className:`${ab[e?"visible":"hidden"]} ${Vu}`},Sr.createElement("div",{className:`${lb} ${Vu}-Overlay`}),Sr.createElement("div",{className:`${sb} ${Vu}-Text`},t))}var gl=Sr.memo(GR);var ub=require("react");var HR=[kp,`${Jt}--hovered`];function KR(o){return Array.isArray(o)&&(o=o.join(" ")),o.split(" ").map(e=>e.trim()).filter(Boolean)}function Dn(o){let e=Be(),t=_o(),{getComputed:n,api:r}=e,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:u,loadingText:c,columnReorderDragColumnId:d,scrollStopDelay:p,brain:f,scrollerDOMRef:m,components:g,bodySize:h,activeCellIndex:y,rowDetailRenderer:b,showHoverRows:S,wrapRowsHorizontally:T,domProps:C,domRef:I,forceBodyRerenderTimestamp:R,rowHoverClassName:w,ready:D}=re(k=>({ready:k.state.ready,columnReorderDragColumnId:k.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:k.state.forceBodyRerenderTimestamp,renderer:k.state.renderer,onRenderUpdater:k.state.onRenderUpdater,debugId:k.state.debugId,keyboardNavigation:k.state.keyboardNavigation,activeRowIndex:k.state.activeRowIndex,loadingText:k.state.loadingText,scrollStopDelay:k.state.scrollStopDelay,brain:k.state.brain,scrollerDOMRef:k.state.scrollerDOMRef,components:k.state.components,bodySize:k.state.bodySize,activeCellIndex:k.state.activeCellIndex,rowDetailRenderer:k.state.rowDetailRenderer,showHoverRows:k.state.showHoverRows,wrapRowsHorizontally:k.state.wrapRowsHorizontally,domProps:k.state.domProps,domRef:k.state.domRef,rowHoverClassName:k.state.rowHoverClassName})),v=g?.LoadMask??gl,M=n(),{computedRowHeight:x,computedRowSizeCacheForDetails:E}=M,P=E?.getRowHeight||x,{loading:A}=Oe(k=>({loading:k.dataSourceState.loading})),_=Tr.useCallback(k=>{let Q=e.getState(),G=k.target;if(!t&&k._from_row_detail)return;t&&(k._from_row_detail=!0);let $=Ad(G,fu(),Q.domRef.current),ie,pe,ue,le;$&&(pe=Number($.dataset.colIndex),le=Number($.dataset.rowIndex),ie=e.getComputed().computedVisibleColumns[pe].id,ue=e.dataSourceApi.getRowInfoArray()[le].id);let de={columnId:ie,colIndex:pe,rowId:ue,rowIndex:le,event:k,target:$??k.target};$&&Q.cellContextMenu(de),Q.contextMenu(de)},[]),{renderCell:N,renderDetailRow:F}=Jy({imperativeApi:r,getComputed:n,domRef:I,bodySize:h,computed:M}),{autoFocus:O,tabIndex:K}=C??{};tb();let j=(0,ub.useMemo)(()=>{if(!S)return;let k=[];return w&&(k=k.concat(w)),o.rowHoverClassName&&(k=k.concat(o.rowHoverClassName)),Dn.rowHoverClassName&&(k=k.concat(Dn.rowHoverClassName)),KR(k)},[S,w,o.rowHoverClassName,Dn.rowHoverClassName]);return Tr.createElement(ib,{onContextMenu:_},Tr.createElement(jf,{forceRerenderTimestamp:R,debugId:l,tabIndex:K??0,autoFocus:O??void 0,activeRowIndex:D&&s==="row"?u:null,activeCellIndex:D&&s==="cell"&&!d?y:null,scrollStopDelay:p,renderer:i,wrapRowsHorizontally:T,onRenderUpdater:a,brain:f,activeCellRowHeight:P,renderCell:N,renderDetailRow:b?F:void 0,cellHoverClassNames:j,scrollerDOMRef:m,scrollVarHostRef:I}),Tr.createElement(v,{visible:A},c))}Dn.rowHoverClassName=HR;function cb(){return re(o=>o.api)}function db(o){return re(e=>e.api.getColumnApi(o))}var pb=o=>`--infinite-${o}`;var fb=40,mb=pb(Od);var Zt=ze.rootClassName,{ManagedComponentContextProvider:BR}=Nt({initSetupState:Fg,forwardProps:Lg,mapPropsToState:Gg,cleanup:kg,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Vg(),getParentState:()=>Ka(o=>o),debugName:o=>Wo(o.debugId,dl)}),gb=ve.memo(function(){let e=Ii(),{componentState:t,api:n,initialChildren:r}=re(O=>({componentState:O.state,api:O.api,initialChildren:O.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Oe(O=>({dataArrayLength:O.dataSourceState.dataArray.length,getDataSourceState:O.getDataSourceState,dataSourceActions:O.dataSourceActions,dataSourceApi:O.dataSourceApi})),{domRef:u,portalDOMRef:c,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:h,columnHeaderHeightCSSVar:y,scrollStopDelay:b,brain:S,activeRowIndex:T,activeCellIndex:C}=t,{licenseKey:I}=t;!I&&so.licenseKey&&(I=so.licenseKey),gh(T,i,n),mh(C,i,n);let{onKeyDown:R}=Oh();ve.useEffect(()=>{let O=a(),K=_t(j=>{O.notifyRenderRangeChange({renderStartIndex:j[0],renderEndIndex:j[1]})},{wait:b});return S.onVerticalRenderRangeChange(K)},[S,b]);let w=fh(I),{autoFocus:D,tabIndex:v,...M}=t.domProps??{},x=Qd(M);ve.useEffect(()=>{S.setScrollStopDelay(b),l.scrollStopDelayUpdatedByTable=b},[b]),yg(),My(),hy();let{menuPortal:E}=py(),{menuPortal:P}=Ry(),{menuPortal:A}=wy(),{menuPortal:_}=Sy();ve.useEffect(()=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(t.id,t.ready,n,{dataSourceApi:s})},[t.ready,n,s]);let N=Fy();ve.useEffect(()=>{if(e){let O=e.getSnapshot();c.current=O.getMasterState().portalDOMRef.current}},[]);let F=r??ve.createElement(ve.Fragment,null,ve.createElement(Gs,null),ve.createElement(Dn,null));return ve.createElement("div",{"data-debug-id":N,onKeyDown:R,ref:u,...x},F,ve.createElement("div",{ref:c,className:oe(`${ft}Portal`,Oc[1e7],Ei.absolute,Mc[0],Dc[0])},E,P,A,_),g?ve.createElement(Pr,{key:"row-height",varName:g,onChange:d}):null,ve.createElement(Pr,{key:"flashing-duration",allowInts:!0,varName:fe.components.Cell.flashingDuration,onChange:p}),h?ve.createElement(Pr,{key:"row-detail-height",varName:h,onChange:f}):null,y?ve.createElement(Pr,{key:"column-header-height",varName:y,onChange:m}):null,w?null:ve.createElement(fm,null),ve.createElement(gy,null))});function WR({children:o,store:e}){let{componentActions:t,componentState:n}=Ft(),{scrollerDOMRef:r,scrollTopKey:i}=n,a=Fe(n),l=sh({state:n,actions:t,getState:a}),s=Fe(l),u=Ii(),{getDataSourceState:c,dataSourceActions:d,getDataSourceMasterContext:p,dataSourceApi:f}=to(),[m]=ve.useState(()=>gg({getComputed:s,getState:a,getDataSourceState:c,getDataSourceMasterContext:p,dataSourceApi:f,actions:t,dataSourceActions:d})),g={actions:t,state:n,computed:l,dataSourceActions:d,getDataSourceMasterContext:p,getDataSourceState:c,getComputed:s,getState:a,api:m,dataSourceApi:f,children:o};return e.setSnapshot(g),ve.useLayoutEffect(()=>{e.notify()}),yi(r,h=>{let y={width:h.width,height:h.height};t.bodySize=y},{earlyAttach:!0,debounce:50}),ve.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),ve.createElement(gb,null)}var so=function(o){let[e]=ve.useState(()=>hh()),t=Li();return ve.createElement(BR,{repeatWrappedGroupRows:!!o.wrapRowsHorizontally,rowHeight:fb,columnHeaderHeight:mb,...o},ve.createElement(Bi,null,ve.createElement(t.Provider,{value:e},ve.createElement(WR,{children:o.children,store:e}))))};so.Header=Gs;so.Body=Dn;so.HScrollSyncContent=Dy;so.Footer=()=>ve.createElement(Fc,null);so.GroupingToolbar=jy;var hb=W(require("react"));function jR(o){let{DataSource:e}=sr({nodesKey:"children",...o});return hb.createElement(e,null,o.children??null)}var yb=W(require("react"));var Gu=o=>(t,{unfilteredTreePaths:n,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new rt(i,{treePaths:n});r.forEachLeafNodePath((c,{selected:d})=>{l.setNodeSelection(c,d)}),a&&r.forEachLeafNodePath(c=>{l.setNodeSelection(c,a.selected)},a.nodePath);let u={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};o(u)};function bb(o){return yb.createElement(so,{...o})}var hl=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=Ue(`IT:${e}:DataQuery`)}};function xn(o){if(Array.isArray(o))return o.map(xn);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]=xn(i))}),JSON.stringify(n)}return o instanceof Date?o.toISOString():o}var Do=class Do{constructor(e){this.queryCache=new te;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=xn(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 hl(`${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=xn(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=xn(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=xn(e);this.queryCache.delete(t)};if(this.options=e,Do.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)}Do.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=Do.clients.get(e);t&&t.destroy()}static destroyAll(){Do.clients.forEach(e=>{Do.destroy(e.name)})}destroy(){Do.clients.delete(this.options.name)}};Do.clients=new Map;var Hu=Do;var $R={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})})}}}},Sb={instantEdit:$R};var UR=require("react");function Tb(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 bl=class bl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??bl.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}};bl.DEFAULT_SIZE=10;var yl=bl;var Tl=class Tl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Tl.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}};Tl.DEFAULT_SIZE=10;var Sl=Tl;var En=require("react"),YR=(o,e)=>o.every((t,n)=>t===e[n]),Cb=(o,e)=>{let t=(0,En.useRef)(e),n=YR(e,t.current),r=(0,En.useRef)(!0);t.current=e;let i=(0,En.useRef)(["same"]),a=n?[Date.now()]:i.current;i.current=a;let l=(0,En.useRef)(o);l.current=o,(0,En.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var tn=require("react"),Ib=(o,e,t)=>o.every((n,r)=>t?t(n,e[r]):n===e[r]),Cl=(o,e)=>{let{same:t,different:n,compare:r}=e,i=(0,tn.useRef)(t),a=(0,tn.useRef)(n),l=Ib(t,i.current,r),s=!Ib(n,a.current,r),u=(0,tn.useRef)(!0);i.current=t,a.current=n;let c=(0,tn.useRef)(["same"]),d=l&&s?[Date.now()]:c.current;c.current=d;let p=(0,tn.useRef)(o);p.current=o,l&&s&&(u.current=!1),(0,tn.useEffect)(()=>{if(!u.current)return p.current()},d)};var At=W(require("react"));var Rb=J(ee.currentFlashingDuration),qR=({children:o})=>At.createElement(At.Fragment,null,o),wb=1e3,vb={up:ji({direction:"up"}).split(" "),down:ji({direction:"down"}).split(" "),neutral:ji({direction:"neutral"}).split(" ")},Ku=(o={})=>{let{flashDuration:e,flashClassName:t,render:n=qR}=o;return At.forwardRef((i,a)=>{let l=Gr(),{flashingDurationCSSVarValue:s}=re(R=>({flashingDurationCSSVarValue:R.state.flashingDurationCSSVarValue})),u=typeof s=="number"?s??e??wb:e??wb,{domRef:c,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,h=p.id,y=At.useRef(!0),b=At.useRef(d),S=y.current?null:b.current;y.current=!1;let T=At.useRef(void 0),C=At.useRef(void 0),I=At.useRef(void 0);return Cl(()=>{if(d===b.current)return;let R=()=>{let M=m.current;if(T.current&&(clearTimeout(T.current),T.current=void 0),I.current&&(clearTimeout(I.current),I.current=void 0),C.current&&M){let x=C.current,E=vb[x];M.classList.remove(...t?[t,...E]:E),M.style.removeProperty(Rb),C.current=void 0}};b.current=d;let w=m.current;if(!w)return;R();let D=typeof d=="number"?d>S?"up":"down":"neutral",v=vb[D];return w.style.setProperty(Rb,`${u}`),w.classList.add(...t?[t,...v]:v),C.current=D,T.current=setTimeout(R,u),R},{same:[h,g],different:[d]}),At.createElement("div",{ref:c,...i,className:oe(i.className)},n({children:i.children,oldValue:S}))})},Pb=Ku();var tt=W(require("react")),Cr=require("react");var Db=require("react-dom");function xb(o){let[e,t]=tt.useState(null);return(0,Cr.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"?tt.createElement(Eb.Provider,{value:{getState:e}},tt.createElement(XR,null)):null}var Eb=tt.createContext({getState:()=>null});function XR(){let o=tt.useContext(Eb),{getState:e}=o,[,t]=Ut(),n=e().renderer.cellManager;(0,Cr.useEffect)(()=>{let s=_t(()=>{console.log("rerender"),t()},{wait:500});return n.onCellAttachmentChange(s)},[n,t]);let r=n.getRowsWithCells(),i=n.getColumnsWithCells(),a=(0,Cr.useRef)(null),l=(0,Cr.useRef)(null);return tt.createElement("div",{style:{overflow:"auto"}},(0,Db.createPortal)(tt.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),tt.createElement("table",{style:{borderCollapse:"collapse"}},tt.createElement("thead",null,tt.createElement("tr",null,i.map(s=>tt.createElement("th",{key:s,"data-col-index":s},s)))),tt.createElement("tbody",null,r.map(s=>tt.createElement("tr",{key:s,"data-row-index":s},i.map(u=>tt.createElement("td",{key:u,style:{padding:5,border:"1px solid gray",background:n.getCellAt([s,u])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":u},tt.createElement("button",{onClick:()=>{let c=n.getCellAt([s,u])?.getElement();if(!c)return;let d=c.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(c)},style:{cursor:"pointer"}},"(",s,",",u,")"))))))))}var ZR={CheckBox:mo,LoadMask:gl,MenuIcon:Wr,StringFilterEditor:Kn,NumberFilterEditor:zi};0&&(module.exports={AutoScroller,CellSelectionState,DRAG_ITEM_ATTRIBUTE,DataClient,DataSource,DataSourceActionType,DeepMap,DragDropProvider,DragInteractionTarget,DragList,FixedSizeSet,FlashingColumnCell,GroupRowsState,INTERNAL_MatrixDebugger,InfiniteTable,InfiniteTableClassName,InfiniteTableComponent,Menu,RowDetailCache,RowDetailState,RowDisabledState,RowSelectionState,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,WeakFixedSizeSet,alignNode,components,createDefaultProxy,createFlashingColumnCellComponent,debounce,debug,defaultDragProxyMove,defaultFilterTypes,eventMatchesKeyboardShortcut,filterDataArray,filterTypes,flatten,getComponentStateRoot,group,interceptMap,keyboardShortcuts,multisort,multisortNested,queryKeyToCacheKey,toTreeDataArray,useComponentState,useDataSourceApi,useDataSourceInternal,useDataSourceSelector,useDataSourceState,useDragDropProvider,useDragListContext,useEffectWhen,useEffectWhenSameDeps,useEffectWithChanges,useEffectWithObject,useGridScroll,useInfiniteColumnApi,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfinitePortalContainer,useInfiniteTableApi,useLayoutEffectWithChanges,useManagedDataSource,useMasterRowInfo,useOverlay,useOverlayPortal,usePrevious,useRowInfoReducers,useVisibleColumnSizes,withSelectedLeafNodesOnly});
|
|
30
30
|
//!collapsed || lazyLoad;
|