react-virtuoso 0.0.0-development

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Petyo Ivanov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,102 @@
1
+ <img src="https://user-images.githubusercontent.com/13347/101237112-ec4c6000-36de-11eb-936d-4b6b7ec94976.png" width="229" />
2
+
3
+ [![npm version](https://img.shields.io/npm/v/react-virtuoso.svg?style=flat)](//badge.fury.io/js/react-virtuoso)
4
+
5
+ **React Virtuoso** is the most powerful React virtual list/table component, full stop. Here's why:
6
+
7
+ - Variable sized items out of the box; no manual measurements or hard-coding item heights is necessary;
8
+ - Support for [reverse (bottom up) scrolling and prepending items](//virtuoso.dev/prepend-items/) (chat, feeds, etc);
9
+ - [Grouped mode with sticky headers](//virtuoso.dev/grouped-by-first-letter/);
10
+ - [Responsive grid layout](//virtuoso.dev/grid-responsive-columns/);
11
+ - [Table Support](//virtuoso.dev/hello-table/);
12
+ - [Automatic handling of content resize](//virtuoso.dev/auto-resizing/);
13
+ - [Custom Header, Footer, and empty list components](//virtuoso.dev/customize-structure/);
14
+ - [Pinned top items](//virtuoso.dev/top-items/);
15
+ - [Endless scrolling](//virtuoso.dev/endless-scrolling/), [press to load more](//virtuoso.dev/press-to-load-more/);
16
+ - [Initial top most item index](//virtuoso.dev/initial-index/);
17
+ - [Scroll to index method](//virtuoso.dev/scroll-to-index/).
18
+
19
+ For live examples and documentation, check the [documentation website](//virtuoso.dev).
20
+
21
+ ## Sponsors
22
+
23
+ If you are using Virtuoso for work, [sponsor it](https://github.com/sponsors/petyosi). Any donation helps a lot with the project development and maintenance.
24
+
25
+ ## Get Started
26
+
27
+ ```sh
28
+ npm install react-virtuoso
29
+ ```
30
+
31
+ ```jsx
32
+ import * as React from 'react'
33
+ import * as ReactDOM from 'react-dom'
34
+ import { Virtuoso } from 'react-virtuoso'
35
+
36
+ const App = () => {
37
+ return <Virtuoso style={{ height: '400px' }} totalCount={200} itemContent={index => <div>Item {index}</div>} />
38
+ }
39
+
40
+ ReactDOM.render(<App />, document.getElementById('root'))
41
+ ```
42
+
43
+ ## [Grouped Mode](//virtuoso.dev/grouped-by-first-letter/)
44
+
45
+ The `GroupedVirtuoso` component is a variant of the "flat" `Virtuoso`, with the following differences:
46
+
47
+ - Instead of `totalCount`, the component exposes `groupCounts: number[]` property, which specifies the amount of items in each group.
48
+ For example, passing `[20, 30]` will render two groups with 20 and 30 items each;
49
+ - In addition the `itemContent` property, the component requires an additional `groupContent` property,
50
+ which renders the **group header**. The `groupContent` callback receives the zero-based group index as a parameter.
51
+
52
+ ## [Grid](//virtuoso.dev/grid-responsive-columns/)
53
+
54
+ The `VirtuosoGrid` component displays **same sized items** in multiple columns.
55
+ The layout and item sizing is controlled through CSS class properties, which allows you to use media queries, min-width, percentage, etc.
56
+
57
+ ## [Table](//virtuoso.dev/hello-table/)
58
+
59
+ The `TableVirtuoso` component works just like `Virtuoso`, but with HTML tables.
60
+ It supports window scrolling, sticky headers, sticky columns, and works with React Table and MUI Table.
61
+
62
+ ## Works With Your UI Library of Choice
63
+
64
+ You can customize the markup up to your requirements - check [the Material UI list demo](//virtuoso.dev/material-ui-endless-scrolling/).
65
+ If you need to support reordering, [check the React Sortable HOC example](//virtuoso.dev/react-sortable-hoc/).
66
+
67
+ ## Documentation and Demos
68
+
69
+ For in-depth documentation and live examples of the supported features and live demos, check the [documentation website](//virtuoso.dev).
70
+
71
+ ## Browser support
72
+
73
+ To support [legacy browsers](https://caniuse.com/resizeobserver), you might have to load a [ResizeObserver Polyfill](https://www.npmjs.com/package/resize-observer-polyfill) before using `react-virtuoso`:
74
+
75
+ ```
76
+ import ResizeObserver from 'resize-observer-polyfill'
77
+ if (!window.ResizeObserver)
78
+ window.ResizeObserver = ResizeObserver
79
+ ```
80
+
81
+ ## Author
82
+
83
+ Petyo Ivanov [@petyosi](//twitter.com/petyosi).
84
+
85
+ ## Contributing
86
+
87
+ ### Fixes and new Features
88
+
89
+ To run the tests, use `npm run test`.
90
+ An end-to-end browser-based test suite is runnable with `npm run e2e`, with the pages being `e2e/*.tsx` and the tests `e2e/*.test.ts`.
91
+
92
+ A convenient way to debug something is to preview the test cases in the browser.
93
+ To do that, run `npm run browse-examples` - it will open a crude UI that lets you browse the components in the `e2e` folder.
94
+
95
+ ### Docs
96
+
97
+ The documentation site is built with docusaurus and the content is available in the `site/docs` directory.
98
+ The API reference is generated from the doc comments in `src/components.tsx`.
99
+
100
+ ## License
101
+
102
+ MIT License.
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("react-dom");function o(e,t){return o=>e(t(o))}function n(e,t){return t(e)}function r(e,t){return o=>e(t,o)}function i(e,t){return()=>e(t)}function l(e,t){return t(e),e}function s(...e){return e}function c(e){e()}function a(e){return()=>e}function u(){}function d(e,t){return e(1,t)}function f(e,t){e(0,t)}function m(e){e(2)}function h(e){return e(4)}function g(e,t){return d(e,r(t,0))}function p(e,t){const o=e(1,(e=>{o(),t(e)}));return o}function v(){const e=[];return(t,o)=>{switch(t){case 2:return void e.splice(0,e.length);case 1:return e.push(o),()=>{const t=e.indexOf(o);t>-1&&e.splice(t,1)};case 0:return void e.slice().forEach((e=>{e(o)}));default:throw new Error(`unrecognized action ${t}`)}}}function x(e){let t=e;const o=v();return(e,n)=>{switch(e){case 1:n(t);break;case 0:t=n;break;case 4:return t}return o(e,n)}}function I(e){return l(v(),(t=>g(e,t)))}function T(e,t){return l(x(t),(t=>g(e,t)))}function w(e,...t){const o=function(...e){return t=>e.reduceRight(n,t)}(...t);return(t,n)=>{switch(t){case 1:return d(e,o(n));case 2:return void m(e)}}}function C(e,t){return e===t}function S(e=C){let t;return o=>n=>{e(t,n)||(t=n,o(n))}}function E(e){return t=>o=>{e(o)&&t(o)}}function H(e){return t=>o(t,e)}function y(e){return t=>()=>t(e)}function b(e,t){return o=>n=>o(t=e(t,n))}function R(e){return t=>o=>{e>0?e--:t(o)}}function z(e){let t,o;return n=>r=>{t=r,o||(o=setTimeout((()=>{o=void 0,n(t)}),e))}}function B(e){let t,o;return n=>r=>{t=r,o&&clearTimeout(o),o=setTimeout((()=>{n(t)}),e)}}function k(...e){const t=new Array(e.length);let o=0,n=null;const r=Math.pow(2,e.length)-1;return e.forEach(((e,i)=>{const l=Math.pow(2,i);d(e,(e=>{const s=o;o|=l,t[i]=e,s!==r&&o===r&&n&&(n(),n=null)}))})),e=>i=>{const l=()=>e([i].concat(t));o===r?l():n=l}}function P(...e){return function(t,o){switch(t){case 1:return function(...e){return()=>{e.map(c)}}(...e.map((e=>d(e,o))));case 2:return;default:throw new Error(`unrecognized action ${t}`)}}}function L(e,t=C){return w(e,S(t))}function O(...e){const t=v(),o=new Array(e.length);let n=0;const r=Math.pow(2,e.length)-1;return e.forEach(((e,i)=>{const l=Math.pow(2,i);d(e,(e=>{o[i]=e,n|=l,n===r&&f(t,o)}))})),function(e,i){switch(e){case 1:return n===r&&i(o),d(t,i);case 2:return m(t);default:throw new Error(`unrecognized action ${e}`)}}}function M(e,t=[],{singleton:o}={singleton:!0}){return{id:W(),constructor:e,dependencies:t,singleton:o}}const W=()=>Symbol();const V="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function F(t,o,n){const s=Object.keys(o.required||{}),c=Object.keys(o.optional||{}),g=Object.keys(o.methods||{}),p=Object.keys(o.events||{}),v=e.createContext({});function x(e,t){e.propsReady&&f(e.propsReady,!1);for(const n of s){f(e[o.required[n]],t[n])}for(const n of c)if(n in t){f(e[o.optional[n]],t[n])}e.propsReady&&f(e.propsReady,!0)}function I(e){return p.reduce(((t,n)=>(t[n]=function(e){let t,o;const n=()=>t&&t();return function(r,i){switch(r){case 1:if(i){if(o===i)return;return n(),o=i,t=d(e,i),t}return n(),u;case 2:return n(),void(o=null);default:throw new Error(`unrecognized action ${r}`)}}}(e[o.events[n]]),t)),{})}const T=e.forwardRef(((r,u)=>{const{children:h,...T}=r,[w]=e.useState((()=>l(function(e){const t=new Map,o=({id:e,constructor:n,dependencies:r,singleton:i})=>{if(i&&t.has(e))return t.get(e);const l=n(r.map((e=>o(e))));return i&&t.set(e,l),l};return o(e)}(t),(e=>x(e,T))))),[C]=e.useState(i(I,w));return V((()=>{for(const e of p)e in T&&d(C[e],T[e]);return()=>{Object.values(C).map(m)}}),[T,C,w]),V((()=>{x(w,T)})),e.useImperativeHandle(u,a(function(e){return g.reduce(((t,n)=>(t[n]=t=>{f(e[o.methods[n]],t)},t)),{})}(w))),e.createElement(v.Provider,{value:w},n?e.createElement(n,function(e,t){const o={},n={};let r=0;const i=e.length;for(;r<i;)n[e[r]]=1,r+=1;for(const l in t)n.hasOwnProperty(l)||(o[l]=t[l]);return o}([...s,...c,...p],T),h):h)}));return{Component:T,usePublisher:t=>e.useCallback(r(f,e.useContext(v)[t]),[t]),useEmitterValue:t=>{const o=e.useContext(v)[t],[n,r]=e.useState(i(h,o));return V((()=>d(o,(e=>{e!==n&&r(a(e))}))),[o,n]),n},useEmitter:(t,o)=>{const n=e.useContext(v)[t];V((()=>d(n,o)),[o,n])}}}const A="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;var D=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(D||{});const G={0:"debug",1:"log",2:"warn",3:"error"},N=M((()=>{const e=x(3);return{log:x(((t,o,n=1)=>{n>=(("undefined"==typeof globalThis?window:globalThis).VIRTUOSO_LOG_LEVEL??h(e))&&console[G[n]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,o)})),logLevel:e}}),[],{singleton:!0});function _(t,o=!0){const n=e.useRef(null);let r=e=>{};if("undefined"!=typeof ResizeObserver){const e=new ResizeObserver((e=>{const o=e[0].target;null!==o.offsetParent&&t(o)}));r=t=>{t&&o?(e.observe(t),n.current=t):(n.current&&e.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function U(e,t=!0){return _(e,t).callbackRef}function $(e,t,o,n,r,i,l){return _((o=>{const s=function(e,t,o,n){const r=e.length;if(0===r)return null;const i=[];for(let l=0;l<r;l++){const r=e.item(l);if(!r||void 0===r.dataset.index)continue;const s=parseInt(r.dataset.index),c=parseFloat(r.dataset.knownSize),a=t(r,o);if(0===a&&n("Zero-sized element, this should not happen",{child:r},D.ERROR),a===c)continue;const u=i[i.length-1];0===i.length||u.size!==a||u.endIndex!==s-1?i.push({startIndex:s,endIndex:s,size:a}):i[i.length-1].endIndex++}return i}(o.children,t,"offsetHeight",r);let c=o.parentElement;for(;!c.dataset.virtuosoScroller;)c=c.parentElement;const a="window"===c.lastElementChild.dataset.viewportType,u=l?l.scrollTop:a?window.pageYOffset||document.documentElement.scrollTop:c.scrollTop,d=l?l.scrollHeight:a?document.documentElement.scrollHeight:c.scrollHeight,f=l?l.offsetHeight:a?window.innerHeight:c.offsetHeight;n({scrollTop:Math.max(u,0),scrollHeight:d,viewportHeight:f}),null==i||i(function(e,t,o){"normal"===t||(null==t?void 0:t.endsWith("px"))||o(`${e} was not resolved to pixel value correctly`,t,D.WARN);if("normal"===t)return 0;return parseInt(t??"0",10)}("row-gap",getComputedStyle(o).rowGap,r)),null!==s&&e(s)}),o)}function j(e,t){return Math.round(e.getBoundingClientRect()[t])}function K(e,t){return Math.abs(e-t)<1.01}function q(o,n,r,i=u,l){const s=e.useRef(null),c=e.useRef(null),a=e.useRef(null),d=e.useCallback((e=>{const r=e.target,i=r===window||r===document,l=i?window.pageYOffset||document.documentElement.scrollTop:r.scrollTop,s=i?document.documentElement.scrollHeight:r.scrollHeight,u=i?window.innerHeight:r.offsetHeight,d=()=>{o({scrollTop:Math.max(l,0),scrollHeight:s,viewportHeight:u})};e.suppressFlushSync?d():t.flushSync(d),null!==c.current&&(l===c.current||l<=0||l===s-u)&&(c.current=null,n(!0),a.current&&(clearTimeout(a.current),a.current=null))}),[o,n]);return e.useEffect((()=>{const e=l||s.current;return i(l||s.current),d({target:e,suppressFlushSync:!0}),e.addEventListener("scroll",d,{passive:!0}),()=>{i(null),e.removeEventListener("scroll",d)}}),[s,d,r,i,l]),{scrollerRef:s,scrollByCallback:function(e){s.current.scrollBy(e)},scrollToCallback:function(e){const t=s.current;if(!t||"offsetHeight"in t&&0===t.offsetHeight)return;const r="smooth"===e.behavior;let i,l,u;t===window?(l=Math.max(j(document.documentElement,"height"),document.documentElement.scrollHeight),i=window.innerHeight,u=document.documentElement.scrollTop):(l=t.scrollHeight,i=j(t,"height"),u=t.scrollTop);const d=l-i;if(e.top=Math.ceil(Math.max(Math.min(d,e.top),0)),K(i,l)||e.top===u)return o({scrollTop:u,scrollHeight:l,viewportHeight:i}),void(r&&n(!0));r?(c.current=e.top,a.current&&clearTimeout(a.current),a.current=setTimeout((()=>{a.current=null,c.current=null,n(!0)}),1e3)):c.current=null,t.scrollTo(e)}}}const Y=M((()=>{const e=v(),t=v(),o=x(0),n=v(),r=x(0),i=v(),l=v(),s=x(0),c=x(0),a=x(0),u=x(0),d=v(),f=v(),m=x(!1);return g(w(e,H((({scrollTop:e})=>e))),t),g(w(e,H((({scrollHeight:e})=>e))),l),g(t,r),{scrollContainerState:e,scrollTop:t,viewportHeight:i,headerHeight:s,fixedHeaderHeight:c,fixedFooterHeight:a,footerHeight:u,scrollHeight:l,smoothScrollTargetReached:n,scrollTo:d,scrollBy:f,statefulScrollTop:r,deviation:o,scrollingInProgress:m}}),[],{singleton:!0}),Z={lvl:0};function J(e,t,o,n=Z,r=Z){return{k:e,v:t,lvl:o,l:n,r:r}}function Q(e){return e===Z}function X(){return Z}function ee(e,t){if(Q(e))return Z;const{k:o,l:n,r:r}=e;if(t===o){if(Q(n))return r;if(Q(r))return n;{const[t,o]=ie(n);return ue(se(e,{k:t,v:o,l:le(n)}))}}return ue(se(e,t<o?{l:ee(n,t)}:{r:ee(r,t)}))}function te(e,t,o="k"){if(Q(e))return[-1/0,void 0];if(e[o]===t)return[e.k,e.v];if(e[o]<t){const n=te(e.r,t,o);return n[0]===-1/0?[e.k,e.v]:n}return te(e.l,t,o)}function oe(e,t,o){return Q(e)?J(t,o,1):t===e.k?se(e,{k:t,v:o}):t<e.k?ae(se(e,{l:oe(e.l,t,o)})):ae(se(e,{r:oe(e.r,t,o)}))}function ne(e,t,o){if(Q(e))return[];const{k:n,v:r,l:i,r:l}=e;let s=[];return n>t&&(s=s.concat(ne(i,t,o))),n>=t&&n<=o&&s.push({k:n,v:r}),n<=o&&(s=s.concat(ne(l,t,o))),s}function re(e){return Q(e)?[]:[...re(e.l),{k:e.k,v:e.v},...re(e.r)]}function ie(e){return Q(e.r)?[e.k,e.v]:ie(e.r)}function le(e){return Q(e.r)?e.l:ue(se(e,{r:le(e.r)}))}function se(e,t){return J(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function ce(e){return Q(e)||e.lvl>e.r.lvl}function ae(e){return me(he(e))}function ue(e){const{l:t,r:o,lvl:n}=e;if(o.lvl>=n-1&&t.lvl>=n-1)return e;if(n>o.lvl+1){if(ce(t))return he(se(e,{lvl:n-1}));if(Q(t)||Q(t.r))throw new Error("Unexpected empty nodes");return se(t.r,{l:se(t,{r:t.r.l}),r:se(e,{l:t.r.r,lvl:n-1}),lvl:n})}if(ce(e))return me(se(e,{lvl:n-1}));if(Q(o)||Q(o.l))throw new Error("Unexpected empty nodes");{const t=o.l,r=ce(t)?o.lvl-1:o.lvl;return se(t,{l:se(e,{r:t.l,lvl:n-1}),r:me(se(o,{l:t.r,lvl:r})),lvl:t.lvl+1})}}function de(e,t,o){if(Q(e))return[];const n=te(e,t)[0];return fe(ne(e,n,o),(({k:e,v:t})=>({index:e,value:t})))}function fe(e,t){const o=e.length;if(0===o)return[];let{index:n,value:r}=t(e[0]);const i=[];for(let l=1;l<o;l++){const{index:o,value:s}=t(e[l]);i.push({start:n,end:o-1,value:r}),n=o,r=s}return i.push({start:n,end:1/0,value:r}),i}function me(e){const{r:t,lvl:o}=e;return Q(t)||Q(t.r)||t.lvl!==o||t.r.lvl!==o?e:se(t,{l:se(e,{r:t.l}),lvl:o+1})}function he(e){const{l:t}=e;return Q(t)||t.lvl!==e.lvl?e:se(t,{r:se(e,{l:t.r})})}function ge(e,t,o,n=0){let r=e.length-1;for(;n<=r;){const i=Math.floor((n+r)/2),l=o(e[i],t);if(0===l)return i;if(-1===l){if(r-n<2)return i-1;r=i-1}else{if(r===n)return i;n=i+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function pe(e,t,o){return e[ge(e,t,o)]}const ve=M((()=>({recalcInProgress:x(!1)})),[],{singleton:!0});function xe(e){const{size:t,startIndex:o,endIndex:n}=e;return e=>e.start===o&&(e.end===n||e.end===1/0)&&e.value===t}function Ie({index:e},t){return t===e?0:t<e?-1:1}function Te({offset:e},t){return t===e?0:t<e?-1:1}function we(e){return{index:e.index,value:e}}function Ce(e,t,o,n=0){return n>0&&(t=Math.max(t,pe(e,n,Ie).offset)),fe(function(e,t,o,n){const r=ge(e,t,n),i=ge(e,o,n,r);return e.slice(r,i+1)}(e,t,o,Te),we)}function Se(e,t,o,n){let r=e,i=0,l=0,s=0,c=0;if(0!==t){c=ge(r,t-1,Ie);s=r[c].offset;const e=te(o,t-1);i=e[0],l=e[1],r.length&&r[c].size===te(o,t)[1]&&(c-=1),r=r.slice(0,c+1)}else r=[];for(const{start:a,value:u}of de(o,t,1/0)){const e=a-i,t=e*l+s+e*n;r.push({offset:t,size:u,index:a}),i=a,s=t,l=u}return{offsetTree:r,lastIndex:i,lastOffset:s,lastSize:l}}function Ee(e,[t,o,n,r]){t.length>0&&n("received item sizes",t,D.DEBUG);const i=e.sizeTree;let l=i,s=0;if(o.length>0&&Q(i)&&2===t.length){const e=t[0].size,n=t[1].size;l=o.reduce(((t,o)=>oe(oe(t,o,e),o+1,n)),l)}else[l,s]=function(e,t){let o=Q(e)?0:1/0;for(const n of t){const{size:t,startIndex:r,endIndex:i}=n;if(o=Math.min(o,r),Q(e)){e=oe(e,0,t);continue}const l=de(e,r-1,i+1);if(l.some(xe(n)))continue;let s=!1,c=!1;for(const{start:o,end:n,value:a}of l)s?(i>=o||t===a)&&(e=ee(e,o)):(c=a!==t,s=!0),n>i&&i>=o&&a!==t&&(e=oe(e,i+1,a));c&&(e=oe(e,r,t))}return[e,o]}(l,t);if(l===i)return e;const{offsetTree:c,lastIndex:a,lastSize:u,lastOffset:d}=Se(e.offsetTree,s,l,r);return{sizeTree:l,offsetTree:c,lastIndex:a,lastOffset:d,lastSize:u,groupOffsetTree:o.reduce(((e,t)=>oe(e,t,He(t,c,r))),X()),groupIndices:o}}function He(e,t,o){if(0===t.length)return 0;const{offset:n,index:r,size:i}=pe(t,e,Ie),l=e-r,s=i*l+(l-1)*o+n;return s>0?s+o:s}function ye(e,t,o){if(function(e){return void 0!==e.groupIndex}(e))return t.groupIndices[e.groupIndex]+1;{let n=be("LAST"===e.index?o:e.index,t);return n=Math.max(0,n,Math.min(o,n)),n}}function be(e,t){if(!Re(t))return e;let o=0;for(;t.groupIndices[o]<=e+o;)o++;return e+o}function Re(e){return!Q(e.groupOffsetTree)}const ze={offsetHeight:"height",offsetWidth:"width"},Be=M((([{log:e},{recalcInProgress:t}])=>{const o=v(),n=v(),r=T(n,0),i=v(),l=v(),s=x(0),c=x([]),a=x(void 0),u=x(void 0),m=x(((e,t)=>j(e,ze[t]))),p=x(void 0),C=x(0),y={offsetTree:[],sizeTree:X(),groupOffsetTree:X(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]},R=T(w(o,k(c,e,C),b(Ee,y),S()),y);g(w(c,E((e=>e.length>0)),k(R,C),H((([e,t,o])=>{const n=e.reduce(((e,n,r)=>oe(e,n,He(n,t.offsetTree,o)||r)),X());return{...t,groupIndices:e,groupOffsetTree:n}}))),R),g(w(n,k(R),E((([e,{lastIndex:t}])=>e<t)),H((([e,{lastIndex:t,lastSize:o}])=>[{startIndex:e,endIndex:t,size:o}]))),o),g(a,u);const z=T(w(a,H((e=>void 0===e))),!0);g(w(u,E((e=>void 0!==e&&Q(h(R).sizeTree))),H((e=>[{startIndex:0,endIndex:0,size:e}]))),o);const B=I(w(o,k(R),b((({sizes:e},[t,o])=>({changed:o!==e,sizes:o})),{changed:!1,sizes:y}),H((e=>e.changed))));d(w(s,b(((e,t)=>({diff:e.prev-t,prev:t})),{diff:0,prev:0}),H((e=>e.diff))),(e=>{e>0?(f(t,!0),f(i,e)):e<0&&f(l,e)})),d(w(s,k(e)),(([e,t])=>{e<0&&t("`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:s},D.ERROR)}));const P=I(i);g(w(i,k(R),H((([e,t])=>{if(t.groupIndices.length>0)throw new Error("Virtuoso: prepending items does not work with groups");return re(t.sizeTree).reduce(((t,{k:o,v:n})=>({ranges:[...t.ranges,{startIndex:t.prevIndex,endIndex:o+e-1,size:t.prevSize}],prevIndex:o+e,prevSize:n})),{ranges:[],prevIndex:0,prevSize:t.lastSize}).ranges}))),o);const L=I(w(l,k(R,C),H((([e,{offsetTree:t},o])=>He(-e,t,o)))));return g(w(l,k(R,C),H((([e,t,o])=>{if(t.groupIndices.length>0)throw new Error("Virtuoso: shifting items does not work with groups");const n=re(t.sizeTree).reduce(((t,{k:o,v:n})=>oe(t,Math.max(0,o+e),n)),X());return{...t,sizeTree:n,...Se(t.offsetTree,0,n,o)}}))),R),{data:p,totalCount:n,sizeRanges:o,groupIndices:c,defaultItemSize:u,fixedItemSize:a,unshiftWith:i,shiftWith:l,shiftWithOffset:L,beforeUnshiftWith:P,firstItemIndex:s,gap:C,sizes:R,listRefresh:B,statefulTotalCount:r,trackItemSizes:z,itemSize:m}}),s(N,ve),{singleton:!0}),ke="undefined"!=typeof document&&"scrollBehavior"in document.documentElement.style;function Pe(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),t.behavior&&ke||(t.behavior="auto"),t.offset||(t.offset=0),t}const Le=M((([{sizes:e,totalCount:t,listRefresh:o,gap:n},{scrollingInProgress:r,viewportHeight:i,scrollTo:l,smoothScrollTargetReached:s,headerHeight:c,footerHeight:a,fixedHeaderHeight:u,fixedFooterHeight:m},{log:h}])=>{const I=v(),T=x(0);let C=null,S=null,E=null;function y(){C&&(C(),C=null),E&&(E(),E=null),S&&(clearTimeout(S),S=null),f(r,!1)}return g(w(I,k(e,i,t,T,c,a,h),k(n,u,m),H((([[e,t,n,i,l,c,a,u],m,h,g])=>{const v=Pe(e),{align:x,behavior:T,offset:H}=v,b=i-1,R=ye(v,t,b);let z=He(R,t.offsetTree,m)+c;"end"===x?(z+=h+te(t.sizeTree,R)[1]-n+g,R===b&&(z+=a)):"center"===x?z+=(h+te(t.sizeTree,R)[1]-n+g)/2:z-=l,H&&(z+=H);const B=t=>{y(),t?(u("retrying to scroll to",{location:e},D.DEBUG),f(I,e)):u("list did not change, scroll successful",{},D.DEBUG)};if(y(),"smooth"===T){let e=!1;E=d(o,(t=>{e=e||t})),C=p(s,(()=>{B(e)}))}else C=p(w(o,(k=150,e=>{const t=setTimeout((()=>{e(!1)}),k);return o=>{o&&(e(!0),clearTimeout(t))}})),B);var k;return S=setTimeout((()=>{y()}),1200),f(r,!0),u("scrolling from index to",{index:R,top:z,behavior:T},D.DEBUG),{top:z,behavior:T}}))),l),{scrollToIndex:I,topListHeight:T}}),s(Be,Y,N),{singleton:!0});const Oe="up",Me="down",We={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},Ve=M((([{scrollContainerState:e,scrollTop:t,viewportHeight:o,headerHeight:n,footerHeight:r,scrollBy:i}])=>{const l=x(!1),s=x(!0),c=v(),a=v(),u=x(4),d=x(0),f=T(w(P(w(L(t),R(1),y(!0)),w(L(t),R(1),y(!1),B(100))),S()),!1),m=T(w(P(w(i,y(!0)),w(i,y(!1),B(200))),S()),!1);g(w(O(L(t),L(d)),H((([e,t])=>e<=t)),S()),s),g(w(s,z(50)),a);const p=I(w(O(e,L(o),L(n),L(r),L(u)),b(((e,[{scrollTop:t,scrollHeight:o},n,r,i,l])=>{const s={viewportHeight:n,scrollTop:t,scrollHeight:o};if(t+n-o>-l){let o,n;return t>e.state.scrollTop?(o="SCROLLED_DOWN",n=e.state.scrollTop-t):(o="SIZE_DECREASED",n=e.state.scrollTop-t||e.scrollTopDelta),{atBottom:!0,state:s,atBottomBecause:o,scrollTopDelta:n}}let c;return c=s.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":n<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":t<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:c,state:s}}),We),S(((e,t)=>e&&e.atBottom===t.atBottom)))),C=T(w(e,b(((e,{scrollTop:t,scrollHeight:o,viewportHeight:n})=>{if(K(e.scrollHeight,o))return{scrollTop:t,scrollHeight:o,jump:0,changed:!1};{const r=o-(t+n)<1;return e.scrollTop!==t&&r?{scrollHeight:o,scrollTop:t,jump:e.scrollTop-t,changed:!0}:{scrollHeight:o,scrollTop:t,jump:0,changed:!0}}}),{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),E((e=>e.changed)),H((e=>e.jump))),0);g(w(p,H((e=>e.atBottom))),l),g(w(l,z(50)),c);const M=x(Me);g(w(e,H((({scrollTop:e})=>e)),S(),b(((e,t)=>h(m)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?Oe:Me,prevScrollTop:t}),{direction:Me,prevScrollTop:0}),H((e=>e.direction))),M),g(w(e,z(50),y("none")),M);const W=x(0);return g(w(f,E((e=>!e)),y(0)),W),g(w(t,z(100),k(f),E((([e,t])=>!!t)),b((([e,t],[o])=>[t,o]),[0,0]),H((([e,t])=>t-e))),W),{isScrolling:f,isAtTop:s,isAtBottom:l,atBottomState:p,atTopStateChange:a,atBottomStateChange:c,scrollDirection:M,atBottomThreshold:u,atTopThreshold:d,scrollVelocity:W,lastJumpDueToItemResize:C}}),s(Y)),Fe=M((([{log:e}])=>{const t=x(!1),o=I(w(t,E((e=>e)),S()));return d(t,(t=>{t&&h(e)("props updated",{},D.DEBUG)})),{propsReady:t,didMount:o}}),s(N),{singleton:!0});const Ae=M((([{sizes:e,listRefresh:t,defaultItemSize:o},{scrollTop:n},{scrollToIndex:r},{didMount:i}])=>{const l=x(!0),s=x(0);return g(w(i,k(s),E((([e,t])=>!!t)),y(!1)),l),d(w(O(t,i),k(l,e,o),E((([[,e],t,{sizeTree:o},n])=>e&&(!Q(o)||void 0!==n)&&!t)),k(s)),(([,e])=>{setTimeout((()=>{p(n,(()=>{f(l,!0)})),f(r,e)}))})),{scrolledToInitialItem:l,initialTopMostItemIndex:s}}),s(Be,Y,Le,Fe),{singleton:!0});function De(e){return!!e&&("smooth"===e?"smooth":"auto")}const Ge=M((([{totalCount:e,listRefresh:t},{isAtBottom:o,atBottomState:n},{scrollToIndex:r},{scrolledToInitialItem:i},{propsReady:l,didMount:s},{log:c},{scrollingInProgress:a}])=>{const u=x(!1),m=v();let g=null;function I(e){f(r,{index:"LAST",align:"end",behavior:e})}function T(e){const t=p(n,(t=>{!e||t.atBottom||"SIZE_INCREASED"!==t.notAtBottomBecause||g||(h(c)("scrolling to bottom due to increased size",{},D.DEBUG),I("auto"))}));setTimeout(t,100)}return d(w(O(w(L(e),R(1)),s),k(L(u),o,i,a),H((([[e,t],o,n,r,i])=>{let l=t&&r,s="auto";return l&&(s=((e,t)=>"function"==typeof e?De(e(t)):t&&De(e))(o,n||i),l=l&&!!s),{totalCount:e,shouldFollow:l,followOutputBehavior:s}})),E((({shouldFollow:e})=>e))),(({totalCount:e,followOutputBehavior:o})=>{g&&(g(),g=null),g=p(t,(()=>{h(c)("following output to ",{totalCount:e},D.DEBUG),I(o),g=null}))})),d(w(O(L(u),e,l),E((([e,,t])=>e&&t)),b((({value:e},[,t])=>({refreshed:e===t,value:t})),{refreshed:!1,value:0}),E((({refreshed:e})=>e)),k(u,e)),(([,e])=>{T(!1!==e)})),d(m,(()=>{T(!1!==h(u))})),d(O(L(u),n),(([e,t])=>{e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&I("auto")})),{followOutput:u,autoscrollToBottom:m}}),s(Be,Ve,Le,Ae,Fe,N,Y));function Ne(e){return e.reduce(((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e)),{totalCount:0,groupIndices:[]})}const _e=M((([{totalCount:e,groupIndices:t,sizes:o},{scrollTop:n,headerHeight:r}])=>{const i=v(),l=v(),s=I(w(i,H(Ne)));return g(w(s,H((e=>e.totalCount))),e),g(w(s,H((e=>e.groupIndices))),t),g(w(O(n,o,r),E((([e,t])=>Re(t))),H((([e,t,o])=>te(t.groupOffsetTree,Math.max(e-o,0),"v")[0])),S(),H((e=>[e]))),l),{groupCounts:i,topItemsIndexes:l}}),s(Be,Y));function Ue(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}function $e(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}const je="top",Ke="bottom",qe="none";function Ye(e,t,o){return"number"==typeof e?o===Oe&&t===je||o===Me&&t===Ke?e:0:o===Oe?t===je?e.main:e.reverse:t===Ke?e.main:e.reverse}function Ze(e,t){return"number"==typeof e?e:e[t]||0}const Je=M((([{scrollTop:e,viewportHeight:t,deviation:o,headerHeight:n,fixedHeaderHeight:r}])=>{const i=v(),l=x(0),s=x(0),c=x(0);return{listBoundary:i,overscan:c,topListHeight:l,increaseViewportBy:s,visibleRange:T(w(O(L(e),L(t),L(n),L(i,Ue),L(c),L(l),L(r),L(o),L(s)),H((([e,t,o,[n,r],i,l,s,c,a])=>{const u=e-c,d=l+s,f=Math.max(o-u,0);let m=qe;const h=Ze(a,je),g=Ze(a,Ke);return n-=c,r+=o+s,(n+=o+s)>e+d-h&&(m=Oe),(r-=c)<e-f+t+g&&(m=Me),m!==qe?[Math.max(u-o-Ye(i,je,m)-h,0),u-f-s+t+Ye(i,Ke,m)+g]:null})),E((e=>null!=e)),S(Ue)),[0,0])}}),s(Y),{singleton:!0});const Qe={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function Xe(e,t,o){if(0===e.length)return[];if(!Re(t))return e.map((e=>({...e,index:e.index+o,originalIndex:e.index})));const n=e[0].index,r=e[e.length-1].index,i=[],l=de(t.groupOffsetTree,n,r);let s,c=0;for(const a of e){let e;(!s||s.end<a.index)&&(s=l.shift(),c=t.groupIndices.indexOf(s.start)),e=a.index===s.start?{type:"group",index:c}:{index:a.index-(c+1)+o,groupIndex:c},i.push({...e,size:a.size,offset:a.offset,originalIndex:a.index,data:a.data})}return i}function et(e,t,o,n,r,i){const{lastSize:l,lastOffset:s,lastIndex:c}=r;let a=0,u=0;if(e.length>0){a=e[0].offset;const t=e[e.length-1];u=t.offset+t.size}const d=o-c,f=a,m=s+d*l+(d-1)*n-u;return{items:Xe(e,r,i),topItems:Xe(t,r,i),topListHeight:t.reduce(((e,t)=>t.size+e),0),offsetTop:a,offsetBottom:m,top:f,bottom:u,totalCount:o,firstItemIndex:i}}const tt=M((([{sizes:e,totalCount:t,data:o,firstItemIndex:n,gap:r},i,{visibleRange:s,listBoundary:c,topListHeight:a},{scrolledToInitialItem:u,initialTopMostItemIndex:d},{topListHeight:f},m,{didMount:h},{recalcInProgress:p}])=>{const C=x([]),y=v();g(i.topItemsIndexes,C);const b=T(w(O(h,p,L(s,Ue),L(t),L(e),L(d),u,L(C),L(n),L(r),o),E((([e,t])=>e&&!t)),H((([,,[e,t],o,n,r,i,s,c,a,u])=>{const d=n,{sizeTree:f,offsetTree:m}=d;if(0===o||0===e&&0===t)return{...Qe,totalCount:o};if(Q(f))return et(function(e,t,o){if(Re(t)){const n=be(e,t);return[{index:te(t.groupOffsetTree,n)[0],size:0,offset:0},{index:n,size:0,offset:0,data:o&&o[0]}]}return[{index:e,size:0,offset:0,data:o&&o[0]}]}(function(e,t){const o=t-1;return"number"==typeof e?e:"LAST"===e.index?o:e.index}(r,o),d,u),[],o,a,d,c);const h=[];if(s.length>0){const e=s[0],t=s[s.length-1];let o=0;for(const n of de(f,e,t)){const r=n.value,i=Math.max(n.start,e),l=Math.min(n.end,t);for(let e=i;e<=l;e++)h.push({index:e,size:r,offset:o,data:u&&u[e]}),o+=r}}if(!i)return et([],h,o,a,d,c);const g=s.length>0?s[s.length-1]+1:0,p=Ce(m,e,t,g);if(0===p.length)return null;const v=o-1;return et(l([],(o=>{for(const n of p){const r=n.value;let i=r.offset,l=n.start;const s=r.size;if(r.offset<e){l+=Math.floor((e-r.offset+a)/(s+a));const t=l-n.start;i+=t*s+t*a}l<g&&(i+=(g-l)*s,l=g);const c=Math.min(n.end,v);for(let e=l;e<=c&&!(i>=t);e++)o.push({index:e,size:s,offset:i,data:u&&u[e]}),i+=s+a}})),h,o,a,d,c)})),E((e=>null!==e)),S()),Qe);g(w(o,E((e=>void 0!==e)),H((e=>null==e?void 0:e.length))),t),g(w(b,H((e=>e.topListHeight))),f),g(f,a),g(w(b,H((e=>[e.top,e.bottom]))),c),g(w(b,H((e=>e.items))),y);return{listState:b,topItemsIndexes:C,endReached:I(w(b,E((({items:e})=>e.length>0)),k(t,o),E((([{items:e},t])=>e[e.length-1].originalIndex===t-1)),H((([,e,t])=>[e-1,t])),S(Ue),H((([e])=>e)))),startReached:I(w(b,z(200),E((({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length)),H((({items:e})=>e[0].index)),S())),rangeChanged:I(w(b,E((({items:e})=>e.length>0)),H((({items:e})=>{let t=0,o=e.length-1;for(;"group"===e[t].type&&t<o;)t++;for(;"group"===e[o].type&&o>t;)o--;return{startIndex:e[t].index,endIndex:e[o].index}})),S($e))),itemsRendered:y,...m}}),s(Be,_e,Je,Ae,Le,Ve,Fe,ve),{singleton:!0}),ot=M((([{sizes:e,firstItemIndex:t,data:o,gap:n},{listState:r},{didMount:i}])=>{const l=x(0);return g(w(i,k(l),E((([,e])=>0!==e)),k(e,t,n,o),H((([[,e],t,o,n,r=[]])=>{let i=0;if(t.groupIndices.length>0)for(const s of t.groupIndices){if(s-i>=e)break;i++}const l=e+i;return et(Array.from({length:l}).map(((e,t)=>({index:t,size:0,offset:0,data:r[t]}))),[],l,n,t,o)}))),r),{initialItemCount:l}}),s(Be,tt,Fe),{singleton:!0}),nt=M((([{scrollVelocity:e}])=>{const t=x(!1),o=v(),n=x(!1);return g(w(e,k(n,t,o),E((([e,t])=>!!t)),H((([e,t,o,n])=>{const{exit:r,enter:i}=t;if(o){if(r(e,n))return!1}else if(i(e,n))return!0;return o})),S()),t),d(w(O(t,e,o),k(n)),(([[e,t,o],n])=>e&&n&&n.change&&n.change(t,o))),{isSeeking:t,scrollSeekConfiguration:n,scrollVelocity:e,scrollSeekRangeChanged:o}}),s(Ve),{singleton:!0}),rt=M((([{topItemsIndexes:e}])=>{const t=x(0);return g(w(t,E((e=>e>0)),H((e=>Array.from({length:e}).map(((e,t)=>t))))),e),{topItemCount:t}}),s(tt)),it=M((([{footerHeight:e,headerHeight:t,fixedHeaderHeight:o,fixedFooterHeight:n},{listState:r}])=>{const i=v(),l=T(w(O(e,n,t,o,r),H((([e,t,o,n,r])=>e+t+o+n+r.offsetBottom+r.bottom))),0);return g(L(l),i),{totalListHeight:l,totalListHeightChanged:i}}),s(Y,tt),{singleton:!0});function lt(e){let t,o=!1;return()=>(o||(o=!0,t=e()),t)}const st=lt((()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent))),ct=M((([{scrollBy:e,scrollTop:t,deviation:o,scrollingInProgress:n},{isScrolling:r,isAtBottom:i,scrollDirection:l,lastJumpDueToItemResize:s},{listState:c},{beforeUnshiftWith:a,shiftWithOffset:u,sizes:m,gap:h},{log:p},{recalcInProgress:v}])=>{const x=I(w(c,k(s),b((([,e,t,o],[{items:n,totalCount:r,bottom:i,offsetBottom:l},s])=>{const c=i+l;let a=0;if(t===r&&e.length>0&&n.length>0){0===n[0].originalIndex&&0===e[0].originalIndex||(a=c-o,0!==a&&(a+=s))}return[a,n,r,c]}),[0,[],0,0]),E((([e])=>0!==e)),k(t,l,n,i,p),E((([,e,t,o])=>!o&&0!==e&&t===Oe)),H((([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},D.DEBUG),e)))));function C(t){t>0?(f(e,{top:-t,behavior:"auto"}),f(o,0)):(f(o,0),f(e,{top:-t,behavior:"auto"}))}return d(w(x,k(o,r)),(([e,t,n])=>{n&&st()?f(o,t-e):C(-e)})),d(w(O(T(r,!1),o,v),E((([e,t,o])=>!e&&!o&&0!==t)),H((([e,t])=>t)),z(1)),C),g(w(u,H((e=>({top:-e})))),e),d(w(a,k(m,h),H((([e,{lastSize:t},o])=>e*t+e*o))),(t=>{f(o,t),requestAnimationFrame((()=>{f(e,{top:t}),requestAnimationFrame((()=>{f(o,0),f(v,!1)}))}))})),{deviation:o}}),s(Y,Ve,tt,Be,N,ve)),at=M((([{totalListHeight:e},{didMount:t},{scrollTo:o}])=>{const n=x(0);return d(w(t,k(n),E((([,e])=>0!==e)),H((([,e])=>({top:e})))),(t=>{p(w(e,E((e=>0!==e))),(()=>{setTimeout((()=>{f(o,t)}))}))})),{initialScrollTop:n}}),s(it,Fe,Y),{singleton:!0}),ut=M((([{viewportHeight:e},{totalListHeight:t}])=>{const o=x(!1);return{alignToBottom:o,paddingTopAddition:T(w(O(o,e,t),E((([e])=>e)),H((([,e,t])=>Math.max(0,e-t))),S()),0)}}),s(Y,it),{singleton:!0}),dt=M((([{scrollTo:e,scrollContainerState:t}])=>{const o=v(),n=v(),r=v(),i=x(!1),l=x(void 0);return g(w(O(o,n),H((([{viewportHeight:e,scrollTop:t,scrollHeight:o},{offsetTop:n}])=>({scrollTop:Math.max(0,t-n),scrollHeight:o,viewportHeight:e})))),t),g(w(e,k(n),H((([e,{offsetTop:t}])=>({...e,top:e.top+t})))),r),{useWindowScroll:i,customScrollParent:l,windowScrollContainerState:o,windowViewportRect:n,windowScrollTo:r}}),s(Y)),ft=M((([{sizes:e,totalCount:t,gap:o},{scrollTop:n,viewportHeight:r,headerHeight:i,fixedHeaderHeight:l,fixedFooterHeight:s,scrollingInProgress:c},{scrollToIndex:a}])=>{const u=v();return g(w(u,k(e,r,t,i,l,s,n),k(o),H((([[e,t,o,n,r,i,l,s],a])=>{const{done:u,behavior:d,align:f,...m}=e;let h=null;const g=ye(e,t,n-1),v=He(g,t.offsetTree,a)+r+i;if(v<s+i)h={...m,behavior:d,align:f??"start"};else{v+te(t.sizeTree,g)[1]>s+o-l&&(h={...m,behavior:d,align:f??"end"})}return h?u&&p(w(c,R(1),E((e=>!1===e))),u):u&&u(),h})),E((e=>null!==e))),a),{scrollIntoView:u}}),s(Be,Y,Le,tt,N),{singleton:!0}),mt=M((([e,t,o,n,r,i,l,s,c])=>({...e,...t,...o,...n,...r,...i,...l,...s,...c})),s(Je,ot,Fe,nt,it,at,ut,dt,ft)),ht=M((([{totalCount:e,sizeRanges:t,fixedItemSize:o,defaultItemSize:n,trackItemSizes:r,itemSize:i,data:l,firstItemIndex:s,groupIndices:c,statefulTotalCount:a,gap:u},{initialTopMostItemIndex:d,scrolledToInitialItem:f},m,h,{listState:p,topItemsIndexes:v,...x},{scrollToIndex:I},T,{topItemCount:C},{groupCounts:S},E,y])=>(g(x.rangeChanged,E.scrollSeekRangeChanged),g(w(E.windowViewportRect,H((e=>e.visibleHeight))),m.viewportHeight),{totalCount:e,data:l,firstItemIndex:s,sizeRanges:t,initialTopMostItemIndex:d,scrolledToInitialItem:f,topItemsIndexes:v,topItemCount:C,groupCounts:S,fixedItemHeight:o,defaultItemHeight:n,gap:u,...h,statefulTotalCount:a,listState:p,scrollToIndex:I,trackItemSizes:r,itemSize:i,groupIndices:c,...x,...E,...m,...y})),s(Be,Ae,Y,Ge,tt,Le,ct,rt,_e,mt,N)),gt="-webkit-sticky",pt="sticky",vt=lt((()=>{if("undefined"==typeof document)return pt;const e=document.createElement("div");return e.style.position=gt,e.style.position===gt?gt:pt}));function xt(t,o){const n=e.useRef(null),r=e.useCallback((e=>{if(null===e||!e.offsetParent)return;const r=e.getBoundingClientRect(),i=r.width;let l,s;if(o){const e=o.getBoundingClientRect(),t=r.top-e.top;l=e.height-Math.max(0,t),s=t+o.scrollTop}else l=window.innerHeight-Math.max(0,r.top),s=r.top+window.pageYOffset;n.current={offsetTop:s,visibleHeight:l,visibleWidth:i},t(n.current)}),[t,o]),{callbackRef:i,ref:l}=_(r),s=e.useCallback((()=>{r(l.current)}),[r,l]);return e.useEffect((()=>{if(o){o.addEventListener("scroll",s);const e=new ResizeObserver(s);return e.observe(o),()=>{o.removeEventListener("scroll",s),e.unobserve(o)}}return window.addEventListener("scroll",s),window.addEventListener("resize",s),()=>{window.removeEventListener("scroll",s),window.removeEventListener("resize",s)}}),[s,o]),i}const It=e.createContext(void 0),Tt=e.createContext(void 0);function wt(e){return e}const Ct=M((([e,t])=>({...e,...t})),s(ht,M((()=>{const e=x((e=>`Item ${e}`)),t=x(null),o=x((e=>`Group ${e}`)),n=x({}),r=x(wt),i=x("div"),l=x(u),s=(e,t=null)=>T(w(n,H((t=>t[e])),S()),t);return{context:t,itemContent:e,groupContent:o,components:n,computeItemKey:r,headerFooterTag:i,scrollerRef:l,FooterComponent:s("Footer"),HeaderComponent:s("Header"),TopItemListComponent:s("TopItemList"),ListComponent:s("List","div"),ItemComponent:s("Item","div"),GroupComponent:s("Group","div"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder")}})))),St=({height:t})=>e.createElement("div",{style:{height:t}}),Et={position:vt(),zIndex:1,overflowAnchor:"none"},Ht={overflowAnchor:"none"},yt=e.memo((function({showTopList:t=!1}){const o=Gt("listState"),n=Dt("sizeRanges"),r=Gt("useWindowScroll"),i=Gt("customScrollParent"),l=Dt("windowScrollContainerState"),s=Dt("scrollContainerState"),c=i||r?l:s,a=Gt("itemContent"),d=Gt("context"),f=Gt("groupContent"),m=Gt("trackItemSizes"),h=Gt("itemSize"),g=Gt("log"),p=Dt("gap"),{callbackRef:v}=$(n,h,m,t?u:c,g,p,i),[x,I]=e.useState(0);Nt("deviation",(e=>{x!==e&&I(e)}));const T=Gt("EmptyPlaceholder"),w=Gt("ScrollSeekPlaceholder")||St,C=Gt("ListComponent"),S=Gt("ItemComponent"),E=Gt("GroupComponent"),H=Gt("computeItemKey"),y=Gt("isSeeking"),b=Gt("groupIndices").length>0,R=Gt("paddingTopAddition"),z=t?{}:{boxSizing:"border-box",paddingTop:o.offsetTop+R,paddingBottom:o.offsetBottom,marginTop:x};return!t&&0===o.totalCount&&T?e.createElement(T,Bt(T,d)):e.createElement(C,{...Bt(C,d),ref:v,style:z,"data-test-id":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?o.topItems:o.items).map((t=>{const n=t.originalIndex,r=H(n+o.firstItemIndex,t.data,d);return y?e.createElement(w,{...Bt(w,d),key:r,index:t.index,height:t.size,type:t.type||"item",..."group"===t.type?{}:{groupIndex:t.groupIndex}}):"group"===t.type?e.createElement(E,{...Bt(E,d),key:r,"data-index":n,"data-known-size":t.size,"data-item-index":t.index,style:Et},f(t.index)):e.createElement(S,{...Bt(S,d),key:r,"data-index":n,"data-known-size":t.size,"data-item-index":t.index,"data-item-group-index":t.groupIndex,item:t.data,style:Ht},b?a(t.index,t.groupIndex,t.data,d):a(t.index,t.data,d))})))})),bt={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Rt={width:"100%",height:"100%",position:"absolute",top:0},zt={width:"100%",position:vt(),top:0,zIndex:1};function Bt(e,t){if("string"!=typeof e)return{context:t}}const kt=e.memo((function(){const t=Gt("HeaderComponent"),o=Dt("headerHeight"),n=Gt("headerFooterTag"),r=U((e=>o(j(e,"height")))),i=Gt("context");return t?e.createElement(n,{ref:r},e.createElement(t,Bt(t,i))):null})),Pt=e.memo((function(){const t=Gt("FooterComponent"),o=Dt("footerHeight"),n=Gt("headerFooterTag"),r=U((e=>o(j(e,"height")))),i=Gt("context");return t?e.createElement(n,{ref:r},e.createElement(t,Bt(t,i))):null}));function Lt({usePublisher:t,useEmitter:o,useEmitterValue:n}){return e.memo((function({style:r,children:i,...l}){const s=t("scrollContainerState"),c=n("ScrollerComponent"),a=t("smoothScrollTargetReached"),u=n("scrollerRef"),d=n("context"),{scrollerRef:f,scrollByCallback:m,scrollToCallback:h}=q(s,a,c,u);return o("scrollTo",h),o("scrollBy",m),e.createElement(c,{ref:f,style:{...bt,...r},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...l,...Bt(c,d)},i)}))}function Ot({usePublisher:t,useEmitter:o,useEmitterValue:n}){return e.memo((function({style:r,children:i,...l}){const s=t("windowScrollContainerState"),c=n("ScrollerComponent"),a=t("smoothScrollTargetReached"),d=n("totalListHeight"),f=n("deviation"),m=n("customScrollParent"),h=n("context"),{scrollerRef:g,scrollByCallback:p,scrollToCallback:v}=q(s,a,c,u,m);return A((()=>(g.current=m||window,()=>{g.current=null})),[g,m]),o("windowScrollTo",v),o("scrollBy",p),e.createElement(c,{style:{position:"relative",...r,...0!==d?{height:d+f}:{}},"data-virtuoso-scroller":!0,...l,...Bt(c,h)},i)}))}const Mt=({children:t})=>{const n=e.useContext(It),r=Dt("viewportHeight"),i=Dt("fixedItemHeight"),l=U(o(r,(e=>j(e,"height"))));return e.useEffect((()=>{n&&(r(n.viewportHeight),i(n.itemHeight))}),[n,r,i]),e.createElement("div",{style:Rt,ref:l,"data-viewport-type":"element"},t)},Wt=({children:t})=>{const o=e.useContext(It),n=Dt("windowViewportRect"),r=Dt("fixedItemHeight"),i=Gt("customScrollParent"),l=xt(n,i);return e.useEffect((()=>{o&&(r(o.itemHeight),n({offsetTop:0,visibleHeight:o.viewportHeight,visibleWidth:100}))}),[o,n,r]),e.createElement("div",{ref:l,style:Rt,"data-viewport-type":"window"},t)},Vt=({children:t})=>{const o=Gt("TopItemListComponent"),n=Gt("headerHeight"),r={...zt,marginTop:`${n}px`},i=Gt("context");return e.createElement(o||"div",{style:r,context:i},t)},Ft=e.memo((function(t){const o=Gt("useWindowScroll"),n=Gt("topItemsIndexes").length>0,r=Gt("customScrollParent"),i=r||o?Ut:_t,l=r||o?Wt:Mt;return e.createElement(i,{...t},n&&e.createElement(Vt,null,e.createElement(yt,{showTopList:!0})),e.createElement(l,null,e.createElement(kt,null),e.createElement(yt,null),e.createElement(Pt,null)))})),{Component:At,usePublisher:Dt,useEmitterValue:Gt,useEmitter:Nt}=F(Ct,{required:{},optional:{context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",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",headerFooterTag:"headerFooterTag",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",autoscrollToBottom:"autoscrollToBottom"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Ft),_t=Lt({usePublisher:Dt,useEmitterValue:Gt,useEmitter:Nt}),Ut=Ot({usePublisher:Dt,useEmitterValue:Gt,useEmitter:Nt}),$t=At,jt=At,Kt={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},qt={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:Yt,ceil:Zt,floor:Jt,min:Qt,max:Xt}=Math;function eo(e,t,o){return Array.from({length:t-e+1}).map(((t,n)=>({index:n+e,data:null==o?void 0:o[n+e]})))}function to(e,t){return e&&e.column===t.column&&e.row===t.row}const oo=M((([{overscan:e,visibleRange:t,listBoundary:o},{scrollTop:n,viewportHeight:r,scrollBy:i,scrollTo:l,smoothScrollTargetReached:s,scrollContainerState:c,footerHeight:a,headerHeight:u},d,f,{propsReady:m,didMount:h},{windowViewportRect:p,windowScrollTo:C,useWindowScroll:b,customScrollParent:R,windowScrollContainerState:z},B])=>{const P=x(0),M=x(0),W=x(Kt),V=x({height:0,width:0}),F=x({height:0,width:0}),A=v(),D=v(),G=x(0),N=x(void 0),_=x({row:0,column:0});g(w(O(h,M,N),E((([,e])=>0!==e)),H((([,e,t])=>({items:eo(0,e-1,t),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0})))),W),g(w(O(L(P),t,L(_,to),L(F,((e,t)=>e&&e.width===t.width&&e.height===t.height)),N),k(V),H((([[e,[t,o],n,r,i],l])=>{const{row:s,column:c}=n,{height:a,width:u}=r,{width:d}=l;if(0===e||0===d)return Kt;if(0===u)return function(e){return{...qt,items:e}}(eo(0,0,i));const f=io(d,u,c);let m=f*Jt((t+s)/(a+s)),h=f*Zt((o+s)/(a+s))-1;h=Qt(e-1,Xt(h,f-1)),m=Qt(h,Xt(0,m));const g=eo(m,h,i),{top:p,bottom:v}=no(l,n,r,g),x=Zt(e/f);return{items:g,offsetTop:p,offsetBottom:x*a+(x-1)*s-v,top:p,bottom:v,itemHeight:a,itemWidth:u}}))),W),g(w(N,E((e=>void 0!==e)),H((e=>e.length))),P),g(w(V,H((({height:e})=>e))),r),g(w(O(V,F,W,_),H((([e,t,{items:o},n])=>{const{top:r,bottom:i}=no(e,n,t,o);return[r,i]})),S(Ue)),o);const U=I(w(L(W),E((({items:e})=>e.length>0)),k(P),E((([{items:e},t])=>e[e.length-1].index===t-1)),H((([,e])=>e-1)),S())),$=I(w(L(W),E((({items:e})=>e.length>0&&0===e[0].index)),y(0),S())),j=I(w(L(W),E((({items:e})=>e.length>0)),H((({items:e})=>({startIndex:e[0].index,endIndex:e[e.length-1].index}))),S($e)));g(j,f.scrollSeekRangeChanged),g(w(A,k(V,F,P,_),H((([e,t,o,n,r])=>{const i=Pe(e),{align:l,behavior:s,offset:c}=i;let a=i.index;"LAST"===a&&(a=n-1),a=Xt(0,a,Qt(n-1,a));let u=ro(t,r,o,a);return"end"===l?u=Yt(u-t.height+o.height):"center"===l&&(u=Yt(u-t.height/2+o.height/2)),c&&(u+=c),{top:u,behavior:s}}))),l);const K=T(w(W,H((e=>e.offsetBottom+e.bottom))),0);return g(w(p,H((e=>({width:e.visibleWidth,height:e.visibleHeight})))),V),{data:N,totalCount:P,viewportDimensions:V,itemDimensions:F,scrollTop:n,scrollHeight:D,overscan:e,scrollBy:i,scrollTo:l,scrollToIndex:A,smoothScrollTargetReached:s,windowViewportRect:p,windowScrollTo:C,useWindowScroll:b,customScrollParent:R,windowScrollContainerState:z,deviation:G,scrollContainerState:c,footerHeight:a,headerHeight:u,initialItemCount:M,gap:_,...f,gridState:W,totalListHeight:K,...d,startReached:$,endReached:U,rangeChanged:j,propsReady:m,...B}}),s(Je,Y,Ve,nt,Fe,dt,N));function no(e,t,o,n){const{height:r}=o;if(void 0===r||0===n.length)return{top:0,bottom:0};return{top:ro(e,t,o,n[0].index),bottom:ro(e,t,o,n[n.length-1].index)+r}}function ro(e,t,o,n){const r=io(e.width,o.width,t.column),i=Jt(n/r),l=i*o.height+Xt(0,i-1)*t.row;return l>0?l+t.row:l}function io(e,t,o){return Xt(1,Jt((e+o)/(t+o)))}const lo=M((([e,t])=>({...e,...t})),s(oo,M((()=>{const e=x((e=>`Item ${e}`)),t=x({}),o=x(null),n=x("virtuoso-grid-item"),r=x("virtuoso-grid-list"),i=x(wt),l=x("div"),s=x(u),c=(e,o=null)=>T(w(t,H((t=>t[e])),S()),o);return{context:o,itemContent:e,components:t,computeItemKey:i,itemClassName:n,listClassName:r,headerFooterTag:l,scrollerRef:s,FooterComponent:c("Footer"),HeaderComponent:c("Header"),ListComponent:c("List","div"),ItemComponent:c("Item","div"),ScrollerComponent:c("Scroller","div"),ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}})))),so=e.memo((function(){const t=po("gridState"),o=po("listClassName"),n=po("itemClassName"),r=po("itemContent"),i=po("computeItemKey"),l=po("isSeeking"),s=go("scrollHeight"),c=po("ItemComponent"),a=po("ListComponent"),u=po("ScrollSeekPlaceholder"),d=po("context"),f=go("itemDimensions"),m=go("gap"),h=po("log"),g=U((e=>{const t=e.parentElement.parentElement.scrollHeight;s(t);const o=e.firstChild;o&&f(o.getBoundingClientRect()),m({row:To("row-gap",getComputedStyle(e).rowGap,h),column:To("column-gap",getComputedStyle(e).columnGap,h)})}));return e.createElement(a,{ref:g,className:o,...Bt(a,d),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map((o=>{const s=i(o.index,o.data,d);return l?e.createElement(u,{key:s,...Bt(u,d),index:o.index,height:t.itemHeight,width:t.itemWidth}):e.createElement(c,{...Bt(c,d),className:n,"data-index":o.index,key:s},r(o.index,o.data,d))})))})),co=e.memo((function(){const t=po("HeaderComponent"),o=go("headerHeight"),n=po("headerFooterTag"),r=U((e=>o(j(e,"height")))),i=po("context");return t?e.createElement(n,{ref:r},e.createElement(t,Bt(t,i))):null})),ao=e.memo((function(){const t=po("FooterComponent"),o=go("footerHeight"),n=po("headerFooterTag"),r=U((e=>o(j(e,"height")))),i=po("context");return t?e.createElement(n,{ref:r},e.createElement(t,Bt(t,i))):null})),uo=({children:t})=>{const o=e.useContext(Tt),n=go("itemDimensions"),r=go("viewportDimensions"),i=U((e=>{r(e.getBoundingClientRect())}));return e.useEffect((()=>{o&&(r({height:o.viewportHeight,width:o.viewportWidth}),n({height:o.itemHeight,width:o.itemWidth}))}),[o,r,n]),e.createElement("div",{style:Rt,ref:i},t)},fo=({children:t})=>{const o=e.useContext(Tt),n=go("windowViewportRect"),r=go("itemDimensions"),i=po("customScrollParent"),l=xt(n,i);return e.useEffect((()=>{o&&(r({height:o.itemHeight,width:o.itemWidth}),n({offsetTop:0,visibleHeight:o.viewportHeight,visibleWidth:o.viewportWidth}))}),[o,n,r]),e.createElement("div",{ref:l,style:Rt},t)},mo=e.memo((function({...t}){const o=po("useWindowScroll"),n=po("customScrollParent"),r=n||o?Io:xo,i=n||o?fo:uo;return e.createElement(r,{...t},e.createElement(i,null,e.createElement(co,null),e.createElement(so,null),e.createElement(ao,null)))})),{Component:ho,usePublisher:go,useEmitterValue:po,useEmitter:vo}=F(lo,{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"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange"}},mo),xo=Lt({usePublisher:go,useEmitterValue:po,useEmitter:vo}),Io=Ot({usePublisher:go,useEmitterValue:po,useEmitter:vo});function To(e,t,o){return"normal"===t||(null==t?void 0:t.endsWith("px"))||o(`${e} was not resolved to pixel value correctly`,t,D.WARN),"normal"===t?0:parseInt(t??"0",10)}const wo=ho,Co=M((([e,t])=>({...e,...t})),s(ht,M((()=>{const t=x((t=>e.createElement("td",null,"Item $",t))),o=x(null),n=x(null),r=x(null),i=x({}),l=x(wt),s=x(u),c=(e,t=null)=>T(w(i,H((t=>t[e])),S()),t);return{context:o,itemContent:t,fixedHeaderContent:n,fixedFooterContent:r,components:i,computeItemKey:l,scrollerRef:s,TableComponent:c("Table","table"),TableHeadComponent:c("TableHead","thead"),TableFooterComponent:c("TableFoot","tfoot"),TableBodyComponent:c("TableBody","tbody"),TableRowComponent:c("TableRow","tr"),ScrollerComponent:c("Scroller","div"),EmptyPlaceholder:c("EmptyPlaceholder"),ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),FillerRow:c("FillerRow")}})))),So=({height:t})=>e.createElement("tr",null,e.createElement("td",{style:{height:t}})),Eo=({height:t})=>e.createElement("tr",null,e.createElement("td",{style:{height:t,padding:0,border:0}})),Ho=e.memo((function(){const t=ko("listState"),o=Bo("sizeRanges"),n=ko("useWindowScroll"),r=ko("customScrollParent"),i=Bo("windowScrollContainerState"),l=Bo("scrollContainerState"),s=r||n?i:l,c=ko("itemContent"),a=ko("trackItemSizes"),u=ko("itemSize"),d=ko("log"),{callbackRef:f,ref:m}=$(o,u,a,s,d,void 0,r),[h,g]=e.useState(0);Po("deviation",(e=>{h!==e&&(m.current.style.marginTop=`${e}px`,g(e))}));const p=ko("EmptyPlaceholder"),v=ko("ScrollSeekPlaceholder")||So,x=ko("FillerRow")||Eo,I=ko("TableBodyComponent"),T=ko("TableRowComponent"),w=ko("computeItemKey"),C=ko("isSeeking"),S=ko("paddingTopAddition"),E=ko("firstItemIndex"),H=ko("statefulTotalCount"),y=ko("context");if(0===H&&p)return e.createElement(p,Bt(p,y));const b=t.offsetTop+S+h,R=t.offsetBottom,z=b>0?e.createElement(x,{height:b,key:"padding-top",context:y}):null,B=R>0?e.createElement(x,{height:R,key:"padding-bottom",context:y}):null,k=t.items.map((t=>{const o=t.originalIndex,n=w(o+E,t.data,y);return C?e.createElement(v,{...Bt(v,y),key:n,index:t.index,height:t.size,type:t.type||"item"}):e.createElement(T,{...Bt(T,y),key:n,"data-index":o,"data-known-size":t.size,"data-item-index":t.index,item:t.data,style:{overflowAnchor:"none"}},c(t.index,t.data,y))}));return e.createElement(I,{ref:f,"data-test-id":"virtuoso-item-list",...Bt(I,y)},[z,...k,B])})),yo=({children:t})=>{const n=e.useContext(It),r=Bo("viewportHeight"),i=Bo("fixedItemHeight"),l=U(o(r,(e=>j(e,"height"))));return e.useEffect((()=>{n&&(r(n.viewportHeight),i(n.itemHeight))}),[n,r,i]),e.createElement("div",{style:Rt,ref:l,"data-viewport-type":"element"},t)},bo=({children:t})=>{const o=e.useContext(It),n=Bo("windowViewportRect"),r=Bo("fixedItemHeight"),i=ko("customScrollParent"),l=xt(n,i);return e.useEffect((()=>{o&&(r(o.itemHeight),n({offsetTop:0,visibleHeight:o.viewportHeight,visibleWidth:100}))}),[o,n,r]),e.createElement("div",{ref:l,style:Rt,"data-viewport-type":"window"},t)},Ro=e.memo((function(t){const n=ko("useWindowScroll"),r=ko("customScrollParent"),i=Bo("fixedHeaderHeight"),l=Bo("fixedFooterHeight"),s=ko("fixedHeaderContent"),c=ko("fixedFooterContent"),a=ko("context"),u=U(o(i,(e=>j(e,"height")))),d=U(o(l,(e=>j(e,"height")))),f=r||n?Oo:Lo,m=r||n?bo:yo,h=ko("TableComponent"),g=ko("TableHeadComponent"),p=ko("TableFooterComponent"),v=s?e.createElement(g,{key:"TableHead",style:{zIndex:1,position:"sticky",top:0},ref:u,...Bt(g,a)},s()):null,x=c?e.createElement(p,{key:"TableFoot",style:{zIndex:1,position:"sticky",bottom:0},ref:d,...Bt(p,a)},c()):null;return e.createElement(f,{...t},e.createElement(m,null,e.createElement(h,{style:{borderSpacing:0},...Bt(h,a)},[v,e.createElement(Ho,{key:"TableBody"}),x])))})),{Component:zo,usePublisher:Bo,useEmitterValue:ko,useEmitter:Po}=F(Co,{required:{},optional:{context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",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"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Ro),Lo=Lt({usePublisher:Bo,useEmitterValue:ko,useEmitter:Po}),Oo=Ot({usePublisher:Bo,useEmitterValue:ko,useEmitter:Po}),Mo=zo;exports.GroupedVirtuoso=jt,exports.LogLevel=D,exports.TableVirtuoso=Mo,exports.Virtuoso=$t,exports.VirtuosoGrid=wo,exports.VirtuosoGridMockContext=Tt,exports.VirtuosoMockContext=It;