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

react-smart-scroller

Package Overview
Dependencies
Maintainers
3
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-smart-scroller - npm Package Compare versions

Comparing version 1.1.20 to 1.1.21

2

dist/react-smart-scroller.cjs.production.min.js

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

"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e,n=t(require("react")),o=t(require("styled-components"));function i(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function r(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function l(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t,e){return e||(e=t.slice(0)),t.raw=e,t}!function(t){t[t.One=1]="One",t[t.Two=2]="Two",t[t.Three=3]="Three",t[t.Four=4]="Four"}(e||(e={}));var c=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.every(Boolean)},d=function(){},h=function(t){return t?Number(t.toString().replace("px","")):void 0},f=function(t,n,o,i,r){var l={top:0,right:0,bottom:0,left:0};if(!(t||n||o||i||r))return l;if(!t)return s({},l,{right:h(o),left:h(n),top:h(i),bottom:h(r)});var a=t.toString().split(" "),u=a.length,c=a.map(h);switch(u){case e.One:var d=c[0];return{top:d,right:d,bottom:d,left:d};case e.Two:var f=c[0],v=c[1];return{top:f,right:v,bottom:f,left:v};case e.Three:var p=c[1];return{top:c[0],right:p,bottom:c[2],left:p};case e.Four:default:return{top:c[0],right:c[1],bottom:c[2],left:c[3]}}},v=function(){return"undefined"==typeof window},p=function(t){return!v()&&navigator.userAgent.includes(t)},g=function(){return p("Mac")},m=function(){return p("Android")||p("iPhone")||p("iPad")};function w(){var t=u(["\n position: absolute;\n"]);return w=function(){return t},t}function C(){var t=u(["\n position: relative;\n background-color: ",";\n cursor: pointer;\n width: 10px;\n height: 100%;\n"]);return C=function(){return t},t}function b(){var t=u(["\n position: absolute;\n cursor: pointer;\n right: 0;\n height: 100%;\n background-color: ",";\n top: 0;\n width: 10px;\n display: flex;\n justify-content: center;\n"]);return b=function(){return t},t}function x(){var t=u(["\n box-sizing: border-box;\n"]);return x=function(){return t},t}function M(){var t=u(["\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow-x: hidden;\n overflow-y: scroll;\n margin-right: -20px;\n -webkit-overflow-scrolling: touch;\n"]);return M=function(){return t},t}var y=function(t){function e(e){var o;return(o=t.call(this,e)||this).state={scrollContainerHeight:0,deltaYOrigin:0,deltaY:0,thumbWidth:0,trackWidth:0,scrollHeight:0,scrollTop:0,padding:o.trackPadding,ratio:1},o.overflowContainerRef=n.createRef(),o.thumbRef=n.createRef(),o.trackRef=n.createRef(),o.measureContainers=o.measureContainers.bind(a(o)),o.onMouseDown=o.onMouseDown.bind(a(o)),o.onMouseDrag=o.onMouseDrag.bind(a(o)),o.onOverflowContentScroll=o.onOverflowContentScroll.bind(a(o)),o.deleteMouseMoveEvent=o.deleteMouseMoveEvent.bind(a(o)),o.onScrollbarClick=o.onScrollbarClick.bind(a(o)),o.onOverflowContentMouseDown=o.onOverflowContentMouseDown.bind(a(o)),o.onOverflowContentDrag=o.onOverflowContentDrag.bind(a(o)),o.deleteOverflowMouseMoveEvent=o.deleteOverflowMouseMoveEvent.bind(a(o)),o}l(e,t);var o=e.prototype;return o.componentDidMount=function(){window.addEventListener("resize",this.measureContainers),window.addEventListener("mouseup",this.deleteMouseMoveEvent),window.addEventListener("transitionend",this.measureContainers),window.addEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.addEventListener("load",this.measureContainers)},o.componentWillUnmount=function(){window.removeEventListener("resize",this.measureContainers),window.removeEventListener("mouseup",this.deleteMouseMoveEvent),window.removeEventListener("transitionend",this.measureContainers),window.removeEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.removeEventListener("load",this.measureContainers)},o.setStartPosition=function(){var t=this.props.startAt,e=this.overflowContainerRef.current,n=this.startElement;this.measureContainers(),e&&n&&(e.scrollTop=n.offsetTop-(t&&t.center?(e.clientHeight-n.clientHeight)/2:0))},o.scrollContainerReducedHeight=function(t){var e=this.state.padding;return t-(e.top+e.bottom)},o.measureContainers=function(t){var e=this,n=this.overflowContainerRef.current,o=this.thumbRef.current,i=this.trackRef.current,r=c(n,o,i);if(r){var s=this.scrollContainerReducedHeight(n.clientHeight);this.setState({scrollContainerHeight:s,thumbWidth:o.offsetWidth,trackWidth:i.clientWidth,scrollHeight:n.scrollHeight,ratio:(s-o.offsetHeight)/(n.scrollHeight-n.clientHeight)},(function(){t&&"load"===t.type&&e.setStartPosition()}))}if(r&&o.offsetTop+o.offsetHeight>n.clientHeight){var l=n.clientHeight-o.offsetHeight;n.scroll(0,n.scrollHeight),o.style.top=l+"px"}},o.onMouseDown=function(t){t.preventDefault();var e=this.thumbRef.current;e&&this.overflowContainerRef.current&&this.setState({deltaYOrigin:e.offsetTop,deltaY:t.clientY+this.state.padding.top}),window.addEventListener("mousemove",this.onMouseDrag)},o.onScrollbarClick=function(t){var e=t.clientY,n=this.state.padding,o=this.thumbRef.current,i=this.overflowContainerRef.current;if(c(o,i,e>=(h(o.style.top)||0)+i.getBoundingClientRect().top+n.top,e<=(h(o.style.top)||0)+i.getBoundingClientRect().top+o.offsetHeight+n.top))return null;var r=(i.scrollHeight-i.clientHeight)/(this.state.scrollContainerHeight-o.offsetHeight),s=i.getBoundingClientRect().top+o.offsetHeight/2+n.top;return i.scroll({top:r*(e-s),left:0,behavior:"smooth"})},o.deleteMouseMoveEvent=function(){window.removeEventListener("mousemove",this.onMouseDrag)},o.deleteOverflowMouseMoveEvent=function(){window.removeEventListener("mousemove",this.onOverflowContentDrag)},o.onMouseDrag=function(t){var e=this.state,n=this.overflowContainerRef.current,o=this.thumbRef.current,i=e.scrollContainerHeight-o.offsetHeight,r=t.clientY-e.deltaY+e.deltaYOrigin+e.padding.top,s=r>=0&&r<=i,l=c(Boolean(this.overflowContainerRef.current),Boolean(this.thumbRef.current));if(l&&!s){var a=r>0?n.scrollHeight-n.offsetHeight:0;o.style.top=(r<0?0:i)+"px",n.scroll(0,a)}l&&s&&(n.scroll(0,(n.scrollHeight-n.offsetHeight)/i*r),o.style.top=r+"px")},o.onOverflowContentScroll=function(){var t=this.thumbRef.current,e=this.overflowContainerRef.current;e&&t&&(t.style.top=e.scrollTop*this.state.ratio+"px")},o.onOverflowContentMouseDown=function(t){t.preventDefault();var e=this.overflowContainerRef.current;e&&this.setState({deltaY:t.clientY,scrollTop:e.scrollTop}),window.addEventListener("mousemove",this.onOverflowContentDrag)},o.onOverflowContentDrag=function(t){var e=this.state,n=this.overflowContainerRef.current;n&&0!==t.clientY&&n.scroll(0,e.scrollTop-(t.clientY-e.deltaY))},o.renderThumb=function(){var t=this.state,e=t.scrollContainerHeight,o=Number((100*e/t.scrollHeight).toFixed(0))*e/100+"px";return this.props.thumb?n.cloneElement(this.props.thumb,{ref:this.thumbRef,onMouseDown:this.onMouseDown,style:s({top:0,position:"relative",cursor:"pointer"},this.props.thumb.props.style)}):n.createElement(O,{ref:this.thumbRef,onMouseDown:this.onMouseDown,style:{height:o}})},o.renderScrollbar=function(){var t=!m()&&this.shouldRenderScrollbar;return n.createElement(R,{ref:this.trackRef,onClick:this.onScrollbarClick,style:s({color:"#bdc3c7",right:this.rightOffset,display:t?"flex":"none"},this.props.trackProps)},n.createElement(k,null,this.renderThumb()))},o.renderChildren=function(){var t=this,e=this.props.numCols,o=this.props.spacing/2,i=this.props.children;return n.Children.map(i,(function(r,l){var a=l!==n.Children.count(i)-1?"paddingBottom: "+o+"px":void 0,u=0!==l?"paddingTop: "+o+"px":void 0,c=e?"calc(100% / "+e+")":"auto",d=n.cloneElement(i[l],{style:s({display:"flex"},i[l].props.style)});return n.createElement(S,{id:"react-smart-scroller-"+l,style:{padding:o+"px 0",height:c,paddingTop:u,paddingBottom:a,marginRight:t.contentMargin}},d)}))},o.render=function(){var t=this.props,e=t.draggable;return n.createElement("div",{style:t.style},n.createElement(E,{style:{cursor:e?"pointer":"unset"},ref:this.overflowContainerRef,onScroll:this.onOverflowContentScroll,onMouseDown:e?this.onOverflowContentMouseDown:d},this.renderChildren()),this.renderScrollbar())},r(e,[{key:"shouldRenderScrollbar",get:function(){var t=this.overflowContainerRef.current,e=this.props.numCols;return!e&&t?t.clientHeight<t.scrollHeight:!(t&&t.children.length<=e)}},{key:"trackPadding",get:function(){var t=this.props.trackProps;return t?f(t.padding,t.paddingLeft,t.paddingRight,t.paddingTop,t.paddingBottom):{top:0,right:0,bottom:0,left:0}}},{key:"contentMargin",get:function(){var t=this.state,e=t.thumbWidth,n=t.trackWidth,o=n>e?n:e,i=g()?o+20:o;return!m()&&this.shouldRenderScrollbar?i+10+"px":"20px"}},{key:"rightOffset",get:function(){return this.state.thumbWidth>this.state.trackWidth?(this.state.thumbWidth-this.state.trackWidth)/2:0}},{key:"startElement",get:function(){if(this.props.startAt)return document.getElementById("react-smart-scroller-"+this.props.startAt.startIndex)}}]),e}(n.Component),E=o.div(M()),S=o.div(x()),R=o.div(b(),"#bdc3c7"),O=o.div(C(),"#2ecc71"),k=o.div(w());function D(){var t=u(["\n width: 20px;\n height: 20px;\n border-radius: 50%;\n margin: 0 3px;\n cursor: pointer;\n"]);return D=function(){return t},t}function L(){var t=u(["\n border: solid ",";\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 6px;\n transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n cursor: pointer;\n"]);return L=function(){return t},t}function W(){var t=u(["\n border: solid ",";\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 6px;\n transform: rotate(135deg);\n -webkit-transform: rotate(135deg);\n cursor: pointer;\n"]);return W=function(){return t},t}function T(){var t=u(["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 40px;\n"]);return T=function(){return t},t}function H(){var t=u(["\n position: relative;\n left: 0;\n background-color: ",";\n cursor: pointer;\n width: 100px;\n height: 10px;\n"]);return H=function(){return t},t}function P(){var t=u(["\n position: absolute;\n cursor: pointer;\n left: 0;\n width: 100%;\n background-color: ",";\n bottom: 0;\n height: 10px;\n display: flex;\n align-items: center;\n"]);return P=function(){return t},t}function I(){var t=u(["\n flex: 0 0 auto;\n box-sizing: border-box;\n"]);return I=function(){return t},t}function V(){var t=u(["\n display: flex;\n overflow-x: scroll;\n overflow-y: hidden;\n margin-bottom: -20px;\n -webkit-overflow-scrolling: touch;\n"]);return V=function(){return t},t}var X=function(t){function e(e){var o;return(o=t.call(this,e)||this).state={scrollContainerWidth:0,deltaXOrigin:0,deltaX:0,thumbHeight:0,trackHeight:0,scrollWidth:0,scrollLeft:0,padding:o.trackPadding,ratio:1,numberOfViews:0,paginationIndex:0},o.overflowContainerRef=n.createRef(),o.thumbRef=n.createRef(),o.trackRef=n.createRef(),o.paginationRef=n.createRef(),o.onNext=o.onNext.bind(a(o)),o.onPrevious=o.onPrevious.bind(a(o)),o.onDotClick=o.onDotClick.bind(a(o)),o.measureContainers=o.measureContainers.bind(a(o)),o.onMouseDown=o.onMouseDown.bind(a(o)),o.onMouseDrag=o.onMouseDrag.bind(a(o)),o.onOverflowContentScroll=o.onOverflowContentScroll.bind(a(o)),o.deleteMouseMoveEvent=o.deleteMouseMoveEvent.bind(a(o)),o.onScrollbarClick=o.onScrollbarClick.bind(a(o)),o.onOverflowContentDrag=o.onOverflowContentDrag.bind(a(o)),o.onOverflowContentMouseDown=o.onOverflowContentMouseDown.bind(a(o)),o.deleteOverflowMouseMoveEvent=o.deleteOverflowMouseMoveEvent.bind(a(o)),o}l(e,t);var o=e.prototype;return o.componentDidMount=function(){this.setState({numberOfViews:this.numberOfViews}),window.addEventListener("resize",this.measureContainers),window.addEventListener("mouseup",this.deleteMouseMoveEvent),window.addEventListener("transitionend",this.measureContainers),window.addEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.addEventListener("load",this.measureContainers)},o.componentWillUnmount=function(){window.removeEventListener("resize",this.measureContainers),window.removeEventListener("mouseup",this.deleteMouseMoveEvent),window.removeEventListener("transitionend",this.measureContainers),window.removeEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.removeEventListener("load",this.measureContainers)},o.scrollContainerReducedWidth=function(t){var e=this.state.padding;return t-(e.left+e.right)},o.setStartPosition=function(){var t=this.props.startAt,e=this.overflowContainerRef.current,n=this.startElement;this.measureContainers(),e&&n&&(e.scrollLeft=n.offsetLeft-(t&&t.center?(e.clientWidth-n.clientWidth)/2:0))},o.measureContainers=function(t){var e=this,n=this.overflowContainerRef.current,o=this.thumbRef.current,i=this.trackRef.current,r=c(n,o,i);if(r){var s=this.scrollContainerReducedWidth(n.clientWidth);this.setState({scrollContainerWidth:s,thumbHeight:o.offsetHeight,trackHeight:i.clientHeight,scrollWidth:n.scrollWidth,ratio:(s-o.offsetWidth)/(n.scrollWidth-n.clientWidth)},(function(){t&&"load"===t.type&&e.setStartPosition()}))}if(r&&o.offsetLeft+o.clientWidth>n.clientWidth){var l=n.clientWidth-o.clientWidth;n.scroll(n.scrollWidth,0),o.style.left=l+"px"}},o.onMouseDown=function(t){t.preventDefault(),this.thumbRef.current&&this.setState({deltaXOrigin:this.thumbRef.current.offsetLeft,deltaX:t.clientX+this.state.padding.left}),window.addEventListener("mousemove",this.onMouseDrag)},o.onScrollbarClick=function(t){var e=t.clientX,n=this.thumbRef.current,o=this.overflowContainerRef.current;if(c(n,o,e>=n.offsetLeft+o.getBoundingClientRect().left,e<=n.offsetLeft+o.getBoundingClientRect().left+n.offsetWidth))return null;var i=(o.scrollWidth-o.clientWidth)/(this.state.scrollContainerWidth-n.offsetWidth),r=o.getBoundingClientRect().left+n.offsetWidth/2+this.state.padding.left;return o.scroll({left:i*(e-r),top:0,behavior:"smooth"})},o.deleteMouseMoveEvent=function(){window.removeEventListener("mousemove",this.onMouseDrag)},o.deleteOverflowMouseMoveEvent=function(){window.removeEventListener("mousemove",this.onOverflowContentDrag)},o.onMouseDrag=function(t){var e=this.state,n=this.overflowContainerRef.current,o=this.thumbRef.current,i=e.scrollContainerWidth-o.offsetWidth,r=t.clientX-e.deltaX+e.deltaXOrigin,s=r>=0&&r<=i,l=c(Boolean(this.overflowContainerRef.current),Boolean(this.thumbRef.current));if(l&&!s){var a=r>0?n.scrollWidth-n.clientWidth:0;o.style.left=(r<0?0:i)+"px",n.scroll(a,0)}l&&s&&(n.scroll((n.scrollWidth-n.clientWidth)/i*r,0),o.style.left=r+"px")},o.onOverflowContentScroll=function(){var t,e,n=this.thumbRef.current,o=this.overflowContainerRef.current;o&&n&&(n.style.left=o.scrollLeft*this.state.ratio+"px");var i=(null==o?void 0:o.scrollLeft)||0,r=null===(t=this.childrenWidth)||void 0===t?void 0:t.reduce((function(t,e,n){var o;return t.concat({index:n+1,value:e.value+((null===(o=t[n-1])||void 0===o?void 0:o.value)||0)})}),[]),s=null==r||null===(e=r.reverse())||void 0===e?void 0:e.find((function(t){return i>=t.value}));this.setState({paginationIndex:s?s.index:0})},o.onOverflowContentMouseDown=function(t){t.preventDefault();var e=this.overflowContainerRef.current;e&&this.setState({deltaX:t.clientX,scrollLeft:e.scrollLeft}),window.addEventListener("mousemove",this.onOverflowContentDrag)},o.onOverflowContentDrag=function(t){var e=this.state,n=this.overflowContainerRef.current;n&&0!==t.clientX&&n.scroll(e.scrollLeft-(t.clientX-e.deltaX),0)},o.renderChildren=function(){var t=this,e=this.props.numCols,o=this.props.spacing/2,i=this.props.children;return n.Children.map(i,(function(r,s){var l=s!==n.Children.count(i)-1?"paddingRight: "+o+"px":void 0;return n.createElement(N,{id:"react-smart-scroller-"+s,style:{padding:"0 "+o+"px",flexBasis:e?"calc(100% / "+e+")":"unset",paddingRight:l,paddingLeft:0!==s?"paddingLeft: "+o+"px":void 0,marginBottom:t.contentMargin}},r)}))},o.renderThumb=function(){var t=this.state,e=t.scrollContainerWidth,o=Number((100*e/t.scrollWidth).toFixed(0))*e/100+"px";return this.props.thumb?n.cloneElement(this.props.thumb,{ref:this.thumbRef,onMouseDown:this.onMouseDown,style:s({left:0,position:"relative",cursor:"pointer"},this.props.thumb.props.style)}):n.createElement(z,{ref:this.thumbRef,onMouseDown:this.onMouseDown,style:{width:o}})},o.renderScrollbar=function(){var t,e,o=!m()&&this.shouldRenderScrollbar&&!this.props.pagination,i=(null===(t=this.props.paginationConfig)||void 0===t?void 0:t.withScroll)?{bottom:(null===(e=this.paginationRef.current)||void 0===e?void 0:e.clientHeight)||40}:{bottom:0};return n.createElement(Y,{ref:this.trackRef,onClick:this.onScrollbarClick,style:s({color:"#bdc3c7",bottom:this.bottomOffset,display:o?"flex":"none"},this.props.trackProps,{},i)},this.renderThumb())},o.onNext=function(){var t=this.overflowContainerRef.current,e=this.state.paginationIndex,n=this.props.paginationConfig;if(t&&n&&n.withScroll&&e<this.numberOfViews-1){var o,i=e+1,r=(null===(o=t.children.item(e))||void 0===o?void 0:o.clientWidth)||0;return t.scroll({left:t.scrollLeft+r,top:0,behavior:"smooth"}),this.setState({paginationIndex:i})}},o.onPrevious=function(){var t=this.overflowContainerRef.current,e=this.state.paginationIndex,n=this.props.paginationConfig;if(t&&n&&n.withScroll&&e>0){var o,i=e-1,r=(null===(o=t.children.item(i))||void 0===o?void 0:o.clientWidth)||0;return t.scroll({left:t.scrollLeft-r,top:0,behavior:"smooth"}),this.setState({paginationIndex:i})}},o.onDotClick=function(t){var e=this.overflowContainerRef.current,n=this.props.paginationConfig;if(e&&n&&n.withScroll){var o,i=(null==e||null===(o=e.children.item(t))||void 0===o?void 0:o.offsetLeft)||0;return e.scroll({left:i,top:0,behavior:"smooth"}),this.setState({paginationIndex:t})}},o.renderDots=function(){var t=this,e=this.props.paginationConfig;return Array.from(Array(this.numberOfViews)).map((function(o,i){return n.createElement(F,{key:i,style:{backgroundColor:t.state.paginationIndex===i?(null==e?void 0:e.activeDotColor)||"#2ecc71":(null==e?void 0:e.unactiveDotsColor)||"#bdc3c7"},onClick:function(){return t.onDotClick(i)}})}))},o.renderPagination=function(){var t=this.props,e=t.renderPagination,o=t.paginationConfig,i=(null==o?void 0:o.withScroll)?{marginTop:20}:{marginTop:"unset"};if(e){var r=e({selectedDot:this.state.paginationIndex,onPrev:this.onPrevious,onNext:this.onNext,childrenCount:this.childrenCount,onDotClick:this.onDotClick});return n.cloneElement(r,{ref:this.paginationRef,style:s({},r.props.style,{marginTop:20})})}return n.createElement(A,{style:i,ref:this.paginationRef},n.createElement(j,{onClick:this.onPrevious}),this.renderDots(),n.createElement(_,{onClick:this.onNext}))},o.render=function(){var t=this.props,e=t.draggable,o=t.paginationConfig;return n.createElement("div",{style:t.style},n.createElement(B,{ref:this.overflowContainerRef,onScroll:this.onOverflowContentScroll,onMouseDown:e?this.onOverflowContentMouseDown:d,style:{cursor:e?"pointer":"unset"}},this.renderChildren()),this.renderScrollbar(),(null==o?void 0:o.withScroll)&&this.renderPagination())},r(e,[{key:"shouldRenderScrollbar",get:function(){var t=this.overflowContainerRef.current,e=this.props.numCols;return!e&&t?t.clientWidth<t.scrollWidth:!(t&&t.children.length<=e)}},{key:"trackPadding",get:function(){var t=this.props.trackProps;return t?f(t.padding,t.paddingLeft,t.paddingRight,t.paddingTop,t.paddingBottom):{top:0,right:0,bottom:0,left:0}}},{key:"contentMargin",get:function(){var t=this.state,e=t.thumbHeight,n=t.trackHeight,o=n>e?n:e,i=g()?o+20:o;return!m()&&this.shouldRenderScrollbar?i+10+"px":"20px"}},{key:"bottomOffset",get:function(){return this.state.thumbHeight>this.state.trackHeight?(this.state.thumbHeight-this.state.trackHeight)/2:0}},{key:"startElement",get:function(){if(this.props.startAt)return document.getElementById("react-smart-scroller-"+this.props.startAt.startIndex)}},{key:"childrenCount",get:function(){return n.Children.count(this.props.children)}},{key:"numberOfViews",get:function(){return Math.ceil(this.childrenCount/(this.props.numCols||1))}},{key:"childrenWidth",get:function(){var t=this;return n.Children.map(this.props.children,(function(e,n){var o,i;return{value:(null===(o=t.overflowContainerRef.current)||void 0===o||null===(i=o.children.item(n))||void 0===i?void 0:i.clientWidth)||0,index:n}}))}}]),e}(n.Component);X.defaultProps={spacing:0,vertical:!1,draggable:!1,pagination:!1};var B=o.div(V()),N=o.div(I()),Y=o.div(P(),"#bdc3c7"),z=o.div(H(),"#2ecc71"),A=o.div(T()),j=o.div(W(),"#000000"),_=o.div(L(),"#000000"),F=o.div(D());function U(){var t=u(["\n width: 20px;\n height: 20px;\n border-radius: 50%;\n margin: 0 3px;\n cursor: pointer;\n"]);return U=function(){return t},t}function q(){var t=u(["\n border: solid ",";\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 6px;\n transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n cursor: pointer;\n"]);return q=function(){return t},t}function G(){var t=u(["\n border: solid ",";\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 6px;\n transform: rotate(135deg);\n -webkit-transform: rotate(135deg);\n cursor: pointer;\n"]);return G=function(){return t},t}function J(){var t=u(["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 40px;\n"]);return J=function(){return t},t}function K(){var t=u(["\n flex: 0 0 auto;\n box-sizing: border-box;\n"]);return K=function(){return t},t}function Q(){var t=u(["\n display: flex;\n position: relative;\n -webkit-overflow-scrolling: touch;\n"]);return Q=function(){return t},t}function Z(){var t=u(["\n display: flex;\n flex-direction: column;\n"]);return Z=function(){return t},t}var $=function(t){function e(e){var o;return(o=t.call(this,e)||this).state={paginationIndex:0,numberOfViews:0,scrollValue:0,children:o.props.children,deltaX:0,scrollLeft:0,dragScroll:0,deltaY:0,horizontal:!1,lockedMove:!1},o.overflowContainerRef=n.createRef(),o.onNext=o.onNext.bind(a(o)),o.onPrevious=o.onPrevious.bind(a(o)),o.onDotClick=o.onDotClick.bind(a(o)),o.onTouchMove=o.onTouchMove.bind(a(o)),o.onTouchStart=o.onTouchStart.bind(a(o)),o.updatePosition=o.updatePosition.bind(a(o)),o.setStartPosition=o.setStartPosition.bind(a(o)),o.onOverflowContentDrag=o.onOverflowContentDrag.bind(a(o)),o.onOverflowContentScroll=o.onOverflowContentScroll.bind(a(o)),o.onOverflowContentMouseDown=o.onOverflowContentMouseDown.bind(a(o)),o.deleteOverflowMouseMoveEvent=o.deleteOverflowMouseMoveEvent.bind(a(o)),o}l(e,t);var o=e.prototype;return o.componentDidMount=function(){this.setState({numberOfViews:this.numberOfViews}),window.addEventListener("resize",this.updatePosition),window.addEventListener("touchstart",this.onTouchStart),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.deleteOverflowMouseMoveEvent),window.addEventListener("load",this.setStartPosition)},o.componentWillUnmount=function(){window.removeEventListener("resize",this.updatePosition),window.removeEventListener("touchstart",this.onTouchStart),window.removeEventListener("mousemove",this.onOverflowContentDrag),window.removeEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.deleteOverflowMouseMoveEvent),window.removeEventListener("load",this.setStartPosition)},o.setStartPosition=function(){var t=this.props,e=t.startAt,o=t.children,i=this.overflowContainerRef.current,r=this.props.numCols||1;if(i){var s=Math.ceil((e?e.startIndex:0)/r),l=n.Children.count(o),a=Math.ceil(l/r)-1,u=s<0?0:s>a?a:s,c=-u*i.offsetWidth;i.style.transform="translate("+c+"px)",this.setState({paginationIndex:u,scrollValue:c})}},o.updatePosition=function(){var t=this.props.children,e=this.overflowContainerRef.current,o=this.props.numCols||1;if(e){var i=Math.ceil(this.state.paginationIndex/o),r=n.Children.count(t),s=Math.ceil(r/o)-1,l=i<0?0:i>s?s:i,a=-l*e.offsetWidth;e.style.transform="translate("+a+"px)",this.setState({paginationIndex:l,scrollValue:a})}},o.onNext=function(){var t=this.overflowContainerRef.current,e=this.state,n=e.paginationIndex,o=e.scrollValue,i=this.props.paginationConfig;if(t&&i&&(null==i?void 0:i.withScroll)&&n<this.numberOfViews-1){var r,s=n+1,l=(null===(r=t.children.item(n))||void 0===r?void 0:r.clientWidth)||0;return t.scroll({left:t.scrollLeft+l,top:0,behavior:"smooth"}),this.setState({paginationIndex:s})}if(t&&n===this.numberOfViews-1&&i&&i.infinite)return t.style.transform="translate(0px)",this.setState({paginationIndex:0,scrollValue:0});if(t&&n<this.numberOfViews-1){var a,u,c,d=n+1;if(t.clientWidth+Math.abs(this.state.scrollValue)>=t.scrollWidth)return;var h=(null===(a=this.props.paginationConfig)||void 0===a?void 0:a.withScroll)||(null===(u=this.props.paginationConfig)||void 0===u?void 0:u.renderNextToEachOther)?o-((null===(c=t.children.item(n))||void 0===c?void 0:c.clientWidth)||0):o-t.offsetWidth;return t.style.transform="translate("+h+"px)",this.setState({paginationIndex:d,scrollValue:h})}},o.onPrevious=function(){var t=this.overflowContainerRef.current,e=this.state,n=e.paginationIndex,o=e.scrollValue,i=this.props.paginationConfig;if(t&&i&&(null==i?void 0:i.withScroll)&&n>0){var r,s=n-1,l=(null===(r=t.children.item(s))||void 0===r?void 0:r.clientWidth)||0;return t.scroll({left:t.scrollLeft-l,top:0,behavior:"smooth"}),this.setState({paginationIndex:s})}if(t&&0===n&&i&&i.infinite){var a,u,c,d=this.numberOfViews-1,h=(null===(a=this.props.paginationConfig)||void 0===a?void 0:a.withScroll)||(null===(u=this.props.paginationConfig)||void 0===u?void 0:u.renderNextToEachOther)?d+((null===(c=t.children.item(d))||void 0===c?void 0:c.clientWidth)||0):d*t.offsetWidth;return t.style.transform="translate(-"+h+"px)",this.setState({paginationIndex:d,scrollValue:-h})}if(t&&n>0){var f,v,p,g=n-1,m=(null===(f=this.props.paginationConfig)||void 0===f?void 0:f.withScroll)||(null===(v=this.props.paginationConfig)||void 0===v?void 0:v.renderNextToEachOther)?o+((null===(p=t.children.item(g))||void 0===p?void 0:p.clientWidth)||0):o+t.offsetWidth;return t.style.transform="translate("+m+"px)",this.setState({paginationIndex:g,scrollValue:m})}},o.onDotClick=function(t){var e=this.overflowContainerRef.current,n=this.state.paginationIndex,o=this.props.paginationConfig;if(e&&o&&((null==o?void 0:o.withScroll)||(null==o?void 0:o.renderNextToEachOther))){var i,r=(null==e||null===(i=e.children.item(t))||void 0===i?void 0:i.offsetLeft)||0;return e.scroll({left:r,top:0,behavior:"smooth"}),this.setState({paginationIndex:t})}if(e&&t!==n){var s,l,a,u=(null===(s=this.props.paginationConfig)||void 0===s?void 0:s.withScroll)||(null===(l=this.props.paginationConfig)||void 0===l?void 0:l.renderNextToEachOther)?-((null==e||null===(a=e.children.item(t))||void 0===a?void 0:a.offsetLeft)||0):-t*e.clientWidth;e.style.transform="translate("+u+"px)",this.setState({paginationIndex:t,scrollValue:u})}},o.onOverflowContentMouseDown=function(t){t.preventDefault();var e=this.overflowContainerRef.current,n=this.props.paginationConfig;e&&n&&n.draggable&&(e.style.transition="unset",e.style.transform="translate("+this.state.scrollValue+"px)",this.setState({deltaX:t.clientX,scrollLeft:this.state.scrollValue,dragScroll:this.state.scrollValue}),window.addEventListener("mousemove",this.onOverflowContentDrag),window.addEventListener("mouseup",this.deleteOverflowMouseMoveEvent))},o.onOverflowContentDrag=function(t){var e=this.state,n=this.overflowContainerRef.current,o=e.scrollLeft+(t.clientX-e.deltaX);n&&0!==t.clientX&&(n.style.transform="translate("+o+"px)",this.setState({dragScroll:o}))},o.onTouchStart=function(t){var e=this.state.scrollValue,n=t.touches.item(0),o=this.overflowContainerRef.current;this.setState({deltaX:n.clientX,scrollLeft:e,dragScroll:e,deltaY:n.clientY,horizontal:!1,lockedMove:!1}),o&&(o.style.transition="unset")},o.onTouchMove=function(t){var e=this.state,n=e.deltaX,o=e.scrollLeft,i=e.deltaY,r=e.horizontal,s=e.lockedMove,l=t.touches.item(0),a=this.overflowContainerRef.current,u=o+(l.clientX-n),c=this.props.paginationConfig,d=(null==c?void 0:c.minOffsetToChangeSlide)||50;if(!r&&s)return null;Math.abs(l.clientY-i)>d&&!s&&this.setState({horizontal:!1,lockedMove:!0}),Math.abs(l.clientX-n)>d&&!s&&this.setState({horizontal:!0,lockedMove:!0}),Math.abs(l.clientX-n)>d&&t.preventDefault(),a&&0!==l.clientX&&(a.style.transform="translate("+u+"px)",this.setState({dragScroll:u}))},o.deleteOverflowMouseMoveEvent=function(){var t=this.overflowContainerRef.current,e=this.state,n=e.dragScroll,o=e.paginationIndex,i=e.scrollLeft,r=this.props.paginationConfig,s=(null==r?void 0:r.minOffsetToChangeSlide)||150,l=(null==r?void 0:r.transitionTime)||1;if(t&&-i+n<-s){var a=o===this.childrenCount-1,u=a?o*t.clientWidth:(o+1)*t.clientWidth;t.style.transition="all "+l+"s",t.style.transform="translate(-"+u+"px)",this.setState({paginationIndex:a?o:o+1,scrollValue:-u})}if(t&&-i+n>s){var d=0===o,h=d?0:(o-1)*t.clientWidth;t.style.transition="all "+l+"s",t.style.transform="translate(-"+h+"px)",this.setState({paginationIndex:d?o:o-1,scrollValue:-h})}c(t,-i+n>-s,-i+n<s)&&(t.style.transition="all "+l+"s",t.style.transform="translate(-"+o*t.clientWidth+"px)"),window.removeEventListener("mousemove",this.onOverflowContentDrag),window.removeEventListener("mouseup",this.deleteOverflowMouseMoveEvent)},o.renderChildren=function(){var t=this,e=this.props.numCols,o=this.props.spacing/2,i=this.props.children;return n.Children.map(i,(function(r,s){var l,a,u=s!==n.Children.count(i)-1?"paddingRight: "+o+"px":void 0,c=(null===(l=t.props.paginationConfig)||void 0===l?void 0:l.withScroll)||(null===(a=t.props.paginationConfig)||void 0===a?void 0:a.renderNextToEachOther)?"unset":"100%";return n.createElement(nt,{id:"react-smart-scroller-"+s,style:{padding:"0 "+o+"px",flexBasis:e?"calc(100% / "+e+")":"unset",paddingRight:u,paddingLeft:0!==s?"paddingLeft: "+o+"px":void 0,width:c}},r)}))},o.renderDots=function(){var t=this,e=this.props.paginationConfig;return Array.from(Array(this.numberOfViews)).map((function(o,i){return n.createElement(st,{key:i,style:{backgroundColor:t.state.paginationIndex===i?(null==e?void 0:e.activeDotColor)||"#2ecc71":(null==e?void 0:e.unactiveDotsColor)||"#bdc3c7"},onClick:function(){return t.onDotClick(i)}})}))},o.renderPagination=function(){var t=this.props,e=t.renderPagination,o=t.paginationConfig,i=(null==o?void 0:o.withScroll)?{marginTop:20}:{marginTop:"unset"};return e?e({selectedDot:this.state.paginationIndex,onPrev:this.onPrevious,onNext:this.onNext,childrenCount:this.childrenCount,onDotClick:this.onDotClick}):n.createElement(ot,{style:i},n.createElement(it,{onClick:this.onPrevious}),this.renderDots(),n.createElement(rt,{onClick:this.onNext}))},o.onOverflowContentScroll=function(){var t,e,n=this.overflowContainerRef.current,o=(null==n?void 0:n.scrollLeft)||0,i=null===(t=this.childrenWidth)||void 0===t?void 0:t.reduce((function(t,e,n){var o;return t.concat({index:n+1,value:e.value+((null===(o=t[n-1])||void 0===o?void 0:o.value)||0)})}),[]),r=null==i||null===(e=i.reverse())||void 0===e?void 0:e.find((function(t){return o>=t.value}));this.setState({paginationIndex:r?r.index:0})},o.render=function(){var t=this.props,e=t.paginationConfig;return n.createElement(tt,{style:t.style},n.createElement(et,{ref:this.overflowContainerRef,style:s({transition:"all "+((null==e?void 0:e.transitionTime)||1)+"s",flex:1},(null==e?void 0:e.withScroll)?{overflowX:"auto",marginBottom:-20}:{overflowX:"unset",marginBottom:"unset"}),onScroll:this.onOverflowContentScroll,onMouseDown:m()?d:this.onOverflowContentMouseDown},this.renderChildren()),this.renderPagination())},r(e,[{key:"childrenCount",get:function(){return n.Children.count(this.props.children)}},{key:"numberOfViews",get:function(){return Math.ceil(this.childrenCount/(this.props.numCols||1))}},{key:"childrenWidth",get:function(){var t=this;return n.Children.map(this.props.children,(function(e,n){var o,i;return{value:(null===(o=t.overflowContainerRef.current)||void 0===o||null===(i=o.children.item(n))||void 0===i?void 0:i.clientWidth)||0,index:n}}))}}]),e}(n.Component),tt=o.div(Z()),et=o.div(Q()),nt=o.div(K()),ot=o.div(J()),it=o.div(G(),"#000000"),rt=o.div(q(),"#000000"),st=o.div(U());function lt(){var t=u(["\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: relative;\n"]);return lt=function(){return t},t}var at=function(t){function e(){return t.apply(this,arguments)||this}l(e,t);var o=e.prototype;return o.renderMain=function(){return n.createElement(this.props.pagination?$:this.props.vertical?y:X,Object.assign({},this.props))},o.render=function(){return v()?null:n.createElement(ut,null,this.renderMain())},e}(n.Component),ut=o.div(lt());exports.ReactSmartScroller=at;
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e,n=t(require("react")),o=t(require("styled-components"));function i(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function r(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function l(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t,e){return e||(e=t.slice(0)),t.raw=e,t}!function(t){t[t.One=1]="One",t[t.Two=2]="Two",t[t.Three=3]="Three",t[t.Four=4]="Four"}(e||(e={}));var c=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.every(Boolean)},d=function(){},h=function(t){return t?Number(t.toString().replace("px","")):void 0},f=function(t,n,o,i,r){var l={top:0,right:0,bottom:0,left:0};if(!(t||n||o||i||r))return l;if(!t)return s({},l,{right:h(o),left:h(n),top:h(i),bottom:h(r)});var a=t.toString().split(" "),u=a.length,c=a.map(h);switch(u){case e.One:var d=c[0];return{top:d,right:d,bottom:d,left:d};case e.Two:var f=c[0],v=c[1];return{top:f,right:v,bottom:f,left:v};case e.Three:var p=c[1];return{top:c[0],right:p,bottom:c[2],left:p};case e.Four:default:return{top:c[0],right:c[1],bottom:c[2],left:c[3]}}},v=function(){return"undefined"==typeof window},p=function(t){return!v()&&navigator.userAgent.includes(t)},g=function(){return p("Mac")},m=function(){return p("Android")||p("iPhone")||p("iPad")};function w(){var t=u(["\n position: absolute;\n"]);return w=function(){return t},t}function C(){var t=u(["\n position: relative;\n background-color: ",";\n cursor: pointer;\n width: 10px;\n height: 100%;\n"]);return C=function(){return t},t}function b(){var t=u(["\n position: absolute;\n cursor: pointer;\n right: 0;\n height: 100%;\n background-color: ",";\n top: 0;\n width: 10px;\n display: flex;\n justify-content: center;\n"]);return b=function(){return t},t}function x(){var t=u(["\n box-sizing: border-box;\n"]);return x=function(){return t},t}function M(){var t=u(["\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow-x: hidden;\n overflow-y: scroll;\n margin-right: -20px;\n -webkit-overflow-scrolling: touch;\n"]);return M=function(){return t},t}var y=function(t){function e(e){var o;return(o=t.call(this,e)||this).state={scrollContainerHeight:0,deltaYOrigin:0,deltaY:0,thumbWidth:0,trackWidth:0,scrollHeight:0,scrollTop:0,padding:o.trackPadding,ratio:1},o.overflowContainerRef=n.createRef(),o.thumbRef=n.createRef(),o.trackRef=n.createRef(),o.measureContainers=o.measureContainers.bind(a(o)),o.onMouseDown=o.onMouseDown.bind(a(o)),o.onMouseDrag=o.onMouseDrag.bind(a(o)),o.onOverflowContentScroll=o.onOverflowContentScroll.bind(a(o)),o.deleteMouseMoveEvent=o.deleteMouseMoveEvent.bind(a(o)),o.onScrollbarClick=o.onScrollbarClick.bind(a(o)),o.onOverflowContentMouseDown=o.onOverflowContentMouseDown.bind(a(o)),o.onOverflowContentDrag=o.onOverflowContentDrag.bind(a(o)),o.deleteOverflowMouseMoveEvent=o.deleteOverflowMouseMoveEvent.bind(a(o)),o}l(e,t);var o=e.prototype;return o.componentDidMount=function(){window.addEventListener("resize",this.measureContainers),window.addEventListener("mouseup",this.deleteMouseMoveEvent),window.addEventListener("transitionend",this.measureContainers),window.addEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.addEventListener("load",this.measureContainers)},o.componentWillUnmount=function(){window.removeEventListener("resize",this.measureContainers),window.removeEventListener("mouseup",this.deleteMouseMoveEvent),window.removeEventListener("transitionend",this.measureContainers),window.removeEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.removeEventListener("load",this.measureContainers)},o.setStartPosition=function(){var t=this.props.startAt,e=this.overflowContainerRef.current,n=this.startElement;this.measureContainers(),e&&n&&(e.scrollTop=n.offsetTop-(t&&t.center?(e.clientHeight-n.clientHeight)/2:0))},o.scrollContainerReducedHeight=function(t){var e=this.state.padding;return t-(e.top+e.bottom)},o.measureContainers=function(t){var e=this,n=this.overflowContainerRef.current,o=this.thumbRef.current,i=this.trackRef.current,r=c(n,o,i);if(r){var s=this.scrollContainerReducedHeight(n.clientHeight);this.setState({scrollContainerHeight:s,thumbWidth:o.offsetWidth,trackWidth:i.clientWidth,scrollHeight:n.scrollHeight,ratio:(s-o.offsetHeight)/(n.scrollHeight-n.clientHeight)},(function(){t&&"load"===t.type&&e.setStartPosition()}))}if(r&&o.offsetTop+o.offsetHeight>n.clientHeight){var l=n.clientHeight-o.offsetHeight;n.scroll(0,n.scrollHeight),o.style.top=l+"px"}},o.onMouseDown=function(t){t.preventDefault();var e=this.thumbRef.current;e&&this.overflowContainerRef.current&&this.setState({deltaYOrigin:e.offsetTop,deltaY:t.clientY+this.state.padding.top}),window.addEventListener("mousemove",this.onMouseDrag)},o.onScrollbarClick=function(t){var e=t.clientY,n=this.state.padding,o=this.thumbRef.current,i=this.overflowContainerRef.current;if(c(o,i,e>=(h(o.style.top)||0)+i.getBoundingClientRect().top+n.top,e<=(h(o.style.top)||0)+i.getBoundingClientRect().top+o.offsetHeight+n.top))return null;var r=(i.scrollHeight-i.clientHeight)/(this.state.scrollContainerHeight-o.offsetHeight),s=i.getBoundingClientRect().top+o.offsetHeight/2+n.top;return i.scroll({top:r*(e-s),left:0,behavior:"smooth"})},o.deleteMouseMoveEvent=function(){window.removeEventListener("mousemove",this.onMouseDrag)},o.deleteOverflowMouseMoveEvent=function(){window.removeEventListener("mousemove",this.onOverflowContentDrag)},o.onMouseDrag=function(t){var e=this.state,n=this.overflowContainerRef.current,o=this.thumbRef.current,i=e.scrollContainerHeight-o.offsetHeight,r=t.clientY-e.deltaY+e.deltaYOrigin+e.padding.top,s=r>=0&&r<=i,l=c(Boolean(this.overflowContainerRef.current),Boolean(this.thumbRef.current));if(l&&!s){var a=r>0?n.scrollHeight-n.offsetHeight:0;o.style.top=(r<0?0:i)+"px",n.scroll(0,a)}l&&s&&(n.scroll(0,(n.scrollHeight-n.offsetHeight)/i*r),o.style.top=r+"px")},o.onOverflowContentScroll=function(){var t=this.thumbRef.current,e=this.overflowContainerRef.current;e&&t&&(t.style.top=e.scrollTop*this.state.ratio+"px")},o.onOverflowContentMouseDown=function(t){t.preventDefault();var e=this.overflowContainerRef.current;e&&this.setState({deltaY:t.clientY,scrollTop:e.scrollTop}),window.addEventListener("mousemove",this.onOverflowContentDrag)},o.onOverflowContentDrag=function(t){var e=this.state,n=this.overflowContainerRef.current;n&&0!==t.clientY&&n.scroll(0,e.scrollTop-(t.clientY-e.deltaY))},o.renderThumb=function(){var t=this.state,e=t.scrollContainerHeight,o=Number((100*e/t.scrollHeight).toFixed(0))*e/100+"px";return this.props.thumb?n.cloneElement(this.props.thumb,{ref:this.thumbRef,onMouseDown:this.onMouseDown,style:s({top:0,position:"relative",cursor:"pointer"},this.props.thumb.props.style)}):n.createElement(O,{ref:this.thumbRef,onMouseDown:this.onMouseDown,style:{height:o}})},o.renderScrollbar=function(){var t=!m()&&this.shouldRenderScrollbar;return n.createElement(R,{ref:this.trackRef,onClick:this.onScrollbarClick,style:s({color:"#bdc3c7",right:this.rightOffset,display:t?"flex":"none"},this.props.trackProps)},n.createElement(k,null,this.renderThumb()))},o.renderChildren=function(){var t=this,e=this.props.numCols,o=this.props.spacing/2,i=this.props.children;return n.Children.map(i,(function(r,l){var a=l!==n.Children.count(i)-1?"paddingBottom: "+o+"px":void 0,u=0!==l?"paddingTop: "+o+"px":void 0,c=e?"calc(100% / "+e+")":"auto",d=n.cloneElement(i[l],{style:s({display:"flex"},i[l].props.style)});return n.createElement(S,{id:"react-smart-scroller-"+l,style:{padding:o+"px 0",height:c,paddingTop:u,paddingBottom:a,marginRight:t.contentMargin}},d)}))},o.render=function(){var t=this.props,e=t.draggable;return n.createElement("div",{style:t.style},n.createElement(E,{style:{cursor:e?"pointer":"unset"},ref:this.overflowContainerRef,onScroll:this.onOverflowContentScroll,onMouseDown:e?this.onOverflowContentMouseDown:d},this.renderChildren()),this.renderScrollbar())},r(e,[{key:"shouldRenderScrollbar",get:function(){var t=this.overflowContainerRef.current,e=this.props.numCols;return!e&&t?t.clientHeight<t.scrollHeight:!(t&&t.children.length<=e)}},{key:"trackPadding",get:function(){var t=this.props.trackProps;return t?f(t.padding,t.paddingLeft,t.paddingRight,t.paddingTop,t.paddingBottom):{top:0,right:0,bottom:0,left:0}}},{key:"contentMargin",get:function(){var t=this.state,e=t.thumbWidth,n=t.trackWidth,o=n>e?n:e,i=g()?o+20:o;return!m()&&this.shouldRenderScrollbar?i+10+"px":"20px"}},{key:"rightOffset",get:function(){return this.state.thumbWidth>this.state.trackWidth?(this.state.thumbWidth-this.state.trackWidth)/2:0}},{key:"startElement",get:function(){if(this.props.startAt)return document.getElementById("react-smart-scroller-"+this.props.startAt.startIndex)}}]),e}(n.Component),E=o.div(M()),S=o.div(x()),R=o.div(b(),"#bdc3c7"),O=o.div(C(),"#2ecc71"),k=o.div(w());function D(){var t=u(["\n width: 20px;\n height: 20px;\n border-radius: 50%;\n margin: 0 3px;\n cursor: pointer;\n"]);return D=function(){return t},t}function L(){var t=u(["\n border: solid ",";\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 6px;\n transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n cursor: pointer;\n"]);return L=function(){return t},t}function W(){var t=u(["\n border: solid ",";\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 6px;\n transform: rotate(135deg);\n -webkit-transform: rotate(135deg);\n cursor: pointer;\n"]);return W=function(){return t},t}function T(){var t=u(["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 40px;\n"]);return T=function(){return t},t}function H(){var t=u(["\n position: relative;\n left: 0;\n background-color: ",";\n cursor: pointer;\n width: 100px;\n height: 10px;\n"]);return H=function(){return t},t}function P(){var t=u(["\n position: absolute;\n cursor: pointer;\n left: 0;\n width: 100%;\n background-color: ",";\n bottom: 0;\n height: 10px;\n display: flex;\n align-items: center;\n"]);return P=function(){return t},t}function I(){var t=u(["\n flex: 0 0 auto;\n box-sizing: border-box;\n"]);return I=function(){return t},t}function V(){var t=u(["\n display: flex;\n overflow-x: scroll;\n overflow-y: hidden;\n margin-bottom: -20px;\n -webkit-overflow-scrolling: touch;\n"]);return V=function(){return t},t}var X=function(t){function e(e){var o;return(o=t.call(this,e)||this).state={scrollContainerWidth:0,deltaXOrigin:0,deltaX:0,thumbHeight:0,trackHeight:0,scrollWidth:0,scrollLeft:0,padding:o.trackPadding,ratio:1,numberOfViews:0,paginationIndex:0},o.overflowContainerRef=n.createRef(),o.thumbRef=n.createRef(),o.trackRef=n.createRef(),o.paginationRef=n.createRef(),o.onNext=o.onNext.bind(a(o)),o.onPrevious=o.onPrevious.bind(a(o)),o.onDotClick=o.onDotClick.bind(a(o)),o.measureContainers=o.measureContainers.bind(a(o)),o.onMouseDown=o.onMouseDown.bind(a(o)),o.onMouseDrag=o.onMouseDrag.bind(a(o)),o.onOverflowContentScroll=o.onOverflowContentScroll.bind(a(o)),o.deleteMouseMoveEvent=o.deleteMouseMoveEvent.bind(a(o)),o.onScrollbarClick=o.onScrollbarClick.bind(a(o)),o.onOverflowContentDrag=o.onOverflowContentDrag.bind(a(o)),o.onOverflowContentMouseDown=o.onOverflowContentMouseDown.bind(a(o)),o.deleteOverflowMouseMoveEvent=o.deleteOverflowMouseMoveEvent.bind(a(o)),o}l(e,t);var o=e.prototype;return o.componentDidMount=function(){this.setState({numberOfViews:this.numberOfViews}),window.addEventListener("resize",this.measureContainers),window.addEventListener("mouseup",this.deleteMouseMoveEvent),window.addEventListener("transitionend",this.measureContainers),window.addEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.addEventListener("load",this.measureContainers)},o.componentWillUnmount=function(){window.removeEventListener("resize",this.measureContainers),window.removeEventListener("mouseup",this.deleteMouseMoveEvent),window.removeEventListener("transitionend",this.measureContainers),window.removeEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.removeEventListener("load",this.measureContainers)},o.scrollContainerReducedWidth=function(t){var e=this.state.padding;return t-(e.left+e.right)},o.setStartPosition=function(){var t=this.props.startAt,e=this.overflowContainerRef.current,n=this.startElement;this.measureContainers(),e&&n&&(e.scrollLeft=n.offsetLeft-(t&&t.center?(e.clientWidth-n.clientWidth)/2:0))},o.measureContainers=function(t){var e=this,n=this.overflowContainerRef.current,o=this.thumbRef.current,i=this.trackRef.current,r=c(n,o,i);if(r){var s=this.scrollContainerReducedWidth(n.clientWidth);this.setState({scrollContainerWidth:s,thumbHeight:o.offsetHeight,trackHeight:i.clientHeight,scrollWidth:n.scrollWidth,ratio:(s-o.offsetWidth)/(n.scrollWidth-n.clientWidth)},(function(){t&&"load"===t.type&&e.setStartPosition()}))}if(r&&o.offsetLeft+o.clientWidth>n.clientWidth){var l=n.clientWidth-o.clientWidth;n.scroll(n.scrollWidth,0),o.style.left=l+"px"}},o.onMouseDown=function(t){t.preventDefault(),this.thumbRef.current&&this.setState({deltaXOrigin:this.thumbRef.current.offsetLeft,deltaX:t.clientX+this.state.padding.left}),window.addEventListener("mousemove",this.onMouseDrag)},o.onScrollbarClick=function(t){var e=t.clientX,n=this.thumbRef.current,o=this.overflowContainerRef.current;if(c(n,o,e>=n.offsetLeft+o.getBoundingClientRect().left,e<=n.offsetLeft+o.getBoundingClientRect().left+n.offsetWidth))return null;var i=(o.scrollWidth-o.clientWidth)/(this.state.scrollContainerWidth-n.offsetWidth),r=o.getBoundingClientRect().left+n.offsetWidth/2+this.state.padding.left;return o.scroll({left:i*(e-r),top:0,behavior:"smooth"})},o.deleteMouseMoveEvent=function(){window.removeEventListener("mousemove",this.onMouseDrag)},o.deleteOverflowMouseMoveEvent=function(){window.removeEventListener("mousemove",this.onOverflowContentDrag)},o.onMouseDrag=function(t){var e=this.state,n=this.overflowContainerRef.current,o=this.thumbRef.current,i=e.scrollContainerWidth-o.offsetWidth,r=t.clientX-e.deltaX+e.deltaXOrigin,s=r>=0&&r<=i,l=c(Boolean(this.overflowContainerRef.current),Boolean(this.thumbRef.current));if(l&&!s){var a=r>0?n.scrollWidth-n.clientWidth:0;o.style.left=(r<0?0:i)+"px",n.scroll(a,0)}l&&s&&(n.scroll((n.scrollWidth-n.clientWidth)/i*r,0),o.style.left=r+"px")},o.onOverflowContentScroll=function(){var t,e,n=this.thumbRef.current,o=this.overflowContainerRef.current;o&&n&&(n.style.left=o.scrollLeft*this.state.ratio+"px");var i=(null==o?void 0:o.scrollLeft)||0,r=null===(t=this.childrenWidth)||void 0===t?void 0:t.reduce((function(t,e,n){var o;return t.concat({index:n+1,value:e.value+((null===(o=t[n-1])||void 0===o?void 0:o.value)||0)})}),[]),s=null==r||null===(e=r.reverse())||void 0===e?void 0:e.find((function(t){return i>=t.value}));this.setState({paginationIndex:s?s.index:0})},o.onOverflowContentMouseDown=function(t){t.preventDefault();var e=this.overflowContainerRef.current;e&&this.setState({deltaX:t.clientX,scrollLeft:e.scrollLeft}),window.addEventListener("mousemove",this.onOverflowContentDrag)},o.onOverflowContentDrag=function(t){var e=this.state,n=this.overflowContainerRef.current;n&&0!==t.clientX&&n.scroll(e.scrollLeft-(t.clientX-e.deltaX),0)},o.renderChildren=function(){var t=this,e=this.props.numCols,o=this.props.spacing/2,i=this.props.children;return n.Children.map(i,(function(r,s){var l=s!==n.Children.count(i)-1?"paddingRight: "+o+"px":void 0;return n.createElement(N,{id:"react-smart-scroller-"+s,style:{padding:"0 "+o+"px",flexBasis:e?"calc(100% / "+e+")":"unset",paddingRight:l,paddingLeft:0!==s?"paddingLeft: "+o+"px":void 0,marginBottom:t.contentMargin}},r)}))},o.renderThumb=function(){var t=this.state,e=t.scrollContainerWidth,o=Number((100*e/t.scrollWidth).toFixed(0))*e/100+"px";return this.props.thumb?n.cloneElement(this.props.thumb,{ref:this.thumbRef,onMouseDown:this.onMouseDown,style:s({left:0,position:"relative",cursor:"pointer"},this.props.thumb.props.style)}):n.createElement(z,{ref:this.thumbRef,onMouseDown:this.onMouseDown,style:{width:o}})},o.renderScrollbar=function(){var t,e,o=!m()&&this.shouldRenderScrollbar&&!this.props.pagination,i=(null===(t=this.props.paginationConfig)||void 0===t?void 0:t.withScroll)?{bottom:(null===(e=this.paginationRef.current)||void 0===e?void 0:e.clientHeight)||40}:{bottom:0};return n.createElement(Y,{ref:this.trackRef,onClick:this.onScrollbarClick,style:s({color:"#bdc3c7",bottom:this.bottomOffset,display:o?"flex":"none"},this.props.trackProps,{},i)},this.renderThumb())},o.onNext=function(){var t=this.overflowContainerRef.current,e=this.state.paginationIndex,n=this.props.paginationConfig;if(t&&n&&n.withScroll&&e<this.numberOfViews-1){var o,i=e+1,r=(null===(o=t.children.item(e))||void 0===o?void 0:o.clientWidth)||0;return t.scroll({left:t.scrollLeft+r,top:0,behavior:"smooth"}),this.setState({paginationIndex:i})}},o.onPrevious=function(){var t=this.overflowContainerRef.current,e=this.state.paginationIndex,n=this.props.paginationConfig;if(t&&n&&n.withScroll&&e>0){var o,i=e-1,r=(null===(o=t.children.item(i))||void 0===o?void 0:o.clientWidth)||0;return t.scroll({left:t.scrollLeft-r,top:0,behavior:"smooth"}),this.setState({paginationIndex:i})}},o.onDotClick=function(t){var e=this.overflowContainerRef.current,n=this.props.paginationConfig;if(e&&n&&n.withScroll){var o,i=(null==e||null===(o=e.children.item(t))||void 0===o?void 0:o.offsetLeft)||0;return e.scroll({left:i,top:0,behavior:"smooth"}),this.setState({paginationIndex:t})}},o.renderDots=function(){var t=this,e=this.props.paginationConfig;return Array.from(Array(this.numberOfViews)).map((function(o,i){return n.createElement(F,{key:i,style:{backgroundColor:t.state.paginationIndex===i?(null==e?void 0:e.activeDotColor)||"#2ecc71":(null==e?void 0:e.unactiveDotsColor)||"#bdc3c7"},onClick:function(){return t.onDotClick(i)}})}))},o.renderPagination=function(){var t=this.props,e=t.renderPagination,o=t.paginationConfig,i=(null==o?void 0:o.withScroll)?{marginTop:20}:{marginTop:"unset"};if(e){var r=e({selectedDot:this.state.paginationIndex,onPrev:this.onPrevious,onNext:this.onNext,childrenCount:this.childrenCount,onDotClick:this.onDotClick});return n.cloneElement(r,{ref:this.paginationRef,style:s({},r.props.style,{marginTop:20})})}return n.createElement(A,{style:i,ref:this.paginationRef},n.createElement(j,{onClick:this.onPrevious}),this.renderDots(),n.createElement(_,{onClick:this.onNext}))},o.render=function(){var t=this.props,e=t.draggable,o=t.paginationConfig;return n.createElement("div",{style:t.style},n.createElement(B,{ref:this.overflowContainerRef,onScroll:this.onOverflowContentScroll,onMouseDown:e?this.onOverflowContentMouseDown:d,style:{cursor:e?"pointer":"unset"}},this.renderChildren()),this.renderScrollbar(),(null==o?void 0:o.withScroll)&&this.renderPagination())},r(e,[{key:"shouldRenderScrollbar",get:function(){var t=this.overflowContainerRef.current,e=this.props.numCols;return!e&&t?t.clientWidth<t.scrollWidth:!(t&&t.children.length<=e)}},{key:"trackPadding",get:function(){var t=this.props.trackProps;return t?f(t.padding,t.paddingLeft,t.paddingRight,t.paddingTop,t.paddingBottom):{top:0,right:0,bottom:0,left:0}}},{key:"contentMargin",get:function(){var t=this.state,e=t.thumbHeight,n=t.trackHeight,o=n>e?n:e,i=g()?o+20:o;return!m()&&this.shouldRenderScrollbar?i+10+"px":"20px"}},{key:"bottomOffset",get:function(){return this.state.thumbHeight>this.state.trackHeight?(this.state.thumbHeight-this.state.trackHeight)/2:0}},{key:"startElement",get:function(){if(this.props.startAt)return document.getElementById("react-smart-scroller-"+this.props.startAt.startIndex)}},{key:"childrenCount",get:function(){return n.Children.count(this.props.children)}},{key:"numberOfViews",get:function(){return Math.ceil(this.childrenCount/(this.props.numCols||1))}},{key:"childrenWidth",get:function(){var t=this;return n.Children.map(this.props.children,(function(e,n){var o,i;return{value:(null===(o=t.overflowContainerRef.current)||void 0===o||null===(i=o.children.item(n))||void 0===i?void 0:i.clientWidth)||0,index:n}}))}}]),e}(n.Component);X.defaultProps={spacing:0,vertical:!1,draggable:!1,pagination:!1};var B=o.div(V()),N=o.div(I()),Y=o.div(P(),"#bdc3c7"),z=o.div(H(),"#2ecc71"),A=o.div(T()),j=o.div(W(),"#000000"),_=o.div(L(),"#000000"),F=o.div(D());function U(){var t=u(["\n width: 20px;\n height: 20px;\n border-radius: 50%;\n margin: 0 3px;\n cursor: pointer;\n"]);return U=function(){return t},t}function q(){var t=u(["\n border: solid ",";\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 6px;\n transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n cursor: pointer;\n"]);return q=function(){return t},t}function G(){var t=u(["\n border: solid ",";\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 6px;\n transform: rotate(135deg);\n -webkit-transform: rotate(135deg);\n cursor: pointer;\n"]);return G=function(){return t},t}function J(){var t=u(["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 40px;\n"]);return J=function(){return t},t}function K(){var t=u(["\n flex: 0 0 auto;\n box-sizing: border-box;\n"]);return K=function(){return t},t}function Q(){var t=u(["\n display: flex;\n position: relative;\n -webkit-overflow-scrolling: touch;\n"]);return Q=function(){return t},t}function Z(){var t=u(["\n display: flex;\n flex-direction: column;\n"]);return Z=function(){return t},t}var $=function(t){function e(e){var o;return(o=t.call(this,e)||this).state={paginationIndex:0,numberOfViews:0,scrollValue:0,children:o.props.children,deltaX:0,scrollLeft:0,dragScroll:0,deltaY:0,horizontal:!1,lockedMove:!1},o.overflowContainerRef=n.createRef(),o.onNext=o.onNext.bind(a(o)),o.onPrevious=o.onPrevious.bind(a(o)),o.onDotClick=o.onDotClick.bind(a(o)),o.onTouchMove=o.onTouchMove.bind(a(o)),o.onTouchStart=o.onTouchStart.bind(a(o)),o.updatePosition=o.updatePosition.bind(a(o)),o.setStartPosition=o.setStartPosition.bind(a(o)),o.onOverflowContentDrag=o.onOverflowContentDrag.bind(a(o)),o.onOverflowContentScroll=o.onOverflowContentScroll.bind(a(o)),o.onOverflowContentMouseDown=o.onOverflowContentMouseDown.bind(a(o)),o.deleteOverflowMouseMoveEvent=o.deleteOverflowMouseMoveEvent.bind(a(o)),o}l(e,t);var o=e.prototype;return o.componentDidMount=function(){this.setState({numberOfViews:this.numberOfViews}),window.addEventListener("resize",this.updatePosition),window.addEventListener("touchstart",this.onTouchStart),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.deleteOverflowMouseMoveEvent),window.addEventListener("load",this.setStartPosition)},o.componentWillUnmount=function(){window.removeEventListener("resize",this.updatePosition),window.removeEventListener("touchstart",this.onTouchStart),window.removeEventListener("mousemove",this.onOverflowContentDrag),window.removeEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.deleteOverflowMouseMoveEvent),window.removeEventListener("load",this.setStartPosition)},o.setStartPosition=function(){var t=this.props,e=t.startAt,o=t.children,i=this.overflowContainerRef.current,r=this.props.numCols||1;if(i){var s=Math.ceil((e?e.startIndex:0)/r),l=n.Children.count(o),a=Math.ceil(l/r)-1,u=s<0?0:s>a?a:s,c=-u*i.offsetWidth;i.style.transform="translate("+c+"px)",this.setState({paginationIndex:u,scrollValue:c})}},o.updatePosition=function(){var t=this.props.children,e=this.overflowContainerRef.current,o=this.props.numCols||1;if(e){var i=Math.ceil(this.state.paginationIndex/o),r=n.Children.count(t),s=Math.ceil(r/o)-1,l=i<0?0:i>s?s:i,a=-l*e.offsetWidth;e.style.transform="translate("+a+"px)",this.setState({paginationIndex:l,scrollValue:a})}},o.onNext=function(){var t=this.overflowContainerRef.current,e=this.state,n=e.paginationIndex,o=e.scrollValue,i=this.props.paginationConfig;if(t&&i&&(null==i?void 0:i.withScroll)&&n<this.numberOfViews-1){var r,s=n+1,l=(null===(r=t.children.item(n))||void 0===r?void 0:r.clientWidth)||0;return t.scroll({left:t.scrollLeft+l,top:0,behavior:"smooth"}),this.setState({paginationIndex:s})}if(t&&n===this.numberOfViews-1&&i&&i.infinite)return t.style.transform="translate(0px)",this.setState({paginationIndex:0,scrollValue:0});if(t&&n<this.numberOfViews-1){var a,u,c,d=n+1;if(t.clientWidth+Math.abs(this.state.scrollValue)>=t.scrollWidth)return;var h=(null===(a=this.props.paginationConfig)||void 0===a?void 0:a.withScroll)||(null===(u=this.props.paginationConfig)||void 0===u?void 0:u.renderNextToEachOther)?o-((null===(c=t.children.item(n))||void 0===c?void 0:c.clientWidth)||0):o-t.offsetWidth;return t.style.transform="translate("+h+"px)",this.setState({paginationIndex:d,scrollValue:h})}},o.onPrevious=function(){var t=this.overflowContainerRef.current,e=this.state,n=e.paginationIndex,o=e.scrollValue,i=this.props.paginationConfig;if(t&&i&&(null==i?void 0:i.withScroll)&&n>0){var r,s=n-1,l=(null===(r=t.children.item(s))||void 0===r?void 0:r.clientWidth)||0;return t.scroll({left:t.scrollLeft-l,top:0,behavior:"smooth"}),this.setState({paginationIndex:s})}if(t&&0===n&&i&&i.infinite){var a,u,c,d=this.numberOfViews-1,h=(null===(a=this.props.paginationConfig)||void 0===a?void 0:a.withScroll)||(null===(u=this.props.paginationConfig)||void 0===u?void 0:u.renderNextToEachOther)?d+((null===(c=t.children.item(d))||void 0===c?void 0:c.clientWidth)||0):d*t.offsetWidth;return t.style.transform="translate(-"+h+"px)",this.setState({paginationIndex:d,scrollValue:-h})}if(t&&n>0){var f,v,p,g=n-1,m=(null===(f=this.props.paginationConfig)||void 0===f?void 0:f.withScroll)||(null===(v=this.props.paginationConfig)||void 0===v?void 0:v.renderNextToEachOther)?o+((null===(p=t.children.item(g))||void 0===p?void 0:p.clientWidth)||0):o+t.offsetWidth;return t.style.transform="translate("+m+"px)",this.setState({paginationIndex:g,scrollValue:m})}},o.onDotClick=function(t){var e=this.overflowContainerRef.current,n=this.state.paginationIndex,o=this.props.paginationConfig;if(e&&o&&((null==o?void 0:o.withScroll)||(null==o?void 0:o.renderNextToEachOther))){var i,r=(null==e||null===(i=e.children.item(t))||void 0===i?void 0:i.offsetLeft)||0;return e.scroll({left:r,top:0,behavior:"smooth"}),this.setState({paginationIndex:t})}if(e&&t!==n){var s,l,a,u=(null===(s=this.props.paginationConfig)||void 0===s?void 0:s.withScroll)||(null===(l=this.props.paginationConfig)||void 0===l?void 0:l.renderNextToEachOther)?-((null==e||null===(a=e.children.item(t))||void 0===a?void 0:a.offsetLeft)||0):-t*e.clientWidth;e.style.transform="translate("+u+"px)",this.setState({paginationIndex:t,scrollValue:u})}},o.onOverflowContentMouseDown=function(t){t.preventDefault();var e=this.overflowContainerRef.current,n=this.props.paginationConfig;e&&n&&n.draggable&&(e.style.transition="unset",e.style.transform="translate("+this.state.scrollValue+"px)",this.setState({deltaX:t.clientX,scrollLeft:this.state.scrollValue,dragScroll:this.state.scrollValue}),window.addEventListener("mousemove",this.onOverflowContentDrag),window.addEventListener("mouseup",this.deleteOverflowMouseMoveEvent))},o.onOverflowContentDrag=function(t){var e=this.state,n=this.overflowContainerRef.current,o=e.scrollLeft+(t.clientX-e.deltaX);n&&0!==t.clientX&&(n.style.transform="translate("+o+"px)",this.setState({dragScroll:o}))},o.onTouchStart=function(t){var e=this.state.scrollValue,n=t.touches.item(0),o=this.overflowContainerRef.current;this.setState({deltaX:n.clientX,scrollLeft:e,dragScroll:e,deltaY:n.clientY,horizontal:!1,lockedMove:!1}),o&&(o.style.transition="unset")},o.onTouchMove=function(t){var e=this.state,n=e.deltaX,o=e.scrollLeft,i=e.deltaY,r=e.horizontal,s=e.lockedMove,l=t.touches.item(0),a=this.overflowContainerRef.current,u=o+(l.clientX-n),c=this.props.paginationConfig,d=(null==c?void 0:c.minOffsetToChangeSlide)||50;if(!r&&s)return null;Math.abs(l.clientY-i)>d&&!s&&this.setState({horizontal:!1,lockedMove:!0}),Math.abs(l.clientX-n)>d&&!s&&this.setState({horizontal:!0,lockedMove:!0}),Math.abs(l.clientX-n)>d&&t.preventDefault(),a&&0!==l.clientX&&(a.style.transform="translate("+u+"px)",this.setState({dragScroll:u}))},o.deleteOverflowMouseMoveEvent=function(){var t=this.overflowContainerRef.current,e=this.state,n=e.dragScroll,o=e.paginationIndex,i=e.scrollLeft,r=this.props.paginationConfig,s=(null==r?void 0:r.minOffsetToChangeSlide)||150,l=(null==r?void 0:r.transitionTime)||1;if(t&&-i+n<-s){var a=o===Math.ceil(this.childrenCount/(this.props.numCols||1))-1,u=a?o*t.clientWidth:(o+1)*t.clientWidth;t.style.transition="all "+l+"s",t.style.transform="translate(-"+u+"px)",this.setState({paginationIndex:a?o:o+1,scrollValue:-u})}if(t&&-i+n>s){var d=0===o,h=d?0:(o-1)*t.clientWidth;t.style.transition="all "+l+"s",t.style.transform="translate(-"+h+"px)",this.setState({paginationIndex:d?o:o-1,scrollValue:-h})}c(t,-i+n>-s,-i+n<s)&&(t.style.transition="all "+l+"s",t.style.transform="translate(-"+o*t.clientWidth+"px)"),window.removeEventListener("mousemove",this.onOverflowContentDrag),window.removeEventListener("mouseup",this.deleteOverflowMouseMoveEvent)},o.renderChildren=function(){var t=this,e=this.props.numCols,o=this.props.spacing/2,i=this.props.children;return n.Children.map(i,(function(r,s){var l,a,u=s!==n.Children.count(i)-1?"paddingRight: "+o+"px":void 0,c=(null===(l=t.props.paginationConfig)||void 0===l?void 0:l.withScroll)||(null===(a=t.props.paginationConfig)||void 0===a?void 0:a.renderNextToEachOther)?"unset":"100%";return n.createElement(nt,{id:"react-smart-scroller-"+s,style:{padding:"0 "+o+"px",flexBasis:e?"calc(100% / "+e+")":"unset",paddingRight:u,paddingLeft:0!==s?"paddingLeft: "+o+"px":void 0,width:c}},r)}))},o.renderDots=function(){var t=this,e=this.props.paginationConfig;return Array.from(Array(this.numberOfViews)).map((function(o,i){return n.createElement(st,{key:i,style:{backgroundColor:t.state.paginationIndex===i?(null==e?void 0:e.activeDotColor)||"#2ecc71":(null==e?void 0:e.unactiveDotsColor)||"#bdc3c7"},onClick:function(){return t.onDotClick(i)}})}))},o.renderPagination=function(){var t=this.props,e=t.renderPagination,o=t.paginationConfig,i=(null==o?void 0:o.withScroll)?{marginTop:20}:{marginTop:"unset"};return e?e({selectedDot:this.state.paginationIndex,onPrev:this.onPrevious,onNext:this.onNext,childrenCount:this.childrenCount,onDotClick:this.onDotClick}):n.createElement(ot,{style:i},n.createElement(it,{onClick:this.onPrevious}),this.renderDots(),n.createElement(rt,{onClick:this.onNext}))},o.onOverflowContentScroll=function(){var t,e,n=this.overflowContainerRef.current,o=(null==n?void 0:n.scrollLeft)||0,i=null===(t=this.childrenWidth)||void 0===t?void 0:t.reduce((function(t,e,n){var o;return t.concat({index:n+1,value:e.value+((null===(o=t[n-1])||void 0===o?void 0:o.value)||0)})}),[]),r=null==i||null===(e=i.reverse())||void 0===e?void 0:e.find((function(t){return o>=t.value}));this.setState({paginationIndex:r?r.index:0})},o.render=function(){var t=this.props,e=t.paginationConfig;return n.createElement(tt,{style:t.style},n.createElement(et,{ref:this.overflowContainerRef,style:s({transition:"all "+((null==e?void 0:e.transitionTime)||1)+"s",flex:1},(null==e?void 0:e.withScroll)?{overflowX:"auto",marginBottom:-20}:{overflowX:"unset",marginBottom:"unset"}),onScroll:this.onOverflowContentScroll,onMouseDown:m()?d:this.onOverflowContentMouseDown},this.renderChildren()),this.renderPagination())},r(e,[{key:"childrenCount",get:function(){return n.Children.count(this.props.children)}},{key:"numberOfViews",get:function(){return Math.ceil(this.childrenCount/(this.props.numCols||1))}},{key:"childrenWidth",get:function(){var t=this;return n.Children.map(this.props.children,(function(e,n){var o,i;return{value:(null===(o=t.overflowContainerRef.current)||void 0===o||null===(i=o.children.item(n))||void 0===i?void 0:i.clientWidth)||0,index:n}}))}}]),e}(n.Component),tt=o.div(Z()),et=o.div(Q()),nt=o.div(K()),ot=o.div(J()),it=o.div(G(),"#000000"),rt=o.div(q(),"#000000"),st=o.div(U());function lt(){var t=u(["\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: relative;\n"]);return lt=function(){return t},t}var at=function(t){function e(){return t.apply(this,arguments)||this}l(e,t);var o=e.prototype;return o.renderMain=function(){return n.createElement(this.props.pagination?$:this.props.vertical?y:X,Object.assign({},this.props))},o.render=function(){return v()?null:n.createElement(ut,null,this.renderMain())},e}(n.Component),ut=o.div(lt());exports.ReactSmartScroller=at;
//# sourceMappingURL=react-smart-scroller.cjs.production.min.js.map

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("styled-components")):"function"==typeof define&&define.amd?define(["exports","react","styled-components"],e):e((t=t||self)["react-smart-scroller"]={},t.React,t.styled)}(this,(function(t,e,n){"use strict";function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function i(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function s(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a(t,e){return e||(e=t.slice(0)),t.raw=e,t}var u;e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n,function(t){t[t.One=1]="One",t[t.Two=2]="Two",t[t.Three=3]="Three",t[t.Four=4]="Four"}(u||(u={}));var c=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.every(Boolean)},d=function(){},h=function(t){return t?Number(t.toString().replace("px","")):void 0},f=function(t,e,n,o,i){var s={top:0,right:0,bottom:0,left:0};if(!(t||e||n||o||i))return s;if(!t)return r({},s,{right:h(n),left:h(e),top:h(o),bottom:h(i)});var l=t.toString().split(" "),a=l.length,c=l.map(h);switch(a){case u.One:var d=c[0];return{top:d,right:d,bottom:d,left:d};case u.Two:var f=c[0],v=c[1];return{top:f,right:v,bottom:f,left:v};case u.Three:var p=c[1];return{top:c[0],right:p,bottom:c[2],left:p};case u.Four:default:return{top:c[0],right:c[1],bottom:c[2],left:c[3]}}},v=function(){return"undefined"==typeof window},p=function(t){return!v()&&navigator.userAgent.includes(t)},g=function(){return p("Mac")},m=function(){return p("Android")||p("iPhone")||p("iPad")};function w(){var t=a(["\n position: absolute;\n"]);return w=function(){return t},t}function C(){var t=a(["\n position: relative;\n background-color: ",";\n cursor: pointer;\n width: 10px;\n height: 100%;\n"]);return C=function(){return t},t}function b(){var t=a(["\n position: absolute;\n cursor: pointer;\n right: 0;\n height: 100%;\n background-color: ",";\n top: 0;\n width: 10px;\n display: flex;\n justify-content: center;\n"]);return b=function(){return t},t}function x(){var t=a(["\n box-sizing: border-box;\n"]);return x=function(){return t},t}function y(){var t=a(["\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow-x: hidden;\n overflow-y: scroll;\n margin-right: -20px;\n -webkit-overflow-scrolling: touch;\n"]);return y=function(){return t},t}var M=function(t){function n(n){var o;return(o=t.call(this,n)||this).state={scrollContainerHeight:0,deltaYOrigin:0,deltaY:0,thumbWidth:0,trackWidth:0,scrollHeight:0,scrollTop:0,padding:o.trackPadding,ratio:1},o.overflowContainerRef=e.createRef(),o.thumbRef=e.createRef(),o.trackRef=e.createRef(),o.measureContainers=o.measureContainers.bind(l(o)),o.onMouseDown=o.onMouseDown.bind(l(o)),o.onMouseDrag=o.onMouseDrag.bind(l(o)),o.onOverflowContentScroll=o.onOverflowContentScroll.bind(l(o)),o.deleteMouseMoveEvent=o.deleteMouseMoveEvent.bind(l(o)),o.onScrollbarClick=o.onScrollbarClick.bind(l(o)),o.onOverflowContentMouseDown=o.onOverflowContentMouseDown.bind(l(o)),o.onOverflowContentDrag=o.onOverflowContentDrag.bind(l(o)),o.deleteOverflowMouseMoveEvent=o.deleteOverflowMouseMoveEvent.bind(l(o)),o}s(n,t);var o=n.prototype;return o.componentDidMount=function(){window.addEventListener("resize",this.measureContainers),window.addEventListener("mouseup",this.deleteMouseMoveEvent),window.addEventListener("transitionend",this.measureContainers),window.addEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.addEventListener("load",this.measureContainers)},o.componentWillUnmount=function(){window.removeEventListener("resize",this.measureContainers),window.removeEventListener("mouseup",this.deleteMouseMoveEvent),window.removeEventListener("transitionend",this.measureContainers),window.removeEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.removeEventListener("load",this.measureContainers)},o.setStartPosition=function(){var t=this.props.startAt,e=this.overflowContainerRef.current,n=this.startElement;this.measureContainers(),e&&n&&(e.scrollTop=n.offsetTop-(t&&t.center?(e.clientHeight-n.clientHeight)/2:0))},o.scrollContainerReducedHeight=function(t){var e=this.state.padding;return t-(e.top+e.bottom)},o.measureContainers=function(t){var e=this,n=this.overflowContainerRef.current,o=this.thumbRef.current,i=this.trackRef.current,r=c(n,o,i);if(r){var s=this.scrollContainerReducedHeight(n.clientHeight);this.setState({scrollContainerHeight:s,thumbWidth:o.offsetWidth,trackWidth:i.clientWidth,scrollHeight:n.scrollHeight,ratio:(s-o.offsetHeight)/(n.scrollHeight-n.clientHeight)},(function(){t&&"load"===t.type&&e.setStartPosition()}))}if(r&&o.offsetTop+o.offsetHeight>n.clientHeight){var l=n.clientHeight-o.offsetHeight;n.scroll(0,n.scrollHeight),o.style.top=l+"px"}},o.onMouseDown=function(t){t.preventDefault();var e=this.thumbRef.current;e&&this.overflowContainerRef.current&&this.setState({deltaYOrigin:e.offsetTop,deltaY:t.clientY+this.state.padding.top}),window.addEventListener("mousemove",this.onMouseDrag)},o.onScrollbarClick=function(t){var e=t.clientY,n=this.state.padding,o=this.thumbRef.current,i=this.overflowContainerRef.current;if(c(o,i,e>=(h(o.style.top)||0)+i.getBoundingClientRect().top+n.top,e<=(h(o.style.top)||0)+i.getBoundingClientRect().top+o.offsetHeight+n.top))return null;var r=(i.scrollHeight-i.clientHeight)/(this.state.scrollContainerHeight-o.offsetHeight),s=i.getBoundingClientRect().top+o.offsetHeight/2+n.top;return i.scroll({top:r*(e-s),left:0,behavior:"smooth"})},o.deleteMouseMoveEvent=function(){window.removeEventListener("mousemove",this.onMouseDrag)},o.deleteOverflowMouseMoveEvent=function(){window.removeEventListener("mousemove",this.onOverflowContentDrag)},o.onMouseDrag=function(t){var e=this.state,n=this.overflowContainerRef.current,o=this.thumbRef.current,i=e.scrollContainerHeight-o.offsetHeight,r=t.clientY-e.deltaY+e.deltaYOrigin+e.padding.top,s=r>=0&&r<=i,l=c(Boolean(this.overflowContainerRef.current),Boolean(this.thumbRef.current));if(l&&!s){var a=r>0?n.scrollHeight-n.offsetHeight:0;o.style.top=(r<0?0:i)+"px",n.scroll(0,a)}l&&s&&(n.scroll(0,(n.scrollHeight-n.offsetHeight)/i*r),o.style.top=r+"px")},o.onOverflowContentScroll=function(){var t=this.thumbRef.current,e=this.overflowContainerRef.current;e&&t&&(t.style.top=e.scrollTop*this.state.ratio+"px")},o.onOverflowContentMouseDown=function(t){t.preventDefault();var e=this.overflowContainerRef.current;e&&this.setState({deltaY:t.clientY,scrollTop:e.scrollTop}),window.addEventListener("mousemove",this.onOverflowContentDrag)},o.onOverflowContentDrag=function(t){var e=this.state,n=this.overflowContainerRef.current;n&&0!==t.clientY&&n.scroll(0,e.scrollTop-(t.clientY-e.deltaY))},o.renderThumb=function(){var t=this.state,n=t.scrollContainerHeight,o=Number((100*n/t.scrollHeight).toFixed(0))*n/100+"px";return this.props.thumb?e.cloneElement(this.props.thumb,{ref:this.thumbRef,onMouseDown:this.onMouseDown,style:r({top:0,position:"relative",cursor:"pointer"},this.props.thumb.props.style)}):e.createElement(R,{ref:this.thumbRef,onMouseDown:this.onMouseDown,style:{height:o}})},o.renderScrollbar=function(){var t=!m()&&this.shouldRenderScrollbar;return e.createElement(O,{ref:this.trackRef,onClick:this.onScrollbarClick,style:r({color:"#bdc3c7",right:this.rightOffset,display:t?"flex":"none"},this.props.trackProps)},e.createElement(k,null,this.renderThumb()))},o.renderChildren=function(){var t=this,n=this.props.numCols,o=this.props.spacing/2,i=this.props.children;return e.Children.map(i,(function(s,l){var a=l!==e.Children.count(i)-1?"paddingBottom: "+o+"px":void 0,u=0!==l?"paddingTop: "+o+"px":void 0,c=n?"calc(100% / "+n+")":"auto",d=e.cloneElement(i[l],{style:r({display:"flex"},i[l].props.style)});return e.createElement(S,{id:"react-smart-scroller-"+l,style:{padding:o+"px 0",height:c,paddingTop:u,paddingBottom:a,marginRight:t.contentMargin}},d)}))},o.render=function(){var t=this.props,n=t.draggable;return e.createElement("div",{style:t.style},e.createElement(E,{style:{cursor:n?"pointer":"unset"},ref:this.overflowContainerRef,onScroll:this.onOverflowContentScroll,onMouseDown:n?this.onOverflowContentMouseDown:d},this.renderChildren()),this.renderScrollbar())},i(n,[{key:"shouldRenderScrollbar",get:function(){var t=this.overflowContainerRef.current,e=this.props.numCols;return!e&&t?t.clientHeight<t.scrollHeight:!(t&&t.children.length<=e)}},{key:"trackPadding",get:function(){var t=this.props.trackProps;return t?f(t.padding,t.paddingLeft,t.paddingRight,t.paddingTop,t.paddingBottom):{top:0,right:0,bottom:0,left:0}}},{key:"contentMargin",get:function(){var t=this.state,e=t.thumbWidth,n=t.trackWidth,o=n>e?n:e,i=g()?o+20:o;return!m()&&this.shouldRenderScrollbar?i+10+"px":"20px"}},{key:"rightOffset",get:function(){return this.state.thumbWidth>this.state.trackWidth?(this.state.thumbWidth-this.state.trackWidth)/2:0}},{key:"startElement",get:function(){if(this.props.startAt)return document.getElementById("react-smart-scroller-"+this.props.startAt.startIndex)}}]),n}(e.Component),E=n.div(y()),S=n.div(x()),O=n.div(b(),"#bdc3c7"),R=n.div(C(),"#2ecc71"),k=n.div(w());function D(){var t=a(["\n width: 20px;\n height: 20px;\n border-radius: 50%;\n margin: 0 3px;\n cursor: pointer;\n"]);return D=function(){return t},t}function L(){var t=a(["\n border: solid ",";\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 6px;\n transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n cursor: pointer;\n"]);return L=function(){return t},t}function W(){var t=a(["\n border: solid ",";\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 6px;\n transform: rotate(135deg);\n -webkit-transform: rotate(135deg);\n cursor: pointer;\n"]);return W=function(){return t},t}function P(){var t=a(["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 40px;\n"]);return P=function(){return t},t}function T(){var t=a(["\n position: relative;\n left: 0;\n background-color: ",";\n cursor: pointer;\n width: 100px;\n height: 10px;\n"]);return T=function(){return t},t}function H(){var t=a(["\n position: absolute;\n cursor: pointer;\n left: 0;\n width: 100%;\n background-color: ",";\n bottom: 0;\n height: 10px;\n display: flex;\n align-items: center;\n"]);return H=function(){return t},t}function I(){var t=a(["\n flex: 0 0 auto;\n box-sizing: border-box;\n"]);return I=function(){return t},t}function V(){var t=a(["\n display: flex;\n overflow-x: scroll;\n overflow-y: hidden;\n margin-bottom: -20px;\n -webkit-overflow-scrolling: touch;\n"]);return V=function(){return t},t}var X=function(t){function n(n){var o;return(o=t.call(this,n)||this).state={scrollContainerWidth:0,deltaXOrigin:0,deltaX:0,thumbHeight:0,trackHeight:0,scrollWidth:0,scrollLeft:0,padding:o.trackPadding,ratio:1,numberOfViews:0,paginationIndex:0},o.overflowContainerRef=e.createRef(),o.thumbRef=e.createRef(),o.trackRef=e.createRef(),o.paginationRef=e.createRef(),o.onNext=o.onNext.bind(l(o)),o.onPrevious=o.onPrevious.bind(l(o)),o.onDotClick=o.onDotClick.bind(l(o)),o.measureContainers=o.measureContainers.bind(l(o)),o.onMouseDown=o.onMouseDown.bind(l(o)),o.onMouseDrag=o.onMouseDrag.bind(l(o)),o.onOverflowContentScroll=o.onOverflowContentScroll.bind(l(o)),o.deleteMouseMoveEvent=o.deleteMouseMoveEvent.bind(l(o)),o.onScrollbarClick=o.onScrollbarClick.bind(l(o)),o.onOverflowContentDrag=o.onOverflowContentDrag.bind(l(o)),o.onOverflowContentMouseDown=o.onOverflowContentMouseDown.bind(l(o)),o.deleteOverflowMouseMoveEvent=o.deleteOverflowMouseMoveEvent.bind(l(o)),o}s(n,t);var o=n.prototype;return o.componentDidMount=function(){this.setState({numberOfViews:this.numberOfViews}),window.addEventListener("resize",this.measureContainers),window.addEventListener("mouseup",this.deleteMouseMoveEvent),window.addEventListener("transitionend",this.measureContainers),window.addEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.addEventListener("load",this.measureContainers)},o.componentWillUnmount=function(){window.removeEventListener("resize",this.measureContainers),window.removeEventListener("mouseup",this.deleteMouseMoveEvent),window.removeEventListener("transitionend",this.measureContainers),window.removeEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.removeEventListener("load",this.measureContainers)},o.scrollContainerReducedWidth=function(t){var e=this.state.padding;return t-(e.left+e.right)},o.setStartPosition=function(){var t=this.props.startAt,e=this.overflowContainerRef.current,n=this.startElement;this.measureContainers(),e&&n&&(e.scrollLeft=n.offsetLeft-(t&&t.center?(e.clientWidth-n.clientWidth)/2:0))},o.measureContainers=function(t){var e=this,n=this.overflowContainerRef.current,o=this.thumbRef.current,i=this.trackRef.current,r=c(n,o,i);if(r){var s=this.scrollContainerReducedWidth(n.clientWidth);this.setState({scrollContainerWidth:s,thumbHeight:o.offsetHeight,trackHeight:i.clientHeight,scrollWidth:n.scrollWidth,ratio:(s-o.offsetWidth)/(n.scrollWidth-n.clientWidth)},(function(){t&&"load"===t.type&&e.setStartPosition()}))}if(r&&o.offsetLeft+o.clientWidth>n.clientWidth){var l=n.clientWidth-o.clientWidth;n.scroll(n.scrollWidth,0),o.style.left=l+"px"}},o.onMouseDown=function(t){t.preventDefault(),this.thumbRef.current&&this.setState({deltaXOrigin:this.thumbRef.current.offsetLeft,deltaX:t.clientX+this.state.padding.left}),window.addEventListener("mousemove",this.onMouseDrag)},o.onScrollbarClick=function(t){var e=t.clientX,n=this.thumbRef.current,o=this.overflowContainerRef.current;if(c(n,o,e>=n.offsetLeft+o.getBoundingClientRect().left,e<=n.offsetLeft+o.getBoundingClientRect().left+n.offsetWidth))return null;var i=(o.scrollWidth-o.clientWidth)/(this.state.scrollContainerWidth-n.offsetWidth),r=o.getBoundingClientRect().left+n.offsetWidth/2+this.state.padding.left;return o.scroll({left:i*(e-r),top:0,behavior:"smooth"})},o.deleteMouseMoveEvent=function(){window.removeEventListener("mousemove",this.onMouseDrag)},o.deleteOverflowMouseMoveEvent=function(){window.removeEventListener("mousemove",this.onOverflowContentDrag)},o.onMouseDrag=function(t){var e=this.state,n=this.overflowContainerRef.current,o=this.thumbRef.current,i=e.scrollContainerWidth-o.offsetWidth,r=t.clientX-e.deltaX+e.deltaXOrigin,s=r>=0&&r<=i,l=c(Boolean(this.overflowContainerRef.current),Boolean(this.thumbRef.current));if(l&&!s){var a=r>0?n.scrollWidth-n.clientWidth:0;o.style.left=(r<0?0:i)+"px",n.scroll(a,0)}l&&s&&(n.scroll((n.scrollWidth-n.clientWidth)/i*r,0),o.style.left=r+"px")},o.onOverflowContentScroll=function(){var t,e,n=this.thumbRef.current,o=this.overflowContainerRef.current;o&&n&&(n.style.left=o.scrollLeft*this.state.ratio+"px");var i=(null==o?void 0:o.scrollLeft)||0,r=null===(t=this.childrenWidth)||void 0===t?void 0:t.reduce((function(t,e,n){var o;return t.concat({index:n+1,value:e.value+((null===(o=t[n-1])||void 0===o?void 0:o.value)||0)})}),[]),s=null==r||null===(e=r.reverse())||void 0===e?void 0:e.find((function(t){return i>=t.value}));this.setState({paginationIndex:s?s.index:0})},o.onOverflowContentMouseDown=function(t){t.preventDefault();var e=this.overflowContainerRef.current;e&&this.setState({deltaX:t.clientX,scrollLeft:e.scrollLeft}),window.addEventListener("mousemove",this.onOverflowContentDrag)},o.onOverflowContentDrag=function(t){var e=this.state,n=this.overflowContainerRef.current;n&&0!==t.clientX&&n.scroll(e.scrollLeft-(t.clientX-e.deltaX),0)},o.renderChildren=function(){var t=this,n=this.props.numCols,o=this.props.spacing/2,i=this.props.children;return e.Children.map(i,(function(r,s){var l=s!==e.Children.count(i)-1?"paddingRight: "+o+"px":void 0;return e.createElement(N,{id:"react-smart-scroller-"+s,style:{padding:"0 "+o+"px",flexBasis:n?"calc(100% / "+n+")":"unset",paddingRight:l,paddingLeft:0!==s?"paddingLeft: "+o+"px":void 0,marginBottom:t.contentMargin}},r)}))},o.renderThumb=function(){var t=this.state,n=t.scrollContainerWidth,o=Number((100*n/t.scrollWidth).toFixed(0))*n/100+"px";return this.props.thumb?e.cloneElement(this.props.thumb,{ref:this.thumbRef,onMouseDown:this.onMouseDown,style:r({left:0,position:"relative",cursor:"pointer"},this.props.thumb.props.style)}):e.createElement(z,{ref:this.thumbRef,onMouseDown:this.onMouseDown,style:{width:o}})},o.renderScrollbar=function(){var t,n,o=!m()&&this.shouldRenderScrollbar&&!this.props.pagination,i=(null===(t=this.props.paginationConfig)||void 0===t?void 0:t.withScroll)?{bottom:(null===(n=this.paginationRef.current)||void 0===n?void 0:n.clientHeight)||40}:{bottom:0};return e.createElement(Y,{ref:this.trackRef,onClick:this.onScrollbarClick,style:r({color:"#bdc3c7",bottom:this.bottomOffset,display:o?"flex":"none"},this.props.trackProps,{},i)},this.renderThumb())},o.onNext=function(){var t=this.overflowContainerRef.current,e=this.state.paginationIndex,n=this.props.paginationConfig;if(t&&n&&n.withScroll&&e<this.numberOfViews-1){var o,i=e+1,r=(null===(o=t.children.item(e))||void 0===o?void 0:o.clientWidth)||0;return t.scroll({left:t.scrollLeft+r,top:0,behavior:"smooth"}),this.setState({paginationIndex:i})}},o.onPrevious=function(){var t=this.overflowContainerRef.current,e=this.state.paginationIndex,n=this.props.paginationConfig;if(t&&n&&n.withScroll&&e>0){var o,i=e-1,r=(null===(o=t.children.item(i))||void 0===o?void 0:o.clientWidth)||0;return t.scroll({left:t.scrollLeft-r,top:0,behavior:"smooth"}),this.setState({paginationIndex:i})}},o.onDotClick=function(t){var e=this.overflowContainerRef.current,n=this.props.paginationConfig;if(e&&n&&n.withScroll){var o,i=(null==e||null===(o=e.children.item(t))||void 0===o?void 0:o.offsetLeft)||0;return e.scroll({left:i,top:0,behavior:"smooth"}),this.setState({paginationIndex:t})}},o.renderDots=function(){var t=this,n=this.props.paginationConfig;return Array.from(Array(this.numberOfViews)).map((function(o,i){return e.createElement(F,{key:i,style:{backgroundColor:t.state.paginationIndex===i?(null==n?void 0:n.activeDotColor)||"#2ecc71":(null==n?void 0:n.unactiveDotsColor)||"#bdc3c7"},onClick:function(){return t.onDotClick(i)}})}))},o.renderPagination=function(){var t=this.props,n=t.renderPagination,o=t.paginationConfig,i=(null==o?void 0:o.withScroll)?{marginTop:20}:{marginTop:"unset"};if(n){var s=n({selectedDot:this.state.paginationIndex,onPrev:this.onPrevious,onNext:this.onNext,childrenCount:this.childrenCount,onDotClick:this.onDotClick});return e.cloneElement(s,{ref:this.paginationRef,style:r({},s.props.style,{marginTop:20})})}return e.createElement(A,{style:i,ref:this.paginationRef},e.createElement(j,{onClick:this.onPrevious}),this.renderDots(),e.createElement(_,{onClick:this.onNext}))},o.render=function(){var t=this.props,n=t.draggable,o=t.paginationConfig;return e.createElement("div",{style:t.style},e.createElement(B,{ref:this.overflowContainerRef,onScroll:this.onOverflowContentScroll,onMouseDown:n?this.onOverflowContentMouseDown:d,style:{cursor:n?"pointer":"unset"}},this.renderChildren()),this.renderScrollbar(),(null==o?void 0:o.withScroll)&&this.renderPagination())},i(n,[{key:"shouldRenderScrollbar",get:function(){var t=this.overflowContainerRef.current,e=this.props.numCols;return!e&&t?t.clientWidth<t.scrollWidth:!(t&&t.children.length<=e)}},{key:"trackPadding",get:function(){var t=this.props.trackProps;return t?f(t.padding,t.paddingLeft,t.paddingRight,t.paddingTop,t.paddingBottom):{top:0,right:0,bottom:0,left:0}}},{key:"contentMargin",get:function(){var t=this.state,e=t.thumbHeight,n=t.trackHeight,o=n>e?n:e,i=g()?o+20:o;return!m()&&this.shouldRenderScrollbar?i+10+"px":"20px"}},{key:"bottomOffset",get:function(){return this.state.thumbHeight>this.state.trackHeight?(this.state.thumbHeight-this.state.trackHeight)/2:0}},{key:"startElement",get:function(){if(this.props.startAt)return document.getElementById("react-smart-scroller-"+this.props.startAt.startIndex)}},{key:"childrenCount",get:function(){return e.Children.count(this.props.children)}},{key:"numberOfViews",get:function(){return Math.ceil(this.childrenCount/(this.props.numCols||1))}},{key:"childrenWidth",get:function(){var t=this;return e.Children.map(this.props.children,(function(e,n){var o,i;return{value:(null===(o=t.overflowContainerRef.current)||void 0===o||null===(i=o.children.item(n))||void 0===i?void 0:i.clientWidth)||0,index:n}}))}}]),n}(e.Component);X.defaultProps={spacing:0,vertical:!1,draggable:!1,pagination:!1};var B=n.div(V()),N=n.div(I()),Y=n.div(H(),"#bdc3c7"),z=n.div(T(),"#2ecc71"),A=n.div(P()),j=n.div(W(),"#000000"),_=n.div(L(),"#000000"),F=n.div(D());function U(){var t=a(["\n width: 20px;\n height: 20px;\n border-radius: 50%;\n margin: 0 3px;\n cursor: pointer;\n"]);return U=function(){return t},t}function q(){var t=a(["\n border: solid ",";\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 6px;\n transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n cursor: pointer;\n"]);return q=function(){return t},t}function G(){var t=a(["\n border: solid ",";\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 6px;\n transform: rotate(135deg);\n -webkit-transform: rotate(135deg);\n cursor: pointer;\n"]);return G=function(){return t},t}function J(){var t=a(["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 40px;\n"]);return J=function(){return t},t}function K(){var t=a(["\n flex: 0 0 auto;\n box-sizing: border-box;\n"]);return K=function(){return t},t}function Q(){var t=a(["\n display: flex;\n position: relative;\n -webkit-overflow-scrolling: touch;\n"]);return Q=function(){return t},t}function Z(){var t=a(["\n display: flex;\n flex-direction: column;\n"]);return Z=function(){return t},t}var $=function(t){function n(n){var o;return(o=t.call(this,n)||this).state={paginationIndex:0,numberOfViews:0,scrollValue:0,children:o.props.children,deltaX:0,scrollLeft:0,dragScroll:0,deltaY:0,horizontal:!1,lockedMove:!1},o.overflowContainerRef=e.createRef(),o.onNext=o.onNext.bind(l(o)),o.onPrevious=o.onPrevious.bind(l(o)),o.onDotClick=o.onDotClick.bind(l(o)),o.onTouchMove=o.onTouchMove.bind(l(o)),o.onTouchStart=o.onTouchStart.bind(l(o)),o.updatePosition=o.updatePosition.bind(l(o)),o.setStartPosition=o.setStartPosition.bind(l(o)),o.onOverflowContentDrag=o.onOverflowContentDrag.bind(l(o)),o.onOverflowContentScroll=o.onOverflowContentScroll.bind(l(o)),o.onOverflowContentMouseDown=o.onOverflowContentMouseDown.bind(l(o)),o.deleteOverflowMouseMoveEvent=o.deleteOverflowMouseMoveEvent.bind(l(o)),o}s(n,t);var o=n.prototype;return o.componentDidMount=function(){this.setState({numberOfViews:this.numberOfViews}),window.addEventListener("resize",this.updatePosition),window.addEventListener("touchstart",this.onTouchStart),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.deleteOverflowMouseMoveEvent),window.addEventListener("load",this.setStartPosition)},o.componentWillUnmount=function(){window.removeEventListener("resize",this.updatePosition),window.removeEventListener("touchstart",this.onTouchStart),window.removeEventListener("mousemove",this.onOverflowContentDrag),window.removeEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.deleteOverflowMouseMoveEvent),window.removeEventListener("load",this.setStartPosition)},o.setStartPosition=function(){var t=this.props,n=t.startAt,o=t.children,i=this.overflowContainerRef.current,r=this.props.numCols||1;if(i){var s=Math.ceil((n?n.startIndex:0)/r),l=e.Children.count(o),a=Math.ceil(l/r)-1,u=s<0?0:s>a?a:s,c=-u*i.offsetWidth;i.style.transform="translate("+c+"px)",this.setState({paginationIndex:u,scrollValue:c})}},o.updatePosition=function(){var t=this.props.children,n=this.overflowContainerRef.current,o=this.props.numCols||1;if(n){var i=Math.ceil(this.state.paginationIndex/o),r=e.Children.count(t),s=Math.ceil(r/o)-1,l=i<0?0:i>s?s:i,a=-l*n.offsetWidth;n.style.transform="translate("+a+"px)",this.setState({paginationIndex:l,scrollValue:a})}},o.onNext=function(){var t=this.overflowContainerRef.current,e=this.state,n=e.paginationIndex,o=e.scrollValue,i=this.props.paginationConfig;if(t&&i&&(null==i?void 0:i.withScroll)&&n<this.numberOfViews-1){var r,s=n+1,l=(null===(r=t.children.item(n))||void 0===r?void 0:r.clientWidth)||0;return t.scroll({left:t.scrollLeft+l,top:0,behavior:"smooth"}),this.setState({paginationIndex:s})}if(t&&n===this.numberOfViews-1&&i&&i.infinite)return t.style.transform="translate(0px)",this.setState({paginationIndex:0,scrollValue:0});if(t&&n<this.numberOfViews-1){var a,u,c,d=n+1;if(t.clientWidth+Math.abs(this.state.scrollValue)>=t.scrollWidth)return;var h=(null===(a=this.props.paginationConfig)||void 0===a?void 0:a.withScroll)||(null===(u=this.props.paginationConfig)||void 0===u?void 0:u.renderNextToEachOther)?o-((null===(c=t.children.item(n))||void 0===c?void 0:c.clientWidth)||0):o-t.offsetWidth;return t.style.transform="translate("+h+"px)",this.setState({paginationIndex:d,scrollValue:h})}},o.onPrevious=function(){var t=this.overflowContainerRef.current,e=this.state,n=e.paginationIndex,o=e.scrollValue,i=this.props.paginationConfig;if(t&&i&&(null==i?void 0:i.withScroll)&&n>0){var r,s=n-1,l=(null===(r=t.children.item(s))||void 0===r?void 0:r.clientWidth)||0;return t.scroll({left:t.scrollLeft-l,top:0,behavior:"smooth"}),this.setState({paginationIndex:s})}if(t&&0===n&&i&&i.infinite){var a,u,c,d=this.numberOfViews-1,h=(null===(a=this.props.paginationConfig)||void 0===a?void 0:a.withScroll)||(null===(u=this.props.paginationConfig)||void 0===u?void 0:u.renderNextToEachOther)?d+((null===(c=t.children.item(d))||void 0===c?void 0:c.clientWidth)||0):d*t.offsetWidth;return t.style.transform="translate(-"+h+"px)",this.setState({paginationIndex:d,scrollValue:-h})}if(t&&n>0){var f,v,p,g=n-1,m=(null===(f=this.props.paginationConfig)||void 0===f?void 0:f.withScroll)||(null===(v=this.props.paginationConfig)||void 0===v?void 0:v.renderNextToEachOther)?o+((null===(p=t.children.item(g))||void 0===p?void 0:p.clientWidth)||0):o+t.offsetWidth;return t.style.transform="translate("+m+"px)",this.setState({paginationIndex:g,scrollValue:m})}},o.onDotClick=function(t){var e=this.overflowContainerRef.current,n=this.state.paginationIndex,o=this.props.paginationConfig;if(e&&o&&((null==o?void 0:o.withScroll)||(null==o?void 0:o.renderNextToEachOther))){var i,r=(null==e||null===(i=e.children.item(t))||void 0===i?void 0:i.offsetLeft)||0;return e.scroll({left:r,top:0,behavior:"smooth"}),this.setState({paginationIndex:t})}if(e&&t!==n){var s,l,a,u=(null===(s=this.props.paginationConfig)||void 0===s?void 0:s.withScroll)||(null===(l=this.props.paginationConfig)||void 0===l?void 0:l.renderNextToEachOther)?-((null==e||null===(a=e.children.item(t))||void 0===a?void 0:a.offsetLeft)||0):-t*e.clientWidth;e.style.transform="translate("+u+"px)",this.setState({paginationIndex:t,scrollValue:u})}},o.onOverflowContentMouseDown=function(t){t.preventDefault();var e=this.overflowContainerRef.current,n=this.props.paginationConfig;e&&n&&n.draggable&&(e.style.transition="unset",e.style.transform="translate("+this.state.scrollValue+"px)",this.setState({deltaX:t.clientX,scrollLeft:this.state.scrollValue,dragScroll:this.state.scrollValue}),window.addEventListener("mousemove",this.onOverflowContentDrag),window.addEventListener("mouseup",this.deleteOverflowMouseMoveEvent))},o.onOverflowContentDrag=function(t){var e=this.state,n=this.overflowContainerRef.current,o=e.scrollLeft+(t.clientX-e.deltaX);n&&0!==t.clientX&&(n.style.transform="translate("+o+"px)",this.setState({dragScroll:o}))},o.onTouchStart=function(t){var e=this.state.scrollValue,n=t.touches.item(0),o=this.overflowContainerRef.current;this.setState({deltaX:n.clientX,scrollLeft:e,dragScroll:e,deltaY:n.clientY,horizontal:!1,lockedMove:!1}),o&&(o.style.transition="unset")},o.onTouchMove=function(t){var e=this.state,n=e.deltaX,o=e.scrollLeft,i=e.deltaY,r=e.horizontal,s=e.lockedMove,l=t.touches.item(0),a=this.overflowContainerRef.current,u=o+(l.clientX-n),c=this.props.paginationConfig,d=(null==c?void 0:c.minOffsetToChangeSlide)||50;if(!r&&s)return null;Math.abs(l.clientY-i)>d&&!s&&this.setState({horizontal:!1,lockedMove:!0}),Math.abs(l.clientX-n)>d&&!s&&this.setState({horizontal:!0,lockedMove:!0}),Math.abs(l.clientX-n)>d&&t.preventDefault(),a&&0!==l.clientX&&(a.style.transform="translate("+u+"px)",this.setState({dragScroll:u}))},o.deleteOverflowMouseMoveEvent=function(){var t=this.overflowContainerRef.current,e=this.state,n=e.dragScroll,o=e.paginationIndex,i=e.scrollLeft,r=this.props.paginationConfig,s=(null==r?void 0:r.minOffsetToChangeSlide)||150,l=(null==r?void 0:r.transitionTime)||1;if(t&&-i+n<-s){var a=o===this.childrenCount-1,u=a?o*t.clientWidth:(o+1)*t.clientWidth;t.style.transition="all "+l+"s",t.style.transform="translate(-"+u+"px)",this.setState({paginationIndex:a?o:o+1,scrollValue:-u})}if(t&&-i+n>s){var d=0===o,h=d?0:(o-1)*t.clientWidth;t.style.transition="all "+l+"s",t.style.transform="translate(-"+h+"px)",this.setState({paginationIndex:d?o:o-1,scrollValue:-h})}c(t,-i+n>-s,-i+n<s)&&(t.style.transition="all "+l+"s",t.style.transform="translate(-"+o*t.clientWidth+"px)"),window.removeEventListener("mousemove",this.onOverflowContentDrag),window.removeEventListener("mouseup",this.deleteOverflowMouseMoveEvent)},o.renderChildren=function(){var t=this,n=this.props.numCols,o=this.props.spacing/2,i=this.props.children;return e.Children.map(i,(function(r,s){var l,a,u=s!==e.Children.count(i)-1?"paddingRight: "+o+"px":void 0,c=(null===(l=t.props.paginationConfig)||void 0===l?void 0:l.withScroll)||(null===(a=t.props.paginationConfig)||void 0===a?void 0:a.renderNextToEachOther)?"unset":"100%";return e.createElement(nt,{id:"react-smart-scroller-"+s,style:{padding:"0 "+o+"px",flexBasis:n?"calc(100% / "+n+")":"unset",paddingRight:u,paddingLeft:0!==s?"paddingLeft: "+o+"px":void 0,width:c}},r)}))},o.renderDots=function(){var t=this,n=this.props.paginationConfig;return Array.from(Array(this.numberOfViews)).map((function(o,i){return e.createElement(st,{key:i,style:{backgroundColor:t.state.paginationIndex===i?(null==n?void 0:n.activeDotColor)||"#2ecc71":(null==n?void 0:n.unactiveDotsColor)||"#bdc3c7"},onClick:function(){return t.onDotClick(i)}})}))},o.renderPagination=function(){var t=this.props,n=t.renderPagination,o=t.paginationConfig,i=(null==o?void 0:o.withScroll)?{marginTop:20}:{marginTop:"unset"};return n?n({selectedDot:this.state.paginationIndex,onPrev:this.onPrevious,onNext:this.onNext,childrenCount:this.childrenCount,onDotClick:this.onDotClick}):e.createElement(ot,{style:i},e.createElement(it,{onClick:this.onPrevious}),this.renderDots(),e.createElement(rt,{onClick:this.onNext}))},o.onOverflowContentScroll=function(){var t,e,n=this.overflowContainerRef.current,o=(null==n?void 0:n.scrollLeft)||0,i=null===(t=this.childrenWidth)||void 0===t?void 0:t.reduce((function(t,e,n){var o;return t.concat({index:n+1,value:e.value+((null===(o=t[n-1])||void 0===o?void 0:o.value)||0)})}),[]),r=null==i||null===(e=i.reverse())||void 0===e?void 0:e.find((function(t){return o>=t.value}));this.setState({paginationIndex:r?r.index:0})},o.render=function(){var t=this.props,n=t.paginationConfig;return e.createElement(tt,{style:t.style},e.createElement(et,{ref:this.overflowContainerRef,style:r({transition:"all "+((null==n?void 0:n.transitionTime)||1)+"s",flex:1},(null==n?void 0:n.withScroll)?{overflowX:"auto",marginBottom:-20}:{overflowX:"unset",marginBottom:"unset"}),onScroll:this.onOverflowContentScroll,onMouseDown:m()?d:this.onOverflowContentMouseDown},this.renderChildren()),this.renderPagination())},i(n,[{key:"childrenCount",get:function(){return e.Children.count(this.props.children)}},{key:"numberOfViews",get:function(){return Math.ceil(this.childrenCount/(this.props.numCols||1))}},{key:"childrenWidth",get:function(){var t=this;return e.Children.map(this.props.children,(function(e,n){var o,i;return{value:(null===(o=t.overflowContainerRef.current)||void 0===o||null===(i=o.children.item(n))||void 0===i?void 0:i.clientWidth)||0,index:n}}))}}]),n}(e.Component),tt=n.div(Z()),et=n.div(Q()),nt=n.div(K()),ot=n.div(J()),it=n.div(G(),"#000000"),rt=n.div(q(),"#000000"),st=n.div(U());function lt(){var t=a(["\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: relative;\n"]);return lt=function(){return t},t}var at=function(t){function n(){return t.apply(this,arguments)||this}s(n,t);var o=n.prototype;return o.renderMain=function(){return e.createElement(this.props.pagination?$:this.props.vertical?M:X,Object.assign({},this.props))},o.render=function(){return v()?null:e.createElement(ut,null,this.renderMain())},n}(e.Component),ut=n.div(lt());t.ReactSmartScroller=at,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("styled-components")):"function"==typeof define&&define.amd?define(["exports","react","styled-components"],e):e((t=t||self)["react-smart-scroller"]={},t.React,t.styled)}(this,(function(t,e,n){"use strict";function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function i(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function s(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a(t,e){return e||(e=t.slice(0)),t.raw=e,t}var u;e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n,function(t){t[t.One=1]="One",t[t.Two=2]="Two",t[t.Three=3]="Three",t[t.Four=4]="Four"}(u||(u={}));var c=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.every(Boolean)},d=function(){},h=function(t){return t?Number(t.toString().replace("px","")):void 0},f=function(t,e,n,o,i){var s={top:0,right:0,bottom:0,left:0};if(!(t||e||n||o||i))return s;if(!t)return r({},s,{right:h(n),left:h(e),top:h(o),bottom:h(i)});var l=t.toString().split(" "),a=l.length,c=l.map(h);switch(a){case u.One:var d=c[0];return{top:d,right:d,bottom:d,left:d};case u.Two:var f=c[0],v=c[1];return{top:f,right:v,bottom:f,left:v};case u.Three:var p=c[1];return{top:c[0],right:p,bottom:c[2],left:p};case u.Four:default:return{top:c[0],right:c[1],bottom:c[2],left:c[3]}}},v=function(){return"undefined"==typeof window},p=function(t){return!v()&&navigator.userAgent.includes(t)},g=function(){return p("Mac")},m=function(){return p("Android")||p("iPhone")||p("iPad")};function w(){var t=a(["\n position: absolute;\n"]);return w=function(){return t},t}function C(){var t=a(["\n position: relative;\n background-color: ",";\n cursor: pointer;\n width: 10px;\n height: 100%;\n"]);return C=function(){return t},t}function b(){var t=a(["\n position: absolute;\n cursor: pointer;\n right: 0;\n height: 100%;\n background-color: ",";\n top: 0;\n width: 10px;\n display: flex;\n justify-content: center;\n"]);return b=function(){return t},t}function x(){var t=a(["\n box-sizing: border-box;\n"]);return x=function(){return t},t}function y(){var t=a(["\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow-x: hidden;\n overflow-y: scroll;\n margin-right: -20px;\n -webkit-overflow-scrolling: touch;\n"]);return y=function(){return t},t}var M=function(t){function n(n){var o;return(o=t.call(this,n)||this).state={scrollContainerHeight:0,deltaYOrigin:0,deltaY:0,thumbWidth:0,trackWidth:0,scrollHeight:0,scrollTop:0,padding:o.trackPadding,ratio:1},o.overflowContainerRef=e.createRef(),o.thumbRef=e.createRef(),o.trackRef=e.createRef(),o.measureContainers=o.measureContainers.bind(l(o)),o.onMouseDown=o.onMouseDown.bind(l(o)),o.onMouseDrag=o.onMouseDrag.bind(l(o)),o.onOverflowContentScroll=o.onOverflowContentScroll.bind(l(o)),o.deleteMouseMoveEvent=o.deleteMouseMoveEvent.bind(l(o)),o.onScrollbarClick=o.onScrollbarClick.bind(l(o)),o.onOverflowContentMouseDown=o.onOverflowContentMouseDown.bind(l(o)),o.onOverflowContentDrag=o.onOverflowContentDrag.bind(l(o)),o.deleteOverflowMouseMoveEvent=o.deleteOverflowMouseMoveEvent.bind(l(o)),o}s(n,t);var o=n.prototype;return o.componentDidMount=function(){window.addEventListener("resize",this.measureContainers),window.addEventListener("mouseup",this.deleteMouseMoveEvent),window.addEventListener("transitionend",this.measureContainers),window.addEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.addEventListener("load",this.measureContainers)},o.componentWillUnmount=function(){window.removeEventListener("resize",this.measureContainers),window.removeEventListener("mouseup",this.deleteMouseMoveEvent),window.removeEventListener("transitionend",this.measureContainers),window.removeEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.removeEventListener("load",this.measureContainers)},o.setStartPosition=function(){var t=this.props.startAt,e=this.overflowContainerRef.current,n=this.startElement;this.measureContainers(),e&&n&&(e.scrollTop=n.offsetTop-(t&&t.center?(e.clientHeight-n.clientHeight)/2:0))},o.scrollContainerReducedHeight=function(t){var e=this.state.padding;return t-(e.top+e.bottom)},o.measureContainers=function(t){var e=this,n=this.overflowContainerRef.current,o=this.thumbRef.current,i=this.trackRef.current,r=c(n,o,i);if(r){var s=this.scrollContainerReducedHeight(n.clientHeight);this.setState({scrollContainerHeight:s,thumbWidth:o.offsetWidth,trackWidth:i.clientWidth,scrollHeight:n.scrollHeight,ratio:(s-o.offsetHeight)/(n.scrollHeight-n.clientHeight)},(function(){t&&"load"===t.type&&e.setStartPosition()}))}if(r&&o.offsetTop+o.offsetHeight>n.clientHeight){var l=n.clientHeight-o.offsetHeight;n.scroll(0,n.scrollHeight),o.style.top=l+"px"}},o.onMouseDown=function(t){t.preventDefault();var e=this.thumbRef.current;e&&this.overflowContainerRef.current&&this.setState({deltaYOrigin:e.offsetTop,deltaY:t.clientY+this.state.padding.top}),window.addEventListener("mousemove",this.onMouseDrag)},o.onScrollbarClick=function(t){var e=t.clientY,n=this.state.padding,o=this.thumbRef.current,i=this.overflowContainerRef.current;if(c(o,i,e>=(h(o.style.top)||0)+i.getBoundingClientRect().top+n.top,e<=(h(o.style.top)||0)+i.getBoundingClientRect().top+o.offsetHeight+n.top))return null;var r=(i.scrollHeight-i.clientHeight)/(this.state.scrollContainerHeight-o.offsetHeight),s=i.getBoundingClientRect().top+o.offsetHeight/2+n.top;return i.scroll({top:r*(e-s),left:0,behavior:"smooth"})},o.deleteMouseMoveEvent=function(){window.removeEventListener("mousemove",this.onMouseDrag)},o.deleteOverflowMouseMoveEvent=function(){window.removeEventListener("mousemove",this.onOverflowContentDrag)},o.onMouseDrag=function(t){var e=this.state,n=this.overflowContainerRef.current,o=this.thumbRef.current,i=e.scrollContainerHeight-o.offsetHeight,r=t.clientY-e.deltaY+e.deltaYOrigin+e.padding.top,s=r>=0&&r<=i,l=c(Boolean(this.overflowContainerRef.current),Boolean(this.thumbRef.current));if(l&&!s){var a=r>0?n.scrollHeight-n.offsetHeight:0;o.style.top=(r<0?0:i)+"px",n.scroll(0,a)}l&&s&&(n.scroll(0,(n.scrollHeight-n.offsetHeight)/i*r),o.style.top=r+"px")},o.onOverflowContentScroll=function(){var t=this.thumbRef.current,e=this.overflowContainerRef.current;e&&t&&(t.style.top=e.scrollTop*this.state.ratio+"px")},o.onOverflowContentMouseDown=function(t){t.preventDefault();var e=this.overflowContainerRef.current;e&&this.setState({deltaY:t.clientY,scrollTop:e.scrollTop}),window.addEventListener("mousemove",this.onOverflowContentDrag)},o.onOverflowContentDrag=function(t){var e=this.state,n=this.overflowContainerRef.current;n&&0!==t.clientY&&n.scroll(0,e.scrollTop-(t.clientY-e.deltaY))},o.renderThumb=function(){var t=this.state,n=t.scrollContainerHeight,o=Number((100*n/t.scrollHeight).toFixed(0))*n/100+"px";return this.props.thumb?e.cloneElement(this.props.thumb,{ref:this.thumbRef,onMouseDown:this.onMouseDown,style:r({top:0,position:"relative",cursor:"pointer"},this.props.thumb.props.style)}):e.createElement(R,{ref:this.thumbRef,onMouseDown:this.onMouseDown,style:{height:o}})},o.renderScrollbar=function(){var t=!m()&&this.shouldRenderScrollbar;return e.createElement(O,{ref:this.trackRef,onClick:this.onScrollbarClick,style:r({color:"#bdc3c7",right:this.rightOffset,display:t?"flex":"none"},this.props.trackProps)},e.createElement(k,null,this.renderThumb()))},o.renderChildren=function(){var t=this,n=this.props.numCols,o=this.props.spacing/2,i=this.props.children;return e.Children.map(i,(function(s,l){var a=l!==e.Children.count(i)-1?"paddingBottom: "+o+"px":void 0,u=0!==l?"paddingTop: "+o+"px":void 0,c=n?"calc(100% / "+n+")":"auto",d=e.cloneElement(i[l],{style:r({display:"flex"},i[l].props.style)});return e.createElement(S,{id:"react-smart-scroller-"+l,style:{padding:o+"px 0",height:c,paddingTop:u,paddingBottom:a,marginRight:t.contentMargin}},d)}))},o.render=function(){var t=this.props,n=t.draggable;return e.createElement("div",{style:t.style},e.createElement(E,{style:{cursor:n?"pointer":"unset"},ref:this.overflowContainerRef,onScroll:this.onOverflowContentScroll,onMouseDown:n?this.onOverflowContentMouseDown:d},this.renderChildren()),this.renderScrollbar())},i(n,[{key:"shouldRenderScrollbar",get:function(){var t=this.overflowContainerRef.current,e=this.props.numCols;return!e&&t?t.clientHeight<t.scrollHeight:!(t&&t.children.length<=e)}},{key:"trackPadding",get:function(){var t=this.props.trackProps;return t?f(t.padding,t.paddingLeft,t.paddingRight,t.paddingTop,t.paddingBottom):{top:0,right:0,bottom:0,left:0}}},{key:"contentMargin",get:function(){var t=this.state,e=t.thumbWidth,n=t.trackWidth,o=n>e?n:e,i=g()?o+20:o;return!m()&&this.shouldRenderScrollbar?i+10+"px":"20px"}},{key:"rightOffset",get:function(){return this.state.thumbWidth>this.state.trackWidth?(this.state.thumbWidth-this.state.trackWidth)/2:0}},{key:"startElement",get:function(){if(this.props.startAt)return document.getElementById("react-smart-scroller-"+this.props.startAt.startIndex)}}]),n}(e.Component),E=n.div(y()),S=n.div(x()),O=n.div(b(),"#bdc3c7"),R=n.div(C(),"#2ecc71"),k=n.div(w());function D(){var t=a(["\n width: 20px;\n height: 20px;\n border-radius: 50%;\n margin: 0 3px;\n cursor: pointer;\n"]);return D=function(){return t},t}function L(){var t=a(["\n border: solid ",";\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 6px;\n transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n cursor: pointer;\n"]);return L=function(){return t},t}function W(){var t=a(["\n border: solid ",";\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 6px;\n transform: rotate(135deg);\n -webkit-transform: rotate(135deg);\n cursor: pointer;\n"]);return W=function(){return t},t}function P(){var t=a(["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 40px;\n"]);return P=function(){return t},t}function T(){var t=a(["\n position: relative;\n left: 0;\n background-color: ",";\n cursor: pointer;\n width: 100px;\n height: 10px;\n"]);return T=function(){return t},t}function H(){var t=a(["\n position: absolute;\n cursor: pointer;\n left: 0;\n width: 100%;\n background-color: ",";\n bottom: 0;\n height: 10px;\n display: flex;\n align-items: center;\n"]);return H=function(){return t},t}function I(){var t=a(["\n flex: 0 0 auto;\n box-sizing: border-box;\n"]);return I=function(){return t},t}function V(){var t=a(["\n display: flex;\n overflow-x: scroll;\n overflow-y: hidden;\n margin-bottom: -20px;\n -webkit-overflow-scrolling: touch;\n"]);return V=function(){return t},t}var X=function(t){function n(n){var o;return(o=t.call(this,n)||this).state={scrollContainerWidth:0,deltaXOrigin:0,deltaX:0,thumbHeight:0,trackHeight:0,scrollWidth:0,scrollLeft:0,padding:o.trackPadding,ratio:1,numberOfViews:0,paginationIndex:0},o.overflowContainerRef=e.createRef(),o.thumbRef=e.createRef(),o.trackRef=e.createRef(),o.paginationRef=e.createRef(),o.onNext=o.onNext.bind(l(o)),o.onPrevious=o.onPrevious.bind(l(o)),o.onDotClick=o.onDotClick.bind(l(o)),o.measureContainers=o.measureContainers.bind(l(o)),o.onMouseDown=o.onMouseDown.bind(l(o)),o.onMouseDrag=o.onMouseDrag.bind(l(o)),o.onOverflowContentScroll=o.onOverflowContentScroll.bind(l(o)),o.deleteMouseMoveEvent=o.deleteMouseMoveEvent.bind(l(o)),o.onScrollbarClick=o.onScrollbarClick.bind(l(o)),o.onOverflowContentDrag=o.onOverflowContentDrag.bind(l(o)),o.onOverflowContentMouseDown=o.onOverflowContentMouseDown.bind(l(o)),o.deleteOverflowMouseMoveEvent=o.deleteOverflowMouseMoveEvent.bind(l(o)),o}s(n,t);var o=n.prototype;return o.componentDidMount=function(){this.setState({numberOfViews:this.numberOfViews}),window.addEventListener("resize",this.measureContainers),window.addEventListener("mouseup",this.deleteMouseMoveEvent),window.addEventListener("transitionend",this.measureContainers),window.addEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.addEventListener("load",this.measureContainers)},o.componentWillUnmount=function(){window.removeEventListener("resize",this.measureContainers),window.removeEventListener("mouseup",this.deleteMouseMoveEvent),window.removeEventListener("transitionend",this.measureContainers),window.removeEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.removeEventListener("load",this.measureContainers)},o.scrollContainerReducedWidth=function(t){var e=this.state.padding;return t-(e.left+e.right)},o.setStartPosition=function(){var t=this.props.startAt,e=this.overflowContainerRef.current,n=this.startElement;this.measureContainers(),e&&n&&(e.scrollLeft=n.offsetLeft-(t&&t.center?(e.clientWidth-n.clientWidth)/2:0))},o.measureContainers=function(t){var e=this,n=this.overflowContainerRef.current,o=this.thumbRef.current,i=this.trackRef.current,r=c(n,o,i);if(r){var s=this.scrollContainerReducedWidth(n.clientWidth);this.setState({scrollContainerWidth:s,thumbHeight:o.offsetHeight,trackHeight:i.clientHeight,scrollWidth:n.scrollWidth,ratio:(s-o.offsetWidth)/(n.scrollWidth-n.clientWidth)},(function(){t&&"load"===t.type&&e.setStartPosition()}))}if(r&&o.offsetLeft+o.clientWidth>n.clientWidth){var l=n.clientWidth-o.clientWidth;n.scroll(n.scrollWidth,0),o.style.left=l+"px"}},o.onMouseDown=function(t){t.preventDefault(),this.thumbRef.current&&this.setState({deltaXOrigin:this.thumbRef.current.offsetLeft,deltaX:t.clientX+this.state.padding.left}),window.addEventListener("mousemove",this.onMouseDrag)},o.onScrollbarClick=function(t){var e=t.clientX,n=this.thumbRef.current,o=this.overflowContainerRef.current;if(c(n,o,e>=n.offsetLeft+o.getBoundingClientRect().left,e<=n.offsetLeft+o.getBoundingClientRect().left+n.offsetWidth))return null;var i=(o.scrollWidth-o.clientWidth)/(this.state.scrollContainerWidth-n.offsetWidth),r=o.getBoundingClientRect().left+n.offsetWidth/2+this.state.padding.left;return o.scroll({left:i*(e-r),top:0,behavior:"smooth"})},o.deleteMouseMoveEvent=function(){window.removeEventListener("mousemove",this.onMouseDrag)},o.deleteOverflowMouseMoveEvent=function(){window.removeEventListener("mousemove",this.onOverflowContentDrag)},o.onMouseDrag=function(t){var e=this.state,n=this.overflowContainerRef.current,o=this.thumbRef.current,i=e.scrollContainerWidth-o.offsetWidth,r=t.clientX-e.deltaX+e.deltaXOrigin,s=r>=0&&r<=i,l=c(Boolean(this.overflowContainerRef.current),Boolean(this.thumbRef.current));if(l&&!s){var a=r>0?n.scrollWidth-n.clientWidth:0;o.style.left=(r<0?0:i)+"px",n.scroll(a,0)}l&&s&&(n.scroll((n.scrollWidth-n.clientWidth)/i*r,0),o.style.left=r+"px")},o.onOverflowContentScroll=function(){var t,e,n=this.thumbRef.current,o=this.overflowContainerRef.current;o&&n&&(n.style.left=o.scrollLeft*this.state.ratio+"px");var i=(null==o?void 0:o.scrollLeft)||0,r=null===(t=this.childrenWidth)||void 0===t?void 0:t.reduce((function(t,e,n){var o;return t.concat({index:n+1,value:e.value+((null===(o=t[n-1])||void 0===o?void 0:o.value)||0)})}),[]),s=null==r||null===(e=r.reverse())||void 0===e?void 0:e.find((function(t){return i>=t.value}));this.setState({paginationIndex:s?s.index:0})},o.onOverflowContentMouseDown=function(t){t.preventDefault();var e=this.overflowContainerRef.current;e&&this.setState({deltaX:t.clientX,scrollLeft:e.scrollLeft}),window.addEventListener("mousemove",this.onOverflowContentDrag)},o.onOverflowContentDrag=function(t){var e=this.state,n=this.overflowContainerRef.current;n&&0!==t.clientX&&n.scroll(e.scrollLeft-(t.clientX-e.deltaX),0)},o.renderChildren=function(){var t=this,n=this.props.numCols,o=this.props.spacing/2,i=this.props.children;return e.Children.map(i,(function(r,s){var l=s!==e.Children.count(i)-1?"paddingRight: "+o+"px":void 0;return e.createElement(N,{id:"react-smart-scroller-"+s,style:{padding:"0 "+o+"px",flexBasis:n?"calc(100% / "+n+")":"unset",paddingRight:l,paddingLeft:0!==s?"paddingLeft: "+o+"px":void 0,marginBottom:t.contentMargin}},r)}))},o.renderThumb=function(){var t=this.state,n=t.scrollContainerWidth,o=Number((100*n/t.scrollWidth).toFixed(0))*n/100+"px";return this.props.thumb?e.cloneElement(this.props.thumb,{ref:this.thumbRef,onMouseDown:this.onMouseDown,style:r({left:0,position:"relative",cursor:"pointer"},this.props.thumb.props.style)}):e.createElement(z,{ref:this.thumbRef,onMouseDown:this.onMouseDown,style:{width:o}})},o.renderScrollbar=function(){var t,n,o=!m()&&this.shouldRenderScrollbar&&!this.props.pagination,i=(null===(t=this.props.paginationConfig)||void 0===t?void 0:t.withScroll)?{bottom:(null===(n=this.paginationRef.current)||void 0===n?void 0:n.clientHeight)||40}:{bottom:0};return e.createElement(Y,{ref:this.trackRef,onClick:this.onScrollbarClick,style:r({color:"#bdc3c7",bottom:this.bottomOffset,display:o?"flex":"none"},this.props.trackProps,{},i)},this.renderThumb())},o.onNext=function(){var t=this.overflowContainerRef.current,e=this.state.paginationIndex,n=this.props.paginationConfig;if(t&&n&&n.withScroll&&e<this.numberOfViews-1){var o,i=e+1,r=(null===(o=t.children.item(e))||void 0===o?void 0:o.clientWidth)||0;return t.scroll({left:t.scrollLeft+r,top:0,behavior:"smooth"}),this.setState({paginationIndex:i})}},o.onPrevious=function(){var t=this.overflowContainerRef.current,e=this.state.paginationIndex,n=this.props.paginationConfig;if(t&&n&&n.withScroll&&e>0){var o,i=e-1,r=(null===(o=t.children.item(i))||void 0===o?void 0:o.clientWidth)||0;return t.scroll({left:t.scrollLeft-r,top:0,behavior:"smooth"}),this.setState({paginationIndex:i})}},o.onDotClick=function(t){var e=this.overflowContainerRef.current,n=this.props.paginationConfig;if(e&&n&&n.withScroll){var o,i=(null==e||null===(o=e.children.item(t))||void 0===o?void 0:o.offsetLeft)||0;return e.scroll({left:i,top:0,behavior:"smooth"}),this.setState({paginationIndex:t})}},o.renderDots=function(){var t=this,n=this.props.paginationConfig;return Array.from(Array(this.numberOfViews)).map((function(o,i){return e.createElement(F,{key:i,style:{backgroundColor:t.state.paginationIndex===i?(null==n?void 0:n.activeDotColor)||"#2ecc71":(null==n?void 0:n.unactiveDotsColor)||"#bdc3c7"},onClick:function(){return t.onDotClick(i)}})}))},o.renderPagination=function(){var t=this.props,n=t.renderPagination,o=t.paginationConfig,i=(null==o?void 0:o.withScroll)?{marginTop:20}:{marginTop:"unset"};if(n){var s=n({selectedDot:this.state.paginationIndex,onPrev:this.onPrevious,onNext:this.onNext,childrenCount:this.childrenCount,onDotClick:this.onDotClick});return e.cloneElement(s,{ref:this.paginationRef,style:r({},s.props.style,{marginTop:20})})}return e.createElement(A,{style:i,ref:this.paginationRef},e.createElement(j,{onClick:this.onPrevious}),this.renderDots(),e.createElement(_,{onClick:this.onNext}))},o.render=function(){var t=this.props,n=t.draggable,o=t.paginationConfig;return e.createElement("div",{style:t.style},e.createElement(B,{ref:this.overflowContainerRef,onScroll:this.onOverflowContentScroll,onMouseDown:n?this.onOverflowContentMouseDown:d,style:{cursor:n?"pointer":"unset"}},this.renderChildren()),this.renderScrollbar(),(null==o?void 0:o.withScroll)&&this.renderPagination())},i(n,[{key:"shouldRenderScrollbar",get:function(){var t=this.overflowContainerRef.current,e=this.props.numCols;return!e&&t?t.clientWidth<t.scrollWidth:!(t&&t.children.length<=e)}},{key:"trackPadding",get:function(){var t=this.props.trackProps;return t?f(t.padding,t.paddingLeft,t.paddingRight,t.paddingTop,t.paddingBottom):{top:0,right:0,bottom:0,left:0}}},{key:"contentMargin",get:function(){var t=this.state,e=t.thumbHeight,n=t.trackHeight,o=n>e?n:e,i=g()?o+20:o;return!m()&&this.shouldRenderScrollbar?i+10+"px":"20px"}},{key:"bottomOffset",get:function(){return this.state.thumbHeight>this.state.trackHeight?(this.state.thumbHeight-this.state.trackHeight)/2:0}},{key:"startElement",get:function(){if(this.props.startAt)return document.getElementById("react-smart-scroller-"+this.props.startAt.startIndex)}},{key:"childrenCount",get:function(){return e.Children.count(this.props.children)}},{key:"numberOfViews",get:function(){return Math.ceil(this.childrenCount/(this.props.numCols||1))}},{key:"childrenWidth",get:function(){var t=this;return e.Children.map(this.props.children,(function(e,n){var o,i;return{value:(null===(o=t.overflowContainerRef.current)||void 0===o||null===(i=o.children.item(n))||void 0===i?void 0:i.clientWidth)||0,index:n}}))}}]),n}(e.Component);X.defaultProps={spacing:0,vertical:!1,draggable:!1,pagination:!1};var B=n.div(V()),N=n.div(I()),Y=n.div(H(),"#bdc3c7"),z=n.div(T(),"#2ecc71"),A=n.div(P()),j=n.div(W(),"#000000"),_=n.div(L(),"#000000"),F=n.div(D());function U(){var t=a(["\n width: 20px;\n height: 20px;\n border-radius: 50%;\n margin: 0 3px;\n cursor: pointer;\n"]);return U=function(){return t},t}function q(){var t=a(["\n border: solid ",";\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 6px;\n transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n cursor: pointer;\n"]);return q=function(){return t},t}function G(){var t=a(["\n border: solid ",";\n border-width: 0 2px 2px 0;\n display: inline-block;\n padding: 6px;\n transform: rotate(135deg);\n -webkit-transform: rotate(135deg);\n cursor: pointer;\n"]);return G=function(){return t},t}function J(){var t=a(["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 40px;\n"]);return J=function(){return t},t}function K(){var t=a(["\n flex: 0 0 auto;\n box-sizing: border-box;\n"]);return K=function(){return t},t}function Q(){var t=a(["\n display: flex;\n position: relative;\n -webkit-overflow-scrolling: touch;\n"]);return Q=function(){return t},t}function Z(){var t=a(["\n display: flex;\n flex-direction: column;\n"]);return Z=function(){return t},t}var $=function(t){function n(n){var o;return(o=t.call(this,n)||this).state={paginationIndex:0,numberOfViews:0,scrollValue:0,children:o.props.children,deltaX:0,scrollLeft:0,dragScroll:0,deltaY:0,horizontal:!1,lockedMove:!1},o.overflowContainerRef=e.createRef(),o.onNext=o.onNext.bind(l(o)),o.onPrevious=o.onPrevious.bind(l(o)),o.onDotClick=o.onDotClick.bind(l(o)),o.onTouchMove=o.onTouchMove.bind(l(o)),o.onTouchStart=o.onTouchStart.bind(l(o)),o.updatePosition=o.updatePosition.bind(l(o)),o.setStartPosition=o.setStartPosition.bind(l(o)),o.onOverflowContentDrag=o.onOverflowContentDrag.bind(l(o)),o.onOverflowContentScroll=o.onOverflowContentScroll.bind(l(o)),o.onOverflowContentMouseDown=o.onOverflowContentMouseDown.bind(l(o)),o.deleteOverflowMouseMoveEvent=o.deleteOverflowMouseMoveEvent.bind(l(o)),o}s(n,t);var o=n.prototype;return o.componentDidMount=function(){this.setState({numberOfViews:this.numberOfViews}),window.addEventListener("resize",this.updatePosition),window.addEventListener("touchstart",this.onTouchStart),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.deleteOverflowMouseMoveEvent),window.addEventListener("load",this.setStartPosition)},o.componentWillUnmount=function(){window.removeEventListener("resize",this.updatePosition),window.removeEventListener("touchstart",this.onTouchStart),window.removeEventListener("mousemove",this.onOverflowContentDrag),window.removeEventListener("mouseup",this.deleteOverflowMouseMoveEvent),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.deleteOverflowMouseMoveEvent),window.removeEventListener("load",this.setStartPosition)},o.setStartPosition=function(){var t=this.props,n=t.startAt,o=t.children,i=this.overflowContainerRef.current,r=this.props.numCols||1;if(i){var s=Math.ceil((n?n.startIndex:0)/r),l=e.Children.count(o),a=Math.ceil(l/r)-1,u=s<0?0:s>a?a:s,c=-u*i.offsetWidth;i.style.transform="translate("+c+"px)",this.setState({paginationIndex:u,scrollValue:c})}},o.updatePosition=function(){var t=this.props.children,n=this.overflowContainerRef.current,o=this.props.numCols||1;if(n){var i=Math.ceil(this.state.paginationIndex/o),r=e.Children.count(t),s=Math.ceil(r/o)-1,l=i<0?0:i>s?s:i,a=-l*n.offsetWidth;n.style.transform="translate("+a+"px)",this.setState({paginationIndex:l,scrollValue:a})}},o.onNext=function(){var t=this.overflowContainerRef.current,e=this.state,n=e.paginationIndex,o=e.scrollValue,i=this.props.paginationConfig;if(t&&i&&(null==i?void 0:i.withScroll)&&n<this.numberOfViews-1){var r,s=n+1,l=(null===(r=t.children.item(n))||void 0===r?void 0:r.clientWidth)||0;return t.scroll({left:t.scrollLeft+l,top:0,behavior:"smooth"}),this.setState({paginationIndex:s})}if(t&&n===this.numberOfViews-1&&i&&i.infinite)return t.style.transform="translate(0px)",this.setState({paginationIndex:0,scrollValue:0});if(t&&n<this.numberOfViews-1){var a,u,c,d=n+1;if(t.clientWidth+Math.abs(this.state.scrollValue)>=t.scrollWidth)return;var h=(null===(a=this.props.paginationConfig)||void 0===a?void 0:a.withScroll)||(null===(u=this.props.paginationConfig)||void 0===u?void 0:u.renderNextToEachOther)?o-((null===(c=t.children.item(n))||void 0===c?void 0:c.clientWidth)||0):o-t.offsetWidth;return t.style.transform="translate("+h+"px)",this.setState({paginationIndex:d,scrollValue:h})}},o.onPrevious=function(){var t=this.overflowContainerRef.current,e=this.state,n=e.paginationIndex,o=e.scrollValue,i=this.props.paginationConfig;if(t&&i&&(null==i?void 0:i.withScroll)&&n>0){var r,s=n-1,l=(null===(r=t.children.item(s))||void 0===r?void 0:r.clientWidth)||0;return t.scroll({left:t.scrollLeft-l,top:0,behavior:"smooth"}),this.setState({paginationIndex:s})}if(t&&0===n&&i&&i.infinite){var a,u,c,d=this.numberOfViews-1,h=(null===(a=this.props.paginationConfig)||void 0===a?void 0:a.withScroll)||(null===(u=this.props.paginationConfig)||void 0===u?void 0:u.renderNextToEachOther)?d+((null===(c=t.children.item(d))||void 0===c?void 0:c.clientWidth)||0):d*t.offsetWidth;return t.style.transform="translate(-"+h+"px)",this.setState({paginationIndex:d,scrollValue:-h})}if(t&&n>0){var f,v,p,g=n-1,m=(null===(f=this.props.paginationConfig)||void 0===f?void 0:f.withScroll)||(null===(v=this.props.paginationConfig)||void 0===v?void 0:v.renderNextToEachOther)?o+((null===(p=t.children.item(g))||void 0===p?void 0:p.clientWidth)||0):o+t.offsetWidth;return t.style.transform="translate("+m+"px)",this.setState({paginationIndex:g,scrollValue:m})}},o.onDotClick=function(t){var e=this.overflowContainerRef.current,n=this.state.paginationIndex,o=this.props.paginationConfig;if(e&&o&&((null==o?void 0:o.withScroll)||(null==o?void 0:o.renderNextToEachOther))){var i,r=(null==e||null===(i=e.children.item(t))||void 0===i?void 0:i.offsetLeft)||0;return e.scroll({left:r,top:0,behavior:"smooth"}),this.setState({paginationIndex:t})}if(e&&t!==n){var s,l,a,u=(null===(s=this.props.paginationConfig)||void 0===s?void 0:s.withScroll)||(null===(l=this.props.paginationConfig)||void 0===l?void 0:l.renderNextToEachOther)?-((null==e||null===(a=e.children.item(t))||void 0===a?void 0:a.offsetLeft)||0):-t*e.clientWidth;e.style.transform="translate("+u+"px)",this.setState({paginationIndex:t,scrollValue:u})}},o.onOverflowContentMouseDown=function(t){t.preventDefault();var e=this.overflowContainerRef.current,n=this.props.paginationConfig;e&&n&&n.draggable&&(e.style.transition="unset",e.style.transform="translate("+this.state.scrollValue+"px)",this.setState({deltaX:t.clientX,scrollLeft:this.state.scrollValue,dragScroll:this.state.scrollValue}),window.addEventListener("mousemove",this.onOverflowContentDrag),window.addEventListener("mouseup",this.deleteOverflowMouseMoveEvent))},o.onOverflowContentDrag=function(t){var e=this.state,n=this.overflowContainerRef.current,o=e.scrollLeft+(t.clientX-e.deltaX);n&&0!==t.clientX&&(n.style.transform="translate("+o+"px)",this.setState({dragScroll:o}))},o.onTouchStart=function(t){var e=this.state.scrollValue,n=t.touches.item(0),o=this.overflowContainerRef.current;this.setState({deltaX:n.clientX,scrollLeft:e,dragScroll:e,deltaY:n.clientY,horizontal:!1,lockedMove:!1}),o&&(o.style.transition="unset")},o.onTouchMove=function(t){var e=this.state,n=e.deltaX,o=e.scrollLeft,i=e.deltaY,r=e.horizontal,s=e.lockedMove,l=t.touches.item(0),a=this.overflowContainerRef.current,u=o+(l.clientX-n),c=this.props.paginationConfig,d=(null==c?void 0:c.minOffsetToChangeSlide)||50;if(!r&&s)return null;Math.abs(l.clientY-i)>d&&!s&&this.setState({horizontal:!1,lockedMove:!0}),Math.abs(l.clientX-n)>d&&!s&&this.setState({horizontal:!0,lockedMove:!0}),Math.abs(l.clientX-n)>d&&t.preventDefault(),a&&0!==l.clientX&&(a.style.transform="translate("+u+"px)",this.setState({dragScroll:u}))},o.deleteOverflowMouseMoveEvent=function(){var t=this.overflowContainerRef.current,e=this.state,n=e.dragScroll,o=e.paginationIndex,i=e.scrollLeft,r=this.props.paginationConfig,s=(null==r?void 0:r.minOffsetToChangeSlide)||150,l=(null==r?void 0:r.transitionTime)||1;if(t&&-i+n<-s){var a=o===Math.ceil(this.childrenCount/(this.props.numCols||1))-1,u=a?o*t.clientWidth:(o+1)*t.clientWidth;t.style.transition="all "+l+"s",t.style.transform="translate(-"+u+"px)",this.setState({paginationIndex:a?o:o+1,scrollValue:-u})}if(t&&-i+n>s){var d=0===o,h=d?0:(o-1)*t.clientWidth;t.style.transition="all "+l+"s",t.style.transform="translate(-"+h+"px)",this.setState({paginationIndex:d?o:o-1,scrollValue:-h})}c(t,-i+n>-s,-i+n<s)&&(t.style.transition="all "+l+"s",t.style.transform="translate(-"+o*t.clientWidth+"px)"),window.removeEventListener("mousemove",this.onOverflowContentDrag),window.removeEventListener("mouseup",this.deleteOverflowMouseMoveEvent)},o.renderChildren=function(){var t=this,n=this.props.numCols,o=this.props.spacing/2,i=this.props.children;return e.Children.map(i,(function(r,s){var l,a,u=s!==e.Children.count(i)-1?"paddingRight: "+o+"px":void 0,c=(null===(l=t.props.paginationConfig)||void 0===l?void 0:l.withScroll)||(null===(a=t.props.paginationConfig)||void 0===a?void 0:a.renderNextToEachOther)?"unset":"100%";return e.createElement(nt,{id:"react-smart-scroller-"+s,style:{padding:"0 "+o+"px",flexBasis:n?"calc(100% / "+n+")":"unset",paddingRight:u,paddingLeft:0!==s?"paddingLeft: "+o+"px":void 0,width:c}},r)}))},o.renderDots=function(){var t=this,n=this.props.paginationConfig;return Array.from(Array(this.numberOfViews)).map((function(o,i){return e.createElement(st,{key:i,style:{backgroundColor:t.state.paginationIndex===i?(null==n?void 0:n.activeDotColor)||"#2ecc71":(null==n?void 0:n.unactiveDotsColor)||"#bdc3c7"},onClick:function(){return t.onDotClick(i)}})}))},o.renderPagination=function(){var t=this.props,n=t.renderPagination,o=t.paginationConfig,i=(null==o?void 0:o.withScroll)?{marginTop:20}:{marginTop:"unset"};return n?n({selectedDot:this.state.paginationIndex,onPrev:this.onPrevious,onNext:this.onNext,childrenCount:this.childrenCount,onDotClick:this.onDotClick}):e.createElement(ot,{style:i},e.createElement(it,{onClick:this.onPrevious}),this.renderDots(),e.createElement(rt,{onClick:this.onNext}))},o.onOverflowContentScroll=function(){var t,e,n=this.overflowContainerRef.current,o=(null==n?void 0:n.scrollLeft)||0,i=null===(t=this.childrenWidth)||void 0===t?void 0:t.reduce((function(t,e,n){var o;return t.concat({index:n+1,value:e.value+((null===(o=t[n-1])||void 0===o?void 0:o.value)||0)})}),[]),r=null==i||null===(e=i.reverse())||void 0===e?void 0:e.find((function(t){return o>=t.value}));this.setState({paginationIndex:r?r.index:0})},o.render=function(){var t=this.props,n=t.paginationConfig;return e.createElement(tt,{style:t.style},e.createElement(et,{ref:this.overflowContainerRef,style:r({transition:"all "+((null==n?void 0:n.transitionTime)||1)+"s",flex:1},(null==n?void 0:n.withScroll)?{overflowX:"auto",marginBottom:-20}:{overflowX:"unset",marginBottom:"unset"}),onScroll:this.onOverflowContentScroll,onMouseDown:m()?d:this.onOverflowContentMouseDown},this.renderChildren()),this.renderPagination())},i(n,[{key:"childrenCount",get:function(){return e.Children.count(this.props.children)}},{key:"numberOfViews",get:function(){return Math.ceil(this.childrenCount/(this.props.numCols||1))}},{key:"childrenWidth",get:function(){var t=this;return e.Children.map(this.props.children,(function(e,n){var o,i;return{value:(null===(o=t.overflowContainerRef.current)||void 0===o||null===(i=o.children.item(n))||void 0===i?void 0:i.clientWidth)||0,index:n}}))}}]),n}(e.Component),tt=n.div(Z()),et=n.div(Q()),nt=n.div(K()),ot=n.div(J()),it=n.div(G(),"#000000"),rt=n.div(q(),"#000000"),st=n.div(U());function lt(){var t=a(["\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: relative;\n"]);return lt=function(){return t},t}var at=function(t){function n(){return t.apply(this,arguments)||this}s(n,t);var o=n.prototype;return o.renderMain=function(){return e.createElement(this.props.pagination?$:this.props.vertical?M:X,Object.assign({},this.props))},o.render=function(){return v()?null:e.createElement(ut,null,this.renderMain())},n}(e.Component),ut=n.div(lt());t.ReactSmartScroller=at,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=react-smart-scroller.umd.production.min.js.map
{
"name": "react-smart-scroller",
"version": "1.1.20",
"version": "1.1.21",
"description": "React-smart-scroller is a library that allows you to create highly customizable horizontal or vertical scroller in easy way. You can modify track styles or pass your own thumb (own component)",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc