@ehfuse/mui-virtual-data-table 1.1.26 → 1.1.28

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/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";var Ge=Object.defineProperty;var ot=Object.getOwnPropertyDescriptor;var it=Object.getOwnPropertyNames;var lt=Object.prototype.hasOwnProperty;var at=(a,p)=>{for(var h in p)Ge(a,h,{get:p[h],enumerable:!0})},st=(a,p,h,L)=>{if(p&&typeof p=="object"||typeof p=="function")for(let T of it(p))!lt.call(a,T)&&T!==h&&Ge(a,T,{get:()=>p[T],enumerable:!(L=ot(p,T))||L.enumerable});return a};var ct=a=>st(Ge({},"__esModule",{value:!0}),a);var wt={};at(wt,{VirtualDataTable:()=>tt});module.exports=ct(wt);var c=require("react"),d=require("@mui/material"),et=require("react-virtuoso");var Ae=require("react/jsx-runtime"),Se=require("react"),Be=require("@mui/material"),$e=function(){return $e=Object.assign||function(p){for(var h,L=1,T=arguments.length;L<T;L++){h=arguments[L];for(var D in h)Object.prototype.hasOwnProperty.call(h,D)&&(p[D]=h[D])}return p},$e.apply(this,arguments)};function Ke(a){var p=a.visible,h=a.onComplete,L=a.fadeoutDuration,T=L===void 0?200:L,D=a.exitDelay,y=D===void 0?0:D,E=a.size,P=E===void 0?40:E,K=a.className,ee=a.style,Y=a.sx,te=a.indicator,F=a.background,U=F===void 0?{show:!0,color:"255, 255, 255",opacity:.9}:F,fe=(0,Se.useRef)(void 0),u=(0,Se.useRef)(null),Z=(0,Se.useState)(p),he=Z[0],me=Z[1],V=U.show,J=V===void 0?!0:V,R=U.color,A=R===void 0?"255, 255, 255":R,oe=U.opacity,ie=oe===void 0?.9:oe;if((0,Se.useEffect)(function(){var ae=fe.current;if(ae===!0&&p===!1&&u.current){var se=u.current;se.style.opacity="0",setTimeout(function(){me(!1),h?.()},T+y)}else p===!0&&(me(!0),u.current&&(u.current.style.opacity="1"));fe.current=p},[p,h,T,y]),!he)return null;var Le=function(){return typeof te=="string"?(0,Ae.jsx)("img",{src:te,alt:"Loading",style:{width:P,height:P}}):te||(0,Ae.jsx)(Be.CircularProgress,{size:P})},le=function(){return J?A.startsWith("rgba")?{backgroundColor:A}:/^\d+,\s*\d+,\s*\d+$/.test(A)?{backgroundColor:"rgba(".concat(A,", ").concat(ie,")")}:ie!==1?{backgroundColor:A,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:A,opacity:ie,zIndex:-1}}:{backgroundColor:A}:{backgroundColor:"transparent"}};return(0,Ae.jsx)(Be.Box,{ref:u,className:K,style:$e({},ee),sx:$e($e({position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,opacity:p?1:0,transition:"opacity ".concat(T,"ms ease-out")},le()),Y),children:Le()})}var ke=require("react/jsx-runtime"),ut=`
1
+ "use strict";var Ge=Object.defineProperty;var ot=Object.getOwnPropertyDescriptor;var it=Object.getOwnPropertyNames;var lt=Object.prototype.hasOwnProperty;var at=(a,p)=>{for(var h in p)Ge(a,h,{get:p[h],enumerable:!0})},st=(a,p,h,L)=>{if(p&&typeof p=="object"||typeof p=="function")for(let S of it(p))!lt.call(a,S)&&S!==h&&Ge(a,S,{get:()=>p[S],enumerable:!(L=ot(p,S))||L.enumerable});return a};var ct=a=>st(Ge({},"__esModule",{value:!0}),a);var wt={};at(wt,{VirtualDataTable:()=>tt});module.exports=ct(wt);var c=require("react"),d=require("@mui/material"),et=require("react-virtuoso");var Ae=require("react/jsx-runtime"),ke=require("react"),ze=require("@mui/material"),$e=function(){return $e=Object.assign||function(p){for(var h,L=1,S=arguments.length;L<S;L++){h=arguments[L];for(var D in h)Object.prototype.hasOwnProperty.call(h,D)&&(p[D]=h[D])}return p},$e.apply(this,arguments)};function Ke(a){var p=a.visible,h=a.onComplete,L=a.fadeoutDuration,S=L===void 0?200:L,D=a.exitDelay,x=D===void 0?0:D,E=a.size,P=E===void 0?40:E,K=a.className,ee=a.style,Y=a.sx,te=a.indicator,F=a.background,U=F===void 0?{show:!0,color:"255, 255, 255",opacity:.9}:F,fe=(0,ke.useRef)(void 0),u=(0,ke.useRef)(null),Z=(0,ke.useState)(p),he=Z[0],me=Z[1],B=U.show,J=B===void 0?!0:B,R=U.color,A=R===void 0?"255, 255, 255":R,ie=U.opacity,le=ie===void 0?.9:ie;if((0,ke.useEffect)(function(){var ae=fe.current;if(ae===!0&&p===!1&&u.current){var se=u.current;se.style.opacity="0",setTimeout(function(){me(!1),h?.()},S+x)}else p===!0&&(me(!0),u.current&&(u.current.style.opacity="1"));fe.current=p},[p,h,S,x]),!he)return null;var De=function(){return typeof te=="string"?(0,Ae.jsx)("img",{src:te,alt:"Loading",style:{width:P,height:P}}):te||(0,Ae.jsx)(ze.CircularProgress,{size:P})},re=function(){return J?A.startsWith("rgba")?{backgroundColor:A}:/^\d+,\s*\d+,\s*\d+$/.test(A)?{backgroundColor:"rgba(".concat(A,", ").concat(le,")")}:le!==1?{backgroundColor:A,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:A,opacity:le,zIndex:-1}}:{backgroundColor:A}:{backgroundColor:"transparent"}};return(0,Ae.jsx)(ze.Box,{ref:u,className:K,style:$e({},ee),sx:$e($e({position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,opacity:p?1:0,transition:"opacity ".concat(S,"ms ease-out")},re()),Y),children:De()})}var Le=require("react/jsx-runtime"),ut=`
2
2
  .vdt-css-spinner{box-sizing:border-box;border-radius:50%;border:4px solid rgba(28,64,125,0.14);border-top-color:#1c407d;animation:vdt-css-spinner-spin .75s linear infinite}
3
3
  @keyframes vdt-css-spinner-spin{to{transform:rotate(360deg)}}
4
- `;function Ue({size:a=54}){return(0,ke.jsxs)(ke.Fragment,{children:[(0,ke.jsx)("style",{children:ut}),(0,ke.jsx)("span",{className:"vdt-css-spinner",role:"progressbar","aria-label":"loading",style:{display:"inline-block",width:a,height:a}})]})}var n=require("react"),ne=require("react/jsx-runtime"),dt=["editor","textarea","input","select","textfield","form-control","contenteditable","MuiInputBase-input","MuiSelect-select","MuiOutlinedInput-input","MuiFilledInput-input","MuiInput-input","MuiFormControl-root","MuiTextField-root","MuiSelect-root","MuiOutlinedInput-root","MuiFilledInput-root","MuiInput-root","MuiAutocomplete-input","MuiDatePicker-input","MuiSlider-thumb","MuiSlider-rail","MuiSlider-track","MuiSlider-mark","MuiSlider-markLabel","MuiSlider-root","MuiSlider-colorPrimary","MuiSlider-sizeMedium","MuiIconButton-root","MuiButton-root","MuiButtonBase-root","MuiTouchRipple-root","MuiCheckbox-root","MuiRadio-root","MuiSwitch-root","PrivateSwitchBase-root","ant-input","ant-input-affix-wrapper","ant-input-group-addon","ant-input-number","ant-input-number-handler","ant-select","ant-select-selector","ant-select-selection-search","ant-select-dropdown","ant-cascader","ant-cascader-input","ant-picker","ant-picker-input","ant-time-picker","ant-calendar-picker","ant-slider","ant-slider-track","ant-slider-handle","ant-switch","ant-checkbox","ant-checkbox-wrapper","ant-radio","ant-radio-wrapper","ant-rate","ant-upload","ant-upload-drag","ant-form-item","ant-form-item-control","ant-btn","ant-dropdown","ant-dropdown-trigger","ant-menu","ant-menu-item","ant-tooltip","ant-popover","ant-modal","ant-drawer","ant-tree-select","ant-auto-complete","ant-mentions","ant-transfer","ui-input","ui-textarea","ui-select","ui-select-trigger","ui-select-content","ui-select-item","ui-button","ui-checkbox","ui-radio-group","ui-switch","ui-slider","ui-range-slider","ui-calendar","ui-date-picker","ui-combobox","ui-command","ui-command-input","ui-popover","ui-dialog","ui-sheet","ui-dropdown-menu","ui-context-menu","ui-menubar","ui-navigation-menu","ui-form","ui-form-control","ui-form-item","ui-form-field","ui-label","radix-ui","radix-select","radix-dropdown","radix-dialog","radix-popover","radix-accordion","radix-tabs","radix-slider","radix-switch","radix-checkbox","radix-radio","ql-editor","ql-container","ql-toolbar","ql-picker","ql-picker-label","ql-picker-options","ql-formats","ql-snow","ql-bubble","quill","quilleditor","monaco-editor","monaco-editor-background","view-lines","decorationsOverviewRuler","monaco-scrollable-element","CodeMirror","CodeMirror-code","CodeMirror-lines","CodeMirror-scroll","CodeMirror-sizer","cm-editor","cm-focused","cm-content","tox-editor-container","tox-editor-header","tox-edit-area","tox-tinymce","mce-content-body","ck-editor","ck-content","ck-toolbar","ck-editor__editable","ck-widget","slate-editor","slate-content","DraftEditor-root","DraftEditor-editorContainer","public-DraftEditor-content","ehfuse-editor","ehfuse-editor-wrapper","ehfuse-editor-content","ehfuse-toolbar","ehfuse-toolbar-group","ehfuse-cursor","text-editor","rich-text-editor","wysiwyg","ace_editor","ace_content"],Ze=(a,p)=>{let h=a.tagName.toLowerCase(),L=["text","password","email","number","search","tel","url","checkbox","radio"];if(h==="input"){let T=a.type;return L.includes(T)}if(["textarea","select","button"].includes(h)||["svg","path","circle","rect","line","polygon","polyline"].includes(h)||a.getAttribute("contenteditable")==="true")return!0;if(p?.excludeSelectors){for(let T of p.excludeSelectors)if(a.matches(T))return!0}return pt(a,p)},pt=(a,p)=>{let h=[...dt,...p?.excludeClasses||[]],L=a,T=0,D=5;for(;L&&T<=D;){if(h.some(y=>L.classList.contains(y)))return!0;if(L.classList.contains("MuiDialogContent-root"))break;L=L.parentElement,T++}return!1},ft={},ht={},mt={},gt={},bt={},yt=(0,n.forwardRef)(({className:a="",style:p={},containerStyle:h={},contentStyle:L={},children:T,onScroll:D,thumb:y=ft,track:E=ht,arrows:P=mt,dragScroll:K=gt,autoHide:ee=bt,showScrollbar:Y=!0,detectInnerScroll:te=!1},F)=>{let U=(0,n.useRef)({});(0,n.useEffect)(()=>{U.current={children:T,onScroll:D,showScrollbar:Y,thumb:y,track:E,arrows:P,dragScroll:K,autoHide:ee}});let fe=(0,n.useRef)(null),u=(0,n.useRef)(null),Z=(0,n.useRef)(null),he=(0,n.useRef)(null),me=(0,n.useRef)(null),V=(0,n.useRef)(null),[J,R]=(0,n.useState)(!1),[A,oe]=(0,n.useState)(!1),[ie,Le]=(0,n.useState)(!1),[le,ae]=(0,n.useState)({y:0,scrollTop:0}),[se,Ve]=(0,n.useState)(0),[We,Ne]=(0,n.useState)(0),[Ee,Oe]=(0,n.useState)(!1),[xe,Re]=(0,n.useState)(!1),[ce,qe]=(0,n.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[rt,H]=(0,n.useState)(null),[b,ge]=(0,n.useState)(null),[ze,He]=(0,n.useState)(!1),ve=(0,n.useRef)(null),[Ie,Pe]=(0,n.useState)(!1),we=(0,n.useRef)(null),be=(0,n.useRef)(null),ue=(0,n.useRef)(null),W=(0,n.useMemo)(()=>{let r=y.color??"#606060";return{width:y.width??8,minHeight:y.minHeight??50,radius:y.radius??(y.width??8)/2,color:r,opacity:y.opacity??.6,hoverColor:y.hoverColor??r,hoverOpacity:y.hoverOpacity??1}},[y]),M=(0,n.useMemo)(()=>({width:E.width??16,color:E.color??"rgba(128, 128, 128, 0.1)",visible:E.visible??!0,alignment:E.alignment??"center",radius:E.radius??W.radius??4,margin:E.margin??4}),[E,W.radius]),q=(0,n.useMemo)(()=>{let r=P.color??"#808080";return{visible:P.visible??!1,step:P.step??50,color:r,opacity:P.opacity??.6,hoverColor:P.hoverColor??r,hoverOpacity:P.hoverOpacity??1}},[P]),Me=(0,n.useMemo)(()=>({enabled:K.enabled??!0,excludeClasses:K.excludeClasses??[],excludeSelectors:K.excludeSelectors??[]}),[K]),x=(0,n.useMemo)(()=>({enabled:ee.enabled??!0,delay:ee.delay??1500,delayOnWheel:ee.delayOnWheel??700}),[ee]),I=W.width,Ce=M.width,de=W.minHeight,z=q.visible,De=q.step,Q=(0,n.useCallback)(()=>{if(!u.current)return;let r=document.activeElement;r&&u.current.contains(r)&&r!==u.current||u.current.focus()},[]);(0,n.useImperativeHandle)(F,()=>({getScrollContainer:()=>u.current,scrollTo:r=>{u.current&&u.current.scrollTo(r)},get scrollTop(){return u.current?.scrollTop||0},get scrollHeight(){return u.current?.scrollHeight||0},get clientHeight(){return u.current?.clientHeight||0}}),[]);let $=(0,n.useCallback)(()=>{if(V.current){let l=V.current;if(document.contains(l)&&l.scrollHeight>l.clientHeight+2)return l;V.current=null}if(!u.current)return null;if(Z.current&&Z.current.scrollHeight>u.current.clientHeight+2)return V.current=u.current,u.current;if(!te)return null;let r=u.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let l of r){let o=l;if(o!==u.current&&o.classList.contains("overlay-scrollbar-container"))continue;let f=o.parentElement,w=!1;for(;f&&f!==u.current;){if(f.classList.contains("overlay-scrollbar-container")&&f!==u.current){w=!0;break}f=f.parentElement}if(!w&&o.scrollHeight>o.clientHeight+2)return V.current=o,o}return null},[]),ye=(0,n.useCallback)(()=>$()!==null,[$]),S=(0,n.useCallback)(()=>{we.current&&(clearTimeout(we.current),we.current=null)},[]),je=(0,n.useCallback)(()=>{be.current&&(clearTimeout(be.current),be.current=null)},[]),Xe=(0,n.useCallback)(()=>{ue.current&&(clearTimeout(ue.current),ue.current=null)},[]),B=(0,n.useCallback)(r=>{x.enabled&&(S(),we.current=setTimeout(()=>{R(!1),we.current=null},r))},[S,x.enabled]),k=(0,n.useCallback)(()=>{let r=$();if(!r){R(!1),Oe(!1),S();return}if(Oe(!0),!he.current)return;x.enabled||(R(!0),S());let l=r.clientHeight,o=r.scrollHeight,f=r.scrollTop,w=0;if(fe.current){let Fe=window.getComputedStyle(fe.current),Ye=parseFloat(Fe.paddingTop)||0,nt=parseFloat(Fe.paddingBottom)||0;w=Ye+nt}let C=z?I*2+M.margin*4:M.margin*2,O=l-C+w,N=l/o,pe=Math.max(O*N,de),Te=o-l,X=O-pe,_e=Te>0?f/Te*X:0;Ve(pe),Ne(_e)},[$,S,z,I,de,x.enabled]),i=(0,n.useCallback)(r=>{r.preventDefault(),r.stopPropagation();let l=$();l&&(oe(!0),ae({y:r.clientY,scrollTop:l.scrollTop}),S(),R(!0),Q())},[$,S,Q]),t=(0,n.useCallback)(r=>{if(!A)return;let l=$();if(!l)return;let o=l.clientHeight,f=l.scrollHeight-o,w=r.clientY-le.y,C=o-se,O=w/C*f,N=Math.max(0,Math.min(f,le.scrollTop+O));l.scrollTop=N,k()},[A,le,se,k,$]),m=(0,n.useCallback)(()=>{oe(!1),ye()&&B(x.delay)},[ye,B,x.delay]),v=(0,n.useCallback)(r=>{if(!he.current)return;let l=he.current.getBoundingClientRect(),o=r.clientY-l.top,f=$();if(!f)return;let w=f.clientHeight,C=f.scrollHeight,O=o/w*(C-w);f.scrollTop=Math.max(0,Math.min(C-w,O)),k(),R(!0),B(x.delay),Q()},[k,B,x.delay,$,Q]),g=(0,n.useCallback)(r=>{if(r.preventDefault(),r.stopPropagation(),!u.current)return;let l=Math.max(0,u.current.scrollTop-De);u.current.scrollTop=l,k(),R(!0),B(x.delay),Q()},[k,B,De,x.delay,Q]),e=(0,n.useCallback)(r=>{if(r.preventDefault(),r.stopPropagation(),!u.current||!Z.current)return;let l=u.current,o=Z.current.scrollHeight-l.clientHeight,f=Math.min(o,l.scrollTop+De);l.scrollTop=f,k(),R(!0),B(x.delay),Q()},[k,B,De,x.delay,Q]),j=(0,n.useCallback)(r=>{if(!Me.enabled)return;let l=r.target;if(Ze(l,Me)||r.button!==0)return;let o=$();o&&(o.scrollHeight<=o.clientHeight||(r.preventDefault(),Re(!0),qe({x:r.clientX,y:r.clientY,scrollTop:o.scrollTop,scrollLeft:o.scrollLeft||0}),S()))},[Me,Ze,$,S]),G=(0,n.useCallback)(r=>{if(!xe)return;let l=$();if(!l)return;let o=ce.x-r.clientX,f=ce.y-r.clientY;if(Math.abs(f)<3&&Math.abs(o)<3)return;R(!0);let w=Math.max(0,Math.min(l.scrollHeight-l.clientHeight,ce.scrollTop+f));l.scrollTop=w,k()},[xe,ce,$,k]),re=(0,n.useCallback)(()=>{Re(!1),ye()&&B(x.delay)},[ye,B,x.delay]);(0,n.useEffect)(()=>{let r=C=>{k(),S(),R(!0);let O=Ie?x.delayOnWheel:x.delay;B(O),D&&D(C)},l=()=>{Pe(!0),ve.current&&clearTimeout(ve.current),ve.current=setTimeout(()=>{Pe(!1)},300),S(),Xe(),ue.current=setTimeout(()=>{R(!0),ue.current=null},50)},o=[],f=$();f&&o.push(f);let w=u.current;return w&&!f&&(o.push(w),w.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(C=>{let O=C;if(O!==w&&O.classList.contains("overlay-scrollbar-container"))return;let N=O.parentElement;for(;N&&N!==w;){if(N.classList.contains("overlay-scrollbar-container")&&N!==w)return;N=N.parentElement}o.push(O)})),o.forEach(C=>{C.addEventListener("scroll",r,{passive:!0}),C.addEventListener("wheel",l,{passive:!0})}),()=>{o.forEach(C=>{C.removeEventListener("scroll",r),C.removeEventListener("wheel",l)}),ve.current&&clearTimeout(ve.current),ue.current&&clearTimeout(ue.current)}},[$,k,D,S,B,x,Ie]),(0,n.useEffect)(()=>{let r=o=>{let f=$();if(!f)return;let{key:w}=o,{scrollTop:C,scrollHeight:O,clientHeight:N}=f,pe=O-N,Te=50,X=null;switch(w){case"ArrowUp":o.preventDefault(),X=Math.max(0,C-Te);break;case"ArrowDown":o.preventDefault(),X=Math.min(pe,C+Te);break;case"PageUp":o.preventDefault(),X=Math.max(0,C-N);break;case"PageDown":o.preventDefault(),X=Math.min(pe,C+N);break;case"Home":o.preventDefault(),X=0;break;case"End":o.preventDefault(),X=pe;break;default:return}if(X!==null){let _e=X/pe,Fe=z?I*2+M.margin*4:M.margin*2,Ye=(N-Fe-se)*_e;Ne(Ye),f.scrollTop=X,S(),R(!0),B(x.delay)}},l=u.current;if(l)return l.addEventListener("keydown",r),()=>{l.removeEventListener("keydown",r)}},[$,z,I,M.margin,se,S,B,x.delay]),(0,n.useEffect)(()=>{if(xe)return document.addEventListener("mousemove",G),document.addEventListener("mouseup",re),()=>{document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",re)}},[xe,G,re]),(0,n.useEffect)(()=>{if(A)return document.addEventListener("mousemove",t),document.addEventListener("mouseup",m),()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",m)}},[A,t,m]),(0,n.useEffect)(()=>{k();let r=setTimeout(()=>{k()},100);return()=>clearTimeout(r)},[k]),(0,n.useLayoutEffect)(()=>{He(!0),k(),!x.enabled&&ye()&&R(!0)},[ye,k,x.enabled]),(0,n.useEffect)(()=>{let r=new ResizeObserver(()=>{k()}),l=[];return u.current&&l.push(u.current),Z.current&&l.push(Z.current),V.current&&document.contains(V.current)&&l.push(V.current),l.forEach(o=>{r.observe(o)}),()=>r.disconnect()},[k]),(0,n.useEffect)(()=>{if(!u.current)return;let r=new MutationObserver(()=>{V.current=null,k()});return r.observe(u.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>r.disconnect()},[k]);let _=Math.max(Ce,I);return(0,n.useEffect)(()=>{let r="overlay-scrollbar-webkit-hide",l=document.getElementById(r);l&&l.remove();let o=document.createElement("style");return o.id=r,o.textContent=`
4
+ `;function Ue({size:a=54}){return(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)("style",{children:ut}),(0,Le.jsx)("span",{className:"vdt-css-spinner",role:"progressbar","aria-label":"loading",style:{display:"inline-block",width:a,height:a}})]})}var n=require("react"),oe=require("react/jsx-runtime"),dt=["editor","textarea","input","select","textfield","form-control","contenteditable","MuiInputBase-input","MuiSelect-select","MuiOutlinedInput-input","MuiFilledInput-input","MuiInput-input","MuiFormControl-root","MuiTextField-root","MuiSelect-root","MuiOutlinedInput-root","MuiFilledInput-root","MuiInput-root","MuiAutocomplete-input","MuiDatePicker-input","MuiSlider-thumb","MuiSlider-rail","MuiSlider-track","MuiSlider-mark","MuiSlider-markLabel","MuiSlider-root","MuiSlider-colorPrimary","MuiSlider-sizeMedium","MuiIconButton-root","MuiButton-root","MuiButtonBase-root","MuiTouchRipple-root","MuiCheckbox-root","MuiRadio-root","MuiSwitch-root","PrivateSwitchBase-root","ant-input","ant-input-affix-wrapper","ant-input-group-addon","ant-input-number","ant-input-number-handler","ant-select","ant-select-selector","ant-select-selection-search","ant-select-dropdown","ant-cascader","ant-cascader-input","ant-picker","ant-picker-input","ant-time-picker","ant-calendar-picker","ant-slider","ant-slider-track","ant-slider-handle","ant-switch","ant-checkbox","ant-checkbox-wrapper","ant-radio","ant-radio-wrapper","ant-rate","ant-upload","ant-upload-drag","ant-form-item","ant-form-item-control","ant-btn","ant-dropdown","ant-dropdown-trigger","ant-menu","ant-menu-item","ant-tooltip","ant-popover","ant-modal","ant-drawer","ant-tree-select","ant-auto-complete","ant-mentions","ant-transfer","ui-input","ui-textarea","ui-select","ui-select-trigger","ui-select-content","ui-select-item","ui-button","ui-checkbox","ui-radio-group","ui-switch","ui-slider","ui-range-slider","ui-calendar","ui-date-picker","ui-combobox","ui-command","ui-command-input","ui-popover","ui-dialog","ui-sheet","ui-dropdown-menu","ui-context-menu","ui-menubar","ui-navigation-menu","ui-form","ui-form-control","ui-form-item","ui-form-field","ui-label","radix-ui","radix-select","radix-dropdown","radix-dialog","radix-popover","radix-accordion","radix-tabs","radix-slider","radix-switch","radix-checkbox","radix-radio","ql-editor","ql-container","ql-toolbar","ql-picker","ql-picker-label","ql-picker-options","ql-formats","ql-snow","ql-bubble","quill","quilleditor","monaco-editor","monaco-editor-background","view-lines","decorationsOverviewRuler","monaco-scrollable-element","CodeMirror","CodeMirror-code","CodeMirror-lines","CodeMirror-scroll","CodeMirror-sizer","cm-editor","cm-focused","cm-content","tox-editor-container","tox-editor-header","tox-edit-area","tox-tinymce","mce-content-body","ck-editor","ck-content","ck-toolbar","ck-editor__editable","ck-widget","slate-editor","slate-content","DraftEditor-root","DraftEditor-editorContainer","public-DraftEditor-content","ehfuse-editor","ehfuse-editor-wrapper","ehfuse-editor-content","ehfuse-toolbar","ehfuse-toolbar-group","ehfuse-cursor","text-editor","rich-text-editor","wysiwyg","ace_editor","ace_content"],Ze=(a,p)=>{let h=a.tagName.toLowerCase(),L=["text","password","email","number","search","tel","url","checkbox","radio"];if(h==="input"){let S=a.type;return L.includes(S)}if(["textarea","select","button"].includes(h)||["svg","path","circle","rect","line","polygon","polyline"].includes(h)||a.getAttribute("contenteditable")==="true")return!0;if(p?.excludeSelectors){for(let S of p.excludeSelectors)if(a.matches(S))return!0}return pt(a,p)},pt=(a,p)=>{let h=[...dt,...p?.excludeClasses||[]],L=a,S=0,D=5;for(;L&&S<=D;){if(h.some(x=>L.classList.contains(x)))return!0;if(L.classList.contains("MuiDialogContent-root"))break;L=L.parentElement,S++}return!1},ft={},ht={},mt={},gt={},bt={},xt=(0,n.forwardRef)(({className:a="",style:p={},containerStyle:h={},contentStyle:L={},children:S,onScroll:D,thumb:x=ft,track:E=ht,arrows:P=mt,dragScroll:K=gt,autoHide:ee=bt,showScrollbar:Y=!0,detectInnerScroll:te=!1},F)=>{let U=(0,n.useRef)({});(0,n.useEffect)(()=>{U.current={children:S,onScroll:D,showScrollbar:Y,thumb:x,track:E,arrows:P,dragScroll:K,autoHide:ee}});let fe=(0,n.useRef)(null),u=(0,n.useRef)(null),Z=(0,n.useRef)(null),he=(0,n.useRef)(null),me=(0,n.useRef)(null),B=(0,n.useRef)(null),[J,R]=(0,n.useState)(!1),[A,ie]=(0,n.useState)(!1),[le,De]=(0,n.useState)(!1),[re,ae]=(0,n.useState)({y:0,scrollTop:0}),[se,Be]=(0,n.useState)(0),[Ve,Ne]=(0,n.useState)(0),[Re,Oe]=(0,n.useState)(!1),[ye,ve]=(0,n.useState)(!1),[ce,We]=(0,n.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[rt,H]=(0,n.useState)(null),[b,ge]=(0,n.useState)(null),[qe,He]=(0,n.useState)(!1),we=(0,n.useRef)(null),[Ie,Pe]=(0,n.useState)(!1),Me=(0,n.useRef)(null),be=(0,n.useRef)(null),ue=(0,n.useRef)(null),V=(0,n.useMemo)(()=>{let r=x.color??"#606060";return{width:x.width??8,minHeight:x.minHeight??50,radius:x.radius??(x.width??8)/2,color:r,opacity:x.opacity??.6,hoverColor:x.hoverColor??r,hoverOpacity:x.hoverOpacity??1}},[x]),M=(0,n.useMemo)(()=>({width:E.width??16,color:E.color??"rgba(128, 128, 128, 0.1)",visible:E.visible??!0,alignment:E.alignment??"center",radius:E.radius??V.radius??4,margin:E.margin??4}),[E,V.radius]),W=(0,n.useMemo)(()=>{let r=P.color??"#808080";return{visible:P.visible??!1,step:P.step??50,color:r,opacity:P.opacity??.6,hoverColor:P.hoverColor??r,hoverOpacity:P.hoverOpacity??1}},[P]),Ce=(0,n.useMemo)(()=>({enabled:K.enabled??!0,excludeClasses:K.excludeClasses??[],excludeSelectors:K.excludeSelectors??[]}),[K]),y=(0,n.useMemo)(()=>({enabled:ee.enabled??!0,delay:ee.delay??1500,delayOnWheel:ee.delayOnWheel??700}),[ee]),I=V.width,Se=M.width,de=V.minHeight,q=W.visible,Ee=W.step,Q=(0,n.useCallback)(()=>{if(!u.current)return;let r=document.activeElement;r&&u.current.contains(r)&&r!==u.current||u.current.focus()},[]);(0,n.useImperativeHandle)(F,()=>({getScrollContainer:()=>u.current,scrollTo:r=>{u.current&&u.current.scrollTo(r)},get scrollTop(){return u.current?.scrollTop||0},get scrollHeight(){return u.current?.scrollHeight||0},get clientHeight(){return u.current?.clientHeight||0}}),[]);let $=(0,n.useCallback)(()=>{if(B.current){let l=B.current;if(document.contains(l)&&l.scrollHeight>l.clientHeight+2)return l;B.current=null}if(!u.current)return null;if(Z.current&&Z.current.scrollHeight>u.current.clientHeight+2)return B.current=u.current,u.current;if(!te)return null;let r=u.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let l of r){let o=l;if(o!==u.current&&o.classList.contains("overlay-scrollbar-container"))continue;let f=o.parentElement,w=!1;for(;f&&f!==u.current;){if(f.classList.contains("overlay-scrollbar-container")&&f!==u.current){w=!0;break}f=f.parentElement}if(!w&&o.scrollHeight>o.clientHeight+2)return B.current=o,o}return null},[]),xe=(0,n.useCallback)(()=>$()!==null,[$]),T=(0,n.useCallback)(()=>{Me.current&&(clearTimeout(Me.current),Me.current=null)},[]),je=(0,n.useCallback)(()=>{be.current&&(clearTimeout(be.current),be.current=null)},[]),Xe=(0,n.useCallback)(()=>{ue.current&&(clearTimeout(ue.current),ue.current=null)},[]),z=(0,n.useCallback)(r=>{y.enabled&&(T(),Me.current=setTimeout(()=>{R(!1),Me.current=null},r))},[T,y.enabled]),k=(0,n.useCallback)(()=>{let r=$();if(!r){R(!1),Oe(!1),T();return}if(Oe(!0),!he.current)return;y.enabled||(R(!0),T());let l=r.clientHeight,o=r.scrollHeight,f=r.scrollTop,w=0;if(fe.current){let Fe=window.getComputedStyle(fe.current),Ye=parseFloat(Fe.paddingTop)||0,nt=parseFloat(Fe.paddingBottom)||0;w=Ye+nt}let C=q?I*2+M.margin*4:M.margin*2,O=l-C+w,N=l/o,pe=Math.max(O*N,de),Te=o-l,X=O-pe,_e=Te>0?f/Te*X:0;Be(pe),Ne(_e)},[$,T,q,I,de,y.enabled]),i=(0,n.useCallback)(r=>{r.preventDefault(),r.stopPropagation();let l=$();l&&(ie(!0),ae({y:r.clientY,scrollTop:l.scrollTop}),T(),R(!0),Q())},[$,T,Q]),t=(0,n.useCallback)(r=>{if(!A)return;let l=$();if(!l)return;let o=l.clientHeight,f=l.scrollHeight-o,w=r.clientY-re.y,C=o-se,O=w/C*f,N=Math.max(0,Math.min(f,re.scrollTop+O));l.scrollTop=N,k()},[A,re,se,k,$]),m=(0,n.useCallback)(()=>{ie(!1),xe()&&z(y.delay)},[xe,z,y.delay]),v=(0,n.useCallback)(r=>{if(!he.current)return;let l=he.current.getBoundingClientRect(),o=r.clientY-l.top,f=$();if(!f)return;let w=f.clientHeight,C=f.scrollHeight,O=o/w*(C-w);f.scrollTop=Math.max(0,Math.min(C-w,O)),k(),R(!0),z(y.delay),Q()},[k,z,y.delay,$,Q]),g=(0,n.useCallback)(r=>{if(r.preventDefault(),r.stopPropagation(),!u.current)return;let l=Math.max(0,u.current.scrollTop-Ee);u.current.scrollTop=l,k(),R(!0),z(y.delay),Q()},[k,z,Ee,y.delay,Q]),e=(0,n.useCallback)(r=>{if(r.preventDefault(),r.stopPropagation(),!u.current||!Z.current)return;let l=u.current,o=Z.current.scrollHeight-l.clientHeight,f=Math.min(o,l.scrollTop+Ee);l.scrollTop=f,k(),R(!0),z(y.delay),Q()},[k,z,Ee,y.delay,Q]),j=(0,n.useCallback)(r=>{if(!Ce.enabled)return;let l=r.target;if(Ze(l,Ce)||r.button!==0)return;let o=$();o&&(o.scrollHeight<=o.clientHeight||(r.preventDefault(),ve(!0),We({x:r.clientX,y:r.clientY,scrollTop:o.scrollTop,scrollLeft:o.scrollLeft||0}),T()))},[Ce,Ze,$,T]),G=(0,n.useCallback)(r=>{if(!ye)return;let l=$();if(!l)return;let o=ce.x-r.clientX,f=ce.y-r.clientY;if(Math.abs(f)<3&&Math.abs(o)<3)return;R(!0);let w=Math.max(0,Math.min(l.scrollHeight-l.clientHeight,ce.scrollTop+f));l.scrollTop=w,k()},[ye,ce,$,k]),ne=(0,n.useCallback)(()=>{ve(!1),xe()&&z(y.delay)},[xe,z,y.delay]);(0,n.useEffect)(()=>{let r=C=>{k(),T(),R(!0);let O=Ie?y.delayOnWheel:y.delay;z(O),D&&D(C)},l=()=>{Pe(!0),we.current&&clearTimeout(we.current),we.current=setTimeout(()=>{Pe(!1)},300),T(),Xe(),ue.current=setTimeout(()=>{R(!0),ue.current=null},50)},o=[],f=$();f&&o.push(f);let w=u.current;return w&&!f&&(o.push(w),w.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(C=>{let O=C;if(O!==w&&O.classList.contains("overlay-scrollbar-container"))return;let N=O.parentElement;for(;N&&N!==w;){if(N.classList.contains("overlay-scrollbar-container")&&N!==w)return;N=N.parentElement}o.push(O)})),o.forEach(C=>{C.addEventListener("scroll",r,{passive:!0}),C.addEventListener("wheel",l,{passive:!0})}),()=>{o.forEach(C=>{C.removeEventListener("scroll",r),C.removeEventListener("wheel",l)}),we.current&&clearTimeout(we.current),ue.current&&clearTimeout(ue.current)}},[$,k,D,T,z,y,Ie]),(0,n.useEffect)(()=>{let r=o=>{let f=$();if(!f)return;let{key:w}=o,{scrollTop:C,scrollHeight:O,clientHeight:N}=f,pe=O-N,Te=50,X=null;switch(w){case"ArrowUp":o.preventDefault(),X=Math.max(0,C-Te);break;case"ArrowDown":o.preventDefault(),X=Math.min(pe,C+Te);break;case"PageUp":o.preventDefault(),X=Math.max(0,C-N);break;case"PageDown":o.preventDefault(),X=Math.min(pe,C+N);break;case"Home":o.preventDefault(),X=0;break;case"End":o.preventDefault(),X=pe;break;default:return}if(X!==null){let _e=X/pe,Fe=q?I*2+M.margin*4:M.margin*2,Ye=(N-Fe-se)*_e;Ne(Ye),f.scrollTop=X,T(),R(!0),z(y.delay)}},l=u.current;if(l)return l.addEventListener("keydown",r),()=>{l.removeEventListener("keydown",r)}},[$,q,I,M.margin,se,T,z,y.delay]),(0,n.useEffect)(()=>{if(ye)return document.addEventListener("mousemove",G),document.addEventListener("mouseup",ne),()=>{document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",ne)}},[ye,G,ne]),(0,n.useEffect)(()=>{if(A)return document.addEventListener("mousemove",t),document.addEventListener("mouseup",m),()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",m)}},[A,t,m]),(0,n.useEffect)(()=>{k();let r=setTimeout(()=>{k()},100);return()=>clearTimeout(r)},[k]),(0,n.useLayoutEffect)(()=>{He(!0),k(),!y.enabled&&xe()&&R(!0)},[xe,k,y.enabled]),(0,n.useEffect)(()=>{let r=new ResizeObserver(()=>{k()}),l=[];return u.current&&l.push(u.current),Z.current&&l.push(Z.current),B.current&&document.contains(B.current)&&l.push(B.current),l.forEach(o=>{r.observe(o)}),()=>r.disconnect()},[k]),(0,n.useEffect)(()=>{if(!u.current)return;let r=new MutationObserver(()=>{B.current=null,k()});return r.observe(u.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>r.disconnect()},[k]);let _=Math.max(Se,I);return(0,n.useEffect)(()=>{let r="overlay-scrollbar-webkit-hide",l=document.getElementById(r);l&&l.remove();let o=document.createElement("style");return o.id=r,o.textContent=`
5
5
  .overlay-scrollbar-container::-webkit-scrollbar {
6
6
  display: none !important;
7
7
  width: 0 !important;
@@ -21,7 +21,7 @@
21
21
  outline: 2px solid rgba(0, 123, 255, 0.5);
22
22
  outline-offset: -2px;
23
23
  }
24
- `,document.head.appendChild(o),()=>{let f=document.getElementById(r);f&&f.remove()}},[]),(0,ne.jsxs)("div",{ref:fe,className:`overlay-scrollbar-wrapper ${a}`,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",...p},children:[(0,ne.jsx)("div",{ref:u,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:j,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:xe?"none":"auto",...h},children:(0,ne.jsx)("div",{ref:Z,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",...L},children:T})}),Y&&Ee&&(0,ne.jsxs)("div",{ref:he,className:"overlay-scrollbar-track",onMouseEnter:()=>{S(),be.current=setTimeout(()=>{R(!0),be.current=null},100)},onMouseLeave:()=>{je(),A||B(x.delay)},style:{position:"absolute",top:0,right:0,width:`${_}px`,height:"100%",opacity:J?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[M.visible&&(0,ne.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:r=>{r.preventDefault(),r.stopPropagation(),v(r)},style:{position:"absolute",top:z?`${W.width+M.margin*2}px`:`${M.margin}px`,right:M.alignment==="right"?"0px":`${(_-W.width)/2}px`,width:`${W.width}px`,height:z?`calc(100% - ${W.width*2+M.margin*4}px)`:`calc(100% - ${M.margin*2}px)`,backgroundColor:M.color,borderRadius:`${M.radius}px`,cursor:"pointer"}}),(0,ne.jsx)("div",{ref:me,className:"overlay-scrollbar-thumb",onMouseDown:i,onMouseEnter:()=>Le(!0),onMouseLeave:()=>Le(!1),style:{position:"absolute",top:`${(z?I+M.margin*2:M.margin)+We}px`,right:M.alignment==="right"?"0px":`${(_-I)/2}px`,width:`${I}px`,height:`${Math.max(se,de)}px`,backgroundColor:ie||A?W.hoverColor:W.color,opacity:ie||A?W.hoverOpacity:W.opacity,borderRadius:`${W.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),Y&&Ee&&z&&(0,ne.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:g,onMouseEnter:()=>ge("up"),onMouseLeave:()=>ge(null),style:{position:"absolute",top:`${M.margin}px`,right:M.alignment==="right"?"0px":`${(_-I)/2}px`,width:`${I}px`,height:`${I}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(I*.75,8)}px`,color:b==="up"?q.hoverColor:q.color,userSelect:"none",zIndex:1001,opacity:J?b==="up"?q.hoverOpacity:q.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),Y&&Ee&&z&&(0,ne.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:e,onMouseEnter:()=>ge("down"),onMouseLeave:()=>ge(null),style:{position:"absolute",bottom:`${M.margin}px`,right:M.alignment==="right"?"0px":`${(_-I)/2}px`,width:`${I}px`,height:`${I}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(I*.75,8)}px`,color:b==="down"?q.hoverColor:q.color,userSelect:"none",zIndex:1001,opacity:J?b==="down"?q.hoverOpacity:q.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"})]})}),Je=yt;var s=require("react/jsx-runtime"),xt={alignment:"right",margin:0,radius:0},Qe=5;function vt({data:a,loading:p=!1,columns:h,onRowClick:L,getRowId:T,selectedRowId:D,selectedRowSx:y,rowHeight:E=50,columnHeight:P=56,striped:K,rowDivider:ee=!0,onSort:Y,onLoadMore:te,sortBy:F,sortDirection:U,showPaper:fe=!0,paddingX:u="1rem",paddingTop:Z=0,paddingBottom:he=0,rowHoverColor:me,rowHoverOpacity:V,viewportBuffer:J,overscan:R,scrollbars:A,emptyMessage:oe="NO DATA",LoadingComponent:ie,showFooter:Le,footerHeight:le,footerSx:ae}){let se=Math.max(E*12,480),Ve=Math.max(E*12,480),We=typeof J=="number"?J:J?.top??se,Ne=typeof J=="number"?J:J?.bottom??Ve,Ee=Math.max(E*8,420),Oe=Math.max(E*10,520),xe=typeof R=="number"?R:{main:R?.main??Ee,reverse:R?.reverse??Oe},Re=E+(ee?1:0),ce=!y||typeof y!="function",qe=(0,c.useMemo)(()=>!ce||D===null||D===void 0||!y?null:{[`& tbody tr[data-row-id="${String(D).replace(/["\\]/g,"\\$&")}"]`]:y},[ce,D,y]),rt=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),[H]=(0,c.useState)(()=>typeof window>"u"?!1:window.localStorage.getItem("vdt-perf-debug")==="1"),b=(0,c.useRef)({wheelEvents:0,wheelInputPx:0,wheelHandlerMs:0,wheelRafFlushes:0,wheelRafMs:0,rangeChangedCalls:0,rangeChangedMs:0,rowContentCalls:0,rowContentMs:0,rowContentMaxMs:0,cellRenderCalls:0,cellRenderMs:0,cellRenderMaxMs:0}),ge=(0,c.useCallback)(i=>{if(!H)return;let t=b.current;if(!(t.wheelEvents>0||t.rangeChangedCalls>0||t.rowContentCalls>0||t.cellRenderCalls>0))return;let v=t.rowContentCalls>0?t.rowContentMs/t.rowContentCalls:0,g=t.cellRenderCalls>0?t.cellRenderMs/t.cellRenderCalls:0;console.log("[VDT perf]",{reason:i,wheel:{events:t.wheelEvents,inputPx:Math.round(t.wheelInputPx),handlerMs:Number(t.wheelHandlerMs.toFixed(2)),rafFlushes:t.wheelRafFlushes,rafMs:Number(t.wheelRafMs.toFixed(2))},rangeChanged:{calls:t.rangeChangedCalls,totalMs:Number(t.rangeChangedMs.toFixed(2))},rowContent:{calls:t.rowContentCalls,totalMs:Number(t.rowContentMs.toFixed(2)),avgMs:Number(v.toFixed(3)),maxMs:Number(t.rowContentMaxMs.toFixed(3))},cellRender:{calls:t.cellRenderCalls,totalMs:Number(t.cellRenderMs.toFixed(2)),avgMs:Number(g.toFixed(3)),maxMs:Number(t.cellRenderMaxMs.toFixed(3))}}),b.current={wheelEvents:0,wheelInputPx:0,wheelHandlerMs:0,wheelRafFlushes:0,wheelRafMs:0,rangeChangedCalls:0,rangeChangedMs:0,rowContentCalls:0,rowContentMs:0,rowContentMaxMs:0,cellRenderCalls:0,cellRenderMs:0,cellRenderMaxMs:0}},[H]);(0,c.useEffect)(()=>{if(!H||typeof window>"u")return;console.log("[VDT perf] enabled (localStorage vdt-perf-debug=1)");let i=window.setInterval(()=>{ge("interval")},1500);return()=>{window.clearInterval(i),ge("cleanup")}},[ge,H]);let ze=(0,c.useMemo)(()=>(0,c.forwardRef)((i,t)=>{let m=(0,c.useRef)(null),v=(0,c.useRef)(0),g=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let e=m.current;if(!e)return;let j=G=>{let re=H?performance.now():0;G.preventDefault();let _=G.deltaY;G.deltaMode===1?_*=40:G.deltaMode===2&&(_*=e.clientHeight),H&&(b.current.wheelEvents+=1,b.current.wheelInputPx+=_),v.current+=_,g.current===null&&(g.current=requestAnimationFrame(()=>{let r=H?performance.now():0,l=Math.max(e.clientHeight*.4,160),o=Math.max(-l,Math.min(l,v.current));v.current=0,g.current=null,o!==0&&(e.scrollTop+=o),H&&(b.current.wheelRafFlushes+=1,b.current.wheelRafMs+=performance.now()-r)}),H&&(b.current.wheelHandlerMs+=performance.now()-re))};return e.addEventListener("wheel",j,{passive:!1}),()=>{e.removeEventListener("wheel",j),g.current!==null&&(cancelAnimationFrame(g.current),g.current=null),v.current=0}},[]),(0,s.jsx)(Je,{detectInnerScroll:!0,track:xt,...A,children:(0,s.jsx)(d.TableContainer,{component:d.Box,...i,ref:e=>{m.current=e,typeof t=="function"?t(e):t&&(t.current=e)},sx:{userSelect:"auto",WebkitUserSelect:"auto",position:"relative",width:"100%",height:"100%",overflow:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none",msOverflowStyle:"none",transform:"translateZ(0)",backfaceVisibility:"hidden",willChange:"scroll-position","&::-webkit-scrollbar":{display:"none"},"& .MuiTable-root":{paddingRight:u,paddingTop:Z,paddingBottom:he}}})})}),[]),He=(0,c.useMemo)(()=>{if(K===!0)return"#f5f5f5";if(typeof K=="string")return K},[K]),[ve,Ie]=(0,c.useState)(p),[Pe,we]=(0,c.useState)(0);(0,c.useEffect)(()=>{p&&Ie(!0)},[p]);let be=(0,c.useCallback)(()=>{Ie(!1)},[]),ue=ve,W=p&&a.length>0,M=(0,c.useRef)(!1),q=(0,c.useRef)(null),Me=(0,c.useRef)(L);Me.current=L;let x=(0,c.useRef)(T);x.current=T;let I=!!L,Ce=(0,c.useRef)(!1),de=(0,c.useRef)({x:0,y:0});(0,c.useEffect)(()=>{let i=t=>{let m=t.clientX-de.current.x,v=t.clientY-de.current.y;Math.sqrt(m*m+v*v)>Qe&&(Ce.current=!0)};return document.addEventListener("mousemove",i),()=>{document.removeEventListener("mousemove",i)}},[]),(0,c.useEffect)(()=>{let i=document.querySelector('[data-testid="virtuoso-scroller"]');i&&i.querySelectorAll(".MuiTableSortLabel-root").forEach(m=>{let v=new MouseEvent("mouseleave",{bubbles:!0,cancelable:!0});m.dispatchEvent(v)})},[F]);let z=(0,c.useCallback)(i=>{if(!Y)return;Y(i,F===i&&U==="asc"?"desc":"asc")},[Y,F,U]),De=(0,c.useCallback)(i=>{let t=H?performance.now():0;if(!te){H&&(b.current.rangeChangedCalls+=1,b.current.rangeChangedMs+=performance.now()-t);return}if(p&&a.length===0){H&&(b.current.rangeChangedCalls+=1,b.current.rangeChangedMs+=performance.now()-t);return}let m=a.length>=30;if(i>=a.length-1&&m&&!M.current){M.current=!0;let g=a.length;te(g,50)}H&&(b.current.rangeChangedCalls+=1,b.current.rangeChangedMs+=performance.now()-t)},[a.length,p,te,H]);(0,c.useEffect)(()=>{p||(M.current=!1)},[p]),(0,c.useEffect)(()=>{a.length===0&&we(i=>i+1)},[a.length]);let Q=(0,c.useRef)(a.length);(0,c.useEffect)(()=>{let i=Q.current,t=a.length;if(t>i&&i>0){Q.current=t;return}q.current&&t>0&&t<=i&&q.current.scrollToIndex({index:0,align:"start",behavior:"auto"}),Q.current=t},[a]);let $=(0,c.useCallback)(()=>{let i={},t=[];if(h.forEach(e=>{e.group?(i[e.group]||(i[e.group]=[]),i[e.group].push(e)):t.push(e)}),!(Object.keys(i).length>0))return(0,s.jsx)(d.TableRow,{children:h.map(e=>(0,s.jsx)(d.TableCell,{align:e.align||"left",style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e.sortable?(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:(0,s.jsxs)(d.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>z(String(e.id)),children:[e.text,(0,s.jsx)(d.TableSortLabel,{active:F===e.id,direction:F===e.id?U:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:F===e.id?1:0,transition:"opacity 0.2s ease","& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(180deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(0deg)"}}})]})}):e.text},String(e.id)))});let v=[...t.map(e=>(0,s.jsx)(d.TableCell,{rowSpan:2,align:e.align||"left",style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e.sortable&&Y?(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:(0,s.jsxs)(d.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>z(String(e.id)),children:[e.text,(0,s.jsx)(d.TableSortLabel,{active:F===e.id,direction:F===e.id?U:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:F===e.id?1:0,transition:"opacity 0.2s ease","&:hover":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}},"& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(180deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(0deg)"}}})]})}):e.text},String(e.id))),...Object.entries(i).map(([e,j])=>(0,s.jsx)(d.TableCell,{align:"center",colSpan:j.length,style:{fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e},e))],g=[...Object.values(i).flat().map(e=>(0,s.jsx)(d.TableCell,{align:e.align||"left",style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e.sortable&&Y?(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:(0,s.jsxs)(d.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>z(String(e.id)),children:[e.text,(0,s.jsx)(d.TableSortLabel,{active:F===e.id,direction:F===e.id?U:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:F===e.id?1:0,transition:"opacity 0.2s ease","&:hover":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}},"& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(0deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(180deg)"}}})]})}):e.text},String(e.id)))];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.TableRow,{children:v}),(0,s.jsx)(d.TableRow,{children:g})]})},[h,F,U,z,Y,P]),ye=(0,c.useCallback)((i,t)=>{let m=H?performance.now():0;if(!t){if(H){b.current.rowContentCalls+=1;let g=performance.now()-m;b.current.rowContentMs+=g,b.current.rowContentMaxMs=Math.max(b.current.rowContentMaxMs,g)}return null}let v=h.map(g=>{let e=H?performance.now():0,j=g.render?g.render(t,i):String(t[g.id]||"");if(H){let G=performance.now()-e;b.current.cellRenderCalls+=1,b.current.cellRenderMs+=G,b.current.cellRenderMaxMs=Math.max(b.current.cellRenderMaxMs,G)}return(0,s.jsx)(d.TableCell,{align:g.align||"left",style:{width:g.width,minWidth:g.width,...g.style,padding:"8px 16px"},children:j},String(g.id))});if(H){b.current.rowContentCalls+=1;let g=performance.now()-m;b.current.rowContentMs+=g,b.current.rowContentMaxMs=Math.max(b.current.rowContentMaxMs,g)}return(0,s.jsx)(s.Fragment,{children:v})},[h,H]),S=Le??h.some(i=>typeof i.footer=="function"),je=(0,c.useCallback)(()=>{if(!S)return null;let i=[];for(let t=0;t<h.length;t+=1){let m=h[t],v=m.footerColSpan&&m.footerColSpan>1?Math.min(m.footerColSpan,h.length-t):1;i.push((0,s.jsx)(d.TableCell,{align:m.align||"left",colSpan:v>1?v:void 0,style:{...v>1?{}:{width:m.width,minWidth:m.width},...m.style,fontWeight:"bold",padding:"16px"},children:m.footer?m.footer(a):null},String(m.id))),t+=v-1}return(0,s.jsx)(d.TableRow,{children:i})},[S,h,a]),B=(0,c.useMemo)(()=>({Scroller:ze,Table:i=>(0,s.jsx)(d.Table,{...i,sx:{borderCollapse:"separate",tableLayout:"fixed",marginRight:"16px",...S?{height:"100%"}:{}}}),TableHead:(0,c.forwardRef)((i,t)=>(0,s.jsx)(d.TableHead,{...i,ref:t,sx:{userSelect:"none","& tr":{height:P,"& th":{padding:"16px",position:"sticky",top:0,zIndex:2,fontWeight:"bold"}}}})),TableRow:i=>{let{item:t,selected:m,"aria-selected":v,className:g,...e}=i,j=e["data-index"]??0,G=j%2===1,re=t&&x.current?x.current(t,j):j,_=!ce&&D!==null&&D!==void 0&&re===D,r=_&&y?typeof y=="function"?y(t,j):y:void 0,l=String(g??"").split(/\s+/).filter(o=>o!=="Mui-selected"&&o!=="Mui-focusVisible").join(" ");return(0,s.jsx)(d.TableRow,{...e,"data-row-id":re!=null?String(re):void 0,className:l||void 0,selected:_,onMouseDown:o=>{Ce.current=!1,de.current={x:o.clientX,y:o.clientY}},onClick:o=>{let f=o.clientX-de.current.x,w=o.clientY-de.current.y;if(Math.sqrt(f*f+w*w)>Qe||Ce.current){o.preventDefault(),o.stopPropagation(),Ce.current=!1;return}t&&Me.current&&Me.current(t,j),Ce.current=!1},sx:[{userSelect:"none",height:E,backgroundColor:G&&He?He:"transparent","& td":{padding:"8px 16px",borderBottom:ee?"1px solid rgba(224, 224, 224, 1)":"none"},"& th":{padding:"8px 16px",borderBottom:"none"},"&:hover":I&&!_?{backgroundColor:o=>{let f=o.palette.mode==="dark",C=me??"#000000",O=V??.06;if(!me)return f?`rgba(255, 255, 255, ${O})`:`rgba(0, 0, 0, ${O})`;let N=C.replace("#","").trim();if(N.length!==6)return C;let pe=parseInt(N.substring(0,2),16),Te=parseInt(N.substring(2,4),16),X=parseInt(N.substring(4,6),16);return`rgba(${pe}, ${Te}, ${X}, ${O})`}}:void 0,cursor:I?"pointer":void 0},r]})},TableBody:(0,c.forwardRef)((i,t)=>{let{children:m,...v}=i;return(0,s.jsxs)(d.TableBody,{...v,ref:t,sx:S?{height:"100%"}:void 0,children:[m,S&&(0,s.jsx)("tr",{"aria-hidden":!0,style:{height:"100%"},children:(0,s.jsx)("td",{colSpan:h.length,style:{padding:0,border:0}})})]})}),TableFoot:(0,c.forwardRef)((i,t)=>(0,s.jsx)(d.TableFooter,{...i,ref:t,sx:[{position:"sticky",bottom:0,zIndex:2,backgroundColor:m=>m.palette.mode==="dark"?"#1e1e1e":"#ffffff","& tr":{height:le??E},"& td":{padding:"16px",color:"inherit",fontSize:"0.875rem",borderTop:"1px solid #000000",borderBottom:"none"}},...Array.isArray(ae)?ae:ae?[ae]:[]]}))}),[I,ce?null:D,y,E,He,ee,P,me,V,ze,le,ae,S,h]),k=(0,s.jsxs)(d.Box,{sx:{position:"relative",height:"100%",width:"100%","& .MuiTableHead-root":{backgroundColor:i=>i.palette.mode==="dark"?"#1e1e1e !important":"#ffffff !important"},...qe??{}},children:[(0,s.jsx)(et.TableVirtuoso,{ref:q,data:a,totalCount:te?a.length+1:a.length,defaultItemHeight:Re,fixedItemHeight:Re,fixedHeaderContent:$,fixedFooterContent:S?je:void 0,itemContent:ye,endReached:De,style:{height:"100%"},increaseViewportBy:{top:We,bottom:Ne},overscan:xe,followOutput:!1,components:B},Pe),a.length===0&&!p&&(0,s.jsx)(d.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:typeof oe=="string"?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Box,{sx:{width:48,height:48,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5f5",color:"#999"},children:"\u{1F4C4}"}),(0,s.jsx)(d.Typography,{variant:"body1",sx:{color:"text.secondary"},children:oe})]}):oe}),ue&&(0,s.jsx)(s.Fragment,{children:ie?(0,s.jsx)(ie,{visible:p,onComplete:be}):(0,s.jsx)(Ke,{visible:p,onComplete:be,size:40,indicator:(0,s.jsx)(Ue,{}),sx:{top:`${h.some(i=>i.group)?P*2:P}px`,bottom:`${S?le??E:0}px`},background:{show:a.length===0,opacity:.8}})})]});return fe?(0,s.jsx)(d.Paper,{className:"grow",elevation:1,sx:{padding:0,paddingLeft:u,height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:k}):(0,s.jsx)(d.Box,{className:"grow",style:{padding:0,paddingLeft:u,height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:k})}var tt=(0,c.memo)(vt);
24
+ `,document.head.appendChild(o),()=>{let f=document.getElementById(r);f&&f.remove()}},[]),(0,oe.jsxs)("div",{ref:fe,className:`overlay-scrollbar-wrapper ${a}`,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",...p},children:[(0,oe.jsx)("div",{ref:u,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:j,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:ye?"none":"auto",...h},children:(0,oe.jsx)("div",{ref:Z,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",...L},children:S})}),Y&&Re&&(0,oe.jsxs)("div",{ref:he,className:"overlay-scrollbar-track",onMouseEnter:()=>{T(),be.current=setTimeout(()=>{R(!0),be.current=null},100)},onMouseLeave:()=>{je(),A||z(y.delay)},style:{position:"absolute",top:0,right:0,width:`${_}px`,height:"100%",opacity:J?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[M.visible&&(0,oe.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:r=>{r.preventDefault(),r.stopPropagation(),v(r)},style:{position:"absolute",top:q?`${V.width+M.margin*2}px`:`${M.margin}px`,right:M.alignment==="right"?"0px":`${(_-V.width)/2}px`,width:`${V.width}px`,height:q?`calc(100% - ${V.width*2+M.margin*4}px)`:`calc(100% - ${M.margin*2}px)`,backgroundColor:M.color,borderRadius:`${M.radius}px`,cursor:"pointer"}}),(0,oe.jsx)("div",{ref:me,className:"overlay-scrollbar-thumb",onMouseDown:i,onMouseEnter:()=>De(!0),onMouseLeave:()=>De(!1),style:{position:"absolute",top:`${(q?I+M.margin*2:M.margin)+Ve}px`,right:M.alignment==="right"?"0px":`${(_-I)/2}px`,width:`${I}px`,height:`${Math.max(se,de)}px`,backgroundColor:le||A?V.hoverColor:V.color,opacity:le||A?V.hoverOpacity:V.opacity,borderRadius:`${V.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),Y&&Re&&q&&(0,oe.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:g,onMouseEnter:()=>ge("up"),onMouseLeave:()=>ge(null),style:{position:"absolute",top:`${M.margin}px`,right:M.alignment==="right"?"0px":`${(_-I)/2}px`,width:`${I}px`,height:`${I}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(I*.75,8)}px`,color:b==="up"?W.hoverColor:W.color,userSelect:"none",zIndex:1001,opacity:J?b==="up"?W.hoverOpacity:W.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),Y&&Re&&q&&(0,oe.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:e,onMouseEnter:()=>ge("down"),onMouseLeave:()=>ge(null),style:{position:"absolute",bottom:`${M.margin}px`,right:M.alignment==="right"?"0px":`${(_-I)/2}px`,width:`${I}px`,height:`${I}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(I*.75,8)}px`,color:b==="down"?W.hoverColor:W.color,userSelect:"none",zIndex:1001,opacity:J?b==="down"?W.hoverOpacity:W.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"})]})}),Je=xt;var s=require("react/jsx-runtime"),yt={alignment:"right",margin:0,radius:0},Qe=5;function vt({data:a,loading:p=!1,columns:h,onRowClick:L,getRowId:S,selectedRowId:D,selectedRowSx:x,rowHeight:E=50,columnHeight:P=56,striped:K,rowDivider:ee=!0,onSort:Y,onLoadMore:te,sortBy:F,sortDirection:U,showPaper:fe=!0,paddingX:u="1rem",paddingTop:Z=0,paddingBottom:he=0,rowHoverColor:me,rowHoverOpacity:B,viewportBuffer:J,overscan:R,scrollbars:A,emptyMessage:ie="NO DATA",LoadingComponent:le,showFooter:De,footerHeight:re,footerSx:ae}){let se=Math.max(E*12,480),Be=Math.max(E*12,480),Ve=typeof J=="number"?J:J?.top??se,Ne=typeof J=="number"?J:J?.bottom??Be,Re=Math.max(E*8,420),Oe=Math.max(E*10,520),ye=typeof R=="number"?R:{main:R?.main??Re,reverse:R?.reverse??Oe},ve=E+(ee?1:0),ce=!x||typeof x!="function",We=(0,c.useMemo)(()=>!ce||D===null||D===void 0||!x?null:{[`& tbody tr[data-row-id="${String(D).replace(/["\\]/g,"\\$&")}"]`]:x},[ce,D,x]),rt=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),[H]=(0,c.useState)(()=>typeof window>"u"?!1:window.localStorage.getItem("vdt-perf-debug")==="1"),b=(0,c.useRef)({wheelEvents:0,wheelInputPx:0,wheelHandlerMs:0,wheelRafFlushes:0,wheelRafMs:0,rangeChangedCalls:0,rangeChangedMs:0,rowContentCalls:0,rowContentMs:0,rowContentMaxMs:0,cellRenderCalls:0,cellRenderMs:0,cellRenderMaxMs:0}),ge=(0,c.useCallback)(i=>{if(!H)return;let t=b.current;if(!(t.wheelEvents>0||t.rangeChangedCalls>0||t.rowContentCalls>0||t.cellRenderCalls>0))return;let v=t.rowContentCalls>0?t.rowContentMs/t.rowContentCalls:0,g=t.cellRenderCalls>0?t.cellRenderMs/t.cellRenderCalls:0;console.log("[VDT perf]",{reason:i,wheel:{events:t.wheelEvents,inputPx:Math.round(t.wheelInputPx),handlerMs:Number(t.wheelHandlerMs.toFixed(2)),rafFlushes:t.wheelRafFlushes,rafMs:Number(t.wheelRafMs.toFixed(2))},rangeChanged:{calls:t.rangeChangedCalls,totalMs:Number(t.rangeChangedMs.toFixed(2))},rowContent:{calls:t.rowContentCalls,totalMs:Number(t.rowContentMs.toFixed(2)),avgMs:Number(v.toFixed(3)),maxMs:Number(t.rowContentMaxMs.toFixed(3))},cellRender:{calls:t.cellRenderCalls,totalMs:Number(t.cellRenderMs.toFixed(2)),avgMs:Number(g.toFixed(3)),maxMs:Number(t.cellRenderMaxMs.toFixed(3))}}),b.current={wheelEvents:0,wheelInputPx:0,wheelHandlerMs:0,wheelRafFlushes:0,wheelRafMs:0,rangeChangedCalls:0,rangeChangedMs:0,rowContentCalls:0,rowContentMs:0,rowContentMaxMs:0,cellRenderCalls:0,cellRenderMs:0,cellRenderMaxMs:0}},[H]);(0,c.useEffect)(()=>{if(!H||typeof window>"u")return;console.log("[VDT perf] enabled (localStorage vdt-perf-debug=1)");let i=window.setInterval(()=>{ge("interval")},1500);return()=>{window.clearInterval(i),ge("cleanup")}},[ge,H]);let qe=(0,c.useMemo)(()=>(0,c.forwardRef)((i,t)=>{let m=(0,c.useRef)(null),v=(0,c.useRef)(0),g=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let e=m.current;if(!e)return;let j=G=>{let ne=H?performance.now():0;G.preventDefault();let _=G.deltaY;G.deltaMode===1?_*=40:G.deltaMode===2&&(_*=e.clientHeight),H&&(b.current.wheelEvents+=1,b.current.wheelInputPx+=_),v.current+=_,g.current===null&&(g.current=requestAnimationFrame(()=>{let r=H?performance.now():0,l=Math.max(e.clientHeight*.4,160),o=Math.max(-l,Math.min(l,v.current));v.current=0,g.current=null,o!==0&&(e.scrollTop+=o),H&&(b.current.wheelRafFlushes+=1,b.current.wheelRafMs+=performance.now()-r)}),H&&(b.current.wheelHandlerMs+=performance.now()-ne))};return e.addEventListener("wheel",j,{passive:!1}),()=>{e.removeEventListener("wheel",j),g.current!==null&&(cancelAnimationFrame(g.current),g.current=null),v.current=0}},[]),(0,s.jsx)(Je,{detectInnerScroll:!0,track:yt,...A,children:(0,s.jsx)(d.TableContainer,{component:d.Box,...i,ref:e=>{m.current=e,typeof t=="function"?t(e):t&&(t.current=e)},sx:{userSelect:"auto",WebkitUserSelect:"auto",position:"relative",width:"100%",height:"100%",overflow:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none",msOverflowStyle:"none",transform:"translateZ(0)",backfaceVisibility:"hidden",willChange:"scroll-position","&::-webkit-scrollbar":{display:"none"},"& .MuiTable-root":{paddingRight:u,paddingTop:Z,paddingBottom:he}}})})}),[]),He=(0,c.useMemo)(()=>{if(K===!0)return"#f5f5f5";if(typeof K=="string")return K},[K]),[we,Ie]=(0,c.useState)(p),[Pe,Me]=(0,c.useState)(0);(0,c.useEffect)(()=>{p&&Ie(!0)},[p]);let be=(0,c.useCallback)(()=>{Ie(!1)},[]),ue=we,V=p&&a.length>0,M=(0,c.useRef)(!1),W=(0,c.useRef)(null),Ce=(0,c.useRef)(L);Ce.current=L;let y=(0,c.useRef)(S);y.current=S;let I=!!L,Se=(0,c.useRef)(!1),de=(0,c.useRef)({x:0,y:0});(0,c.useEffect)(()=>{let i=t=>{let m=t.clientX-de.current.x,v=t.clientY-de.current.y;Math.sqrt(m*m+v*v)>Qe&&(Se.current=!0)};return document.addEventListener("mousemove",i),()=>{document.removeEventListener("mousemove",i)}},[]),(0,c.useEffect)(()=>{let i=document.querySelector('[data-testid="virtuoso-scroller"]');i&&i.querySelectorAll(".MuiTableSortLabel-root").forEach(m=>{let v=new MouseEvent("mouseleave",{bubbles:!0,cancelable:!0});m.dispatchEvent(v)})},[F]);let q=(0,c.useCallback)(i=>{if(!Y)return;Y(i,F===i&&U==="asc"?"desc":"asc")},[Y,F,U]),Ee=(0,c.useCallback)(i=>{let t=H?performance.now():0;if(!te){H&&(b.current.rangeChangedCalls+=1,b.current.rangeChangedMs+=performance.now()-t);return}if(p&&a.length===0){H&&(b.current.rangeChangedCalls+=1,b.current.rangeChangedMs+=performance.now()-t);return}let m=a.length>=30;if(i>=a.length-1&&m&&!M.current){M.current=!0;let g=a.length;te(g,50)}H&&(b.current.rangeChangedCalls+=1,b.current.rangeChangedMs+=performance.now()-t)},[a.length,p,te,H]);(0,c.useEffect)(()=>{p||(M.current=!1)},[p]),(0,c.useEffect)(()=>{a.length===0&&Me(i=>i+1)},[a.length]);let Q=(0,c.useRef)(a.length);(0,c.useEffect)(()=>{let i=Q.current,t=a.length;if(t>i&&i>0){Q.current=t;return}W.current&&t>0&&t<=i&&W.current.scrollToIndex({index:0,align:"start",behavior:"auto"}),Q.current=t},[a]);let $=(0,c.useCallback)(()=>{let i={},t=[];if(h.forEach(e=>{e.group?(i[e.group]||(i[e.group]=[]),i[e.group].push(e)):t.push(e)}),!(Object.keys(i).length>0))return(0,s.jsx)(d.TableRow,{children:h.map(e=>(0,s.jsx)(d.TableCell,{align:e.align||"left",style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e.sortable?(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:(0,s.jsxs)(d.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>q(String(e.id)),children:[e.text,(0,s.jsx)(d.TableSortLabel,{active:F===e.id,direction:F===e.id?U:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:F===e.id?1:0,transition:"opacity 0.2s ease","& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(180deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(0deg)"}}})]})}):e.text},String(e.id)))});let v=[...t.map(e=>(0,s.jsx)(d.TableCell,{rowSpan:2,align:e.align||"left",style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e.sortable&&Y?(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:(0,s.jsxs)(d.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>q(String(e.id)),children:[e.text,(0,s.jsx)(d.TableSortLabel,{active:F===e.id,direction:F===e.id?U:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:F===e.id?1:0,transition:"opacity 0.2s ease","&:hover":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}},"& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(180deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(0deg)"}}})]})}):e.text},String(e.id))),...Object.entries(i).map(([e,j])=>(0,s.jsx)(d.TableCell,{align:"center",colSpan:j.length,style:{fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e},e))],g=[...Object.values(i).flat().map(e=>(0,s.jsx)(d.TableCell,{align:e.align||"left",style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e.sortable&&Y?(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:(0,s.jsxs)(d.Box,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>q(String(e.id)),children:[e.text,(0,s.jsx)(d.TableSortLabel,{active:F===e.id,direction:F===e.id?U:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:F===e.id?1:0,transition:"opacity 0.2s ease","&:hover":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}},"& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(0deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(180deg)"}}})]})}):e.text},String(e.id)))];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.TableRow,{children:v}),(0,s.jsx)(d.TableRow,{children:g})]})},[h,F,U,q,Y,P]),xe=(0,c.useCallback)((i,t)=>{let m=H?performance.now():0;if(!t){if(H){b.current.rowContentCalls+=1;let g=performance.now()-m;b.current.rowContentMs+=g,b.current.rowContentMaxMs=Math.max(b.current.rowContentMaxMs,g)}return null}let v=h.map(g=>{let e=H?performance.now():0,j=g.render?g.render(t,i):String(t[g.id]||"");if(H){let G=performance.now()-e;b.current.cellRenderCalls+=1,b.current.cellRenderMs+=G,b.current.cellRenderMaxMs=Math.max(b.current.cellRenderMaxMs,G)}return(0,s.jsx)(d.TableCell,{align:g.align||"left",style:{width:g.width,minWidth:g.width,...g.style,padding:"8px 16px"},children:j},String(g.id))});if(H){b.current.rowContentCalls+=1;let g=performance.now()-m;b.current.rowContentMs+=g,b.current.rowContentMaxMs=Math.max(b.current.rowContentMaxMs,g)}return(0,s.jsx)(s.Fragment,{children:v})},[h,H]),T=De??h.some(i=>typeof i.footer=="function"),je=(0,c.useCallback)(()=>{if(!T)return null;let i=[];for(let t=0;t<h.length;t+=1){let m=h[t],v=m.footerColSpan&&m.footerColSpan>1?Math.min(m.footerColSpan,h.length-t):1;i.push((0,s.jsx)(d.TableCell,{align:m.align||"left",colSpan:v>1?v:void 0,style:{...v>1?{}:{width:m.width,minWidth:m.width},...m.style,fontWeight:"bold",padding:"16px"},children:m.footer?m.footer(a):null},String(m.id))),t+=v-1}return(0,s.jsx)(d.TableRow,{children:i})},[T,h,a]),z=(0,c.useMemo)(()=>({Scroller:qe,Table:i=>(0,s.jsx)(d.Table,{...i,sx:{borderCollapse:"separate",tableLayout:"fixed",marginRight:"16px",...T?{height:"100%"}:{}}}),TableHead:(0,c.forwardRef)((i,t)=>(0,s.jsx)(d.TableHead,{...i,ref:t,sx:{userSelect:"none","& tr":{height:P,"& th":{padding:"16px",position:"sticky",top:0,zIndex:2,fontWeight:"bold"}}}})),TableRow:i=>{let{item:t,selected:m,"aria-selected":v,className:g,...e}=i,j=e["data-index"]??0,G=j%2===1,ne=t&&y.current?y.current(t,j):j,_=!ce&&D!==null&&D!==void 0&&ne===D,r=_&&x?typeof x=="function"?x(t,j):x:void 0,l=String(g??"").split(/\s+/).filter(o=>o!=="Mui-selected"&&o!=="Mui-focusVisible").join(" ");return(0,s.jsx)(d.TableRow,{...e,"data-row-id":ne!=null?String(ne):void 0,className:l||void 0,selected:_,onMouseDown:o=>{Se.current=!1,de.current={x:o.clientX,y:o.clientY}},onClick:o=>{let f=o.clientX-de.current.x,w=o.clientY-de.current.y;if(Math.sqrt(f*f+w*w)>Qe||Se.current){o.preventDefault(),o.stopPropagation(),Se.current=!1;return}t&&Ce.current&&Ce.current(t,j),Se.current=!1},sx:[{userSelect:"none",height:ve,maxHeight:ve,boxSizing:"border-box",backgroundColor:G&&He?He:"transparent","& td":{padding:"8px 16px",boxSizing:"border-box",borderBottom:ee?"1px solid rgba(224, 224, 224, 1)":"none"},"& th":{padding:"8px 16px",borderBottom:"none"},"&:hover":I&&!_?{backgroundColor:o=>{let f=o.palette.mode==="dark",C=me??"#000000",O=B??.06;if(!me)return f?`rgba(255, 255, 255, ${O})`:`rgba(0, 0, 0, ${O})`;let N=C.replace("#","").trim();if(N.length!==6)return C;let pe=parseInt(N.substring(0,2),16),Te=parseInt(N.substring(2,4),16),X=parseInt(N.substring(4,6),16);return`rgba(${pe}, ${Te}, ${X}, ${O})`}}:void 0,cursor:I?"pointer":void 0},r]})},TableBody:(0,c.forwardRef)((i,t)=>{let{children:m,...v}=i;return(0,s.jsxs)(d.TableBody,{...v,ref:t,sx:T?{height:"100%"}:void 0,children:[m,T&&(0,s.jsx)("tr",{"aria-hidden":!0,style:{height:"100%"},children:(0,s.jsx)("td",{colSpan:h.length,style:{padding:0,border:0}})})]})}),TableFoot:(0,c.forwardRef)((i,t)=>(0,s.jsx)(d.TableFooter,{...i,ref:t,sx:[{"& tr":{height:re??E,maxHeight:re??E,boxSizing:"border-box"},"& td":{height:re??E,boxSizing:"border-box",backgroundColor:m=>m.palette.mode==="dark"?"#1e1e1e":"#ffffff",padding:"0 16px",color:"inherit",fontSize:"0.875rem",border:"none",boxShadow:"inset 0 1px 0 0 #000000"}},...Array.isArray(ae)?ae:ae?[ae]:[]]}))}),[I,ce?null:D,x,E,He,ee,P,me,B,qe,re,ae,T,h]),k=(0,s.jsxs)(d.Box,{sx:{position:"relative",height:"100%",width:"100%","& .MuiTableHead-root":{backgroundColor:i=>i.palette.mode==="dark"?"#1e1e1e !important":"#ffffff !important"},...We??{}},children:[(0,s.jsx)(et.TableVirtuoso,{ref:W,data:a,totalCount:te?a.length+1:a.length,defaultItemHeight:ve,fixedItemHeight:ve,fixedHeaderContent:$,fixedFooterContent:T?je:void 0,itemContent:xe,endReached:Ee,style:{height:"100%"},increaseViewportBy:{top:Ve,bottom:Ne},overscan:ye,followOutput:!1,components:z},Pe),a.length===0&&!p&&(0,s.jsx)(d.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:typeof ie=="string"?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Box,{sx:{width:48,height:48,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5f5",color:"#999"},children:"\u{1F4C4}"}),(0,s.jsx)(d.Typography,{variant:"body1",sx:{color:"text.secondary"},children:ie})]}):ie}),ue&&(0,s.jsx)(s.Fragment,{children:le?(0,s.jsx)(le,{visible:p,onComplete:be}):(0,s.jsx)(Ke,{visible:p,onComplete:be,size:40,indicator:(0,s.jsx)(Ue,{}),sx:{top:`${h.some(i=>i.group)?P*2:P}px`,bottom:`${T?re??E:0}px`},background:{show:a.length===0,opacity:.8}})})]});return fe?(0,s.jsx)(d.Paper,{className:"grow",elevation:1,sx:{padding:0,paddingLeft:u,height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:k}):(0,s.jsx)(d.Box,{className:"grow",style:{padding:0,paddingLeft:u,height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:k})}var tt=(0,c.memo)(vt);
25
25
  /**
26
26
  * Virtual Data Table - A high-performance virtual data table component for React
27
27
  *