New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-virtuoso

Package Overview
Dependencies
Maintainers
1
Versions
289
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-virtuoso - npm Package Compare versions

Comparing version 3.1.5 to 4.0.0

dist/react-urx/index.d.ts

50

dist/index.d.ts

@@ -8,3 +8,2 @@ import { ComponentPropsWithRef } from 'react';

import { ReactNode } from 'react';
import { Ref } from 'react';

@@ -14,3 +13,3 @@ /**

*/
export declare interface Components<Context = unknown> {
export declare interface Components<Data = unknown, Context = unknown> {
/**

@@ -33,3 +32,3 @@ * Set to render a component at the top of the list.

*/
Item?: ComponentType<ItemProps & {
Item?: ComponentType<ItemProps<Data> & {
context?: Context;

@@ -173,3 +172,5 @@ }>;

*/
export declare type GridListProps = Pick<ComponentPropsWithRef<'div'>, 'style' | 'children' | 'ref' | 'className'>;
export declare type GridListProps = Pick<ComponentPropsWithRef<'div'>, 'style' | 'children' | 'ref' | 'className'> & {
'data-test-id': string;
};

@@ -196,3 +197,3 @@ export declare type GridRootProps = Omit<React_2.HTMLProps<HTMLDivElement>, 'ref' | 'data'>;

export declare const GroupedVirtuoso: <ItemData = any, Context = any>(props: GroupedVirtuosoProps<ItemData, Context> & {
ref?: Ref<GroupedVirtuosoHandle> | undefined;
ref?: React_3.Ref<GroupedVirtuosoHandle> | undefined;
}) => ReactElement;

@@ -259,3 +260,3 @@

export declare type ItemProps = Pick<ComponentPropsWithRef<'div'>, 'style' | 'children'> & {
export declare type ItemProps<D> = Pick<ComponentPropsWithRef<'div'>, 'style' | 'children'> & {
'data-index': number;

@@ -265,2 +266,3 @@ 'data-item-index': number;

'data-known-size': number;
item: D;
};

@@ -377,3 +379,3 @@

*/
export declare interface TableComponents<Context = unknown> {
export declare interface TableComponents<Data = unknown, Context = unknown> {
/**

@@ -402,3 +404,3 @@ * Set to customize the wrapping `table` element.

*/
TableRow?: ComponentType<ItemProps & {
TableRow?: ComponentType<ItemProps<Data> & {
context?: Context;

@@ -444,3 +446,3 @@ }>;

export declare const TableVirtuoso: <ItemData = any, Context = any>(props: TableVirtuosoProps<ItemData, Context> & {
ref?: Ref<TableVirtuosoHandle> | undefined;
ref?: React_3.Ref<TableVirtuosoHandle> | undefined;
}) => ReactElement;

@@ -459,3 +461,3 @@

*/
components?: TableComponents<C>;
components?: TableComponents<D, C>;
/**

@@ -466,6 +468,2 @@ * Set the contents of the table header.

/**
* Set the contents of the table footer.
*/
fixedFooterContent?: FixedFooterContent;
/**
* The total amount of items to be rendered.

@@ -632,6 +630,2 @@ */

atBottomThreshold?: number;
/**
* No longer necessary after 2.10.2. component should work out of the box.
*/
react18ConcurrentRendering?: boolean;
}

@@ -642,7 +636,7 @@

export declare const Virtuoso: <ItemData = any, Context = any>(props: VirtuosoProps<ItemData, Context> & {
ref?: Ref<VirtuosoHandle> | undefined;
ref?: React_3.Ref<VirtuosoHandle> | undefined;
}) => ReactElement;
export declare const VirtuosoGrid: <ItemData = any, Context = any>(props: VirtuosoGridProps<ItemData, Context> & {
ref?: Ref<VirtuosoGridHandle> | undefined;
export declare const VirtuosoGrid: <Context = any>(props: VirtuosoGridProps<Context, unknown> & {
ref?: React_3.Ref<VirtuosoGridHandle> | undefined;
}) => ReactElement;

@@ -688,6 +682,2 @@

/**
* Use the `components` property for advanced customization of the elements rendered by the list.
*/
context?: C;
/**
* Set the overscan property to make the component "chunk" the rendering of new items on scroll.

@@ -706,6 +696,2 @@ * The property causes the component to render more items than the necessary, but reduces the re-renders on scroll.

/**
* Set to customize the wrapper tag for the header and footer components (default is `div`).
*/
headerFooterTag?: string;
/**
* Use to display placeholders if the user scrolls fast through the list.

@@ -858,3 +844,3 @@ *

*/
components?: Components<C>;
components?: Components<D, C>;
/**

@@ -988,6 +974,2 @@ * Set the callback to specify the contents of the item.

atBottomThreshold?: number;
/**
* No longer necessary after 2.10.2. component should work out of the box.
*/
react18ConcurrentRendering?: boolean;
}

@@ -994,0 +976,0 @@

@@ -1,2 +0,1 @@

"use strict";var e=require("@virtuoso.dev/react-urx"),t=require("@virtuoso.dev/urx"),n=require("react"),o=require("react-dom");function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,t}var i=/*#__PURE__*/r(t),a=/*#__PURE__*/r(n);function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},l.apply(this,arguments)}function s(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)t.indexOf(n=i[o])>=0||(r[n]=e[n]);return r}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var m,d,f="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;exports.LogLevel=void 0,(d=exports.LogLevel||(exports.LogLevel={}))[d.DEBUG=0]="DEBUG",d[d.INFO=1]="INFO",d[d.WARN=2]="WARN",d[d.ERROR=3]="ERROR";var p=((m={})[exports.LogLevel.DEBUG]="debug",m[exports.LogLevel.INFO]="log",m[exports.LogLevel.WARN]="warn",m[exports.LogLevel.ERROR]="error",m),h=i.system(function(){var e=i.statefulStream(exports.LogLevel.ERROR);return{log:i.statefulStream(function(t,n,o){var r;void 0===o&&(o=exports.LogLevel.INFO),o>=(null!=(r=("undefined"==typeof globalThis?window:globalThis).VIRTUOSO_LOG_LEVEL)?r:i.getValue(e))&&console[p[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function g(e,t){void 0===t&&(t=!0);var o=n.useRef(null),r=function(e){};if("undefined"!=typeof ResizeObserver){var i=new ResizeObserver(function(t){var n=t[0].target;null!==n.offsetParent&&e(n)});r=function(e){e&&t?(i.observe(e),o.current=e):(o.current&&i.unobserve(o.current),o.current=null)}}return{ref:o,callbackRef:r}}function v(e,t){return void 0===t&&(t=!0),g(e,t).callbackRef}function S(e,t,n,o,r,i,a){return g(function(n){for(var l=function(e,t,n,o){var r=e.length;if(0===r)return null;for(var i=[],a=0;a<r;a++){var l=e.item(a);if(l&&void 0!==l.dataset.index){var s=parseInt(l.dataset.index),u=parseFloat(l.dataset.knownSize),c=t(l,"offsetHeight");if(0===c&&o("Zero-sized element, this should not happen",{child:l},exports.LogLevel.ERROR),c!==u){var m=i[i.length-1];0===i.length||m.size!==c||m.endIndex!==s-1?i.push({startIndex:s,endIndex:s,size:c}):i[i.length-1].endIndex++}}}return i}(n.children,t,0,r),s=n.parentElement;!s.dataset.virtuosoScroller;)s=s.parentElement;var u="window"===s.firstElementChild.dataset.viewportType,c=a?a.scrollTop:u?window.pageYOffset||document.documentElement.scrollTop:s.scrollTop,m=a?a.scrollHeight:u?document.documentElement.scrollHeight:s.scrollHeight,d=a?a.offsetHeight:u?window.innerHeight:s.offsetHeight;o({scrollTop:Math.max(c,0),scrollHeight:m,viewportHeight:d}),null==i||i(function(e,t,n){return"normal"===t||null!=t&&t.endsWith("px")||n("row-gap was not resolved to pixel value correctly",t,exports.LogLevel.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}(0,getComputedStyle(n).rowGap,r)),null!==l&&e(l)},n)}function C(e,t){return Math.round(e.getBoundingClientRect()[t])}function x(e,t){return Math.abs(e-t)<1.01}function I(e,t,r,a,l){void 0===a&&(a=i.noop);var s=n.useRef(null),u=n.useRef(null),c=n.useRef(null),m=n.useRef(!1),d=n.useCallback(function(n){var r=n.target,i=r===window||r===document,a=i?window.pageYOffset||document.documentElement.scrollTop:r.scrollTop,l=i?document.documentElement.scrollHeight:r.scrollHeight,s=i?window.innerHeight:r.offsetHeight,d=function(){e({scrollTop:Math.max(a,0),scrollHeight:l,viewportHeight:s})};m.current?o.flushSync(d):d(),m.current=!1,null!==u.current&&(a===u.current||a<=0||a===l-s)&&(u.current=null,t(!0),c.current&&(clearTimeout(c.current),c.current=null))},[e,t]);return n.useEffect(function(){var e=l||s.current;return a(l||s.current),d({target:e}),e.addEventListener("scroll",d,{passive:!0}),function(){a(null),e.removeEventListener("scroll",d)}},[s,d,r,a,l]),{scrollerRef:s,scrollByCallback:function(e){m.current=!0,s.current.scrollBy(e)},scrollToCallback:function(n){var o=s.current;if(o&&(!("offsetHeight"in o)||0!==o.offsetHeight)){var r,i,a,l="smooth"===n.behavior;if(o===window?(i=Math.max(C(document.documentElement,"height"),document.documentElement.scrollHeight),r=window.innerHeight,a=document.documentElement.scrollTop):(i=o.scrollHeight,r=C(o,"height"),a=o.scrollTop),n.top=Math.ceil(Math.max(Math.min(i-r,n.top),0)),x(r,i)||n.top===a)return e({scrollTop:a,scrollHeight:i,viewportHeight:r}),void(l&&t(!0));l?(u.current=n.top,c.current&&clearTimeout(c.current),c.current=setTimeout(function(){c.current=null,u.current=null,t(!0)},1e3)):u.current=null,o.scrollTo(n)}}}}var T=i.system(function(){var e=i.stream(),t=i.stream(),n=i.statefulStream(0),o=i.stream(),r=i.statefulStream(0),a=i.stream(),l=i.stream(),s=i.statefulStream(0),u=i.statefulStream(0),c=i.statefulStream(0),m=i.statefulStream(0),d=i.stream(),f=i.stream(),p=i.statefulStream(!1),h=i.statefulStream(!1);return i.connect(i.pipe(e,i.map(function(e){return e.scrollTop})),t),i.connect(i.pipe(e,i.map(function(e){return e.scrollHeight})),l),i.connect(t,r),{scrollContainerState:e,scrollTop:t,viewportHeight:a,headerHeight:s,fixedHeaderHeight:u,fixedFooterHeight:c,footerHeight:m,scrollHeight:l,smoothScrollTargetReached:o,react18ConcurrentRendering:h,scrollTo:d,scrollBy:f,statefulScrollTop:r,deviation:n,scrollingInProgress:p}},[],{singleton:!0}),w={lvl:0};function b(e,t,n,o,r){return void 0===o&&(o=w),void 0===r&&(r=w),{k:e,v:t,lvl:n,l:o,r:r}}function y(e){return e===w}function E(){return w}function H(e,t){if(y(e))return w;var n=e.k,o=e.l,r=e.r;if(t===n){if(y(o))return r;if(y(r))return o;var i=z(o);return M(P(e,{k:i[0],v:i[1],l:B(o)}))}return M(P(e,t<n?{l:H(o,t)}:{r:H(r,t)}))}function L(e,t,n){if(void 0===n&&(n="k"),y(e))return[-Infinity,void 0];if(e[n]===t)return[e.k,e.v];if(e[n]<t){var o=L(e.r,t,n);return-Infinity===o[0]?[e.k,e.v]:o}return L(e.l,t,n)}function R(e,t,n){return y(e)?b(t,n,1):t===e.k?P(e,{k:t,v:n}):function(e){return U(A(e))}(P(e,t<e.k?{l:R(e.l,t,n)}:{r:R(e.r,t,n)}))}function F(e,t,n){if(y(e))return[];var o=e.k,r=e.v,i=e.r,a=[];return o>t&&(a=a.concat(F(e.l,t,n))),o>=t&&o<=n&&a.push({k:o,v:r}),o<=n&&(a=a.concat(F(i,t,n))),a}function k(e){return y(e)?[]:[].concat(k(e.l),[{k:e.k,v:e.v}],k(e.r))}function z(e){return y(e.r)?[e.k,e.v]:z(e.r)}function B(e){return y(e.r)?e.l:M(P(e,{r:B(e.r)}))}function P(e,t){return b(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 O(e){return y(e)||e.lvl>e.r.lvl}function M(e){var t=e.l,n=e.r,o=e.lvl;if(n.lvl>=o-1&&t.lvl>=o-1)return e;if(o>n.lvl+1){if(O(t))return A(P(e,{lvl:o-1}));if(y(t)||y(t.r))throw new Error("Unexpected empty nodes");return P(t.r,{l:P(t,{r:t.r.l}),r:P(e,{l:t.r.r,lvl:o-1}),lvl:o})}if(O(e))return U(P(e,{lvl:o-1}));if(y(n)||y(n.l))throw new Error("Unexpected empty nodes");var r=n.l,i=O(r)?n.lvl-1:n.lvl;return P(r,{l:P(e,{r:r.l,lvl:o-1}),r:U(P(n,{l:r.r,lvl:i})),lvl:r.lvl+1})}function V(e,t,n){return y(e)?[]:W(F(e,L(e,t)[0],n),function(e){return{index:e.k,value:e.v}})}function W(e,t){var n=e.length;if(0===n)return[];for(var o=t(e[0]),r=o.index,i=o.value,a=[],l=1;l<n;l++){var s=t(e[l]),u=s.index,c=s.value;a.push({start:r,end:u-1,value:i}),r=u,i=c}return a.push({start:r,end:Infinity,value:i}),a}function U(e){var t=e.r,n=e.lvl;return y(t)||y(t.r)||t.lvl!==n||t.r.lvl!==n?e:P(t,{l:P(e,{r:t.l}),lvl:n+1})}function A(e){var t=e.l;return y(t)||t.lvl!==e.lvl?e:P(t,{r:P(e,{l:t.r})})}function N(e,t,n,o){void 0===o&&(o=0);for(var r=e.length-1;o<=r;){var i=Math.floor((o+r)/2),a=n(e[i],t);if(0===a)return i;if(-1===a){if(r-o<2)return i-1;r=i-1}else{if(r===o)return i;o=i+1}}throw new Error("Failed binary finding record in array - "+e.join(",")+", searched for "+t)}function D(e,t,n){return e[N(e,t,n)]}var G=i.system(function(){return{recalcInProgress:i.statefulStream(!1)}},[],{singleton:!0});function j(e){var t=e.size,n=e.startIndex,o=e.endIndex;return function(e){return e.start===n&&(e.end===o||Infinity===e.end)&&e.value===t}}function _(e,t){var n=e.index;return t===n?0:t<n?-1:1}function K(e,t){var n=e.offset;return t===n?0:t<n?-1:1}function q(e){return{index:e.index,value:e}}function Y(e,t,n,o){var r=e,i=0,a=0,l=0,s=0;if(0!==t){l=r[s=N(r,t-1,_)].offset;var u=L(n,t-1);i=u[0],a=u[1],r.length&&r[s].size===L(n,t)[1]&&(s-=1),r=r.slice(0,s+1)}else r=[];for(var m,d=c(V(n,t,Infinity));!(m=d()).done;){var f=m.value,p=f.start,h=f.value,g=p-i,v=g*a+l+g*o;r.push({offset:v,size:h,index:p}),i=p,l=v,a=h}return{offsetTree:r,lastIndex:i,lastOffset:l,lastSize:a}}function Z(e,t){var n=t[0],o=t[1],r=t[3];n.length>0&&(0,t[2])("received item sizes",n,exports.LogLevel.DEBUG);var i=e.sizeTree,a=i,l=0;if(o.length>0&&y(i)&&2===n.length){var s=n[0].size,u=n[1].size;a=o.reduce(function(e,t){return R(R(e,t,s),t+1,u)},a)}else{var m=function(e,t){for(var n,o=y(e)?0:Infinity,r=c(t);!(n=r()).done;){var i=n.value,a=i.size,l=i.startIndex,s=i.endIndex;if(o=Math.min(o,l),y(e))e=R(e,0,a);else{var u=V(e,l-1,s+1);if(!u.some(j(i))){for(var m,d=!1,f=!1,p=c(u);!(m=p()).done;){var h=m.value,g=h.start,v=h.end,S=h.value;d?(s>=g||a===S)&&(e=H(e,g)):(f=S!==a,d=!0),v>s&&s>=g&&S!==a&&(e=R(e,s+1,S))}f&&(e=R(e,l,a))}}}return[e,o]}(a,n);a=m[0],l=m[1]}if(a===i)return e;var d=Y(e.offsetTree,l,a,r),f=d.offsetTree;return{sizeTree:a,offsetTree:f,lastIndex:d.lastIndex,lastOffset:d.lastOffset,lastSize:d.lastSize,groupOffsetTree:o.reduce(function(e,t){return R(e,t,J(t,f,r))},E()),groupIndices:o}}function J(e,t,n){if(0===t.length)return 0;var o=D(t,e,_),r=e-o.index,i=o.size*r+(r-1)*n+o.offset;return i>0?i+n:i}function $(e,t,n){if(function(e){return void 0!==e.groupIndex}(e))return t.groupIndices[e.groupIndex]+1;var o=Q("LAST"===e.index?n:e.index,t);return Math.max(0,o,Math.min(n,o))}function Q(e,t){if(!X(t))return e;for(var n=0;t.groupIndices[n]<=e+n;)n++;return e+n}function X(e){return!y(e.groupOffsetTree)}var ee={offsetHeight:"height",offsetWidth:"width"},te=i.system(function(e){var t=e[0].log,n=e[1].recalcInProgress,o=i.stream(),r=i.stream(),a=i.statefulStreamFromEmitter(r,0),s=i.stream(),u=i.stream(),c=i.statefulStream(0),m=i.statefulStream([]),d=i.statefulStream(void 0),f=i.statefulStream(void 0),p=i.statefulStream(function(e,t){return C(e,ee[t])}),h=i.statefulStream(void 0),g=i.statefulStream(0),v={offsetTree:[],sizeTree:E(),groupOffsetTree:E(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]},S=i.statefulStreamFromEmitter(i.pipe(o,i.withLatestFrom(m,t,g),i.scan(Z,v),i.distinctUntilChanged()),v);i.connect(i.pipe(m,i.filter(function(e){return e.length>0}),i.withLatestFrom(S,g),i.map(function(e){var t=e[0],n=e[1],o=e[2],r=t.reduce(function(e,t,r){return R(e,t,J(t,n.offsetTree,o)||r)},E());return l({},n,{groupIndices:t,groupOffsetTree:r})})),S),i.connect(i.pipe(r,i.withLatestFrom(S),i.filter(function(e){return e[0]<e[1].lastIndex}),i.map(function(e){var t=e[1];return[{startIndex:e[0],endIndex:t.lastIndex,size:t.lastSize}]})),o),i.connect(d,f);var x=i.statefulStreamFromEmitter(i.pipe(d,i.map(function(e){return void 0===e})),!0);i.connect(i.pipe(f,i.filter(function(e){return void 0!==e&&y(i.getValue(S).sizeTree)}),i.map(function(e){return[{startIndex:0,endIndex:0,size:e}]})),o);var I=i.streamFromEmitter(i.pipe(o,i.withLatestFrom(S),i.scan(function(e,t){var n=t[1];return{changed:n!==e.sizes,sizes:n}},{changed:!1,sizes:v}),i.map(function(e){return e.changed})));i.subscribe(i.pipe(c,i.scan(function(e,t){return{diff:e.prev-t,prev:t}},{diff:0,prev:0}),i.map(function(e){return e.diff})),function(e){e>0?(i.publish(n,!0),i.publish(s,e)):e<0&&i.publish(u,e)}),i.subscribe(i.pipe(c,i.withLatestFrom(t)),function(e){e[0]<0&&(0,e[1])("`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:c},exports.LogLevel.ERROR)});var T=i.streamFromEmitter(s);i.connect(i.pipe(s,i.withLatestFrom(S),i.map(function(e){var t=e[0],n=e[1];if(n.groupIndices.length>0)throw new Error("Virtuoso: prepending items does not work with groups");return k(n.sizeTree).reduce(function(e,n){var o=n.k,r=n.v;return{ranges:[].concat(e.ranges,[{startIndex:e.prevIndex,endIndex:o+t-1,size:e.prevSize}]),prevIndex:o+t,prevSize:r}},{ranges:[],prevIndex:0,prevSize:n.lastSize}).ranges})),o);var w=i.streamFromEmitter(i.pipe(u,i.withLatestFrom(S,g),i.map(function(e){return J(-e[0],e[1].offsetTree,e[2])})));return i.connect(i.pipe(u,i.withLatestFrom(S,g),i.map(function(e){var t=e[0],n=e[1],o=e[2];if(n.groupIndices.length>0)throw new Error("Virtuoso: shifting items does not work with groups");var r=k(n.sizeTree).reduce(function(e,n){var o=n.v;return R(e,Math.max(0,n.k+t),o)},E());return l({},n,{sizeTree:r},Y(n.offsetTree,0,r,o))})),S),{data:h,totalCount:r,sizeRanges:o,groupIndices:m,defaultItemSize:f,fixedItemSize:d,unshiftWith:s,shiftWith:u,shiftWithOffset:w,beforeUnshiftWith:T,firstItemIndex:c,gap:g,sizes:S,listRefresh:I,statefulTotalCount:a,trackItemSizes:x,itemSize:p}},i.tup(h,G),{singleton:!0}),ne="undefined"!=typeof document&&"scrollBehavior"in document.documentElement.style;function oe(e){var t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),t.behavior&&ne||(t.behavior="auto"),t.offset||(t.offset=0),t}var re=i.system(function(e){var t=e[0],n=t.sizes,o=t.totalCount,r=t.listRefresh,a=t.gap,l=e[1],s=l.scrollingInProgress,u=l.viewportHeight,c=l.scrollTo,m=l.smoothScrollTargetReached,d=l.headerHeight,f=l.footerHeight,p=l.fixedHeaderHeight,h=l.fixedFooterHeight,g=e[2].log,v=i.stream(),S=i.statefulStream(0),C=null,x=null,I=null;function T(){C&&(C(),C=null),I&&(I(),I=null),x&&(clearTimeout(x),x=null),i.publish(s,!1)}return i.connect(i.pipe(v,i.withLatestFrom(n,u,o,S,d,f,g),i.withLatestFrom(a,p,h),i.map(function(e){var t=e[0],n=t[0],o=t[1],a=t[2],l=t[3],u=t[4],c=t[5],d=t[6],f=t[7],p=e[1],h=e[2],g=e[3],S=oe(n),w=S.align,b=S.behavior,y=S.offset,E=l-1,H=$(S,o,E),R=J(H,o.offsetTree,p)+c;"end"===w?(R+=h+L(o.sizeTree,H)[1]-a+g,H===E&&(R+=d)):"center"===w?R+=(h+L(o.sizeTree,H)[1]-a+g)/2:R-=u,y&&(R+=y);var F=function(e){T(),e?(f("retrying to scroll to",{location:n},exports.LogLevel.DEBUG),i.publish(v,n)):f("list did not change, scroll successful",{},exports.LogLevel.DEBUG)};if(T(),"smooth"===b){var k=!1;I=i.subscribe(r,function(e){k=k||e}),C=i.handleNext(m,function(){F(k)})}else C=i.handleNext(i.pipe(r,function(e){var t=setTimeout(function(){e(!1)},150);return function(n){n&&(e(!0),clearTimeout(t))}}),F);return x=setTimeout(function(){T()},1200),i.publish(s,!0),f("scrolling from index to",{index:H,top:R,behavior:b},exports.LogLevel.DEBUG),{top:R,behavior:b}})),c),{scrollToIndex:v,topListHeight:S}},i.tup(te,T,h),{singleton:!0}),ie="up",ae={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},le=i.system(function(e){var t=e[0],n=t.scrollContainerState,o=t.scrollTop,r=t.viewportHeight,a=t.headerHeight,l=t.footerHeight,s=t.scrollBy,u=i.statefulStream(!1),c=i.statefulStream(!0),m=i.stream(),d=i.stream(),f=i.statefulStream(4),p=i.statefulStream(0),h=i.statefulStreamFromEmitter(i.pipe(i.merge(i.pipe(i.duc(o),i.skip(1),i.mapTo(!0)),i.pipe(i.duc(o),i.skip(1),i.mapTo(!1),i.debounceTime(100))),i.distinctUntilChanged()),!1),g=i.statefulStreamFromEmitter(i.pipe(i.merge(i.pipe(s,i.mapTo(!0)),i.pipe(s,i.mapTo(!1),i.debounceTime(200))),i.distinctUntilChanged()),!1);i.connect(i.pipe(i.combineLatest(i.duc(o),i.duc(p)),i.map(function(e){return e[0]<=e[1]}),i.distinctUntilChanged()),c),i.connect(i.pipe(c,i.throttleTime(50)),d);var v=i.streamFromEmitter(i.pipe(i.combineLatest(n,i.duc(r),i.duc(a),i.duc(l),i.duc(f)),i.scan(function(e,t){var n,o,r=t[0],i=r.scrollTop,a=r.scrollHeight,l=t[1],s={viewportHeight:l,scrollTop:i,scrollHeight:a};return i+l-a>-t[4]?(i>e.state.scrollTop?(n="SCROLLED_DOWN",o=e.state.scrollTop-i):(n="SIZE_DECREASED",o=e.state.scrollTop-i||e.scrollTopDelta),{atBottom:!0,state:s,atBottomBecause:n,scrollTopDelta:o}):{atBottom:!1,notAtBottomBecause:s.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":l<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":i<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",state:s}},ae),i.distinctUntilChanged(function(e,t){return e&&e.atBottom===t.atBottom}))),S=i.statefulStreamFromEmitter(i.pipe(n,i.scan(function(e,t){var n=t.scrollTop,o=t.scrollHeight,r=t.viewportHeight;return x(e.scrollHeight,o)?{scrollTop:n,scrollHeight:o,jump:0,changed:!1}:e.scrollTop!==n&&o-(n+r)<1?{scrollHeight:o,scrollTop:n,jump:e.scrollTop-n,changed:!0}:{scrollHeight:o,scrollTop:n,jump:0,changed:!0}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),i.filter(function(e){return e.changed}),i.map(function(e){return e.jump})),0);i.connect(i.pipe(v,i.map(function(e){return e.atBottom})),u),i.connect(i.pipe(u,i.throttleTime(50)),m);var C=i.statefulStream("down");i.connect(i.pipe(n,i.map(function(e){return e.scrollTop}),i.distinctUntilChanged(),i.scan(function(e,t){return i.getValue(g)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?ie:"down",prevScrollTop:t}},{direction:"down",prevScrollTop:0}),i.map(function(e){return e.direction})),C),i.connect(i.pipe(n,i.throttleTime(50),i.mapTo("none")),C);var I=i.statefulStream(0);return i.connect(i.pipe(h,i.filter(function(e){return!e}),i.mapTo(0)),I),i.connect(i.pipe(o,i.throttleTime(100),i.withLatestFrom(h),i.filter(function(e){return!!e[1]}),i.scan(function(e,t){return[e[1],t[0]]},[0,0]),i.map(function(e){return e[1]-e[0]})),I),{isScrolling:h,isAtTop:c,isAtBottom:u,atBottomState:v,atTopStateChange:d,atBottomStateChange:m,scrollDirection:C,atBottomThreshold:f,atTopThreshold:p,scrollVelocity:I,lastJumpDueToItemResize:S}},i.tup(T)),se=i.system(function(e){var t=e[0].log,n=i.statefulStream(!1),o=i.streamFromEmitter(i.pipe(n,i.filter(function(e){return e}),i.distinctUntilChanged()));return i.subscribe(n,function(e){e&&i.getValue(t)("props updated",{},exports.LogLevel.DEBUG)}),{propsReady:n,didMount:o}},i.tup(h),{singleton:!0}),ue=i.system(function(e){var t=e[0],n=t.sizes,o=t.listRefresh,r=t.defaultItemSize,a=e[1].scrollTop,l=e[2].scrollToIndex,s=e[3].didMount,u=i.statefulStream(!0),c=i.statefulStream(0);return i.connect(i.pipe(s,i.withLatestFrom(c),i.filter(function(e){return!!e[1]}),i.mapTo(!1)),u),i.subscribe(i.pipe(i.combineLatest(o,s),i.withLatestFrom(u,n,r),i.filter(function(e){var t=e[1],n=e[3];return e[0][1]&&(!y(e[2].sizeTree)||void 0!==n)&&!t}),i.withLatestFrom(c)),function(e){var t=e[1];setTimeout(function(){i.handleNext(a,function(){i.publish(u,!0)}),i.publish(l,t)})}),{scrolledToInitialItem:u,initialTopMostItemIndex:c}},i.tup(te,T,re,se),{singleton:!0});function ce(e){return!!e&&("smooth"===e?"smooth":"auto")}var me=i.system(function(e){var t=e[0],n=t.totalCount,o=t.listRefresh,r=e[1],a=r.isAtBottom,l=r.atBottomState,s=e[2].scrollToIndex,u=e[3].scrolledToInitialItem,c=e[4],m=c.propsReady,d=c.didMount,f=e[5].log,p=e[6].scrollingInProgress,h=i.statefulStream(!1),g=i.stream(),v=null;function S(e){i.publish(s,{index:"LAST",align:"end",behavior:e})}function C(e){var t=i.handleNext(l,function(t){!e||t.atBottom||"SIZE_INCREASED"!==t.notAtBottomBecause||v||(i.getValue(f)("scrolling to bottom due to increased size",{},exports.LogLevel.DEBUG),S("auto"))});setTimeout(t,100)}return i.subscribe(i.pipe(i.combineLatest(i.pipe(i.duc(n),i.skip(1)),d),i.withLatestFrom(i.duc(h),a,u,p),i.map(function(e){var t=e[0],n=t[0],o=t[1]&&e[3],r="auto";return o&&(r=function(e,t){return"function"==typeof e?ce(e(t)):t&&ce(e)}(e[1],e[2]||e[4]),o=o&&!!r),{totalCount:n,shouldFollow:o,followOutputBehavior:r}}),i.filter(function(e){return e.shouldFollow})),function(e){var t=e.totalCount,n=e.followOutputBehavior;v&&(v(),v=null),v=i.handleNext(o,function(){i.getValue(f)("following output to ",{totalCount:t},exports.LogLevel.DEBUG),S(n),v=null})}),i.subscribe(i.pipe(i.combineLatest(i.duc(h),n,m),i.filter(function(e){return e[0]&&e[2]}),i.scan(function(e,t){var n=t[1];return{refreshed:e.value===n,value:n}},{refreshed:!1,value:0}),i.filter(function(e){return e.refreshed}),i.withLatestFrom(h,n)),function(e){C(!1!==e[1])}),i.subscribe(g,function(){C(!1!==i.getValue(h))}),i.subscribe(i.combineLatest(i.duc(h),l),function(e){var t=e[1];e[0]&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&S("auto")}),{followOutput:h,autoscrollToBottom:g}},i.tup(te,le,re,ue,se,h,T));function de(e){return e.reduce(function(e,t){return e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e},{totalCount:0,groupIndices:[]})}var fe=i.system(function(e){var t=e[0],n=t.totalCount,o=t.groupIndices,r=t.sizes,a=e[1],l=a.scrollTop,s=a.headerHeight,u=i.stream(),c=i.stream(),m=i.streamFromEmitter(i.pipe(u,i.map(de)));return i.connect(i.pipe(m,i.map(function(e){return e.totalCount})),n),i.connect(i.pipe(m,i.map(function(e){return e.groupIndices})),o),i.connect(i.pipe(i.combineLatest(l,r,s),i.filter(function(e){return X(e[1])}),i.map(function(e){return L(e[1].groupOffsetTree,Math.max(e[0]-e[2],0),"v")[0]}),i.distinctUntilChanged(),i.map(function(e){return[e]})),c),{groupCounts:u,topItemsIndexes:c}},i.tup(te,T));function pe(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}function he(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function ge(e,t,n){return"number"==typeof e?n===ie&&"top"===t||"down"===n&&"bottom"===t?e:0:n===ie?"top"===t?e.main:e.reverse:"bottom"===t?e.main:e.reverse}function ve(e,t){return"number"==typeof e?e:e[t]||0}var Se=i.system(function(e){var t=e[0],n=t.scrollTop,o=t.viewportHeight,r=t.deviation,a=t.headerHeight,l=t.fixedHeaderHeight,s=i.stream(),u=i.statefulStream(0),c=i.statefulStream(0),m=i.statefulStream(0),d=i.statefulStreamFromEmitter(i.pipe(i.combineLatest(i.duc(n),i.duc(o),i.duc(a),i.duc(s,pe),i.duc(m),i.duc(u),i.duc(l),i.duc(r),i.duc(c)),i.map(function(e){var t=e[0],n=e[1],o=e[2],r=e[3],i=r[0],a=r[1],l=e[4],s=e[6],u=e[7],c=e[8],m=t-u,d=e[5]+s,f=Math.max(o-m,0),p="none",h=ve(c,"top"),g=ve(c,"bottom");return i-=u,a+=o+s,(i+=o+s)>t+d-h&&(p=ie),(a-=u)<t-f+n+g&&(p="down"),"none"!==p?[Math.max(m-o-ge(l,"top",p)-h,0),m-f-s+n+ge(l,"bottom",p)+g]:null}),i.filter(function(e){return null!=e}),i.distinctUntilChanged(pe)),[0,0]);return{listBoundary:s,overscan:m,topListHeight:u,increaseViewportBy:c,visibleRange:d}},i.tup(T),{singleton:!0}),Ce={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function xe(e,t,n){if(0===e.length)return[];if(!X(t))return e.map(function(e){return l({},e,{index:e.index+n,originalIndex:e.index})});for(var o,r=[],i=V(t.groupOffsetTree,e[0].index,e[e.length-1].index),a=void 0,s=0,u=c(e);!(o=u()).done;){var m=o.value;(!a||a.end<m.index)&&(a=i.shift(),s=t.groupIndices.indexOf(a.start)),r.push(l({},m.index===a.start?{type:"group",index:s}:{index:m.index-(s+1)+n,groupIndex:s},{size:m.size,offset:m.offset,originalIndex:m.index,data:m.data}))}return r}function Ie(e,t,n,o,r,i){var a=0,l=0;if(e.length>0){a=e[0].offset;var s=e[e.length-1];l=s.offset+s.size}var u=n-r.lastIndex,c=a,m=r.lastOffset+u*r.lastSize+(u-1)*o-l;return{items:xe(e,r,i),topItems:xe(t,r,i),topListHeight:t.reduce(function(e,t){return t.size+e},0),offsetTop:a,offsetBottom:m,top:c,bottom:l,totalCount:n,firstItemIndex:i}}var Te=i.system(function(e){var t=e[0],n=t.sizes,o=t.totalCount,r=t.data,a=t.firstItemIndex,s=t.gap,u=e[1],m=e[2],d=m.visibleRange,f=m.listBoundary,p=m.topListHeight,h=e[3],g=h.scrolledToInitialItem,v=h.initialTopMostItemIndex,S=e[4].topListHeight,C=e[5],x=e[6].didMount,I=e[7].recalcInProgress,T=i.statefulStream([]),w=i.stream();i.connect(u.topItemsIndexes,T);var b=i.statefulStreamFromEmitter(i.pipe(i.combineLatest(x,I,i.duc(d,pe),i.duc(o),i.duc(n),i.duc(v),g,i.duc(T),i.duc(a),i.duc(s),r),i.filter(function(e){return e[0]&&!e[1]}),i.map(function(e){var t=e[2],n=t[0],o=t[1],r=e[3],a=e[5],s=e[6],u=e[7],m=e[8],d=e[9],f=e[10],p=e[4],h=p.sizeTree,g=p.offsetTree;if(0===r||0===n&&0===o)return l({},Ce,{totalCount:r});if(y(h))return Ie(function(e,t,n){if(X(t)){var o=Q(e,t);return[{index:L(t.groupOffsetTree,o)[0],size:0,offset:0},{index:o,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}(function(e,t){return"number"==typeof e?e:"LAST"===e.index?t-1:e.index}(a,r),p,f),[],r,d,p,m);var v=[];if(u.length>0)for(var S,C=u[0],x=u[u.length-1],I=0,T=c(V(h,C,x));!(S=T()).done;)for(var w=S.value,b=w.value,E=Math.max(w.start,C),H=Math.min(w.end,x),R=E;R<=H;R++)v.push({index:R,size:b,offset:I,data:f&&f[R]}),I+=b;if(!s)return Ie([],v,r,d,p,m);var F=u.length>0?u[u.length-1]+1:0,k=function(e,t,n,o){return void 0===o&&(o=0),o>0&&(t=Math.max(t,D(e,o,_).offset)),W((i=n,l=N(r=e,t,a=K),s=N(r,i,a,l),r.slice(l,s+1)),q);var r,i,a,l,s}(g,n,o,F);if(0===k.length)return null;var z=r-1;return Ie(i.tap([],function(e){for(var t,r=c(k);!(t=r()).done;){var i=t.value,a=i.value,l=a.offset,s=i.start,u=a.size;if(a.offset<n){var m=(s+=Math.floor((n-a.offset+d)/(u+d)))-i.start;l+=m*u+m*d}s<F&&(l+=(F-s)*u,s=F);for(var p=Math.min(i.end,z),h=s;h<=p&&!(l>=o);h++)e.push({index:h,size:u,offset:l,data:f&&f[h]}),l+=u+d}}),v,r,d,p,m)}),i.filter(function(e){return null!==e}),i.distinctUntilChanged()),Ce);return i.connect(i.pipe(r,i.filter(function(e){return void 0!==e}),i.map(function(e){return e.length})),o),i.connect(i.pipe(b,i.map(function(e){return e.topListHeight})),S),i.connect(S,p),i.connect(i.pipe(b,i.map(function(e){return[e.top,e.bottom]})),f),i.connect(i.pipe(b,i.map(function(e){return e.items})),w),l({listState:b,topItemsIndexes:T,endReached:i.streamFromEmitter(i.pipe(b,i.filter(function(e){return e.items.length>0}),i.withLatestFrom(o,r),i.filter(function(e){var t=e[0].items;return t[t.length-1].originalIndex===e[1]-1}),i.map(function(e){return[e[1]-1,e[2]]}),i.distinctUntilChanged(pe),i.map(function(e){return e[0]}))),startReached:i.streamFromEmitter(i.pipe(b,i.throttleTime(200),i.filter(function(e){var t=e.items;return t.length>0&&t[0].originalIndex===e.topItems.length}),i.map(function(e){return e.items[0].index}),i.distinctUntilChanged())),rangeChanged:i.streamFromEmitter(i.pipe(b,i.filter(function(e){return e.items.length>0}),i.map(function(e){for(var t=e.items,n=0,o=t.length-1;"group"===t[n].type&&n<o;)n++;for(;"group"===t[o].type&&o>n;)o--;return{startIndex:t[n].index,endIndex:t[o].index}}),i.distinctUntilChanged(he))),itemsRendered:w},C)},i.tup(te,fe,Se,ue,re,le,se,G),{singleton:!0}),we=i.system(function(e){var t=e[0],n=t.sizes,o=t.firstItemIndex,r=t.data,a=t.gap,l=e[1].listState,s=e[2].didMount,u=i.statefulStream(0);return i.connect(i.pipe(s,i.withLatestFrom(u),i.filter(function(e){return 0!==e[1]}),i.withLatestFrom(n,o,a,r),i.map(function(e){var t=e[0][1],n=e[1],o=e[2],r=e[3],i=e[4],a=void 0===i?[]:i,l=0;if(n.groupIndices.length>0)for(var s,u=c(n.groupIndices);!((s=u()).done||s.value-l>=t);)l++;var m=t+l;return Ie(Array.from({length:m}).map(function(e,t){return{index:t,size:0,offset:0,data:a[t]}}),[],m,r,n,o)})),l),{initialItemCount:u}},i.tup(te,Te,se),{singleton:!0}),be=i.system(function(e){var t=e[0].scrollVelocity,n=i.statefulStream(!1),o=i.stream(),r=i.statefulStream(!1);return i.connect(i.pipe(t,i.withLatestFrom(r,n,o),i.filter(function(e){return!!e[1]}),i.map(function(e){var t=e[0],n=e[1],o=e[2],r=e[3],i=n.enter;if(o){if((0,n.exit)(t,r))return!1}else if(i(t,r))return!0;return o}),i.distinctUntilChanged()),n),i.subscribe(i.pipe(i.combineLatest(n,t,o),i.withLatestFrom(r)),function(e){var t=e[0],n=e[1];return t[0]&&n&&n.change&&n.change(t[1],t[2])}),{isSeeking:n,scrollSeekConfiguration:r,scrollVelocity:t,scrollSeekRangeChanged:o}},i.tup(le),{singleton:!0}),ye=i.system(function(e){var t=e[0].topItemsIndexes,n=i.statefulStream(0);return i.connect(i.pipe(n,i.filter(function(e){return e>0}),i.map(function(e){return Array.from({length:e}).map(function(e,t){return t})})),t),{topItemCount:n}},i.tup(Te)),Ee=i.system(function(e){var t=e[0],n=t.footerHeight,o=t.headerHeight,r=t.fixedHeaderHeight,a=t.fixedFooterHeight,l=e[1].listState,s=i.stream(),u=i.statefulStreamFromEmitter(i.pipe(i.combineLatest(n,a,o,r,l),i.map(function(e){var t=e[4];return e[0]+e[1]+e[2]+e[3]+t.offsetBottom+t.bottom})),0);return i.connect(i.duc(u),s),{totalListHeight:u,totalListHeightChanged:s}},i.tup(T,Te),{singleton:!0});function He(e){var t,n=!1;return function(){return n||(n=!0,t=e()),t}}var Le=He(function(){return/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)}),Re=i.system(function(e){var t=e[0],n=t.scrollBy,o=t.scrollTop,r=t.deviation,a=t.scrollingInProgress,l=e[1],s=l.isScrolling,u=l.isAtBottom,c=l.scrollDirection,m=e[3],d=m.beforeUnshiftWith,f=m.shiftWithOffset,p=m.sizes,h=m.gap,g=e[4].log,v=e[5].recalcInProgress,S=i.streamFromEmitter(i.pipe(e[2].listState,i.withLatestFrom(l.lastJumpDueToItemResize),i.scan(function(e,t){var n=e[1],o=t[0],r=o.items,i=o.totalCount,a=o.bottom+o.offsetBottom,l=0;return e[2]===i&&n.length>0&&r.length>0&&(0===r[0].originalIndex&&0===n[0].originalIndex||0!=(l=a-e[3])&&(l+=t[1])),[l,r,i,a]},[0,[],0,0]),i.filter(function(e){return 0!==e[0]}),i.withLatestFrom(o,c,a,u,g),i.filter(function(e){return!e[3]&&0!==e[1]&&e[2]===ie}),i.map(function(e){var t=e[0][0];return(0,e[5])("Upward scrolling compensation",{amount:t},exports.LogLevel.DEBUG),t})));function C(e){e>0?(i.publish(n,{top:-e,behavior:"auto"}),i.publish(r,0)):(i.publish(r,0),i.publish(n,{top:-e,behavior:"auto"}))}return i.subscribe(i.pipe(S,i.withLatestFrom(r,s)),function(e){var t=e[0],n=e[1];e[2]&&Le()?i.publish(r,n-t):C(-t)}),i.subscribe(i.pipe(i.combineLatest(i.statefulStreamFromEmitter(s,!1),r,v),i.filter(function(e){return!e[0]&&!e[2]&&0!==e[1]}),i.map(function(e){return e[1]}),i.throttleTime(1)),C),i.connect(i.pipe(f,i.map(function(e){return{top:-e}})),n),i.subscribe(i.pipe(d,i.withLatestFrom(p,h),i.map(function(e){var t=e[0];return t*e[1].lastSize+t*e[2]})),function(e){i.publish(r,e),requestAnimationFrame(function(){i.publish(n,{top:e}),requestAnimationFrame(function(){i.publish(r,0),i.publish(v,!1)})})}),{deviation:r}},i.tup(T,le,Te,te,h,G)),Fe=i.system(function(e){var t=e[0].totalListHeight,n=e[1].didMount,o=e[2].scrollTo,r=i.statefulStream(0);return i.subscribe(i.pipe(n,i.withLatestFrom(r),i.filter(function(e){return 0!==e[1]}),i.map(function(e){return{top:e[1]}})),function(e){i.handleNext(i.pipe(t,i.filter(function(e){return 0!==e})),function(){setTimeout(function(){i.publish(o,e)})})}),{initialScrollTop:r}},i.tup(Ee,se,T),{singleton:!0}),ke=i.system(function(e){var t=e[0].viewportHeight,n=e[1].totalListHeight,o=i.statefulStream(!1);return{alignToBottom:o,paddingTopAddition:i.statefulStreamFromEmitter(i.pipe(i.combineLatest(o,t,n),i.filter(function(e){return e[0]}),i.map(function(e){return Math.max(0,e[1]-e[2])}),i.distinctUntilChanged()),0)}},i.tup(T,Ee),{singleton:!0}),ze=i.system(function(e){var t=e[0],n=t.scrollTo,o=t.scrollContainerState,r=i.stream(),a=i.stream(),s=i.stream(),u=i.statefulStream(!1),c=i.statefulStream(void 0);return i.connect(i.pipe(i.combineLatest(r,a),i.map(function(e){var t=e[0],n=t.viewportHeight,o=t.scrollHeight;return{scrollTop:Math.max(0,t.scrollTop-e[1].offsetTop),scrollHeight:o,viewportHeight:n}})),o),i.connect(i.pipe(n,i.withLatestFrom(a),i.map(function(e){var t=e[0];return l({},t,{top:t.top+e[1].offsetTop})})),s),{useWindowScroll:u,customScrollParent:c,windowScrollContainerState:r,windowViewportRect:a,windowScrollTo:s}},i.tup(T)),Be=["done","behavior","align"],Pe=i.system(function(e){var t=e[0],n=t.sizes,o=t.totalCount,r=t.gap,a=e[1],u=a.scrollTop,c=a.viewportHeight,m=a.headerHeight,d=a.fixedHeaderHeight,f=a.fixedFooterHeight,p=a.scrollingInProgress,h=e[2].scrollToIndex,g=i.stream();return i.connect(i.pipe(g,i.withLatestFrom(n,c,o,m,d,f,u),i.withLatestFrom(r),i.map(function(e){var t=e[0],n=t[0],o=t[1],r=t[2],a=t[3],u=t[4],c=t[5],m=t[6],d=t[7],f=e[1],h=n.done,g=n.behavior,v=n.align,S=s(n,Be),C=null,x=$(n,o,a-1),I=J(x,o.offsetTree,f)+u+c;return I<d+c?C=l({},S,{behavior:g,align:null!=v?v:"start"}):I+L(o.sizeTree,x)[1]>d+r-m&&(C=l({},S,{behavior:g,align:null!=v?v:"end"})),C?h&&i.handleNext(i.pipe(p,i.skip(1),i.filter(function(e){return!1===e})),h):h&&h(),C}),i.filter(function(e){return null!==e})),h),{scrollIntoView:g}},i.tup(te,T,re,Te,h),{singleton:!0}),Oe=["listState","topItemsIndexes"],Me=i.system(function(e){return l({},e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},i.tup(Se,we,se,be,Ee,Fe,ke,ze,Pe)),Ve=i.system(function(e){var t=e[0],n=t.totalCount,o=t.sizeRanges,r=t.fixedItemSize,a=t.defaultItemSize,u=t.trackItemSizes,c=t.itemSize,m=t.data,d=t.firstItemIndex,f=t.groupIndices,p=t.statefulTotalCount,h=t.gap,g=e[1],v=g.initialTopMostItemIndex,S=g.scrolledToInitialItem,C=e[2],x=e[3],I=e[4],T=I.listState,w=I.topItemsIndexes,b=s(I,Oe),y=e[5].scrollToIndex,E=e[7].topItemCount,H=e[8].groupCounts,L=e[9],R=e[10];return i.connect(b.rangeChanged,L.scrollSeekRangeChanged),i.connect(i.pipe(L.windowViewportRect,i.map(function(e){return e.visibleHeight})),C.viewportHeight),l({totalCount:n,data:m,firstItemIndex:d,sizeRanges:o,initialTopMostItemIndex:v,scrolledToInitialItem:S,topItemsIndexes:w,topItemCount:E,groupCounts:H,fixedItemHeight:r,defaultItemHeight:a,gap:h},x,{statefulTotalCount:p,listState:T,scrollToIndex:y,trackItemSizes:u,itemSize:c,groupIndices:f},b,L,C,R)},i.tup(te,ue,T,me,Te,re,Re,ye,fe,Me,h)),We=He(function(){if("undefined"==typeof document)return"sticky";var e=document.createElement("div");return e.style.position="-webkit-sticky","-webkit-sticky"===e.style.position?"-webkit-sticky":"sticky"});function Ue(e,t){var o=n.useRef(null),r=n.useCallback(function(n){if(null!==n&&n.offsetParent){var r,i,a=n.getBoundingClientRect(),l=a.width;if(t){var s=t.getBoundingClientRect(),u=a.top-s.top;r=s.height-Math.max(0,u),i=u+t.scrollTop}else r=window.innerHeight-Math.max(0,a.top),i=a.top+window.pageYOffset;o.current={offsetTop:i,visibleHeight:r,visibleWidth:l},e(o.current)}},[e,t]),i=g(r),a=i.callbackRef,l=i.ref,s=n.useCallback(function(){r(l.current)},[r,l]);return n.useEffect(function(){if(t){t.addEventListener("scroll",s);var e=new ResizeObserver(s);return e.observe(t),function(){t.removeEventListener("scroll",s),e.unobserve(t)}}return window.addEventListener("scroll",s),window.addEventListener("resize",s),function(){window.removeEventListener("scroll",s),window.removeEventListener("resize",s)}},[s,t]),a}var Ae=a.createContext(void 0),Ne=a.createContext(void 0),De=["placeholder"],Ge=["style","children"],je=["style","children"];function _e(e){return e}var Ke=i.system(function(){var e=i.statefulStream(function(e){return"Item "+e}),t=i.statefulStream(null),n=i.statefulStream(function(e){return"Group "+e}),o=i.statefulStream({}),r=i.statefulStream(_e),a=i.statefulStream("div"),l=i.statefulStream(i.noop),s=function(e,t){return void 0===t&&(t=null),i.statefulStreamFromEmitter(i.pipe(o,i.map(function(t){return t[e]}),i.distinctUntilChanged()),t)};return{context:t,itemContent:e,groupContent:n,components:o,computeItemKey:r,headerFooterTag:a,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")}});function qe(e,t){var n=i.stream();return i.subscribe(n,function(){return console.warn("react-virtuoso: You are using a deprecated property. "+t,"color: red;","color: inherit;","color: blue;")}),i.connect(n,e),n}var Ye=i.system(function(e){var t=e[0],n=e[1],o={item:qe(n.itemContent,"Rename the %citem%c prop to %citemContent."),group:qe(n.groupContent,"Rename the %cgroup%c prop to %cgroupContent."),topItems:qe(t.topItemCount,"Rename the %ctopItems%c prop to %ctopItemCount."),itemHeight:qe(t.fixedItemHeight,"Rename the %citemHeight%c prop to %cfixedItemHeight."),scrollingStateChange:qe(t.isScrolling,"Rename the %cscrollingStateChange%c prop to %cisScrolling."),adjustForPrependedItems:i.stream(),maxHeightCacheSize:i.stream(),footer:i.stream(),header:i.stream(),HeaderContainer:i.stream(),FooterContainer:i.stream(),ItemContainer:i.stream(),ScrollContainer:i.stream(),GroupContainer:i.stream(),ListContainer:i.stream(),emptyComponent:i.stream(),scrollSeek:i.stream()};function r(e,t,o){i.connect(i.pipe(e,i.withLatestFrom(n.components),i.map(function(e){var n,r=e[0],i=e[1];return console.warn("react-virtuoso: "+o+" property is deprecated. Pass components."+t+" instead."),l({},i,((n={})[t]=r,n))})),n.components)}return i.subscribe(o.adjustForPrependedItems,function(){console.warn("react-virtuoso: adjustForPrependedItems is no longer supported. Use the firstItemIndex property instead - https://virtuoso.dev/prepend-items.","color: red;","color: inherit;","color: blue;")}),i.subscribe(o.maxHeightCacheSize,function(){console.warn("react-virtuoso: maxHeightCacheSize is no longer necessary. Setting it has no effect - remove it from your code.")}),i.subscribe(o.HeaderContainer,function(){console.warn("react-virtuoso: HeaderContainer is deprecated. Use headerFooterTag if you want to change the wrapper of the header component and pass components.Header to change its contents.")}),i.subscribe(o.FooterContainer,function(){console.warn("react-virtuoso: FooterContainer is deprecated. Use headerFooterTag if you want to change the wrapper of the footer component and pass components.Footer to change its contents.")}),i.subscribe(o.scrollSeek,function(e){var o=e.placeholder,r=s(e,De);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),i.publish(n.components,l({},i.getValue(n.components),{ScrollSeekPlaceholder:o})),i.publish(t.scrollSeekConfiguration,r)}),r(o.footer,"Footer","footer"),r(o.header,"Header","header"),r(o.ItemContainer,"Item","ItemContainer"),r(o.ListContainer,"List","ListContainer"),r(o.ScrollContainer,"Scroller","ScrollContainer"),r(o.emptyComponent,"EmptyPlaceholder","emptyComponent"),r(o.GroupContainer,"Group","GroupContainer"),l({},t,n,o)},i.tup(Ve,Ke)),Ze=function(e){return a.createElement("div",{style:{height:e.height}})},Je={position:We(),zIndex:1,overflowAnchor:"none"},$e={overflowAnchor:"none"},Qe=a.memo(function(e){var t=e.showTopList,o=void 0!==t&&t,r=pt("listState"),s=ft("sizeRanges"),u=pt("useWindowScroll"),c=pt("customScrollParent"),m=ft("windowScrollContainerState"),d=ft("scrollContainerState"),f=c||u?m:d,p=pt("itemContent"),h=pt("context"),g=pt("groupContent"),v=pt("trackItemSizes"),C=pt("itemSize"),x=pt("log"),I=ft("gap"),T=S(s,C,v,o?i.noop:f,x,I,c).callbackRef,w=a.useState(0),b=w[0],y=w[1];ht("deviation",function(e){b!==e&&y(e)});var E=pt("EmptyPlaceholder"),H=pt("ScrollSeekPlaceholder")||Ze,L=pt("ListComponent"),R=pt("ItemComponent"),F=pt("GroupComponent"),k=pt("computeItemKey"),z=pt("isSeeking"),B=pt("groupIndices").length>0,P=pt("paddingTopAddition"),O=o?{}:{boxSizing:"border-box",paddingTop:r.offsetTop+P,paddingBottom:r.offsetBottom,marginTop:b};return!o&&0===r.totalCount&&E?n.createElement(E,nt(E,h)):n.createElement(L,l({},nt(L,h),{ref:T,style:O,"data-test-id":o?"virtuoso-top-item-list":"virtuoso-item-list"}),(o?r.topItems:r.items).map(function(e){var t=e.originalIndex,o=k(t+r.firstItemIndex,e.data,h);return z?n.createElement(H,l({},nt(H,h),{key:o,index:e.index,height:e.size,type:e.type||"item"},"group"===e.type?{}:{groupIndex:e.groupIndex})):"group"===e.type?n.createElement(F,l({},nt(F,h),{key:o,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,style:Je}),g(e.index)):n.createElement(R,l({},nt(R,h),{key:o,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,"data-item-group-index":e.groupIndex,style:$e}),B?p(e.index,e.groupIndex,e.data,h):p(e.index,e.data,h))}))}),Xe={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},et={width:"100%",height:"100%",position:"absolute",top:0},tt={width:"100%",position:We(),top:0};function nt(e,t){if("string"!=typeof e)return{context:t}}var ot=a.memo(function(){var e=pt("HeaderComponent"),t=ft("headerHeight"),o=pt("headerFooterTag"),r=v(function(e){return t(C(e,"height"))}),i=pt("context");return e?n.createElement(o,{ref:r},n.createElement(e,nt(e,i))):null}),rt=a.memo(function(){var e=pt("FooterComponent"),t=ft("footerHeight"),o=pt("headerFooterTag"),r=v(function(e){return t(C(e,"height"))}),i=pt("context");return e?n.createElement(o,{ref:r},n.createElement(e,nt(e,i))):null});function it(e){var t=e.usePublisher,o=e.useEmitter,r=e.useEmitterValue;return a.memo(function(e){var i=e.style,a=e.children,u=s(e,Ge),c=t("scrollContainerState"),m=r("ScrollerComponent"),d=t("smoothScrollTargetReached"),f=r("scrollerRef"),p=r("context"),h=I(c,d,m,f),g=h.scrollerRef,v=h.scrollByCallback;return o("scrollTo",h.scrollToCallback),o("scrollBy",v),n.createElement(m,l({ref:g,style:l({},Xe,i),"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0},u,nt(m,p)),a)})}function at(e){var t=e.usePublisher,o=e.useEmitter,r=e.useEmitterValue;return a.memo(function(e){var a=e.style,u=e.children,c=s(e,je),m=t("windowScrollContainerState"),d=r("ScrollerComponent"),p=t("smoothScrollTargetReached"),h=r("totalListHeight"),g=r("deviation"),v=r("customScrollParent"),S=r("context"),C=I(m,p,d,i.noop,v),x=C.scrollerRef,T=C.scrollByCallback,w=C.scrollToCallback;return f(function(){return x.current=v||window,function(){x.current=null}},[x,v]),o("windowScrollTo",w),o("scrollBy",T),n.createElement(d,l({style:l({position:"relative"},a,0!==h?{height:h+g}:{}),"data-virtuoso-scroller":!0},c,nt(d,S)),u)})}var lt=function(e){var t=e.children,o=n.useContext(Ae),r=ft("viewportHeight"),l=ft("fixedItemHeight"),s=v(i.compose(r,function(e){return C(e,"height")}));return a.useEffect(function(){o&&(r(o.viewportHeight),l(o.itemHeight))},[o,r,l]),a.createElement("div",{style:et,ref:s,"data-viewport-type":"element"},t)},st=function(e){var t=e.children,o=n.useContext(Ae),r=ft("windowViewportRect"),i=ft("fixedItemHeight"),l=pt("customScrollParent"),s=Ue(r,l);return a.useEffect(function(){o&&(i(o.itemHeight),r({offsetTop:0,visibleHeight:o.viewportHeight,visibleWidth:100}))},[o,r,i]),a.createElement("div",{ref:s,style:et,"data-viewport-type":"window"},t)},ut=function(e){var t=e.children,o=pt("TopItemListComponent"),r=pt("headerHeight"),i=l({},tt,{marginTop:r+"px"}),a=pt("context");return n.createElement(o||"div",{style:i,context:a},t)},ct=a.memo(function(e){var t=pt("useWindowScroll"),n=pt("topItemsIndexes").length>0,o=pt("customScrollParent"),r=o||t?st:lt;return a.createElement(o||t?vt:gt,l({},e),a.createElement(r,null,a.createElement(ot,null),a.createElement(Qe,null),a.createElement(rt,null)),n&&a.createElement(ut,null,a.createElement(Qe,{showTopList:!0})))}),mt=e.systemToComponent(Ye,{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",react18ConcurrentRendering:"react18ConcurrentRendering",item:"item",group:"group",topItems:"topItems",itemHeight:"itemHeight",scrollingStateChange:"scrollingStateChange",maxHeightCacheSize:"maxHeightCacheSize",footer:"footer",header:"header",ItemContainer:"ItemContainer",ScrollContainer:"ScrollContainer",ListContainer:"ListContainer",GroupContainer:"GroupContainer",emptyComponent:"emptyComponent",HeaderContainer:"HeaderContainer",FooterContainer:"FooterContainer",scrollSeek:"scrollSeek"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",adjustForPrependedItems:"adjustForPrependedItems",autoscrollToBottom:"autoscrollToBottom"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},ct),dt=mt.Component,ft=mt.usePublisher,pt=mt.useEmitterValue,ht=mt.useEmitter,gt=it({usePublisher:ft,useEmitterValue:pt,useEmitter:ht}),vt=at({usePublisher:ft,useEmitterValue:pt,useEmitter:ht}),St={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},Ct={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},xt=Math.round,It=Math.ceil,Tt=Math.floor,wt=Math.min,bt=Math.max;function yt(e,t,n){return Array.from({length:t-e+1}).map(function(t,o){return{index:o+e,data:null==n?void 0:n[o+e]}})}function Et(e,t){return e&&e.column===t.column&&e.row===t.row}var Ht=i.system(function(e){var t=e[0],n=t.overscan,o=t.visibleRange,r=t.listBoundary,a=e[1],s=a.scrollTop,u=a.viewportHeight,c=a.scrollBy,m=a.scrollTo,d=a.smoothScrollTargetReached,f=a.scrollContainerState,p=a.footerHeight,h=a.headerHeight,g=e[2],v=e[3],S=e[4],C=S.propsReady,x=S.didMount,I=e[5],T=I.windowViewportRect,w=I.windowScrollTo,b=I.useWindowScroll,y=I.customScrollParent,E=I.windowScrollContainerState,H=e[6],L=i.statefulStream(0),R=i.statefulStream(0),F=i.statefulStream(St),k=i.statefulStream({height:0,width:0}),z=i.statefulStream({height:0,width:0}),B=i.stream(),P=i.stream(),O=i.statefulStream(0),M=i.statefulStream(void 0),V=i.statefulStream({row:0,column:0});i.connect(i.pipe(i.combineLatest(x,R,M),i.filter(function(e){return 0!==e[1]}),i.map(function(e){return{items:yt(0,e[1]-1,e[2]),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0}})),F),i.connect(i.pipe(i.combineLatest(i.duc(L),o,i.duc(V,Et),i.duc(z,function(e,t){return e&&e.width===t.width&&e.height===t.height}),M),i.withLatestFrom(k),i.map(function(e){var t=e[0],n=t[0],o=t[1],r=o[0],i=o[1],a=t[2],s=t[3],u=t[4],c=e[1],m=a.row,d=a.column,f=s.height,p=s.width,h=c.width;if(0===n||0===h)return St;if(0===p)return function(e){return l({},Ct,{items:e})}(yt(0,0,u));var g=Ft(h,p,d),v=g*Tt((r+m)/(f+m)),S=g*It((i+m)/(f+m))-1;S=wt(n-1,bt(S,g-1));var C=yt(v=wt(S,bt(0,v)),S,u),x=Lt(c,a,s,C),I=x.top,T=x.bottom,w=It(n/g);return{items:C,offsetTop:I,offsetBottom:w*f+(w-1)*m-T,top:I,bottom:T,itemHeight:f,itemWidth:p}})),F),i.connect(i.pipe(M,i.filter(function(e){return void 0!==e}),i.map(function(e){return e.length})),L),i.connect(i.pipe(k,i.map(function(e){return e.height})),u),i.connect(i.pipe(i.combineLatest(k,z,F,V),i.map(function(e){var t=Lt(e[0],e[3],e[1],e[2].items);return[t.top,t.bottom]}),i.distinctUntilChanged(pe)),r);var W=i.streamFromEmitter(i.pipe(i.duc(F),i.filter(function(e){return e.items.length>0}),i.withLatestFrom(L),i.filter(function(e){var t=e[0].items;return t[t.length-1].index===e[1]-1}),i.map(function(e){return e[1]-1}),i.distinctUntilChanged())),U=i.streamFromEmitter(i.pipe(i.duc(F),i.filter(function(e){var t=e.items;return t.length>0&&0===t[0].index}),i.mapTo(0),i.distinctUntilChanged())),A=i.streamFromEmitter(i.pipe(i.duc(F),i.filter(function(e){return e.items.length>0}),i.map(function(e){var t=e.items;return{startIndex:t[0].index,endIndex:t[t.length-1].index}}),i.distinctUntilChanged(he)));i.connect(A,v.scrollSeekRangeChanged),i.connect(i.pipe(B,i.withLatestFrom(k,z,L,V),i.map(function(e){var t=e[1],n=e[2],o=e[3],r=e[4],i=oe(e[0]),a=i.align,l=i.behavior,s=i.offset,u=i.index;"LAST"===u&&(u=o-1);var c=Rt(t,r,n,u=bt(0,u,wt(o-1,u)));return"end"===a?c=xt(c-t.height+n.height):"center"===a&&(c=xt(c-t.height/2+n.height/2)),s&&(c+=s),{top:c,behavior:l}})),m);var N=i.statefulStreamFromEmitter(i.pipe(F,i.map(function(e){return e.offsetBottom+e.bottom})),0);return i.connect(i.pipe(T,i.map(function(e){return{width:e.visibleWidth,height:e.visibleHeight}})),k),l({data:M,totalCount:L,viewportDimensions:k,itemDimensions:z,scrollTop:s,scrollHeight:P,overscan:n,scrollBy:c,scrollTo:m,scrollToIndex:B,smoothScrollTargetReached:d,windowViewportRect:T,windowScrollTo:w,useWindowScroll:b,customScrollParent:y,windowScrollContainerState:E,deviation:O,scrollContainerState:f,footerHeight:p,headerHeight:h,initialItemCount:R,gap:V},v,{gridState:F,totalListHeight:N},g,{startReached:U,endReached:W,rangeChanged:A,propsReady:C},H)},i.tup(Se,T,le,be,se,ze,h));function Lt(e,t,n,o){var r=n.height;return void 0===r||0===o.length?{top:0,bottom:0}:{top:Rt(e,t,n,o[0].index),bottom:Rt(e,t,n,o[o.length-1].index)+r}}function Rt(e,t,n,o){var r=Ft(e.width,n.width,t.column),i=Tt(o/r),a=i*n.height+bt(0,i-1)*t.row;return a>0?a+t.row:a}function Ft(e,t,n){return bt(1,Tt((e+n)/(t+n)))}var kt=["placeholder"],zt=i.system(function(){var e=i.statefulStream(function(e){return"Item "+e}),t=i.statefulStream({}),n=i.statefulStream(null),o=i.statefulStream("virtuoso-grid-item"),r=i.statefulStream("virtuoso-grid-list"),a=i.statefulStream(_e),l=i.statefulStream("div"),s=i.statefulStream(i.noop),u=function(e,n){return void 0===n&&(n=null),i.statefulStreamFromEmitter(i.pipe(t,i.map(function(t){return t[e]}),i.distinctUntilChanged()),n)};return{context:n,itemContent:e,components:t,computeItemKey:a,itemClassName:o,listClassName:r,headerFooterTag:l,scrollerRef:s,FooterComponent:u("Footer"),HeaderComponent:u("Header"),ListComponent:u("List","div"),ItemComponent:u("Item","div"),ScrollerComponent:u("Scroller","div"),ScrollSeekPlaceholder:u("ScrollSeekPlaceholder","div")}}),Bt=i.system(function(e){var t=e[0],n=e[1],o={item:qe(n.itemContent,"Rename the %citem%c prop to %citemContent."),ItemContainer:i.stream(),ScrollContainer:i.stream(),ListContainer:i.stream(),emptyComponent:i.stream(),scrollSeek:i.stream()};function r(e,t,o){i.connect(i.pipe(e,i.withLatestFrom(n.components),i.map(function(e){var n,r=e[0],i=e[1];return console.warn("react-virtuoso: "+o+" property is deprecated. Pass components."+t+" instead."),l({},i,((n={})[t]=r,n))})),n.components)}return i.subscribe(o.scrollSeek,function(e){var o=e.placeholder,r=s(e,kt);console.warn("react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead."),i.publish(n.components,l({},i.getValue(n.components),{ScrollSeekPlaceholder:o})),i.publish(t.scrollSeekConfiguration,r)}),r(o.ItemContainer,"Item","ItemContainer"),r(o.ListContainer,"List","ListContainer"),r(o.ScrollContainer,"Scroller","ScrollContainer"),l({},t,n,o)},i.tup(Ht,zt)),Pt=a.memo(function(){var e=Gt("gridState"),t=Gt("listClassName"),o=Gt("itemClassName"),r=Gt("itemContent"),i=Gt("computeItemKey"),a=Gt("isSeeking"),s=Dt("scrollHeight"),u=Gt("ItemComponent"),c=Gt("ListComponent"),m=Gt("ScrollSeekPlaceholder"),d=Gt("context"),f=Dt("itemDimensions"),p=Dt("gap"),h=Gt("log"),g=v(function(e){s(e.parentElement.parentElement.scrollHeight);var t=e.firstChild;t&&f(t.getBoundingClientRect()),p({row:qt("row-gap",getComputedStyle(e).rowGap,h),column:qt("column-gap",getComputedStyle(e).columnGap,h)})});return n.createElement(c,l({ref:g,className:t},nt(c,d),{style:{paddingTop:e.offsetTop,paddingBottom:e.offsetBottom}}),e.items.map(function(t){var s=i(t.index,t.data,d);return a?n.createElement(m,l({key:s},nt(m,d),{index:t.index,height:e.itemHeight,width:e.itemWidth})):n.createElement(u,l({},nt(u,d),{className:o,"data-index":t.index,key:s}),r(t.index,t.data,d))}))}),Ot=a.memo(function(){var e=Gt("HeaderComponent"),t=Dt("headerHeight"),o=Gt("headerFooterTag"),r=v(function(e){return t(C(e,"height"))}),i=Gt("context");return e?n.createElement(o,{ref:r},n.createElement(e,nt(e,i))):null}),Mt=a.memo(function(){var e=Gt("FooterComponent"),t=Dt("footerHeight"),o=Gt("headerFooterTag"),r=v(function(e){return t(C(e,"height"))}),i=Gt("context");return e?n.createElement(o,{ref:r},n.createElement(e,nt(e,i))):null}),Vt=function(e){var t=e.children,o=n.useContext(Ne),r=Dt("itemDimensions"),i=Dt("viewportDimensions"),l=v(function(e){i(e.getBoundingClientRect())});return a.useEffect(function(){o&&(i({height:o.viewportHeight,width:o.viewportWidth}),r({height:o.itemHeight,width:o.itemWidth}))},[o,i,r]),a.createElement("div",{style:et,ref:l},t)},Wt=function(e){var t=e.children,o=n.useContext(Ne),r=Dt("windowViewportRect"),i=Dt("itemDimensions"),l=Gt("customScrollParent"),s=Ue(r,l);return a.useEffect(function(){o&&(i({height:o.itemHeight,width:o.itemWidth}),r({offsetTop:0,visibleHeight:o.viewportHeight,visibleWidth:o.viewportWidth}))},[o,r,i]),a.createElement("div",{ref:s,style:et},t)},Ut=a.memo(function(e){var t=l({},e),n=Gt("useWindowScroll"),o=Gt("customScrollParent"),r=o||n?Wt:Vt;return a.createElement(o||n?Kt:_t,l({},t),a.createElement(r,null,a.createElement(Ot,null),a.createElement(Pt,null),a.createElement(Mt,null)))}),At=e.systemToComponent(Bt,{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",item:"item",ItemContainer:"ItemContainer",ScrollContainer:"ScrollContainer",ListContainer:"ListContainer",scrollSeek:"scrollSeek"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange"}},Ut),Nt=At.Component,Dt=At.usePublisher,Gt=At.useEmitterValue,jt=At.useEmitter,_t=it({usePublisher:Dt,useEmitterValue:Gt,useEmitter:jt}),Kt=at({usePublisher:Dt,useEmitterValue:Gt,useEmitter:jt});function qt(e,t,n){return"normal"===t||null!=t&&t.endsWith("px")||n(e+" was not resolved to pixel value correctly",t,exports.LogLevel.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}var Yt=i.system(function(){var e=i.statefulStream(function(e){return a.createElement("td",null,"Item $",e)}),t=i.statefulStream(null),n=i.statefulStream(null),o=i.statefulStream(null),r=i.statefulStream({}),l=i.statefulStream(_e),s=i.statefulStream(i.noop),u=function(e,t){return void 0===t&&(t=null),i.statefulStreamFromEmitter(i.pipe(r,i.map(function(t){return t[e]}),i.distinctUntilChanged()),t)};return{context:t,itemContent:e,fixedHeaderContent:n,fixedFooterContent:o,components:r,computeItemKey:l,scrollerRef:s,TableComponent:u("Table","table"),TableHeadComponent:u("TableHead","thead"),TableFooterComponent:u("TableFoot","tfoot"),TableBodyComponent:u("TableBody","tbody"),TableRowComponent:u("TableRow","tr"),ScrollerComponent:u("Scroller","div"),EmptyPlaceholder:u("EmptyPlaceholder"),ScrollSeekPlaceholder:u("ScrollSeekPlaceholder"),FillerRow:u("FillerRow")}}),Zt=i.system(function(e){return l({},e[0],e[1])},i.tup(Ve,Yt)),Jt=function(e){return a.createElement("tr",null,a.createElement("td",{style:{height:e.height}}))},$t=function(e){return a.createElement("tr",null,a.createElement("td",{style:{height:e.height,padding:0,border:0}}))},Qt=a.memo(function(){var e=an("listState"),t=rn("sizeRanges"),o=an("useWindowScroll"),r=an("customScrollParent"),i=rn("windowScrollContainerState"),s=rn("scrollContainerState"),u=r||o?i:s,c=an("itemContent"),m=an("trackItemSizes"),d=S(t,an("itemSize"),m,u,an("log"),void 0,r),f=d.callbackRef,p=d.ref,h=a.useState(0),g=h[0],v=h[1];ln("deviation",function(e){g!==e&&(p.current.style.marginTop=e+"px",v(e))});var C=an("EmptyPlaceholder"),x=an("ScrollSeekPlaceholder")||Jt,I=an("FillerRow")||$t,T=an("TableBodyComponent"),w=an("TableRowComponent"),b=an("computeItemKey"),y=an("isSeeking"),E=an("paddingTopAddition"),H=an("firstItemIndex"),L=an("statefulTotalCount"),R=an("context");if(0===L&&C)return n.createElement(C,nt(C,R));var F=e.offsetTop+E+g,k=e.offsetBottom,z=F>0?a.createElement(I,{height:F,key:"padding-top"}):null,B=k>0?a.createElement(I,{height:k,key:"padding-bottom"}):null,P=e.items.map(function(e){var t=e.originalIndex,o=b(t+H,e.data,R);return y?n.createElement(x,l({},nt(x,R),{key:o,index:e.index,height:e.size,type:e.type||"item"})):n.createElement(w,l({},nt(w,R),{key:o,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,style:{overflowAnchor:"none"}}),c(e.index,e.data,R))});return n.createElement(T,l({ref:f,"data-test-id":"virtuoso-item-list"},nt(T,R)),[z].concat(P,[B]))}),Xt=function(e){var t=e.children,o=n.useContext(Ae),r=rn("viewportHeight"),l=rn("fixedItemHeight"),s=v(i.compose(r,function(e){return C(e,"height")}));return a.useEffect(function(){o&&(r(o.viewportHeight),l(o.itemHeight))},[o,r,l]),a.createElement("div",{style:et,ref:s,"data-viewport-type":"element"},t)},en=function(e){var t=e.children,o=n.useContext(Ae),r=rn("windowViewportRect"),i=rn("fixedItemHeight"),l=an("customScrollParent"),s=Ue(r,l);return a.useEffect(function(){o&&(i(o.itemHeight),r({offsetTop:0,visibleHeight:o.viewportHeight,visibleWidth:100}))},[o,r,i]),a.createElement("div",{ref:s,style:et,"data-viewport-type":"window"},t)},tn=a.memo(function(e){var t=an("useWindowScroll"),n=an("customScrollParent"),o=rn("fixedHeaderHeight"),r=rn("fixedFooterHeight"),s=an("fixedHeaderContent"),u=an("fixedFooterContent"),c=an("context"),m=v(i.compose(o,function(e){return C(e,"height")})),d=v(i.compose(r,function(e){return C(e,"height")})),f=n||t?un:sn,p=n||t?en:Xt,h=an("TableComponent"),g=an("TableHeadComponent"),S=an("TableFooterComponent"),x=s?a.createElement(g,l({key:"TableHead",style:{zIndex:1,position:"sticky",top:0},ref:m},nt(g,c)),s()):null,I=u?a.createElement(S,l({key:"TableFoot",style:{zIndex:1,position:"sticky",bottom:0},ref:d},nt(S,c)),u()):null;return a.createElement(f,l({},e),a.createElement(p,null,a.createElement(h,l({style:{borderSpacing:0}},nt(h,c)),[x,a.createElement(Qt,{key:"TableBody"}),I])))}),nn=e.systemToComponent(Zt,{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",react18ConcurrentRendering:"react18ConcurrentRendering"},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"}},tn),on=nn.Component,rn=nn.usePublisher,an=nn.useEmitterValue,ln=nn.useEmitter,sn=it({usePublisher:rn,useEmitterValue:an,useEmitter:ln}),un=at({usePublisher:rn,useEmitterValue:an,useEmitter:ln}),cn=dt,mn=on,dn=Nt;exports.GroupedVirtuoso=dt,exports.TableVirtuoso=mn,exports.Virtuoso=cn,exports.VirtuosoGrid=dn,exports.VirtuosoGridMockContext=Ne,exports.VirtuosoMockContext=Ae;
//# sourceMappingURL=index.js.map
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),o=require("react-dom");function n(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const o in e)if("default"!==o){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}return t.default=e,Object.freeze(t)}const r=n(t);function i(e,t){return o=>e(t(o))}function l(e,t){return t(e)}function s(e,t){return o=>e(t,o)}function c(e,t){return()=>e(t)}function a(e,t){return t(e),e}function u(...e){return e}function d(e){e()}function f(e){return()=>e}function h(){}function m(e,t){return e(1,t)}function g(e,t){e(0,t)}function p(e){e(2)}function x(e){return e(4)}function v(e,t){return m(e,s(t,0))}function I(e,t){const o=e(1,(e=>{o(),t(e)}));return o}function T(){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 w(e){let t=e;const o=T();return(e,n)=>{switch(e){case 1:n(t);break;case 0:t=n;break;case 4:return t}return o(e,n)}}function C(e){return a(T(),(t=>v(e,t)))}function S(e,t){return a(w(t),(t=>v(e,t)))}function H(e,...t){const o=function(...e){return t=>e.reduceRight(l,t)}(...t);return(t,n)=>{switch(t){case 1:return m(e,o(n));case 2:return void p(e)}}}function y(e,t){return e===t}function b(e=y){let t;return o=>n=>{e(t,n)||(t=n,o(n))}}function E(e){return t=>o=>{e(o)&&t(o)}}function R(e){return t=>i(t,e)}function z(e){return t=>()=>t(e)}function B(e,t){return o=>n=>o(t=e(t,n))}function k(e){return t=>o=>{e>0?e--:t(o)}}function P(e){let t,o;return n=>r=>{t=r,o||(o=setTimeout((()=>{o=void 0,n(t)}),e))}}function O(e){let t,o;return n=>r=>{t=r,o&&clearTimeout(o),o=setTimeout((()=>{n(t)}),e)}}function L(...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);m(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 M(...e){return function(t,o){switch(t){case 1:return function(...e){return()=>{e.map(d)}}(...e.map((e=>m(e,o))));case 2:return;default:throw new Error(`unrecognized action ${t}`)}}}function W(e,t=y){return H(e,b(t))}function j(...e){const t=T(),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);m(e,(e=>{o[i]=e,n|=l,n===r&&g(t,o)}))})),function(e,i){switch(e){case 1:return n===r&&i(o),m(t,i);case 2:return p(t);default:throw new Error(`unrecognized action ${e}`)}}}function V(e,t=[],{singleton:o}={singleton:!0}){return{id:F(),constructor:e,dependencies:t,singleton:o}}const F=()=>Symbol();const A="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;function D(e,o,n){const i=Object.keys(o.required||{}),l=Object.keys(o.optional||{}),u=Object.keys(o.methods||{}),d=Object.keys(o.events||{}),v=t.createContext({});function I(e,t){e.propsReady&&g(e.propsReady,!1);for(const n of i){g(e[o.required[n]],t[n])}for(const n of l)if(n in t){g(e[o.optional[n]],t[n])}e.propsReady&&g(e.propsReady,!0)}function T(e){return d.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=m(e,i),t}return n(),h;case 2:return n(),void(o=null);default:throw new Error(`unrecognized action ${r}`)}}}(e[o.events[n]]),t)),{})}const w=t.forwardRef(((r,s)=>{const{children:h,...x}=r,[w]=t.useState((()=>a(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)}(e),(e=>I(e,x))))),[C]=t.useState(c(T,w));return A((()=>{for(const e of d)e in x&&m(C[e],x[e]);return()=>{Object.values(C).map(p)}}),[x,C,w]),A((()=>{I(w,x)})),t.useImperativeHandle(s,f(function(e){return u.reduce(((t,n)=>(t[n]=t=>{g(e[o.methods[n]],t)},t)),{})}(w))),t.createElement(v.Provider,{value:w},n?t.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}([...i,...l,...d],x),h):h)}));return{Component:w,usePublisher:e=>t.useCallback(s(g,r.useContext(v)[e]),[e]),useEmitterValue:e=>{const o=t.useContext(v)[e],[n,r]=t.useState(c(x,o));return A((()=>m(o,(e=>{e!==n&&r(f(e))}))),[o,n]),n},useEmitter:(e,o)=>{const n=t.useContext(v)[e];A((()=>m(n,o)),[o,n])}}}const G="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;var N=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(N||{});const _={0:"debug",1:"log",2:"warn",3:"error"},U=V((()=>{const e=w(3);return{log:w(((t,o,n=1)=>{n>=(("undefined"==typeof globalThis?window:globalThis).VIRTUOSO_LOG_LEVEL??x(e))&&console[_[n]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,o)})),logLevel:e}}),[],{singleton:!0});function $(e,o=!0){const n=t.useRef(null);let r=e=>{};if("undefined"!=typeof ResizeObserver){const t=new ResizeObserver((t=>{const o=t[0].target;null!==o.offsetParent&&e(o)}));r=e=>{e&&o?(t.observe(e),n.current=e):(n.current&&t.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function K(e,t=!0){return $(e,t).callbackRef}function q(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},N.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.firstElementChild.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,N.WARN);if("normal"===t)return 0;return parseInt(t??"0",10)}("row-gap",getComputedStyle(o).rowGap,r)),null!==s&&e(s)}),o)}function Y(e,t){return Math.round(e.getBoundingClientRect()[t])}function Z(e,t){return Math.abs(e-t)<1.01}function J(e,n,r,i=h,l){const s=t.useRef(null),c=t.useRef(null),a=t.useRef(null),u=t.useCallback((t=>{const r=t.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=()=>{e({scrollTop:Math.max(l,0),scrollHeight:s,viewportHeight:u})};t.suppressFlushSync?d():o.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))}),[e,n]);return t.useEffect((()=>{const e=l||s.current;return i(l||s.current),u({target:e,suppressFlushSync:!0}),e.addEventListener("scroll",u,{passive:!0}),()=>{i(null),e.removeEventListener("scroll",u)}}),[s,u,r,i,l]),{scrollerRef:s,scrollByCallback:function(e){s.current.scrollBy(e)},scrollToCallback:function(t){const o=s.current;if(!o||"offsetHeight"in o&&0===o.offsetHeight)return;const r="smooth"===t.behavior;let i,l,u;o===window?(l=Math.max(Y(document.documentElement,"height"),document.documentElement.scrollHeight),i=window.innerHeight,u=document.documentElement.scrollTop):(l=o.scrollHeight,i=Y(o,"height"),u=o.scrollTop);const d=l-i;if(t.top=Math.ceil(Math.max(Math.min(d,t.top),0)),Z(i,l)||t.top===u)return e({scrollTop:u,scrollHeight:l,viewportHeight:i}),void(r&&n(!0));r?(c.current=t.top,a.current&&clearTimeout(a.current),a.current=setTimeout((()=>{a.current=null,c.current=null,n(!0)}),1e3)):c.current=null,o.scrollTo(t)}}}const Q=V((()=>{const e=T(),t=T(),o=w(0),n=T(),r=w(0),i=T(),l=T(),s=w(0),c=w(0),a=w(0),u=w(0),d=T(),f=T(),h=w(!1);return v(H(e,R((({scrollTop:e})=>e))),t),v(H(e,R((({scrollHeight:e})=>e))),l),v(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:h}}),[],{singleton:!0}),X={lvl:0};function ee(e,t,o,n=X,r=X){return{k:e,v:t,lvl:o,l:n,r:r}}function te(e){return e===X}function oe(){return X}function ne(e,t){if(te(e))return X;const{k:o,l:n,r:r}=e;if(t===o){if(te(n))return r;if(te(r))return n;{const[t,o]=ce(n);return he(ue(e,{k:t,v:o,l:ae(n)}))}}return he(ue(e,t<o?{l:ne(n,t)}:{r:ne(r,t)}))}function re(e,t,o="k"){if(te(e))return[-1/0,void 0];if(e[o]===t)return[e.k,e.v];if(e[o]<t){const n=re(e.r,t,o);return n[0]===-1/0?[e.k,e.v]:n}return re(e.l,t,o)}function ie(e,t,o){return te(e)?ee(t,o,1):t===e.k?ue(e,{k:t,v:o}):t<e.k?fe(ue(e,{l:ie(e.l,t,o)})):fe(ue(e,{r:ie(e.r,t,o)}))}function le(e,t,o){if(te(e))return[];const{k:n,v:r,l:i,r:l}=e;let s=[];return n>t&&(s=s.concat(le(i,t,o))),n>=t&&n<=o&&s.push({k:n,v:r}),n<=o&&(s=s.concat(le(l,t,o))),s}function se(e){return te(e)?[]:[...se(e.l),{k:e.k,v:e.v},...se(e.r)]}function ce(e){return te(e.r)?[e.k,e.v]:ce(e.r)}function ae(e){return te(e.r)?e.l:he(ue(e,{r:ae(e.r)}))}function ue(e,t){return ee(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 de(e){return te(e)||e.lvl>e.r.lvl}function fe(e){return pe(xe(e))}function he(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(de(t))return xe(ue(e,{lvl:n-1}));if(te(t)||te(t.r))throw new Error("Unexpected empty nodes");return ue(t.r,{l:ue(t,{r:t.r.l}),r:ue(e,{l:t.r.r,lvl:n-1}),lvl:n})}if(de(e))return pe(ue(e,{lvl:n-1}));if(te(o)||te(o.l))throw new Error("Unexpected empty nodes");{const t=o.l,r=de(t)?o.lvl-1:o.lvl;return ue(t,{l:ue(e,{r:t.l,lvl:n-1}),r:pe(ue(o,{l:t.r,lvl:r})),lvl:t.lvl+1})}}function me(e,t,o){if(te(e))return[];const n=re(e,t)[0];return ge(le(e,n,o),(({k:e,v:t})=>({index:e,value:t})))}function ge(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 pe(e){const{r:t,lvl:o}=e;return te(t)||te(t.r)||t.lvl!==o||t.r.lvl!==o?e:ue(t,{l:ue(e,{r:t.l}),lvl:o+1})}function xe(e){const{l:t}=e;return te(t)||t.lvl!==e.lvl?e:ue(t,{r:ue(e,{l:t.r})})}function ve(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 Ie(e,t,o){return e[ve(e,t,o)]}const Te=V((()=>({recalcInProgress:w(!1)})),[],{singleton:!0});function we(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 Ce({index:e},t){return t===e?0:t<e?-1:1}function Se({offset:e},t){return t===e?0:t<e?-1:1}function He(e){return{index:e.index,value:e}}function ye(e,t,o,n=0){return n>0&&(t=Math.max(t,Ie(e,n,Ce).offset)),ge(function(e,t,o,n){const r=ve(e,t,n),i=ve(e,o,n,r);return e.slice(r,i+1)}(e,t,o,Se),He)}function be(e,t,o,n){let r=e,i=0,l=0,s=0,c=0;if(0!==t){c=ve(r,t-1,Ce);s=r[c].offset;const e=re(o,t-1);i=e[0],l=e[1],r.length&&r[c].size===re(o,t)[1]&&(c-=1),r=r.slice(0,c+1)}else r=[];for(const{start:a,value:u}of me(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,N.DEBUG);const i=e.sizeTree;let l=i,s=0;if(o.length>0&&te(i)&&2===t.length){const e=t[0].size,n=t[1].size;l=o.reduce(((t,o)=>ie(ie(t,o,e),o+1,n)),l)}else[l,s]=function(e,t){let o=te(e)?0:1/0;for(const n of t){const{size:t,startIndex:r,endIndex:i}=n;if(o=Math.min(o,r),te(e)){e=ie(e,0,t);continue}const l=me(e,r-1,i+1);if(l.some(we(n)))continue;let s=!1,c=!1;for(const{start:o,end:n,value:a}of l)s?(i>=o||t===a)&&(e=ne(e,o)):(c=a!==t,s=!0),n>i&&i>=o&&a!==t&&(e=ie(e,i+1,a));c&&(e=ie(e,r,t))}return[e,o]}(l,t);if(l===i)return e;const{offsetTree:c,lastIndex:a,lastSize:u,lastOffset:d}=be(e.offsetTree,s,l,r);return{sizeTree:l,offsetTree:c,lastIndex:a,lastOffset:d,lastSize:u,groupOffsetTree:o.reduce(((e,t)=>ie(e,t,Re(t,c,r))),oe()),groupIndices:o}}function Re(e,t,o){if(0===t.length)return 0;const{offset:n,index:r,size:i}=Ie(t,e,Ce),l=e-r,s=i*l+(l-1)*o+n;return s>0?s+o:s}function ze(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(!ke(t))return e;let o=0;for(;t.groupIndices[o]<=e+o;)o++;return e+o}function ke(e){return!te(e.groupOffsetTree)}const Pe={offsetHeight:"height",offsetWidth:"width"},Oe=V((([{log:e},{recalcInProgress:t}])=>{const o=T(),n=T(),r=S(n,0),i=T(),l=T(),s=w(0),c=w([]),a=w(void 0),u=w(void 0),d=w(((e,t)=>Y(e,Pe[t]))),f=w(void 0),h=w(0),p={offsetTree:[],sizeTree:oe(),groupOffsetTree:oe(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]},I=S(H(o,L(c,e,h),B(Ee,p),b()),p);v(H(c,E((e=>e.length>0)),L(I,h),R((([e,t,o])=>{const n=e.reduce(((e,n,r)=>ie(e,n,Re(n,t.offsetTree,o)||r)),oe());return{...t,groupIndices:e,groupOffsetTree:n}}))),I),v(H(n,L(I),E((([e,{lastIndex:t}])=>e<t)),R((([e,{lastIndex:t,lastSize:o}])=>[{startIndex:e,endIndex:t,size:o}]))),o),v(a,u);const y=S(H(a,R((e=>void 0===e))),!0);v(H(u,E((e=>void 0!==e&&te(x(I).sizeTree))),R((e=>[{startIndex:0,endIndex:0,size:e}]))),o);const z=C(H(o,L(I),B((({sizes:e},[t,o])=>({changed:o!==e,sizes:o})),{changed:!1,sizes:p}),R((e=>e.changed))));m(H(s,B(((e,t)=>({diff:e.prev-t,prev:t})),{diff:0,prev:0}),R((e=>e.diff))),(e=>{e>0?(g(t,!0),g(i,e)):e<0&&g(l,e)})),m(H(s,L(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},N.ERROR)}));const k=C(i);v(H(i,L(I),R((([e,t])=>{if(t.groupIndices.length>0)throw new Error("Virtuoso: prepending items does not work with groups");return se(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 P=C(H(l,L(I,h),R((([e,{offsetTree:t},o])=>Re(-e,t,o)))));return v(H(l,L(I,h),R((([e,t,o])=>{if(t.groupIndices.length>0)throw new Error("Virtuoso: shifting items does not work with groups");const n=se(t.sizeTree).reduce(((t,{k:o,v:n})=>ie(t,Math.max(0,o+e),n)),oe());return{...t,sizeTree:n,...be(t.offsetTree,0,n,o)}}))),I),{data:f,totalCount:n,sizeRanges:o,groupIndices:c,defaultItemSize:u,fixedItemSize:a,unshiftWith:i,shiftWith:l,shiftWithOffset:P,beforeUnshiftWith:k,firstItemIndex:s,gap:h,sizes:I,listRefresh:z,statefulTotalCount:r,trackItemSizes:y,itemSize:d}}),u(U,Te),{singleton:!0}),Le="undefined"!=typeof document&&"scrollBehavior"in document.documentElement.style;function Me(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),t.behavior&&Le||(t.behavior="auto"),t.offset||(t.offset=0),t}const We=V((([{sizes:e,totalCount:t,listRefresh:o,gap:n},{scrollingInProgress:r,viewportHeight:i,scrollTo:l,smoothScrollTargetReached:s,headerHeight:c,footerHeight:a,fixedHeaderHeight:u,fixedFooterHeight:d},{log:f}])=>{const h=T(),p=w(0);let x=null,C=null,S=null;function y(){x&&(x(),x=null),S&&(S(),S=null),C&&(clearTimeout(C),C=null),g(r,!1)}return v(H(h,L(e,i,t,p,c,a,f),L(n,u,d),R((([[e,t,n,i,l,c,a,u],d,f,p])=>{const v=Me(e),{align:T,behavior:w,offset:b}=v,E=i-1,R=ze(v,t,E);let z=Re(R,t.offsetTree,d)+c;"end"===T?(z+=f+re(t.sizeTree,R)[1]-n+p,R===E&&(z+=a)):"center"===T?z+=(f+re(t.sizeTree,R)[1]-n+p)/2:z-=l,b&&(z+=b);const B=t=>{y(),t?(u("retrying to scroll to",{location:e},N.DEBUG),g(h,e)):u("list did not change, scroll successful",{},N.DEBUG)};if(y(),"smooth"===w){let e=!1;S=m(o,(t=>{e=e||t})),x=I(s,(()=>{B(e)}))}else x=I(H(o,(k=150,e=>{const t=setTimeout((()=>{e(!1)}),k);return o=>{o&&(e(!0),clearTimeout(t))}})),B);var k;return C=setTimeout((()=>{y()}),1200),g(r,!0),u("scrolling from index to",{index:R,top:z,behavior:w},N.DEBUG),{top:z,behavior:w}}))),l),{scrollToIndex:h,topListHeight:p}}),u(Oe,Q,U),{singleton:!0});const je="up",Ve="down",Fe={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},Ae=V((([{scrollContainerState:e,scrollTop:t,viewportHeight:o,headerHeight:n,footerHeight:r,scrollBy:i}])=>{const l=w(!1),s=w(!0),c=T(),a=T(),u=w(4),d=w(0),f=S(H(M(H(W(t),k(1),z(!0)),H(W(t),k(1),z(!1),O(100))),b()),!1),h=S(H(M(H(i,z(!0)),H(i,z(!1),O(200))),b()),!1);v(H(j(W(t),W(d)),R((([e,t])=>e<=t)),b()),s),v(H(s,P(50)),a);const m=C(H(j(e,W(o),W(n),W(r),W(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}}),Fe),b(((e,t)=>e&&e.atBottom===t.atBottom)))),g=S(H(e,B(((e,{scrollTop:t,scrollHeight:o,viewportHeight:n})=>{if(Z(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)),R((e=>e.jump))),0);v(H(m,R((e=>e.atBottom))),l),v(H(l,P(50)),c);const p=w(Ve);v(H(e,R((({scrollTop:e})=>e)),b(),B(((e,t)=>x(h)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?je:Ve,prevScrollTop:t}),{direction:Ve,prevScrollTop:0}),R((e=>e.direction))),p),v(H(e,P(50),z("none")),p);const I=w(0);return v(H(f,E((e=>!e)),z(0)),I),v(H(t,P(100),L(f),E((([e,t])=>!!t)),B((([e,t],[o])=>[t,o]),[0,0]),R((([e,t])=>t-e))),I),{isScrolling:f,isAtTop:s,isAtBottom:l,atBottomState:m,atTopStateChange:a,atBottomStateChange:c,scrollDirection:p,atBottomThreshold:u,atTopThreshold:d,scrollVelocity:I,lastJumpDueToItemResize:g}}),u(Q)),De=V((([{log:e}])=>{const t=w(!1),o=C(H(t,E((e=>e)),b()));return m(t,(t=>{t&&x(e)("props updated",{},N.DEBUG)})),{propsReady:t,didMount:o}}),u(U),{singleton:!0});const Ge=V((([{sizes:e,listRefresh:t,defaultItemSize:o},{scrollTop:n},{scrollToIndex:r},{didMount:i}])=>{const l=w(!0),s=w(0);return v(H(i,L(s),E((([e,t])=>!!t)),z(!1)),l),m(H(j(t,i),L(l,e,o),E((([[,e],t,{sizeTree:o},n])=>e&&(!te(o)||void 0!==n)&&!t)),L(s)),(([,e])=>{setTimeout((()=>{I(n,(()=>{g(l,!0)})),g(r,e)}))})),{scrolledToInitialItem:l,initialTopMostItemIndex:s}}),u(Oe,Q,We,De),{singleton:!0});function Ne(e){return!!e&&("smooth"===e?"smooth":"auto")}const _e=V((([{totalCount:e,listRefresh:t},{isAtBottom:o,atBottomState:n},{scrollToIndex:r},{scrolledToInitialItem:i},{propsReady:l,didMount:s},{log:c},{scrollingInProgress:a}])=>{const u=w(!1),d=T();let f=null;function h(e){g(r,{index:"LAST",align:"end",behavior:e})}function p(e){const t=I(n,(t=>{!e||t.atBottom||"SIZE_INCREASED"!==t.notAtBottomBecause||f||(x(c)("scrolling to bottom due to increased size",{},N.DEBUG),h("auto"))}));setTimeout(t,100)}return m(H(j(H(W(e),k(1)),s),L(W(u),o,i,a),R((([[e,t],o,n,r,i])=>{let l=t&&r,s="auto";return l&&(s=((e,t)=>"function"==typeof e?Ne(e(t)):t&&Ne(e))(o,n||i),l=l&&!!s),{totalCount:e,shouldFollow:l,followOutputBehavior:s}})),E((({shouldFollow:e})=>e))),(({totalCount:e,followOutputBehavior:o})=>{f&&(f(),f=null),f=I(t,(()=>{x(c)("following output to ",{totalCount:e},N.DEBUG),h(o),f=null}))})),m(H(j(W(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)),L(u,e)),(([,e])=>{p(!1!==e)})),m(d,(()=>{p(!1!==x(u))})),m(j(W(u),n),(([e,t])=>{e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&h("auto")})),{followOutput:u,autoscrollToBottom:d}}),u(Oe,Ae,We,Ge,De,U,Q));function Ue(e){return e.reduce(((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e)),{totalCount:0,groupIndices:[]})}const $e=V((([{totalCount:e,groupIndices:t,sizes:o},{scrollTop:n,headerHeight:r}])=>{const i=T(),l=T(),s=C(H(i,R(Ue)));return v(H(s,R((e=>e.totalCount))),e),v(H(s,R((e=>e.groupIndices))),t),v(H(j(n,o,r),E((([e,t])=>ke(t))),R((([e,t,o])=>re(t.groupOffsetTree,Math.max(e-o,0),"v")[0])),b(),R((e=>[e]))),l),{groupCounts:i,topItemsIndexes:l}}),u(Oe,Q));function Ke(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}function qe(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}const Ye="top",Ze="bottom",Je="none";function Qe(e,t,o){return"number"==typeof e?o===je&&t===Ye||o===Ve&&t===Ze?e:0:o===je?t===Ye?e.main:e.reverse:t===Ze?e.main:e.reverse}function Xe(e,t){return"number"==typeof e?e:e[t]||0}const et=V((([{scrollTop:e,viewportHeight:t,deviation:o,headerHeight:n,fixedHeaderHeight:r}])=>{const i=T(),l=w(0),s=w(0),c=w(0);return{listBoundary:i,overscan:c,topListHeight:l,increaseViewportBy:s,visibleRange:S(H(j(W(e),W(t),W(n),W(i,Ke),W(c),W(l),W(r),W(o),W(s)),R((([e,t,o,[n,r],i,l,s,c,a])=>{const u=e-c,d=l+s,f=Math.max(o-u,0);let h=Je;const m=Xe(a,Ye),g=Xe(a,Ze);return n-=c,r+=o+s,(n+=o+s)>e+d-m&&(h=je),(r-=c)<e-f+t+g&&(h=Ve),h!==Je?[Math.max(u-o-Qe(i,Ye,h)-m,0),u-f-s+t+Qe(i,Ze,h)+g]:null})),E((e=>null!=e)),b(Ke)),[0,0])}}),u(Q),{singleton:!0});const tt={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function ot(e,t,o){if(0===e.length)return[];if(!ke(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=me(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 nt(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,h=s+d*l+(d-1)*n-u;return{items:ot(e,r,i),topItems:ot(t,r,i),topListHeight:t.reduce(((e,t)=>t.size+e),0),offsetTop:a,offsetBottom:h,top:f,bottom:u,totalCount:o,firstItemIndex:i}}const rt=V((([{sizes:e,totalCount:t,data:o,firstItemIndex:n,gap:r},i,{visibleRange:l,listBoundary:s,topListHeight:c},{scrolledToInitialItem:u,initialTopMostItemIndex:d},{topListHeight:f},h,{didMount:m},{recalcInProgress:g}])=>{const p=w([]),x=T();v(i.topItemsIndexes,p);const I=S(H(j(m,g,W(l,Ke),W(t),W(e),W(d),u,W(p),W(n),W(r),o),E((([e,t])=>e&&!t)),R((([,,[e,t],o,n,r,i,l,s,c,u])=>{const d=n,{sizeTree:f,offsetTree:h}=d;if(0===o||0===e&&0===t)return{...tt,totalCount:o};if(te(f))return nt(function(e,t,o){if(ke(t)){const n=Be(e,t);return[{index:re(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,c,d,s);const m=[];if(l.length>0){const e=l[0],t=l[l.length-1];let o=0;for(const n of me(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++)m.push({index:e,size:r,offset:o,data:u&&u[e]}),o+=r}}if(!i)return nt([],m,o,c,d,s);const g=l.length>0?l[l.length-1]+1:0,p=ye(h,e,t,g);if(0===p.length)return null;const x=o-1;return nt(a([],(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+c)/(s+c));const t=l-n.start;i+=t*s+t*c}l<g&&(i+=(g-l)*s,l=g);const a=Math.min(n.end,x);for(let e=l;e<=a&&!(i>=t);e++)o.push({index:e,size:s,offset:i,data:u&&u[e]}),i+=s+c}})),m,o,c,d,s)})),E((e=>null!==e)),b()),tt);v(H(o,E((e=>void 0!==e)),R((e=>null==e?void 0:e.length))),t),v(H(I,R((e=>e.topListHeight))),f),v(f,c),v(H(I,R((e=>[e.top,e.bottom]))),s),v(H(I,R((e=>e.items))),x);return{listState:I,topItemsIndexes:p,endReached:C(H(I,E((({items:e})=>e.length>0)),L(t,o),E((([{items:e},t])=>e[e.length-1].originalIndex===t-1)),R((([,e,t])=>[e-1,t])),b(Ke),R((([e])=>e)))),startReached:C(H(I,P(200),E((({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length)),R((({items:e})=>e[0].index)),b())),rangeChanged:C(H(I,E((({items:e})=>e.length>0)),R((({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}})),b(qe))),itemsRendered:x,...h}}),u(Oe,$e,et,Ge,We,Ae,De,Te),{singleton:!0}),it=V((([{sizes:e,firstItemIndex:t,data:o,gap:n},{listState:r},{didMount:i}])=>{const l=w(0);return v(H(i,L(l),E((([,e])=>0!==e)),L(e,t,n,o),R((([[,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 nt(Array.from({length:l}).map(((e,t)=>({index:t,size:0,offset:0,data:r[t]}))),[],l,n,t,o)}))),r),{initialItemCount:l}}),u(Oe,rt,De),{singleton:!0}),lt=V((([{scrollVelocity:e}])=>{const t=w(!1),o=T(),n=w(!1);return v(H(e,L(n,t,o),E((([e,t])=>!!t)),R((([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})),b()),t),m(H(j(t,e,o),L(n)),(([[e,t,o],n])=>e&&n&&n.change&&n.change(t,o))),{isSeeking:t,scrollSeekConfiguration:n,scrollVelocity:e,scrollSeekRangeChanged:o}}),u(Ae),{singleton:!0}),st=V((([{topItemsIndexes:e}])=>{const t=w(0);return v(H(t,E((e=>e>0)),R((e=>Array.from({length:e}).map(((e,t)=>t))))),e),{topItemCount:t}}),u(rt)),ct=V((([{footerHeight:e,headerHeight:t,fixedHeaderHeight:o,fixedFooterHeight:n},{listState:r}])=>{const i=T(),l=S(H(j(e,n,t,o,r),R((([e,t,o,n,r])=>e+t+o+n+r.offsetBottom+r.bottom))),0);return v(W(l),i),{totalListHeight:l,totalListHeightChanged:i}}),u(Q,rt),{singleton:!0});function at(e){let t,o=!1;return()=>(o||(o=!0,t=e()),t)}const ut=at((()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent))),dt=V((([{scrollBy:e,scrollTop:t,deviation:o,scrollingInProgress:n},{isScrolling:r,isAtBottom:i,scrollDirection:l,lastJumpDueToItemResize:s},{listState:c},{beforeUnshiftWith:a,shiftWithOffset:u,sizes:d,gap:f},{log:h},{recalcInProgress:p}])=>{const x=C(H(c,L(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)),L(t,l,n,i,h),E((([,e,t,o])=>!o&&0!==e&&t===je)),R((([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},N.DEBUG),e)))));function I(t){t>0?(g(e,{top:-t,behavior:"auto"}),g(o,0)):(g(o,0),g(e,{top:-t,behavior:"auto"}))}return m(H(x,L(o,r)),(([e,t,n])=>{n&&ut()?g(o,t-e):I(-e)})),m(H(j(S(r,!1),o,p),E((([e,t,o])=>!e&&!o&&0!==t)),R((([e,t])=>t)),P(1)),I),v(H(u,R((e=>({top:-e})))),e),m(H(a,L(d,f),R((([e,{lastSize:t},o])=>e*t+e*o))),(t=>{g(o,t),requestAnimationFrame((()=>{g(e,{top:t}),requestAnimationFrame((()=>{g(o,0),g(p,!1)}))}))})),{deviation:o}}),u(Q,Ae,rt,Oe,U,Te)),ft=V((([{totalListHeight:e},{didMount:t},{scrollTo:o}])=>{const n=w(0);return m(H(t,L(n),E((([,e])=>0!==e)),R((([,e])=>({top:e})))),(t=>{I(H(e,E((e=>0!==e))),(()=>{setTimeout((()=>{g(o,t)}))}))})),{initialScrollTop:n}}),u(ct,De,Q),{singleton:!0}),ht=V((([{viewportHeight:e},{totalListHeight:t}])=>{const o=w(!1);return{alignToBottom:o,paddingTopAddition:S(H(j(o,e,t),E((([e])=>e)),R((([,e,t])=>Math.max(0,e-t))),b()),0)}}),u(Q,ct),{singleton:!0}),mt=V((([{scrollTo:e,scrollContainerState:t}])=>{const o=T(),n=T(),r=T(),i=w(!1),l=w(void 0);return v(H(j(o,n),R((([{viewportHeight:e,scrollTop:t,scrollHeight:o},{offsetTop:n}])=>({scrollTop:Math.max(0,t-n),scrollHeight:o,viewportHeight:e})))),t),v(H(e,L(n),R((([e,{offsetTop:t}])=>({...e,top:e.top+t})))),r),{useWindowScroll:i,customScrollParent:l,windowScrollContainerState:o,windowViewportRect:n,windowScrollTo:r}}),u(Q)),gt=V((([{sizes:e,totalCount:t,gap:o},{scrollTop:n,viewportHeight:r,headerHeight:i,fixedHeaderHeight:l,fixedFooterHeight:s,scrollingInProgress:c},{scrollToIndex:a}])=>{const u=T();return v(H(u,L(e,r,t,i,l,s,n),L(o),R((([[e,t,o,n,r,i,l,s],a])=>{const{done:u,behavior:d,align:f,...h}=e;let m=null;const g=ze(e,t,n-1),p=Re(g,t.offsetTree,a)+r+i;if(p<s+i)m={...h,behavior:d,align:f??"start"};else{p+re(t.sizeTree,g)[1]>s+o-l&&(m={...h,behavior:d,align:f??"end"})}return m?u&&I(H(c,k(1),E((e=>!1===e))),u):u&&u(),m})),E((e=>null!==e))),a),{scrollIntoView:u}}),u(Oe,Q,We,rt,U),{singleton:!0}),pt=V((([e,t,o,n,r,i,l,s,c])=>({...e,...t,...o,...n,...r,...i,...l,...s,...c})),u(et,it,De,lt,ct,ft,ht,mt,gt)),xt=V((([{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},h,m,{listState:g,topItemsIndexes:p,...x},{scrollToIndex:I},T,{topItemCount:w},{groupCounts:C},S,y])=>(v(x.rangeChanged,S.scrollSeekRangeChanged),v(H(S.windowViewportRect,R((e=>e.visibleHeight))),h.viewportHeight),{totalCount:e,data:l,firstItemIndex:s,sizeRanges:t,initialTopMostItemIndex:d,scrolledToInitialItem:f,topItemsIndexes:p,topItemCount:w,groupCounts:C,fixedItemHeight:o,defaultItemHeight:n,gap:u,...m,statefulTotalCount:a,listState:g,scrollToIndex:I,trackItemSizes:r,itemSize:i,groupIndices:c,...x,...S,...h,...y})),u(Oe,Ge,Q,_e,rt,We,dt,st,$e,pt,U)),vt="-webkit-sticky",It="sticky",Tt=at((()=>{if("undefined"==typeof document)return It;const e=document.createElement("div");return e.style.position=vt,e.style.position===vt?vt:It}));function wt(e,o){const n=t.useRef(null),r=t.useCallback((t=>{if(null===t||!t.offsetParent)return;const r=t.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},e(n.current)}),[e,o]),{callbackRef:i,ref:l}=$(r),s=t.useCallback((()=>{r(l.current)}),[r,l]);return t.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 Ct=r.createContext(void 0),St=r.createContext(void 0);function Ht(e){return e}const yt=V((([e,t])=>({...e,...t})),u(xt,V((()=>{const e=w((e=>`Item ${e}`)),t=w(null),o=w((e=>`Group ${e}`)),n=w({}),r=w(Ht),i=w("div"),l=w(h),s=(e,t=null)=>S(H(n,R((t=>t[e])),b()),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")}})))),bt=({height:t})=>e.jsx("div",{style:{height:t}}),Et={position:Tt(),zIndex:1,overflowAnchor:"none"},Rt={overflowAnchor:"none"},zt=r.memo((function({showTopList:e=!1}){const o=_t("listState"),n=Nt("sizeRanges"),i=_t("useWindowScroll"),l=_t("customScrollParent"),s=Nt("windowScrollContainerState"),c=Nt("scrollContainerState"),a=l||i?s:c,u=_t("itemContent"),d=_t("context"),f=_t("groupContent"),m=_t("trackItemSizes"),g=_t("itemSize"),p=_t("log"),x=Nt("gap"),{callbackRef:v}=q(n,g,m,e?h:a,p,x,l),[I,T]=r.useState(0);Ut("deviation",(e=>{I!==e&&T(e)}));const w=_t("EmptyPlaceholder"),C=_t("ScrollSeekPlaceholder")||bt,S=_t("ListComponent"),H=_t("ItemComponent"),y=_t("GroupComponent"),b=_t("computeItemKey"),E=_t("isSeeking"),R=_t("groupIndices").length>0,z=_t("paddingTopAddition"),B=e?{}:{boxSizing:"border-box",paddingTop:o.offsetTop+z,paddingBottom:o.offsetBottom,marginTop:I};return!e&&0===o.totalCount&&w?t.createElement(w,Ot(w,d)):t.createElement(S,{...Ot(S,d),ref:v,style:B,"data-test-id":e?"virtuoso-top-item-list":"virtuoso-item-list"},(e?o.topItems:o.items).map((e=>{const n=e.originalIndex,r=b(n+o.firstItemIndex,e.data,d);return E?t.createElement(C,{...Ot(C,d),key:r,index:e.index,height:e.size,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?t.createElement(y,{...Ot(y,d),key:r,"data-index":n,"data-known-size":e.size,"data-item-index":e.index,style:Et},f(e.index)):t.createElement(H,{...Ot(H,d),key:r,"data-index":n,"data-known-size":e.size,"data-item-index":e.index,"data-item-group-index":e.groupIndex,item:e.data,style:Rt},R?u(e.index,e.groupIndex,e.data,d):u(e.index,e.data,d))})))})),Bt={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},kt={width:"100%",height:"100%",position:"absolute",top:0},Pt={width:"100%",position:Tt(),top:0,zIndex:1};function Ot(e,t){if("string"!=typeof e)return{context:t}}const Lt=r.memo((function(){const e=_t("HeaderComponent"),o=Nt("headerHeight"),n=_t("headerFooterTag"),r=K((e=>o(Y(e,"height")))),i=_t("context");return e?t.createElement(n,{ref:r},t.createElement(e,Ot(e,i))):null})),Mt=r.memo((function(){const e=_t("FooterComponent"),o=Nt("footerHeight"),n=_t("headerFooterTag"),r=K((e=>o(Y(e,"height")))),i=_t("context");return e?t.createElement(n,{ref:r},t.createElement(e,Ot(e,i))):null}));function Wt({usePublisher:e,useEmitter:o,useEmitterValue:n}){return r.memo((function({style:r,children:i,...l}){const s=e("scrollContainerState"),c=n("ScrollerComponent"),a=e("smoothScrollTargetReached"),u=n("scrollerRef"),d=n("context"),{scrollerRef:f,scrollByCallback:h,scrollToCallback:m}=J(s,a,c,u);return o("scrollTo",m),o("scrollBy",h),t.createElement(c,{ref:f,style:{...Bt,...r},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...l,...Ot(c,d)},i)}))}function jt({usePublisher:e,useEmitter:o,useEmitterValue:n}){return r.memo((function({style:r,children:i,...l}){const s=e("windowScrollContainerState"),c=n("ScrollerComponent"),a=e("smoothScrollTargetReached"),u=n("totalListHeight"),d=n("deviation"),f=n("customScrollParent"),m=n("context"),{scrollerRef:g,scrollByCallback:p,scrollToCallback:x}=J(s,a,c,h,f);return G((()=>(g.current=f||window,()=>{g.current=null})),[g,f]),o("windowScrollTo",x),o("scrollBy",p),t.createElement(c,{style:{position:"relative",...r,...0!==u?{height:u+d}:{}},"data-virtuoso-scroller":!0,...l,...Ot(c,m)},i)}))}const Vt=({children:o})=>{const n=t.useContext(Ct),l=Nt("viewportHeight"),s=Nt("fixedItemHeight"),c=K(i(l,(e=>Y(e,"height"))));return r.useEffect((()=>{n&&(l(n.viewportHeight),s(n.itemHeight))}),[n,l,s]),e.jsx("div",{style:kt,ref:c,"data-viewport-type":"element",children:o})},Ft=({children:o})=>{const n=t.useContext(Ct),i=Nt("windowViewportRect"),l=Nt("fixedItemHeight"),s=_t("customScrollParent"),c=wt(i,s);return r.useEffect((()=>{n&&(l(n.itemHeight),i({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:100}))}),[n,i,l]),e.jsx("div",{ref:c,style:kt,"data-viewport-type":"window",children:o})},At=({children:e})=>{const o=_t("TopItemListComponent"),n=_t("headerHeight"),r={...Pt,marginTop:`${n}px`},i=_t("context");return t.createElement(o||"div",{style:r,context:i},e)},Dt=r.memo((function(t){const o=_t("useWindowScroll"),n=_t("topItemsIndexes").length>0,r=_t("customScrollParent"),i=r||o?Kt:$t,l=r||o?Ft:Vt;return e.jsxs(i,{...t,children:[n&&e.jsx(At,{children:e.jsx(zt,{showTopList:!0})}),e.jsxs(l,{children:[e.jsx(Lt,{}),e.jsx(zt,{}),e.jsx(Mt,{})]})]})})),{Component:Gt,usePublisher:Nt,useEmitterValue:_t,useEmitter:Ut}=D(yt,{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"}},Dt),$t=Wt({usePublisher:Nt,useEmitterValue:_t,useEmitter:Ut}),Kt=jt({usePublisher:Nt,useEmitterValue:_t,useEmitter:Ut}),qt=Gt,Yt=Gt,Zt={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},Jt={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:Qt,ceil:Xt,floor:eo,min:to,max:oo}=Math;function no(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 ro(e,t){return e&&e.column===t.column&&e.row===t.row}const io=V((([{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:h,didMount:m},{windowViewportRect:g,windowScrollTo:p,useWindowScroll:x,customScrollParent:I,windowScrollContainerState:y},B])=>{const k=w(0),P=w(0),O=w(Zt),M=w({height:0,width:0}),V=w({height:0,width:0}),F=T(),A=T(),D=w(0),G=w(void 0),N=w({row:0,column:0});v(H(j(m,P,G),E((([,e])=>0!==e)),R((([,e,t])=>({items:no(0,e-1,t),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0})))),O),v(H(j(W(k),t,W(N,ro),W(V,((e,t)=>e&&e.width===t.width&&e.height===t.height)),G),L(M),R((([[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 Zt;if(0===u)return function(e){return{...Jt,items:e}}(no(0,0,i));const f=co(d,u,c);let h=f*eo((t+s)/(a+s)),m=f*Xt((o+s)/(a+s))-1;m=to(e-1,oo(m,f-1)),h=to(m,oo(0,h));const g=no(h,m,i),{top:p,bottom:x}=lo(l,n,r,g),v=Xt(e/f);return{items:g,offsetTop:p,offsetBottom:v*a+(v-1)*s-x,top:p,bottom:x,itemHeight:a,itemWidth:u}}))),O),v(H(G,E((e=>void 0!==e)),R((e=>e.length))),k),v(H(M,R((({height:e})=>e))),r),v(H(j(M,V,O,N),R((([e,t,{items:o},n])=>{const{top:r,bottom:i}=lo(e,n,t,o);return[r,i]})),b(Ke)),o);const _=C(H(W(O),E((({items:e})=>e.length>0)),L(k),E((([{items:e},t])=>e[e.length-1].index===t-1)),R((([,e])=>e-1)),b())),U=C(H(W(O),E((({items:e})=>e.length>0&&0===e[0].index)),z(0),b())),$=C(H(W(O),E((({items:e})=>e.length>0)),R((({items:e})=>({startIndex:e[0].index,endIndex:e[e.length-1].index}))),b(qe)));v($,f.scrollSeekRangeChanged),v(H(F,L(M,V,k,N),R((([e,t,o,n,r])=>{const i=Me(e),{align:l,behavior:s,offset:c}=i;let a=i.index;"LAST"===a&&(a=n-1),a=oo(0,a,to(n-1,a));let u=so(t,r,o,a);return"end"===l?u=Qt(u-t.height+o.height):"center"===l&&(u=Qt(u-t.height/2+o.height/2)),c&&(u+=c),{top:u,behavior:s}}))),l);const K=S(H(O,R((e=>e.offsetBottom+e.bottom))),0);return v(H(g,R((e=>({width:e.visibleWidth,height:e.visibleHeight})))),M),{data:G,totalCount:k,viewportDimensions:M,itemDimensions:V,scrollTop:n,scrollHeight:A,overscan:e,scrollBy:i,scrollTo:l,scrollToIndex:F,smoothScrollTargetReached:s,windowViewportRect:g,windowScrollTo:p,useWindowScroll:x,customScrollParent:I,windowScrollContainerState:y,deviation:D,scrollContainerState:c,footerHeight:a,headerHeight:u,initialItemCount:P,gap:N,...f,gridState:O,totalListHeight:K,...d,startReached:U,endReached:_,rangeChanged:$,propsReady:h,...B}}),u(et,Q,Ae,lt,De,mt,U));function lo(e,t,o,n){const{height:r}=o;if(void 0===r||0===n.length)return{top:0,bottom:0};return{top:so(e,t,o,n[0].index),bottom:so(e,t,o,n[n.length-1].index)+r}}function so(e,t,o,n){const r=co(e.width,o.width,t.column),i=eo(n/r),l=i*o.height+oo(0,i-1)*t.row;return l>0?l+t.row:l}function co(e,t,o){return oo(1,eo((e+o)/(t+o)))}const ao=V((([e,t])=>({...e,...t})),u(io,V((()=>{const e=w((e=>`Item ${e}`)),t=w({}),o=w(null),n=w("virtuoso-grid-item"),r=w("virtuoso-grid-list"),i=w(Ht),l=w("div"),s=w(h),c=(e,o=null)=>S(H(t,R((t=>t[e])),b()),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")}})))),uo=r.memo((function(){const e=Io("gridState"),o=Io("listClassName"),n=Io("itemClassName"),r=Io("itemContent"),i=Io("computeItemKey"),l=Io("isSeeking"),s=vo("scrollHeight"),c=Io("ItemComponent"),a=Io("ListComponent"),u=Io("ScrollSeekPlaceholder"),d=Io("context"),f=vo("itemDimensions"),h=vo("gap"),m=Io("log"),g=K((e=>{const t=e.parentElement.parentElement.scrollHeight;s(t);const o=e.firstChild;o&&f(o.getBoundingClientRect()),h({row:So("row-gap",getComputedStyle(e).rowGap,m),column:So("column-gap",getComputedStyle(e).columnGap,m)})}));return t.createElement(a,{ref:g,className:o,...Ot(a,d),style:{paddingTop:e.offsetTop,paddingBottom:e.offsetBottom},"data-test-id":"virtuoso-item-list"},e.items.map((o=>{const s=i(o.index,o.data,d);return l?t.createElement(u,{key:s,...Ot(u,d),index:o.index,height:e.itemHeight,width:e.itemWidth}):t.createElement(c,{...Ot(c,d),className:n,"data-index":o.index,key:s},r(o.index,o.data,d))})))})),fo=r.memo((function(){const e=Io("HeaderComponent"),o=vo("headerHeight"),n=Io("headerFooterTag"),r=K((e=>o(Y(e,"height")))),i=Io("context");return e?t.createElement(n,{ref:r},t.createElement(e,Ot(e,i))):null})),ho=r.memo((function(){const e=Io("FooterComponent"),o=vo("footerHeight"),n=Io("headerFooterTag"),r=K((e=>o(Y(e,"height")))),i=Io("context");return e?t.createElement(n,{ref:r},t.createElement(e,Ot(e,i))):null})),mo=({children:o})=>{const n=t.useContext(St),i=vo("itemDimensions"),l=vo("viewportDimensions"),s=K((e=>{l(e.getBoundingClientRect())}));return r.useEffect((()=>{n&&(l({height:n.viewportHeight,width:n.viewportWidth}),i({height:n.itemHeight,width:n.itemWidth}))}),[n,l,i]),e.jsx("div",{style:kt,ref:s,children:o})},go=({children:o})=>{const n=t.useContext(St),i=vo("windowViewportRect"),l=vo("itemDimensions"),s=Io("customScrollParent"),c=wt(i,s);return r.useEffect((()=>{n&&(l({height:n.itemHeight,width:n.itemWidth}),i({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:n.viewportWidth}))}),[n,i,l]),e.jsx("div",{ref:c,style:kt,children:o})},po=r.memo((function({...t}){const o=Io("useWindowScroll"),n=Io("customScrollParent"),r=n||o?Co:wo,i=n||o?go:mo;return e.jsx(r,{...t,children:e.jsxs(i,{children:[e.jsx(fo,{}),e.jsx(uo,{}),e.jsx(ho,{})]})})})),{Component:xo,usePublisher:vo,useEmitterValue:Io,useEmitter:To}=D(ao,{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"}},po),wo=Wt({usePublisher:vo,useEmitterValue:Io,useEmitter:To}),Co=jt({usePublisher:vo,useEmitterValue:Io,useEmitter:To});function So(e,t,o){return"normal"===t||(null==t?void 0:t.endsWith("px"))||o(`${e} was not resolved to pixel value correctly`,t,N.WARN),"normal"===t?0:parseInt(t??"0",10)}const Ho=xo,yo=V((([e,t])=>({...e,...t})),u(xt,V((()=>{const t=w((t=>e.jsxs("td",{children:["Item $",t]}))),o=w(null),n=w(null),r=w(null),i=w({}),l=w(Ht),s=w(h),c=(e,t=null)=>S(H(i,R((t=>t[e])),b()),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")}})))),bo=({height:t})=>e.jsx("tr",{children:e.jsx("td",{style:{height:t}})}),Eo=({height:t})=>e.jsx("tr",{children:e.jsx("td",{style:{height:t,padding:0,border:0}})}),Ro=r.memo((function(){const o=Lo("listState"),n=Oo("sizeRanges"),i=Lo("useWindowScroll"),l=Lo("customScrollParent"),s=Oo("windowScrollContainerState"),c=Oo("scrollContainerState"),a=l||i?s:c,u=Lo("itemContent"),d=Lo("trackItemSizes"),f=Lo("itemSize"),h=Lo("log"),{callbackRef:m,ref:g}=q(n,f,d,a,h,void 0,l),[p,x]=r.useState(0);Mo("deviation",(e=>{p!==e&&(g.current.style.marginTop=`${e}px`,x(e))}));const v=Lo("EmptyPlaceholder"),I=Lo("ScrollSeekPlaceholder")||bo,T=Lo("FillerRow")||Eo,w=Lo("TableBodyComponent"),C=Lo("TableRowComponent"),S=Lo("computeItemKey"),H=Lo("isSeeking"),y=Lo("paddingTopAddition"),b=Lo("firstItemIndex"),E=Lo("statefulTotalCount"),R=Lo("context");if(0===E&&v)return t.createElement(v,Ot(v,R));const z=o.offsetTop+y+p,B=o.offsetBottom,k=z>0?e.jsx(T,{height:z},"padding-top"):null,P=B>0?e.jsx(T,{height:B},"padding-bottom"):null,O=o.items.map((e=>{const o=e.originalIndex,n=S(o+b,e.data,R);return H?t.createElement(I,{...Ot(I,R),key:n,index:e.index,height:e.size,type:e.type||"item"}):t.createElement(C,{...Ot(C,R),key:n,"data-index":o,"data-known-size":e.size,"data-item-index":e.index,item:e.data,style:{overflowAnchor:"none"}},u(e.index,e.data,R))}));return t.createElement(w,{ref:m,"data-test-id":"virtuoso-item-list",...Ot(w,R)},[k,...O,P])})),zo=({children:o})=>{const n=t.useContext(Ct),l=Oo("viewportHeight"),s=Oo("fixedItemHeight"),c=K(i(l,(e=>Y(e,"height"))));return r.useEffect((()=>{n&&(l(n.viewportHeight),s(n.itemHeight))}),[n,l,s]),e.jsx("div",{style:kt,ref:c,"data-viewport-type":"element",children:o})},Bo=({children:o})=>{const n=t.useContext(Ct),i=Oo("windowViewportRect"),l=Oo("fixedItemHeight"),s=Lo("customScrollParent"),c=wt(i,s);return r.useEffect((()=>{n&&(l(n.itemHeight),i({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:100}))}),[n,i,l]),e.jsx("div",{ref:c,style:kt,"data-viewport-type":"window",children:o})},ko=r.memo((function(t){const o=Lo("useWindowScroll"),n=Lo("customScrollParent"),l=Oo("fixedHeaderHeight"),s=Oo("fixedFooterHeight"),c=Lo("fixedHeaderContent"),a=Lo("fixedFooterContent"),u=Lo("context"),d=K(i(l,(e=>Y(e,"height")))),f=K(i(s,(e=>Y(e,"height")))),h=n||o?jo:Wo,m=n||o?Bo:zo,g=Lo("TableComponent"),p=Lo("TableHeadComponent"),x=Lo("TableFooterComponent"),v=c?r.createElement(p,{key:"TableHead",style:{zIndex:1,position:"sticky",top:0},ref:d,...Ot(p,u)},c()):null,I=a?r.createElement(x,{key:"TableFoot",style:{zIndex:1,position:"sticky",bottom:0},ref:f,...Ot(x,u)},a()):null;return e.jsx(h,{...t,children:e.jsx(m,{children:r.createElement(g,{style:{borderSpacing:0},...Ot(g,u)},[v,e.jsx(Ro,{},"TableBody"),I])})})})),{Component:Po,usePublisher:Oo,useEmitterValue:Lo,useEmitter:Mo}=D(yo,{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"}},ko),Wo=Wt({usePublisher:Oo,useEmitterValue:Lo,useEmitter:Mo}),jo=jt({usePublisher:Oo,useEmitterValue:Lo,useEmitter:Mo}),Vo=Po;exports.GroupedVirtuoso=Yt,exports.LogLevel=N,exports.TableVirtuoso=Vo,exports.Virtuoso=qt,exports.VirtuosoGrid=Ho,exports.VirtuosoGridMockContext=St,exports.VirtuosoMockContext=Ct;
{
"name": "react-virtuoso",
"author": "Petyo Ivanov",
"type": "module",
"sideEffects": false,
"version": "3.1.5",
"version": "4.0.0",
"homepage": "https://virtuoso.dev/",

@@ -30,18 +31,12 @@ "license": "MIT",

"scripts": {
"start": "microbundle watch --raw --no-sourcemap --strict --no-compress --jsx React.createElement --format=cjs,esm",
"build": "yarn build:microbundle && yarn build:bundle-dts",
"build:microbundle": "microbundle --strict --jsx React.createElement --format=cjs,esm src/index.tsx",
"build:bundle-dts": "api-extractor run --local && ./scripts/cleanup-dist.sh",
"test": "jest --passWithNoTests",
"build": "vite build && ./scripts/build-types.sh",
"test": "vitest run",
"test:watch": "vitest watch",
"e2e": "playwright test",
"lint": "eslint src test e2e --ext .ts,.tsx",
"typecheck": "tsc --noEmit -p tsconfig.typecheck.json",
"browse-examples": "node examples/generate-examples.mjs && parcel examples/__examples.html",
"prepare": "yarn build && husky install",
"dev": "ladle serve",
"prepare": "pnpm run build && husky install",
"semantic-release": "semantic-release"
},
"dependencies": {
"@virtuoso.dev/react-urx": "^0.2.12",
"@virtuoso.dev/urx": "^0.2.12"
},
"peerDependencies": {

@@ -57,6 +52,6 @@ "react": ">=16 || >=17 || >= 18",

"@faker-js/faker": "^7.6.0",
"@microsoft/api-extractor": "^7.25.0",
"@playwright/test": "^1.27.1",
"@testing-library/react": "^13.4.0",
"@types/jest": "^26.0.20",
"@ladle/react": "^2.4.5",
"@microsoft/api-extractor": "^7.33.7",
"@playwright/test": "^1.29.1",
"@types/jsdom": "^16.2.3",

@@ -69,26 +64,19 @@ "@types/lodash": "^4.14.165",

"@types/react-table": "^7.7.10",
"@types/react-test-renderer": "^16.9.3",
"@typescript-eslint/eslint-plugin": "^5.28.0",
"@typescript-eslint/parser": "^5.28.0",
"babel-eslint": "^10.0.0",
"eslint": "^7.5.0",
"eslint-config-prettier": "^7.2.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-html": "^6.0.2",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-json": "^2.1.1",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.20.3",
"eslint-plugin-react-hooks": "^4.0.8",
"@typescript-eslint/eslint-plugin": "^5.47.0",
"@typescript-eslint/parser": "^5.47.0",
"@vitejs/plugin-react": "^3.0.0",
"eslint": "^8.30.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "^6.0.0",
"jest": "^26.6.3",
"jsdom": "^16.4.0",
"jsdom": "^20.0.3",
"lodash": "^4.17.21",
"microbundle": "^0.15.1",
"parcel": "^2.8.0",
"playwright": "^1.27.1",
"playwright": "^1.29.1",
"prettier": "^2.2.1",
"process": "^0.11.10",
"react": "^18.0.0",

@@ -99,9 +87,10 @@ "react-beautiful-dnd": "^13.0.0",

"react-table": "^7.7.0",
"react-test-renderer": "^16.13.1",
"rollup-plugin-dts": "^4.2.0",
"semantic-release": "^19.0.5",
"ts-jest": "^26.5.1",
"terser": "^5.16.1",
"tslib": "^2.0.0",
"typescript": "^4.4.2"
"typescript": "^4.9.4",
"vite": "^4.0.0",
"vitest": "^0.26.2"
},
"packageManager": "pnpm@7.21.0",
"resolutions": {

@@ -108,0 +97,0 @@ "@types/react": "^16.14.2"

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc