(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1545],{3930:function(t,e,o){"use strict";var n=o(67294);e.Z=function(t){var e=(0,n.useRef)(t);return e.current=t,e}},45210:function(t,e,o){"use strict";var n=o(67294),r=o(3930),s=o(92770),i=o(31663);e.Z=function(t){i.Z&&!(0,s.mf)(t)&&console.error("useUnmount expected parameter is a function, got ".concat(typeof t));var e=(0,r.Z)(t);(0,n.useEffect)(function(){return function(){e.current()}},[])}},48002:function(t,e,o){"use strict";o.d(e,{n:function(){return s}});var n=o(92770),r=o(52982);function s(t,e){return r.Z?t?(0,n.mf)(t)?t():"current"in t?t.current:t:e:void 0}},92770:function(t,e,o){"use strict";o.d(e,{mf:function(){return n}});var n=function(t){return"function"==typeof t}},52982:function(t,e){"use strict";var o=!!("undefined"!=typeof window&&window.document&&window.document.createElement);e.Z=o},31663:function(t,e){"use strict";e.Z=!1},45553:function(){},58533:function(t,e,o){"use strict";var n=o(67294),r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},s=function(){return(s=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},i={Pixel:"Pixel",Percent:"Percent"},l={unit:i.Percent,value:.8};function c(t){return"number"==typeof t?{unit:i.Percent,value:100*t}:"string"==typeof t?t.match(/^(\d*(\.\d+)?)px$/)?{unit:i.Pixel,value:parseFloat(t)}:t.match(/^(\d*(\.\d+)?)%$/)?{unit:i.Percent,value:parseFloat(t)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),l):(console.warn("scrollThreshold should be string or number"),l)}var a=function(t){function e(e){var o=t.call(this,e)||this;return o.lastScrollTop=0,o.actionTriggered=!1,o.startY=0,o.currentY=0,o.dragging=!1,o.maxPullDownDistance=0,o.getScrollableTarget=function(){return o.props.scrollableTarget instanceof HTMLElement?o.props.scrollableTarget:"string"==typeof o.props.scrollableTarget?document.getElementById(o.props.scrollableTarget):(null===o.props.scrollableTarget&&console.warn("You are trying to pass scrollableTarget but it is null. This might\n        happen because the element may not have been added to DOM yet.\n        See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n      "),null)},o.onStart=function(t){!o.lastScrollTop&&(o.dragging=!0,t instanceof MouseEvent?o.startY=t.pageY:t instanceof TouchEvent&&(o.startY=t.touches[0].pageY),o.currentY=o.startY,o._infScroll&&(o._infScroll.style.willChange="transform",o._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},o.onMove=function(t){o.dragging&&(t instanceof MouseEvent?o.currentY=t.pageY:t instanceof TouchEvent&&(o.currentY=t.touches[0].pageY),o.currentY<o.startY||(o.currentY-o.startY>=Number(o.props.pullDownToRefreshThreshold)&&o.setState({pullToRefreshThresholdBreached:!0}),o.currentY-o.startY>1.5*o.maxPullDownDistance||!o._infScroll||(o._infScroll.style.overflow="visible",o._infScroll.style.transform="translate3d(0px, "+(o.currentY-o.startY)+"px, 0px)")))},o.onEnd=function(){o.startY=0,o.currentY=0,o.dragging=!1,o.state.pullToRefreshThresholdBreached&&(o.props.refreshFunction&&o.props.refreshFunction(),o.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){o._infScroll&&(o._infScroll.style.overflow="auto",o._infScroll.style.transform="none",o._infScroll.style.willChange="unset")})},o.onScrollListener=function(t){"function"==typeof o.props.onScroll&&setTimeout(function(){return o.props.onScroll&&o.props.onScroll(t)},0);var e=o.props.height||o._scrollableNode?t.target:document.documentElement.scrollTop?document.documentElement:document.body;o.actionTriggered||((o.props.inverse?o.isElementAtTop(e,o.props.scrollThreshold):o.isElementAtBottom(e,o.props.scrollThreshold))&&o.props.hasMore&&(o.actionTriggered=!0,o.setState({showLoader:!0}),o.props.next&&o.props.next()),o.lastScrollTop=e.scrollTop)},o.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:e.dataLength},o.throttledOnScrollListener=(function(t,e,o,n){var r,s=!1,i=0;function l(){r&&clearTimeout(r)}function c(){var c=this,a=Date.now()-i,h=arguments;function u(){i=Date.now(),o.apply(c,h)}s||(n&&!r&&u(),l(),void 0===n&&a>t?u():!0!==e&&(r=setTimeout(n?function(){r=void 0}:u,void 0===n?t-a:t)))}return"boolean"!=typeof e&&(n=o,o=e,e=void 0),c.cancel=function(){l(),s=!0},c})(150,o.onScrollListener).bind(o),o.onStart=o.onStart.bind(o),o.onMove=o.onMove.bind(o),o.onEnd=o.onEnd.bind(o),o}return!function(t,e){function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}(e,t),e.prototype.componentDidMount=function(){if(void 0===this.props.dataLength)throw Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),"function"!=typeof this.props.refreshFunction))throw Error('Mandatory prop "refreshFunction" missing.\n          Pull Down To Refresh functionality will not work\n          as expected. Check README.md for usage\'')},e.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},e.prototype.componentDidUpdate=function(t){this.props.dataLength!==t.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},e.getDerivedStateFromProps=function(t,e){return t.dataLength!==e.prevDataLength?s(s({},e),{prevDataLength:t.dataLength}):null},e.prototype.isElementAtTop=function(t,e){void 0===e&&(e=.8);var o=t===document.body||t===document.documentElement?window.screen.availHeight:t.clientHeight,n=c(e);return n.unit===i.Pixel?t.scrollTop<=n.value+o-t.scrollHeight+1:t.scrollTop<=n.value/100+o-t.scrollHeight+1},e.prototype.isElementAtBottom=function(t,e){void 0===e&&(e=.8);var o=t===document.body||t===document.documentElement?window.screen.availHeight:t.clientHeight,n=c(e);return n.unit===i.Pixel?t.scrollTop+o>=t.scrollHeight-n.value:t.scrollTop+o>=n.value/100*t.scrollHeight},e.prototype.render=function(){var t=this,e=s({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),o=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),r=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return n.createElement("div",{style:r,className:"infinite-scroll-component__outerdiv"},n.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(e){return t._infScroll=e},style:e},this.props.pullDownToRefresh&&n.createElement("div",{style:{position:"relative"},ref:function(e){return t._pullDown=e}},n.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!o&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},e}(n.Component);e.Z=a}}]);