react-virtuoso 4.14.1 → 4.16.1
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.cjs +1 -1
- package/dist/index.d.ts +25 -0
- package/dist/index.mjs +1270 -1207
- package/package.json +6 -2
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react/jsx-runtime"),E=require("react"),lo=require("react-dom"),Ce=0,zt=1,Ut=2,kn=4;function cn(t){return()=>t}function co(t){t()}function te(t,e){return n=>t(e(n))}function un(t,e){return()=>t(e)}function uo(t,e){return n=>t(e,n)}function Me(t){return t!==void 0}function ao(...t){return()=>{t.map(co)}}function Kt(){}function we(t,e){return e(t),t}function fo(t,e){return e(t)}function X(...t){return t}function U(t,e){return t(zt,e)}function G(t,e){t(Ce,e)}function je(t){t(Ut)}function ot(t){return t(kn)}function O(t,e){return U(t,uo(e,Ce))}function Tt(t,e){const n=t(zt,o=>{n(),e(o)});return n}function an(t){let e,n;return o=>r=>{e=r,n&&clearTimeout(n),n=setTimeout(()=>{o(e)},t)}}function Bn(t,e){return t===e}function Y(t=Bn){let e;return n=>o=>{t(e,o)||(e=o,n(o))}}function M(t){return e=>n=>{t(n)&&e(n)}}function H(t){return e=>te(e,t)}function bt(t){return e=>()=>{e(t)}}function I(t,...e){const n=mo(...e);return(o,r)=>{switch(o){case Ut:je(t);return;case zt:return U(t,n(r))}}}function Rt(t,e){return n=>o=>{n(e=t(e,o))}}function Wt(t){return e=>n=>{t>0?t--:e(n)}}function Bt(t){let e=null,n;return o=>r=>{e=r,!n&&(n=setTimeout(()=>{n=void 0,o(e)},t))}}function _(...t){const e=new Array(t.length);let n=0,o=null;const r=Math.pow(2,t.length)-1;return t.forEach((s,i)=>{const l=Math.pow(2,i);U(s,c=>{const a=n;n=n|l,e[i]=c,a!==r&&n===r&&o&&(o(),o=null)})}),s=>i=>{const l=()=>{s([i].concat(e))};n===r?l():o=l}}function mo(...t){return e=>t.reduceRight(fo,e)}function po(t){let e,n;const o=()=>e==null?void 0:e();return function(r,s){switch(r){case zt:return s?n===s?void 0:(o(),n=s,e=U(t,s),e):(o(),Kt);case Ut:o(),n=null;return}}}function w(t){let e=t;const n=D();return(o,r)=>{switch(o){case Ce:e=r;break;case zt:{r(e);break}case kn:return e}return n(o,r)}}function ct(t,e){return we(w(e),n=>O(t,n))}function D(){const t=[];return(e,n)=>{switch(e){case Ce:t.slice().forEach(o=>{o(n)});return;case Ut:t.splice(0,t.length);return;case zt:return t.push(n),()=>{const o=t.indexOf(n);o>-1&&t.splice(o,1)}}}}function ht(t){return we(D(),e=>O(t,e))}function $(t,e=[],{singleton:n}={singleton:!0}){return{constructor:t,dependencies:e,id:ho(),singleton:n}}const ho=()=>Symbol();function go(t){const e=new Map,n=({constructor:o,dependencies:r,id:s,singleton:i})=>{if(i&&e.has(s))return e.get(s);const l=o(r.map(c=>n(c)));return i&&e.set(s,l),l};return n(t)}function rt(...t){const e=D(),n=new Array(t.length);let o=0;const r=Math.pow(2,t.length)-1;return t.forEach((s,i)=>{const l=Math.pow(2,i);U(s,c=>{n[i]=c,o=o|l,o===r&&G(e,n)})}),function(s,i){switch(s){case Ut:{je(e);return}case zt:return o===r&&i(n),U(e,i)}}}function P(t,e=Bn){return I(t,Y(e))}function Fe(...t){return function(e,n){switch(e){case Ut:return;case zt:return ao(...t.map(o=>U(o,n)))}}}var at=(t=>(t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR",t))(at||{});const xo={0:"debug",3:"error",1:"log",2:"warn"},Io=()=>typeof globalThis>"u"?window:globalThis,Vt=$(()=>{const t=w(3);return{log:w((n,o,r=1)=>{var i;const s=(i=Io().VIRTUOSO_LOG_LEVEL)!=null?i:ot(t);r>=s&&console[xo[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,o)}),logLevel:t}},[],{singleton:!0});function Et(t,e,n){return Ae(t,e,n).callbackRef}function Ae(t,e,n){const o=E.useRef(null);let r=i=>{};const s=E.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(i=>{const l=()=>{const c=i[0].target;c.offsetParent!==null&&t(c)};n?l():requestAnimationFrame(l)}):null,[t,n]);return r=i=>{i&&e?(s==null||s.observe(i),o.current=i):(o.current&&(s==null||s.unobserve(o.current)),o.current=null)},{callbackRef:r,ref:o}}function Fn(t,e,n,o,r,s,i,l,c){const a=E.useCallback(m=>{const S=So(m.children,e,l?"offsetWidth":"offsetHeight",r);let h=m.parentElement;for(;!h.dataset.virtuosoScroller;)h=h.parentElement;const x=h.lastElementChild.dataset.viewportType==="window";let C;x&&(C=h.ownerDocument.defaultView);const v=i?l?i.scrollLeft:i.scrollTop:x?l?C.scrollX||C.document.documentElement.scrollLeft:C.scrollY||C.document.documentElement.scrollTop:l?h.scrollLeft:h.scrollTop,g=i?l?i.scrollWidth:i.scrollHeight:x?l?C.document.documentElement.scrollWidth:C.document.documentElement.scrollHeight:l?h.scrollWidth:h.scrollHeight,p=i?l?i.offsetWidth:i.offsetHeight:x?l?C.innerWidth:C.innerHeight:l?h.offsetWidth:h.offsetHeight;o({scrollHeight:g,scrollTop:Math.max(v,0),viewportHeight:p}),s==null||s(l?dn("column-gap",getComputedStyle(m).columnGap,r):dn("row-gap",getComputedStyle(m).rowGap,r)),S!==null&&t(S)},[t,e,r,s,i,o,l]);return Ae(a,n,c)}function So(t,e,n,o){const r=t.length;if(r===0)return null;const s=[];for(let i=0;i<r;i++){const l=t.item(i);if(l.dataset.index===void 0)continue;const c=parseInt(l.dataset.index),a=parseFloat(l.dataset.knownSize),m=e(l,n);if(m===0&&o("Zero-sized element, this should not happen",{child:l},at.ERROR),m===a)continue;const S=s[s.length-1];s.length===0||S.size!==m||S.endIndex!==c-1?s.push({endIndex:c,size:m,startIndex:c}):s[s.length-1].endIndex++}return s}function dn(t,e,n){return e!=="normal"&&!(e!=null&&e.endsWith("px"))&&n(`${t} was not resolved to pixel value correctly`,e,at.WARN),e==="normal"?0:parseInt(e!=null?e:"0",10)}function Ge(t,e,n){const o=E.useRef(null),r=E.useCallback(c=>{if(!(c!=null&&c.offsetParent))return;const a=c.getBoundingClientRect(),m=a.width;let S,h;if(e){const x=e.getBoundingClientRect(),C=a.top-x.top;h=x.height-Math.max(0,C),S=C+e.scrollTop}else{const x=i.current.ownerDocument.defaultView;h=x.innerHeight-Math.max(0,a.top),S=a.top+x.scrollY}o.current={offsetTop:S,visibleHeight:h,visibleWidth:m},t(o.current)},[t,e]),{callbackRef:s,ref:i}=Ae(r,!0,n),l=E.useCallback(()=>{r(i.current)},[r,i]);return E.useEffect(()=>{var c;if(e){e.addEventListener("scroll",l);const a=new ResizeObserver(()=>{requestAnimationFrame(l)});return a.observe(e),()=>{e.removeEventListener("scroll",l),a.unobserve(e)}}else{const a=(c=i.current)==null?void 0:c.ownerDocument.defaultView;return a==null||a.addEventListener("scroll",l),a==null||a.addEventListener("resize",l),()=>{a==null||a.removeEventListener("scroll",l),a==null||a.removeEventListener("resize",l)}}},[l,e,i]),s}const dt=$(()=>{const t=D(),e=D(),n=w(0),o=D(),r=w(0),s=D(),i=D(),l=w(0),c=w(0),a=w(0),m=w(0),S=D(),h=D(),x=w(!1),C=w(!1),v=w(!1);return O(I(t,H(({scrollTop:g})=>g)),e),O(I(t,H(({scrollHeight:g})=>g)),i),O(e,r),{deviation:n,fixedFooterHeight:a,fixedHeaderHeight:c,footerHeight:m,headerHeight:l,horizontalDirection:C,scrollBy:h,scrollContainerState:t,scrollHeight:i,scrollingInProgress:x,scrollTo:S,scrollTop:e,skipAnimationFrameInResizeObserver:v,smoothScrollTargetReached:o,statefulScrollTop:r,viewportHeight:s}},[],{singleton:!0}),ee={lvl:0};function On(t,e){const n=t.length;if(n===0)return[];let{index:o,value:r}=e(t[0]);const s=[];for(let i=1;i<n;i++){const{index:l,value:c}=e(t[i]);s.push({end:l-1,start:o,value:r}),o=l,r=c}return s.push({end:1/0,start:o,value:r}),s}function K(t){return t===ee}function ne(t,e){if(!K(t))return e===t.k?t.v:e<t.k?ne(t.l,e):ne(t.r,e)}function wt(t,e,n="k"){if(K(t))return[-1/0,void 0];if(Number(t[n])===e)return[t.k,t.v];if(Number(t[n])<e){const o=wt(t.r,e,n);return o[0]===-1/0?[t.k,t.v]:o}return wt(t.l,e,n)}function pt(t,e,n){return K(t)?Vn(e,n,1):e===t.k?st(t,{k:e,v:n}):e<t.k?fn(st(t,{l:pt(t.l,e,n)})):fn(st(t,{r:pt(t.r,e,n)}))}function $t(){return ee}function ve(t,e,n){if(K(t))return[];const o=wt(t,e)[0];return To(Le(t,o,n))}function Oe(t,e){if(K(t))return ee;const{k:n,l:o,r}=t;if(e===n){if(K(o))return r;if(K(r))return o;{const[s,i]=zn(o);return he(st(t,{k:s,l:Ln(o),v:i}))}}else return e<n?he(st(t,{l:Oe(o,e)})):he(st(t,{r:Oe(r,e)}))}function Gt(t){return K(t)?[]:[...Gt(t.l),{k:t.k,v:t.v},...Gt(t.r)]}function Le(t,e,n){if(K(t))return[];const{k:o,l:r,r:s,v:i}=t;let l=[];return o>e&&(l=l.concat(Le(r,e,n))),o>=e&&o<=n&&l.push({k:o,v:i}),o<=n&&(l=l.concat(Le(s,e,n))),l}function he(t){const{l:e,lvl:n,r:o}=t;if(o.lvl>=n-1&&e.lvl>=n-1)return t;if(n>o.lvl+1){if(Re(e))return Pn(st(t,{lvl:n-1}));if(!K(e)&&!K(e.r))return st(e.r,{l:st(e,{r:e.r.l}),lvl:n,r:st(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}else{if(Re(t))return ze(st(t,{lvl:n-1}));if(!K(o)&&!K(o.l)){const r=o.l,s=Re(r)?o.lvl-1:o.lvl;return st(r,{l:st(t,{lvl:n-1,r:r.l}),lvl:r.lvl+1,r:ze(st(o,{l:r.r,lvl:s}))})}else throw new Error("Unexpected empty nodes")}}function st(t,e){return Vn(e.k!==void 0?e.k:t.k,e.v!==void 0?e.v:t.v,e.lvl!==void 0?e.lvl:t.lvl,e.l!==void 0?e.l:t.l,e.r!==void 0?e.r:t.r)}function Ln(t){return K(t.r)?t.l:he(st(t,{r:Ln(t.r)}))}function Re(t){return K(t)||t.lvl>t.r.lvl}function zn(t){return K(t.r)?[t.k,t.v]:zn(t.r)}function Vn(t,e,n,o=ee,r=ee){return{k:t,l:o,lvl:n,r,v:e}}function fn(t){return ze(Pn(t))}function Pn(t){const{l:e}=t;return!K(e)&&e.lvl===t.lvl?st(e,{r:st(t,{l:e.r})}):t}function ze(t){const{lvl:e,r:n}=t;return!K(n)&&!K(n.r)&&n.lvl===e&&n.r.lvl===e?st(n,{l:st(t,{r:n.l}),lvl:e+1}):t}function To(t){return On(t,({k:e,v:n})=>({index:e,value:n}))}function Mn(t,e){return!!(t&&t.startIndex===e.startIndex&&t.endIndex===e.endIndex)}function oe(t,e){return!!(t&&t[0]===e[0]&&t[1]===e[1])}const We=$(()=>({recalcInProgress:w(!1)}),[],{singleton:!0});function jn(t,e,n){return t[xe(t,e,n)]}function xe(t,e,n,o=0){let r=t.length-1;for(;o<=r;){const s=Math.floor((o+r)/2),i=t[s],l=n(i,e);if(l===0)return s;if(l===-1){if(r-o<2)return s-1;r=s-1}else{if(r===o)return s;o=s+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`)}function Co(t,e,n,o){const r=xe(t,e,o),s=xe(t,n,o,r);return t.slice(r,s+1)}function vt(t,e){return Math.round(t.getBoundingClientRect()[e])}function ye(t){return!K(t.groupOffsetTree)}function _e({index:t},e){return e===t?0:e<t?-1:1}function wo(){return{groupIndices:[],groupOffsetTree:$t(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:$t()}}function vo(t,e){let n=K(t)?0:1/0;for(const o of e){const{endIndex:r,size:s,startIndex:i}=o;if(n=Math.min(n,i),K(t)){t=pt(t,0,s);continue}const l=ve(t,i-1,r+1);if(l.some(Bo(o)))continue;let c=!1,a=!1;for(const{end:m,start:S,value:h}of l)c?(r>=S||s===h)&&(t=Oe(t,S)):(a=h!==s,c=!0),m>r&&r>=S&&h!==s&&(t=pt(t,r+1,h));a&&(t=pt(t,i,s))}return[t,n]}function yo(t){return typeof t.groupIndex<"u"}function bo({offset:t},e){return e===t?0:e<t?-1:1}function re(t,e,n){if(e.length===0)return 0;const{index:o,offset:r,size:s}=jn(e,t,_e),i=t-o,l=s*i+(i-1)*n+r;return l>0?l+n:l}function An(t,e){if(!ye(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function Gn(t,e,n){if(yo(t))return e.groupIndices[t.groupIndex]+1;{const o=t.index==="LAST"?n:t.index;let r=An(o,e);return r=Math.max(0,r,Math.min(n,r)),r}}function Ro(t,e,n,o=0){return o>0&&(e=Math.max(e,jn(t,o,_e).offset)),On(Co(t,e,n,bo),ko)}function Eo(t,[e,n,o,r]){e.length>0&&o("received item sizes",e,at.DEBUG);const s=t.sizeTree;let i=s,l=0;if(n.length>0&&K(s)&&e.length===2){const h=e[0].size,x=e[1].size;i=n.reduce((C,v)=>pt(pt(C,v,h),v+1,x),i)}else[i,l]=vo(i,e);if(i===s)return t;const{lastIndex:c,lastOffset:a,lastSize:m,offsetTree:S}=Ve(t.offsetTree,l,i,r);return{groupIndices:n,groupOffsetTree:n.reduce((h,x)=>pt(h,x,re(x,S,r)),$t()),lastIndex:c,lastOffset:a,lastSize:m,offsetTree:S,sizeTree:i}}function Ho(t){return Gt(t).map(({k:e,v:n},o,r)=>{const s=r[o+1];return{endIndex:s?s.k-1:1/0,size:n,startIndex:e}})}function mn(t,e){let n=0,o=0;for(;n<t;)n+=e[o+1]-e[o]-1,o++;return o-(n===t?0:1)}function Ve(t,e,n,o){let r=t,s=0,i=0,l=0,c=0;if(e!==0){c=xe(r,e-1,_e),l=r[c].offset;const m=wt(n,e-1);s=m[0],i=m[1],r.length&&r[c].size===wt(n,e)[1]&&(c-=1),r=r.slice(0,c+1)}else r=[];for(const{start:a,value:m}of ve(n,e,1/0)){const S=a-s,h=S*i+l+S*o;r.push({index:a,offset:h,size:m}),s=a,l=h,i=m}return{lastIndex:s,lastOffset:l,lastSize:i,offsetTree:r}}function ko(t){return{index:t.index,value:t}}function Bo(t){const{endIndex:e,size:n,startIndex:o}=t;return r=>r.start===o&&(r.end===e||r.end===1/0)&&r.value===n}const Fo={offsetHeight:"height",offsetWidth:"width"},Ht=$(([{log:t},{recalcInProgress:e}])=>{const n=D(),o=D(),r=ct(o,0),s=D(),i=D(),l=w(0),c=w([]),a=w(void 0),m=w(void 0),S=w((f,d)=>vt(f,Fo[d])),h=w(void 0),x=w(0),C=wo(),v=ct(I(n,_(c,t,x),Rt(Eo,C),Y()),C),g=ct(I(c,Y(),Rt((f,d)=>({current:d,prev:f.current}),{current:[],prev:[]}),H(({prev:f})=>f)),[]);O(I(c,M(f=>f.length>0),_(v,x),H(([f,d,y])=>{const k=f.reduce((B,z,V)=>pt(B,z,re(z,d.offsetTree,y)||V),$t());return{...d,groupIndices:f,groupOffsetTree:k}})),v),O(I(o,_(v),M(([f,{lastIndex:d}])=>f<d),H(([f,{lastIndex:d,lastSize:y}])=>[{endIndex:d,size:y,startIndex:f}])),n),O(a,m);const p=ct(I(a,H(f=>f===void 0)),!0);O(I(m,M(f=>f!==void 0&&K(ot(v).sizeTree)),H(f=>[{endIndex:0,size:f,startIndex:0}])),n);const u=ht(I(n,_(v),Rt(({sizes:f},[d,y])=>({changed:y!==f,sizes:y}),{changed:!1,sizes:C}),H(f=>f.changed)));U(I(l,Rt((f,d)=>({diff:f.prev-d,prev:d}),{diff:0,prev:0}),H(f=>f.diff)),f=>{const{groupIndices:d}=ot(v);if(f>0)G(e,!0),G(s,f+mn(f,d));else if(f<0){const y=ot(g);y.length>0&&(f-=mn(-f,y)),G(i,f)}}),U(I(l,_(t)),([f,d])=>{f<0&&d("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},at.ERROR)});const T=ht(s);O(I(s,_(v),H(([f,d])=>{const y=d.groupIndices.length>0,k=[],B=d.lastSize;if(y){const z=ne(d.sizeTree,0);let V=0,W=0;for(;V<f;){const F=d.groupIndices[W],q=d.groupIndices.length===W+1?1/0:d.groupIndices[W+1]-F-1;k.push({endIndex:F,size:z,startIndex:F}),k.push({endIndex:F+1+q-1,size:B,startIndex:F+1}),W++,V+=q+1}const J=Gt(d.sizeTree);return V!==f&&J.shift(),J.reduce((F,{k:q,v:it})=>{let ft=F.ranges;return F.prevSize!==0&&(ft=[...F.ranges,{endIndex:q+f-1,size:F.prevSize,startIndex:F.prevIndex}]),{prevIndex:q+f,prevSize:it,ranges:ft}},{prevIndex:f,prevSize:0,ranges:k}).ranges}return Gt(d.sizeTree).reduce((z,{k:V,v:W})=>({prevIndex:V+f,prevSize:W,ranges:[...z.ranges,{endIndex:V+f-1,size:z.prevSize,startIndex:z.prevIndex}]}),{prevIndex:0,prevSize:B,ranges:[]}).ranges})),n);const R=ht(I(i,_(v,x),H(([f,{offsetTree:d},y])=>{const k=-f;return re(k,d,y)})));return O(I(i,_(v,x),H(([f,d,y])=>{if(d.groupIndices.length>0){if(K(d.sizeTree))return d;let B=$t();const z=ot(g);let V=0,W=0,J=0;for(;V<-f;){J=z[W];const F=z[W+1]-J-1;W++,V+=F+1}if(B=Gt(d.sizeTree).reduce((F,{k:q,v:it})=>pt(F,Math.max(0,q+f),it),B),V!==-f){const F=ne(d.sizeTree,J);B=pt(B,0,F);const q=wt(d.sizeTree,-f+1)[1];B=pt(B,1,q)}return{...d,sizeTree:B,...Ve(d.offsetTree,0,B,y)}}else{const B=Gt(d.sizeTree).reduce((z,{k:V,v:W})=>pt(z,Math.max(0,V+f),W),$t());return{...d,sizeTree:B,...Ve(d.offsetTree,0,B,y)}}})),v),{beforeUnshiftWith:T,data:h,defaultItemSize:m,firstItemIndex:l,fixedItemSize:a,gap:x,groupIndices:c,itemSize:S,listRefresh:u,shiftWith:i,shiftWithOffset:R,sizeRanges:n,sizes:v,statefulTotalCount:r,totalCount:o,trackItemSizes:p,unshiftWith:s}},X(Vt,We),{singleton:!0});function Oo(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const Wn=$(([{groupIndices:t,sizes:e,totalCount:n},{headerHeight:o,scrollTop:r}])=>{const s=D(),i=D(),l=ht(I(s,H(Oo)));return O(I(l,H(c=>c.totalCount)),n),O(I(l,H(c=>c.groupIndices)),t),O(I(rt(r,e,o),M(([c,a])=>ye(a)),H(([c,a,m])=>wt(a.groupOffsetTree,Math.max(c-m,0),"v")[0]),Y(),H(c=>[c])),i),{groupCounts:s,topItemsIndexes:i}},X(Ht,dt)),Pt=$(([{log:t}])=>{const e=w(!1),n=ht(I(e,M(o=>o),Y()));return U(e,o=>{o&&ot(t)("props updated",{},at.DEBUG)}),{didMount:n,propsReady:e}},X(Vt),{singleton:!0}),Lo=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function _n(t){const e=typeof t=="number"?{index:t}:t;return e.align||(e.align="start"),(!e.behavior||!Lo)&&(e.behavior="auto"),e.offset||(e.offset=0),e}const ie=$(([{gap:t,listRefresh:e,sizes:n,totalCount:o},{fixedFooterHeight:r,fixedHeaderHeight:s,footerHeight:i,headerHeight:l,scrollingInProgress:c,scrollTo:a,smoothScrollTargetReached:m,viewportHeight:S},{log:h}])=>{const x=D(),C=D(),v=w(0);let g=null,p=null,u=null;function T(){g&&(g(),g=null),u&&(u(),u=null),p&&(clearTimeout(p),p=null),G(c,!1)}return O(I(x,_(n,S,o,v,l,i,h),_(t,s,r),H(([[R,f,d,y,k,B,z,V],W,J,nt])=>{const F=_n(R),{align:q,behavior:it,offset:ft}=F,It=y-1,mt=Gn(F,f,It);let ut=re(mt,f.offsetTree,W)+B;q==="end"?(ut+=J+wt(f.sizeTree,mt)[1]-d+nt,mt===It&&(ut+=z)):q==="center"?ut+=(J+wt(f.sizeTree,mt)[1]-d+nt)/2:ut-=k,ft&&(ut+=ft);const Mt=St=>{T(),St?(V("retrying to scroll to",{location:R},at.DEBUG),G(x,R)):(G(C,!0),V("list did not change, scroll successful",{},at.DEBUG))};if(T(),it==="smooth"){let St=!1;u=U(e,Yt=>{St=St||Yt}),g=Tt(m,()=>{Mt(St)})}else g=Tt(I(e,zo(150)),Mt);return p=setTimeout(()=>{T()},1200),G(c,!0),V("scrolling from index to",{behavior:it,index:mt,top:ut},at.DEBUG),{behavior:it,top:ut}})),a),{scrollTargetReached:C,scrollToIndex:x,topListHeight:v}},X(Ht,dt,Vt),{singleton:!0});function zo(t){return e=>{const n=setTimeout(()=>{e(!1)},t);return o=>{o&&(e(!0),clearTimeout(n))}}}function Ne(t,e){t==0?e():requestAnimationFrame(()=>{Ne(t-1,e)})}function De(t,e){const n=e-1;return typeof t=="number"?t:t.index==="LAST"?n:t.index}const le=$(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:o},{scrollTargetReached:r,scrollToIndex:s},{didMount:i}])=>{const l=w(!0),c=w(0),a=w(!0);return O(I(i,_(c),M(([m,S])=>!!S),bt(!1)),l),O(I(i,_(c),M(([m,S])=>!!S),bt(!1)),a),U(I(rt(e,i),_(l,n,t,a),M(([[,m],S,{sizeTree:h},x,C])=>m&&(!K(h)||Me(x))&&!S&&!C),_(c)),([,m])=>{Tt(r,()=>{G(a,!0)}),Ne(4,()=>{Tt(o,()=>{G(l,!0)}),G(s,m)})}),{initialItemFinalLocationReached:a,initialTopMostItemIndex:c,scrolledToInitialItem:l}},X(Ht,dt,ie,Pt),{singleton:!0});function Nn(t,e){return Math.abs(t-e)<1.01}const se="up",Jt="down",Vo="none",Po={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Mo=0,ce=$(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:o,scrollTop:r,viewportHeight:s}])=>{const i=w(!1),l=w(!0),c=D(),a=D(),m=w(4),S=w(Mo),h=ct(I(Fe(I(P(r),Wt(1),bt(!0)),I(P(r),Wt(1),bt(!1),an(100))),Y()),!1),x=ct(I(Fe(I(n,bt(!0)),I(n,bt(!1),an(200))),Y()),!1);O(I(rt(P(r),P(S)),H(([u,T])=>u<=T),Y()),l),O(I(l,Bt(50)),a);const C=ht(I(rt(o,P(s),P(e),P(t),P(m)),Rt((u,[{scrollHeight:T,scrollTop:R},f,d,y,k])=>{const B=R+f-T>-k,z={scrollHeight:T,scrollTop:R,viewportHeight:f};if(B){let W,J;return R>u.state.scrollTop?(W="SCROLLED_DOWN",J=u.state.scrollTop-R):(W="SIZE_DECREASED",J=u.state.scrollTop-R||u.scrollTopDelta),{atBottom:!0,atBottomBecause:W,scrollTopDelta:J,state:z}}let V;return z.scrollHeight>u.state.scrollHeight?V="SIZE_INCREASED":f<u.state.viewportHeight?V="VIEWPORT_HEIGHT_DECREASING":R<u.state.scrollTop?V="SCROLLING_UPWARDS":V="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:V,state:z}},Po),Y((u,T)=>u&&u.atBottom===T.atBottom))),v=ct(I(o,Rt((u,{scrollHeight:T,scrollTop:R,viewportHeight:f})=>{if(Nn(u.scrollHeight,T))return{changed:!1,jump:0,scrollHeight:T,scrollTop:R};{const d=T-(R+f)<1;return u.scrollTop!==R&&d?{changed:!0,jump:u.scrollTop-R,scrollHeight:T,scrollTop:R}:{changed:!0,jump:0,scrollHeight:T,scrollTop:R}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),M(u=>u.changed),H(u=>u.jump)),0);O(I(C,H(u=>u.atBottom)),i),O(I(i,Bt(50)),c);const g=w(Jt);O(I(o,H(({scrollTop:u})=>u),Y(),Rt((u,T)=>ot(x)?{direction:u.direction,prevScrollTop:T}:{direction:T<u.prevScrollTop?se:Jt,prevScrollTop:T},{direction:Jt,prevScrollTop:0}),H(u=>u.direction)),g),O(I(o,Bt(50),bt(Vo)),g);const p=w(0);return O(I(h,M(u=>!u),bt(0)),p),O(I(r,Bt(100),_(h),M(([u,T])=>!!T),Rt(([u,T],[R])=>[T,R],[0,0]),H(([u,T])=>T-u)),p),{atBottomState:C,atBottomStateChange:c,atBottomThreshold:m,atTopStateChange:a,atTopThreshold:S,isAtBottom:i,isAtTop:l,isScrolling:h,lastJumpDueToItemResize:v,scrollDirection:g,scrollVelocity:p}},X(dt)),Ie="top",Se="bottom",pn="none";function hn(t,e,n){return typeof t=="number"?n===se&&e===Ie||n===Jt&&e===Se?t:0:n===se?e===Ie?t.main:t.reverse:e===Se?t.main:t.reverse}function gn(t,e){var n;return typeof t=="number"?t:(n=t[e])!=null?n:0}const $e=$(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:o,viewportHeight:r}])=>{const s=D(),i=w(0),l=w(0),c=w(0),a=ct(I(rt(P(o),P(r),P(n),P(s,oe),P(c),P(i),P(e),P(t),P(l)),H(([m,S,h,[x,C],v,g,p,u,T])=>{const R=m-u,f=g+p,d=Math.max(h-R,0);let y=pn;const k=gn(T,Ie),B=gn(T,Se);return x-=u,x+=h+p,C+=h+p,C-=u,x>m+f-k&&(y=se),C<m-d+S+B&&(y=Jt),y!==pn?[Math.max(R-h-hn(v,Ie,y)-k,0),R-d-p+S+hn(v,Se,y)+B]:null}),M(m=>m!=null),Y(oe)),[0,0]);return{increaseViewportBy:l,listBoundary:s,overscan:c,topListHeight:i,visibleRange:a}},X(dt),{singleton:!0});function jo(t,e,n){if(ye(e)){const o=An(t,e);return[{index:wt(e.groupOffsetTree,o)[0],offset:0,size:0},{data:n==null?void 0:n[0],index:o,offset:0,size:0}]}return[{data:n==null?void 0:n[0],index:t,offset:0,size:0}]}const Ee={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function ge(t,e,n,o,r,s){const{lastIndex:i,lastOffset:l,lastSize:c}=r;let a=0,m=0;if(t.length>0){a=t[0].offset;const v=t[t.length-1];m=v.offset+v.size}const S=n-i,h=l+S*c+(S-1)*o,x=a,C=h-m;return{bottom:m,firstItemIndex:s,items:xn(t,r,s),offsetBottom:C,offsetTop:a,top:x,topItems:xn(e,r,s),topListHeight:e.reduce((v,g)=>g.size+v,0),totalCount:n}}function Dn(t,e,n,o,r,s){let i=0;if(n.groupIndices.length>0)for(const m of n.groupIndices){if(m-i>=t)break;i++}const l=t+i,c=De(e,l),a=Array.from({length:l}).map((m,S)=>({data:s[S+c],index:S+c,offset:0,size:0}));return ge(a,[],l,r,n,o)}function xn(t,e,n){if(t.length===0)return[];if(!ye(e))return t.map(a=>({...a,index:a.index+n,originalIndex:a.index}));const o=t[0].index,r=t[t.length-1].index,s=[],i=ve(e.groupOffsetTree,o,r);let l,c=0;for(const a of t){(!l||l.end<a.index)&&(l=i.shift(),c=e.groupIndices.indexOf(l.start));let m;a.index===l.start?m={index:c,type:"group"}:m={groupIndex:c,index:a.index-(c+1)+n},s.push({...m,data:a.data,offset:a.offset,originalIndex:a.index,size:a.size})}return s}const _t=$(([{data:t,firstItemIndex:e,gap:n,sizes:o,totalCount:r},s,{listBoundary:i,topListHeight:l,visibleRange:c},{initialTopMostItemIndex:a,scrolledToInitialItem:m},{topListHeight:S},h,{didMount:x},{recalcInProgress:C}])=>{const v=w([]),g=w(0),p=D();O(s.topItemsIndexes,v);const u=ct(I(rt(x,C,P(c,oe),P(r),P(o),P(a),m,P(v),P(e),P(n),t),M(([d,y,,k,,,,,,,B])=>{const z=B&&B.length!==k;return d&&!y&&!z}),H(([,,[d,y],k,B,z,V,W,J,nt,F])=>{const q=B,{offsetTree:it,sizeTree:ft}=q,It=ot(g);if(k===0)return{...Ee,totalCount:k};if(d===0&&y===0)return It===0?{...Ee,totalCount:k}:Dn(It,z,B,J,nt,F||[]);if(K(ft))return It>0?null:ge(jo(De(z,k),q,F),[],k,nt,q,J);const mt=[];if(W.length>0){const jt=W[0],yt=W[W.length-1];let kt=0;for(const b of ve(ft,jt,yt)){const N=b.value,Q=Math.max(b.start,jt),lt=Math.min(b.end,yt);for(let tt=Q;tt<=lt;tt++)mt.push({data:F==null?void 0:F[tt],index:tt,offset:kt,size:N}),kt+=N}}if(!V)return ge([],mt,k,nt,q,J);const ut=W.length>0?W[W.length-1]+1:0,Mt=Ro(it,d,y,ut);if(Mt.length===0)return null;const St=k-1,Yt=we([],jt=>{for(const yt of Mt){const kt=yt.value;let b=kt.offset,N=yt.start;const Q=kt.size;if(kt.offset<d){N+=Math.floor((d-kt.offset+nt)/(Q+nt));const tt=N-yt.start;b+=tt*Q+tt*nt}N<ut&&(b+=(ut-N)*Q,N=ut);const lt=Math.min(yt.end,St);for(let tt=N;tt<=lt&&!(b>=y);tt++)jt.push({data:F==null?void 0:F[tt],index:tt,offset:b,size:Q}),b+=Q+nt}});return ge(Yt,mt,k,nt,q,J)}),M(d=>d!==null),Y()),Ee);O(I(t,M(Me),H(d=>d==null?void 0:d.length)),r),O(I(u,H(d=>d.topListHeight)),S),O(S,l),O(I(u,H(d=>[d.top,d.bottom])),i),O(I(u,H(d=>d.items)),p);const T=ht(I(u,M(({items:d})=>d.length>0),_(r,t),M(([{items:d},y])=>d[d.length-1].originalIndex===y-1),H(([,d,y])=>[d-1,y]),Y(oe),H(([d])=>d))),R=ht(I(u,Bt(200),M(({items:d,topItems:y})=>d.length>0&&d[0].originalIndex===y.length),H(({items:d})=>d[0].index),Y())),f=ht(I(u,M(({items:d})=>d.length>0),H(({items:d})=>{let y=0,k=d.length-1;for(;d[y].type==="group"&&y<k;)y++;for(;d[k].type==="group"&&k>y;)k--;return{endIndex:d[k].index,startIndex:d[y].index}}),Y(Mn)));return{endReached:T,initialItemCount:g,itemsRendered:p,listState:u,rangeChanged:f,startReached:R,topItemsIndexes:v,...h}},X(Ht,Wn,$e,le,ie,ce,Pt,We),{singleton:!0}),$n=$(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:o},{listState:r}])=>{const s=D(),i=ct(I(rt(n,t,o,e,r),H(([l,c,a,m,S])=>l+c+a+m+S.offsetBottom+S.bottom)),0);return O(P(i),s),{totalListHeight:i,totalListHeightChanged:s}},X(dt,_t),{singleton:!0}),Ao=$(([{viewportHeight:t},{totalListHeight:e}])=>{const n=w(!1),o=ct(I(rt(n,t,e),M(([r])=>r),H(([,r,s])=>Math.max(0,r-s)),Bt(0),Y()),0);return{alignToBottom:n,paddingTopAddition:o}},X(dt,$n),{singleton:!0}),Un=$(()=>({context:w(null)})),Go=({itemBottom:t,itemTop:e,locationParams:{align:n,behavior:o,...r},viewportBottom:s,viewportTop:i})=>e<i?{...r,align:n!=null?n:"start",behavior:o}:t>s?{...r,align:n!=null?n:"end",behavior:o}:null,Kn=$(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:o,fixedHeaderHeight:r,headerHeight:s,scrollingInProgress:i,scrollTop:l,viewportHeight:c},{scrollToIndex:a}])=>{const m=D();return O(I(m,_(e,c,n,s,r,o,l),_(t),H(([[S,h,x,C,v,g,p,u],T])=>{const{align:R,behavior:f,calculateViewLocation:d=Go,done:y,...k}=S,B=Gn(S,h,C-1),z=re(B,h.offsetTree,T)+v+g,V=z+wt(h.sizeTree,B)[1],W=u+g,J=u+x-p,nt=d({itemBottom:V,itemTop:z,locationParams:{align:R,behavior:f,...k},viewportBottom:J,viewportTop:W});return nt?y&&Tt(I(i,M(F=>!F),Wt(ot(i)?1:2)),y):y&&y(),nt}),M(S=>S!==null)),a),{scrollIntoView:m}},X(Ht,dt,ie,_t,Vt),{singleton:!0});function In(t){return t?t==="smooth"?"smooth":"auto":!1}const Wo=(t,e)=>typeof t=="function"?In(t(e)):e&&In(t),_o=$(([{listRefresh:t,totalCount:e,fixedItemSize:n,data:o},{atBottomState:r,isAtBottom:s},{scrollToIndex:i},{scrolledToInitialItem:l},{didMount:c,propsReady:a},{log:m},{scrollingInProgress:S},{context:h},{scrollIntoView:x}])=>{const C=w(!1),v=D();let g=null;function p(f){G(i,{align:"end",behavior:f,index:"LAST"})}U(I(rt(I(P(e),Wt(1)),c),_(P(C),s,l,S),H(([[f,d],y,k,B,z])=>{let V=d&&B,W="auto";return V&&(W=Wo(y,k||z),V=V&&!!W),{followOutputBehavior:W,shouldFollow:V,totalCount:f}}),M(({shouldFollow:f})=>f)),({followOutputBehavior:f,totalCount:d})=>{g&&(g(),g=null),ot(n)?requestAnimationFrame(()=>{ot(m)("following output to ",{totalCount:d},at.DEBUG),p(f)}):g=Tt(t,()=>{ot(m)("following output to ",{totalCount:d},at.DEBUG),p(f),g=null})});function u(f){const d=Tt(r,y=>{f&&!y.atBottom&&y.notAtBottomBecause==="SIZE_INCREASED"&&!g&&(ot(m)("scrolling to bottom due to increased size",{},at.DEBUG),p("auto"))});setTimeout(d,100)}U(I(rt(P(C),e,a),M(([f,,d])=>f&&d),Rt(({value:f},[,d])=>({refreshed:f===d,value:d}),{refreshed:!1,value:0}),M(({refreshed:f})=>f),_(C,e)),([,f])=>{ot(l)&&u(f!==!1)}),U(v,()=>{u(ot(C)!==!1)}),U(rt(P(C),r),([f,d])=>{f&&!d.atBottom&&d.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&p("auto")});const T=w(null),R=D();return O(Fe(I(P(o),H(f=>{var d;return(d=f==null?void 0:f.length)!=null?d:0})),I(P(e))),R),U(I(rt(I(R,Wt(1)),c),_(P(T),l,S,h),H(([[f,d],y,k,B,z])=>d&&k&&(y==null?void 0:y({context:z,totalCount:f,scrollingInProgress:B}))),M(f=>!!f),Bt(0)),f=>{g&&(g(),g=null),ot(n)?requestAnimationFrame(()=>{ot(m)("scrolling into view",{}),G(x,f)}):g=Tt(t,()=>{ot(m)("scrolling into view",{}),G(x,f),g=null})}),{autoscrollToBottom:v,followOutput:C,scrollIntoViewOnChange:T}},X(Ht,ce,ie,le,Pt,Vt,dt,Un,Kn)),No=$(([{data:t,firstItemIndex:e,gap:n,sizes:o},{initialTopMostItemIndex:r},{initialItemCount:s,listState:i},{didMount:l}])=>(O(I(l,_(s),M(([,c])=>c!==0),_(r,o,e,n,t),H(([[,c],a,m,S,h,x=[]])=>Dn(c,a,m,S,h,x))),i),{}),X(Ht,le,_t,Pt),{singleton:!0}),Do=$(([{didMount:t},{scrollTo:e},{listState:n}])=>{const o=w(0);return U(I(t,_(o),M(([,r])=>r!==0),H(([,r])=>({top:r}))),r=>{Tt(I(n,Wt(1),M(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{G(e,r)})})}),{initialScrollTop:o}},X(Pt,dt,_t),{singleton:!0}),qn=$(([{scrollVelocity:t}])=>{const e=w(!1),n=D(),o=w(!1);return O(I(t,_(o,e,n),M(([r,s])=>!!s),H(([r,s,i,l])=>{const{enter:c,exit:a}=s;if(i){if(a(r,l))return!1}else if(c(r,l))return!0;return i}),Y()),e),U(I(rt(e,t,n),_(o)),([[r,s,i],l])=>{r&&l&&l.change&&l.change(s,i)}),{isSeeking:e,scrollSeekConfiguration:o,scrollSeekRangeChanged:n,scrollVelocity:t}},X(ce),{singleton:!0}),Ue=$(([{scrollContainerState:t,scrollTo:e}])=>{const n=D(),o=D(),r=D(),s=w(!1),i=w(void 0);return O(I(rt(n,o),H(([{scrollHeight:l,scrollTop:c,viewportHeight:a},{offsetTop:m}])=>({scrollHeight:l,scrollTop:Math.max(0,c-m),viewportHeight:a}))),t),O(I(e,_(o),H(([l,{offsetTop:c}])=>({...l,top:l.top+c}))),r),{customScrollParent:i,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:o}},X(dt)),$o=$(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:o},{initialTopMostItemIndex:r},{didMount:s},{useWindowScroll:i,windowScrollContainerState:l,windowViewportRect:c}])=>{const a=D(),m=w(void 0),S=w(null),h=w(null);return O(l,S),O(c,h),U(I(a,_(e,o,i,S,h,n)),([x,C,v,g,p,u,T])=>{const R=Ho(C.sizeTree);g&&p!==null&&u!==null&&(v=p.scrollTop-u.offsetTop),v-=T,x({ranges:R,scrollTop:v})}),O(I(m,M(Me),H(Uo)),r),O(I(s,_(m),M(([,x])=>x!==void 0),Y(),H(([,x])=>x.ranges)),t),{getState:a,restoreStateFrom:m}},X(Ht,dt,le,Pt,Ue));function Uo(t){return{align:"start",index:0,offset:t.scrollTop}}const Ko=$(([{topItemsIndexes:t}])=>{const e=w(0);return O(I(e,M(n=>n>=0),H(n=>Array.from({length:n}).map((o,r)=>r))),t),{topItemCount:e}},X(_t));function Yn(t){let e=!1,n;return()=>(e||(e=!0,n=t()),n)}const qo=Yn(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Yo=$(([{deviation:t,scrollBy:e,scrollingInProgress:n,scrollTop:o},{isAtBottom:r,isScrolling:s,lastJumpDueToItemResize:i,scrollDirection:l},{listState:c},{beforeUnshiftWith:a,gap:m,shiftWithOffset:S,sizes:h},{log:x},{recalcInProgress:C}])=>{const v=ht(I(c,_(i),Rt(([,p,u,T],[{bottom:R,items:f,offsetBottom:d,totalCount:y},k])=>{const B=R+d;let z=0;return u===y&&p.length>0&&f.length>0&&(f[0].originalIndex===0&&p[0].originalIndex===0||(z=B-T,z!==0&&(z+=k))),[z,f,y,B]},[0,[],0,0]),M(([p])=>p!==0),_(o,l,n,r,x,C),M(([,p,u,T,,,R])=>!R&&!T&&p!==0&&u===se),H(([[p],,,,,u])=>(u("Upward scrolling compensation",{amount:p},at.DEBUG),p))));function g(p){p>0?(G(e,{behavior:"auto",top:-p}),G(t,0)):(G(t,0),G(e,{behavior:"auto",top:-p}))}return U(I(v,_(t,s)),([p,u,T])=>{T&&qo()?G(t,u-p):g(-p)}),U(I(rt(ct(s,!1),t,C),M(([p,u,T])=>!p&&!T&&u!==0),H(([p,u])=>u),Bt(1)),g),O(I(S,H(p=>({top:-p}))),e),U(I(a,_(h,m),H(([p,{groupIndices:u,lastSize:T,sizeTree:R},f])=>{function d(y){return y*(T+f)}if(u.length===0)return d(p);{let y=0;const k=ne(R,0);let B=0,z=0;for(;B<p;){B++,y+=k;let V=u.length===z+1?1/0:u[z+1]-u[z]-1;B+V>p&&(y-=k,V=p-B+1),B+=V,y+=d(V),z++}return y}})),p=>{G(t,p),requestAnimationFrame(()=>{G(e,{top:p}),requestAnimationFrame(()=>{G(t,0),G(C,!1)})})}),{deviation:t}},X(dt,ce,_t,Ht,Vt,We)),Zo=$(([t,e,n,o,r,s,i,l,c,a,m])=>({...t,...e,...n,...o,...r,...s,...i,...l,...c,...a,...m}),X($e,No,Pt,qn,$n,Do,Ao,Ue,Kn,Vt,Un)),Zn=$(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:o,gap:r,groupIndices:s,itemSize:i,sizeRanges:l,sizes:c,statefulTotalCount:a,totalCount:m,trackItemSizes:S},{initialItemFinalLocationReached:h,initialTopMostItemIndex:x,scrolledToInitialItem:C},v,g,p,{listState:u,topItemsIndexes:T,...R},{scrollToIndex:f},d,{topItemCount:y},{groupCounts:k},B])=>(O(R.rangeChanged,B.scrollSeekRangeChanged),O(I(B.windowViewportRect,H(z=>z.visibleHeight)),v.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:o,gap:r,groupCounts:k,initialItemFinalLocationReached:h,initialTopMostItemIndex:x,scrolledToInitialItem:C,sizeRanges:l,topItemCount:y,topItemsIndexes:T,totalCount:m,...p,groupIndices:s,itemSize:i,listState:u,scrollToIndex:f,statefulTotalCount:a,trackItemSizes:S,...R,...B,...v,sizes:c,...g}),X(Ht,le,dt,$o,_o,_t,ie,Yo,Ko,Wn,Zo));function Xo(t,e){const n={},o={};let r=0;const s=t.length;for(;r<s;)o[t[r]]=1,r+=1;for(const i in e)Object.hasOwn(o,i)||(n[i]=e[i]);return n}const me=typeof document<"u"?E.useLayoutEffect:E.useEffect;function Ke(t,e,n){const o=Object.keys(e.required||{}),r=Object.keys(e.optional||{}),s=Object.keys(e.methods||{}),i=Object.keys(e.events||{}),l=E.createContext({});function c(p,u){p.propsReady&&G(p.propsReady,!1);for(const T of o){const R=p[e.required[T]];G(R,u[T])}for(const T of r)if(T in u){const R=p[e.optional[T]];G(R,u[T])}p.propsReady&&G(p.propsReady,!0)}function a(p){return s.reduce((u,T)=>(u[T]=R=>{const f=p[e.methods[T]];G(f,R)},u),{})}function m(p){return i.reduce((u,T)=>(u[T]=po(p[e.events[T]]),u),{})}const S=E.forwardRef((p,u)=>{const{children:T,...R}=p,[f]=E.useState(()=>we(go(t),k=>{c(k,R)})),[d]=E.useState(un(m,f));me(()=>{for(const k of i)k in R&&U(d[k],R[k]);return()=>{Object.values(d).map(je)}},[R,d,f]),me(()=>{c(f,R)}),E.useImperativeHandle(u,cn(a(f)));const y=n;return L.jsx(l.Provider,{value:f,children:n?L.jsx(y,{...Xo([...o,...r,...i],R),children:T}):T})}),h=p=>{const u=E.useContext(l);return E.useCallback(T=>{G(u[p],T)},[u,p])},x=p=>{const T=E.useContext(l)[p],R=E.useCallback(f=>U(T,f),[T]);return E.useSyncExternalStore(R,()=>ot(T),()=>ot(T))},C=p=>{const T=E.useContext(l)[p],[R,f]=E.useState(un(ot,T));return me(()=>U(T,d=>{d!==R&&f(cn(d))}),[T,R]),R},v=E.version.startsWith("18")?x:C;return{Component:S,useEmitter:(p,u)=>{const R=E.useContext(l)[p];me(()=>U(R,u),[u,R])},useEmitterValue:v,usePublisher:h}}const ue=E.createContext(void 0),qe=E.createContext(void 0),Xn=typeof document<"u"?E.useLayoutEffect:E.useEffect;function He(t){return"self"in t}function Jo(t){return"body"in t}function Jn(t,e,n,o=Kt,r,s){const i=E.useRef(null),l=E.useRef(null),c=E.useRef(null),a=E.useCallback(h=>{let x,C,v;const g=h.target;if(Jo(g)||He(g)){const u=He(g)?g:g.defaultView;v=s?u.scrollX:u.scrollY,x=s?u.document.documentElement.scrollWidth:u.document.documentElement.scrollHeight,C=s?u.innerWidth:u.innerHeight}else v=s?g.scrollLeft:g.scrollTop,x=s?g.scrollWidth:g.scrollHeight,C=s?g.offsetWidth:g.offsetHeight;const p=()=>{t({scrollHeight:x,scrollTop:Math.max(v,0),viewportHeight:C})};h.suppressFlushSync?p():lo.flushSync(p),l.current!==null&&(v===l.current||v<=0||v===x-C)&&(l.current=null,e(!0),c.current&&(clearTimeout(c.current),c.current=null))},[t,e,s]);E.useEffect(()=>{const h=r||i.current;return o(r||i.current),a({suppressFlushSync:!0,target:h}),h.addEventListener("scroll",a,{passive:!0}),()=>{o(null),h.removeEventListener("scroll",a)}},[i,a,n,o,r]);function m(h){const x=i.current;if(!x||(s?"offsetWidth"in x&&x.offsetWidth===0:"offsetHeight"in x&&x.offsetHeight===0))return;const C=h.behavior==="smooth";let v,g,p;He(x)?(g=Math.max(vt(x.document.documentElement,s?"width":"height"),s?x.document.documentElement.scrollWidth:x.document.documentElement.scrollHeight),v=s?x.innerWidth:x.innerHeight,p=s?window.scrollX:window.scrollY):(g=x[s?"scrollWidth":"scrollHeight"],v=vt(x,s?"width":"height"),p=x[s?"scrollLeft":"scrollTop"]);const u=g-v;if(h.top=Math.ceil(Math.max(Math.min(u,h.top),0)),Nn(v,g)||h.top===p){t({scrollHeight:g,scrollTop:p,viewportHeight:v}),C&&e(!0);return}C?(l.current=h.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,l.current=null,e(!0)},1e3)):l.current=null,s&&(h={behavior:h.behavior,left:h.top}),x.scrollTo(h)}function S(h){s&&(h={behavior:h.behavior,left:h.top}),i.current.scrollBy(h)}return{scrollByCallback:S,scrollerRef:i,scrollToCallback:m}}const ke="-webkit-sticky",Sn="sticky",Ye=Yn(()=>{if(typeof document>"u")return Sn;const t=document.createElement("div");return t.style.position=ke,t.style.position===ke?ke:Sn});function Ze(t){return t}const Qo=$(()=>{const t=w(l=>`Item ${l}`),e=w(l=>`Group ${l}`),n=w({}),o=w(Ze),r=w("div"),s=w(Kt),i=(l,c=null)=>ct(I(n,H(a=>a[l]),Y()),c);return{components:n,computeItemKey:o,EmptyPlaceholder:i("EmptyPlaceholder"),FooterComponent:i("Footer"),GroupComponent:i("Group","div"),groupContent:e,HeaderComponent:i("Header"),HeaderFooterTag:r,ItemComponent:i("Item","div"),itemContent:t,ListComponent:i("List","div"),ScrollerComponent:i("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:i("ScrollSeekPlaceholder"),TopItemListComponent:i("TopItemList")}}),tr=$(([t,e])=>({...t,...e}),X(Zn,Qo)),er=({height:t})=>L.jsx("div",{style:{height:t}}),nr={overflowAnchor:"none",position:Ye(),zIndex:1},Qn={overflowAnchor:"none"},or={...Qn,display:"inline-block",height:"100%"},Tn=E.memo(function({showTopList:e=!1}){const n=j("listState"),o=gt("sizeRanges"),r=j("useWindowScroll"),s=j("customScrollParent"),i=gt("windowScrollContainerState"),l=gt("scrollContainerState"),c=s||r?i:l,a=j("itemContent"),m=j("context"),S=j("groupContent"),h=j("trackItemSizes"),x=j("itemSize"),C=j("log"),v=gt("gap"),g=j("horizontalDirection"),{callbackRef:p}=Fn(o,x,h,e?Kt:c,C,v,s,g,j("skipAnimationFrameInResizeObserver")),[u,T]=E.useState(0);Qe("deviation",F=>{u!==F&&T(F)});const R=j("EmptyPlaceholder"),f=j("ScrollSeekPlaceholder")||er,d=j("ListComponent"),y=j("ItemComponent"),k=j("GroupComponent"),B=j("computeItemKey"),z=j("isSeeking"),V=j("groupIndices").length>0,W=j("alignToBottom"),J=j("initialItemFinalLocationReached"),nt=e?{}:{boxSizing:"border-box",...g?{display:"inline-block",height:"100%",marginLeft:u!==0?u:W?"auto":0,paddingLeft:n.offsetTop,paddingRight:n.offsetBottom,whiteSpace:"nowrap"}:{marginTop:u!==0?u:W?"auto":0,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},...J?{}:{visibility:"hidden"}};return!e&&n.totalCount===0&&R?L.jsx(R,{...Z(R,m)}):L.jsx(d,{...Z(d,m),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:p,style:nt,children:(e?n.topItems:n.items).map(F=>{const q=F.originalIndex,it=B(q+n.firstItemIndex,F.data,m);return z?E.createElement(f,{...Z(f,m),height:F.size,index:F.index,key:it,type:F.type||"item",...F.type==="group"?{}:{groupIndex:F.groupIndex}}):F.type==="group"?E.createElement(k,{...Z(k,m),"data-index":q,"data-item-index":F.index,"data-known-size":F.size,key:it,style:nr},S(F.index,m)):E.createElement(y,{...Z(y,m),...to(y,F.data),"data-index":q,"data-item-group-index":F.groupIndex,"data-item-index":F.index,"data-known-size":F.size,key:it,style:g?or:Qn},V?a(F.index,F.groupIndex,F.data,m):a(F.index,F.data,m))})})}),rr={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},sr={outline:"none",overflowX:"auto",position:"relative"},qt=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:{}}),ir={position:Ye(),top:0,width:"100%",zIndex:1};function Z(t,e){if(typeof t!="string")return{context:e}}function to(t,e){return{item:typeof t=="string"?void 0:e}}const lr=E.memo(function(){const e=j("HeaderComponent"),n=gt("headerHeight"),o=j("HeaderFooterTag"),r=Et(E.useMemo(()=>i=>{n(vt(i,"height"))},[n]),!0,j("skipAnimationFrameInResizeObserver")),s=j("context");return e?L.jsx(o,{ref:r,children:L.jsx(e,{...Z(e,s)})}):null}),cr=E.memo(function(){const e=j("FooterComponent"),n=gt("footerHeight"),o=j("HeaderFooterTag"),r=Et(E.useMemo(()=>i=>{n(vt(i,"height"))},[n]),!0,j("skipAnimationFrameInResizeObserver")),s=j("context");return e?L.jsx(o,{ref:r,children:L.jsx(e,{...Z(e,s)})}):null});function Xe({useEmitter:t,useEmitterValue:e,usePublisher:n}){return E.memo(function({children:s,style:i,context:l,...c}){const a=n("scrollContainerState"),m=e("ScrollerComponent"),S=n("smoothScrollTargetReached"),h=e("scrollerRef"),x=e("horizontalDirection")||!1,{scrollByCallback:C,scrollerRef:v,scrollToCallback:g}=Jn(a,S,m,h,void 0,x);t("scrollTo",g),t("scrollBy",C);const p=x?sr:rr;return L.jsx(m,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:v,style:{...p,...i},tabIndex:0,...c,...Z(m,l),children:s})})}function Je({useEmitter:t,useEmitterValue:e,usePublisher:n}){return E.memo(function({children:s,style:i,context:l,...c}){const a=n("windowScrollContainerState"),m=e("ScrollerComponent"),S=n("smoothScrollTargetReached"),h=e("totalListHeight"),x=e("deviation"),C=e("customScrollParent"),v=E.useRef(null),g=e("scrollerRef"),{scrollByCallback:p,scrollerRef:u,scrollToCallback:T}=Jn(a,S,m,g,C);return Xn(()=>{var R;return u.current=C||((R=v.current)==null?void 0:R.ownerDocument.defaultView),()=>{u.current=null}},[u,C]),t("windowScrollTo",T),t("scrollBy",p),L.jsx(m,{ref:v,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...h!==0?{height:h+x}:{}},...c,...Z(m,l),children:s})})}const ur=({children:t})=>{const e=E.useContext(ue),n=gt("viewportHeight"),o=gt("fixedItemHeight"),r=j("alignToBottom"),s=j("horizontalDirection"),i=E.useMemo(()=>te(n,c=>vt(c,s?"width":"height")),[n,s]),l=Et(i,!0,j("skipAnimationFrameInResizeObserver"));return E.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),L.jsx("div",{"data-viewport-type":"element",ref:l,style:qt(r),children:t})},ar=({children:t})=>{const e=E.useContext(ue),n=gt("windowViewportRect"),o=gt("fixedItemHeight"),r=j("customScrollParent"),s=Ge(n,r,j("skipAnimationFrameInResizeObserver")),i=j("alignToBottom");return E.useEffect(()=>{e&&(o(e.itemHeight),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),L.jsx("div",{"data-viewport-type":"window",ref:s,style:qt(i),children:t})},dr=({children:t})=>{const e=j("TopItemListComponent")||"div",n=j("headerHeight"),o={...ir,marginTop:`${n}px`},r=j("context");return L.jsx(e,{style:o,...Z(e,r),children:t})},fr=E.memo(function(e){const n=j("useWindowScroll"),o=j("topItemsIndexes").length>0,r=j("customScrollParent"),s=j("context"),i=r||n?pr:mr,l=r||n?ar:ur;return L.jsxs(i,{...e,context:s,children:[o&&L.jsx(dr,{children:L.jsx(Tn,{showTopList:!0})}),L.jsxs(l,{children:[L.jsx(lr,{}),L.jsx(Tn,{}),L.jsx(cr,{})]})]})}),{Component:eo,useEmitter:Qe,useEmitterValue:j,usePublisher:gt}=Ke(tr,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},fr),mr=Xe({useEmitter:Qe,useEmitterValue:j,usePublisher:gt}),pr=Je({useEmitter:Qe,useEmitterValue:j,usePublisher:gt}),hr=eo,gr=eo,xr=$(()=>{const t=w(a=>L.jsxs("td",{children:["Item $",a]})),e=w(null),n=w(a=>L.jsxs("td",{colSpan:1e3,children:["Group ",a]})),o=w(null),r=w(null),s=w({}),i=w(Ze),l=w(Kt),c=(a,m=null)=>ct(I(s,H(S=>S[a]),Y()),m);return{components:s,computeItemKey:i,context:e,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:r,fixedHeaderContent:o,itemContent:t,groupContent:n,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}}),Ir=$(([t,e])=>({...t,...e}),X(Zn,xr)),Sr=({height:t})=>L.jsx("tr",{children:L.jsx("td",{style:{height:t}})}),Tr=({height:t})=>L.jsx("tr",{children:L.jsx("td",{style:{border:0,height:t,padding:0}})}),Cr={overflowAnchor:"none"},Cn={position:Ye(),zIndex:2,overflowAnchor:"none"},wn=E.memo(function({showTopList:e=!1}){const n=A("listState"),o=A("computeItemKey"),r=A("firstItemIndex"),s=A("context"),i=A("isSeeking"),l=A("fixedHeaderHeight"),c=A("groupIndices").length>0,a=A("itemContent"),m=A("groupContent"),S=A("ScrollSeekPlaceholder")||Sr,h=A("GroupComponent"),x=A("TableRowComponent"),C=(e?n.topItems:[]).reduce((g,p,u)=>(u===0?g.push(p.size):g.push(g[u-1]+p.size),g),[]),v=(e?n.topItems:n.items).map(g=>{const p=g.originalIndex,u=o(p+r,g.data,s),T=e?p===0?0:C[p-1]:0;return i?E.createElement(S,{...Z(S,s),height:g.size,index:g.index,key:u,type:g.type||"item"}):g.type==="group"?E.createElement(h,{...Z(h,s),"data-index":p,"data-item-index":g.index,"data-known-size":g.size,key:u,style:{...Cn,top:l}},m(g.index,s)):E.createElement(x,{...Z(x,s),...to(x,g.data),"data-index":p,"data-item-index":g.index,"data-known-size":g.size,"data-item-group-index":g.groupIndex,key:u,style:e?{...Cn,top:l+T}:Cr},c?a(g.index,g.groupIndex,g.data,s):a(g.index,g.data,s))});return L.jsx(L.Fragment,{children:v})}),wr=E.memo(function(){const e=A("listState"),n=A("topItemsIndexes").length>0,o=Ct("sizeRanges"),r=A("useWindowScroll"),s=A("customScrollParent"),i=Ct("windowScrollContainerState"),l=Ct("scrollContainerState"),c=s||r?i:l,a=A("trackItemSizes"),m=A("itemSize"),S=A("log"),{callbackRef:h,ref:x}=Fn(o,m,a,c,S,void 0,s,!1,A("skipAnimationFrameInResizeObserver")),[C,v]=E.useState(0);tn("deviation",V=>{C!==V&&(x.current.style.marginTop=`${V}px`,v(V))});const g=A("EmptyPlaceholder"),p=A("FillerRow")||Tr,u=A("TableBodyComponent"),T=A("paddingTopAddition"),R=A("statefulTotalCount"),f=A("context");if(R===0&&g)return L.jsx(g,{...Z(g,f)});const d=(n?e.topItems:[]).reduce((V,W)=>V+W.size,0),y=e.offsetTop+T+C-d,k=e.offsetBottom,B=y>0?L.jsx(p,{context:f,height:y},"padding-top"):null,z=k>0?L.jsx(p,{context:f,height:k},"padding-bottom"):null;return L.jsxs(u,{"data-testid":"virtuoso-item-list",ref:h,...Z(u,f),children:[B,n&&L.jsx(wn,{showTopList:!0}),L.jsx(wn,{}),z]})}),vr=({children:t})=>{const e=E.useContext(ue),n=Ct("viewportHeight"),o=Ct("fixedItemHeight"),r=Et(E.useMemo(()=>te(n,s=>vt(s,"height")),[n]),!0,A("skipAnimationFrameInResizeObserver"));return E.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),L.jsx("div",{"data-viewport-type":"element",ref:r,style:qt(!1),children:t})},yr=({children:t})=>{const e=E.useContext(ue),n=Ct("windowViewportRect"),o=Ct("fixedItemHeight"),r=A("customScrollParent"),s=Ge(n,r,A("skipAnimationFrameInResizeObserver"));return E.useEffect(()=>{e&&(o(e.itemHeight),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),L.jsx("div",{"data-viewport-type":"window",ref:s,style:qt(!1),children:t})},br=E.memo(function(e){const n=A("useWindowScroll"),o=A("customScrollParent"),r=Ct("fixedHeaderHeight"),s=Ct("fixedFooterHeight"),i=A("fixedHeaderContent"),l=A("fixedFooterContent"),c=A("context"),a=Et(E.useMemo(()=>te(r,u=>vt(u,"height")),[r]),!0,A("skipAnimationFrameInResizeObserver")),m=Et(E.useMemo(()=>te(s,u=>vt(u,"height")),[s]),!0,A("skipAnimationFrameInResizeObserver")),S=o||n?Er:Rr,h=o||n?yr:vr,x=A("TableComponent"),C=A("TableHeadComponent"),v=A("TableFooterComponent"),g=i?L.jsx(C,{ref:a,style:{position:"sticky",top:0,zIndex:2},...Z(C,c),children:i()},"TableHead"):null,p=l?L.jsx(v,{ref:m,style:{bottom:0,position:"sticky",zIndex:1},...Z(v,c),children:l()},"TableFoot"):null;return L.jsx(S,{...e,...Z(S,c),children:L.jsx(h,{children:L.jsxs(x,{style:{borderSpacing:0,overflowAnchor:"none"},...Z(x,c),children:[g,L.jsx(wr,{},"TableBody"),p]})})})}),{Component:no,useEmitter:tn,useEmitterValue:A,usePublisher:Ct}=Ke(Ir,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},br),Rr=Xe({useEmitter:tn,useEmitterValue:A,usePublisher:Ct}),Er=Je({useEmitter:tn,useEmitterValue:A,usePublisher:Ct}),Hr=no,kr=no,vn={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Br={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:yn,floor:Te,max:Qt,min:Be,round:bn}=Math;function Rn(t,e,n){return Array.from({length:e-t+1}).map((o,r)=>({data:n===null?null:n[r+t],index:r+t}))}function Fr(t){return{...Br,items:t}}function pe(t,e){return t&&t.width===e.width&&t.height===e.height}function Or(t,e){return t&&t.column===e.column&&t.row===e.row}const Lr=$(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:o},{footerHeight:r,headerHeight:s,scrollBy:i,scrollContainerState:l,scrollTo:c,scrollTop:a,smoothScrollTargetReached:m,viewportHeight:S},h,x,{didMount:C,propsReady:v},{customScrollParent:g,useWindowScroll:p,windowScrollContainerState:u,windowScrollTo:T,windowViewportRect:R},f])=>{const d=w(0),y=w(0),k=w(vn),B=w({height:0,width:0}),z=w({height:0,width:0}),V=D(),W=D(),J=w(0),nt=w(null),F=w({column:0,row:0}),q=D(),it=D(),ft=w(!1),It=w(0),mt=w(!0),ut=w(!1),Mt=w(!1);U(I(C,_(It),M(([b,N])=>!!N)),()=>{G(mt,!1)}),U(I(rt(C,mt,z,B,It,ut),M(([b,N,Q,lt,,tt])=>b&&!N&&Q.height!==0&<.height!==0&&!tt)),([,,,,b])=>{G(ut,!0),Ne(1,()=>{G(V,b)}),Tt(I(a),()=>{G(e,[0,0]),G(mt,!0)})}),O(I(it,M(b=>b!=null&&b.scrollTop>0),bt(0)),y),U(I(C,_(it),M(([,b])=>b!=null)),([,b])=>{b&&(G(B,b.viewport),G(z,b.item),G(F,b.gap),b.scrollTop>0&&(G(ft,!0),Tt(I(a,Wt(1)),N=>{G(ft,!1)}),G(c,{top:b.scrollTop})))}),O(I(B,H(({height:b})=>b)),S),O(I(rt(P(B,pe),P(z,pe),P(F,(b,N)=>b&&b.column===N.column&&b.row===N.row),P(a)),H(([b,N,Q,lt])=>({gap:Q,item:N,scrollTop:lt,viewport:b}))),q),O(I(rt(P(d),o,P(F,Or),P(z,pe),P(B,pe),P(nt),P(y),P(ft),P(mt),P(It)),M(([,,,,,,,b])=>!b),H(([b,[N,Q],lt,tt,Ft,Zt,Nt,,ae,Ot])=>{const{column:Lt,row:Xt}=lt,{height:de,width:be}=tt,{width:en}=Ft;if(Nt===0&&(b===0||en===0))return vn;if(be===0){const ln=De(Ot,b),io=ln+Math.max(Nt-1,0);return Fr(Rn(ln,io,Zt))}const fe=oo(en,be,Lt);let Dt,At;ae?N===0&&Q===0&&Nt>0?(Dt=0,At=Nt-1):(Dt=fe*Te((N+Xt)/(de+Xt)),At=fe*yn((Q+Xt)/(de+Xt))-1,At=Be(b-1,Qt(At,fe-1)),Dt=Be(At,Qt(0,Dt))):(Dt=0,At=-1);const nn=Rn(Dt,At,Zt),{bottom:on,top:rn}=En(Ft,lt,tt,nn),sn=yn(b/fe),so=sn*de+(sn-1)*Xt-on;return{bottom:on,itemHeight:de,items:nn,itemWidth:be,offsetBottom:so,offsetTop:rn,top:rn}})),k),O(I(nt,M(b=>b!==null),H(b=>b.length)),d),O(I(rt(B,z,k,F),M(([b,N,{items:Q}])=>Q.length>0&&N.height!==0&&b.height!==0),H(([b,N,{items:Q},lt])=>{const{bottom:tt,top:Ft}=En(b,lt,N,Q);return[Ft,tt]}),Y(oe)),e);const St=w(!1);O(I(a,_(St),H(([b,N])=>N||b!==0)),St);const Yt=ht(I(rt(k,d),M(([{items:b}])=>b.length>0),_(St),M(([[b,N],Q])=>{const tt=b.items[b.items.length-1].index===N-1;return(Q||b.bottom>0&&b.itemHeight>0&&b.offsetBottom===0&&b.items.length===N)&&tt}),H(([[,b]])=>b-1),Y())),jt=ht(I(P(k),M(({items:b})=>b.length>0&&b[0].index===0),bt(0),Y())),yt=ht(I(P(k),_(ft),M(([{items:b},N])=>b.length>0&&!N),H(([{items:b}])=>({endIndex:b[b.length-1].index,startIndex:b[0].index})),Y(Mn),Bt(0)));O(yt,x.scrollSeekRangeChanged),O(I(V,_(B,z,d,F),H(([b,N,Q,lt,tt])=>{const Ft=_n(b),{align:Zt,behavior:Nt,offset:ae}=Ft;let Ot=Ft.index;Ot==="LAST"&&(Ot=lt-1),Ot=Qt(0,Ot,Be(lt-1,Ot));let Lt=Pe(N,tt,Q,Ot);return Zt==="end"?Lt=bn(Lt-N.height+Q.height):Zt==="center"&&(Lt=bn(Lt-N.height/2+Q.height/2)),ae&&(Lt+=ae),{behavior:Nt,top:Lt}})),c);const kt=ct(I(k,H(b=>b.offsetBottom+b.bottom)),0);return O(I(R,H(b=>({height:b.visibleHeight,width:b.visibleWidth}))),B),{customScrollParent:g,data:nt,deviation:J,footerHeight:r,gap:F,headerHeight:s,increaseViewportBy:t,initialItemCount:y,itemDimensions:z,overscan:n,restoreStateFrom:it,scrollBy:i,scrollContainerState:l,scrollHeight:W,scrollTo:c,scrollToIndex:V,scrollTop:a,smoothScrollTargetReached:m,totalCount:d,useWindowScroll:p,viewportDimensions:B,windowScrollContainerState:u,windowScrollTo:T,windowViewportRect:R,...x,gridState:k,horizontalDirection:Mt,initialTopMostItemIndex:It,totalListHeight:kt,...h,endReached:Yt,propsReady:v,rangeChanged:yt,startReached:jt,stateChanged:q,stateRestoreInProgress:ft,...f}},X($e,dt,ce,qn,Pt,Ue,Vt));function oo(t,e,n){return Qt(1,Te((t+n)/(Te(e)+n)))}function En(t,e,n,o){const{height:r}=n;if(r===void 0||o.length===0)return{bottom:0,top:0};const s=Pe(t,e,n,o[0].index);return{bottom:Pe(t,e,n,o[o.length-1].index)+r,top:s}}function Pe(t,e,n,o){const r=oo(t.width,n.width,e.column),s=Te(o/r),i=s*n.height+Qt(0,s-1)*e.row;return i>0?i+e.row:i}const zr=$(()=>{const t=w(S=>`Item ${S}`),e=w({}),n=w(null),o=w("virtuoso-grid-item"),r=w("virtuoso-grid-list"),s=w(Ze),i=w("div"),l=w(Kt),c=(S,h=null)=>ct(I(e,H(x=>x[S]),Y()),h),a=w(!1),m=w(!1);return O(P(m),a),{components:e,computeItemKey:s,context:n,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:i,itemClassName:o,ItemComponent:c("Item","div"),itemContent:t,listClassName:r,ListComponent:c("List","div"),readyStateChanged:a,reportReadyState:m,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),Vr=$(([t,e])=>({...t,...e}),X(Lr,zr)),Pr=E.memo(function(){const e=et("gridState"),n=et("listClassName"),o=et("itemClassName"),r=et("itemContent"),s=et("computeItemKey"),i=et("isSeeking"),l=xt("scrollHeight"),c=et("ItemComponent"),a=et("ListComponent"),m=et("ScrollSeekPlaceholder"),S=et("context"),h=xt("itemDimensions"),x=xt("gap"),C=et("log"),v=et("stateRestoreInProgress"),g=xt("reportReadyState"),p=Et(E.useMemo(()=>u=>{const T=u.parentElement.parentElement.scrollHeight;l(T);const R=u.firstChild;if(R){const{height:f,width:d}=R.getBoundingClientRect();h({height:f,width:d})}x({column:Hn("column-gap",getComputedStyle(u).columnGap,C),row:Hn("row-gap",getComputedStyle(u).rowGap,C)})},[l,h,x,C]),!0,!1);return Xn(()=>{e.itemHeight>0&&e.itemWidth>0&&g(!0)},[e]),v?null:L.jsx(a,{className:n,ref:p,...Z(a,S),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(u=>{const T=s(u.index,u.data,S);return i?L.jsx(m,{...Z(m,S),height:e.itemHeight,index:u.index,width:e.itemWidth},T):E.createElement(c,{...Z(c,S),className:o,"data-index":u.index,key:T},r(u.index,u.data,S))})})}),Mr=E.memo(function(){const e=et("HeaderComponent"),n=xt("headerHeight"),o=et("headerFooterTag"),r=Et(E.useMemo(()=>i=>{n(vt(i,"height"))},[n]),!0,!1),s=et("context");return e?L.jsx(o,{ref:r,children:L.jsx(e,{...Z(e,s)})}):null}),jr=E.memo(function(){const e=et("FooterComponent"),n=xt("footerHeight"),o=et("headerFooterTag"),r=Et(E.useMemo(()=>i=>{n(vt(i,"height"))},[n]),!0,!1),s=et("context");return e?L.jsx(o,{ref:r,children:L.jsx(e,{...Z(e,s)})}):null}),Ar=({children:t})=>{const e=E.useContext(qe),n=xt("itemDimensions"),o=xt("viewportDimensions"),r=Et(E.useMemo(()=>s=>{o(s.getBoundingClientRect())},[o]),!0,!1);return E.useEffect(()=>{e&&(o({height:e.viewportHeight,width:e.viewportWidth}),n({height:e.itemHeight,width:e.itemWidth}))},[e,o,n]),L.jsx("div",{ref:r,style:qt(!1),children:t})},Gr=({children:t})=>{const e=E.useContext(qe),n=xt("windowViewportRect"),o=xt("itemDimensions"),r=et("customScrollParent"),s=Ge(n,r,!1);return E.useEffect(()=>{e&&(o({height:e.itemHeight,width:e.itemWidth}),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,o]),L.jsx("div",{ref:s,style:qt(!1),children:t})},Wr=E.memo(function({...e}){const n=et("useWindowScroll"),o=et("customScrollParent"),r=o||n?Dr:Nr,s=o||n?Gr:Ar,i=et("context");return L.jsx(r,{...e,...Z(r,i),children:L.jsxs(s,{children:[L.jsx(Mr,{}),L.jsx(Pr,{}),L.jsx(jr,{})]})})}),{Component:_r,useEmitter:ro,useEmitterValue:et,usePublisher:xt}=Ke(Vr,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},Wr),Nr=Xe({useEmitter:ro,useEmitterValue:et,usePublisher:xt}),Dr=Je({useEmitter:ro,useEmitterValue:et,usePublisher:xt});function Hn(t,e,n){return e!=="normal"&&!(e!=null&&e.endsWith("px"))&&n(`${t} was not resolved to pixel value correctly`,e,at.WARN),e==="normal"?0:parseInt(e!=null?e:"0",10)}const $r=_r;exports.GroupedTableVirtuoso=kr;exports.GroupedVirtuoso=gr;exports.LogLevel=at;exports.TableVirtuoso=Hr;exports.Virtuoso=hr;exports.VirtuosoGrid=$r;exports.VirtuosoGridMockContext=qe;exports.VirtuosoMockContext=ue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react/jsx-runtime"),H=require("react"),lo=require("react-dom"),Ce=0,Lt=1,Ut=2,kn=4;function cn(t){return()=>t}function co(t){t()}function te(t,e){return n=>t(e(n))}function un(t,e){return()=>t(e)}function uo(t,e){return n=>t(e,n)}function Pe(t){return t!==void 0}function ao(...t){return()=>{t.map(co)}}function Kt(){}function we(t,e){return e(t),t}function fo(t,e){return e(t)}function Q(...t){return t}function Y(t,e){return t(Lt,e)}function W(t,e){t(Ce,e)}function Me(t){t(Ut)}function ot(t){return t(kn)}function F(t,e){return Y(t,uo(e,Ce))}function Tt(t,e){const n=t(Lt,o=>{n(),e(o)});return n}function an(t){let e,n;return o=>r=>{e=r,n&&clearTimeout(n),n=setTimeout(()=>{o(e)},t)}}function Bn(t,e){return t===e}function X(t=Bn){let e;return n=>o=>{t(e,o)||(e=o,n(o))}}function P(t){return e=>n=>{t(n)&&e(n)}}function B(t){return e=>te(e,t)}function bt(t){return e=>()=>{e(t)}}function I(t,...e){const n=mo(...e);return(o,r)=>{switch(o){case Ut:Me(t);return;case Lt:return Y(t,n(r))}}}function Rt(t,e){return n=>o=>{n(e=t(e,o))}}function Wt(t){return e=>n=>{t>0?t--:e(n)}}function Bt(t){let e=null,n;return o=>r=>{e=r,!n&&(n=setTimeout(()=>{n=void 0,o(e)},t))}}function _(...t){const e=new Array(t.length);let n=0,o=null;const r=Math.pow(2,t.length)-1;return t.forEach((s,i)=>{const l=Math.pow(2,i);Y(s,c=>{const a=n;n=n|l,e[i]=c,a!==r&&n===r&&o&&(o(),o=null)})}),s=>i=>{const l=()=>{s([i].concat(e))};n===r?l():o=l}}function mo(...t){return e=>t.reduceRight(fo,e)}function po(t){let e,n;const o=()=>e==null?void 0:e();return function(r,s){switch(r){case Lt:return s?n===s?void 0:(o(),n=s,e=Y(t,s),e):(o(),Kt);case Ut:o(),n=null;return}}}function w(t){let e=t;const n=$();return(o,r)=>{switch(o){case Ce:e=r;break;case Lt:{r(e);break}case kn:return e}return n(o,r)}}function at(t,e){return we(w(e),n=>F(t,n))}function $(){const t=[];return(e,n)=>{switch(e){case Ce:t.slice().forEach(o=>{o(n)});return;case Ut:t.splice(0,t.length);return;case Lt:return t.push(n),()=>{const o=t.indexOf(n);o>-1&&t.splice(o,1)}}}}function gt(t){return we($(),e=>F(t,e))}function K(t,e=[],{singleton:n}={singleton:!0}){return{constructor:t,dependencies:e,id:ho(),singleton:n}}const ho=()=>Symbol();function go(t){const e=new Map,n=({constructor:o,dependencies:r,id:s,singleton:i})=>{if(i&&e.has(s))return e.get(s);const l=o(r.map(c=>n(c)));return i&&e.set(s,l),l};return n(t)}function st(...t){const e=$(),n=new Array(t.length);let o=0;const r=Math.pow(2,t.length)-1;return t.forEach((s,i)=>{const l=Math.pow(2,i);Y(s,c=>{n[i]=c,o=o|l,o===r&&W(e,n)})}),function(s,i){switch(s){case Ut:{Me(e);return}case Lt:return o===r&&i(n),Y(e,i)}}}function M(t,e=Bn){return I(t,X(e))}function ze(...t){return function(e,n){switch(e){case Ut:return;case Lt:return ao(...t.map(o=>Y(o,n)))}}}var mt=(t=>(t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR",t))(mt||{});const xo={0:"debug",3:"error",1:"log",2:"warn"},Io=()=>typeof globalThis>"u"?window:globalThis,Vt=K(()=>{const t=w(3);return{log:w((n,o,r=1)=>{var i;const s=(i=Io().VIRTUOSO_LOG_LEVEL)!=null?i:ot(t);r>=s&&console[xo[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,o)}),logLevel:t}},[],{singleton:!0});function Ht(t,e,n){return je(t,e,n).callbackRef}function je(t,e,n){const o=H.useRef(null);let r=i=>{};const s=H.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(i=>{const l=()=>{const c=i[0].target;c.offsetParent!==null&&t(c)};n?l():requestAnimationFrame(l)}):null,[t,n]);return r=i=>{i&&e?(s==null||s.observe(i),o.current=i):(o.current&&(s==null||s.unobserve(o.current)),o.current=null)},{callbackRef:r,ref:o}}function zn(t,e,n,o,r,s,i,l,c){const a=H.useCallback(m=>{const S=So(m.children,e,l?"offsetWidth":"offsetHeight",r);let p=m.parentElement;for(;!p.dataset.virtuosoScroller;)p=p.parentElement;const T=p.lastElementChild.dataset.viewportType==="window";let v;T&&(v=p.ownerDocument.defaultView);const E=i?l?i.scrollLeft:i.scrollTop:T?l?v.scrollX||v.document.documentElement.scrollLeft:v.scrollY||v.document.documentElement.scrollTop:l?p.scrollLeft:p.scrollTop,h=i?l?i.scrollWidth:i.scrollHeight:T?l?v.document.documentElement.scrollWidth:v.document.documentElement.scrollHeight:l?p.scrollWidth:p.scrollHeight,f=i?l?i.offsetWidth:i.offsetHeight:T?l?v.innerWidth:v.innerHeight:l?p.offsetWidth:p.offsetHeight;o({scrollHeight:h,scrollTop:Math.max(E,0),viewportHeight:f}),s==null||s(l?dn("column-gap",getComputedStyle(m).columnGap,r):dn("row-gap",getComputedStyle(m).rowGap,r)),S!==null&&t(S)},[t,e,r,s,i,o,l]);return je(a,n,c)}function So(t,e,n,o){const r=t.length;if(r===0)return null;const s=[];for(let i=0;i<r;i++){const l=t.item(i);if(l.dataset.index===void 0)continue;const c=parseInt(l.dataset.index),a=parseFloat(l.dataset.knownSize),m=e(l,n);if(m===0&&o("Zero-sized element, this should not happen",{child:l},mt.ERROR),m===a)continue;const S=s[s.length-1];s.length===0||S.size!==m||S.endIndex!==c-1?s.push({endIndex:c,size:m,startIndex:c}):s[s.length-1].endIndex++}return s}function dn(t,e,n){return e!=="normal"&&!(e!=null&&e.endsWith("px"))&&n(`${t} was not resolved to pixel value correctly`,e,mt.WARN),e==="normal"?0:parseInt(e!=null?e:"0",10)}function Ae(t,e,n){const o=H.useRef(null),r=H.useCallback(c=>{if(!(c!=null&&c.offsetParent))return;const a=c.getBoundingClientRect(),m=a.width;let S,p;if(e){const T=e.getBoundingClientRect(),v=a.top-T.top;p=T.height-Math.max(0,v),S=v+e.scrollTop}else{const T=i.current.ownerDocument.defaultView;p=T.innerHeight-Math.max(0,a.top),S=a.top+T.scrollY}o.current={offsetTop:S,visibleHeight:p,visibleWidth:m},t(o.current)},[t,e]),{callbackRef:s,ref:i}=je(r,!0,n),l=H.useCallback(()=>{r(i.current)},[r,i]);return H.useEffect(()=>{var c;if(e){e.addEventListener("scroll",l);const a=new ResizeObserver(()=>{requestAnimationFrame(l)});return a.observe(e),()=>{e.removeEventListener("scroll",l),a.unobserve(e)}}else{const a=(c=i.current)==null?void 0:c.ownerDocument.defaultView;return a==null||a.addEventListener("scroll",l),a==null||a.addEventListener("resize",l),()=>{a==null||a.removeEventListener("scroll",l),a==null||a.removeEventListener("resize",l)}}},[l,e,i]),s}const pt=K(()=>{const t=$(),e=$(),n=w(0),o=$(),r=w(0),s=$(),i=$(),l=w(0),c=w(0),a=w(0),m=w(0),S=$(),p=$(),T=w(!1),v=w(!1),E=w(!1);return F(I(t,B(({scrollTop:h})=>h)),e),F(I(t,B(({scrollHeight:h})=>h)),i),F(e,r),{deviation:n,fixedFooterHeight:a,fixedHeaderHeight:c,footerHeight:m,headerHeight:l,horizontalDirection:v,scrollBy:p,scrollContainerState:t,scrollHeight:i,scrollingInProgress:T,scrollTo:S,scrollTop:e,skipAnimationFrameInResizeObserver:E,smoothScrollTargetReached:o,statefulScrollTop:r,viewportHeight:s}},[],{singleton:!0}),ee={lvl:0};function Fn(t,e){const n=t.length;if(n===0)return[];let{index:o,value:r}=e(t[0]);const s=[];for(let i=1;i<n;i++){const{index:l,value:c}=e(t[i]);s.push({end:l-1,start:o,value:r}),o=l,r=c}return s.push({end:1/0,start:o,value:r}),s}function Z(t){return t===ee}function ne(t,e){if(!Z(t))return e===t.k?t.v:e<t.k?ne(t.l,e):ne(t.r,e)}function wt(t,e,n="k"){if(Z(t))return[-1/0,void 0];if(Number(t[n])===e)return[t.k,t.v];if(Number(t[n])<e){const o=wt(t.r,e,n);return o[0]===-1/0?[t.k,t.v]:o}return wt(t.l,e,n)}function ht(t,e,n){return Z(t)?Vn(e,n,1):e===t.k?it(t,{k:e,v:n}):e<t.k?fn(it(t,{l:ht(t.l,e,n)})):fn(it(t,{r:ht(t.r,e,n)}))}function $t(){return ee}function ve(t,e,n){if(Z(t))return[];const o=wt(t,e)[0];return To(Oe(t,o,n))}function Fe(t,e){if(Z(t))return ee;const{k:n,l:o,r}=t;if(e===n){if(Z(o))return r;if(Z(r))return o;{const[s,i]=Ln(o);return he(it(t,{k:s,l:On(o),v:i}))}}else return e<n?he(it(t,{l:Fe(o,e)})):he(it(t,{r:Fe(r,e)}))}function At(t){return Z(t)?[]:[...At(t.l),{k:t.k,v:t.v},...At(t.r)]}function Oe(t,e,n){if(Z(t))return[];const{k:o,l:r,r:s,v:i}=t;let l=[];return o>e&&(l=l.concat(Oe(r,e,n))),o>=e&&o<=n&&l.push({k:o,v:i}),o<=n&&(l=l.concat(Oe(s,e,n))),l}function he(t){const{l:e,lvl:n,r:o}=t;if(o.lvl>=n-1&&e.lvl>=n-1)return t;if(n>o.lvl+1){if(Re(e))return Gn(it(t,{lvl:n-1}));if(!Z(e)&&!Z(e.r))return it(e.r,{l:it(e,{r:e.r.l}),lvl:n,r:it(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}else{if(Re(t))return Le(it(t,{lvl:n-1}));if(!Z(o)&&!Z(o.l)){const r=o.l,s=Re(r)?o.lvl-1:o.lvl;return it(r,{l:it(t,{lvl:n-1,r:r.l}),lvl:r.lvl+1,r:Le(it(o,{l:r.r,lvl:s}))})}else throw new Error("Unexpected empty nodes")}}function it(t,e){return Vn(e.k!==void 0?e.k:t.k,e.v!==void 0?e.v:t.v,e.lvl!==void 0?e.lvl:t.lvl,e.l!==void 0?e.l:t.l,e.r!==void 0?e.r:t.r)}function On(t){return Z(t.r)?t.l:he(it(t,{r:On(t.r)}))}function Re(t){return Z(t)||t.lvl>t.r.lvl}function Ln(t){return Z(t.r)?[t.k,t.v]:Ln(t.r)}function Vn(t,e,n,o=ee,r=ee){return{k:t,l:o,lvl:n,r,v:e}}function fn(t){return Le(Gn(t))}function Gn(t){const{l:e}=t;return!Z(e)&&e.lvl===t.lvl?it(e,{r:it(t,{l:e.r})}):t}function Le(t){const{lvl:e,r:n}=t;return!Z(n)&&!Z(n.r)&&n.lvl===e&&n.r.lvl===e?it(n,{l:it(t,{r:n.l}),lvl:e+1}):t}function To(t){return Fn(t,({k:e,v:n})=>({index:e,value:n}))}function Pn(t,e){return!!(t&&t.startIndex===e.startIndex&&t.endIndex===e.endIndex)}function oe(t,e){return!!(t&&t[0]===e[0]&&t[1]===e[1])}const We=K(()=>({recalcInProgress:w(!1)}),[],{singleton:!0});function Mn(t,e,n){return t[xe(t,e,n)]}function xe(t,e,n,o=0){let r=t.length-1;for(;o<=r;){const s=Math.floor((o+r)/2),i=t[s],l=n(i,e);if(l===0)return s;if(l===-1){if(r-o<2)return s-1;r=s-1}else{if(r===o)return s;o=s+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`)}function Co(t,e,n,o){const r=xe(t,e,o),s=xe(t,n,o,r);return t.slice(r,s+1)}function vt(t,e){return Math.round(t.getBoundingClientRect()[e])}function ye(t){return!Z(t.groupOffsetTree)}function _e({index:t},e){return e===t?0:e<t?-1:1}function wo(){return{groupIndices:[],groupOffsetTree:$t(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:$t()}}function vo(t,e){let n=Z(t)?0:1/0;for(const o of e){const{endIndex:r,size:s,startIndex:i}=o;if(n=Math.min(n,i),Z(t)){t=ht(t,0,s);continue}const l=ve(t,i-1,r+1);if(l.some(Bo(o)))continue;let c=!1,a=!1;for(const{end:m,start:S,value:p}of l)c?(r>=S||s===p)&&(t=Fe(t,S)):(a=p!==s,c=!0),m>r&&r>=S&&p!==s&&(t=ht(t,r+1,p));a&&(t=ht(t,i,s))}return[t,n]}function yo(t){return typeof t.groupIndex<"u"}function bo({offset:t},e){return e===t?0:e<t?-1:1}function re(t,e,n){if(e.length===0)return 0;const{index:o,offset:r,size:s}=Mn(e,t,_e),i=t-o,l=s*i+(i-1)*n+r;return l>0?l+n:l}function jn(t,e){if(!ye(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function An(t,e,n){if(yo(t))return e.groupIndices[t.groupIndex]+1;{const o=t.index==="LAST"?n:t.index;let r=jn(o,e);return r=Math.max(0,r,Math.min(n,r)),r}}function Ro(t,e,n,o=0){return o>0&&(e=Math.max(e,Mn(t,o,_e).offset)),Fn(Co(t,e,n,bo),ko)}function Ho(t,[e,n,o,r]){e.length>0&&o("received item sizes",e,mt.DEBUG);const s=t.sizeTree;let i=s,l=0;if(n.length>0&&Z(s)&&e.length===2){const p=e[0].size,T=e[1].size;i=n.reduce((v,E)=>ht(ht(v,E,p),E+1,T),i)}else[i,l]=vo(i,e);if(i===s)return t;const{lastIndex:c,lastOffset:a,lastSize:m,offsetTree:S}=Ve(t.offsetTree,l,i,r);return{groupIndices:n,groupOffsetTree:n.reduce((p,T)=>ht(p,T,re(T,S,r)),$t()),lastIndex:c,lastOffset:a,lastSize:m,offsetTree:S,sizeTree:i}}function Eo(t){return At(t).map(({k:e,v:n},o,r)=>{const s=r[o+1];return{endIndex:s?s.k-1:1/0,size:n,startIndex:e}})}function mn(t,e){let n=0,o=0;for(;n<t;)n+=e[o+1]-e[o]-1,o++;return o-(n===t?0:1)}function Ve(t,e,n,o){let r=t,s=0,i=0,l=0,c=0;if(e!==0){c=xe(r,e-1,_e),l=r[c].offset;const m=wt(n,e-1);s=m[0],i=m[1],r.length&&r[c].size===wt(n,e)[1]&&(c-=1),r=r.slice(0,c+1)}else r=[];for(const{start:a,value:m}of ve(n,e,1/0)){const S=a-s,p=S*i+l+S*o;r.push({index:a,offset:p,size:m}),s=a,l=p,i=m}return{lastIndex:s,lastOffset:l,lastSize:i,offsetTree:r}}function ko(t){return{index:t.index,value:t}}function Bo(t){const{endIndex:e,size:n,startIndex:o}=t;return r=>r.start===o&&(r.end===e||r.end===1/0)&&r.value===n}const zo={offsetHeight:"height",offsetWidth:"width"},Et=K(([{log:t},{recalcInProgress:e}])=>{const n=$(),o=$(),r=at(o,0),s=$(),i=$(),l=w(0),c=w([]),a=w(void 0),m=w(void 0),S=w(void 0),p=w(void 0),T=w((d,g)=>vt(d,zo[g])),v=w(void 0),E=w(0),h=wo(),f=at(I(n,_(c,t,E),Rt(Ho,h),X()),h),u=at(I(c,X(),Rt((d,g)=>({current:g,prev:d.current}),{current:[],prev:[]}),B(({prev:d})=>d)),[]);F(I(c,P(d=>d.length>0),_(f,E),B(([d,g,k])=>{const O=d.reduce((z,G,D)=>ht(z,G,re(G,g.offsetTree,k)||D),$t());return{...g,groupIndices:d,groupOffsetTree:O}})),f),F(I(o,_(f),P(([d,{lastIndex:g}])=>d<g),B(([d,{lastIndex:g,lastSize:k}])=>[{endIndex:g,size:k,startIndex:d}])),n),F(a,m);const C=at(I(a,B(d=>d===void 0)),!0);F(I(m,P(d=>d!==void 0&&Z(ot(f).sizeTree)),B(d=>{const g=ot(S),k=ot(c).length>0;return g?k?[{endIndex:0,size:g,startIndex:0},{endIndex:1,size:d,startIndex:1}]:[]:[{endIndex:0,size:d,startIndex:0}]})),n),F(I(p,P(d=>d!==void 0&&d.length>0&&Z(ot(f).sizeTree)),B(d=>{const g=[];let k=d[0],O=0;for(let z=1;z<d.length;z++){const G=d[z];G!==k&&(g.push({endIndex:z-1,size:k,startIndex:O}),k=G,O=z)}return g.push({endIndex:d.length-1,size:k,startIndex:O}),g})),n),F(I(c,_(S,m),P(([,d,g])=>d!==void 0&&g!==void 0),B(([d,g,k])=>{const O=[];for(let z=0;z<d.length;z++){const G=d[z],D=d[z+1];O.push({startIndex:G,endIndex:G,size:g}),D!==void 0&&O.push({startIndex:G+1,endIndex:D-1,size:k})}return O})),n);const R=gt(I(n,_(f),Rt(({sizes:d},[g,k])=>({changed:k!==d,sizes:k}),{changed:!1,sizes:h}),B(d=>d.changed)));Y(I(l,Rt((d,g)=>({diff:d.prev-g,prev:g}),{diff:0,prev:0}),B(d=>d.diff)),d=>{const{groupIndices:g}=ot(f);if(d>0)W(e,!0),W(s,d+mn(d,g));else if(d<0){const k=ot(u);k.length>0&&(d-=mn(-d,k)),W(i,d)}}),Y(I(l,_(t)),([d,g])=>{d<0&&g("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},mt.ERROR)});const y=gt(s);F(I(s,_(f),B(([d,g])=>{const k=g.groupIndices.length>0,O=[],z=g.lastSize;if(k){const G=ne(g.sizeTree,0);let D=0,U=0;for(;D<d;){const q=g.groupIndices[U],rt=g.groupIndices.length===U+1?1/0:g.groupIndices[U+1]-q-1;O.push({endIndex:q,size:G,startIndex:q}),O.push({endIndex:q+1+rt-1,size:z,startIndex:q+1}),U++,D+=rt+1}const V=At(g.sizeTree);return D!==d&&V.shift(),V.reduce((q,{k:rt,v:dt})=>{let ct=q.ranges;return q.prevSize!==0&&(ct=[...q.ranges,{endIndex:rt+d-1,size:q.prevSize,startIndex:q.prevIndex}]),{prevIndex:rt+d,prevSize:dt,ranges:ct}},{prevIndex:d,prevSize:0,ranges:O}).ranges}return At(g.sizeTree).reduce((G,{k:D,v:U})=>({prevIndex:D+d,prevSize:U,ranges:[...G.ranges,{endIndex:D+d-1,size:G.prevSize,startIndex:G.prevIndex}]}),{prevIndex:0,prevSize:z,ranges:[]}).ranges})),n);const x=gt(I(i,_(f,E),B(([d,{offsetTree:g},k])=>{const O=-d;return re(O,g,k)})));return F(I(i,_(f,E),B(([d,g,k])=>{if(g.groupIndices.length>0){if(Z(g.sizeTree))return g;let z=$t();const G=ot(u);let D=0,U=0,V=0;for(;D<-d;){V=G[U];const q=G[U+1]-V-1;U++,D+=q+1}if(z=At(g.sizeTree).reduce((q,{k:rt,v:dt})=>ht(q,Math.max(0,rt+d),dt),z),D!==-d){const q=ne(g.sizeTree,V);z=ht(z,0,q);const rt=wt(g.sizeTree,-d+1)[1];z=ht(z,1,rt)}return{...g,sizeTree:z,...Ve(g.offsetTree,0,z,k)}}else{const z=At(g.sizeTree).reduce((G,{k:D,v:U})=>ht(G,Math.max(0,D+d),U),$t());return{...g,sizeTree:z,...Ve(g.offsetTree,0,z,k)}}})),f),{beforeUnshiftWith:y,data:v,defaultItemSize:m,firstItemIndex:l,fixedItemSize:a,fixedGroupSize:S,gap:E,groupIndices:c,heightEstimates:p,itemSize:T,listRefresh:R,shiftWith:i,shiftWithOffset:x,sizeRanges:n,sizes:f,statefulTotalCount:r,totalCount:o,trackItemSizes:C,unshiftWith:s}},Q(Vt,We),{singleton:!0});function Fo(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const Wn=K(([{groupIndices:t,sizes:e,totalCount:n},{headerHeight:o,scrollTop:r}])=>{const s=$(),i=$(),l=gt(I(s,B(Fo)));return F(I(l,B(c=>c.totalCount)),n),F(I(l,B(c=>c.groupIndices)),t),F(I(st(r,e,o),P(([c,a])=>ye(a)),B(([c,a,m])=>wt(a.groupOffsetTree,Math.max(c-m,0),"v")[0]),X(),B(c=>[c])),i),{groupCounts:s,topItemsIndexes:i}},Q(Et,pt)),Gt=K(([{log:t}])=>{const e=w(!1),n=gt(I(e,P(o=>o),X()));return Y(e,o=>{o&&ot(t)("props updated",{},mt.DEBUG)}),{didMount:n,propsReady:e}},Q(Vt),{singleton:!0}),Oo=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function _n(t){const e=typeof t=="number"?{index:t}:t;return e.align||(e.align="start"),(!e.behavior||!Oo)&&(e.behavior="auto"),e.offset||(e.offset=0),e}const ie=K(([{gap:t,listRefresh:e,sizes:n,totalCount:o},{fixedFooterHeight:r,fixedHeaderHeight:s,footerHeight:i,headerHeight:l,scrollingInProgress:c,scrollTo:a,smoothScrollTargetReached:m,viewportHeight:S},{log:p}])=>{const T=$(),v=$(),E=w(0);let h=null,f=null,u=null;function C(){h&&(h(),h=null),u&&(u(),u=null),f&&(clearTimeout(f),f=null),W(c,!1)}return F(I(T,_(n,S,o,E,l,i,p),_(t,s,r),B(([[R,y,x,d,g,k,O,z],G,D,U])=>{const V=_n(R),{align:lt,behavior:q,offset:rt}=V,dt=d-1,ct=An(V,y,dt);let ft=re(ct,y.offsetTree,G)+k;lt==="end"?(ft+=D+wt(y.sizeTree,ct)[1]-x+U,ct===dt&&(ft+=O)):lt==="center"?ft+=(D+wt(y.sizeTree,ct)[1]-x+U)/2:ft-=g,rt&&(ft+=rt);const Pt=St=>{C(),St?(z("retrying to scroll to",{location:R},mt.DEBUG),W(T,R)):(W(v,!0),z("list did not change, scroll successful",{},mt.DEBUG))};if(C(),q==="smooth"){let St=!1;u=Y(e,Yt=>{St=St||Yt}),h=Tt(m,()=>{Pt(St)})}else h=Tt(I(e,Lo(150)),Pt);return f=setTimeout(()=>{C()},1200),W(c,!0),z("scrolling from index to",{behavior:q,index:ct,top:ft},mt.DEBUG),{behavior:q,top:ft}})),a),{scrollTargetReached:v,scrollToIndex:T,topListHeight:E}},Q(Et,pt,Vt),{singleton:!0});function Lo(t){return e=>{const n=setTimeout(()=>{e(!1)},t);return o=>{o&&(e(!0),clearTimeout(n))}}}function Ne(t,e){t==0?e():requestAnimationFrame(()=>{Ne(t-1,e)})}function De(t,e){const n=e-1;return typeof t=="number"?t:t.index==="LAST"?n:t.index}const le=K(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:o},{scrollTargetReached:r,scrollToIndex:s},{didMount:i}])=>{const l=w(!0),c=w(0),a=w(!0);return F(I(i,_(c),P(([m,S])=>!!S),bt(!1)),l),F(I(i,_(c),P(([m,S])=>!!S),bt(!1)),a),Y(I(st(e,i),_(l,n,t,a),P(([[,m],S,{sizeTree:p},T,v])=>m&&(!Z(p)||Pe(T))&&!S&&!v),_(c)),([,m])=>{Tt(r,()=>{W(a,!0)}),Ne(4,()=>{Tt(o,()=>{W(l,!0)}),W(s,m)})}),{initialItemFinalLocationReached:a,initialTopMostItemIndex:c,scrolledToInitialItem:l}},Q(Et,pt,ie,Gt),{singleton:!0});function Nn(t,e){return Math.abs(t-e)<1.01}const se="up",Jt="down",Vo="none",Go={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Po=0,ce=K(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:o,scrollTop:r,viewportHeight:s}])=>{const i=w(!1),l=w(!0),c=$(),a=$(),m=w(4),S=w(Po),p=at(I(ze(I(M(r),Wt(1),bt(!0)),I(M(r),Wt(1),bt(!1),an(100))),X()),!1),T=at(I(ze(I(n,bt(!0)),I(n,bt(!1),an(200))),X()),!1);F(I(st(M(r),M(S)),B(([u,C])=>u<=C),X()),l),F(I(l,Bt(50)),a);const v=gt(I(st(o,M(s),M(e),M(t),M(m)),Rt((u,[{scrollHeight:C,scrollTop:R},y,x,d,g])=>{const k=R+y-C>-g,O={scrollHeight:C,scrollTop:R,viewportHeight:y};if(k){let G,D;return R>u.state.scrollTop?(G="SCROLLED_DOWN",D=u.state.scrollTop-R):(G="SIZE_DECREASED",D=u.state.scrollTop-R||u.scrollTopDelta),{atBottom:!0,atBottomBecause:G,scrollTopDelta:D,state:O}}let z;return O.scrollHeight>u.state.scrollHeight?z="SIZE_INCREASED":y<u.state.viewportHeight?z="VIEWPORT_HEIGHT_DECREASING":R<u.state.scrollTop?z="SCROLLING_UPWARDS":z="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:z,state:O}},Go),X((u,C)=>u&&u.atBottom===C.atBottom))),E=at(I(o,Rt((u,{scrollHeight:C,scrollTop:R,viewportHeight:y})=>{if(Nn(u.scrollHeight,C))return{changed:!1,jump:0,scrollHeight:C,scrollTop:R};{const x=C-(R+y)<1;return u.scrollTop!==R&&x?{changed:!0,jump:u.scrollTop-R,scrollHeight:C,scrollTop:R}:{changed:!0,jump:0,scrollHeight:C,scrollTop:R}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),P(u=>u.changed),B(u=>u.jump)),0);F(I(v,B(u=>u.atBottom)),i),F(I(i,Bt(50)),c);const h=w(Jt);F(I(o,B(({scrollTop:u})=>u),X(),Rt((u,C)=>ot(T)?{direction:u.direction,prevScrollTop:C}:{direction:C<u.prevScrollTop?se:Jt,prevScrollTop:C},{direction:Jt,prevScrollTop:0}),B(u=>u.direction)),h),F(I(o,Bt(50),bt(Vo)),h);const f=w(0);return F(I(p,P(u=>!u),bt(0)),f),F(I(r,Bt(100),_(p),P(([u,C])=>!!C),Rt(([u,C],[R])=>[C,R],[0,0]),B(([u,C])=>C-u)),f),{atBottomState:v,atBottomStateChange:c,atBottomThreshold:m,atTopStateChange:a,atTopThreshold:S,isAtBottom:i,isAtTop:l,isScrolling:p,lastJumpDueToItemResize:E,scrollDirection:h,scrollVelocity:f}},Q(pt)),Ie="top",Se="bottom",pn="none";function hn(t,e,n){return typeof t=="number"?n===se&&e===Ie||n===Jt&&e===Se?t:0:n===se?e===Ie?t.main:t.reverse:e===Se?t.main:t.reverse}function gn(t,e){var n;return typeof t=="number"?t:(n=t[e])!=null?n:0}const $e=K(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:o,viewportHeight:r}])=>{const s=$(),i=w(0),l=w(0),c=w(0),a=at(I(st(M(o),M(r),M(n),M(s,oe),M(c),M(i),M(e),M(t),M(l)),B(([m,S,p,[T,v],E,h,f,u,C])=>{const R=m-u,y=h+f,x=Math.max(p-R,0);let d=pn;const g=gn(C,Ie),k=gn(C,Se);return T-=u,T+=p+f,v+=p+f,v-=u,T>m+y-g&&(d=se),v<m-x+S+k&&(d=Jt),d!==pn?[Math.max(R-p-hn(E,Ie,d)-g,0),R-x-f+S+hn(E,Se,d)+k]:null}),P(m=>m!=null),X(oe)),[0,0]);return{increaseViewportBy:l,listBoundary:s,overscan:c,topListHeight:i,visibleRange:a}},Q(pt),{singleton:!0});function Mo(t,e,n){if(ye(e)){const o=jn(t,e);return[{index:wt(e.groupOffsetTree,o)[0],offset:0,size:0},{data:n==null?void 0:n[0],index:o,offset:0,size:0}]}return[{data:n==null?void 0:n[0],index:t,offset:0,size:0}]}const He={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function ge(t,e,n,o,r,s){const{lastIndex:i,lastOffset:l,lastSize:c}=r;let a=0,m=0;if(t.length>0){a=t[0].offset;const E=t[t.length-1];m=E.offset+E.size}const S=n-i,p=l+S*c+(S-1)*o,T=a,v=p-m;return{bottom:m,firstItemIndex:s,items:xn(t,r,s),offsetBottom:v,offsetTop:a,top:T,topItems:xn(e,r,s),topListHeight:e.reduce((E,h)=>h.size+E,0),totalCount:n}}function Dn(t,e,n,o,r,s){let i=0;if(n.groupIndices.length>0)for(const m of n.groupIndices){if(m-i>=t)break;i++}const l=t+i,c=De(e,l),a=Array.from({length:l}).map((m,S)=>({data:s[S+c],index:S+c,offset:0,size:0}));return ge(a,[],l,r,n,o)}function xn(t,e,n){if(t.length===0)return[];if(!ye(e))return t.map(a=>({...a,index:a.index+n,originalIndex:a.index}));const o=t[0].index,r=t[t.length-1].index,s=[],i=ve(e.groupOffsetTree,o,r);let l,c=0;for(const a of t){(!l||l.end<a.index)&&(l=i.shift(),c=e.groupIndices.indexOf(l.start));let m;a.index===l.start?m={index:c,type:"group"}:m={groupIndex:c,index:a.index-(c+1)+n},s.push({...m,data:a.data,offset:a.offset,originalIndex:a.index,size:a.size})}return s}const _t=K(([{data:t,firstItemIndex:e,gap:n,sizes:o,totalCount:r},s,{listBoundary:i,topListHeight:l,visibleRange:c},{initialTopMostItemIndex:a,scrolledToInitialItem:m},{topListHeight:S},p,{didMount:T},{recalcInProgress:v}])=>{const E=w([]),h=w(0),f=$();F(s.topItemsIndexes,E);const u=at(I(st(T,v,M(c,oe),M(r),M(o),M(a),m,M(E),M(e),M(n),t),P(([x,d,,g,,,,,,,k])=>{const O=k&&k.length!==g;return x&&!d&&!O}),B(([,,[x,d],g,k,O,z,G,D,U,V])=>{const lt=k,{offsetTree:q,sizeTree:rt}=lt,dt=ot(h);if(g===0)return{...He,totalCount:g};if(x===0&&d===0)return dt===0?{...He,totalCount:g}:Dn(dt,O,k,D,U,V||[]);if(Z(rt))return dt>0?null:ge(Mo(De(O,g),lt,V),[],g,U,lt,D);const ct=[];if(G.length>0){const Mt=G[0],yt=G[G.length-1];let kt=0;for(const b of ve(rt,Mt,yt)){const N=b.value,tt=Math.max(b.start,Mt),ut=Math.min(b.end,yt);for(let et=tt;et<=ut;et++)ct.push({data:V==null?void 0:V[et],index:et,offset:kt,size:N}),kt+=N}}if(!z)return ge([],ct,g,U,lt,D);const ft=G.length>0?G[G.length-1]+1:0,Pt=Ro(q,x,d,ft);if(Pt.length===0)return null;const St=g-1,Yt=we([],Mt=>{for(const yt of Pt){const kt=yt.value;let b=kt.offset,N=yt.start;const tt=kt.size;if(kt.offset<x){N+=Math.floor((x-kt.offset+U)/(tt+U));const et=N-yt.start;b+=et*tt+et*U}N<ft&&(b+=(ft-N)*tt,N=ft);const ut=Math.min(yt.end,St);for(let et=N;et<=ut&&!(b>=d);et++)Mt.push({data:V==null?void 0:V[et],index:et,offset:b,size:tt}),b+=tt+U}});return ge(Yt,ct,g,U,lt,D)}),P(x=>x!==null),X()),He);F(I(t,P(Pe),B(x=>x==null?void 0:x.length)),r),F(I(u,B(x=>x.topListHeight)),S),F(S,l),F(I(u,B(x=>[x.top,x.bottom])),i),F(I(u,B(x=>x.items)),f);const C=gt(I(u,P(({items:x})=>x.length>0),_(r,t),P(([{items:x},d])=>x[x.length-1].originalIndex===d-1),B(([,x,d])=>[x-1,d]),X(oe),B(([x])=>x))),R=gt(I(u,Bt(200),P(({items:x,topItems:d})=>x.length>0&&x[0].originalIndex===d.length),B(({items:x})=>x[0].index),X())),y=gt(I(u,P(({items:x})=>x.length>0),B(({items:x})=>{let d=0,g=x.length-1;for(;x[d].type==="group"&&d<g;)d++;for(;x[g].type==="group"&&g>d;)g--;return{endIndex:x[g].index,startIndex:x[d].index}}),X(Pn)));return{endReached:C,initialItemCount:h,itemsRendered:f,listState:u,rangeChanged:y,startReached:R,topItemsIndexes:E,...p}},Q(Et,Wn,$e,le,ie,ce,Gt,We),{singleton:!0}),$n=K(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:o},{listState:r}])=>{const s=$(),i=at(I(st(n,t,o,e,r),B(([l,c,a,m,S])=>l+c+a+m+S.offsetBottom+S.bottom)),0);return F(M(i),s),{totalListHeight:i,totalListHeightChanged:s}},Q(pt,_t),{singleton:!0}),jo=K(([{viewportHeight:t},{totalListHeight:e}])=>{const n=w(!1),o=at(I(st(n,t,e),P(([r])=>r),B(([,r,s])=>Math.max(0,r-s)),Bt(0),X()),0);return{alignToBottom:n,paddingTopAddition:o}},Q(pt,$n),{singleton:!0}),Un=K(()=>({context:w(null)})),Ao=({itemBottom:t,itemTop:e,locationParams:{align:n,behavior:o,...r},viewportBottom:s,viewportTop:i})=>e<i?{...r,align:n!=null?n:"start",behavior:o}:t>s?{...r,align:n!=null?n:"end",behavior:o}:null,Kn=K(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:o,fixedHeaderHeight:r,headerHeight:s,scrollingInProgress:i,scrollTop:l,viewportHeight:c},{scrollToIndex:a}])=>{const m=$();return F(I(m,_(e,c,n,s,r,o,l),_(t),B(([[S,p,T,v,E,h,f,u],C])=>{const{align:R,behavior:y,calculateViewLocation:x=Ao,done:d,...g}=S,k=An(S,p,v-1),O=re(k,p.offsetTree,C)+E+h,z=O+wt(p.sizeTree,k)[1],G=u+h,D=u+T-f,U=x({itemBottom:z,itemTop:O,locationParams:{align:R,behavior:y,...g},viewportBottom:D,viewportTop:G});return U?d&&Tt(I(i,P(V=>!V),Wt(ot(i)?1:2)),d):d&&d(),U}),P(S=>S!==null)),a),{scrollIntoView:m}},Q(Et,pt,ie,_t,Vt),{singleton:!0});function In(t){return t?t==="smooth"?"smooth":"auto":!1}const Wo=(t,e)=>typeof t=="function"?In(t(e)):e&&In(t),_o=K(([{listRefresh:t,totalCount:e,fixedItemSize:n,data:o},{atBottomState:r,isAtBottom:s},{scrollToIndex:i},{scrolledToInitialItem:l},{didMount:c,propsReady:a},{log:m},{scrollingInProgress:S},{context:p},{scrollIntoView:T}])=>{const v=w(!1),E=$();let h=null;function f(y){W(i,{align:"end",behavior:y,index:"LAST"})}Y(I(st(I(M(e),Wt(1)),c),_(M(v),s,l,S),B(([[y,x],d,g,k,O])=>{let z=x&&k,G="auto";return z&&(G=Wo(d,g||O),z=z&&!!G),{followOutputBehavior:G,shouldFollow:z,totalCount:y}}),P(({shouldFollow:y})=>y)),({followOutputBehavior:y,totalCount:x})=>{h&&(h(),h=null),ot(n)?requestAnimationFrame(()=>{ot(m)("following output to ",{totalCount:x},mt.DEBUG),f(y)}):h=Tt(t,()=>{ot(m)("following output to ",{totalCount:x},mt.DEBUG),f(y),h=null})});function u(y){const x=Tt(r,d=>{y&&!d.atBottom&&d.notAtBottomBecause==="SIZE_INCREASED"&&!h&&(ot(m)("scrolling to bottom due to increased size",{},mt.DEBUG),f("auto"))});setTimeout(x,100)}Y(I(st(M(v),e,a),P(([y,,x])=>y&&x),Rt(({value:y},[,x])=>({refreshed:y===x,value:x}),{refreshed:!1,value:0}),P(({refreshed:y})=>y),_(v,e)),([,y])=>{ot(l)&&u(y!==!1)}),Y(E,()=>{u(ot(v)!==!1)}),Y(st(M(v),r),([y,x])=>{y&&!x.atBottom&&x.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&f("auto")});const C=w(null),R=$();return F(ze(I(M(o),B(y=>{var x;return(x=y==null?void 0:y.length)!=null?x:0})),I(M(e))),R),Y(I(st(I(R,Wt(1)),c),_(M(C),l,S,p),B(([[y,x],d,g,k,O])=>x&&g&&(d==null?void 0:d({context:O,totalCount:y,scrollingInProgress:k}))),P(y=>!!y),Bt(0)),y=>{h&&(h(),h=null),ot(n)?requestAnimationFrame(()=>{ot(m)("scrolling into view",{}),W(T,y)}):h=Tt(t,()=>{ot(m)("scrolling into view",{}),W(T,y),h=null})}),{autoscrollToBottom:E,followOutput:v,scrollIntoViewOnChange:C}},Q(Et,ce,ie,le,Gt,Vt,pt,Un,Kn)),No=K(([{data:t,firstItemIndex:e,gap:n,sizes:o},{initialTopMostItemIndex:r},{initialItemCount:s,listState:i},{didMount:l}])=>(F(I(l,_(s),P(([,c])=>c!==0),_(r,o,e,n,t),B(([[,c],a,m,S,p,T=[]])=>Dn(c,a,m,S,p,T))),i),{}),Q(Et,le,_t,Gt),{singleton:!0}),Do=K(([{didMount:t},{scrollTo:e},{listState:n}])=>{const o=w(0);return Y(I(t,_(o),P(([,r])=>r!==0),B(([,r])=>({top:r}))),r=>{Tt(I(n,Wt(1),P(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{W(e,r)})})}),{initialScrollTop:o}},Q(Gt,pt,_t),{singleton:!0}),qn=K(([{scrollVelocity:t}])=>{const e=w(!1),n=$(),o=w(!1);return F(I(t,_(o,e,n),P(([r,s])=>!!s),B(([r,s,i,l])=>{const{enter:c,exit:a}=s;if(i){if(a(r,l))return!1}else if(c(r,l))return!0;return i}),X()),e),Y(I(st(e,t,n),_(o)),([[r,s,i],l])=>{r&&l&&l.change&&l.change(s,i)}),{isSeeking:e,scrollSeekConfiguration:o,scrollSeekRangeChanged:n,scrollVelocity:t}},Q(ce),{singleton:!0}),Ue=K(([{scrollContainerState:t,scrollTo:e}])=>{const n=$(),o=$(),r=$(),s=w(!1),i=w(void 0);return F(I(st(n,o),B(([{scrollHeight:l,scrollTop:c,viewportHeight:a},{offsetTop:m}])=>({scrollHeight:l,scrollTop:Math.max(0,c-m),viewportHeight:a}))),t),F(I(e,_(o),B(([l,{offsetTop:c}])=>({...l,top:l.top+c}))),r),{customScrollParent:i,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:o}},Q(pt)),$o=K(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:o},{initialTopMostItemIndex:r},{didMount:s},{useWindowScroll:i,windowScrollContainerState:l,windowViewportRect:c}])=>{const a=$(),m=w(void 0),S=w(null),p=w(null);return F(l,S),F(c,p),Y(I(a,_(e,o,i,S,p,n)),([T,v,E,h,f,u,C])=>{const R=Eo(v.sizeTree);h&&f!==null&&u!==null&&(E=f.scrollTop-u.offsetTop),E-=C,T({ranges:R,scrollTop:E})}),F(I(m,P(Pe),B(Uo)),r),F(I(s,_(m),P(([,T])=>T!==void 0),X(),B(([,T])=>T.ranges)),t),{getState:a,restoreStateFrom:m}},Q(Et,pt,le,Gt,Ue));function Uo(t){return{align:"start",index:0,offset:t.scrollTop}}const Ko=K(([{topItemsIndexes:t}])=>{const e=w(0);return F(I(e,P(n=>n>=0),B(n=>Array.from({length:n}).map((o,r)=>r))),t),{topItemCount:e}},Q(_t));function Yn(t){let e=!1,n;return()=>(e||(e=!0,n=t()),n)}const qo=Yn(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Yo=K(([{deviation:t,scrollBy:e,scrollingInProgress:n,scrollTop:o},{isAtBottom:r,isScrolling:s,lastJumpDueToItemResize:i,scrollDirection:l},{listState:c},{beforeUnshiftWith:a,gap:m,shiftWithOffset:S,sizes:p},{log:T},{recalcInProgress:v}])=>{const E=gt(I(c,_(i),Rt(([,f,u,C],[{bottom:R,items:y,offsetBottom:x,totalCount:d},g])=>{const k=R+x;let O=0;return u===d&&f.length>0&&y.length>0&&(y[0].originalIndex===0&&f[0].originalIndex===0||(O=k-C,O!==0&&(O+=g))),[O,y,d,k]},[0,[],0,0]),P(([f])=>f!==0),_(o,l,n,r,T,v),P(([,f,u,C,,,R])=>!R&&!C&&f!==0&&u===se),B(([[f],,,,,u])=>(u("Upward scrolling compensation",{amount:f},mt.DEBUG),f))));function h(f){f>0?(W(e,{behavior:"auto",top:-f}),W(t,0)):(W(t,0),W(e,{behavior:"auto",top:-f}))}return Y(I(E,_(t,s)),([f,u,C])=>{C&&qo()?W(t,u-f):h(-f)}),Y(I(st(at(s,!1),t,v),P(([f,u,C])=>!f&&!C&&u!==0),B(([f,u])=>u),Bt(1)),h),F(I(S,B(f=>({top:-f}))),e),Y(I(a,_(p,m),B(([f,{groupIndices:u,lastSize:C,sizeTree:R},y])=>{function x(d){return d*(C+y)}if(u.length===0)return x(f);{let d=0;const g=ne(R,0);let k=0,O=0;for(;k<f;){k++,d+=g;let z=u.length===O+1?1/0:u[O+1]-u[O]-1;k+z>f&&(d-=g,z=f-k+1),k+=z,d+=x(z),O++}return d}})),f=>{W(t,f),requestAnimationFrame(()=>{W(e,{top:f}),requestAnimationFrame(()=>{W(t,0),W(v,!1)})})}),{deviation:t}},Q(pt,ce,_t,Et,Vt,We)),Zo=K(([t,e,n,o,r,s,i,l,c,a,m])=>({...t,...e,...n,...o,...r,...s,...i,...l,...c,...a,...m}),Q($e,No,Gt,qn,$n,Do,jo,Ue,Kn,Vt,Un)),Zn=K(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:o,fixedGroupSize:r,gap:s,groupIndices:i,heightEstimates:l,itemSize:c,sizeRanges:a,sizes:m,statefulTotalCount:S,totalCount:p,trackItemSizes:T},{initialItemFinalLocationReached:v,initialTopMostItemIndex:E,scrolledToInitialItem:h},f,u,C,{listState:R,topItemsIndexes:y,...x},{scrollToIndex:d},g,{topItemCount:k},{groupCounts:O},z])=>(F(x.rangeChanged,z.scrollSeekRangeChanged),F(I(z.windowViewportRect,B(G=>G.visibleHeight)),f.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:o,fixedGroupHeight:r,gap:s,groupCounts:O,heightEstimates:l,initialItemFinalLocationReached:v,initialTopMostItemIndex:E,scrolledToInitialItem:h,sizeRanges:a,topItemCount:k,topItemsIndexes:y,totalCount:p,...C,groupIndices:i,itemSize:c,listState:R,scrollToIndex:d,statefulTotalCount:S,trackItemSizes:T,...x,...z,...f,sizes:m,...u}),Q(Et,le,pt,$o,_o,_t,ie,Yo,Ko,Wn,Zo));function Xo(t,e){const n={},o={};let r=0;const s=t.length;for(;r<s;)o[t[r]]=1,r+=1;for(const i in e)Object.hasOwn(o,i)||(n[i]=e[i]);return n}const me=typeof document<"u"?H.useLayoutEffect:H.useEffect;function Ke(t,e,n){const o=Object.keys(e.required||{}),r=Object.keys(e.optional||{}),s=Object.keys(e.methods||{}),i=Object.keys(e.events||{}),l=H.createContext({});function c(f,u){f.propsReady&&W(f.propsReady,!1);for(const C of o){const R=f[e.required[C]];W(R,u[C])}for(const C of r)if(C in u){const R=f[e.optional[C]];W(R,u[C])}f.propsReady&&W(f.propsReady,!0)}function a(f){return s.reduce((u,C)=>(u[C]=R=>{const y=f[e.methods[C]];W(y,R)},u),{})}function m(f){return i.reduce((u,C)=>(u[C]=po(f[e.events[C]]),u),{})}const S=H.forwardRef((f,u)=>{const{children:C,...R}=f,[y]=H.useState(()=>we(go(t),g=>{c(g,R)})),[x]=H.useState(un(m,y));me(()=>{for(const g of i)g in R&&Y(x[g],R[g]);return()=>{Object.values(x).map(Me)}},[R,x,y]),me(()=>{c(y,R)}),H.useImperativeHandle(u,cn(a(y)));const d=n;return L.jsx(l.Provider,{value:y,children:n?L.jsx(d,{...Xo([...o,...r,...i],R),children:C}):C})}),p=f=>{const u=H.useContext(l);return H.useCallback(C=>{W(u[f],C)},[u,f])},T=f=>{const C=H.useContext(l)[f],R=H.useCallback(y=>Y(C,y),[C]);return H.useSyncExternalStore(R,()=>ot(C),()=>ot(C))},v=f=>{const C=H.useContext(l)[f],[R,y]=H.useState(un(ot,C));return me(()=>Y(C,x=>{x!==R&&y(cn(x))}),[C,R]),R},E=H.version.startsWith("18")?T:v;return{Component:S,useEmitter:(f,u)=>{const R=H.useContext(l)[f];me(()=>Y(R,u),[u,R])},useEmitterValue:E,usePublisher:p}}const ue=H.createContext(void 0),qe=H.createContext(void 0),Xn=typeof document<"u"?H.useLayoutEffect:H.useEffect;function Ee(t){return"self"in t}function Jo(t){return"body"in t}function Jn(t,e,n,o=Kt,r,s){const i=H.useRef(null),l=H.useRef(null),c=H.useRef(null),a=H.useCallback(p=>{let T,v,E;const h=p.target;if(Jo(h)||Ee(h)){const u=Ee(h)?h:h.defaultView;E=s?u.scrollX:u.scrollY,T=s?u.document.documentElement.scrollWidth:u.document.documentElement.scrollHeight,v=s?u.innerWidth:u.innerHeight}else E=s?h.scrollLeft:h.scrollTop,T=s?h.scrollWidth:h.scrollHeight,v=s?h.offsetWidth:h.offsetHeight;const f=()=>{t({scrollHeight:T,scrollTop:Math.max(E,0),viewportHeight:v})};p.suppressFlushSync?f():lo.flushSync(f),l.current!==null&&(E===l.current||E<=0||E===T-v)&&(l.current=null,e(!0),c.current&&(clearTimeout(c.current),c.current=null))},[t,e,s]);H.useEffect(()=>{const p=r||i.current;return o(r||i.current),a({suppressFlushSync:!0,target:p}),p.addEventListener("scroll",a,{passive:!0}),()=>{o(null),p.removeEventListener("scroll",a)}},[i,a,n,o,r]);function m(p){const T=i.current;if(!T||(s?"offsetWidth"in T&&T.offsetWidth===0:"offsetHeight"in T&&T.offsetHeight===0))return;const v=p.behavior==="smooth";let E,h,f;Ee(T)?(h=Math.max(vt(T.document.documentElement,s?"width":"height"),s?T.document.documentElement.scrollWidth:T.document.documentElement.scrollHeight),E=s?T.innerWidth:T.innerHeight,f=s?window.scrollX:window.scrollY):(h=T[s?"scrollWidth":"scrollHeight"],E=vt(T,s?"width":"height"),f=T[s?"scrollLeft":"scrollTop"]);const u=h-E;if(p.top=Math.ceil(Math.max(Math.min(u,p.top),0)),Nn(E,h)||p.top===f){t({scrollHeight:h,scrollTop:f,viewportHeight:E}),v&&e(!0);return}v?(l.current=p.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,l.current=null,e(!0)},1e3)):l.current=null,s&&(p={behavior:p.behavior,left:p.top}),T.scrollTo(p)}function S(p){s&&(p={behavior:p.behavior,left:p.top}),i.current.scrollBy(p)}return{scrollByCallback:S,scrollerRef:i,scrollToCallback:m}}const ke="-webkit-sticky",Sn="sticky",Ye=Yn(()=>{if(typeof document>"u")return Sn;const t=document.createElement("div");return t.style.position=ke,t.style.position===ke?ke:Sn});function Ze(t){return t}const Qo=K(()=>{const t=w(l=>`Item ${l}`),e=w(l=>`Group ${l}`),n=w({}),o=w(Ze),r=w("div"),s=w(Kt),i=(l,c=null)=>at(I(n,B(a=>a[l]),X()),c);return{components:n,computeItemKey:o,EmptyPlaceholder:i("EmptyPlaceholder"),FooterComponent:i("Footer"),GroupComponent:i("Group","div"),groupContent:e,HeaderComponent:i("Header"),HeaderFooterTag:r,ItemComponent:i("Item","div"),itemContent:t,ListComponent:i("List","div"),ScrollerComponent:i("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:i("ScrollSeekPlaceholder"),TopItemListComponent:i("TopItemList")}}),tr=K(([t,e])=>({...t,...e}),Q(Zn,Qo)),er=({height:t})=>L.jsx("div",{style:{height:t}}),nr={overflowAnchor:"none",position:Ye(),zIndex:1},Qn={overflowAnchor:"none"},or={...Qn,display:"inline-block",height:"100%"},Tn=H.memo(function({showTopList:e=!1}){const n=j("listState"),o=xt("sizeRanges"),r=j("useWindowScroll"),s=j("customScrollParent"),i=xt("windowScrollContainerState"),l=xt("scrollContainerState"),c=s||r?i:l,a=j("itemContent"),m=j("context"),S=j("groupContent"),p=j("trackItemSizes"),T=j("itemSize"),v=j("log"),E=xt("gap"),h=j("horizontalDirection"),{callbackRef:f}=zn(o,T,p,e?Kt:c,v,E,s,h,j("skipAnimationFrameInResizeObserver")),[u,C]=H.useState(0);Qe("deviation",V=>{u!==V&&C(V)});const R=j("EmptyPlaceholder"),y=j("ScrollSeekPlaceholder")||er,x=j("ListComponent"),d=j("ItemComponent"),g=j("GroupComponent"),k=j("computeItemKey"),O=j("isSeeking"),z=j("groupIndices").length>0,G=j("alignToBottom"),D=j("initialItemFinalLocationReached"),U=e?{}:{boxSizing:"border-box",...h?{display:"inline-block",height:"100%",marginLeft:u!==0?u:G?"auto":0,paddingLeft:n.offsetTop,paddingRight:n.offsetBottom,whiteSpace:"nowrap"}:{marginTop:u!==0?u:G?"auto":0,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},...D?{}:{visibility:"hidden"}};return!e&&n.totalCount===0&&R?L.jsx(R,{...J(R,m)}):L.jsx(x,{...J(x,m),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:f,style:U,children:(e?n.topItems:n.items).map(V=>{const lt=V.originalIndex,q=k(lt+n.firstItemIndex,V.data,m);return O?H.createElement(y,{...J(y,m),height:V.size,index:V.index,key:q,type:V.type||"item",...V.type==="group"?{}:{groupIndex:V.groupIndex}}):V.type==="group"?H.createElement(g,{...J(g,m),"data-index":lt,"data-item-index":V.index,"data-known-size":V.size,key:q,style:nr},S(V.index,m)):H.createElement(d,{...J(d,m),...to(d,V.data),"data-index":lt,"data-item-group-index":V.groupIndex,"data-item-index":V.index,"data-known-size":V.size,key:q,style:h?or:Qn},z?a(V.index,V.groupIndex,V.data,m):a(V.index,V.data,m))})})}),rr={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},sr={outline:"none",overflowX:"auto",position:"relative"},qt=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:{}}),ir={position:Ye(),top:0,width:"100%",zIndex:1};function J(t,e){if(typeof t!="string")return{context:e}}function to(t,e){return{item:typeof t=="string"?void 0:e}}const lr=H.memo(function(){const e=j("HeaderComponent"),n=xt("headerHeight"),o=j("HeaderFooterTag"),r=Ht(H.useMemo(()=>i=>{n(vt(i,"height"))},[n]),!0,j("skipAnimationFrameInResizeObserver")),s=j("context");return e?L.jsx(o,{ref:r,children:L.jsx(e,{...J(e,s)})}):null}),cr=H.memo(function(){const e=j("FooterComponent"),n=xt("footerHeight"),o=j("HeaderFooterTag"),r=Ht(H.useMemo(()=>i=>{n(vt(i,"height"))},[n]),!0,j("skipAnimationFrameInResizeObserver")),s=j("context");return e?L.jsx(o,{ref:r,children:L.jsx(e,{...J(e,s)})}):null});function Xe({useEmitter:t,useEmitterValue:e,usePublisher:n}){return H.memo(function({children:s,style:i,context:l,...c}){const a=n("scrollContainerState"),m=e("ScrollerComponent"),S=n("smoothScrollTargetReached"),p=e("scrollerRef"),T=e("horizontalDirection")||!1,{scrollByCallback:v,scrollerRef:E,scrollToCallback:h}=Jn(a,S,m,p,void 0,T);t("scrollTo",h),t("scrollBy",v);const f=T?sr:rr;return L.jsx(m,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:E,style:{...f,...i},tabIndex:0,...c,...J(m,l),children:s})})}function Je({useEmitter:t,useEmitterValue:e,usePublisher:n}){return H.memo(function({children:s,style:i,context:l,...c}){const a=n("windowScrollContainerState"),m=e("ScrollerComponent"),S=n("smoothScrollTargetReached"),p=e("totalListHeight"),T=e("deviation"),v=e("customScrollParent"),E=H.useRef(null),h=e("scrollerRef"),{scrollByCallback:f,scrollerRef:u,scrollToCallback:C}=Jn(a,S,m,h,v);return Xn(()=>{var R;return u.current=v||((R=E.current)==null?void 0:R.ownerDocument.defaultView),()=>{u.current=null}},[u,v]),t("windowScrollTo",C),t("scrollBy",f),L.jsx(m,{ref:E,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...p!==0?{height:p+T}:{}},...c,...J(m,l),children:s})})}const ur=({children:t})=>{const e=H.useContext(ue),n=xt("viewportHeight"),o=xt("fixedItemHeight"),r=j("alignToBottom"),s=j("horizontalDirection"),i=H.useMemo(()=>te(n,c=>vt(c,s?"width":"height")),[n,s]),l=Ht(i,!0,j("skipAnimationFrameInResizeObserver"));return H.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),L.jsx("div",{"data-viewport-type":"element",ref:l,style:qt(r),children:t})},ar=({children:t})=>{const e=H.useContext(ue),n=xt("windowViewportRect"),o=xt("fixedItemHeight"),r=j("customScrollParent"),s=Ae(n,r,j("skipAnimationFrameInResizeObserver")),i=j("alignToBottom");return H.useEffect(()=>{e&&(o(e.itemHeight),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),L.jsx("div",{"data-viewport-type":"window",ref:s,style:qt(i),children:t})},dr=({children:t})=>{const e=j("TopItemListComponent")||"div",n=j("headerHeight"),o={...ir,marginTop:`${n}px`},r=j("context");return L.jsx(e,{style:o,...J(e,r),children:t})},fr=H.memo(function(e){const n=j("useWindowScroll"),o=j("topItemsIndexes").length>0,r=j("customScrollParent"),s=j("context"),i=r||n?pr:mr,l=r||n?ar:ur;return L.jsxs(i,{...e,context:s,children:[o&&L.jsx(dr,{children:L.jsx(Tn,{showTopList:!0})}),L.jsxs(l,{children:[L.jsx(lr,{}),L.jsx(Tn,{}),L.jsx(cr,{})]})]})}),{Component:eo,useEmitter:Qe,useEmitterValue:j,usePublisher:xt}=Ke(tr,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},fr),mr=Xe({useEmitter:Qe,useEmitterValue:j,usePublisher:xt}),pr=Je({useEmitter:Qe,useEmitterValue:j,usePublisher:xt}),hr=eo,gr=eo,xr=K(()=>{const t=w(a=>L.jsxs("td",{children:["Item $",a]})),e=w(null),n=w(a=>L.jsxs("td",{colSpan:1e3,children:["Group ",a]})),o=w(null),r=w(null),s=w({}),i=w(Ze),l=w(Kt),c=(a,m=null)=>at(I(s,B(S=>S[a]),X()),m);return{components:s,computeItemKey:i,context:e,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:r,fixedHeaderContent:o,itemContent:t,groupContent:n,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}}),Ir=K(([t,e])=>({...t,...e}),Q(Zn,xr)),Sr=({height:t})=>L.jsx("tr",{children:L.jsx("td",{style:{height:t}})}),Tr=({height:t})=>L.jsx("tr",{children:L.jsx("td",{style:{border:0,height:t,padding:0}})}),Cr={overflowAnchor:"none"},Cn={position:Ye(),zIndex:2,overflowAnchor:"none"},wn=H.memo(function({showTopList:e=!1}){const n=A("listState"),o=A("computeItemKey"),r=A("firstItemIndex"),s=A("context"),i=A("isSeeking"),l=A("fixedHeaderHeight"),c=A("groupIndices").length>0,a=A("itemContent"),m=A("groupContent"),S=A("ScrollSeekPlaceholder")||Sr,p=A("GroupComponent"),T=A("TableRowComponent"),v=(e?n.topItems:[]).reduce((h,f,u)=>(u===0?h.push(f.size):h.push(h[u-1]+f.size),h),[]),E=(e?n.topItems:n.items).map(h=>{const f=h.originalIndex,u=o(f+r,h.data,s),C=e?f===0?0:v[f-1]:0;return i?H.createElement(S,{...J(S,s),height:h.size,index:h.index,key:u,type:h.type||"item"}):h.type==="group"?H.createElement(p,{...J(p,s),"data-index":f,"data-item-index":h.index,"data-known-size":h.size,key:u,style:{...Cn,top:l}},m(h.index,s)):H.createElement(T,{...J(T,s),...to(T,h.data),"data-index":f,"data-item-index":h.index,"data-known-size":h.size,"data-item-group-index":h.groupIndex,key:u,style:e?{...Cn,top:l+C}:Cr},c?a(h.index,h.groupIndex,h.data,s):a(h.index,h.data,s))});return L.jsx(L.Fragment,{children:E})}),wr=H.memo(function(){const e=A("listState"),n=A("topItemsIndexes").length>0,o=Ct("sizeRanges"),r=A("useWindowScroll"),s=A("customScrollParent"),i=Ct("windowScrollContainerState"),l=Ct("scrollContainerState"),c=s||r?i:l,a=A("trackItemSizes"),m=A("itemSize"),S=A("log"),{callbackRef:p,ref:T}=zn(o,m,a,c,S,void 0,s,!1,A("skipAnimationFrameInResizeObserver")),[v,E]=H.useState(0);tn("deviation",z=>{v!==z&&(T.current.style.marginTop=`${z}px`,E(z))});const h=A("EmptyPlaceholder"),f=A("FillerRow")||Tr,u=A("TableBodyComponent"),C=A("paddingTopAddition"),R=A("statefulTotalCount"),y=A("context");if(R===0&&h)return L.jsx(h,{...J(h,y)});const x=(n?e.topItems:[]).reduce((z,G)=>z+G.size,0),d=e.offsetTop+C+v-x,g=e.offsetBottom,k=d>0?L.jsx(f,{context:y,height:d},"padding-top"):null,O=g>0?L.jsx(f,{context:y,height:g},"padding-bottom"):null;return L.jsxs(u,{"data-testid":"virtuoso-item-list",ref:p,...J(u,y),children:[k,n&&L.jsx(wn,{showTopList:!0}),L.jsx(wn,{}),O]})}),vr=({children:t})=>{const e=H.useContext(ue),n=Ct("viewportHeight"),o=Ct("fixedItemHeight"),r=Ht(H.useMemo(()=>te(n,s=>vt(s,"height")),[n]),!0,A("skipAnimationFrameInResizeObserver"));return H.useEffect(()=>{e&&(n(e.viewportHeight),o(e.itemHeight))},[e,n,o]),L.jsx("div",{"data-viewport-type":"element",ref:r,style:qt(!1),children:t})},yr=({children:t})=>{const e=H.useContext(ue),n=Ct("windowViewportRect"),o=Ct("fixedItemHeight"),r=A("customScrollParent"),s=Ae(n,r,A("skipAnimationFrameInResizeObserver"));return H.useEffect(()=>{e&&(o(e.itemHeight),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,o]),L.jsx("div",{"data-viewport-type":"window",ref:s,style:qt(!1),children:t})},br=H.memo(function(e){const n=A("useWindowScroll"),o=A("customScrollParent"),r=Ct("fixedHeaderHeight"),s=Ct("fixedFooterHeight"),i=A("fixedHeaderContent"),l=A("fixedFooterContent"),c=A("context"),a=Ht(H.useMemo(()=>te(r,u=>vt(u,"height")),[r]),!0,A("skipAnimationFrameInResizeObserver")),m=Ht(H.useMemo(()=>te(s,u=>vt(u,"height")),[s]),!0,A("skipAnimationFrameInResizeObserver")),S=o||n?Hr:Rr,p=o||n?yr:vr,T=A("TableComponent"),v=A("TableHeadComponent"),E=A("TableFooterComponent"),h=i?L.jsx(v,{ref:a,style:{position:"sticky",top:0,zIndex:2},...J(v,c),children:i()},"TableHead"):null,f=l?L.jsx(E,{ref:m,style:{bottom:0,position:"sticky",zIndex:1},...J(E,c),children:l()},"TableFoot"):null;return L.jsx(S,{...e,...J(S,c),children:L.jsx(p,{children:L.jsxs(T,{style:{borderSpacing:0,overflowAnchor:"none"},...J(T,c),children:[h,L.jsx(wr,{},"TableBody"),f]})})})}),{Component:no,useEmitter:tn,useEmitterValue:A,usePublisher:Ct}=Ke(Ir,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},br),Rr=Xe({useEmitter:tn,useEmitterValue:A,usePublisher:Ct}),Hr=Je({useEmitter:tn,useEmitterValue:A,usePublisher:Ct}),Er=no,kr=no,vn={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Br={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:yn,floor:Te,max:Qt,min:Be,round:bn}=Math;function Rn(t,e,n){return Array.from({length:e-t+1}).map((o,r)=>({data:n===null?null:n[r+t],index:r+t}))}function zr(t){return{...Br,items:t}}function pe(t,e){return t&&t.width===e.width&&t.height===e.height}function Fr(t,e){return t&&t.column===e.column&&t.row===e.row}const Or=K(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:o},{footerHeight:r,headerHeight:s,scrollBy:i,scrollContainerState:l,scrollTo:c,scrollTop:a,smoothScrollTargetReached:m,viewportHeight:S},p,T,{didMount:v,propsReady:E},{customScrollParent:h,useWindowScroll:f,windowScrollContainerState:u,windowScrollTo:C,windowViewportRect:R},y])=>{const x=w(0),d=w(0),g=w(vn),k=w({height:0,width:0}),O=w({height:0,width:0}),z=$(),G=$(),D=w(0),U=w(null),V=w({column:0,row:0}),lt=$(),q=$(),rt=w(!1),dt=w(0),ct=w(!0),ft=w(!1),Pt=w(!1);Y(I(v,_(dt),P(([b,N])=>!!N)),()=>{W(ct,!1)}),Y(I(st(v,ct,O,k,dt,ft),P(([b,N,tt,ut,,et])=>b&&!N&&tt.height!==0&&ut.height!==0&&!et)),([,,,,b])=>{W(ft,!0),Ne(1,()=>{W(z,b)}),Tt(I(a),()=>{W(e,[0,0]),W(ct,!0)})}),F(I(q,P(b=>b!=null&&b.scrollTop>0),bt(0)),d),Y(I(v,_(q),P(([,b])=>b!=null)),([,b])=>{b&&(W(k,b.viewport),W(O,b.item),W(V,b.gap),b.scrollTop>0&&(W(rt,!0),Tt(I(a,Wt(1)),N=>{W(rt,!1)}),W(c,{top:b.scrollTop})))}),F(I(k,B(({height:b})=>b)),S),F(I(st(M(k,pe),M(O,pe),M(V,(b,N)=>b&&b.column===N.column&&b.row===N.row),M(a)),B(([b,N,tt,ut])=>({gap:tt,item:N,scrollTop:ut,viewport:b}))),lt),F(I(st(M(x),o,M(V,Fr),M(O,pe),M(k,pe),M(U),M(d),M(rt),M(ct),M(dt)),P(([,,,,,,,b])=>!b),B(([b,[N,tt],ut,et,zt,Zt,Nt,,ae,Ft])=>{const{column:Ot,row:Xt}=ut,{height:de,width:be}=et,{width:en}=zt;if(Nt===0&&(b===0||en===0))return vn;if(be===0){const ln=De(Ft,b),io=ln+Math.max(Nt-1,0);return zr(Rn(ln,io,Zt))}const fe=oo(en,be,Ot);let Dt,jt;ae?N===0&&tt===0&&Nt>0?(Dt=0,jt=Nt-1):(Dt=fe*Te((N+Xt)/(de+Xt)),jt=fe*yn((tt+Xt)/(de+Xt))-1,jt=Be(b-1,Qt(jt,fe-1)),Dt=Be(jt,Qt(0,Dt))):(Dt=0,jt=-1);const nn=Rn(Dt,jt,Zt),{bottom:on,top:rn}=Hn(zt,ut,et,nn),sn=yn(b/fe),so=sn*de+(sn-1)*Xt-on;return{bottom:on,itemHeight:de,items:nn,itemWidth:be,offsetBottom:so,offsetTop:rn,top:rn}})),g),F(I(U,P(b=>b!==null),B(b=>b.length)),x),F(I(st(k,O,g,V),P(([b,N,{items:tt}])=>tt.length>0&&N.height!==0&&b.height!==0),B(([b,N,{items:tt},ut])=>{const{bottom:et,top:zt}=Hn(b,ut,N,tt);return[zt,et]}),X(oe)),e);const St=w(!1);F(I(a,_(St),B(([b,N])=>N||b!==0)),St);const Yt=gt(I(st(g,x),P(([{items:b}])=>b.length>0),_(St),P(([[b,N],tt])=>{const et=b.items[b.items.length-1].index===N-1;return(tt||b.bottom>0&&b.itemHeight>0&&b.offsetBottom===0&&b.items.length===N)&&et}),B(([[,b]])=>b-1),X())),Mt=gt(I(M(g),P(({items:b})=>b.length>0&&b[0].index===0),bt(0),X())),yt=gt(I(M(g),_(rt),P(([{items:b},N])=>b.length>0&&!N),B(([{items:b}])=>({endIndex:b[b.length-1].index,startIndex:b[0].index})),X(Pn),Bt(0)));F(yt,T.scrollSeekRangeChanged),F(I(z,_(k,O,x,V),B(([b,N,tt,ut,et])=>{const zt=_n(b),{align:Zt,behavior:Nt,offset:ae}=zt;let Ft=zt.index;Ft==="LAST"&&(Ft=ut-1),Ft=Qt(0,Ft,Be(ut-1,Ft));let Ot=Ge(N,et,tt,Ft);return Zt==="end"?Ot=bn(Ot-N.height+tt.height):Zt==="center"&&(Ot=bn(Ot-N.height/2+tt.height/2)),ae&&(Ot+=ae),{behavior:Nt,top:Ot}})),c);const kt=at(I(g,B(b=>b.offsetBottom+b.bottom)),0);return F(I(R,B(b=>({height:b.visibleHeight,width:b.visibleWidth}))),k),{customScrollParent:h,data:U,deviation:D,footerHeight:r,gap:V,headerHeight:s,increaseViewportBy:t,initialItemCount:d,itemDimensions:O,overscan:n,restoreStateFrom:q,scrollBy:i,scrollContainerState:l,scrollHeight:G,scrollTo:c,scrollToIndex:z,scrollTop:a,smoothScrollTargetReached:m,totalCount:x,useWindowScroll:f,viewportDimensions:k,windowScrollContainerState:u,windowScrollTo:C,windowViewportRect:R,...T,gridState:g,horizontalDirection:Pt,initialTopMostItemIndex:dt,totalListHeight:kt,...p,endReached:Yt,propsReady:E,rangeChanged:yt,startReached:Mt,stateChanged:lt,stateRestoreInProgress:rt,...y}},Q($e,pt,ce,qn,Gt,Ue,Vt));function oo(t,e,n){return Qt(1,Te((t+n)/(Te(e)+n)))}function Hn(t,e,n,o){const{height:r}=n;if(r===void 0||o.length===0)return{bottom:0,top:0};const s=Ge(t,e,n,o[0].index);return{bottom:Ge(t,e,n,o[o.length-1].index)+r,top:s}}function Ge(t,e,n,o){const r=oo(t.width,n.width,e.column),s=Te(o/r),i=s*n.height+Qt(0,s-1)*e.row;return i>0?i+e.row:i}const Lr=K(()=>{const t=w(S=>`Item ${S}`),e=w({}),n=w(null),o=w("virtuoso-grid-item"),r=w("virtuoso-grid-list"),s=w(Ze),i=w("div"),l=w(Kt),c=(S,p=null)=>at(I(e,B(T=>T[S]),X()),p),a=w(!1),m=w(!1);return F(M(m),a),{components:e,computeItemKey:s,context:n,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:i,itemClassName:o,ItemComponent:c("Item","div"),itemContent:t,listClassName:r,ListComponent:c("List","div"),readyStateChanged:a,reportReadyState:m,ScrollerComponent:c("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),Vr=K(([t,e])=>({...t,...e}),Q(Or,Lr)),Gr=H.memo(function(){const e=nt("gridState"),n=nt("listClassName"),o=nt("itemClassName"),r=nt("itemContent"),s=nt("computeItemKey"),i=nt("isSeeking"),l=It("scrollHeight"),c=nt("ItemComponent"),a=nt("ListComponent"),m=nt("ScrollSeekPlaceholder"),S=nt("context"),p=It("itemDimensions"),T=It("gap"),v=nt("log"),E=nt("stateRestoreInProgress"),h=It("reportReadyState"),f=Ht(H.useMemo(()=>u=>{const C=u.parentElement.parentElement.scrollHeight;l(C);const R=u.firstChild;if(R){const{height:y,width:x}=R.getBoundingClientRect();p({height:y,width:x})}T({column:En("column-gap",getComputedStyle(u).columnGap,v),row:En("row-gap",getComputedStyle(u).rowGap,v)})},[l,p,T,v]),!0,!1);return Xn(()=>{e.itemHeight>0&&e.itemWidth>0&&h(!0)},[e]),E?null:L.jsx(a,{className:n,ref:f,...J(a,S),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(u=>{const C=s(u.index,u.data,S);return i?L.jsx(m,{...J(m,S),height:e.itemHeight,index:u.index,width:e.itemWidth},C):H.createElement(c,{...J(c,S),className:o,"data-index":u.index,key:C},r(u.index,u.data,S))})})}),Pr=H.memo(function(){const e=nt("HeaderComponent"),n=It("headerHeight"),o=nt("headerFooterTag"),r=Ht(H.useMemo(()=>i=>{n(vt(i,"height"))},[n]),!0,!1),s=nt("context");return e?L.jsx(o,{ref:r,children:L.jsx(e,{...J(e,s)})}):null}),Mr=H.memo(function(){const e=nt("FooterComponent"),n=It("footerHeight"),o=nt("headerFooterTag"),r=Ht(H.useMemo(()=>i=>{n(vt(i,"height"))},[n]),!0,!1),s=nt("context");return e?L.jsx(o,{ref:r,children:L.jsx(e,{...J(e,s)})}):null}),jr=({children:t})=>{const e=H.useContext(qe),n=It("itemDimensions"),o=It("viewportDimensions"),r=Ht(H.useMemo(()=>s=>{o(s.getBoundingClientRect())},[o]),!0,!1);return H.useEffect(()=>{e&&(o({height:e.viewportHeight,width:e.viewportWidth}),n({height:e.itemHeight,width:e.itemWidth}))},[e,o,n]),L.jsx("div",{ref:r,style:qt(!1),children:t})},Ar=({children:t})=>{const e=H.useContext(qe),n=It("windowViewportRect"),o=It("itemDimensions"),r=nt("customScrollParent"),s=Ae(n,r,!1);return H.useEffect(()=>{e&&(o({height:e.itemHeight,width:e.itemWidth}),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,o]),L.jsx("div",{ref:s,style:qt(!1),children:t})},Wr=H.memo(function({...e}){const n=nt("useWindowScroll"),o=nt("customScrollParent"),r=o||n?Dr:Nr,s=o||n?Ar:jr,i=nt("context");return L.jsx(r,{...e,...J(r,i),children:L.jsxs(s,{children:[L.jsx(Pr,{}),L.jsx(Gr,{}),L.jsx(Mr,{})]})})}),{Component:_r,useEmitter:ro,useEmitterValue:nt,usePublisher:It}=Ke(Vr,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},Wr),Nr=Xe({useEmitter:ro,useEmitterValue:nt,usePublisher:It}),Dr=Je({useEmitter:ro,useEmitterValue:nt,usePublisher:It});function En(t,e,n){return e!=="normal"&&!(e!=null&&e.endsWith("px"))&&n(`${t} was not resolved to pixel value correctly`,e,mt.WARN),e==="normal"?0:parseInt(e!=null?e:"0",10)}const $r=_r;exports.GroupedTableVirtuoso=kr;exports.GroupedVirtuoso=gr;exports.LogLevel=mt;exports.TableVirtuoso=Er;exports.Virtuoso=hr;exports.VirtuosoGrid=$r;exports.VirtuosoGridMockContext=qe;exports.VirtuosoMockContext=ue;
|
package/dist/index.d.ts
CHANGED
|
@@ -958,6 +958,25 @@ export declare interface VirtuosoProps<D, C> extends ListRootProps {
|
|
|
958
958
|
* Receives the last item index as an argument. Can be used to implement endless scrolling.
|
|
959
959
|
*/
|
|
960
960
|
endReached?: (index: number) => void;
|
|
961
|
+
/**
|
|
962
|
+
* Use when you have items with widely varying heights and can estimate each item's height upfront.
|
|
963
|
+
*
|
|
964
|
+
* Pass an array of estimated heights for each item (by index). This helps the component calculate
|
|
965
|
+
* a more accurate initial total height for the list, reducing layout shifts during initial scrolling.
|
|
966
|
+
*
|
|
967
|
+
* The estimates don't need to be exact - they're used to build the initial size tree before actual
|
|
968
|
+
* measurements are taken. Once items are rendered and measured, their real heights replace the estimates.
|
|
969
|
+
*
|
|
970
|
+
* @example
|
|
971
|
+
* ```tsx
|
|
972
|
+
* <Virtuoso
|
|
973
|
+
* totalCount={100}
|
|
974
|
+
* heightEstimates={[40, 200, 60, 2000, 40, /* ... for all items * /]}
|
|
975
|
+
* itemContent={index => <Item index={index} />}
|
|
976
|
+
* />
|
|
977
|
+
* ```
|
|
978
|
+
*/
|
|
979
|
+
heightEstimates?: number[];
|
|
961
980
|
/**
|
|
962
981
|
* Use when implementing inverse infinite scrolling - decrease the value this property
|
|
963
982
|
* in combination with `data` or `totalCount` to prepend items to the top of the list.
|
|
@@ -970,6 +989,12 @@ export declare interface VirtuosoProps<D, C> extends ListRootProps {
|
|
|
970
989
|
* Setting it causes the component to skip item measurements.
|
|
971
990
|
*/
|
|
972
991
|
fixedItemHeight?: number;
|
|
992
|
+
/**
|
|
993
|
+
* Can be used to improve performance if the rendered group header items are of known size.
|
|
994
|
+
* Setting it causes the component to skip measuring group headers.
|
|
995
|
+
* The value is in pixels. This value has no effect if {@link fixedItemHeight} is not set.
|
|
996
|
+
*/
|
|
997
|
+
fixedGroupHeight?: number;
|
|
973
998
|
/**
|
|
974
999
|
* If set to `true`, the list automatically scrolls to bottom if the total count is changed.
|
|
975
1000
|
* Set to `"smooth"` for an animated scrolling.
|