import{R as o,j as l,as as v}from"./app-BgLa5dit.js";const S=o.forwardRef((t,u)=>{const[w,d]=o.useState(t.containerHeight||0),[f,m]=o.useState(0),i=o.useRef(null);o.useEffect(()=>{var e;t.containerHeight||d(((e=i.current)==null?void 0:e.clientHeight)??0)},[i.current]);const r=t.items.length,h=Math.ceil(w/t.rowHeight),s=t.rowHeight*r,c=Math.max(0,Math.floor(f/t.rowHeight)-h),H=Math.min(r,c+h*3);function x(e){m(e.currentTarget.scrollTop)}function R(){var g;const e=((g=i.current)==null?void 0:g.getBoundingClientRect().top)??0,n=window.scrollY+e+(t.tableHeightOffset||30);return{height:t.containerHeight||`calc(100vh - ${n}px)`,minHeight:`${t.rowHeight*5}px`,overflow:"auto"}}function b(){const e=[];let n=c;for(;n<H;){const a=t.items[n];a&&e.push(t.getComponent(a,n)),n++}return e}return l.jsx("div",{style:R(),ref:i,children:l.jsx(v.Scrollbars,{onScroll:x,autoHeightMin:s,autoHeightMax:s,ref:u,children:l.jsx("div",{style:{height:s,paddingTop:c*t.rowHeight},children:l.jsxs("ul",{className:"w-100 position-relative d-table striped-list list-unstyled no-full-width",children:[!!t.staticComponentAboveRows&&t.staticComponentAboveRows,b(),!!t.staticComponentBelowRows&&t.staticComponentBelowRows]})})})})});export{S as W};
//# sourceMappingURL=D8ca7W7r.chunk.js.map
