react-window 1.8.7 → 1.8.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,12 +2,14 @@
2
2
 
3
3
  > React components for efficiently rendering large lists and tabular data
4
4
 
5
+ ### If you like this project, 🎉 [become a sponsor](https://github.com/sponsors/bvaughn/) or ☕ [buy me a coffee](http://givebrian.coffee/)
6
+
7
+ ---
8
+
5
9
  React window works by only rendering *part* of a large data set (just enough to fill the viewport). This helps address some common performance bottlenecks:
6
10
  1. It reduces the amount of work (and time) required to render the initial view and to process updates.
7
11
  2. It reduces the memory footprint by avoiding over-allocation of DOM nodes.
8
12
 
9
- [![NPM registry](https://img.shields.io/npm/v/react-window.svg?style=for-the-badge)](https://yarnpkg.com/en/package/react-window) [![Travis](https://img.shields.io/badge/ci-travis-green.svg?style=for-the-badge)](https://travis-ci.org/bvaughn/react-window) [![NPM license](https://img.shields.io/badge/license-mit-red.svg?style=for-the-badge)](LICENSE.md) [![OpenCollective](https://img.shields.io/opencollective/backers/react-window?logo=open-collective&style=for-the-badge)](#backers) [![OpenCollective](https://img.shields.io/opencollective/sponsors/react-window?logo=open-collective&style=for-the-badge)](#sponsors)
10
-
11
13
  ### Sponsors
12
14
 
13
15
  The following wonderful companies have sponsored react-window:
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).ReactWindow={},e.React)}(this,(function(e,t){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,o(e,t)}var a=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function l(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(n=e[r],o=t[r],!(n===o||a(n)&&a(o)))return!1;var n,o;return!0}function s(e,t){var r;void 0===t&&(t=l);var n,o=[],i=!1;return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return i&&r===this&&t(a,o)||(n=e.apply(this,a),i=!0,r=this,o=a),n}}var c="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function u(e){cancelAnimationFrame(e.id)}function d(e,t){var r=c();var n={id:requestAnimationFrame((function o(){c()-r>=t?e.call(null):n.id=requestAnimationFrame(o)}))};return n}var f=-1;var h=null;function p(e){if(void 0===e&&(e=!1),null===h||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),o=n.style;return o.width="100px",o.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?h="positive-descending":(t.scrollLeft=1,h=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),h}return h}var m=function(e){var t=e.columnIndex;e.data;return e.rowIndex+":"+t},v=null,g=null,w=null;function S(e){var o,a=e.getColumnOffset,l=e.getColumnStartIndexForOffset,c=e.getColumnStopIndexForStartIndex,h=e.getColumnWidth,v=e.getEstimatedTotalHeight,g=e.getEstimatedTotalWidth,w=e.getOffsetForColumnAndAlignment,S=e.getOffsetForRowAndAlignment,M=e.getRowHeight,y=e.getRowOffset,x=e.getRowStartIndexForOffset,C=e.getRowStopIndexForStartIndex,b=e.initInstanceProps,_=e.shouldResetStyleCacheOnItemSizeChange,R=e.validateProps;return(o=function(e){function o(t){var r;return(r=e.call(this,t)||this)._instanceProps=b(r.props,n(r)),r._resetIsScrollingTimeoutId=null,r._outerRef=void 0,r.state={instance:n(r),isScrolling:!1,horizontalScrollDirection:"forward",scrollLeft:"number"==typeof r.props.initialScrollLeft?r.props.initialScrollLeft:0,scrollTop:"number"==typeof r.props.initialScrollTop?r.props.initialScrollTop:0,scrollUpdateWasRequested:!1,verticalScrollDirection:"forward"},r._callOnItemsRendered=void 0,r._callOnItemsRendered=s((function(e,t,n,o,i,a,l,s){return r.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:n,overscanRowStopIndex:o,visibleColumnStartIndex:i,visibleColumnStopIndex:a,visibleRowStartIndex:l,visibleRowStopIndex:s})})),r._callOnScroll=void 0,r._callOnScroll=s((function(e,t,n,o,i){return r.props.onScroll({horizontalScrollDirection:n,scrollLeft:e,scrollTop:t,verticalScrollDirection:o,scrollUpdateWasRequested:i})})),r._getItemStyle=void 0,r._getItemStyle=function(e,t){var n,o=r.props,i=o.columnWidth,l=o.direction,s=o.rowHeight,c=r._getItemStyleCache(_&&i,_&&l,_&&s),u=e+":"+t;if(c.hasOwnProperty(u))n=c[u];else{var d=a(r.props,t,r._instanceProps),f="rtl"===l;c[u]=n={position:"absolute",left:f?void 0:d,right:f?d:void 0,top:y(r.props,e,r._instanceProps),height:M(r.props,e,r._instanceProps),width:h(r.props,t,r._instanceProps)}}return n},r._getItemStyleCache=void 0,r._getItemStyleCache=s((function(e,t,r){return{}})),r._onScroll=function(e){var t=e.currentTarget,n=t.clientHeight,o=t.clientWidth,i=t.scrollLeft,a=t.scrollTop,l=t.scrollHeight,s=t.scrollWidth;r.setState((function(e){if(e.scrollLeft===i&&e.scrollTop===a)return null;var t=r.props.direction,c=i;if("rtl"===t)switch(p()){case"negative":c=-i;break;case"positive-descending":c=s-o-i}c=Math.max(0,Math.min(c,s-o));var u=Math.max(0,Math.min(a,l-n));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<i?"forward":"backward",scrollLeft:c,scrollTop:u,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&u(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=d(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},(function(){r._getItemStyleCache(-1)}))},r}i(o,e),o.getDerivedStateFromProps=function(e,t){return I(e,t),R(e),null};var T=o.prototype;return T.scrollTo=function(e){var t=e.scrollLeft,r=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==r&&(r=Math.max(0,r)),this.setState((function(e){return void 0===t&&(t=e.scrollLeft),void 0===r&&(r=e.scrollTop),e.scrollLeft===t&&e.scrollTop===r?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:r,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<r?"forward":"backward"}}),this._resetIsScrollingDebounced)},T.scrollToItem=function(e){var t=e.align,r=void 0===t?"auto":t,n=e.columnIndex,o=e.rowIndex,i=this.props,a=i.columnCount,l=i.height,s=i.rowCount,c=i.width,u=this.state,d=u.scrollLeft,h=u.scrollTop,p=function(e){if(void 0===e&&(e=!1),-1===f||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),f=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return f}();void 0!==n&&(n=Math.max(0,Math.min(n,a-1))),void 0!==o&&(o=Math.max(0,Math.min(o,s-1)));var m=v(this.props,this._instanceProps),I=g(this.props,this._instanceProps)>c?p:0,M=m>l?p:0;this.scrollTo({scrollLeft:void 0!==n?w(this.props,n,r,d,this._instanceProps,M):d,scrollTop:void 0!==o?S(this.props,o,r,h,this._instanceProps,I):h})},T.componentDidMount=function(){var e=this.props,t=e.initialScrollLeft,r=e.initialScrollTop;if(null!=this._outerRef){var n=this._outerRef;"number"==typeof t&&(n.scrollLeft=t),"number"==typeof r&&(n.scrollTop=r)}this._callPropsCallbacks()},T.componentDidUpdate=function(){var e=this.props.direction,t=this.state,r=t.scrollLeft,n=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("rtl"===e)switch(p()){case"negative":o.scrollLeft=-r;break;case"positive-ascending":o.scrollLeft=r;break;default:var i=o.clientWidth,a=o.scrollWidth;o.scrollLeft=a-i-r}else o.scrollLeft=Math.max(0,r);o.scrollTop=Math.max(0,n)}this._callPropsCallbacks()},T.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&u(this._resetIsScrollingTimeoutId)},T.render=function(){var e=this.props,n=e.children,o=e.className,i=e.columnCount,a=e.direction,l=e.height,s=e.innerRef,c=e.innerElementType,u=e.innerTagName,d=e.itemData,f=e.itemKey,h=void 0===f?m:f,p=e.outerElementType,w=e.outerTagName,S=e.rowCount,I=e.style,M=e.useIsScrolling,y=e.width,x=this.state.isScrolling,C=this._getHorizontalRangeToRender(),b=C[0],_=C[1],R=this._getVerticalRangeToRender(),T=R[0],z=R[1],O=[];if(i>0&&S)for(var P=T;P<=z;P++)for(var W=b;W<=_;W++)O.push(t.createElement(n,{columnIndex:W,data:d,isScrolling:M?x:void 0,key:h({columnIndex:W,data:d,rowIndex:P}),rowIndex:P,style:this._getItemStyle(P,W)}));var E=v(this.props,this._instanceProps),A=g(this.props,this._instanceProps);return t.createElement(p||w||"div",{className:o,onScroll:this._onScroll,ref:this._outerRefSetter,style:r({position:"relative",height:l,width:y,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:a},I)},t.createElement(c||u||"div",{children:O,ref:s,style:{height:E,pointerEvents:x?"none":void 0,width:A}}))},T._callPropsCallbacks=function(){var e=this.props,t=e.columnCount,r=e.onItemsRendered,n=e.onScroll,o=e.rowCount;if("function"==typeof r&&t>0&&o>0){var i=this._getHorizontalRangeToRender(),a=i[0],l=i[1],s=i[2],c=i[3],u=this._getVerticalRangeToRender(),d=u[0],f=u[1],h=u[2],p=u[3];this._callOnItemsRendered(a,l,d,f,s,c,h,p)}if("function"==typeof n){var m=this.state,v=m.horizontalScrollDirection,g=m.scrollLeft,w=m.scrollTop,S=m.scrollUpdateWasRequested,I=m.verticalScrollDirection;this._callOnScroll(g,w,v,I,S)}},T._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,r=e.overscanColumnCount,n=e.overscanColumnsCount,o=e.overscanCount,i=e.rowCount,a=this.state,s=a.horizontalScrollDirection,u=a.isScrolling,d=a.scrollLeft,f=r||n||o||1;if(0===t||0===i)return[0,0,0,0];var h=l(this.props,d,this._instanceProps),p=c(this.props,h,d,this._instanceProps),m=u&&"backward"!==s?1:Math.max(1,f),v=u&&"forward"!==s?1:Math.max(1,f);return[Math.max(0,h-m),Math.max(0,Math.min(t-1,p+v)),h,p]},T._getVerticalRangeToRender=function(){var e=this.props,t=e.columnCount,r=e.overscanCount,n=e.overscanRowCount,o=e.overscanRowsCount,i=e.rowCount,a=this.state,l=a.isScrolling,s=a.verticalScrollDirection,c=a.scrollTop,u=n||o||r||1;if(0===t||0===i)return[0,0,0,0];var d=x(this.props,c,this._instanceProps),f=C(this.props,d,c,this._instanceProps),h=l&&"backward"!==s?1:Math.max(1,u),p=l&&"forward"!==s?1:Math.max(1,u);return[Math.max(0,d-h),Math.max(0,Math.min(i-1,f+p)),d,f]},o}(t.PureComponent)).defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},o}"undefined"!=typeof window&&void 0!==window.WeakSet&&(v=new WeakSet,g=new WeakSet,w=new WeakSet);var I=function(e,t){var r=e.children,n=e.direction,o=e.height,i=e.innerTagName,a=e.outerTagName,l=e.overscanColumnsCount,s=e.overscanCount,c=e.overscanRowsCount,u=e.width,d=t.instance;if("number"==typeof s&&v&&!v.has(d)&&(v.add(d),console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")),"number"!=typeof l&&"number"!=typeof c||g&&!g.has(d)&&(g.add(d),console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")),null==i&&null==a||w&&!w.has(d)&&(w.add(d),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")),null==r)throw Error('An invalid "children" prop has been specified. Value should be a React component. "'+(null===r?"null":typeof r)+'" was specified.');switch(n){case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". "'+n+'" was specified.')}if("number"!=typeof u)throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. "'+(null===u?"null":typeof u)+'" was specified.');if("number"!=typeof o)throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. "'+(null===o?"null":typeof o)+'" was specified.')},M=function(e,t){var r=e.rowCount,n=t.rowMetadataMap,o=t.estimatedRowHeight,i=t.lastMeasuredRowIndex,a=0;if(i>=r&&(i=r-1),i>=0){var l=n[i];a=l.offset+l.size}return a+(r-i-1)*o},y=function(e,t){var r=e.columnCount,n=t.columnMetadataMap,o=t.estimatedColumnWidth,i=t.lastMeasuredColumnIndex,a=0;if(i>=r&&(i=r-1),i>=0){var l=n[i];a=l.offset+l.size}return a+(r-i-1)*o},x=function(e,t,r,n){var o,i,a;if("column"===e?(o=n.columnMetadataMap,i=t.columnWidth,a=n.lastMeasuredColumnIndex):(o=n.rowMetadataMap,i=t.rowHeight,a=n.lastMeasuredRowIndex),r>a){var l=0;if(a>=0){var s=o[a];l=s.offset+s.size}for(var c=a+1;c<=r;c++){var u=i(c);o[c]={offset:l,size:u},l+=u}"column"===e?n.lastMeasuredColumnIndex=r:n.lastMeasuredRowIndex=r}return o[r]},C=function(e,t,r,n){var o,i;return"column"===e?(o=r.columnMetadataMap,i=r.lastMeasuredColumnIndex):(o=r.rowMetadataMap,i=r.lastMeasuredRowIndex),(i>0?o[i].offset:0)>=n?b(e,t,r,i,0,n):_(e,t,r,Math.max(0,i),n)},b=function(e,t,r,n,o,i){for(;o<=n;){var a=o+Math.floor((n-o)/2),l=x(e,t,a,r).offset;if(l===i)return a;l<i?o=a+1:l>i&&(n=a-1)}return o>0?o-1:0},_=function(e,t,r,n,o){for(var i="column"===e?t.columnCount:t.rowCount,a=1;n<i&&x(e,t,n,r).offset<o;)n+=a,a*=2;return b(e,t,r,Math.min(n,i-1),Math.floor(n/2),o)},R=function(e,t,r,n,o,i,a){var l="column"===e?t.width:t.height,s=x(e,t,r,i),c="column"===e?y(t,i):M(t,i),u=Math.max(0,Math.min(c-l,s.offset)),d=Math.max(0,s.offset-l+a+s.size);switch("smart"===n&&(n=o>=d-l&&o<=u+l?"auto":"center"),n){case"start":return u;case"end":return d;case"center":return Math.round(d+(u-d)/2);case"auto":default:return o>=d&&o<=u?o:d>u||o<d?d:u}},T=S({getColumnOffset:function(e,t,r){return x("column",e,t,r).offset},getColumnStartIndexForOffset:function(e,t,r){return C("column",e,r,t)},getColumnStopIndexForStartIndex:function(e,t,r,n){for(var o=e.columnCount,i=e.width,a=x("column",e,t,n),l=r+i,s=a.offset+a.size,c=t;c<o-1&&s<l;)c++,s+=x("column",e,c,n).size;return c},getColumnWidth:function(e,t,r){return r.columnMetadataMap[t].size},getEstimatedTotalHeight:M,getEstimatedTotalWidth:y,getOffsetForColumnAndAlignment:function(e,t,r,n,o,i){return R("column",e,t,r,n,o,i)},getOffsetForRowAndAlignment:function(e,t,r,n,o,i){return R("row",e,t,r,n,o,i)},getRowOffset:function(e,t,r){return x("row",e,t,r).offset},getRowHeight:function(e,t,r){return r.rowMetadataMap[t].size},getRowStartIndexForOffset:function(e,t,r){return C("row",e,r,t)},getRowStopIndexForStartIndex:function(e,t,r,n){for(var o=e.rowCount,i=e.height,a=x("row",e,t,n),l=r+i,s=a.offset+a.size,c=t;c<o-1&&s<l;)c++,s+=x("row",e,c,n).size;return c},initInstanceProps:function(e,t){var r=e,n={columnMetadataMap:{},estimatedColumnWidth:r.estimatedColumnWidth||50,estimatedRowHeight:r.estimatedRowHeight||50,lastMeasuredColumnIndex:-1,lastMeasuredRowIndex:-1,rowMetadataMap:{}};return t.resetAfterColumnIndex=function(e,r){void 0===r&&(r=!0),t.resetAfterIndices({columnIndex:e,shouldForceUpdate:r})},t.resetAfterRowIndex=function(e,r){void 0===r&&(r=!0),t.resetAfterIndices({rowIndex:e,shouldForceUpdate:r})},t.resetAfterIndices=function(e){var r=e.columnIndex,o=e.rowIndex,i=e.shouldForceUpdate,a=void 0===i||i;"number"==typeof r&&(n.lastMeasuredColumnIndex=Math.min(n.lastMeasuredColumnIndex,r-1)),"number"==typeof o&&(n.lastMeasuredRowIndex=Math.min(n.lastMeasuredRowIndex,o-1)),t._getItemStyleCache(-1),a&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){var t=e.columnWidth,r=e.rowHeight;if("function"!=typeof t)throw Error('An invalid "columnWidth" prop has been specified. Value should be a function. "'+(null===t?"null":typeof t)+'" was specified.');if("function"!=typeof r)throw Error('An invalid "rowHeight" prop has been specified. Value should be a function. "'+(null===r?"null":typeof r)+'" was specified.')}}),z=function(e,t){return e},O=null,P=null;function W(e){var o,a=e.getItemOffset,l=e.getEstimatedTotalSize,c=e.getItemSize,f=e.getOffsetForIndexAndAlignment,h=e.getStartIndexForOffset,m=e.getStopIndexForStartIndex,v=e.initInstanceProps,g=e.shouldResetStyleCacheOnItemSizeChange,w=e.validateProps;return(o=function(e){function o(t){var r;return(r=e.call(this,t)||this)._instanceProps=v(r.props,n(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:n(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=s((function(e,t,n,o){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:o})})),r._callOnScroll=void 0,r._callOnScroll=s((function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})})),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,n=r.props,o=n.direction,i=n.itemSize,l=n.layout,s=r._getItemStyleCache(g&&i,g&&l,g&&o);if(s.hasOwnProperty(e))t=s[e];else{var u=a(r.props,e,r._instanceProps),d=c(r.props,e,r._instanceProps),f="horizontal"===o||"horizontal"===l,h="rtl"===o,p=f?u:0;s[e]=t={position:"absolute",left:h?void 0:p,right:h?p:void 0,top:f?0:u,height:f?"100%":d,width:f?d:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=s((function(e,t,r){return{}})),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,o=t.scrollLeft,i=t.scrollWidth;r.setState((function(e){if(e.scrollOffset===o)return null;var t=r.props.direction,a=o;if("rtl"===t)switch(p()){case"negative":a=-o;break;case"positive-descending":a=i-n-o}return a=Math.max(0,Math.min(a,i-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<o?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,o=t.scrollHeight,i=t.scrollTop;r.setState((function(e){if(e.scrollOffset===i)return null;var t=Math.max(0,Math.min(i,o-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&u(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=d(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},(function(){r._getItemStyleCache(-1,null)}))},r}i(o,e),o.getDerivedStateFromProps=function(e,t){return E(e,t),w(e),null};var S=o.prototype;return S.scrollTo=function(e){e=Math.max(0,e),this.setState((function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}}),this._resetIsScrollingDebounced)},S.scrollToItem=function(e,t){void 0===t&&(t="auto");var r=this.props.itemCount,n=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1)),this.scrollTo(f(this.props,e,t,n,this._instanceProps))},S.componentDidMount=function(){var e=this.props,t=e.direction,r=e.initialScrollOffset,n=e.layout;if("number"==typeof r&&null!=this._outerRef){var o=this._outerRef;"horizontal"===t||"horizontal"===n?o.scrollLeft=r:o.scrollTop=r}this._callPropsCallbacks()},S.componentDidUpdate=function(){var e=this.props,t=e.direction,r=e.layout,n=this.state,o=n.scrollOffset;if(n.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("horizontal"===t||"horizontal"===r)if("rtl"===t)switch(p()){case"negative":i.scrollLeft=-o;break;case"positive-ascending":i.scrollLeft=o;break;default:var a=i.clientWidth,l=i.scrollWidth;i.scrollLeft=l-a-o}else i.scrollLeft=o;else i.scrollTop=o}this._callPropsCallbacks()},S.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&u(this._resetIsScrollingTimeoutId)},S.render=function(){var e=this.props,n=e.children,o=e.className,i=e.direction,a=e.height,s=e.innerRef,c=e.innerElementType,u=e.innerTagName,d=e.itemCount,f=e.itemData,h=e.itemKey,p=void 0===h?z:h,m=e.layout,v=e.outerElementType,g=e.outerTagName,w=e.style,S=e.useIsScrolling,I=e.width,M=this.state.isScrolling,y="horizontal"===i||"horizontal"===m,x=y?this._onScrollHorizontal:this._onScrollVertical,C=this._getRangeToRender(),b=C[0],_=C[1],R=[];if(d>0)for(var T=b;T<=_;T++)R.push(t.createElement(n,{data:f,key:p(T,f),index:T,isScrolling:S?M:void 0,style:this._getItemStyle(T)}));var O=l(this.props,this._instanceProps);return t.createElement(v||g||"div",{className:o,onScroll:x,ref:this._outerRefSetter,style:r({position:"relative",height:a,width:I,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},w)},t.createElement(c||u||"div",{children:R,ref:s,style:{height:y?"100%":O,pointerEvents:M?"none":void 0,width:y?O:"100%"}}))},S._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],r=e[1],n=e[2],o=e[3];this._callOnItemsRendered(t,r,n,o)}if("function"==typeof this.props.onScroll){var i=this.state,a=i.scrollDirection,l=i.scrollOffset,s=i.scrollUpdateWasRequested;this._callOnScroll(a,l,s)}},S._getRangeToRender=function(){var e=this.props,t=e.itemCount,r=e.overscanCount,n=this.state,o=n.isScrolling,i=n.scrollDirection,a=n.scrollOffset;if(0===t)return[0,0,0,0];var l=h(this.props,a,this._instanceProps),s=m(this.props,l,a,this._instanceProps),c=o&&"backward"!==i?1:Math.max(1,r),u=o&&"forward"!==i?1:Math.max(1,r);return[Math.max(0,l-c),Math.max(0,Math.min(t-1,s+u)),l,s]},o}(t.PureComponent)).defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},o}"undefined"!=typeof window&&void 0!==window.WeakSet&&(O=new WeakSet,P=new WeakSet);var E=function(e,t){var r=e.children,n=e.direction,o=e.height,i=e.layout,a=e.innerTagName,l=e.outerTagName,s=e.width,c=t.instance;null==a&&null==l||P&&!P.has(c)&&(P.add(c),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var u="horizontal"===n||"horizontal"===i;switch(n){case"horizontal":case"vertical":O&&!O.has(c)&&(O.add(c),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". "'+n+'" was specified.')}switch(i){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". "'+i+'" was specified.')}if(null==r)throw Error('An invalid "children" prop has been specified. Value should be a React component. "'+(null===r?"null":typeof r)+'" was specified.');if(u&&"number"!=typeof s)throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. "'+(null===s?"null":typeof s)+'" was specified.');if(!u&&"number"!=typeof o)throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. "'+(null===o?"null":typeof o)+'" was specified.')},A=function(e,t,r){var n=e.itemSize,o=r.itemMetadataMap,i=r.lastMeasuredIndex;if(t>i){var a=0;if(i>=0){var l=o[i];a=l.offset+l.size}for(var s=i+1;s<=t;s++){var c=n(s);o[s]={offset:a,size:c},a+=c}r.lastMeasuredIndex=t}return o[t]},k=function(e,t,r,n,o){for(;n<=r;){var i=n+Math.floor((r-n)/2),a=A(e,i,t).offset;if(a===o)return i;a<o?n=i+1:a>o&&(r=i-1)}return n>0?n-1:0},D=function(e,t,r,n){for(var o=e.itemCount,i=1;r<o&&A(e,r,t).offset<n;)r+=i,i*=2;return k(e,t,Math.min(r,o-1),Math.floor(r/2),n)},F=function(e,t){var r=e.itemCount,n=t.itemMetadataMap,o=t.estimatedItemSize,i=t.lastMeasuredIndex,a=0;if(i>=r&&(i=r-1),i>=0){var l=n[i];a=l.offset+l.size}return a+(r-i-1)*o},L=W({getItemOffset:function(e,t,r){return A(e,t,r).offset},getItemSize:function(e,t,r){return r.itemMetadataMap[t].size},getEstimatedTotalSize:F,getOffsetForIndexAndAlignment:function(e,t,r,n,o){var i=e.direction,a=e.height,l=e.layout,s=e.width,c="horizontal"===i||"horizontal"===l?s:a,u=A(e,t,o),d=F(e,o),f=Math.max(0,Math.min(d-c,u.offset)),h=Math.max(0,u.offset-c+u.size);switch("smart"===r&&(r=n>=h-c&&n<=f+c?"auto":"center"),r){case"start":return f;case"end":return h;case"center":return Math.round(h+(f-h)/2);case"auto":default:return n>=h&&n<=f?n:n<h?h:f}},getStartIndexForOffset:function(e,t,r){return function(e,t,r){var n=t.itemMetadataMap,o=t.lastMeasuredIndex;return(o>0?n[o].offset:0)>=r?k(e,t,o,0,r):D(e,t,Math.max(0,o),r)}(e,r,t)},getStopIndexForStartIndex:function(e,t,r,n){for(var o=e.direction,i=e.height,a=e.itemCount,l=e.layout,s=e.width,c="horizontal"===o||"horizontal"===l?s:i,u=A(e,t,n),d=r+c,f=u.offset+u.size,h=t;h<a-1&&f<d;)h++,f+=A(e,h,n).size;return h},initInstanceProps:function(e,t){var r={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,n){void 0===n&&(n=!0),r.lastMeasuredIndex=Math.min(r.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),n&&t.forceUpdate()},r},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){var t=e.itemSize;if("function"!=typeof t)throw Error('An invalid "itemSize" prop has been specified. Value should be a function. "'+(null===t?"null":typeof t)+'" was specified.')}}),H=S({getColumnOffset:function(e,t){return t*e.columnWidth},getColumnWidth:function(e,t){return e.columnWidth},getRowOffset:function(e,t){return t*e.rowHeight},getRowHeight:function(e,t){return e.rowHeight},getEstimatedTotalHeight:function(e){var t=e.rowCount;return e.rowHeight*t},getEstimatedTotalWidth:function(e){var t=e.columnCount;return e.columnWidth*t},getOffsetForColumnAndAlignment:function(e,t,r,n,o,i){var a=e.columnCount,l=e.columnWidth,s=e.width,c=Math.max(0,a*l-s),u=Math.min(c,t*l),d=Math.max(0,t*l-s+i+l);switch("smart"===r&&(r=n>=d-s&&n<=u+s?"auto":"center"),r){case"start":return u;case"end":return d;case"center":var f=Math.round(d+(u-d)/2);return f<Math.ceil(s/2)?0:f>c+Math.floor(s/2)?c:f;case"auto":default:return n>=d&&n<=u?n:d>u||n<d?d:u}},getOffsetForRowAndAlignment:function(e,t,r,n,o,i){var a=e.rowHeight,l=e.height,s=e.rowCount,c=Math.max(0,s*a-l),u=Math.min(c,t*a),d=Math.max(0,t*a-l+i+a);switch("smart"===r&&(r=n>=d-l&&n<=u+l?"auto":"center"),r){case"start":return u;case"end":return d;case"center":var f=Math.round(d+(u-d)/2);return f<Math.ceil(l/2)?0:f>c+Math.floor(l/2)?c:f;case"auto":default:return n>=d&&n<=u?n:d>u||n<d?d:u}},getColumnStartIndexForOffset:function(e,t){var r=e.columnWidth,n=e.columnCount;return Math.max(0,Math.min(n-1,Math.floor(t/r)))},getColumnStopIndexForStartIndex:function(e,t,r){var n=e.columnWidth,o=e.columnCount,i=e.width,a=t*n,l=Math.ceil((i+r-a)/n);return Math.max(0,Math.min(o-1,t+l-1))},getRowStartIndexForOffset:function(e,t){var r=e.rowHeight,n=e.rowCount;return Math.max(0,Math.min(n-1,Math.floor(t/r)))},getRowStopIndexForStartIndex:function(e,t,r){var n=e.rowHeight,o=e.rowCount,i=e.height,a=t*n,l=Math.ceil((i+r-a)/n);return Math.max(0,Math.min(o-1,t+l-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){var t=e.columnWidth,r=e.rowHeight;if("number"!=typeof t)throw Error('An invalid "columnWidth" prop has been specified. Value should be a number. "'+(null===t?"null":typeof t)+'" was specified.');if("number"!=typeof r)throw Error('An invalid "rowHeight" prop has been specified. Value should be a number. "'+(null===r?"null":typeof r)+'" was specified.')}}),U=W({getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,r,n){var o=e.direction,i=e.height,a=e.itemCount,l=e.itemSize,s=e.layout,c=e.width,u="horizontal"===o||"horizontal"===s?c:i,d=Math.max(0,a*l-u),f=Math.min(d,t*l),h=Math.max(0,t*l-u+l);switch("smart"===r&&(r=n>=h-u&&n<=f+u?"auto":"center"),r){case"start":return f;case"end":return h;case"center":var p=Math.round(h+(f-h)/2);return p<Math.ceil(u/2)?0:p>d+Math.floor(u/2)?d:p;case"auto":default:return n>=h&&n<=f?n:n<h?h:f}},getStartIndexForOffset:function(e,t){var r=e.itemCount,n=e.itemSize;return Math.max(0,Math.min(r-1,Math.floor(t/n)))},getStopIndexForStartIndex:function(e,t,r){var n=e.direction,o=e.height,i=e.itemCount,a=e.itemSize,l=e.layout,s=e.width,c=t*a,u="horizontal"===n||"horizontal"===l?s:o,d=Math.ceil((u+r-c)/a);return Math.max(0,Math.min(i-1,t+d-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){var t=e.itemSize;if("number"!=typeof t)throw Error('An invalid "itemSize" prop has been specified. Value should be a number. "'+(null===t?"null":typeof t)+'" was specified.')}});function N(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}function V(e,t){for(var r in e)if(!(r in t))return!0;for(var n in t)if(e[n]!==t[n])return!0;return!1}var q=["style"],j=["style"];function G(e,t){var r=e.style,n=N(e,q),o=t.style,i=N(t,j);return!V(r,o)&&!V(n,i)}e.FixedSizeGrid=H,e.FixedSizeList=U,e.VariableSizeGrid=T,e.VariableSizeList=L,e.areEqual=G,e.shouldComponentUpdate=function(e,t){return!G(this.props,e)||V(this.state,t)},Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).ReactWindow={},e.React)}(this,(function(e,t){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)}var a=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function l(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(o=e[r],n=t[r],!(o===n||a(o)&&a(n)))return!1;var o,n;return!0}function s(e,t){var r;void 0===t&&(t=l);var o,n=[],i=!1;return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return i&&r===this&&t(a,n)||(o=e.apply(this,a),i=!0,r=this,n=a),o}}var c="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function u(e){cancelAnimationFrame(e.id)}function d(e,t){var r=c();var o={id:requestAnimationFrame((function n(){c()-r>=t?e.call(null):o.id=requestAnimationFrame(n)}))};return o}var f=-1;function h(e){if(void 0===e&&(e=!1),-1===f||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),f=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return f}var p=null;function m(e){if(void 0===e&&(e=!1),null===p||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var o=document.createElement("div"),n=o.style;return n.width="100px",n.height="100px",t.appendChild(o),document.body.appendChild(t),t.scrollLeft>0?p="positive-descending":(t.scrollLeft=1,p=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),p}return p}var v=function(e){var t=e.columnIndex;e.data;return e.rowIndex+":"+t},g=null,w=null,S=null;function I(e){var n,a=e.getColumnOffset,l=e.getColumnStartIndexForOffset,c=e.getColumnStopIndexForStartIndex,f=e.getColumnWidth,p=e.getEstimatedTotalHeight,g=e.getEstimatedTotalWidth,w=e.getOffsetForColumnAndAlignment,S=e.getOffsetForRowAndAlignment,I=e.getRowHeight,y=e.getRowOffset,x=e.getRowStartIndexForOffset,C=e.getRowStopIndexForStartIndex,_=e.initInstanceProps,b=e.shouldResetStyleCacheOnItemSizeChange,R=e.validateProps;return(n=function(e){function n(t){var r;return(r=e.call(this,t)||this)._instanceProps=_(r.props,o(r)),r._resetIsScrollingTimeoutId=null,r._outerRef=void 0,r.state={instance:o(r),isScrolling:!1,horizontalScrollDirection:"forward",scrollLeft:"number"==typeof r.props.initialScrollLeft?r.props.initialScrollLeft:0,scrollTop:"number"==typeof r.props.initialScrollTop?r.props.initialScrollTop:0,scrollUpdateWasRequested:!1,verticalScrollDirection:"forward"},r._callOnItemsRendered=void 0,r._callOnItemsRendered=s((function(e,t,o,n,i,a,l,s){return r.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:o,overscanRowStopIndex:n,visibleColumnStartIndex:i,visibleColumnStopIndex:a,visibleRowStartIndex:l,visibleRowStopIndex:s})})),r._callOnScroll=void 0,r._callOnScroll=s((function(e,t,o,n,i){return r.props.onScroll({horizontalScrollDirection:o,scrollLeft:e,scrollTop:t,verticalScrollDirection:n,scrollUpdateWasRequested:i})})),r._getItemStyle=void 0,r._getItemStyle=function(e,t){var o,n=r.props,i=n.columnWidth,l=n.direction,s=n.rowHeight,c=r._getItemStyleCache(b&&i,b&&l,b&&s),u=e+":"+t;if(c.hasOwnProperty(u))o=c[u];else{var d=a(r.props,t,r._instanceProps),h="rtl"===l;c[u]=o={position:"absolute",left:h?void 0:d,right:h?d:void 0,top:y(r.props,e,r._instanceProps),height:I(r.props,e,r._instanceProps),width:f(r.props,t,r._instanceProps)}}return o},r._getItemStyleCache=void 0,r._getItemStyleCache=s((function(e,t,r){return{}})),r._onScroll=function(e){var t=e.currentTarget,o=t.clientHeight,n=t.clientWidth,i=t.scrollLeft,a=t.scrollTop,l=t.scrollHeight,s=t.scrollWidth;r.setState((function(e){if(e.scrollLeft===i&&e.scrollTop===a)return null;var t=r.props.direction,c=i;if("rtl"===t)switch(m()){case"negative":c=-i;break;case"positive-descending":c=s-n-i}c=Math.max(0,Math.min(c,s-n));var u=Math.max(0,Math.min(a,l-o));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<i?"forward":"backward",scrollLeft:c,scrollTop:u,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&u(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=d(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},(function(){r._getItemStyleCache(-1)}))},r}i(n,e),n.getDerivedStateFromProps=function(e,t){return M(e,t),R(e),null};var T=n.prototype;return T.scrollTo=function(e){var t=e.scrollLeft,r=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==r&&(r=Math.max(0,r)),this.setState((function(e){return void 0===t&&(t=e.scrollLeft),void 0===r&&(r=e.scrollTop),e.scrollLeft===t&&e.scrollTop===r?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:r,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<r?"forward":"backward"}}),this._resetIsScrollingDebounced)},T.scrollToItem=function(e){var t=e.align,r=void 0===t?"auto":t,o=e.columnIndex,n=e.rowIndex,i=this.props,a=i.columnCount,l=i.height,s=i.rowCount,c=i.width,u=this.state,d=u.scrollLeft,f=u.scrollTop,m=h();void 0!==o&&(o=Math.max(0,Math.min(o,a-1))),void 0!==n&&(n=Math.max(0,Math.min(n,s-1)));var v=p(this.props,this._instanceProps),I=g(this.props,this._instanceProps)>c?m:0,M=v>l?m:0;this.scrollTo({scrollLeft:void 0!==o?w(this.props,o,r,d,this._instanceProps,M):d,scrollTop:void 0!==n?S(this.props,n,r,f,this._instanceProps,I):f})},T.componentDidMount=function(){var e=this.props,t=e.initialScrollLeft,r=e.initialScrollTop;if(null!=this._outerRef){var o=this._outerRef;"number"==typeof t&&(o.scrollLeft=t),"number"==typeof r&&(o.scrollTop=r)}this._callPropsCallbacks()},T.componentDidUpdate=function(){var e=this.props.direction,t=this.state,r=t.scrollLeft,o=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var n=this._outerRef;if("rtl"===e)switch(m()){case"negative":n.scrollLeft=-r;break;case"positive-ascending":n.scrollLeft=r;break;default:var i=n.clientWidth,a=n.scrollWidth;n.scrollLeft=a-i-r}else n.scrollLeft=Math.max(0,r);n.scrollTop=Math.max(0,o)}this._callPropsCallbacks()},T.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&u(this._resetIsScrollingTimeoutId)},T.render=function(){var e=this.props,o=e.children,n=e.className,i=e.columnCount,a=e.direction,l=e.height,s=e.innerRef,c=e.innerElementType,u=e.innerTagName,d=e.itemData,f=e.itemKey,h=void 0===f?v:f,m=e.outerElementType,w=e.outerTagName,S=e.rowCount,I=e.style,M=e.useIsScrolling,y=e.width,x=this.state.isScrolling,C=this._getHorizontalRangeToRender(),_=C[0],b=C[1],R=this._getVerticalRangeToRender(),T=R[0],z=R[1],O=[];if(i>0&&S)for(var P=T;P<=z;P++)for(var W=_;W<=b;W++)O.push(t.createElement(o,{columnIndex:W,data:d,isScrolling:M?x:void 0,key:h({columnIndex:W,data:d,rowIndex:P}),rowIndex:P,style:this._getItemStyle(P,W)}));var E=p(this.props,this._instanceProps),A=g(this.props,this._instanceProps);return t.createElement(m||w||"div",{className:n,onScroll:this._onScroll,ref:this._outerRefSetter,style:r({position:"relative",height:l,width:y,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:a},I)},t.createElement(c||u||"div",{children:O,ref:s,style:{height:E,pointerEvents:x?"none":void 0,width:A}}))},T._callPropsCallbacks=function(){var e=this.props,t=e.columnCount,r=e.onItemsRendered,o=e.onScroll,n=e.rowCount;if("function"==typeof r&&t>0&&n>0){var i=this._getHorizontalRangeToRender(),a=i[0],l=i[1],s=i[2],c=i[3],u=this._getVerticalRangeToRender(),d=u[0],f=u[1],h=u[2],p=u[3];this._callOnItemsRendered(a,l,d,f,s,c,h,p)}if("function"==typeof o){var m=this.state,v=m.horizontalScrollDirection,g=m.scrollLeft,w=m.scrollTop,S=m.scrollUpdateWasRequested,I=m.verticalScrollDirection;this._callOnScroll(g,w,v,I,S)}},T._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,r=e.overscanColumnCount,o=e.overscanColumnsCount,n=e.overscanCount,i=e.rowCount,a=this.state,s=a.horizontalScrollDirection,u=a.isScrolling,d=a.scrollLeft,f=r||o||n||1;if(0===t||0===i)return[0,0,0,0];var h=l(this.props,d,this._instanceProps),p=c(this.props,h,d,this._instanceProps),m=u&&"backward"!==s?1:Math.max(1,f),v=u&&"forward"!==s?1:Math.max(1,f);return[Math.max(0,h-m),Math.max(0,Math.min(t-1,p+v)),h,p]},T._getVerticalRangeToRender=function(){var e=this.props,t=e.columnCount,r=e.overscanCount,o=e.overscanRowCount,n=e.overscanRowsCount,i=e.rowCount,a=this.state,l=a.isScrolling,s=a.verticalScrollDirection,c=a.scrollTop,u=o||n||r||1;if(0===t||0===i)return[0,0,0,0];var d=x(this.props,c,this._instanceProps),f=C(this.props,d,c,this._instanceProps),h=l&&"backward"!==s?1:Math.max(1,u),p=l&&"forward"!==s?1:Math.max(1,u);return[Math.max(0,d-h),Math.max(0,Math.min(i-1,f+p)),d,f]},n}(t.PureComponent)).defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},n}"undefined"!=typeof window&&void 0!==window.WeakSet&&(g=new WeakSet,w=new WeakSet,S=new WeakSet);var M=function(e,t){var r=e.children,o=e.direction,n=e.height,i=e.innerTagName,a=e.outerTagName,l=e.overscanColumnsCount,s=e.overscanCount,c=e.overscanRowsCount,u=e.width,d=t.instance;if("number"==typeof s&&g&&!g.has(d)&&(g.add(d),console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")),"number"!=typeof l&&"number"!=typeof c||w&&!w.has(d)&&(w.add(d),console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")),null==i&&null==a||S&&!S.has(d)&&(S.add(d),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")),null==r)throw Error('An invalid "children" prop has been specified. Value should be a React component. "'+(null===r?"null":typeof r)+'" was specified.');switch(o){case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". "'+o+'" was specified.')}if("number"!=typeof u)throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. "'+(null===u?"null":typeof u)+'" was specified.');if("number"!=typeof n)throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. "'+(null===n?"null":typeof n)+'" was specified.')},y=function(e,t){var r=e.rowCount,o=t.rowMetadataMap,n=t.estimatedRowHeight,i=t.lastMeasuredRowIndex,a=0;if(i>=r&&(i=r-1),i>=0){var l=o[i];a=l.offset+l.size}return a+(r-i-1)*n},x=function(e,t){var r=e.columnCount,o=t.columnMetadataMap,n=t.estimatedColumnWidth,i=t.lastMeasuredColumnIndex,a=0;if(i>=r&&(i=r-1),i>=0){var l=o[i];a=l.offset+l.size}return a+(r-i-1)*n},C=function(e,t,r,o){var n,i,a;if("column"===e?(n=o.columnMetadataMap,i=t.columnWidth,a=o.lastMeasuredColumnIndex):(n=o.rowMetadataMap,i=t.rowHeight,a=o.lastMeasuredRowIndex),r>a){var l=0;if(a>=0){var s=n[a];l=s.offset+s.size}for(var c=a+1;c<=r;c++){var u=i(c);n[c]={offset:l,size:u},l+=u}"column"===e?o.lastMeasuredColumnIndex=r:o.lastMeasuredRowIndex=r}return n[r]},_=function(e,t,r,o){var n,i;return"column"===e?(n=r.columnMetadataMap,i=r.lastMeasuredColumnIndex):(n=r.rowMetadataMap,i=r.lastMeasuredRowIndex),(i>0?n[i].offset:0)>=o?b(e,t,r,i,0,o):R(e,t,r,Math.max(0,i),o)},b=function(e,t,r,o,n,i){for(;n<=o;){var a=n+Math.floor((o-n)/2),l=C(e,t,a,r).offset;if(l===i)return a;l<i?n=a+1:l>i&&(o=a-1)}return n>0?n-1:0},R=function(e,t,r,o,n){for(var i="column"===e?t.columnCount:t.rowCount,a=1;o<i&&C(e,t,o,r).offset<n;)o+=a,a*=2;return b(e,t,r,Math.min(o,i-1),Math.floor(o/2),n)},T=function(e,t,r,o,n,i,a){var l="column"===e?t.width:t.height,s=C(e,t,r,i),c="column"===e?x(t,i):y(t,i),u=Math.max(0,Math.min(c-l,s.offset)),d=Math.max(0,s.offset-l+a+s.size);switch("smart"===o&&(o=n>=d-l&&n<=u+l?"auto":"center"),o){case"start":return u;case"end":return d;case"center":return Math.round(d+(u-d)/2);case"auto":default:return n>=d&&n<=u?n:d>u||n<d?d:u}},z=I({getColumnOffset:function(e,t,r){return C("column",e,t,r).offset},getColumnStartIndexForOffset:function(e,t,r){return _("column",e,r,t)},getColumnStopIndexForStartIndex:function(e,t,r,o){for(var n=e.columnCount,i=e.width,a=C("column",e,t,o),l=r+i,s=a.offset+a.size,c=t;c<n-1&&s<l;)c++,s+=C("column",e,c,o).size;return c},getColumnWidth:function(e,t,r){return r.columnMetadataMap[t].size},getEstimatedTotalHeight:y,getEstimatedTotalWidth:x,getOffsetForColumnAndAlignment:function(e,t,r,o,n,i){return T("column",e,t,r,o,n,i)},getOffsetForRowAndAlignment:function(e,t,r,o,n,i){return T("row",e,t,r,o,n,i)},getRowOffset:function(e,t,r){return C("row",e,t,r).offset},getRowHeight:function(e,t,r){return r.rowMetadataMap[t].size},getRowStartIndexForOffset:function(e,t,r){return _("row",e,r,t)},getRowStopIndexForStartIndex:function(e,t,r,o){for(var n=e.rowCount,i=e.height,a=C("row",e,t,o),l=r+i,s=a.offset+a.size,c=t;c<n-1&&s<l;)c++,s+=C("row",e,c,o).size;return c},initInstanceProps:function(e,t){var r=e,o={columnMetadataMap:{},estimatedColumnWidth:r.estimatedColumnWidth||50,estimatedRowHeight:r.estimatedRowHeight||50,lastMeasuredColumnIndex:-1,lastMeasuredRowIndex:-1,rowMetadataMap:{}};return t.resetAfterColumnIndex=function(e,r){void 0===r&&(r=!0),t.resetAfterIndices({columnIndex:e,shouldForceUpdate:r})},t.resetAfterRowIndex=function(e,r){void 0===r&&(r=!0),t.resetAfterIndices({rowIndex:e,shouldForceUpdate:r})},t.resetAfterIndices=function(e){var r=e.columnIndex,n=e.rowIndex,i=e.shouldForceUpdate,a=void 0===i||i;"number"==typeof r&&(o.lastMeasuredColumnIndex=Math.min(o.lastMeasuredColumnIndex,r-1)),"number"==typeof n&&(o.lastMeasuredRowIndex=Math.min(o.lastMeasuredRowIndex,n-1)),t._getItemStyleCache(-1),a&&t.forceUpdate()},o},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){var t=e.columnWidth,r=e.rowHeight;if("function"!=typeof t)throw Error('An invalid "columnWidth" prop has been specified. Value should be a function. "'+(null===t?"null":typeof t)+'" was specified.');if("function"!=typeof r)throw Error('An invalid "rowHeight" prop has been specified. Value should be a function. "'+(null===r?"null":typeof r)+'" was specified.')}}),O=function(e,t){return e},P=null,W=null;function E(e){var n,a=e.getItemOffset,l=e.getEstimatedTotalSize,c=e.getItemSize,f=e.getOffsetForIndexAndAlignment,p=e.getStartIndexForOffset,v=e.getStopIndexForStartIndex,g=e.initInstanceProps,w=e.shouldResetStyleCacheOnItemSizeChange,S=e.validateProps;return(n=function(e){function n(t){var r;return(r=e.call(this,t)||this)._instanceProps=g(r.props,o(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:o(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=s((function(e,t,o,n){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:o,visibleStopIndex:n})})),r._callOnScroll=void 0,r._callOnScroll=s((function(e,t,o){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:o})})),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,o=r.props,n=o.direction,i=o.itemSize,l=o.layout,s=r._getItemStyleCache(w&&i,w&&l,w&&n);if(s.hasOwnProperty(e))t=s[e];else{var u=a(r.props,e,r._instanceProps),d=c(r.props,e,r._instanceProps),f="horizontal"===n||"horizontal"===l,h="rtl"===n,p=f?u:0;s[e]=t={position:"absolute",left:h?void 0:p,right:h?p:void 0,top:f?0:u,height:f?"100%":d,width:f?d:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=s((function(e,t,r){return{}})),r._onScrollHorizontal=function(e){var t=e.currentTarget,o=t.clientWidth,n=t.scrollLeft,i=t.scrollWidth;r.setState((function(e){if(e.scrollOffset===n)return null;var t=r.props.direction,a=n;if("rtl"===t)switch(m()){case"negative":a=-n;break;case"positive-descending":a=i-o-n}return a=Math.max(0,Math.min(a,i-o)),{isScrolling:!0,scrollDirection:e.scrollOffset<n?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,o=t.clientHeight,n=t.scrollHeight,i=t.scrollTop;r.setState((function(e){if(e.scrollOffset===i)return null;var t=Math.max(0,Math.min(i,n-o));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&u(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=d(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},(function(){r._getItemStyleCache(-1,null)}))},r}i(n,e),n.getDerivedStateFromProps=function(e,t){return A(e,t),S(e),null};var I=n.prototype;return I.scrollTo=function(e){e=Math.max(0,e),this.setState((function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}}),this._resetIsScrollingDebounced)},I.scrollToItem=function(e,t){void 0===t&&(t="auto");var r=this.props,o=r.itemCount,n=r.layout,i=this.state.scrollOffset;e=Math.max(0,Math.min(e,o-1));var a=0;if(this._outerRef){var l=this._outerRef;a="vertical"===n?l.scrollWidth>l.clientWidth?h():0:l.scrollHeight>l.clientHeight?h():0}this.scrollTo(f(this.props,e,t,i,this._instanceProps,a))},I.componentDidMount=function(){var e=this.props,t=e.direction,r=e.initialScrollOffset,o=e.layout;if("number"==typeof r&&null!=this._outerRef){var n=this._outerRef;"horizontal"===t||"horizontal"===o?n.scrollLeft=r:n.scrollTop=r}this._callPropsCallbacks()},I.componentDidUpdate=function(){var e=this.props,t=e.direction,r=e.layout,o=this.state,n=o.scrollOffset;if(o.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("horizontal"===t||"horizontal"===r)if("rtl"===t)switch(m()){case"negative":i.scrollLeft=-n;break;case"positive-ascending":i.scrollLeft=n;break;default:var a=i.clientWidth,l=i.scrollWidth;i.scrollLeft=l-a-n}else i.scrollLeft=n;else i.scrollTop=n}this._callPropsCallbacks()},I.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&u(this._resetIsScrollingTimeoutId)},I.render=function(){var e=this.props,o=e.children,n=e.className,i=e.direction,a=e.height,s=e.innerRef,c=e.innerElementType,u=e.innerTagName,d=e.itemCount,f=e.itemData,h=e.itemKey,p=void 0===h?O:h,m=e.layout,v=e.outerElementType,g=e.outerTagName,w=e.style,S=e.useIsScrolling,I=e.width,M=this.state.isScrolling,y="horizontal"===i||"horizontal"===m,x=y?this._onScrollHorizontal:this._onScrollVertical,C=this._getRangeToRender(),_=C[0],b=C[1],R=[];if(d>0)for(var T=_;T<=b;T++)R.push(t.createElement(o,{data:f,key:p(T,f),index:T,isScrolling:S?M:void 0,style:this._getItemStyle(T)}));var z=l(this.props,this._instanceProps);return t.createElement(v||g||"div",{className:n,onScroll:x,ref:this._outerRefSetter,style:r({position:"relative",height:a,width:I,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},w)},t.createElement(c||u||"div",{children:R,ref:s,style:{height:y?"100%":z,pointerEvents:M?"none":void 0,width:y?z:"100%"}}))},I._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],r=e[1],o=e[2],n=e[3];this._callOnItemsRendered(t,r,o,n)}if("function"==typeof this.props.onScroll){var i=this.state,a=i.scrollDirection,l=i.scrollOffset,s=i.scrollUpdateWasRequested;this._callOnScroll(a,l,s)}},I._getRangeToRender=function(){var e=this.props,t=e.itemCount,r=e.overscanCount,o=this.state,n=o.isScrolling,i=o.scrollDirection,a=o.scrollOffset;if(0===t)return[0,0,0,0];var l=p(this.props,a,this._instanceProps),s=v(this.props,l,a,this._instanceProps),c=n&&"backward"!==i?1:Math.max(1,r),u=n&&"forward"!==i?1:Math.max(1,r);return[Math.max(0,l-c),Math.max(0,Math.min(t-1,s+u)),l,s]},n}(t.PureComponent)).defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},n}"undefined"!=typeof window&&void 0!==window.WeakSet&&(P=new WeakSet,W=new WeakSet);var A=function(e,t){var r=e.children,o=e.direction,n=e.height,i=e.layout,a=e.innerTagName,l=e.outerTagName,s=e.width,c=t.instance;null==a&&null==l||W&&!W.has(c)&&(W.add(c),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var u="horizontal"===o||"horizontal"===i;switch(o){case"horizontal":case"vertical":P&&!P.has(c)&&(P.add(c),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". "'+o+'" was specified.')}switch(i){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". "'+i+'" was specified.')}if(null==r)throw Error('An invalid "children" prop has been specified. Value should be a React component. "'+(null===r?"null":typeof r)+'" was specified.');if(u&&"number"!=typeof s)throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. "'+(null===s?"null":typeof s)+'" was specified.');if(!u&&"number"!=typeof n)throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. "'+(null===n?"null":typeof n)+'" was specified.')},k=function(e,t,r){var o=e.itemSize,n=r.itemMetadataMap,i=r.lastMeasuredIndex;if(t>i){var a=0;if(i>=0){var l=n[i];a=l.offset+l.size}for(var s=i+1;s<=t;s++){var c=o(s);n[s]={offset:a,size:c},a+=c}r.lastMeasuredIndex=t}return n[t]},D=function(e,t,r,o,n){for(;o<=r;){var i=o+Math.floor((r-o)/2),a=k(e,i,t).offset;if(a===n)return i;a<n?o=i+1:a>n&&(r=i-1)}return o>0?o-1:0},F=function(e,t,r,o){for(var n=e.itemCount,i=1;r<n&&k(e,r,t).offset<o;)r+=i,i*=2;return D(e,t,Math.min(r,n-1),Math.floor(r/2),o)},L=function(e,t){var r=e.itemCount,o=t.itemMetadataMap,n=t.estimatedItemSize,i=t.lastMeasuredIndex,a=0;if(i>=r&&(i=r-1),i>=0){var l=o[i];a=l.offset+l.size}return a+(r-i-1)*n},H=E({getItemOffset:function(e,t,r){return k(e,t,r).offset},getItemSize:function(e,t,r){return r.itemMetadataMap[t].size},getEstimatedTotalSize:L,getOffsetForIndexAndAlignment:function(e,t,r,o,n,i){var a=e.direction,l=e.height,s=e.layout,c=e.width,u="horizontal"===a||"horizontal"===s?c:l,d=k(e,t,n),f=L(e,n),h=Math.max(0,Math.min(f-u,d.offset)),p=Math.max(0,d.offset-u+d.size+i);switch("smart"===r&&(r=o>=p-u&&o<=h+u?"auto":"center"),r){case"start":return h;case"end":return p;case"center":return Math.round(p+(h-p)/2);case"auto":default:return o>=p&&o<=h?o:o<p?p:h}},getStartIndexForOffset:function(e,t,r){return function(e,t,r){var o=t.itemMetadataMap,n=t.lastMeasuredIndex;return(n>0?o[n].offset:0)>=r?D(e,t,n,0,r):F(e,t,Math.max(0,n),r)}(e,r,t)},getStopIndexForStartIndex:function(e,t,r,o){for(var n=e.direction,i=e.height,a=e.itemCount,l=e.layout,s=e.width,c="horizontal"===n||"horizontal"===l?s:i,u=k(e,t,o),d=r+c,f=u.offset+u.size,h=t;h<a-1&&f<d;)h++,f+=k(e,h,o).size;return h},initInstanceProps:function(e,t){var r={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,o){void 0===o&&(o=!0),r.lastMeasuredIndex=Math.min(r.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),o&&t.forceUpdate()},r},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){var t=e.itemSize;if("function"!=typeof t)throw Error('An invalid "itemSize" prop has been specified. Value should be a function. "'+(null===t?"null":typeof t)+'" was specified.')}}),U=I({getColumnOffset:function(e,t){return t*e.columnWidth},getColumnWidth:function(e,t){return e.columnWidth},getRowOffset:function(e,t){return t*e.rowHeight},getRowHeight:function(e,t){return e.rowHeight},getEstimatedTotalHeight:function(e){var t=e.rowCount;return e.rowHeight*t},getEstimatedTotalWidth:function(e){var t=e.columnCount;return e.columnWidth*t},getOffsetForColumnAndAlignment:function(e,t,r,o,n,i){var a=e.columnCount,l=e.columnWidth,s=e.width,c=Math.max(0,a*l-s),u=Math.min(c,t*l),d=Math.max(0,t*l-s+i+l);switch("smart"===r&&(r=o>=d-s&&o<=u+s?"auto":"center"),r){case"start":return u;case"end":return d;case"center":var f=Math.round(d+(u-d)/2);return f<Math.ceil(s/2)?0:f>c+Math.floor(s/2)?c:f;case"auto":default:return o>=d&&o<=u?o:d>u||o<d?d:u}},getOffsetForRowAndAlignment:function(e,t,r,o,n,i){var a=e.rowHeight,l=e.height,s=e.rowCount,c=Math.max(0,s*a-l),u=Math.min(c,t*a),d=Math.max(0,t*a-l+i+a);switch("smart"===r&&(r=o>=d-l&&o<=u+l?"auto":"center"),r){case"start":return u;case"end":return d;case"center":var f=Math.round(d+(u-d)/2);return f<Math.ceil(l/2)?0:f>c+Math.floor(l/2)?c:f;case"auto":default:return o>=d&&o<=u?o:d>u||o<d?d:u}},getColumnStartIndexForOffset:function(e,t){var r=e.columnWidth,o=e.columnCount;return Math.max(0,Math.min(o-1,Math.floor(t/r)))},getColumnStopIndexForStartIndex:function(e,t,r){var o=e.columnWidth,n=e.columnCount,i=e.width,a=t*o,l=Math.ceil((i+r-a)/o);return Math.max(0,Math.min(n-1,t+l-1))},getRowStartIndexForOffset:function(e,t){var r=e.rowHeight,o=e.rowCount;return Math.max(0,Math.min(o-1,Math.floor(t/r)))},getRowStopIndexForStartIndex:function(e,t,r){var o=e.rowHeight,n=e.rowCount,i=e.height,a=t*o,l=Math.ceil((i+r-a)/o);return Math.max(0,Math.min(n-1,t+l-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){var t=e.columnWidth,r=e.rowHeight;if("number"!=typeof t)throw Error('An invalid "columnWidth" prop has been specified. Value should be a number. "'+(null===t?"null":typeof t)+'" was specified.');if("number"!=typeof r)throw Error('An invalid "rowHeight" prop has been specified. Value should be a number. "'+(null===r?"null":typeof r)+'" was specified.')}}),N=E({getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,r,o,n,i){var a=e.direction,l=e.height,s=e.itemCount,c=e.itemSize,u=e.layout,d=e.width,f="horizontal"===a||"horizontal"===u?d:l,h=Math.max(0,s*c-f),p=Math.min(h,t*c),m=Math.max(0,t*c-f+c+i);switch("smart"===r&&(r=o>=m-f&&o<=p+f?"auto":"center"),r){case"start":return p;case"end":return m;case"center":var v=Math.round(m+(p-m)/2);return v<Math.ceil(f/2)?0:v>h+Math.floor(f/2)?h:v;case"auto":default:return o>=m&&o<=p?o:o<m?m:p}},getStartIndexForOffset:function(e,t){var r=e.itemCount,o=e.itemSize;return Math.max(0,Math.min(r-1,Math.floor(t/o)))},getStopIndexForStartIndex:function(e,t,r){var o=e.direction,n=e.height,i=e.itemCount,a=e.itemSize,l=e.layout,s=e.width,c=t*a,u="horizontal"===o||"horizontal"===l?s:n,d=Math.ceil((u+r-c)/a);return Math.max(0,Math.min(i-1,t+d-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){var t=e.itemSize;if("number"!=typeof t)throw Error('An invalid "itemSize" prop has been specified. Value should be a number. "'+(null===t?"null":typeof t)+'" was specified.')}});function V(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}function q(e,t){for(var r in e)if(!(r in t))return!0;for(var o in t)if(e[o]!==t[o])return!0;return!1}var j=["style"],G=["style"];function K(e,t){var r=e.style,o=V(e,j),n=t.style,i=V(t,G);return!q(r,n)&&!q(o,i)}e.FixedSizeGrid=U,e.FixedSizeList=N,e.VariableSizeGrid=z,e.VariableSizeList=H,e.areEqual=K,e.shouldComponentUpdate=function(e,t){return!K(this.props,e)||q(this.state,t)},Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=index-dev.umd.js.map