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