react-slick
Advanced tools
Comparing version 0.23.2 to 0.24.0
@@ -1,6 +0,12 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.Slider=t(require("react"),require("react-dom")):e.Slider=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(1),o=r(i);t.default=o.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=n(2),c=r(l),u=n(3),d=n(13),p=r(d),f=n(15),h=r(f),v=n(8),y=(0,v.canUseDOM)()&&n(16),g=function(e){function t(n){i(this,t);var r=o(this,e.call(this,n));return r.innerSliderRefHandler=function(e){return r.innerSlider=e},r.slickPrev=function(){return r.innerSlider.slickPrev()},r.slickNext=function(){return r.innerSlider.slickNext()},r.slickGoTo=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r.innerSlider.slickGoTo(e,t)},r.slickPause=function(){return r.innerSlider.pause("paused")},r.slickPlay=function(){return r.innerSlider.autoPlay("play")},r.state={breakpoint:null},r._responsiveMediaHandlers=[],r}return s(t,e),t.prototype.media=function(e,t){y.register(e,t),this._responsiveMediaHandlers.push({query:e,handler:t})},t.prototype.componentWillMount=function(){var e=this;if(this.props.responsive){var t=this.props.responsive.map(function(e){return e.breakpoint});t.sort(function(e,t){return e-t}),t.forEach(function(n,r){var i=void 0;i=0===r?(0,p.default)({minWidth:0,maxWidth:n}):(0,p.default)({minWidth:t[r-1]+1,maxWidth:n}),(0,v.canUseDOM)()&&e.media(i,function(){e.setState({breakpoint:n})})});var n=(0,p.default)({minWidth:t.slice(-1)[0]});(0,v.canUseDOM)()&&this.media(n,function(){e.setState({breakpoint:null})})}},t.prototype.componentWillUnmount=function(){this._responsiveMediaHandlers.forEach(function(e){y.unregister(e.query,e.handler)})},t.prototype.render=function(){var e,t,n=this;this.state.breakpoint?(t=this.props.responsive.filter(function(e){return e.breakpoint===n.state.breakpoint}),e="unslick"===t[0].settings?"unslick":a({},h.default,this.props,t[0].settings)):e=a({},h.default,this.props),e.centerMode&&(e.slidesToScroll>1&&console.warn("slidesToScroll should be equal to 1 in centerMode, you are using "+e.slidesToScroll),e.slidesToScroll=1),e.fade&&(e.slidesToShow>1&&console.warn("slidesToShow should be equal to 1 when fade is true, you're using "+e.slidesToShow),e.slidesToScroll>1&&console.warn("slidesToScroll should be equal to 1 when fade is true, you're using "+e.slidesToScroll),e.slidesToShow=1,e.slidesToScroll=1);var r=c.default.Children.toArray(this.props.children);r=r.filter(function(e){return"string"==typeof e?!!e.trim():!!e}),e.variableWidth&&(e.rows>1||e.slidesPerRow>1)&&(console.warn("variableWidth is not supported in case of rows > 1 or slidesPerRow > 1"),e.variableWidth=!1);for(var i=[],o=null,s=0;s<r.length;s+=e.rows*e.slidesPerRow){for(var l=[],d=s;d<s+e.rows*e.slidesPerRow;d+=e.slidesPerRow){for(var p=[],f=d;f<d+e.slidesPerRow&&(e.variableWidth&&r[f].props.style&&(o=r[f].props.style.width),!(f>=r.length));f+=1)p.push(c.default.cloneElement(r[f],{key:100*s+10*d+f,tabIndex:-1,style:{width:100/e.slidesPerRow+"%",display:"inline-block"}}));l.push(c.default.createElement("div",{key:10*s+d},p))}e.variableWidth?i.push(c.default.createElement("div",{key:s,style:{width:o}},l)):i.push(c.default.createElement("div",{key:s},l))}if("unslick"===e){var v="regular slider "+(this.props.className||"");return c.default.createElement("div",{className:v},i)}return i.length<=e.slidesToShow&&(e.unslick=!0),c.default.createElement(u.InnerSlider,a({ref:this.innerSliderRefHandler},e),i)},t}(c.default.Component);t.default=g},function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0,t.InnerSlider=void 0;var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(2),d=r(u),p=n(4),f=r(p),h=n(5),v=r(h),y=n(6),g=r(y),S=n(7),w=r(S),m=n(8),b=n(9),k=n(10),T=n(11),O=n(12),_=r(O);t.InnerSlider=function(e){function t(n){o(this,t);var r=s(this,e.call(this,n));return r.listRefHandler=function(e){return r.list=e},r.trackRefHandler=function(e){return r.track=e},r.adaptHeight=function(){if(r.props.adaptiveHeight&&r.list){var e=r.list.querySelector('[data-index="'+r.state.currentSlide+'"]');r.list.style.height=(0,m.getHeight)(e)+"px"}},r.componentWillMount=function(){if(r.ssrInit(),r.props.onInit&&r.props.onInit(),r.props.lazyLoad){var e=(0,m.getOnDemandLazySlides)(c({},r.props,r.state));e.length>0&&(r.setState(function(t){return{lazyLoadedList:t.lazyLoadedList.concat(e)}}),r.props.onLazyLoad&&r.props.onLazyLoad(e))}},r.componentDidMount=function(){var e=c({listRef:r.list,trackRef:r.track},r.props);r.updateState(e,!0,function(){r.adaptHeight(),r.props.autoplay&&r.autoPlay("update")}),"progressive"===r.props.lazyLoad&&(r.lazyLoadTimer=setInterval(r.progressiveLazyLoad,1e3)),r.ro=new _.default(function(){r.state.animating?(r.onWindowResized(!1),r.callbackTimers.push(setTimeout(function(){return r.onWindowResized()},r.props.speed))):r.onWindowResized()}),r.ro.observe(r.list),Array.prototype.forEach.call(document.querySelectorAll(".slick-slide"),function(e){e.onfocus=r.props.pauseOnFocus?r.onSlideFocus:null,e.onblur=r.props.pauseOnFocus?r.onSlideBlur:null}),window&&(window.addEventListener?window.addEventListener("resize",r.onWindowResized):window.attachEvent("onresize",r.onWindowResized))},r.componentWillUnmount=function(){r.animationEndCallback&&clearTimeout(r.animationEndCallback),r.lazyLoadTimer&&clearInterval(r.lazyLoadTimer),r.callbackTimers.length&&(r.callbackTimers.forEach(function(e){return clearTimeout(e)}),r.callbackTimers=[]),window.addEventListener?window.removeEventListener("resize",r.onWindowResized):window.detachEvent("onresize",r.onWindowResized),r.autoplayTimer&&clearInterval(r.autoplayTimer)},r.componentWillReceiveProps=function(e){for(var t=c({listRef:r.list,trackRef:r.track},e,r.state),n=!1,i=Object.keys(r.props),o=Array.isArray(i),s=0,i=o?i:i[Symbol.iterator]();;){var a;if(o){if(s>=i.length)break;a=i[s++]}else{if(s=i.next(),s.done)break;a=s.value}var u=a;if(!e.hasOwnProperty(u)){n=!0;break}if("object"!==l(e[u])&&"function"!=typeof e[u]&&e[u]!==r.props[u]){n=!0;break}}r.updateState(t,n,function(){r.state.currentSlide>=d.default.Children.count(e.children)&&r.changeSlide({message:"index",index:d.default.Children.count(e.children)-e.slidesToShow,currentSlide:r.state.currentSlide}),e.autoplay?r.autoPlay("update"):r.pause("paused")})},r.componentDidUpdate=function(){if(r.checkImagesLoad(),r.props.onReInit&&r.props.onReInit(),r.props.lazyLoad){var e=(0,m.getOnDemandLazySlides)(c({},r.props,r.state));e.length>0&&(r.setState(function(t){return{lazyLoadedList:t.lazyLoadedList.concat(e)}}),r.props.onLazyLoad&&r.props.onLazyLoad(e))}r.adaptHeight()},r.onWindowResized=function(e){r.debouncedResize&&r.debouncedResize.cancel(),r.debouncedResize=(0,g.default)(function(){return r.resizeWindow(e)},50),r.debouncedResize()},r.resizeWindow=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(f.default.findDOMNode(r.track)){var t=c({listRef:r.list,trackRef:r.track},r.props,r.state);r.updateState(t,e,function(){r.props.autoplay?r.autoPlay("update"):r.pause("paused")}),r.setState({animating:!1}),clearTimeout(r.animationEndCallback),delete r.animationEndCallback}},r.updateState=function(e,t,n){var i=(0,m.initializedState)(e);e=c({},e,i,{slideIndex:i.currentSlide});var o=(0,m.getTrackLeft)(e);e=c({},e,{left:o});var s=(0,m.getTrackCSS)(e);(t||d.default.Children.count(r.props.children)!==d.default.Children.count(e.children))&&(i.trackStyle=s),r.setState(i,n)},r.ssrInit=function(){if(r.props.variableWidth){var e=0,t=0,n=[],i=(0,m.getPreClones)(c({},r.props,r.state,{slideCount:r.props.children.length})),o=(0,m.getPostClones)(c({},r.props,r.state,{slideCount:r.props.children.length}));r.props.children.forEach(function(t){n.push(t.props.style.width),e+=t.props.style.width});for(var s=0;s<i;s++)t+=n[n.length-1-s],e+=n[n.length-1-s];for(var a=0;a<o;a++)e+=n[a];for(var l=0;l<r.state.currentSlide;l++)t+=n[l];var u={width:e+"px",left:-t+"px"};if(r.props.centerMode){var p=n[r.state.currentSlide]+"px";u.left="calc("+u.left+" + (100% - "+p+") / 2 ) "}return void r.setState({trackStyle:u})}var f=d.default.Children.count(r.props.children),h=c({},r.props,r.state,{slideCount:f}),v=(0,m.getPreClones)(h)+(0,m.getPostClones)(h)+f,y=100/r.props.slidesToShow*v,g=100/v,S=-g*((0,m.getPreClones)(h)+r.state.currentSlide)*y/100;r.props.centerMode&&(S+=(100-g*y/100)/2);var w={width:y+"%",left:S+"%"};r.setState({slideWidth:g+"%",trackStyle:w})},r.checkImagesLoad=function(){var e=document.querySelectorAll(".slick-slide img"),t=e.length,n=0;Array.prototype.forEach.call(e,function(e){var i=function(){return++n&&n>=t&&r.onWindowResized()};if(e.onclick){var o=e.onclick;e.onclick=function(){o(),e.parentNode.focus()}}else e.onclick=function(){return e.parentNode.focus()};e.onload||(r.props.lazyLoad?e.onload=function(){r.adaptHeight(),r.callbackTimers.push(setTimeout(r.onWindowResized,r.props.speed))}:(e.onload=i,e.onerror=function(){i(),r.props.onLazyLoadError&&r.props.onLazyLoadError()}))})},r.progressiveLazyLoad=function(){for(var e=[],t=c({},r.props,r.state),n=r.state.currentSlide;n<r.state.slideCount+(0,m.getPostClones)(t);n++)if(r.state.lazyLoadedList.indexOf(n)<0){e.push(n);break}for(var i=r.state.currentSlide-1;i>=-(0,m.getPreClones)(t);i--)if(r.state.lazyLoadedList.indexOf(i)<0){e.push(i);break}e.length>0?(r.setState(function(t){return{lazyLoadedList:t.lazyLoadedList.concat(e)}}),r.props.onLazyLoad&&r.props.onLazyLoad(e)):r.lazyLoadTimer&&(clearInterval(r.lazyLoadTimer),delete r.lazyLoadTimer)},r.slideHandler=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=r.props,o=n.asNavFor,s=n.beforeChange,a=n.onLazyLoad,l=n.speed,u=n.afterChange,d=r.state.currentSlide,p=(0,m.slideHandler)(c({index:e},r.props,r.state,{trackRef:r.track,useCSS:r.props.useCSS&&!t})),f=p.state,h=p.nextState;if(f){s&&s(d,f.currentSlide);var v=f.lazyLoadedList.filter(function(e){return r.state.lazyLoadedList.indexOf(e)<0});a&&v.length>0&&a(v),r.setState(f,function(){o&&o.innerSlider.state.currentSlide!==d&&o.innerSlider.slideHandler(e),h&&(r.animationEndCallback=setTimeout(function(){var e=h.animating,t=i(h,["animating"]);r.setState(t,function(){r.callbackTimers.push(setTimeout(function(){return r.setState({animating:e})},10)),u&&u(f.currentSlide),delete r.animationEndCallback})},l))})}},r.changeSlide=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=c({},r.props,r.state),i=(0,m.changeSlide)(n,e);(0===i||i)&&(t===!0?r.slideHandler(i,t):r.slideHandler(i))},r.clickHandler=function(e){r.clickable===!1&&(e.stopPropagation(),e.preventDefault()),r.clickable=!0},r.keyHandler=function(e){var t=(0,m.keyHandler)(e,r.props.accessibility,r.props.rtl);""!==t&&r.changeSlide({message:t})},r.selectHandler=function(e){r.changeSlide(e)},r.disableBodyScroll=function(){var e=function(e){e=e||window.event,e.preventDefault&&e.preventDefault(),e.returnValue=!1};window.ontouchmove=e},r.enableBodyScroll=function(){window.ontouchmove=null},r.swipeStart=function(e){r.props.verticalSwiping&&r.disableBodyScroll();var t=(0,m.swipeStart)(e,r.props.swipe,r.props.draggable);""!==t&&r.setState(t)},r.swipeMove=function(e){var t=(0,m.swipeMove)(e,c({},r.props,r.state,{trackRef:r.track,listRef:r.list,slideIndex:r.state.currentSlide}));t&&(t.swiping&&(r.clickable=!1),r.setState(t))},r.swipeEnd=function(e){var t=(0,m.swipeEnd)(e,c({},r.props,r.state,{trackRef:r.track,listRef:r.list,slideIndex:r.state.currentSlide}));if(t){var n=t.triggerSlideHandler;delete t.triggerSlideHandler,r.setState(t),void 0!==n&&(r.slideHandler(n),r.props.verticalSwiping&&r.enableBodyScroll())}},r.slickPrev=function(){r.callbackTimers.push(setTimeout(function(){return r.changeSlide({message:"previous"})},0))},r.slickNext=function(){r.callbackTimers.push(setTimeout(function(){return r.changeSlide({message:"next"})},0))},r.slickGoTo=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e=Number(e),isNaN(e)?"":void r.callbackTimers.push(setTimeout(function(){return r.changeSlide({message:"index",index:e,currentSlide:r.state.currentSlide},t)},0))},r.play=function(){var e;if(r.props.rtl)e=r.state.currentSlide-r.props.slidesToScroll;else{if(!(0,m.canGoNext)(c({},r.props,r.state)))return!1;e=r.state.currentSlide+r.props.slidesToScroll}r.slideHandler(e)},r.autoPlay=function(e){r.autoplayTimer&&clearInterval(r.autoplayTimer);var t=r.state.autoplaying;if("update"===e){if("hovered"===t||"focused"===t||"paused"===t)return}else if("leave"===e){if("paused"===t||"focused"===t)return}else if("blur"===e&&("paused"===t||"hovered"===t))return;r.autoplayTimer=setInterval(r.play,r.props.autoplaySpeed+50),r.setState({autoplaying:"playing"})},r.pause=function(e){r.autoplayTimer&&(clearInterval(r.autoplayTimer),r.autoplayTimer=null);var t=r.state.autoplaying;"paused"===e?r.setState({autoplaying:"paused"}):"focused"===e?"hovered"!==t&&"playing"!==t||r.setState({autoplaying:"focused"}):"playing"===t&&r.setState({autoplaying:"hovered"})},r.onDotsOver=function(){return r.props.autoplay&&r.pause("hovered")},r.onDotsLeave=function(){return r.props.autoplay&&"hovered"===r.state.autoplaying&&r.autoPlay("leave")},r.onTrackOver=function(){return r.props.autoplay&&r.pause("hovered")},r.onTrackLeave=function(){return r.props.autoplay&&"hovered"===r.state.autoplaying&&r.autoPlay("leave")},r.onSlideFocus=function(){return r.props.autoplay&&r.pause("focused")},r.onSlideBlur=function(){return r.props.autoplay&&"focused"===r.state.autoplaying&&r.autoPlay("blur")},r.render=function(){var e=(0,w.default)("slick-slider",r.props.className,{"slick-vertical":r.props.vertical,"slick-initialized":!0}),t=c({},r.props,r.state),n=(0,m.extractObject)(t,["fade","cssEase","speed","infinite","centerMode","focusOnSelect","currentSlide","lazyLoad","lazyLoadedList","rtl","slideWidth","slideHeight","listHeight","vertical","slidesToShow","slidesToScroll","slideCount","trackStyle","variableWidth","unslick","centerPadding"]),i=r.props.pauseOnHover;n=c({},n,{onMouseEnter:i?r.onTrackOver:null,onMouseLeave:i?r.onTrackLeave:null,onMouseOver:i?r.onTrackOver:null,focusOnSelect:r.props.focusOnSelect?r.selectHandler:null});var o;if(r.props.dots===!0&&r.state.slideCount>=r.props.slidesToShow){var s=(0,m.extractObject)(t,["dotsClass","slideCount","slidesToShow","currentSlide","slidesToScroll","clickHandler","children","customPaging","infinite","appendDots"]),a=r.props.pauseOnDotsHover;s=c({},s,{clickHandler:r.changeSlide,onMouseEnter:a?r.onDotsLeave:null,onMouseOver:a?r.onDotsOver:null,onMouseLeave:a?r.onDotsLeave:null}),o=d.default.createElement(k.Dots,s)}var l,u,p=(0,m.extractObject)(t,["infinite","centerMode","currentSlide","slideCount","slidesToShow","prevArrow","nextArrow"]);p.clickHandler=r.changeSlide,r.props.arrows&&(l=d.default.createElement(T.PrevArrow,p),u=d.default.createElement(T.NextArrow,p));var f=null;r.props.vertical&&(f={height:r.state.listHeight});var h=null;r.props.vertical===!1?r.props.centerMode===!0&&(h={padding:"0px "+r.props.centerPadding}):r.props.centerMode===!0&&(h={padding:r.props.centerPadding+" 0px"});var v=c({},f,h),y=r.props.touchMove,g={className:"slick-list",style:v,onClick:r.clickHandler,onMouseDown:y?r.swipeStart:null,onMouseMove:r.state.dragging&&y?r.swipeMove:null,onMouseUp:y?r.swipeEnd:null,onMouseLeave:r.state.dragging&&y?r.swipeEnd:null,onTouchStart:y?r.swipeStart:null,onTouchMove:r.state.dragging&&y?r.swipeMove:null,onTouchEnd:y?r.swipeEnd:null,onTouchCancel:r.state.dragging&&y?r.swipeEnd:null,onKeyDown:r.props.accessibility?r.keyHandler:null},S={className:e,dir:"ltr"};return r.props.unslick&&(g={className:"slick-list"},S={className:e}),d.default.createElement("div",S,r.props.unslick?"":l,d.default.createElement("div",c({ref:r.listRefHandler},g),d.default.createElement(b.Track,c({ref:r.trackRefHandler},n),r.props.children)),r.props.unslick?"":u,r.props.unslick?"":o)},r.list=null,r.track=null,r.state=c({},v.default,{currentSlide:r.props.initialSlide,slideCount:d.default.Children.count(r.props.children)}),r.callbackTimers=[],r.clickable=!0,r.debouncedResize=null,r}return a(t,e),t}(d.default.Component)},function(e,n){e.exports=t},function(e,t){"use strict";t.__esModule=!0;var n={animating:!1,autoplaying:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,dragging:!1,edgeDragged:!1,initialized:!1,lazyLoadedList:[],listHeight:null,listWidth:null,scrolling:!1,slideCount:null,slideHeight:null,slideWidth:null,swipeLeft:null,swiped:!1,swiping:!1,touchObject:{startX:0,startY:0,curX:0,curY:0},trackStyle:{},trackWidth:0};t.default=n},function(e,t){(function(t){function n(e,t,n){function i(t){var n=v,r=y;return v=y=void 0,O=t,S=e.apply(r,n)}function o(e){return O=e,w=setTimeout(u,t),_?i(e):S}function l(e){var n=e-T,r=e-O,i=t-n;return x?b(i,g-r):i}function c(e){var n=e-T,r=e-O;return void 0===T||n>=t||n<0||x&&r>=g}function u(){var e=k();return c(e)?d(e):void(w=setTimeout(u,l(e)))}function d(e){return w=void 0,E&&v?i(e):(v=y=void 0,S)}function p(){void 0!==w&&clearTimeout(w),O=0,v=T=y=w=void 0}function f(){return void 0===w?S:d(k())}function h(){var e=k(),n=c(e);if(v=arguments,y=this,T=e,n){if(void 0===w)return o(T);if(x)return w=setTimeout(u,t),i(T)}return void 0===w&&(w=setTimeout(u,t)),S}var v,y,g,S,w,T,O=0,_=!1,x=!1,E=!0;if("function"!=typeof e)throw new TypeError(a);return t=s(t)||0,r(n)&&(_=!!n.leading,x="maxWait"in n,g=x?m(s(n.maxWait)||0,t):g,E="trailing"in n?!!n.trailing:E),h.cancel=p,h.flush=f,h}function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==typeof e}function o(e){return"symbol"==typeof e||i(e)&&w.call(e)==c}function s(e){if("number"==typeof e)return e;if(o(e))return l;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(u,"");var n=p.test(e);return n||f.test(e)?h(e.slice(2),n?2:8):d.test(e)?l:+e}var a="Expected a function",l=NaN,c="[object Symbol]",u=/^\s+|\s+$/g,d=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,f=/^0o[0-7]+$/i,h=parseInt,v="object"==typeof t&&t&&t.Object===Object&&t,y="object"==typeof self&&self&&self.Object===Object&&self,g=v||y||Function("return this")(),S=Object.prototype,w=S.toString,m=Math.max,b=Math.min,k=function(){return g.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t,n){var r,i;/*! | ||
Copyright (c) 2016 Jed Watson. | ||
Licensed under the MIT License (MIT), see | ||
http://jedwatson.github.io/classnames | ||
*/ | ||
!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r))e.push(n.apply(null,r));else if("object"===i)for(var s in r)o.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}var o={}.hasOwnProperty;"undefined"!=typeof e&&e.exports?e.exports=n:(r=[],i=function(){return n}.apply(t,r),!(void 0!==i&&(e.exports=i)))}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.canUseDOM=t.slidesOnLeft=t.slidesOnRight=t.siblingDirection=t.getTotalSlides=t.getPostClones=t.getPreClones=t.getTrackLeft=t.getTrackAnimateCSS=t.getTrackCSS=t.checkSpecKeys=t.getSlideCount=t.checkNavigable=t.getNavigableIndexes=t.swipeEnd=t.swipeMove=t.swipeStart=t.keyHandler=t.changeSlide=t.slideHandler=t.initializedState=t.extractObject=t.canGoNext=t.getSwipeDirection=t.getHeight=t.getWidth=t.lazySlidesOnRight=t.lazySlidesOnLeft=t.lazyEndIndex=t.lazyStartIndex=t.getRequiredLazySlides=t.getOnDemandLazySlides=void 0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(2),s=r(o),a=n(4),l=r(a),c=t.getOnDemandLazySlides=function(e){for(var t=[],n=u(e),r=d(e),i=n;i<r;i++)e.lazyLoadedList.indexOf(i)<0&&t.push(i);return t},u=(t.getRequiredLazySlides=function(e){for(var t=[],n=u(e),r=d(e),i=n;i<r;i++)t.push(i);return t},t.lazyStartIndex=function(e){return e.currentSlide-p(e)}),d=t.lazyEndIndex=function(e){return e.currentSlide+f(e)},p=t.lazySlidesOnLeft=function(e){return e.centerMode?Math.floor(e.slidesToShow/2)+(parseInt(e.centerPadding)>0?1:0):0},f=t.lazySlidesOnRight=function(e){return e.centerMode?Math.floor((e.slidesToShow-1)/2)+1+(parseInt(e.centerPadding)>0?1:0):e.slidesToShow},h=t.getWidth=function(e){return e&&e.offsetWidth||0},v=t.getHeight=function(e){return e&&e.offsetHeight||0},y=t.getSwipeDirection=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=e.startX-e.curX,n=e.startY-e.curY,r=Math.atan2(n,t),i=Math.round(180*r/Math.PI),i<0&&(i=360-Math.abs(i)),i<=45&&i>=0||i<=360&&i>=315?"left":i>=135&&i<=225?"right":o===!0?i>=35&&i<=135?"up":"down":"vertical"},g=t.canGoNext=function(e){var t=!0;return e.infinite||(e.centerMode&&e.currentSlide>=e.slideCount-1?t=!1:(e.slideCount<=e.slidesToShow||e.currentSlide>=e.slideCount-e.slidesToShow)&&(t=!1)),t},S=(t.extractObject=function(e,t){var n={};return t.forEach(function(t){return n[t]=e[t]}),n},t.initializedState=function(e){var t=s.default.Children.count(e.children),n=Math.ceil(h(l.default.findDOMNode(e.listRef))),r=Math.ceil(h(l.default.findDOMNode(e.trackRef))),i=void 0;if(e.vertical)i=n;else{var o=e.centerMode&&2*parseInt(e.centerPadding);"string"==typeof e.centerPadding&&"%"===e.centerPadding.slice(-1)&&(o*=n/100),i=Math.ceil((n-o)/e.slidesToShow)}var a=l.default.findDOMNode(e.listRef)&&v(l.default.findDOMNode(e.listRef).querySelector('[data-index="0"]')),u=a*e.slidesToShow,d=void 0===e.currentSlide?e.initialSlide:e.currentSlide;e.rtl&&void 0===e.currentSlide&&(d=t-1-e.initialSlide);var p=e.lazyLoadedList||[],f=c({currentSlide:d,lazyLoadedList:p},e);p.concat(f);var y={slideCount:t,slideWidth:i,listWidth:n,trackWidth:r,currentSlide:d,slideHeight:a,listHeight:u,lazyLoadedList:p};return null===e.autoplaying&&e.autoplay&&(y.autoplaying="playing"),y},t.slideHandler=function(e){var t=e.waitForAnimate,n=e.animating,r=e.fade,o=e.infinite,s=e.index,a=e.slideCount,l=e.lazyLoadedList,u=e.lazyLoad,d=e.currentSlide,p=e.centerMode,f=e.slidesToScroll,h=e.slidesToShow,v=e.useCSS;if(t&&n)return{};var y=s,S=void 0,w=void 0,m=void 0,b={},_={};if(r){if(!o&&(s<0||s>=a))return{};s<0?y=s+a:s>=a&&(y=s-a),u&&l.indexOf(y)<0&&l.push(y),b={animating:!0,currentSlide:y,lazyLoadedList:l},_={animating:!1}}else S=y,y<0?(S=y+a,o?a%f!==0&&(S=a-a%f):S=0):!g(e)&&y>d?y=S=d:p&&y>=a?(y=o?a:a-1,S=o?0:a-1):y>=a&&(S=y-a,o?a%f!==0&&(S=0):S=a-h),w=O(i({},e,{slideIndex:y})),m=O(i({},e,{slideIndex:S})),o||(w===m&&(y=S),w=m),u&&l.concat(c(i({},e,{currentSlide:y}))),v?(b={animating:!0,currentSlide:S,trackStyle:T(i({},e,{left:w})),lazyLoadedList:l},_={animating:!1,currentSlide:S,trackStyle:k(i({},e,{left:m})),swipeLeft:null}):b={currentSlide:S,trackStyle:k(i({},e,{left:m})),lazyLoadedList:l};return{state:b,nextState:_}},t.changeSlide=function(e,t){var n,r,o,s,a,l=e.slidesToScroll,c=e.slidesToShow,u=e.slideCount,d=e.currentSlide,p=e.lazyLoad,f=e.infinite;if(s=u%l!==0,n=s?0:(u-d)%l,"previous"===t.message)o=0===n?l:c-n,a=d-o,p&&!f&&(r=d-o,a=r===-1?u-1:r);else if("next"===t.message)o=0===n?l:n,a=d+o,p&&!f&&(a=(d+l)%u+n);else if("dots"===t.message){if(a=t.index*t.slidesToScroll,a===t.currentSlide)return null}else if("children"===t.message){if(a=t.index,a===t.currentSlide)return null;if(f){var h=M(i({},e,{targetSlide:a}));a>t.currentSlide&&"left"===h?a-=u:a<t.currentSlide&&"right"===h&&(a+=u)}}else if("index"===t.message&&(a=Number(t.index),a===t.currentSlide))return null;return a},t.keyHandler=function(e,t,n){return e.target.tagName.match("TEXTAREA|INPUT|SELECT")||!t?"":37===e.keyCode?n?"next":"previous":39===e.keyCode?n?"previous":"next":""},t.swipeStart=function(e,t,n){return"IMG"===e.target.tagName&&e.preventDefault(),!t||!n&&e.type.indexOf("mouse")!==-1?"":{dragging:!0,touchObject:{startX:e.touches?e.touches[0].pageX:e.clientX,startY:e.touches?e.touches[0].pageY:e.clientY,curX:e.touches?e.touches[0].pageX:e.clientX,curY:e.touches?e.touches[0].pageY:e.clientY}}},t.swipeMove=function(e,t){var n=t.scrolling,r=t.animating,o=t.vertical,s=t.swipeToSlide,a=t.verticalSwiping,l=t.rtl,c=t.currentSlide,u=t.edgeFriction,d=t.edgeDragged,p=t.onEdge,f=t.swiped,h=t.swiping,v=t.slideCount,S=t.slidesToScroll,w=t.infinite,m=t.touchObject,b=t.swipeEvent,T=t.listHeight,_=t.listWidth;if(!n){if(r)return e.preventDefault();o&&s&&a&&e.preventDefault();var x=void 0,E={},M=O(t);m.curX=e.touches?e.touches[0].pageX:e.clientX,m.curY=e.touches?e.touches[0].pageY:e.clientY,m.swipeLength=Math.round(Math.sqrt(Math.pow(m.curX-m.startX,2)));var L=Math.round(Math.sqrt(Math.pow(m.curY-m.startY,2)));if(!a&&!h&&L>10)return{scrolling:!0};a&&(m.swipeLength=L);var C=(l?-1:1)*(m.curX>m.startX?1:-1);a&&(C=m.curY>m.startY?1:-1);var z=Math.ceil(v/S),P=y(t.touchObject,a),H=m.swipeLength;return w||(0===c&&"right"===P||c+1>=z&&"left"===P||!g(t)&&"left"===P)&&(H=m.swipeLength*u,d===!1&&p&&(p(P),E.edgeDragged=!0)),!f&&b&&(b(P),E.swiped=!0),x=o?M+H*(T/_)*C:l?M-H*C:M+H*C,a&&(x=M+H*C),E=i({},E,{touchObject:m,swipeLeft:x,trackStyle:k(i({},t,{left:x}))}),Math.abs(m.curX-m.startX)<.8*Math.abs(m.curY-m.startY)?E:(m.swipeLength>10&&(E.swiping=!0,e.preventDefault()),E)}},t.swipeEnd=function(e,t){var n=t.dragging,r=t.swipe,o=t.touchObject,s=t.listWidth,a=t.touchThreshold,l=t.verticalSwiping,c=t.listHeight,u=t.currentSlide,d=t.swipeToSlide,p=t.scrolling,f=t.onSwipe;if(!n)return r&&e.preventDefault(),{};var h=l?c/a:s/a,v=y(o,l),g={dragging:!1,edgeDragged:!1,scrolling:!1,swiping:!1,swiped:!1,swipeLeft:null,touchObject:{}};if(p)return g;if(!o.swipeLength)return g;if(o.swipeLength>h){e.preventDefault(),f&&f(v);var S=void 0,b=void 0;switch(v){case"left":case"up":b=u+m(t),S=d?w(t,b):b,g.currentDirection=0;break;case"right":case"down":b=u-m(t),S=d?w(t,b):b,g.currentDirection=1;break;default:S=u}g.triggerSlideHandler=S}else{var k=O(t);g.trackStyle=T(i({},t,{left:k}))}return g},t.getNavigableIndexes=function(e){for(var t=e.infinite?2*e.slideCount:e.slideCount,n=e.infinite?e.slidesToShow*-1:0,r=e.infinite?e.slidesToShow*-1:0,i=[];n<t;)i.push(n),n=r+e.slidesToScroll,r+=Math.min(e.slidesToScroll,e.slidesToShow);return i}),w=t.checkNavigable=function(e,t){var n=S(e),r=0;if(t>n[n.length-1])t=n[n.length-1];else for(var i in n){if(t<n[i]){t=r;break}r=n[i]}return t},m=t.getSlideCount=function(e){var t=e.centerMode?e.slideWidth*Math.floor(e.slidesToShow/2):0;if(e.swipeToSlide){var n=void 0,r=l.default.findDOMNode(e.listRef),i=r.querySelectorAll(".slick-slide");if(Array.from(i).every(function(r){if(e.vertical){if(r.offsetTop+v(r)/2>e.swipeLeft*-1)return n=r,!1}else if(r.offsetLeft-t+h(r)/2>e.swipeLeft*-1)return n=r,!1;return!0}),!n)return 0;var o=e.rtl===!0?e.slideCount-e.currentSlide:e.currentSlide,s=Math.abs(n.dataset.index-o)||1;return s}return e.slidesToScroll},b=t.checkSpecKeys=function(e,t){return t.reduce(function(t,n){return t&&e.hasOwnProperty(n)},!0)?null:console.error("Keys Missing:",e)},k=t.getTrackCSS=function(e){b(e,["left","variableWidth","slideCount","slidesToShow","slideWidth"]);var t=void 0,n=void 0,r=e.slideCount+2*e.slidesToShow;e.vertical?n=r*e.slideHeight:t=E(e)*e.slideWidth;var o={opacity:1,transition:"",WebkitTransition:""};if(e.useTransform){var s=e.vertical?"translate3d(0px, "+e.left+"px, 0px)":"translate3d("+e.left+"px, 0px, 0px)",a=e.vertical?"translate3d(0px, "+e.left+"px, 0px)":"translate3d("+e.left+"px, 0px, 0px)",l=e.vertical?"translateY("+e.left+"px)":"translateX("+e.left+"px)";o=i({},o,{WebkitTransform:s,transform:a,msTransform:l})}else e.vertical?o.top=e.left:o.left=e.left;return e.fade&&(o={opacity:1}),t&&(o.width=t),n&&(o.height=n),window&&!window.addEventListener&&window.attachEvent&&(e.vertical?o.marginTop=e.left+"px":o.marginLeft=e.left+"px"),o},T=t.getTrackAnimateCSS=function(e){b(e,["left","variableWidth","slideCount","slidesToShow","slideWidth","speed","cssEase"]);var t=k(e);return e.useTransform?(t.WebkitTransition="-webkit-transform "+e.speed+"ms "+e.cssEase,t.transition="transform "+e.speed+"ms "+e.cssEase):e.vertical?t.transition="top "+e.speed+"ms "+e.cssEase:t.transition="left "+e.speed+"ms "+e.cssEase,t},O=t.getTrackLeft=function(e){if(e.unslick)return 0;b(e,["slideIndex","trackRef","infinite","centerMode","slideCount","slidesToShow","slidesToScroll","slideWidth","listWidth","variableWidth","slideHeight"]);var t,n,r=e.slideIndex,i=e.trackRef,o=e.infinite,s=e.centerMode,a=e.slideCount,c=e.slidesToShow,u=e.slidesToScroll,d=e.slideWidth,p=e.listWidth,f=e.variableWidth,h=e.slideHeight,v=e.fade,y=e.vertical,g=0,S=0;if(v||1===e.slideCount)return 0;var w=0;if(o?(w=-_(e),a%u!==0&&r+u>a&&(w=-(r>a?c-(r-a):a%u)),s&&(w+=parseInt(c/2))):(a%u!==0&&r+u>a&&(w=c-a%u),s&&(w=parseInt(c/2))),g=w*d,S=w*h,t=y?r*h*-1+S:r*d*-1+g,f===!0){var m,k=l.default.findDOMNode(i);if(m=r+_(e),n=k&&k.childNodes[m],t=n?n.offsetLeft*-1:0,s===!0){m=o?r+_(e):r,n=k&&k.children[m],t=0;for(var T=0;T<m;T++)t-=k&&k.children[T]&&k.children[T].offsetWidth;t-=parseInt(e.centerPadding),t+=n&&(p-n.offsetWidth)/2}}return t},_=t.getPreClones=function(e){return e.unslick||!e.infinite?0:e.variableWidth?e.slideCount:e.slidesToShow+(e.centerMode?1:0)},x=t.getPostClones=function(e){return e.unslick||!e.infinite?0:e.slideCount},E=t.getTotalSlides=function(e){return 1===e.slideCount?1:_(e)+e.slideCount+x(e)},M=t.siblingDirection=function(e){return e.targetSlide>e.currentSlide?e.targetSlide>e.currentSlide+L(e)?"left":"right":e.targetSlide<e.currentSlide-C(e)?"right":"left"},L=t.slidesOnRight=function(e){var t=e.slidesToShow,n=e.centerMode,r=e.rtl,i=e.centerPadding;if(n){var o=(t-1)/2+1;return parseInt(i)>0&&(o+=1),r&&t%2===0&&(o+=1),o}return r?0:t-1},C=t.slidesOnLeft=function(e){var t=e.slidesToShow,n=e.centerMode,r=e.rtl,i=e.centerPadding;if(n){var o=(t-1)/2+1;return parseInt(i)>0&&(o+=1),r||t%2!==0||(o+=1),o}return r?t-1:0};t.canUseDOM=function(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0,t.Track=void 0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=n(2),c=r(l),u=n(7),d=r(u),p=n(8),f=function(e){var t,n,r,i,o;o=e.rtl?e.slideCount-1-e.index:e.index,r=o<0||o>=e.slideCount,e.centerMode?(i=Math.floor(e.slidesToShow/2),n=(o-e.currentSlide)%e.slideCount===0,o>e.currentSlide-i-1&&o<=e.currentSlide+i&&(t=!0)):t=e.currentSlide<=o&&o<e.currentSlide+e.slidesToShow;var s=o===e.currentSlide;return{"slick-slide":!0,"slick-active":t,"slick-center":n,"slick-cloned":r,"slick-current":s}},h=function(e){var t={};return void 0!==e.variableWidth&&e.variableWidth!==!1||(t.width=e.slideWidth),e.fade&&(t.position="relative",e.vertical?t.top=-e.index*parseInt(e.slideHeight):t.left=-e.index*parseInt(e.slideWidth),t.opacity=e.currentSlide===e.index?1:0,t.transition="opacity "+e.speed+"ms "+e.cssEase+", visibility "+e.speed+"ms "+e.cssEase,t.WebkitTransition="opacity "+e.speed+"ms "+e.cssEase+", visibility "+e.speed+"ms "+e.cssEase),t},v=function(e,t){return e.key||t},y=function(e){var t,n=[],r=[],i=[],o=c.default.Children.count(e.children),s=(0,p.lazyStartIndex)(e),l=(0,p.lazyEndIndex)(e);return c.default.Children.forEach(e.children,function(u,y){var g=void 0,S={message:"children",index:y,slidesToScroll:e.slidesToScroll,currentSlide:e.currentSlide};g=!e.lazyLoad||e.lazyLoad&&e.lazyLoadedList.indexOf(y)>=0?u:c.default.createElement("div",null);var w=h(a({},e,{index:y})),m=g.props.className||"",b=f(a({},e,{index:y}));if(n.push(c.default.cloneElement(g,{key:"original"+v(g,y),"data-index":y,className:(0,d.default)(b,m),tabIndex:"-1","aria-hidden":!b["slick-active"],style:a({outline:"none"},g.props.style||{},w),onClick:function(t){g.props&&g.props.onClick&&g.props.onClick(t),e.focusOnSelect&&e.focusOnSelect(S)}})),e.infinite&&e.fade===!1){var k=o-y;k<=(0,p.getPreClones)(e)&&o!==e.slidesToShow&&(t=-k,t>=s&&(g=u),b=f(a({},e,{index:t})),r.push(c.default.cloneElement(g,{key:"precloned"+v(g,t),"data-index":t,tabIndex:"-1",className:(0,d.default)(b,m),"aria-hidden":!b["slick-active"],style:a({},g.props.style||{},w),onClick:function(t){g.props&&g.props.onClick&&g.props.onClick(t),e.focusOnSelect&&e.focusOnSelect(S)}}))),o!==e.slidesToShow&&(t=o+y,t<l&&(g=u),b=f(a({},e,{index:t})),i.push(c.default.cloneElement(g,{key:"postcloned"+v(g,t),"data-index":t,tabIndex:"-1",className:(0,d.default)(b,m),"aria-hidden":!b["slick-active"],style:a({},g.props.style||{},w),onClick:function(t){g.props&&g.props.onClick&&g.props.onClick(t),e.focusOnSelect&&e.focusOnSelect(S)}})))}}),e.rtl?r.concat(n,i).reverse():r.concat(n,i)};t.Track=function(e){function t(){return i(this,t),o(this,e.apply(this,arguments))}return s(t,e),t.prototype.render=function(){var e=y(this.props),t=this.props,n=t.onMouseEnter,r=t.onMouseOver,i=t.onMouseLeave,o={onMouseEnter:n,onMouseOver:r,onMouseLeave:i};return c.default.createElement("div",a({className:"slick-track",style:this.props.trackStyle},o),e)},t}(c.default.PureComponent)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0,t.Dots=void 0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=n(2),c=r(l),u=n(7),d=r(u),p=function(e){var t;return t=e.infinite?Math.ceil(e.slideCount/e.slidesToScroll):Math.ceil((e.slideCount-e.slidesToShow)/e.slidesToScroll)+1};t.Dots=function(e){function t(){return i(this,t),o(this,e.apply(this,arguments))}return s(t,e),t.prototype.clickHandler=function(e,t){t.preventDefault(),this.props.clickHandler(e)},t.prototype.render=function(){var e=this,t=p({slideCount:this.props.slideCount,slidesToScroll:this.props.slidesToScroll,slidesToShow:this.props.slidesToShow,infinite:this.props.infinite}),n=this.props,r=n.onMouseEnter,i=n.onMouseOver,o=n.onMouseLeave,s={onMouseEnter:r,onMouseOver:i,onMouseLeave:o},l=Array.apply(null,Array(t+1).join("0").split("")).map(function(t,n){var r=n*e.props.slidesToScroll,i=n*e.props.slidesToScroll+(e.props.slidesToScroll-1),o=(0,d.default)({"slick-active":e.props.currentSlide>=r&&e.props.currentSlide<=i}),s={message:"dots",index:n,slidesToScroll:e.props.slidesToScroll,currentSlide:e.props.currentSlide},a=e.clickHandler.bind(e,s);return c.default.createElement("li",{key:n,className:o},c.default.cloneElement(e.props.customPaging(n),{onClick:a}))});return c.default.cloneElement(this.props.appendDots(l),a({className:this.props.dotsClass},s))},t}(c.default.PureComponent)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0,t.NextArrow=t.PrevArrow=void 0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=n(2),c=r(l),u=n(7),d=r(u),p=n(8);t.PrevArrow=function(e){function t(){return i(this,t),o(this,e.apply(this,arguments))}return s(t,e),t.prototype.clickHandler=function(e,t){t&&t.preventDefault(),this.props.clickHandler(e,t)},t.prototype.render=function(){var e={"slick-arrow":!0,"slick-prev":!0},t=this.clickHandler.bind(this,{message:"previous"});!this.props.infinite&&(0===this.props.currentSlide||this.props.slideCount<=this.props.slidesToShow)&&(e["slick-disabled"]=!0,t=null);var n={key:"0","data-role":"none",className:(0,d.default)(e),style:{display:"block"},onClick:t},r={currentSlide:this.props.currentSlide,slideCount:this.props.slideCount},i=void 0;return i=this.props.prevArrow?c.default.cloneElement(this.props.prevArrow,a({},n,r)):c.default.createElement("button",a({key:"0",type:"button"},n)," ","Previous")},t}(c.default.PureComponent),t.NextArrow=function(e){function t(){return i(this,t),o(this,e.apply(this,arguments))}return s(t,e),t.prototype.clickHandler=function(e,t){t&&t.preventDefault(),this.props.clickHandler(e,t)},t.prototype.render=function(){var e={"slick-arrow":!0,"slick-next":!0},t=this.clickHandler.bind(this,{message:"next"});(0,p.canGoNext)(this.props)||(e["slick-disabled"]=!0,t=null);var n={key:"1","data-role":"none",className:(0,d.default)(e),style:{display:"block"},onClick:t},r={currentSlide:this.props.currentSlide,slideCount:this.props.slideCount},i=void 0;return i=this.props.nextArrow?c.default.cloneElement(this.props.nextArrow,a({},n,r)):c.default.createElement("button",a({key:"1",type:"button"},n)," ","Next")},t}(c.default.PureComponent)},function(e,t,n){(function(t){!function(t,n){e.exports=n()}(this,function(){"use strict";function e(e){return parseFloat(e)||0}function n(t){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return n.reduce(function(n,r){var i=t["border-"+r+"-width"];return n+e(i)},0)}function r(t){for(var n=["top","right","bottom","left"],r={},i=0,o=n;i<o.length;i+=1){var s=o[i],a=t["padding-"+s];r[s]=e(a)}return r}function i(e){var t=e.getBBox();return c(0,0,t.width,t.height)}function o(t){var i=t.clientWidth,o=t.clientHeight;if(!i&&!o)return k;var a=b(t).getComputedStyle(t),l=r(a),u=l.left+l.right,d=l.top+l.bottom,p=e(a.width),f=e(a.height);if("border-box"===a.boxSizing&&(Math.round(p+u)!==i&&(p-=n(a,"left","right")+u),Math.round(f+d)!==o&&(f-=n(a,"top","bottom")+d)),!s(t)){var h=Math.round(p+u)-i,v=Math.round(f+d)-o;1!==Math.abs(h)&&(p-=h),1!==Math.abs(v)&&(f-=v)}return c(l.left,l.top,p,f)}function s(e){return e===b(e).document.documentElement}function a(e){return d?T(e)?i(e):o(e):k}function l(e){var t=e.x,n=e.y,r=e.width,i=e.height,o="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,s=Object.create(o.prototype);return m(s,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),s}function c(e,t,n,r){return{x:e,y:t,width:n,height:r}}var u=function(){function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return"undefined"!=typeof Map?Map:function(){function t(){this.__entries__=[]}var n={size:{configurable:!0}};return n.size.get=function(){return this.__entries__.length},t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){var n=this;void 0===t&&(t=null);for(var r=0,i=n.__entries__;r<i.length;r+=1){var o=i[r];e.call(t,o[1],o[0])}},Object.defineProperties(t.prototype,n),t}()}(),d="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,p=function(){return"undefined"!=typeof t&&t.Math===Math?t:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")()}(),f=function(){return"function"==typeof requestAnimationFrame?requestAnimationFrame.bind(p):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),h=2,v=function(e,t){function n(){o&&(o=!1,e()),s&&i()}function r(){f(n)}function i(){var e=Date.now();if(o){if(e-a<h)return;s=!0}else o=!0,s=!1,setTimeout(r,t);a=e}var o=!1,s=!1,a=0;return i},y=20,g=["top","right","bottom","left","width","height","size","weight"],S="undefined"!=typeof MutationObserver,w=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=v(this.refresh.bind(this),y)};w.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},w.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},w.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},w.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},w.prototype.connect_=function(){d&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),S?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},w.prototype.disconnect_=function(){d&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},w.prototype.onTransitionEnd_=function(e){var t=e.propertyName;void 0===t&&(t="");var n=g.some(function(e){return!!~t.indexOf(e)});n&&this.refresh()},w.getInstance=function(){return this.instance_||(this.instance_=new w),this.instance_},w.instance_=null;var m=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n+=1){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},b=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||p},k=c(0,0,0,0),T=function(){return"undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof b(e).SVGGraphicsElement}:function(e){return e instanceof b(e).SVGElement&&"function"==typeof e.getBBox}}(),O=function(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=c(0,0,0,0),this.target=e};O.prototype.isActive=function(){var e=a(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},O.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e};var _=function(e,t){var n=l(t);m(this,{target:e,contentRect:n})},x=function(e,t,n){if(this.activeObservations_=[],this.observations_=new u,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n};x.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof b(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new O(e)),this.controller_.addObserver(this),this.controller_.refresh())}},x.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof b(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},x.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},x.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},x.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new _(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},x.prototype.clearActive=function(){this.activeObservations_.splice(0)},x.prototype.hasActive=function(){return this.activeObservations_.length>0};var E="undefined"!=typeof WeakMap?new WeakMap:new u,M=function(e){if(!(this instanceof M))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=w.getInstance(),n=new x(e,t,this);E.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){M.prototype[e]=function(){return(t=E.get(this))[e].apply(t,arguments);var t}});var L=function(){return"undefined"!=typeof p.ResizeObserver?p.ResizeObserver:M}();return L})}).call(t,function(){return this}())},function(e,t,n){var r=n(14),i=function(e){var t=/[height|width]$/;return t.test(e)},o=function(e){var t="",n=Object.keys(e);return n.forEach(function(o,s){var a=e[o];o=r(o),i(o)&&"number"==typeof a&&(a+="px"),t+=a===!0?o:a===!1?"not "+o:"("+o+": "+a+")",s<n.length-1&&(t+=" and ")}),t},s=function(e){var t="";return"string"==typeof e?e:e instanceof Array?(e.forEach(function(n,r){t+=o(n),r<e.length-1&&(t+=", ")}),t):o(e)};e.exports=s},function(e,t){var n=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()}).toLowerCase()};e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(2),o=r(i),s={accessibility:!0,adaptiveHeight:!1,afterChange:null,appendDots:function(e){return o.default.createElement("ul",{style:{display:"block"}},e)},arrows:!0,autoplay:!1,autoplaySpeed:3e3,beforeChange:null,centerMode:!1,centerPadding:"50px",className:"",cssEase:"ease",customPaging:function(e){return o.default.createElement("button",null,e+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:null,nextArrow:null,onEdge:null,onInit:null,onLazyLoadError:null,onReInit:null,pauseOnDotsHover:!1,pauseOnFocus:!1,pauseOnHover:!0,prevArrow:null,responsive:null,rows:1,rtl:!1,slide:"div",slidesPerRow:1,slidesToScroll:1,slidesToShow:1,speed:500,swipe:!0,swipeEvent:null,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,waitForAnimate:!0};t.default=s},function(e,t,n){var r=n(17);e.exports=new r},function(e,t,n){function r(){if(!window.matchMedia)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!window.matchMedia("only all").matches}var i=n(18),o=n(20),s=o.each,a=o.isFunction,l=o.isArray;r.prototype={constructor:r,register:function(e,t,n){var r=this.queries,o=n&&this.browserIsIncapable;return r[e]||(r[e]=new i(e,o)),a(t)&&(t={match:t}),l(t)||(t=[t]),s(t,function(t){a(t)&&(t={match:t}),r[e].addHandler(t)}),this},unregister:function(e,t){var n=this.queries[e];return n&&(t?n.removeHandler(t):(n.clear(),delete this.queries[e])),this}},e.exports=r},function(e,t,n){function r(e,t){this.query=e,this.isUnconditional=t,this.handlers=[],this.mql=window.matchMedia(e);var n=this;this.listener=function(e){n.mql=e.currentTarget||e,n.assess()},this.mql.addListener(this.listener)}var i=n(19),o=n(20).each;r.prototype={constuctor:r,addHandler:function(e){var t=new i(e);this.handlers.push(t),this.matches()&&t.on()},removeHandler:function(e){var t=this.handlers;o(t,function(n,r){if(n.equals(e))return n.destroy(),!t.splice(r,1)})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){o(this.handlers,function(e){e.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var e=this.matches()?"on":"off";o(this.handlers,function(t){t[e]()})}},e.exports=r},function(e,t){function n(e){this.options=e,!e.deferSetup&&this.setup()}n.prototype={constructor:n,setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(e){return this.options===e||this.options.match===e}},e.exports=n},function(e,t){function n(e,t){var n,r=0,i=e.length;for(r;r<i&&(n=t(e[r],r),n!==!1);r++);}function r(e){return"[object Array]"===Object.prototype.toString.apply(e)}function i(e){return"function"==typeof e}e.exports={isFunction:i,isArray:r,each:n}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.Slider=t(require("react"),require("react-dom")):e.Slider=t(e.React,e.ReactDOM)}(window,function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=13)}([function(t,n){t.exports=e},function(e,t,n){var r; | ||
/*! | ||
Copyright (c) 2016 Jed Watson. | ||
Licensed under the MIT License (MIT), see | ||
http://jedwatson.github.io/classnames | ||
*/ | ||
/*! | ||
Copyright (c) 2016 Jed Watson. | ||
Licensed under the MIT License (MIT), see | ||
http://jedwatson.github.io/classnames | ||
*/!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r))e.push(i.apply(null,r));else if("object"===o)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?e.exports=i:void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r)}()},function(e,n){e.exports=t},function(e,t,n){var r=n(8),i=function(e){var t="",n=Object.keys(e);return n.forEach(function(i,o){var s=e[i];i=r(i),/[height|width]$/.test(i)&&"number"==typeof s&&(s+="px"),t+=!0===s?i:!1===s?"not "+i:"("+i+": "+s+")",o<n.length-1&&(t+=" and ")}),t};e.exports=function(e){var t="";return"string"==typeof e?e:e instanceof Array?(e.forEach(function(n,r){t+=i(n),r<e.length-1&&(t+=", ")}),t):i(e)}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports={isFunction:function(e){return"function"==typeof e},isArray:function(e){return"[object Array]"===Object.prototype.toString.apply(e)},each:function(e,t){for(var n=0,r=e.length;n<r&&!1!==t(e[n],n);n++);}}},function(e,t,n){(function(t){var n=NaN,r="[object Symbol]",i=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt,c="object"==typeof t&&t&&t.Object===Object&&t,u="object"==typeof self&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),p=Object.prototype.toString,f=Math.max,h=Math.min,v=function(){return d.Date.now()};function y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||(c=t)&&"object"==typeof c&&p.call(t)==r)return n;var t,c;if(y(e)){var u="function"==typeof e.valueOf?e.valueOf():e;e=y(u)?u+"":u}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var d=s.test(e);return d||a.test(e)?l(e.slice(2),d?2:8):o.test(e)?n:+e}e.exports=function(e,t,n){var r,i,o,s,a,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var n=r,o=i;return r=i=void 0,c=t,s=e.apply(o,n)}function m(e){var n=e-l;return void 0===l||t<=n||n<0||d&&o<=e-c}function w(){var e,n,r=v();if(m(r))return S(r);a=setTimeout(w,(n=t-((e=r)-l),d?h(n,o-(e-c)):n))}function S(e){return a=void 0,p&&r?g(e):(r=i=void 0,s)}function O(){var e,n=v(),o=m(n);if(r=arguments,i=this,l=n,o){if(void 0===a)return c=e=l,a=setTimeout(w,t),u?g(e):s;if(d)return a=setTimeout(w,t),g(l)}return void 0===a&&(a=setTimeout(w,t)),s}return t=b(t)||0,y(n)&&(u=!!n.leading,o=(d="maxWait"in n)?f(b(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p),O.cancel=function(){void 0!==a&&clearTimeout(a),r=l=i=a=void(c=0)},O.flush=function(){return void 0===a?s:S(v())},O}}).call(this,n(4))},function(e,t,n){"use strict";(function(e){var n=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}var n={size:{configurable:!0}};return n.size.get=function(){return this.__entries__.length},t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n+=1){var i=r[n];e.call(t,i[1],i[0])}},Object.defineProperties(t.prototype,n),t}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,i=void 0!==e&&e.Math===Math?e:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),o="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)},s=["top","right","bottom","left","width","height","size","weight"],a="undefined"!=typeof MutationObserver,l=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,i=0;function s(){n&&(n=!1,e()),r&&l()}function a(){o(s)}function l(){var e=Date.now();if(n){if(e-i<2)return;r=!0}else r=!(n=!0),setTimeout(a,t);i=e}return l}(this.refresh.bind(this),20)};l.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},l.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},l.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},l.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),0<e.length},l.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),a?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},l.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},l.prototype.onTransitionEnd_=function(e){var t=e.propertyName;void 0===t&&(t=""),s.some(function(e){return!!~t.indexOf(e)})&&this.refresh()},l.getInstance=function(){return this.instance_||(this.instance_=new l),this.instance_},l.instance_=null;var c=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n+=1){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},u=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||i},d=y(0,0,0,0);function p(e){return parseFloat(e)||0}function f(e){for(var t=[],n=arguments.length-1;0<n--;)t[n]=arguments[n+1];return t.reduce(function(t,n){return t+p(e["border-"+n+"-width"])},0)}var h="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof u(e).SVGGraphicsElement}:function(e){return e instanceof u(e).SVGElement&&"function"==typeof e.getBBox};function v(e){return r?h(e)?y(0,0,(t=e.getBBox()).width,t.height):function(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return d;var r,i=u(e).getComputedStyle(e),o=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n+=1){var i=r[n],o=e["padding-"+i];t[i]=p(o)}return t}(i),s=o.left+o.right,a=o.top+o.bottom,l=p(i.width),c=p(i.height);if("border-box"===i.boxSizing&&(Math.round(l+s)!==t&&(l-=f(i,"left","right")+s),Math.round(c+a)!==n&&(c-=f(i,"top","bottom")+a)),(r=e)!==u(r).document.documentElement){var h=Math.round(l+s)-t,v=Math.round(c+a)-n;1!==Math.abs(h)&&(l-=h),1!==Math.abs(v)&&(c-=v)}return y(o.left,o.top,l,c)}(e):d;var t}function y(e,t,n,r){return{x:e,y:t,width:n,height:r}}var b=function(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=y(0,0,0,0),this.target=e};b.prototype.isActive=function(){var e=v(this.target);return(this.contentRect_=e).width!==this.broadcastWidth||e.height!==this.broadcastHeight},b.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e};var g=function(e,t){var n,r,i,o,s,a,l,u=(r=(n=t).x,i=n.y,o=n.width,s=n.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(a.prototype),c(l,{x:r,y:i,width:o,height:s,top:i,right:r+o,bottom:s+i,left:r}),l);c(this,{target:e,contentRect:u})},m=function(e,t,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r};m.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof u(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new b(e)),this.controller_.addObserver(this),this.controller_.refresh())}},m.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof u(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},m.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},m.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},m.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new g(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},m.prototype.clearActive=function(){this.activeObservations_.splice(0)},m.prototype.hasActive=function(){return 0<this.activeObservations_.length};var w="undefined"!=typeof WeakMap?new WeakMap:new n,S=function(e){if(!(this instanceof S))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=l.getInstance(),n=new m(e,t,this);w.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){S.prototype[e]=function(){return(t=w.get(this))[e].apply(t,arguments);var t}});var O=void 0!==i.ResizeObserver?i.ResizeObserver:S;t.a=O}).call(this,n(4))},function(e,t){e.exports=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()}).toLowerCase()}},function(e,t,n){var r=n(10);e.exports=new r},function(e,t,n){var r=n(11),i=n(5),o=i.each,s=i.isFunction,a=i.isArray;function l(){if(!window.matchMedia)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!window.matchMedia("only all").matches}l.prototype={constructor:l,register:function(e,t,n){var i=this.queries,l=n&&this.browserIsIncapable;return i[e]||(i[e]=new r(e,l)),s(t)&&(t={match:t}),a(t)||(t=[t]),o(t,function(t){s(t)&&(t={match:t}),i[e].addHandler(t)}),this},unregister:function(e,t){var n=this.queries[e];return n&&(t?n.removeHandler(t):(n.clear(),delete this.queries[e])),this}},e.exports=l},function(e,t,n){var r=n(12),i=n(5).each;function o(e,t){this.query=e,this.isUnconditional=t,this.handlers=[],this.mql=window.matchMedia(e);var n=this;this.listener=function(e){n.mql=e.currentTarget||e,n.assess()},this.mql.addListener(this.listener)}o.prototype={constuctor:o,addHandler:function(e){var t=new r(e);this.handlers.push(t),this.matches()&&t.on()},removeHandler:function(e){var t=this.handlers;i(t,function(n,r){if(n.equals(e))return n.destroy(),!t.splice(r,1)})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){i(this.handlers,function(e){e.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var e=this.matches()?"on":"off";i(this.handlers,function(t){t[e]()})}},e.exports=o},function(e,t){function n(e){!(this.options=e).deferSetup&&this.setup()}n.prototype={constructor:n,setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(e){return this.options===e||this.options.match===e}},e.exports=n},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r),o=n(2),s=n.n(o),a={animating:!1,autoplaying:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,dragging:!1,edgeDragged:!1,initialized:!1,lazyLoadedList:[],listHeight:null,listWidth:null,scrolling:!1,slideCount:null,slideHeight:null,slideWidth:null,swipeLeft:null,swiped:!1,swiping:!1,touchObject:{startX:0,startY:0,curX:0,curY:0},trackStyle:{},trackWidth:0},l=n(6),c=n.n(l),u=n(1),d=n.n(u);function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){f(e,t,n[t])})}return e}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=function(e){for(var t=[],n=v(e),r=y(e),i=n;i<r;i++)e.lazyLoadedList.indexOf(i)<0&&t.push(i);return t},v=function(e){return e.currentSlide-b(e)},y=function(e){return e.currentSlide+g(e)},b=function(e){return e.centerMode?Math.floor(e.slidesToShow/2)+(0<parseInt(e.centerPadding)?1:0):0},g=function(e){return e.centerMode?Math.floor((e.slidesToShow-1)/2)+1+(0<parseInt(e.centerPadding)?1:0):e.slidesToShow},m=function(e){return e&&e.offsetWidth||0},w=function(e){return e&&e.offsetHeight||0},S=function(e){var t,n,r,i,o=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return t=e.startX-e.curX,n=e.startY-e.curY,r=Math.atan2(n,t),(i=Math.round(180*r/Math.PI))<0&&(i=360-Math.abs(i)),i<=45&&0<=i||i<=360&&315<=i?"left":135<=i&&i<=225?"right":!0===o?35<=i&&i<=135?"up":"down":"vertical"},O=function(e){var t=!0;return e.infinite||(e.centerMode&&e.currentSlide>=e.slideCount-1?t=!1:(e.slideCount<=e.slidesToShow||e.currentSlide>=e.slideCount-e.slidesToShow)&&(t=!1)),t},k=function(e,t){var n={};return t.forEach(function(t){return n[t]=e[t]}),n},T=function(e,t){var n=function(e){for(var t=e.infinite?2*e.slideCount:e.slideCount,n=e.infinite?-1*e.slidesToShow:0,r=e.infinite?-1*e.slidesToShow:0,i=[];n<t;)i.push(n),n=r+e.slidesToScroll,r+=Math.min(e.slidesToScroll,e.slidesToShow);return i}(e),r=0;if(t>n[n.length-1])t=n[n.length-1];else for(var i in n){if(t<n[i]){t=r;break}r=n[i]}return t},_=function(e){var t=e.centerMode?e.slideWidth*Math.floor(e.slidesToShow/2):0;if(e.swipeToSlide){var n,r=s.a.findDOMNode(e.listRef).querySelectorAll(".slick-slide");if(Array.from(r).every(function(r){if(e.vertical){if(r.offsetTop+w(r)/2>-1*e.swipeLeft)return n=r,!1}else if(r.offsetLeft-t+m(r)/2>-1*e.swipeLeft)return n=r,!1;return!0}),!n)return 0;var i=!0===e.rtl?e.slideCount-e.currentSlide:e.currentSlide;return Math.abs(n.dataset.index-i)||1}return e.slidesToScroll},E=function(e,t){return t.reduce(function(t,n){return t&&e.hasOwnProperty(n)},!0)?null:console.error("Keys Missing:",e)},x=function(e){var t,n;E(e,["left","variableWidth","slideCount","slidesToShow","slideWidth"]);var r=e.slideCount+2*e.slidesToShow;e.vertical?n=r*e.slideHeight:t=C(e)*e.slideWidth;var i={opacity:1,transition:"",WebkitTransition:""};return e.useTransform?i=p({},i,{WebkitTransform:e.vertical?"translate3d(0px, "+e.left+"px, 0px)":"translate3d("+e.left+"px, 0px, 0px)",transform:e.vertical?"translate3d(0px, "+e.left+"px, 0px)":"translate3d("+e.left+"px, 0px, 0px)",msTransform:e.vertical?"translateY("+e.left+"px)":"translateX("+e.left+"px)"}):e.vertical?i.top=e.left:i.left=e.left,e.fade&&(i={opacity:1}),t&&(i.width=t),n&&(i.height=n),window&&!window.addEventListener&&window.attachEvent&&(e.vertical?i.marginTop=e.left+"px":i.marginLeft=e.left+"px"),i},L=function(e){E(e,["left","variableWidth","slideCount","slidesToShow","slideWidth","speed","cssEase"]);var t=x(e);return e.useTransform?(t.WebkitTransition="-webkit-transform "+e.speed+"ms "+e.cssEase,t.transition="transform "+e.speed+"ms "+e.cssEase):e.vertical?t.transition="top "+e.speed+"ms "+e.cssEase:t.transition="left "+e.speed+"ms "+e.cssEase,t},M=function(e){if(e.unslick)return 0;E(e,["slideIndex","trackRef","infinite","centerMode","slideCount","slidesToShow","slidesToScroll","slideWidth","listWidth","variableWidth","slideHeight"]);var t,n,r=e.slideIndex,i=e.trackRef,o=e.infinite,a=e.centerMode,l=e.slideCount,c=e.slidesToShow,u=e.slidesToScroll,d=e.slideWidth,p=e.listWidth,f=e.variableWidth,h=e.slideHeight,v=e.fade,y=e.vertical;if(v||1===e.slideCount)return 0;var b=0;if(o?(b=-j(e),l%u!=0&&l<r+u&&(b=-(l<r?c-(r-l):l%u)),a&&(b+=parseInt(c/2))):(l%u!=0&&l<r+u&&(b=c-l%u),a&&(b=parseInt(c/2))),t=y?r*h*-1+b*h:r*d*-1+b*d,!0===f){var g,m=s.a.findDOMNode(i);if(g=r+j(e),t=(n=m&&m.childNodes[g])?-1*n.offsetLeft:0,!0===a){g=o?r+j(e):r,n=m&&m.children[g];for(var w=t=0;w<g;w++)t-=m&&m.children[w]&&m.children[w].offsetWidth;t-=parseInt(e.centerPadding),t+=n&&(p-n.offsetWidth)/2}}return t},j=function(e){return e.unslick||!e.infinite?0:e.variableWidth?e.slideCount:e.slidesToShow+(e.centerMode?1:0)},P=function(e){return e.unslick||!e.infinite?0:e.slideCount},C=function(e){return 1===e.slideCount?1:j(e)+e.slideCount+P(e)},z=function(e){return e.targetSlide>e.currentSlide?e.targetSlide>e.currentSlide+W(e)?"left":"right":e.targetSlide<e.currentSlide-R(e)?"right":"left"},W=function(e){var t=e.slidesToShow,n=e.centerMode,r=e.rtl,i=e.centerPadding;if(n){var o=(t-1)/2+1;return 0<parseInt(i)&&(o+=1),r&&t%2==0&&(o+=1),o}return r?0:t-1},R=function(e){var t=e.slidesToShow,n=e.centerMode,r=e.rtl,i=e.centerPadding;if(n){var o=(t-1)/2+1;return 0<parseInt(i)&&(o+=1),r||t%2!=0||(o+=1),o}return r?t-1:0},H=function(){return!("undefined"==typeof window||!window.document||!window.document.createElement)};function D(e){return(D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(){return(I=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function q(e,t){return(q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Y(e,t,n[t])})}return e}function Y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var F=function(e){var t,n,r,i,o;return r=(o=e.rtl?e.slideCount-1-e.index:e.index)<0||o>=e.slideCount,e.centerMode?(i=Math.floor(e.slidesToShow/2),n=(o-e.currentSlide)%e.slideCount==0,o>e.currentSlide-i-1&&o<=e.currentSlide+i&&(t=!0)):t=e.currentSlide<=o&&o<e.currentSlide+e.slidesToShow,{"slick-slide":!0,"slick-active":t,"slick-center":n,"slick-cloned":r,"slick-current":o===e.currentSlide}},B=function(e,t){return e.key||t},G=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==D(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}(this,N(t).apply(this,arguments))}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&q(e,t)}(t,i.a.PureComponent),n=t,(r=[{key:"render",value:function(){var e,t,n,r,o,s,a,l,c=(e=this.props,n=[],r=[],o=[],s=i.a.Children.count(e.children),a=v(e),l=y(e),i.a.Children.forEach(e.children,function(c,u){var p,f={message:"children",index:u,slidesToScroll:e.slidesToScroll,currentSlide:e.currentSlide};p=!e.lazyLoad||e.lazyLoad&&0<=e.lazyLoadedList.indexOf(u)?c:i.a.createElement("div",null);var h,v,y=(v={},void 0!==(h=X({},e,{index:u})).variableWidth&&!1!==h.variableWidth||(v.width=h.slideWidth),h.fade&&(v.position="relative",h.vertical?v.top=-h.index*parseInt(h.slideHeight):v.left=-h.index*parseInt(h.slideWidth),v.opacity=h.currentSlide===h.index?1:0,v.transition="opacity "+h.speed+"ms "+h.cssEase+", visibility "+h.speed+"ms "+h.cssEase,v.WebkitTransition="opacity "+h.speed+"ms "+h.cssEase+", visibility "+h.speed+"ms "+h.cssEase),v),b=p.props.className||"",g=F(X({},e,{index:u}));if(n.push(i.a.cloneElement(p,{key:"original"+B(p,u),"data-index":u,className:d()(g,b),tabIndex:"-1","aria-hidden":!g["slick-active"],style:X({outline:"none"},p.props.style||{},y),onClick:function(t){p.props&&p.props.onClick&&p.props.onClick(t),e.focusOnSelect&&e.focusOnSelect(f)}})),e.infinite&&!1===e.fade){var m=s-u;m<=j(e)&&s!==e.slidesToShow&&(a<=(t=-m)&&(p=c),g=F(X({},e,{index:t})),r.push(i.a.cloneElement(p,{key:"precloned"+B(p,t),"data-index":t,tabIndex:"-1",className:d()(g,b),"aria-hidden":!g["slick-active"],style:X({},p.props.style||{},y),onClick:function(t){p.props&&p.props.onClick&&p.props.onClick(t),e.focusOnSelect&&e.focusOnSelect(f)}}))),s!==e.slidesToShow&&((t=s+u)<l&&(p=c),g=F(X({},e,{index:t})),o.push(i.a.cloneElement(p,{key:"postcloned"+B(p,t),"data-index":t,tabIndex:"-1",className:d()(g,b),"aria-hidden":!g["slick-active"],style:X({},p.props.style||{},y),onClick:function(t){p.props&&p.props.onClick&&p.props.onClick(t),e.focusOnSelect&&e.focusOnSelect(f)}})))}}),e.rtl?r.concat(n,o).reverse():r.concat(n,o)),u=this.props,p={onMouseEnter:u.onMouseEnter,onMouseOver:u.onMouseOver,onMouseLeave:u.onMouseLeave};return i.a.createElement("div",I({className:"slick-track",style:this.props.trackStyle},p),c)}}])&&A(n.prototype,r),t}();function U(e){return(U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function V(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $(e){return($=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function K(e,t){return(K=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Z=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){return!t||"object"!==U(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}(this,$(t).apply(this,arguments))}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&K(e,t)}(t,i.a.PureComponent),n=t,(r=[{key:"clickHandler",value:function(e,t){t.preventDefault(),this.props.clickHandler(e)}},{key:"render",value:function(){var e,t=this,n=(e={slideCount:this.props.slideCount,slidesToScroll:this.props.slidesToScroll,slidesToShow:this.props.slidesToShow,infinite:this.props.infinite}).infinite?Math.ceil(e.slideCount/e.slidesToScroll):Math.ceil((e.slideCount-e.slidesToShow)/e.slidesToScroll)+1,r=this.props,o={onMouseEnter:r.onMouseEnter,onMouseOver:r.onMouseOver,onMouseLeave:r.onMouseLeave},s=Array.apply(null,Array(n+1).join("0").split("")).map(function(e,n){var r=n*t.props.slidesToScroll,o=n*t.props.slidesToScroll+(t.props.slidesToScroll-1),s=d()({"slick-active":t.props.currentSlide>=r&&t.props.currentSlide<=o}),a={message:"dots",index:n,slidesToScroll:t.props.slidesToScroll,currentSlide:t.props.currentSlide},l=t.clickHandler.bind(t,a);return i.a.createElement("li",{key:n,className:s},i.a.cloneElement(t.props.customPaging(n),{onClick:l}))});return i.a.cloneElement(this.props.appendDots(s),function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,i,o;r=e,o=n[i=t],i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})}return e}({className:this.props.dotsClass},o))}}])&&V(n.prototype,r),t}();function J(e){return(J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Q(){return(Q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){te(e,t,n[t])})}return e}function te(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function re(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ie(e,t,n){return t&&re(e.prototype,t),n&&re(e,n),e}function oe(e,t){return!t||"object"!==J(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function se(e){return(se=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ae(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&function(e,t){(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}(e,t)}var le=function(e){function t(){return ne(this,t),oe(this,se(t).apply(this,arguments))}return ae(t,i.a.PureComponent),ie(t,[{key:"clickHandler",value:function(e,t){t&&t.preventDefault(),this.props.clickHandler(e,t)}},{key:"render",value:function(){var e={"slick-arrow":!0,"slick-prev":!0},t=this.clickHandler.bind(this,{message:"previous"});!this.props.infinite&&(0===this.props.currentSlide||this.props.slideCount<=this.props.slidesToShow)&&(e["slick-disabled"]=!0,t=null);var n={key:"0","data-role":"none",className:d()(e),style:{display:"block"},onClick:t},r={currentSlide:this.props.currentSlide,slideCount:this.props.slideCount};return this.props.prevArrow?i.a.cloneElement(this.props.prevArrow,ee({},n,r)):i.a.createElement("button",Q({key:"0",type:"button"},n)," ","Previous")}}]),t}(),ce=function(e){function t(){return ne(this,t),oe(this,se(t).apply(this,arguments))}return ae(t,i.a.PureComponent),ie(t,[{key:"clickHandler",value:function(e,t){t&&t.preventDefault(),this.props.clickHandler(e,t)}},{key:"render",value:function(){var e={"slick-arrow":!0,"slick-next":!0},t=this.clickHandler.bind(this,{message:"next"});O(this.props)||(e["slick-disabled"]=!0,t=null);var n={key:"1","data-role":"none",className:d()(e),style:{display:"block"},onClick:t},r={currentSlide:this.props.currentSlide,slideCount:this.props.slideCount};return this.props.nextArrow?i.a.cloneElement(this.props.nextArrow,ee({},n,r)):i.a.createElement("button",Q({key:"1",type:"button"},n)," ","Next")}}]),t}(),ue=n(7);function de(){return(de=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function pe(e){return(pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){be(e,t,n[t])})}return e}function he(e){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ve(e,t){return(ve=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ye(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ge=function(e){function t(e){var n,r;return function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this),this,r=he(t).call(this,e),be(ye(ye(n=!r||"object"!==pe(r)&&"function"!=typeof r?ye(this):r)),"listRefHandler",function(e){return n.list=e}),be(ye(ye(n)),"trackRefHandler",function(e){return n.track=e}),be(ye(ye(n)),"adaptHeight",function(){if(n.props.adaptiveHeight&&n.list){var e=n.list.querySelector('[data-index="'.concat(n.state.currentSlide,'"]'));n.list.style.height=w(e)+"px"}}),be(ye(ye(n)),"componentWillMount",function(){if(n.ssrInit(),n.props.onInit&&n.props.onInit(),n.props.lazyLoad){var e=h(fe({},n.props,n.state));0<e.length&&(n.setState(function(t){return{lazyLoadedList:t.lazyLoadedList.concat(e)}}),n.props.onLazyLoad&&n.props.onLazyLoad(e))}}),be(ye(ye(n)),"componentDidMount",function(){var e=fe({listRef:n.list,trackRef:n.track},n.props);n.updateState(e,!0,function(){n.adaptHeight(),n.props.autoplay&&n.autoPlay("update")}),"progressive"===n.props.lazyLoad&&(n.lazyLoadTimer=setInterval(n.progressiveLazyLoad,1e3)),n.ro=new ue.a(function(){n.state.animating?(n.onWindowResized(!1),n.callbackTimers.push(setTimeout(function(){return n.onWindowResized()},n.props.speed))):n.onWindowResized()}),n.ro.observe(n.list),Array.prototype.forEach.call(document.querySelectorAll(".slick-slide"),function(e){e.onfocus=n.props.pauseOnFocus?n.onSlideFocus:null,e.onblur=n.props.pauseOnFocus?n.onSlideBlur:null}),window&&(window.addEventListener?window.addEventListener("resize",n.onWindowResized):window.attachEvent("onresize",n.onWindowResized))}),be(ye(ye(n)),"componentWillUnmount",function(){n.animationEndCallback&&clearTimeout(n.animationEndCallback),n.lazyLoadTimer&&clearInterval(n.lazyLoadTimer),n.callbackTimers.length&&(n.callbackTimers.forEach(function(e){return clearTimeout(e)}),n.callbackTimers=[]),window.addEventListener?window.removeEventListener("resize",n.onWindowResized):window.detachEvent("onresize",n.onWindowResized),n.autoplayTimer&&clearInterval(n.autoplayTimer)}),be(ye(ye(n)),"componentWillReceiveProps",function(e){for(var t=fe({listRef:n.list,trackRef:n.track},e,n.state),r=!1,o=Object.keys(n.props),s=0;s<o.length;s++){var a=o[s];if(!e.hasOwnProperty(a)){r=!0;break}if("object"!==pe(e[a])&&"function"!=typeof e[a]&&e[a]!==n.props[a]){r=!0;break}}n.updateState(t,r,function(){n.state.currentSlide>=i.a.Children.count(e.children)&&n.changeSlide({message:"index",index:i.a.Children.count(e.children)-e.slidesToShow,currentSlide:n.state.currentSlide}),e.autoplay?n.autoPlay("update"):n.pause("paused")})}),be(ye(ye(n)),"componentDidUpdate",function(){if(n.checkImagesLoad(),n.props.onReInit&&n.props.onReInit(),n.props.lazyLoad){var e=h(fe({},n.props,n.state));0<e.length&&(n.setState(function(t){return{lazyLoadedList:t.lazyLoadedList.concat(e)}}),n.props.onLazyLoad&&n.props.onLazyLoad(e))}n.adaptHeight()}),be(ye(ye(n)),"onWindowResized",function(e){n.debouncedResize&&n.debouncedResize.cancel(),n.debouncedResize=c()(function(){return n.resizeWindow(e)},50),n.debouncedResize()}),be(ye(ye(n)),"resizeWindow",function(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];if(s.a.findDOMNode(n.track)){var t=fe({listRef:n.list,trackRef:n.track},n.props,n.state);n.updateState(t,e,function(){n.props.autoplay?n.autoPlay("update"):n.pause("paused")}),n.setState({animating:!1}),clearTimeout(n.animationEndCallback),delete n.animationEndCallback}}),be(ye(ye(n)),"updateState",function(e,t,r){var o=function(e){var t,n=i.a.Children.count(e.children),r=Math.ceil(m(s.a.findDOMNode(e.listRef))),o=Math.ceil(m(s.a.findDOMNode(e.trackRef)));if(e.vertical)t=r;else{var a=e.centerMode&&2*parseInt(e.centerPadding);"string"==typeof e.centerPadding&&"%"===e.centerPadding.slice(-1)&&(a*=r/100),t=Math.ceil((r-a)/e.slidesToShow)}var l=s.a.findDOMNode(e.listRef)&&w(s.a.findDOMNode(e.listRef).querySelector('[data-index="0"]')),c=l*e.slidesToShow,u=void 0===e.currentSlide?e.initialSlide:e.currentSlide;e.rtl&&void 0===e.currentSlide&&(u=n-1-e.initialSlide);var d=e.lazyLoadedList||[],p=h({currentSlide:u,lazyLoadedList:d});d.concat(p);var f={slideCount:n,slideWidth:t,listWidth:r,trackWidth:o,currentSlide:u,slideHeight:l,listHeight:c,lazyLoadedList:d};return null===e.autoplaying&&e.autoplay&&(f.autoplaying="playing"),f}(e);e=fe({},e=fe({},e,o,{slideIndex:o.currentSlide}),{left:M(e)});var a=x(e);(t||i.a.Children.count(n.props.children)!==i.a.Children.count(e.children))&&(o.trackStyle=a),n.setState(o,r)}),be(ye(ye(n)),"ssrInit",function(){if(n.props.variableWidth){var e=0,t=0,r=[],o=j(fe({},n.props,n.state,{slideCount:n.props.children.length})),s=P(fe({},n.props,n.state,{slideCount:n.props.children.length}));n.props.children.forEach(function(t){r.push(t.props.style.width),e+=t.props.style.width});for(var a=0;a<o;a++)t+=r[r.length-1-a],e+=r[r.length-1-a];for(var l=0;l<s;l++)e+=r[l];for(var c=0;c<n.state.currentSlide;c++)t+=r[c];var u={width:e+"px",left:-t+"px"};if(n.props.centerMode){var d="".concat(r[n.state.currentSlide],"px");u.left="calc(".concat(u.left," + (100% - ").concat(d,") / 2 ) ")}n.setState({trackStyle:u})}else{var p=i.a.Children.count(n.props.children),f=fe({},n.props,n.state,{slideCount:p}),h=j(f)+P(f)+p,v=100/n.props.slidesToShow*h,y=100/h,b=-y*(j(f)+n.state.currentSlide)*v/100;n.props.centerMode&&(b+=(100-y*v/100)/2);var g={width:v+"%",left:b+"%"};n.setState({slideWidth:y+"%",trackStyle:g})}}),be(ye(ye(n)),"checkImagesLoad",function(){var e=document.querySelectorAll(".slick-slide img"),t=e.length,r=0;Array.prototype.forEach.call(e,function(e){var i=function(){return++r&&t<=r&&n.onWindowResized()};if(e.onclick){var o=e.onclick;e.onclick=function(){o(),e.parentNode.focus()}}else e.onclick=function(){return e.parentNode.focus()};e.onload||(n.props.lazyLoad?e.onload=function(){n.adaptHeight(),n.callbackTimers.push(setTimeout(n.onWindowResized,n.props.speed))}:(e.onload=i,e.onerror=function(){i(),n.props.onLazyLoadError&&n.props.onLazyLoadError()}))})}),be(ye(ye(n)),"progressiveLazyLoad",function(){for(var e=[],t=fe({},n.props,n.state),r=n.state.currentSlide;r<n.state.slideCount+P(t);r++)if(n.state.lazyLoadedList.indexOf(r)<0){e.push(r);break}for(var i=n.state.currentSlide-1;i>=-j(t);i--)if(n.state.lazyLoadedList.indexOf(i)<0){e.push(i);break}0<e.length?(n.setState(function(t){return{lazyLoadedList:t.lazyLoadedList.concat(e)}}),n.props.onLazyLoad&&n.props.onLazyLoad(e)):n.lazyLoadTimer&&(clearInterval(n.lazyLoadTimer),delete n.lazyLoadTimer)}),be(ye(ye(n)),"slideHandler",function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=n.props,i=r.asNavFor,o=r.beforeChange,s=r.onLazyLoad,a=r.speed,l=r.afterChange,c=n.state.currentSlide,u=function(e){var t=e.waitForAnimate,n=e.animating,r=e.fade,i=e.infinite,o=e.index,s=e.slideCount,a=e.lazyLoadedList,l=e.lazyLoad,c=e.currentSlide,u=e.centerMode,d=e.slidesToScroll,f=e.slidesToShow,v=e.useCSS;if(t&&n)return{};var y,b,g,m=o,w={},S={};if(r){if(!i&&(o<0||s<=o))return{};o<0?m=o+s:s<=o&&(m=o-s),l&&a.indexOf(m)<0&&a.push(m),S={animating:(w={animating:!0,currentSlide:m,lazyLoadedList:a},!1)}}else(y=m)<0?(y=m+s,i?s%d!=0&&(y=s-s%d):y=0):!O(e)&&c<m?m=y=c:u&&s<=m?(m=i?s:s-1,y=i?0:s-1):s<=m&&(y=m-s,i?s%d!=0&&(y=0):y=s-f),b=M(p({},e,{slideIndex:m})),g=M(p({},e,{slideIndex:y})),i||(b===g&&(m=y),b=g),l&&a.concat(h(p({},e,{currentSlide:m}))),v?S={animating:(w={animating:!0,currentSlide:y,trackStyle:L(p({},e,{left:b})),lazyLoadedList:a},!1),currentSlide:y,trackStyle:x(p({},e,{left:g})),swipeLeft:null}:w={currentSlide:y,trackStyle:x(p({},e,{left:g})),lazyLoadedList:a};return{state:w,nextState:S}}(fe({index:e},n.props,n.state,{trackRef:n.track,useCSS:n.props.useCSS&&!t})),d=u.state,f=u.nextState;if(d){o&&o(c,d.currentSlide);var v=d.lazyLoadedList.filter(function(e){return n.state.lazyLoadedList.indexOf(e)<0});s&&0<v.length&&s(v),n.setState(d,function(){i&&i.innerSlider.state.currentSlide!==n.state.currentSlide&&i.innerSlider.slideHandler(e),f&&(n.animationEndCallback=setTimeout(function(){var e=f.animating,t=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],0<=t.indexOf(n)||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(f,["animating"]);n.setState(t,function(){n.callbackTimers.push(setTimeout(function(){return n.setState({animating:e})},10)),l&&l(d.currentSlide),delete n.animationEndCallback})},a))})}}),be(ye(ye(n)),"changeSlide",function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=function(e,t){var n,r,i,o,s=e.slidesToScroll,a=e.slidesToShow,l=e.slideCount,c=e.currentSlide,u=e.lazyLoad,d=e.infinite;if(n=l%s!=0?0:(l-c)%s,"previous"===t.message)o=c-(i=0===n?s:a-n),u&&!d&&(o=-1==(r=c-i)?l-1:r);else if("next"===t.message)o=c+(i=0===n?s:n),u&&!d&&(o=(c+s)%l+n);else if("dots"===t.message){if((o=t.index*t.slidesToScroll)===t.currentSlide)return null}else if("children"===t.message){if((o=t.index)===t.currentSlide)return null;if(d){var f=z(p({},e,{targetSlide:o}));o>t.currentSlide&&"left"===f?o-=l:o<t.currentSlide&&"right"===f&&(o+=l)}}else if("index"===t.message&&(o=Number(t.index))===t.currentSlide)return null;return o}(fe({},n.props,n.state),e);(0===r||r)&&(!0===t?n.slideHandler(r,t):n.slideHandler(r))}),be(ye(ye(n)),"clickHandler",function(e){!1===n.clickable&&(e.stopPropagation(),e.preventDefault()),n.clickable=!0}),be(ye(ye(n)),"keyHandler",function(e){var t,r,i,o=(t=e,r=n.props.accessibility,i=n.props.rtl,t.target.tagName.match("TEXTAREA|INPUT|SELECT")||!r?"":37===t.keyCode?i?"next":"previous":39===t.keyCode?i?"previous":"next":"");""!==o&&n.changeSlide({message:o})}),be(ye(ye(n)),"selectHandler",function(e){n.changeSlide(e)}),be(ye(ye(n)),"disableBodyScroll",function(){window.ontouchmove=function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.returnValue=!1}}),be(ye(ye(n)),"enableBodyScroll",function(){window.ontouchmove=null}),be(ye(ye(n)),"swipeStart",function(e){n.props.verticalSwiping&&n.disableBodyScroll();var t,r,i,o=(t=e,r=n.props.swipe,i=n.props.draggable,"IMG"===t.target.tagName&&t.preventDefault(),!r||!i&&-1!==t.type.indexOf("mouse")?"":{dragging:!0,touchObject:{startX:t.touches?t.touches[0].pageX:t.clientX,startY:t.touches?t.touches[0].pageY:t.clientY,curX:t.touches?t.touches[0].pageX:t.clientX,curY:t.touches?t.touches[0].pageY:t.clientY}});""!==o&&n.setState(o)}),be(ye(ye(n)),"swipeMove",function(e){var t=function(e,t){var n=t.scrolling,r=t.animating,i=t.vertical,o=t.swipeToSlide,s=t.verticalSwiping,a=t.rtl,l=t.currentSlide,c=t.edgeFriction,u=t.edgeDragged,d=t.onEdge,f=t.swiped,h=t.swiping,v=t.slideCount,y=t.slidesToScroll,b=t.infinite,g=t.touchObject,m=t.swipeEvent,w=t.listHeight,k=t.listWidth;if(!n){if(r)return e.preventDefault();i&&o&&s&&e.preventDefault();var T,_={},E=M(t);g.curX=e.touches?e.touches[0].pageX:e.clientX,g.curY=e.touches?e.touches[0].pageY:e.clientY,g.swipeLength=Math.round(Math.sqrt(Math.pow(g.curX-g.startX,2)));var L=Math.round(Math.sqrt(Math.pow(g.curY-g.startY,2)));if(!s&&!h&&10<L)return{scrolling:!0};s&&(g.swipeLength=L);var j=(a?-1:1)*(g.curX>g.startX?1:-1);s&&(j=g.curY>g.startY?1:-1);var P=Math.ceil(v/y),C=S(t.touchObject,s),z=g.swipeLength;return b||(0===l&&"right"===C||P<=l+1&&"left"===C||!O(t)&&"left"===C)&&(z=g.swipeLength*c,!1===u&&d&&(d(C),_.edgeDragged=!0)),!f&&m&&(m(C),_.swiped=!0),T=i?E+z*(w/k)*j:a?E-z*j:E+z*j,s&&(T=E+z*j),_=p({},_,{touchObject:g,swipeLeft:T,trackStyle:x(p({},t,{left:T}))}),Math.abs(g.curX-g.startX)<.8*Math.abs(g.curY-g.startY)||10<g.swipeLength&&(_.swiping=!0,e.preventDefault()),_}}(e,fe({},n.props,n.state,{trackRef:n.track,listRef:n.list,slideIndex:n.state.currentSlide}));t&&(t.swiping&&(n.clickable=!1),n.setState(t))}),be(ye(ye(n)),"swipeEnd",function(e){var t=function(e,t){var n=t.dragging,r=t.swipe,i=t.touchObject,o=t.listWidth,s=t.touchThreshold,a=t.verticalSwiping,l=t.listHeight,c=t.currentSlide,u=t.swipeToSlide,d=t.scrolling,f=t.onSwipe;if(!n)return r&&e.preventDefault(),{};var h=a?l/s:o/s,v=S(i,a),y={dragging:!1,edgeDragged:!1,scrolling:!1,swiping:!1,swiped:!1,swipeLeft:null,touchObject:{}};if(d)return y;if(!i.swipeLength)return y;if(i.swipeLength>h){var b,g;switch(e.preventDefault(),f&&f(v),v){case"left":case"up":g=c+_(t),b=u?T(t,g):g,y.currentDirection=0;break;case"right":case"down":g=c-_(t),b=u?T(t,g):g,y.currentDirection=1;break;default:b=c}y.triggerSlideHandler=b}else{var m=M(t);y.trackStyle=L(p({},t,{left:m}))}return y}(e,fe({},n.props,n.state,{trackRef:n.track,listRef:n.list,slideIndex:n.state.currentSlide}));if(t){var r=t.triggerSlideHandler;delete t.triggerSlideHandler,n.setState(t),void 0!==r&&(n.slideHandler(r),n.props.verticalSwiping&&n.enableBodyScroll())}}),be(ye(ye(n)),"slickPrev",function(){n.callbackTimers.push(setTimeout(function(){return n.changeSlide({message:"previous"})},0))}),be(ye(ye(n)),"slickNext",function(){n.callbackTimers.push(setTimeout(function(){return n.changeSlide({message:"next"})},0))}),be(ye(ye(n)),"slickGoTo",function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(e=Number(e),isNaN(e))return"";n.callbackTimers.push(setTimeout(function(){return n.changeSlide({message:"index",index:e,currentSlide:n.state.currentSlide},t)},0))}),be(ye(ye(n)),"play",function(){var e;if(n.props.rtl)e=n.state.currentSlide-n.props.slidesToScroll;else{if(!O(fe({},n.props,n.state)))return!1;e=n.state.currentSlide+n.props.slidesToScroll}n.slideHandler(e)}),be(ye(ye(n)),"autoPlay",function(e){n.autoplayTimer&&clearInterval(n.autoplayTimer);var t=n.state.autoplaying;if("update"===e){if("hovered"===t||"focused"===t||"paused"===t)return}else if("leave"===e){if("paused"===t||"focused"===t)return}else if("blur"===e&&("paused"===t||"hovered"===t))return;n.autoplayTimer=setInterval(n.play,n.props.autoplaySpeed+50),n.setState({autoplaying:"playing"})}),be(ye(ye(n)),"pause",function(e){n.autoplayTimer&&(clearInterval(n.autoplayTimer),n.autoplayTimer=null);var t=n.state.autoplaying;"paused"===e?n.setState({autoplaying:"paused"}):"focused"===e?"hovered"!==t&&"playing"!==t||n.setState({autoplaying:"focused"}):"playing"===t&&n.setState({autoplaying:"hovered"})}),be(ye(ye(n)),"onDotsOver",function(){return n.props.autoplay&&n.pause("hovered")}),be(ye(ye(n)),"onDotsLeave",function(){return n.props.autoplay&&"hovered"===n.state.autoplaying&&n.autoPlay("leave")}),be(ye(ye(n)),"onTrackOver",function(){return n.props.autoplay&&n.pause("hovered")}),be(ye(ye(n)),"onTrackLeave",function(){return n.props.autoplay&&"hovered"===n.state.autoplaying&&n.autoPlay("leave")}),be(ye(ye(n)),"onSlideFocus",function(){return n.props.autoplay&&n.pause("focused")}),be(ye(ye(n)),"onSlideBlur",function(){return n.props.autoplay&&"focused"===n.state.autoplaying&&n.autoPlay("blur")}),be(ye(ye(n)),"render",function(){var e,t,r,o=d()("slick-slider",n.props.className,{"slick-vertical":n.props.vertical,"slick-initialized":!0}),s=fe({},n.props,n.state),a=k(s,["fade","cssEase","speed","infinite","centerMode","focusOnSelect","currentSlide","lazyLoad","lazyLoadedList","rtl","slideWidth","slideHeight","listHeight","vertical","slidesToShow","slidesToScroll","slideCount","trackStyle","variableWidth","unslick","centerPadding"]),l=n.props.pauseOnHover;if(a=fe({},a,{onMouseEnter:l?n.onTrackOver:null,onMouseLeave:l?n.onTrackLeave:null,onMouseOver:l?n.onTrackOver:null,focusOnSelect:n.props.focusOnSelect?n.selectHandler:null}),!0===n.props.dots&&n.state.slideCount>=n.props.slidesToShow){var c=k(s,["dotsClass","slideCount","slidesToShow","currentSlide","slidesToScroll","clickHandler","children","customPaging","infinite","appendDots"]),u=n.props.pauseOnDotsHover;c=fe({},c,{clickHandler:n.changeSlide,onMouseEnter:u?n.onDotsLeave:null,onMouseOver:u?n.onDotsOver:null,onMouseLeave:u?n.onDotsLeave:null}),e=i.a.createElement(Z,c)}var p=k(s,["infinite","centerMode","currentSlide","slideCount","slidesToShow","prevArrow","nextArrow"]);p.clickHandler=n.changeSlide,n.props.arrows&&(t=i.a.createElement(le,p),r=i.a.createElement(ce,p));var f=null;n.props.vertical&&(f={height:n.state.listHeight});var h=null;!1===n.props.vertical?!0===n.props.centerMode&&(h={padding:"0px "+n.props.centerPadding}):!0===n.props.centerMode&&(h={padding:n.props.centerPadding+" 0px"});var v=fe({},f,h),y=n.props.touchMove,b={className:"slick-list",style:v,onClick:n.clickHandler,onMouseDown:y?n.swipeStart:null,onMouseMove:n.state.dragging&&y?n.swipeMove:null,onMouseUp:y?n.swipeEnd:null,onMouseLeave:n.state.dragging&&y?n.swipeEnd:null,onTouchStart:y?n.swipeStart:null,onTouchMove:n.state.dragging&&y?n.swipeMove:null,onTouchEnd:y?n.swipeEnd:null,onTouchCancel:n.state.dragging&&y?n.swipeEnd:null,onKeyDown:n.props.accessibility?n.keyHandler:null},g={className:o,dir:"ltr"};return n.props.unslick&&(b={className:"slick-list"},g={className:o}),i.a.createElement("div",g,n.props.unslick?"":t,i.a.createElement("div",de({ref:n.listRefHandler},b),i.a.createElement(G,de({ref:n.trackRefHandler},a),n.props.children)),n.props.unslick?"":r,n.props.unslick?"":e)}),n.list=null,n.track=null,n.state=fe({},a,{currentSlide:n.props.initialSlide,slideCount:i.a.Children.count(n.props.children)}),n.callbackTimers=[],n.clickable=!0,n.debouncedResize=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ve(e,t)}(t,i.a.Component),t}(),me=n(3),we=n.n(me),Se={accessibility:!0,adaptiveHeight:!1,afterChange:null,appendDots:function(e){return i.a.createElement("ul",{style:{display:"block"}},e)},arrows:!0,autoplay:!1,autoplaySpeed:3e3,beforeChange:null,centerMode:!1,centerPadding:"50px",className:"",cssEase:"ease",customPaging:function(e){return i.a.createElement("button",null,e+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:null,nextArrow:null,onEdge:null,onInit:null,onLazyLoadError:null,onReInit:null,pauseOnDotsHover:!1,pauseOnFocus:!1,pauseOnHover:!0,prevArrow:null,responsive:null,rows:1,rtl:!1,slide:"div",slidesPerRow:1,slidesToScroll:1,slidesToShow:1,speed:500,swipe:!0,swipeEvent:null,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,waitForAnimate:!0};function Oe(e){return(Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ke(){return(ke=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Te(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Me(e,t,n[t])})}return e}function _e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ee(e){return(Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function xe(e,t){return(xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Le(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var je=H()&&n(9),Pe=function(e){function t(e){var n,r;return function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this),this,r=Ee(t).call(this,e),Me(Le(Le(n=!r||"object"!==Oe(r)&&"function"!=typeof r?Le(this):r)),"innerSliderRefHandler",function(e){return n.innerSlider=e}),Me(Le(Le(n)),"slickPrev",function(){return n.innerSlider.slickPrev()}),Me(Le(Le(n)),"slickNext",function(){return n.innerSlider.slickNext()}),Me(Le(Le(n)),"slickGoTo",function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return n.innerSlider.slickGoTo(e,t)}),Me(Le(Le(n)),"slickPause",function(){return n.innerSlider.pause("paused")}),Me(Le(Le(n)),"slickPlay",function(){return n.innerSlider.autoPlay("play")}),n.state={breakpoint:null},n._responsiveMediaHandlers=[],n}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xe(e,t)}(t,i.a.Component),n=t,(r=[{key:"media",value:function(e,t){je.register(e,t),this._responsiveMediaHandlers.push({query:e,handler:t})}},{key:"componentWillMount",value:function(){var e=this;if(this.props.responsive){var t=this.props.responsive.map(function(e){return e.breakpoint});t.sort(function(e,t){return e-t}),t.forEach(function(n,r){var i;i=0===r?we()({minWidth:0,maxWidth:n}):we()({minWidth:t[r-1]+1,maxWidth:n}),H()&&e.media(i,function(){e.setState({breakpoint:n})})});var n=we()({minWidth:t.slice(-1)[0]});H()&&this.media(n,function(){e.setState({breakpoint:null})})}}},{key:"componentWillUnmount",value:function(){this._responsiveMediaHandlers.forEach(function(e){je.unregister(e.query,e.handler)})}},{key:"render",value:function(){var e,t,n=this;(e=this.state.breakpoint?"unslick"===(t=this.props.responsive.filter(function(e){return e.breakpoint===n.state.breakpoint}))[0].settings?"unslick":Te({},Se,this.props,t[0].settings):Te({},Se,this.props)).centerMode&&(e.slidesToScroll,e.slidesToScroll=1),e.fade&&(e.slidesToShow,e.slidesToScroll,e.slidesToShow=1,e.slidesToScroll=1);var r=i.a.Children.toArray(this.props.children);r=r.filter(function(e){return"string"==typeof e?!!e.trim():!!e}),e.variableWidth&&(1<e.rows||1<e.slidesPerRow)&&(console.warn("variableWidth is not supported in case of rows > 1 or slidesPerRow > 1"),e.variableWidth=!1);for(var o=[],s=null,a=0;a<r.length;a+=e.rows*e.slidesPerRow){for(var l=[],c=a;c<a+e.rows*e.slidesPerRow;c+=e.slidesPerRow){for(var u=[],d=c;d<c+e.slidesPerRow&&(e.variableWidth&&r[d].props.style&&(s=r[d].props.style.width),!(d>=r.length));d+=1)u.push(i.a.cloneElement(r[d],{key:100*a+10*c+d,tabIndex:-1,style:{width:"".concat(100/e.slidesPerRow,"%"),display:"inline-block"}}));l.push(i.a.createElement("div",{key:10*a+c},u))}e.variableWidth?o.push(i.a.createElement("div",{key:a,style:{width:s}},l)):o.push(i.a.createElement("div",{key:a},l))}if("unslick"!==e)return o.length<=e.slidesToShow&&(e.unslick=!0),i.a.createElement(ge,ke({ref:this.innerSliderRefHandler},e),o);var p="regular slider "+(this.props.className||"");return i.a.createElement("div",{className:p},o)}}])&&_e(n.prototype,r),t}();t.default=Pe}])}); | ||
//# sourceMappingURL=react-slick.min.js.map |
"use strict"; | ||
exports.__esModule = true; | ||
exports.NextArrow = exports.PrevArrow = undefined; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.NextArrow = exports.PrevArrow = void 0; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react = require("react"); | ||
var _classnames = _interopRequireDefault(require("classnames")); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _innerSliderUtils = require("./utils/innerSliderUtils"); | ||
var _classnames = require("classnames"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
var _innerSliderUtils = require("./utils/innerSliderUtils"); | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
var PrevArrow = exports.PrevArrow = function (_React$PureComponent) { | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var PrevArrow = | ||
/*#__PURE__*/ | ||
function (_React$PureComponent) { | ||
_inherits(PrevArrow, _React$PureComponent); | ||
@@ -32,52 +48,66 @@ | ||
return _possibleConstructorReturn(this, _React$PureComponent.apply(this, arguments)); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(PrevArrow).apply(this, arguments)); | ||
} | ||
PrevArrow.prototype.clickHandler = function clickHandler(options, e) { | ||
if (e) { | ||
e.preventDefault(); | ||
_createClass(PrevArrow, [{ | ||
key: "clickHandler", | ||
value: function clickHandler(options, e) { | ||
if (e) { | ||
e.preventDefault(); | ||
} | ||
this.props.clickHandler(options, e); | ||
} | ||
this.props.clickHandler(options, e); | ||
}; | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
var prevClasses = { | ||
"slick-arrow": true, | ||
"slick-prev": true | ||
}; | ||
var prevHandler = this.clickHandler.bind(this, { | ||
message: "previous" | ||
}); | ||
PrevArrow.prototype.render = function render() { | ||
var prevClasses = { "slick-arrow": true, "slick-prev": true }; | ||
var prevHandler = this.clickHandler.bind(this, { message: "previous" }); | ||
if (!this.props.infinite && (this.props.currentSlide === 0 || this.props.slideCount <= this.props.slidesToShow)) { | ||
prevClasses["slick-disabled"] = true; | ||
prevHandler = null; | ||
} | ||
if (!this.props.infinite && (this.props.currentSlide === 0 || this.props.slideCount <= this.props.slidesToShow)) { | ||
prevClasses["slick-disabled"] = true; | ||
prevHandler = null; | ||
} | ||
var prevArrowProps = { | ||
key: "0", | ||
"data-role": "none", | ||
className: (0, _classnames.default)(prevClasses), | ||
style: { | ||
display: "block" | ||
}, | ||
onClick: prevHandler | ||
}; | ||
var customProps = { | ||
currentSlide: this.props.currentSlide, | ||
slideCount: this.props.slideCount | ||
}; | ||
var prevArrow; | ||
var prevArrowProps = { | ||
key: "0", | ||
"data-role": "none", | ||
className: (0, _classnames2.default)(prevClasses), | ||
style: { display: "block" }, | ||
onClick: prevHandler | ||
}; | ||
var customProps = { | ||
currentSlide: this.props.currentSlide, | ||
slideCount: this.props.slideCount | ||
}; | ||
var prevArrow = void 0; | ||
if (this.props.prevArrow) { | ||
prevArrow = _react.default.cloneElement(this.props.prevArrow, _objectSpread({}, prevArrowProps, customProps)); | ||
} else { | ||
prevArrow = _react.default.createElement("button", _extends({ | ||
key: "0", | ||
type: "button" | ||
}, prevArrowProps), " ", "Previous"); | ||
} | ||
if (this.props.prevArrow) { | ||
prevArrow = _react2.default.cloneElement(this.props.prevArrow, _extends({}, prevArrowProps, customProps)); | ||
} else { | ||
prevArrow = _react2.default.createElement( | ||
"button", | ||
_extends({ key: "0", type: "button" }, prevArrowProps), | ||
" ", | ||
"Previous" | ||
); | ||
return prevArrow; | ||
} | ||
}]); | ||
return prevArrow; | ||
}; | ||
return PrevArrow; | ||
}(_react2.default.PureComponent); | ||
}(_react.default.PureComponent); | ||
var NextArrow = exports.NextArrow = function (_React$PureComponent2) { | ||
exports.PrevArrow = PrevArrow; | ||
var NextArrow = | ||
/*#__PURE__*/ | ||
function (_React$PureComponent2) { | ||
_inherits(NextArrow, _React$PureComponent2); | ||
@@ -88,49 +118,61 @@ | ||
return _possibleConstructorReturn(this, _React$PureComponent2.apply(this, arguments)); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(NextArrow).apply(this, arguments)); | ||
} | ||
NextArrow.prototype.clickHandler = function clickHandler(options, e) { | ||
if (e) { | ||
e.preventDefault(); | ||
_createClass(NextArrow, [{ | ||
key: "clickHandler", | ||
value: function clickHandler(options, e) { | ||
if (e) { | ||
e.preventDefault(); | ||
} | ||
this.props.clickHandler(options, e); | ||
} | ||
this.props.clickHandler(options, e); | ||
}; | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
var nextClasses = { | ||
"slick-arrow": true, | ||
"slick-next": true | ||
}; | ||
var nextHandler = this.clickHandler.bind(this, { | ||
message: "next" | ||
}); | ||
NextArrow.prototype.render = function render() { | ||
var nextClasses = { "slick-arrow": true, "slick-next": true }; | ||
var nextHandler = this.clickHandler.bind(this, { message: "next" }); | ||
if (!(0, _innerSliderUtils.canGoNext)(this.props)) { | ||
nextClasses["slick-disabled"] = true; | ||
nextHandler = null; | ||
} | ||
if (!(0, _innerSliderUtils.canGoNext)(this.props)) { | ||
nextClasses["slick-disabled"] = true; | ||
nextHandler = null; | ||
} | ||
var nextArrowProps = { | ||
key: "1", | ||
"data-role": "none", | ||
className: (0, _classnames.default)(nextClasses), | ||
style: { | ||
display: "block" | ||
}, | ||
onClick: nextHandler | ||
}; | ||
var customProps = { | ||
currentSlide: this.props.currentSlide, | ||
slideCount: this.props.slideCount | ||
}; | ||
var nextArrow; | ||
var nextArrowProps = { | ||
key: "1", | ||
"data-role": "none", | ||
className: (0, _classnames2.default)(nextClasses), | ||
style: { display: "block" }, | ||
onClick: nextHandler | ||
}; | ||
var customProps = { | ||
currentSlide: this.props.currentSlide, | ||
slideCount: this.props.slideCount | ||
}; | ||
var nextArrow = void 0; | ||
if (this.props.nextArrow) { | ||
nextArrow = _react.default.cloneElement(this.props.nextArrow, _objectSpread({}, nextArrowProps, customProps)); | ||
} else { | ||
nextArrow = _react.default.createElement("button", _extends({ | ||
key: "1", | ||
type: "button" | ||
}, nextArrowProps), " ", "Next"); | ||
} | ||
if (this.props.nextArrow) { | ||
nextArrow = _react2.default.cloneElement(this.props.nextArrow, _extends({}, nextArrowProps, customProps)); | ||
} else { | ||
nextArrow = _react2.default.createElement( | ||
"button", | ||
_extends({ key: "1", type: "button" }, nextArrowProps), | ||
" ", | ||
"Next" | ||
); | ||
return nextArrow; | ||
} | ||
}]); | ||
return nextArrow; | ||
}; | ||
return NextArrow; | ||
}(_react.default.PureComponent); | ||
return NextArrow; | ||
}(_react2.default.PureComponent); | ||
exports.NextArrow = NextArrow; |
"use strict"; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _react = require("react"); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react2 = _interopRequireDefault(_react); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -16,7 +17,7 @@ | ||
appendDots: function appendDots(dots) { | ||
return _react2.default.createElement( | ||
"ul", | ||
{ style: { display: "block" } }, | ||
dots | ||
); | ||
return _react.default.createElement("ul", { | ||
style: { | ||
display: "block" | ||
} | ||
}, dots); | ||
}, | ||
@@ -32,7 +33,3 @@ arrows: true, | ||
customPaging: function customPaging(i) { | ||
return _react2.default.createElement( | ||
"button", | ||
null, | ||
i + 1 | ||
); | ||
return _react.default.createElement("button", null, i + 1); | ||
}, | ||
@@ -77,3 +74,3 @@ dots: false, | ||
}; | ||
exports.default = defaultProps; | ||
var _default = defaultProps; | ||
exports.default = _default; |
142
lib/dots.js
"use strict"; | ||
exports.__esModule = true; | ||
exports.Dots = undefined; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.Dots = void 0; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react = require("react"); | ||
var _classnames = _interopRequireDefault(require("classnames")); | ||
var _react2 = _interopRequireDefault(_react); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _classnames = require("classnames"); | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var getDotCount = function getDotCount(spec) { | ||
@@ -36,3 +48,5 @@ var dots; | ||
var Dots = exports.Dots = function (_React$PureComponent) { | ||
var Dots = | ||
/*#__PURE__*/ | ||
function (_React$PureComponent) { | ||
_inherits(Dots, _React$PureComponent); | ||
@@ -43,59 +57,67 @@ | ||
return _possibleConstructorReturn(this, _React$PureComponent.apply(this, arguments)); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(Dots).apply(this, arguments)); | ||
} | ||
Dots.prototype.clickHandler = function clickHandler(options, e) { | ||
// In Autoplay the focus stays on clicked button even after transition | ||
// to next slide. That only goes away by click somewhere outside | ||
e.preventDefault(); | ||
this.props.clickHandler(options); | ||
}; | ||
_createClass(Dots, [{ | ||
key: "clickHandler", | ||
value: function clickHandler(options, e) { | ||
// In Autoplay the focus stays on clicked button even after transition | ||
// to next slide. That only goes away by click somewhere outside | ||
e.preventDefault(); | ||
this.props.clickHandler(options); | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
var _this = this; | ||
Dots.prototype.render = function render() { | ||
var _this2 = this; | ||
var dotCount = getDotCount({ | ||
slideCount: this.props.slideCount, | ||
slidesToScroll: this.props.slidesToScroll, | ||
slidesToShow: this.props.slidesToShow, | ||
infinite: this.props.infinite | ||
}); // Apply join & split to Array to pre-fill it for IE8 | ||
// | ||
// Credit: http://stackoverflow.com/a/13735425/1849458 | ||
var dotCount = getDotCount({ | ||
slideCount: this.props.slideCount, | ||
slidesToScroll: this.props.slidesToScroll, | ||
slidesToShow: this.props.slidesToShow, | ||
infinite: this.props.infinite | ||
}); | ||
var _this$props = this.props, | ||
onMouseEnter = _this$props.onMouseEnter, | ||
onMouseOver = _this$props.onMouseOver, | ||
onMouseLeave = _this$props.onMouseLeave; | ||
var mouseEvents = { | ||
onMouseEnter: onMouseEnter, | ||
onMouseOver: onMouseOver, | ||
onMouseLeave: onMouseLeave | ||
}; | ||
var dots = Array.apply(null, Array(dotCount + 1).join("0").split("")).map(function (x, i) { | ||
var leftBound = i * _this.props.slidesToScroll; | ||
var rightBound = i * _this.props.slidesToScroll + (_this.props.slidesToScroll - 1); | ||
var className = (0, _classnames.default)({ | ||
"slick-active": _this.props.currentSlide >= leftBound && _this.props.currentSlide <= rightBound | ||
}); | ||
var dotOptions = { | ||
message: "dots", | ||
index: i, | ||
slidesToScroll: _this.props.slidesToScroll, | ||
currentSlide: _this.props.currentSlide | ||
}; | ||
// Apply join & split to Array to pre-fill it for IE8 | ||
// | ||
// Credit: http://stackoverflow.com/a/13735425/1849458 | ||
var _props = this.props, | ||
onMouseEnter = _props.onMouseEnter, | ||
onMouseOver = _props.onMouseOver, | ||
onMouseLeave = _props.onMouseLeave; | ||
var onClick = _this.clickHandler.bind(_this, dotOptions); | ||
var mouseEvents = { onMouseEnter: onMouseEnter, onMouseOver: onMouseOver, onMouseLeave: onMouseLeave }; | ||
var dots = Array.apply(null, Array(dotCount + 1).join("0").split("")).map(function (x, i) { | ||
var leftBound = i * _this2.props.slidesToScroll; | ||
var rightBound = i * _this2.props.slidesToScroll + (_this2.props.slidesToScroll - 1); | ||
var className = (0, _classnames2.default)({ | ||
"slick-active": _this2.props.currentSlide >= leftBound && _this2.props.currentSlide <= rightBound | ||
return _react.default.createElement("li", { | ||
key: i, | ||
className: className | ||
}, _react.default.cloneElement(_this.props.customPaging(i), { | ||
onClick: onClick | ||
})); | ||
}); | ||
return _react.default.cloneElement(this.props.appendDots(dots), _objectSpread({ | ||
className: this.props.dotsClass | ||
}, mouseEvents)); | ||
} | ||
}]); | ||
var dotOptions = { | ||
message: "dots", | ||
index: i, | ||
slidesToScroll: _this2.props.slidesToScroll, | ||
currentSlide: _this2.props.currentSlide | ||
}; | ||
return Dots; | ||
}(_react.default.PureComponent); | ||
var onClick = _this2.clickHandler.bind(_this2, dotOptions); | ||
return _react2.default.createElement( | ||
"li", | ||
{ key: i, className: className }, | ||
_react2.default.cloneElement(_this2.props.customPaging(i), { onClick: onClick }) | ||
); | ||
}); | ||
return _react2.default.cloneElement(this.props.appendDots(dots), _extends({ | ||
className: this.props.dotsClass | ||
}, mouseEvents)); | ||
}; | ||
return Dots; | ||
}(_react2.default.PureComponent); | ||
exports.Dots = Dots; |
"use strict"; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _slider = require("./slider"); | ||
var _slider = _interopRequireDefault(require("./slider")); | ||
var _slider2 = _interopRequireDefault(_slider); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = _slider2.default; | ||
var _default = _slider.default; | ||
exports.default = _default; |
"use strict"; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var initialState = { | ||
@@ -22,9 +25,15 @@ animating: false, | ||
swipeLeft: null, | ||
swiped: false, // used by swipeEvent. differentites between touch and swipe. | ||
swiped: false, | ||
// used by swipeEvent. differentites between touch and swipe. | ||
swiping: false, | ||
touchObject: { startX: 0, startY: 0, curX: 0, curY: 0 }, | ||
touchObject: { | ||
startX: 0, | ||
startY: 0, | ||
curX: 0, | ||
curY: 0 | ||
}, | ||
trackStyle: {}, | ||
trackWidth: 0 | ||
}; | ||
exports.default = initialState; | ||
var _default = initialState; | ||
exports.default = _default; |
"use strict"; | ||
exports.__esModule = true; | ||
exports.InnerSlider = undefined; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.InnerSlider = void 0; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var _react = _interopRequireDefault(require("react")); | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _reactDom = _interopRequireDefault(require("react-dom")); | ||
var _react = require("react"); | ||
var _initialState = _interopRequireDefault(require("./initial-state")); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _lodash = _interopRequireDefault(require("lodash.debounce")); | ||
var _reactDom = require("react-dom"); | ||
var _classnames = _interopRequireDefault(require("classnames")); | ||
var _reactDom2 = _interopRequireDefault(_reactDom); | ||
var _innerSliderUtils = require("./utils/innerSliderUtils"); | ||
var _initialState = require("./initial-state"); | ||
var _track = require("./track"); | ||
var _initialState2 = _interopRequireDefault(_initialState); | ||
var _dots = require("./dots"); | ||
var _lodash = require("lodash.debounce"); | ||
var _arrows = require("./arrows"); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _resizeObserverPolyfill = _interopRequireDefault(require("resize-observer-polyfill")); | ||
var _classnames = require("classnames"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
var _innerSliderUtils = require("./utils/innerSliderUtils"); | ||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
var _track = require("./track"); | ||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | ||
var _dots = require("./dots"); | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
var _arrows = require("./arrows"); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
var _resizeObserverPolyfill = require("resize-observer-polyfill"); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _resizeObserverPolyfill2 = _interopRequireDefault(_resizeObserverPolyfill); | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var InnerSlider = exports.InnerSlider = function (_React$Component) { | ||
var InnerSlider = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
_inherits(InnerSlider, _React$Component); | ||
function InnerSlider(props) { | ||
var _this; | ||
_classCallCheck(this, InnerSlider); | ||
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props)); | ||
_this = _possibleConstructorReturn(this, _getPrototypeOf(InnerSlider).call(this, props)); | ||
_this.listRefHandler = function (ref) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "listRefHandler", function (ref) { | ||
return _this.list = ref; | ||
}; | ||
}); | ||
_this.trackRefHandler = function (ref) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "trackRefHandler", function (ref) { | ||
return _this.track = ref; | ||
}; | ||
}); | ||
_this.adaptHeight = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "adaptHeight", function () { | ||
if (_this.props.adaptiveHeight && _this.list) { | ||
var elem = _this.list.querySelector("[data-index=\"" + _this.state.currentSlide + "\"]"); | ||
var elem = _this.list.querySelector("[data-index=\"".concat(_this.state.currentSlide, "\"]")); | ||
_this.list.style.height = (0, _innerSliderUtils.getHeight)(elem) + "px"; | ||
} | ||
}; | ||
}); | ||
_this.componentWillMount = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "componentWillMount", function () { | ||
_this.ssrInit(); | ||
_this.props.onInit && _this.props.onInit(); | ||
if (_this.props.lazyLoad) { | ||
var slidesToLoad = (0, _innerSliderUtils.getOnDemandLazySlides)(_extends({}, _this.props, _this.state)); | ||
var slidesToLoad = (0, _innerSliderUtils.getOnDemandLazySlides)(_objectSpread({}, _this.props, _this.state)); | ||
if (slidesToLoad.length > 0) { | ||
@@ -86,2 +96,3 @@ _this.setState(function (prevState) { | ||
}); | ||
if (_this.props.onLazyLoad) { | ||
@@ -92,16 +103,25 @@ _this.props.onLazyLoad(slidesToLoad); | ||
} | ||
}; | ||
}); | ||
_this.componentDidMount = function () { | ||
var spec = _extends({ listRef: _this.list, trackRef: _this.track }, _this.props); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "componentDidMount", function () { | ||
var spec = _objectSpread({ | ||
listRef: _this.list, | ||
trackRef: _this.track | ||
}, _this.props); | ||
_this.updateState(spec, true, function () { | ||
_this.adaptHeight(); | ||
_this.props.autoplay && _this.autoPlay("update"); | ||
}); | ||
if (_this.props.lazyLoad === "progressive") { | ||
_this.lazyLoadTimer = setInterval(_this.progressiveLazyLoad, 1000); | ||
} | ||
_this.ro = new _resizeObserverPolyfill2.default(function () { | ||
_this.ro = new _resizeObserverPolyfill.default(function () { | ||
if (_this.state.animating) { | ||
_this.onWindowResized(false); // don't set trackStyle hence don't break animation | ||
_this.callbackTimers.push(setTimeout(function () { | ||
@@ -114,11 +134,14 @@ return _this.onWindowResized(); | ||
}); | ||
_this.ro.observe(_this.list); | ||
Array.prototype.forEach.call(document.querySelectorAll(".slick-slide"), function (slide) { | ||
slide.onfocus = _this.props.pauseOnFocus ? _this.onSlideFocus : null; | ||
slide.onblur = _this.props.pauseOnFocus ? _this.onSlideBlur : null; | ||
}); | ||
// To support server-side rendering | ||
}); // To support server-side rendering | ||
if (!window) { | ||
return; | ||
} | ||
if (window.addEventListener) { | ||
@@ -129,11 +152,13 @@ window.addEventListener("resize", _this.onWindowResized); | ||
} | ||
}; | ||
}); | ||
_this.componentWillUnmount = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "componentWillUnmount", function () { | ||
if (_this.animationEndCallback) { | ||
clearTimeout(_this.animationEndCallback); | ||
} | ||
if (_this.lazyLoadTimer) { | ||
clearInterval(_this.lazyLoadTimer); | ||
} | ||
if (_this.callbackTimers.length) { | ||
@@ -143,4 +168,6 @@ _this.callbackTimers.forEach(function (timer) { | ||
}); | ||
_this.callbackTimers = []; | ||
} | ||
if (window.addEventListener) { | ||
@@ -151,26 +178,20 @@ window.removeEventListener("resize", _this.onWindowResized); | ||
} | ||
if (_this.autoplayTimer) { | ||
clearInterval(_this.autoplayTimer); | ||
} | ||
}; | ||
}); | ||
_this.componentWillReceiveProps = function (nextProps) { | ||
var spec = _extends({ | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "componentWillReceiveProps", function (nextProps) { | ||
var spec = _objectSpread({ | ||
listRef: _this.list, | ||
trackRef: _this.track | ||
}, nextProps, _this.state); | ||
var setTrackStyle = false; | ||
for (var _iterator = Object.keys(_this.props), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { | ||
var _ref; | ||
if (_isArray) { | ||
if (_i >= _iterator.length) break; | ||
_ref = _iterator[_i++]; | ||
} else { | ||
_i = _iterator.next(); | ||
if (_i.done) break; | ||
_ref = _i.value; | ||
} | ||
var _arr = Object.keys(_this.props); | ||
var key = _ref; | ||
for (var _i = 0; _i < _arr.length; _i++) { | ||
var key = _arr[_i]; | ||
@@ -181,5 +202,7 @@ if (!nextProps.hasOwnProperty(key)) { | ||
} | ||
if (_typeof(nextProps[key]) === "object" || typeof nextProps[key] === "function") { | ||
continue; | ||
} | ||
if (nextProps[key] !== _this.props[key]) { | ||
@@ -190,10 +213,12 @@ setTrackStyle = true; | ||
} | ||
_this.updateState(spec, setTrackStyle, function () { | ||
if (_this.state.currentSlide >= _react2.default.Children.count(nextProps.children)) { | ||
if (_this.state.currentSlide >= _react.default.Children.count(nextProps.children)) { | ||
_this.changeSlide({ | ||
message: "index", | ||
index: _react2.default.Children.count(nextProps.children) - nextProps.slidesToShow, | ||
index: _react.default.Children.count(nextProps.children) - nextProps.slidesToShow, | ||
currentSlide: _this.state.currentSlide | ||
}); | ||
} | ||
if (nextProps.autoplay) { | ||
@@ -205,9 +230,12 @@ _this.autoPlay("update"); | ||
}); | ||
}; | ||
}); | ||
_this.componentDidUpdate = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "componentDidUpdate", function () { | ||
_this.checkImagesLoad(); | ||
_this.props.onReInit && _this.props.onReInit(); | ||
if (_this.props.lazyLoad) { | ||
var slidesToLoad = (0, _innerSliderUtils.getOnDemandLazySlides)(_extends({}, _this.props, _this.state)); | ||
var slidesToLoad = (0, _innerSliderUtils.getOnDemandLazySlides)(_objectSpread({}, _this.props, _this.state)); | ||
if (slidesToLoad.length > 0) { | ||
@@ -219,2 +247,3 @@ _this.setState(function (prevState) { | ||
}); | ||
if (_this.props.onLazyLoad) { | ||
@@ -224,49 +253,60 @@ _this.props.onLazyLoad(slidesToLoad); | ||
} | ||
} | ||
// if (this.props.onLazyLoad) { | ||
} // if (this.props.onLazyLoad) { | ||
// this.props.onLazyLoad([leftMostSlide]) | ||
// } | ||
_this.adaptHeight(); | ||
}; | ||
}); | ||
_this.onWindowResized = function (setTrackStyle) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onWindowResized", function (setTrackStyle) { | ||
if (_this.debouncedResize) _this.debouncedResize.cancel(); | ||
_this.debouncedResize = (0, _lodash2.default)(function () { | ||
_this.debouncedResize = (0, _lodash.default)(function () { | ||
return _this.resizeWindow(setTrackStyle); | ||
}, 50); | ||
_this.debouncedResize(); | ||
}; | ||
}); | ||
_this.resizeWindow = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "resizeWindow", function () { | ||
var setTrackStyle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; | ||
if (!_reactDom.default.findDOMNode(_this.track)) return; | ||
if (!_reactDom2.default.findDOMNode(_this.track)) return; | ||
var spec = _extends({ | ||
var spec = _objectSpread({ | ||
listRef: _this.list, | ||
trackRef: _this.track | ||
}, _this.props, _this.state); | ||
_this.updateState(spec, setTrackStyle, function () { | ||
if (_this.props.autoplay) _this.autoPlay("update");else _this.pause("paused"); | ||
}); | ||
// animating state should be cleared while resizing, otherwise autoplay stops working | ||
}); // animating state should be cleared while resizing, otherwise autoplay stops working | ||
_this.setState({ | ||
animating: false | ||
}); | ||
clearTimeout(_this.animationEndCallback); | ||
delete _this.animationEndCallback; | ||
}; | ||
}); | ||
_this.updateState = function (spec, setTrackStyle, callback) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "updateState", function (spec, setTrackStyle, callback) { | ||
var updatedState = (0, _innerSliderUtils.initializedState)(spec); | ||
spec = _extends({}, spec, updatedState, { slideIndex: updatedState.currentSlide }); | ||
spec = _objectSpread({}, spec, updatedState, { | ||
slideIndex: updatedState.currentSlide | ||
}); | ||
var targetLeft = (0, _innerSliderUtils.getTrackLeft)(spec); | ||
spec = _extends({}, spec, { left: targetLeft }); | ||
spec = _objectSpread({}, spec, { | ||
left: targetLeft | ||
}); | ||
var trackStyle = (0, _innerSliderUtils.getTrackCSS)(spec); | ||
if (setTrackStyle || _react2.default.Children.count(_this.props.children) !== _react2.default.Children.count(spec.children)) { | ||
if (setTrackStyle || _react.default.Children.count(_this.props.children) !== _react.default.Children.count(spec.children)) { | ||
updatedState["trackStyle"] = trackStyle; | ||
} | ||
_this.setState(updatedState, callback); | ||
}; | ||
}); | ||
_this.ssrInit = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "ssrInit", function () { | ||
if (_this.props.variableWidth) { | ||
@@ -276,8 +316,9 @@ var _trackWidth = 0, | ||
var childrenWidths = []; | ||
var preClones = (0, _innerSliderUtils.getPreClones)(_extends({}, _this.props, _this.state, { | ||
var preClones = (0, _innerSliderUtils.getPreClones)(_objectSpread({}, _this.props, _this.state, { | ||
slideCount: _this.props.children.length | ||
})); | ||
var postClones = (0, _innerSliderUtils.getPostClones)(_extends({}, _this.props, _this.state, { | ||
var postClones = (0, _innerSliderUtils.getPostClones)(_objectSpread({}, _this.props, _this.state, { | ||
slideCount: _this.props.children.length | ||
})); | ||
_this.props.children.forEach(function (child) { | ||
@@ -287,2 +328,3 @@ childrenWidths.push(child.props.style.width); | ||
}); | ||
for (var i = 0; i < preClones; i++) { | ||
@@ -292,8 +334,11 @@ _trackLeft += childrenWidths[childrenWidths.length - 1 - i]; | ||
} | ||
for (var _i2 = 0; _i2 < postClones; _i2++) { | ||
_trackWidth += childrenWidths[_i2]; | ||
} | ||
for (var _i3 = 0; _i3 < _this.state.currentSlide; _i3++) { | ||
_trackLeft += childrenWidths[_i3]; | ||
} | ||
var _trackStyle = { | ||
@@ -303,13 +348,21 @@ width: _trackWidth + "px", | ||
}; | ||
if (_this.props.centerMode) { | ||
var currentWidth = childrenWidths[_this.state.currentSlide] + "px"; | ||
_trackStyle.left = "calc(" + _trackStyle.left + " + (100% - " + currentWidth + ") / 2 ) "; | ||
var currentWidth = "".concat(childrenWidths[_this.state.currentSlide], "px"); | ||
_trackStyle.left = "calc(".concat(_trackStyle.left, " + (100% - ").concat(currentWidth, ") / 2 ) "); | ||
} | ||
_this.setState({ | ||
trackStyle: _trackStyle | ||
}); | ||
return; | ||
} | ||
var childrenCount = _react2.default.Children.count(_this.props.children); | ||
var spec = _extends({}, _this.props, _this.state, { slideCount: childrenCount }); | ||
var childrenCount = _react.default.Children.count(_this.props.children); | ||
var spec = _objectSpread({}, _this.props, _this.state, { | ||
slideCount: childrenCount | ||
}); | ||
var slideCount = (0, _innerSliderUtils.getPreClones)(spec) + (0, _innerSliderUtils.getPostClones)(spec) + childrenCount; | ||
@@ -319,5 +372,7 @@ var trackWidth = 100 / _this.props.slidesToShow * slideCount; | ||
var trackLeft = -slideWidth * ((0, _innerSliderUtils.getPreClones)(spec) + _this.state.currentSlide) * trackWidth / 100; | ||
if (_this.props.centerMode) { | ||
trackLeft += (100 - slideWidth * trackWidth / 100) / 2; | ||
} | ||
var trackStyle = { | ||
@@ -327,2 +382,3 @@ width: trackWidth + "%", | ||
}; | ||
_this.setState({ | ||
@@ -332,5 +388,5 @@ slideWidth: slideWidth + "%", | ||
}); | ||
}; | ||
}); | ||
_this.checkImagesLoad = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "checkImagesLoad", function () { | ||
var images = document.querySelectorAll(".slick-slide img"); | ||
@@ -343,2 +399,3 @@ var imagesCount = images.length, | ||
}; | ||
if (!image.onclick) { | ||
@@ -350,2 +407,3 @@ image.onclick = function () { | ||
var prevClickHandler = image.onclick; | ||
image.onclick = function () { | ||
@@ -356,2 +414,3 @@ prevClickHandler(); | ||
} | ||
if (!image.onload) { | ||
@@ -361,2 +420,3 @@ if (_this.props.lazyLoad) { | ||
_this.adaptHeight(); | ||
_this.callbackTimers.push(setTimeout(_this.onWindowResized, _this.props.speed)); | ||
@@ -366,2 +426,3 @@ }; | ||
image.onload = handler; | ||
image.onerror = function () { | ||
@@ -374,7 +435,9 @@ handler(); | ||
}); | ||
}; | ||
}); | ||
_this.progressiveLazyLoad = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "progressiveLazyLoad", function () { | ||
var slidesToLoad = []; | ||
var spec = _extends({}, _this.props, _this.state); | ||
var spec = _objectSpread({}, _this.props, _this.state); | ||
for (var index = _this.state.currentSlide; index < _this.state.slideCount + (0, _innerSliderUtils.getPostClones)(spec); index++) { | ||
@@ -386,2 +449,3 @@ if (_this.state.lazyLoadedList.indexOf(index) < 0) { | ||
} | ||
for (var _index = _this.state.currentSlide - 1; _index >= -(0, _innerSliderUtils.getPreClones)(spec); _index--) { | ||
@@ -393,2 +457,3 @@ if (_this.state.lazyLoadedList.indexOf(_index) < 0) { | ||
} | ||
if (slidesToLoad.length > 0) { | ||
@@ -400,2 +465,3 @@ _this.setState(function (state) { | ||
}); | ||
if (_this.props.onLazyLoad) { | ||
@@ -410,5 +476,5 @@ _this.props.onLazyLoad(slidesToLoad); | ||
} | ||
}; | ||
}); | ||
_this.slideHandler = function (index) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "slideHandler", function (index) { | ||
var dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
@@ -420,8 +486,7 @@ var _this$props = _this.props, | ||
speed = _this$props.speed, | ||
afterChange = _this$props.afterChange; | ||
// capture currentslide before state is updated | ||
afterChange = _this$props.afterChange; // capture currentslide before state is updated | ||
var currentSlide = _this.state.currentSlide; | ||
var _slideHandler = (0, _innerSliderUtils.slideHandler)(_extends({ | ||
var _slideHandler = (0, _innerSliderUtils.slideHandler)(_objectSpread({ | ||
index: index | ||
@@ -441,4 +506,5 @@ }, _this.props, _this.state, { | ||
onLazyLoad && slidesToLoad.length > 0 && onLazyLoad(slidesToLoad); | ||
_this.setState(state, function () { | ||
asNavFor && asNavFor.innerSlider.state.currentSlide !== currentSlide && asNavFor.innerSlider.slideHandler(index); | ||
asNavFor && asNavFor.innerSlider.state.currentSlide !== _this.state.currentSlide && asNavFor.innerSlider.slideHandler(index); | ||
if (!nextState) return; | ||
@@ -451,4 +517,7 @@ _this.animationEndCallback = setTimeout(function () { | ||
_this.callbackTimers.push(setTimeout(function () { | ||
return _this.setState({ animating: animating }); | ||
return _this.setState({ | ||
animating: animating | ||
}); | ||
}, 10)); | ||
afterChange && afterChange(state.currentSlide); | ||
@@ -459,10 +528,12 @@ delete _this.animationEndCallback; | ||
}); | ||
}; | ||
}); | ||
_this.changeSlide = function (options) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "changeSlide", function (options) { | ||
var dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
var spec = _extends({}, _this.props, _this.state); | ||
var spec = _objectSpread({}, _this.props, _this.state); | ||
var targetSlide = (0, _innerSliderUtils.changeSlide)(spec, options); | ||
if (targetSlide !== 0 && !targetSlide) return; | ||
if (dontAnimate === true) { | ||
@@ -473,5 +544,5 @@ _this.slideHandler(targetSlide, dontAnimate); | ||
} | ||
}; | ||
}); | ||
_this.clickHandler = function (e) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "clickHandler", function (e) { | ||
if (_this.clickable === false) { | ||
@@ -481,15 +552,18 @@ e.stopPropagation(); | ||
} | ||
_this.clickable = true; | ||
}; | ||
}); | ||
_this.keyHandler = function (e) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "keyHandler", function (e) { | ||
var dir = (0, _innerSliderUtils.keyHandler)(e, _this.props.accessibility, _this.props.rtl); | ||
dir !== "" && _this.changeSlide({ message: dir }); | ||
}; | ||
dir !== "" && _this.changeSlide({ | ||
message: dir | ||
}); | ||
}); | ||
_this.selectHandler = function (options) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "selectHandler", function (options) { | ||
_this.changeSlide(options); | ||
}; | ||
}); | ||
_this.disableBodyScroll = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "disableBodyScroll", function () { | ||
var preventDefault = function preventDefault(e) { | ||
@@ -500,19 +574,21 @@ e = e || window.event; | ||
}; | ||
window.ontouchmove = preventDefault; | ||
}; | ||
}); | ||
_this.enableBodyScroll = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "enableBodyScroll", function () { | ||
window.ontouchmove = null; | ||
}; | ||
}); | ||
_this.swipeStart = function (e) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "swipeStart", function (e) { | ||
if (_this.props.verticalSwiping) { | ||
_this.disableBodyScroll(); | ||
} | ||
var state = (0, _innerSliderUtils.swipeStart)(e, _this.props.swipe, _this.props.draggable); | ||
state !== "" && _this.setState(state); | ||
}; | ||
}); | ||
_this.swipeMove = function (e) { | ||
var state = (0, _innerSliderUtils.swipeMove)(e, _extends({}, _this.props, _this.state, { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "swipeMove", function (e) { | ||
var state = (0, _innerSliderUtils.swipeMove)(e, _objectSpread({}, _this.props, _this.state, { | ||
trackRef: _this.track, | ||
@@ -523,10 +599,12 @@ listRef: _this.list, | ||
if (!state) return; | ||
if (state["swiping"]) { | ||
_this.clickable = false; | ||
} | ||
_this.setState(state); | ||
}; | ||
}); | ||
_this.swipeEnd = function (e) { | ||
var state = (0, _innerSliderUtils.swipeEnd)(e, _extends({}, _this.props, _this.state, { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "swipeEnd", function (e) { | ||
var state = (0, _innerSliderUtils.swipeEnd)(e, _objectSpread({}, _this.props, _this.state, { | ||
trackRef: _this.track, | ||
@@ -539,11 +617,15 @@ listRef: _this.list, | ||
delete state["triggerSlideHandler"]; | ||
_this.setState(state); | ||
if (triggerSlideHandler === undefined) return; | ||
_this.slideHandler(triggerSlideHandler); | ||
if (_this.props.verticalSwiping) { | ||
_this.enableBodyScroll(); | ||
} | ||
}; | ||
}); | ||
_this.slickPrev = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "slickPrev", function () { | ||
// this and fellow methods are wrapped in setTimeout | ||
@@ -553,17 +635,21 @@ // to make sure initialize setState has happened before | ||
_this.callbackTimers.push(setTimeout(function () { | ||
return _this.changeSlide({ message: "previous" }); | ||
return _this.changeSlide({ | ||
message: "previous" | ||
}); | ||
}, 0)); | ||
}; | ||
}); | ||
_this.slickNext = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "slickNext", function () { | ||
_this.callbackTimers.push(setTimeout(function () { | ||
return _this.changeSlide({ message: "next" }); | ||
return _this.changeSlide({ | ||
message: "next" | ||
}); | ||
}, 0)); | ||
}; | ||
}); | ||
_this.slickGoTo = function (slide) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "slickGoTo", function (slide) { | ||
var dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
slide = Number(slide); | ||
if (isNaN(slide)) return ""; | ||
_this.callbackTimers.push(setTimeout(function () { | ||
@@ -576,10 +662,11 @@ return _this.changeSlide({ | ||
}, 0)); | ||
}; | ||
}); | ||
_this.play = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "play", function () { | ||
var nextIndex; | ||
if (_this.props.rtl) { | ||
nextIndex = _this.state.currentSlide - _this.props.slidesToScroll; | ||
} else { | ||
if ((0, _innerSliderUtils.canGoNext)(_extends({}, _this.props, _this.state))) { | ||
if ((0, _innerSliderUtils.canGoNext)(_objectSpread({}, _this.props, _this.state))) { | ||
nextIndex = _this.state.currentSlide + _this.props.slidesToScroll; | ||
@@ -592,9 +679,11 @@ } else { | ||
_this.slideHandler(nextIndex); | ||
}; | ||
}); | ||
_this.autoPlay = function (playType) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "autoPlay", function (playType) { | ||
if (_this.autoplayTimer) { | ||
clearInterval(_this.autoplayTimer); | ||
} | ||
var autoplaying = _this.state.autoplaying; | ||
if (playType === "update") { | ||
@@ -613,7 +702,11 @@ if (autoplaying === "hovered" || autoplaying === "focused" || autoplaying === "paused") { | ||
} | ||
_this.autoplayTimer = setInterval(_this.play, _this.props.autoplaySpeed + 50); | ||
_this.setState({ autoplaying: "playing" }); | ||
}; | ||
_this.pause = function (pauseType) { | ||
_this.setState({ | ||
autoplaying: "playing" | ||
}); | ||
}); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "pause", function (pauseType) { | ||
if (_this.autoplayTimer) { | ||
@@ -623,8 +716,14 @@ clearInterval(_this.autoplayTimer); | ||
} | ||
var autoplaying = _this.state.autoplaying; | ||
if (pauseType === "paused") { | ||
_this.setState({ autoplaying: "paused" }); | ||
_this.setState({ | ||
autoplaying: "paused" | ||
}); | ||
} else if (pauseType === "focused") { | ||
if (autoplaying === "hovered" || autoplaying === "playing") { | ||
_this.setState({ autoplaying: "focused" }); | ||
_this.setState({ | ||
autoplaying: "focused" | ||
}); | ||
} | ||
@@ -634,41 +733,44 @@ } else { | ||
if (autoplaying === "playing") { | ||
_this.setState({ autoplaying: "hovered" }); | ||
_this.setState({ | ||
autoplaying: "hovered" | ||
}); | ||
} | ||
} | ||
}; | ||
}); | ||
_this.onDotsOver = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onDotsOver", function () { | ||
return _this.props.autoplay && _this.pause("hovered"); | ||
}; | ||
}); | ||
_this.onDotsLeave = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onDotsLeave", function () { | ||
return _this.props.autoplay && _this.state.autoplaying === "hovered" && _this.autoPlay("leave"); | ||
}; | ||
}); | ||
_this.onTrackOver = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onTrackOver", function () { | ||
return _this.props.autoplay && _this.pause("hovered"); | ||
}; | ||
}); | ||
_this.onTrackLeave = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onTrackLeave", function () { | ||
return _this.props.autoplay && _this.state.autoplaying === "hovered" && _this.autoPlay("leave"); | ||
}; | ||
}); | ||
_this.onSlideFocus = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onSlideFocus", function () { | ||
return _this.props.autoplay && _this.pause("focused"); | ||
}; | ||
}); | ||
_this.onSlideBlur = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onSlideBlur", function () { | ||
return _this.props.autoplay && _this.state.autoplaying === "focused" && _this.autoPlay("blur"); | ||
}; | ||
}); | ||
_this.render = function () { | ||
var className = (0, _classnames2.default)("slick-slider", _this.props.className, { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "render", function () { | ||
var className = (0, _classnames.default)("slick-slider", _this.props.className, { | ||
"slick-vertical": _this.props.vertical, | ||
"slick-initialized": true | ||
}); | ||
var spec = _extends({}, _this.props, _this.state); | ||
var spec = _objectSpread({}, _this.props, _this.state); | ||
var trackProps = (0, _innerSliderUtils.extractObject)(spec, ["fade", "cssEase", "speed", "infinite", "centerMode", "focusOnSelect", "currentSlide", "lazyLoad", "lazyLoadedList", "rtl", "slideWidth", "slideHeight", "listHeight", "vertical", "slidesToShow", "slidesToScroll", "slideCount", "trackStyle", "variableWidth", "unslick", "centerPadding"]); | ||
var pauseOnHover = _this.props.pauseOnHover; | ||
trackProps = _extends({}, trackProps, { | ||
trackProps = _objectSpread({}, trackProps, { | ||
onMouseEnter: pauseOnHover ? _this.onTrackOver : null, | ||
@@ -679,9 +781,8 @@ onMouseLeave: pauseOnHover ? _this.onTrackLeave : null, | ||
}); | ||
var dots; | ||
var dots; | ||
if (_this.props.dots === true && _this.state.slideCount >= _this.props.slidesToShow) { | ||
var dotProps = (0, _innerSliderUtils.extractObject)(spec, ["dotsClass", "slideCount", "slidesToShow", "currentSlide", "slidesToScroll", "clickHandler", "children", "customPaging", "infinite", "appendDots"]); | ||
var pauseOnDotsHover = _this.props.pauseOnDotsHover; | ||
dotProps = _extends({}, dotProps, { | ||
dotProps = _objectSpread({}, dotProps, { | ||
clickHandler: _this.changeSlide, | ||
@@ -692,3 +793,3 @@ onMouseEnter: pauseOnDotsHover ? _this.onDotsLeave : null, | ||
}); | ||
dots = _react2.default.createElement(_dots.Dots, dotProps); | ||
dots = _react.default.createElement(_dots.Dots, dotProps); | ||
} | ||
@@ -701,4 +802,4 @@ | ||
if (_this.props.arrows) { | ||
prevArrow = _react2.default.createElement(_arrows.PrevArrow, arrowProps); | ||
nextArrow = _react2.default.createElement(_arrows.NextArrow, arrowProps); | ||
prevArrow = _react.default.createElement(_arrows.PrevArrow, arrowProps); | ||
nextArrow = _react.default.createElement(_arrows.NextArrow, arrowProps); | ||
} | ||
@@ -730,3 +831,4 @@ | ||
var listStyle = _extends({}, verticalHeightStyle, centerPaddingStyle); | ||
var listStyle = _objectSpread({}, verticalHeightStyle, centerPaddingStyle); | ||
var touchMove = _this.props.touchMove; | ||
@@ -747,3 +849,2 @@ var listProps = { | ||
}; | ||
var innerSliderProps = { | ||
@@ -755,28 +856,22 @@ className: className, | ||
if (_this.props.unslick) { | ||
listProps = { className: "slick-list" }; | ||
innerSliderProps = { className: className }; | ||
listProps = { | ||
className: "slick-list" | ||
}; | ||
innerSliderProps = { | ||
className: className | ||
}; | ||
} | ||
return _react2.default.createElement( | ||
"div", | ||
innerSliderProps, | ||
!_this.props.unslick ? prevArrow : "", | ||
_react2.default.createElement( | ||
"div", | ||
_extends({ ref: _this.listRefHandler }, listProps), | ||
_react2.default.createElement( | ||
_track.Track, | ||
_extends({ ref: _this.trackRefHandler }, trackProps), | ||
_this.props.children | ||
) | ||
), | ||
!_this.props.unslick ? nextArrow : "", | ||
!_this.props.unslick ? dots : "" | ||
); | ||
}; | ||
return _react.default.createElement("div", innerSliderProps, !_this.props.unslick ? prevArrow : "", _react.default.createElement("div", _extends({ | ||
ref: _this.listRefHandler | ||
}, listProps), _react.default.createElement(_track.Track, _extends({ | ||
ref: _this.trackRefHandler | ||
}, trackProps), _this.props.children)), !_this.props.unslick ? nextArrow : "", !_this.props.unslick ? dots : ""); | ||
}); | ||
_this.list = null; | ||
_this.track = null; | ||
_this.state = _extends({}, _initialState2.default, { | ||
_this.state = _objectSpread({}, _initialState.default, { | ||
currentSlide: _this.props.initialSlide, | ||
slideCount: _react2.default.Children.count(_this.props.children) | ||
slideCount: _react.default.Children.count(_this.props.children) | ||
}); | ||
@@ -790,2 +885,4 @@ _this.callbackTimers = []; | ||
return InnerSlider; | ||
}(_react2.default.Component); | ||
}(_react.default.Component); | ||
exports.InnerSlider = InnerSlider; |
"use strict"; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react = require("react"); | ||
var _innerSlider = require("./inner-slider"); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _json2mq = _interopRequireDefault(require("json2mq")); | ||
var _innerSlider = require("./inner-slider"); | ||
var _defaultProps = _interopRequireDefault(require("./default-props")); | ||
var _json2mq = require("json2mq"); | ||
var _innerSliderUtils = require("./utils/innerSliderUtils"); | ||
var _json2mq2 = _interopRequireDefault(_json2mq); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _defaultProps = require("./default-props"); | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
var _defaultProps2 = _interopRequireDefault(_defaultProps); | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
var _innerSliderUtils = require("./utils/innerSliderUtils"); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var enquire = (0, _innerSliderUtils.canUseDOM)() && require("enquire.js"); | ||
var Slider = function (_React$Component) { | ||
var Slider = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
_inherits(Slider, _React$Component); | ||
function Slider(props) { | ||
var _this; | ||
_classCallCheck(this, Slider); | ||
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props)); | ||
_this = _possibleConstructorReturn(this, _getPrototypeOf(Slider).call(this, props)); | ||
_this.innerSliderRefHandler = function (ref) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "innerSliderRefHandler", function (ref) { | ||
return _this.innerSlider = ref; | ||
}; | ||
}); | ||
_this.slickPrev = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "slickPrev", function () { | ||
return _this.innerSlider.slickPrev(); | ||
}; | ||
}); | ||
_this.slickNext = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "slickNext", function () { | ||
return _this.innerSlider.slickNext(); | ||
}; | ||
}); | ||
_this.slickGoTo = function (slide) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "slickGoTo", function (slide) { | ||
var dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
return _this.innerSlider.slickGoTo(slide, dontAnimate); | ||
}; | ||
}); | ||
_this.slickPause = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "slickPause", function () { | ||
return _this.innerSlider.pause("paused"); | ||
}; | ||
}); | ||
_this.slickPlay = function () { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "slickPlay", function () { | ||
return _this.innerSlider.autoPlay("play"); | ||
}; | ||
}); | ||
@@ -73,172 +90,194 @@ _this.state = { | ||
Slider.prototype.media = function media(query, handler) { | ||
// javascript handler for css media query | ||
enquire.register(query, handler); | ||
this._responsiveMediaHandlers.push({ query: query, handler: handler }); | ||
}; | ||
_createClass(Slider, [{ | ||
key: "media", | ||
value: function media(query, handler) { | ||
// javascript handler for css media query | ||
enquire.register(query, handler); | ||
// handles responsive breakpoints | ||
this._responsiveMediaHandlers.push({ | ||
query: query, | ||
handler: handler | ||
}); | ||
} // handles responsive breakpoints | ||
}, { | ||
key: "componentWillMount", | ||
value: function componentWillMount() { | ||
var _this2 = this; | ||
Slider.prototype.componentWillMount = function componentWillMount() { | ||
var _this2 = this; | ||
// performance monitoring | ||
//if (process.env.NODE_ENV !== 'production') { | ||
//const { whyDidYouUpdate } = require('why-did-you-update') | ||
//whyDidYouUpdate(React) | ||
//} | ||
if (this.props.responsive) { | ||
var breakpoints = this.props.responsive.map(function (breakpt) { | ||
return breakpt.breakpoint; | ||
}); // sort them in increasing order of their numerical value | ||
// performance monitoring | ||
//if (process.env.NODE_ENV !== 'production') { | ||
//const { whyDidYouUpdate } = require('why-did-you-update') | ||
//whyDidYouUpdate(React) | ||
//} | ||
if (this.props.responsive) { | ||
var breakpoints = this.props.responsive.map(function (breakpt) { | ||
return breakpt.breakpoint; | ||
}); | ||
// sort them in increasing order of their numerical value | ||
breakpoints.sort(function (x, y) { | ||
return x - y; | ||
}); | ||
breakpoints.sort(function (x, y) { | ||
return x - y; | ||
}); | ||
breakpoints.forEach(function (breakpoint, index) { | ||
// media query for each breakpoint | ||
var bQuery; | ||
breakpoints.forEach(function (breakpoint, index) { | ||
// media query for each breakpoint | ||
var bQuery = void 0; | ||
if (index === 0) { | ||
bQuery = (0, _json2mq2.default)({ minWidth: 0, maxWidth: breakpoint }); | ||
} else { | ||
bQuery = (0, _json2mq2.default)({ | ||
minWidth: breakpoints[index - 1] + 1, | ||
maxWidth: breakpoint | ||
if (index === 0) { | ||
bQuery = (0, _json2mq.default)({ | ||
minWidth: 0, | ||
maxWidth: breakpoint | ||
}); | ||
} else { | ||
bQuery = (0, _json2mq.default)({ | ||
minWidth: breakpoints[index - 1] + 1, | ||
maxWidth: breakpoint | ||
}); | ||
} // when not using server side rendering | ||
(0, _innerSliderUtils.canUseDOM)() && _this2.media(bQuery, function () { | ||
_this2.setState({ | ||
breakpoint: breakpoint | ||
}); | ||
}); | ||
} | ||
// when not using server side rendering | ||
(0, _innerSliderUtils.canUseDOM)() && _this2.media(bQuery, function () { | ||
_this2.setState({ breakpoint: breakpoint }); | ||
}); // Register media query for full screen. Need to support resize from small to large | ||
// convert javascript object to media query string | ||
var query = (0, _json2mq.default)({ | ||
minWidth: breakpoints.slice(-1)[0] | ||
}); | ||
(0, _innerSliderUtils.canUseDOM)() && this.media(query, function () { | ||
_this2.setState({ | ||
breakpoint: null | ||
}); | ||
}); | ||
} | ||
} | ||
}, { | ||
key: "componentWillUnmount", | ||
value: function componentWillUnmount() { | ||
this._responsiveMediaHandlers.forEach(function (obj) { | ||
enquire.unregister(obj.query, obj.handler); | ||
}); | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
var _this3 = this; | ||
// Register media query for full screen. Need to support resize from small to large | ||
// convert javascript object to media query string | ||
var query = (0, _json2mq2.default)({ minWidth: breakpoints.slice(-1)[0] }); | ||
var settings; | ||
var newProps; | ||
(0, _innerSliderUtils.canUseDOM)() && this.media(query, function () { | ||
_this2.setState({ breakpoint: null }); | ||
}); | ||
} | ||
}; | ||
if (this.state.breakpoint) { | ||
newProps = this.props.responsive.filter(function (resp) { | ||
return resp.breakpoint === _this3.state.breakpoint; | ||
}); | ||
settings = newProps[0].settings === "unslick" ? "unslick" : _objectSpread({}, _defaultProps.default, this.props, newProps[0].settings); | ||
} else { | ||
settings = _objectSpread({}, _defaultProps.default, this.props); | ||
} // force scrolling by one if centerMode is on | ||
Slider.prototype.componentWillUnmount = function componentWillUnmount() { | ||
this._responsiveMediaHandlers.forEach(function (obj) { | ||
enquire.unregister(obj.query, obj.handler); | ||
}); | ||
}; | ||
Slider.prototype.render = function render() { | ||
var _this3 = this; | ||
if (settings.centerMode) { | ||
if (settings.slidesToScroll > 1 && process.env.NODE_ENV !== "production") { | ||
console.warn("slidesToScroll should be equal to 1 in centerMode, you are using ".concat(settings.slidesToScroll)); | ||
} | ||
var settings; | ||
var newProps; | ||
if (this.state.breakpoint) { | ||
newProps = this.props.responsive.filter(function (resp) { | ||
return resp.breakpoint === _this3.state.breakpoint; | ||
}); | ||
settings = newProps[0].settings === "unslick" ? "unslick" : _extends({}, _defaultProps2.default, this.props, newProps[0].settings); | ||
} else { | ||
settings = _extends({}, _defaultProps2.default, this.props); | ||
} | ||
settings.slidesToScroll = 1; | ||
} // force showing one slide and scrolling by one if the fade mode is on | ||
// force scrolling by one if centerMode is on | ||
if (settings.centerMode) { | ||
if (settings.slidesToScroll > 1 && process.env.NODE_ENV !== "production") { | ||
console.warn("slidesToScroll should be equal to 1 in centerMode, you are using " + settings.slidesToScroll); | ||
} | ||
settings.slidesToScroll = 1; | ||
} | ||
// force showing one slide and scrolling by one if the fade mode is on | ||
if (settings.fade) { | ||
if (settings.slidesToShow > 1 && process.env.NODE_ENV !== "production") { | ||
console.warn("slidesToShow should be equal to 1 when fade is true, you're using " + settings.slidesToShow); | ||
} | ||
if (settings.slidesToScroll > 1 && process.env.NODE_ENV !== "production") { | ||
console.warn("slidesToScroll should be equal to 1 when fade is true, you're using " + settings.slidesToScroll); | ||
} | ||
settings.slidesToShow = 1; | ||
settings.slidesToScroll = 1; | ||
} | ||
// makes sure that children is an array, even when there is only 1 child | ||
var children = _react2.default.Children.toArray(this.props.children); | ||
if (settings.fade) { | ||
if (settings.slidesToShow > 1 && process.env.NODE_ENV !== "production") { | ||
console.warn("slidesToShow should be equal to 1 when fade is true, you're using ".concat(settings.slidesToShow)); | ||
} | ||
// Children may contain false or null, so we should filter them | ||
// children may also contain string filled with spaces (in certain cases where we use jsx strings) | ||
children = children.filter(function (child) { | ||
if (typeof child === "string") { | ||
return !!child.trim(); | ||
if (settings.slidesToScroll > 1 && process.env.NODE_ENV !== "production") { | ||
console.warn("slidesToScroll should be equal to 1 when fade is true, you're using ".concat(settings.slidesToScroll)); | ||
} | ||
settings.slidesToShow = 1; | ||
settings.slidesToScroll = 1; | ||
} // makes sure that children is an array, even when there is only 1 child | ||
var children = _react.default.Children.toArray(this.props.children); // Children may contain false or null, so we should filter them | ||
// children may also contain string filled with spaces (in certain cases where we use jsx strings) | ||
children = children.filter(function (child) { | ||
if (typeof child === "string") { | ||
return !!child.trim(); | ||
} | ||
return !!child; | ||
}); // rows and slidesPerRow logic is handled here | ||
if (settings.variableWidth && (settings.rows > 1 || settings.slidesPerRow > 1)) { | ||
console.warn("variableWidth is not supported in case of rows > 1 or slidesPerRow > 1"); | ||
settings.variableWidth = false; | ||
} | ||
return !!child; | ||
}); | ||
// rows and slidesPerRow logic is handled here | ||
if (settings.variableWidth && (settings.rows > 1 || settings.slidesPerRow > 1)) { | ||
console.warn("variableWidth is not supported in case of rows > 1 or slidesPerRow > 1"); | ||
settings.variableWidth = false; | ||
} | ||
var newChildren = []; | ||
var currentWidth = null; | ||
for (var i = 0; i < children.length; i += settings.rows * settings.slidesPerRow) { | ||
var newSlide = []; | ||
for (var j = i; j < i + settings.rows * settings.slidesPerRow; j += settings.slidesPerRow) { | ||
var row = []; | ||
for (var k = j; k < j + settings.slidesPerRow; k += 1) { | ||
if (settings.variableWidth && children[k].props.style) { | ||
currentWidth = children[k].props.style.width; | ||
var newChildren = []; | ||
var currentWidth = null; | ||
for (var i = 0; i < children.length; i += settings.rows * settings.slidesPerRow) { | ||
var newSlide = []; | ||
for (var j = i; j < i + settings.rows * settings.slidesPerRow; j += settings.slidesPerRow) { | ||
var row = []; | ||
for (var k = j; k < j + settings.slidesPerRow; k += 1) { | ||
if (settings.variableWidth && children[k].props.style) { | ||
currentWidth = children[k].props.style.width; | ||
} | ||
if (k >= children.length) break; | ||
row.push(_react.default.cloneElement(children[k], { | ||
key: 100 * i + 10 * j + k, | ||
tabIndex: -1, | ||
style: { | ||
width: "".concat(100 / settings.slidesPerRow, "%"), | ||
display: "inline-block" | ||
} | ||
})); | ||
} | ||
if (k >= children.length) break; | ||
row.push(_react2.default.cloneElement(children[k], { | ||
key: 100 * i + 10 * j + k, | ||
tabIndex: -1, | ||
newSlide.push(_react.default.createElement("div", { | ||
key: 10 * i + j | ||
}, row)); | ||
} | ||
if (settings.variableWidth) { | ||
newChildren.push(_react.default.createElement("div", { | ||
key: i, | ||
style: { | ||
width: 100 / settings.slidesPerRow + "%", | ||
display: "inline-block" | ||
width: currentWidth | ||
} | ||
})); | ||
}, newSlide)); | ||
} else { | ||
newChildren.push(_react.default.createElement("div", { | ||
key: i | ||
}, newSlide)); | ||
} | ||
newSlide.push(_react2.default.createElement( | ||
"div", | ||
{ key: 10 * i + j }, | ||
row | ||
)); | ||
} | ||
if (settings.variableWidth) { | ||
newChildren.push(_react2.default.createElement( | ||
"div", | ||
{ key: i, style: { width: currentWidth } }, | ||
newSlide | ||
)); | ||
} else { | ||
newChildren.push(_react2.default.createElement( | ||
"div", | ||
{ key: i }, | ||
newSlide | ||
)); | ||
if (settings === "unslick") { | ||
var className = "regular slider " + (this.props.className || ""); | ||
return _react.default.createElement("div", { | ||
className: className | ||
}, newChildren); | ||
} else if (newChildren.length <= settings.slidesToShow) { | ||
settings.unslick = true; | ||
} | ||
} | ||
if (settings === "unslick") { | ||
var className = "regular slider " + (this.props.className || ""); | ||
return _react2.default.createElement( | ||
"div", | ||
{ className: className }, | ||
newChildren | ||
); | ||
} else if (newChildren.length <= settings.slidesToShow) { | ||
settings.unslick = true; | ||
return _react.default.createElement(_innerSlider.InnerSlider, _extends({ | ||
ref: this.innerSliderRefHandler | ||
}, settings), newChildren); | ||
} | ||
return _react2.default.createElement( | ||
_innerSlider.InnerSlider, | ||
_extends({ ref: this.innerSliderRefHandler }, settings), | ||
newChildren | ||
); | ||
}; | ||
}]); | ||
return Slider; | ||
}(_react2.default.Component); | ||
}(_react.default.Component); | ||
exports.default = Slider; |
150
lib/track.js
"use strict"; | ||
exports.__esModule = true; | ||
exports.Track = undefined; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.Track = void 0; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react = require("react"); | ||
var _classnames = _interopRequireDefault(require("classnames")); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _innerSliderUtils = require("./utils/innerSliderUtils"); | ||
var _classnames = require("classnames"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
var _innerSliderUtils = require("./utils/innerSliderUtils"); | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
// given specifications/props for a slide, fetch all the classes that need to be applied to the slide | ||
@@ -36,6 +50,9 @@ var getSlideClasses = function getSlideClasses(spec) { | ||
} | ||
slickCloned = index < 0 || index >= spec.slideCount; | ||
if (spec.centerMode) { | ||
centerOffset = Math.floor(spec.slidesToShow / 2); | ||
slickCenter = (index - spec.currentSlide) % spec.slideCount === 0; | ||
if (index > spec.currentSlide - centerOffset - 1 && index <= spec.currentSlide + centerOffset) { | ||
@@ -47,2 +64,3 @@ slickActive = true; | ||
} | ||
var slickCurrent = index === spec.currentSlide; | ||
@@ -55,2 +73,3 @@ return { | ||
"slick-current": slickCurrent // dubious in case of RTL | ||
}; | ||
@@ -68,2 +87,3 @@ }; | ||
style.position = "relative"; | ||
if (spec.vertical) { | ||
@@ -74,2 +94,3 @@ style.top = -spec.index * parseInt(spec.slideHeight); | ||
} | ||
style.opacity = spec.currentSlide === spec.index ? 1 : 0; | ||
@@ -92,8 +113,10 @@ style.transition = "opacity " + spec.speed + "ms " + spec.cssEase + ", " + "visibility " + spec.speed + "ms " + spec.cssEase; | ||
var postCloneSlides = []; | ||
var childrenCount = _react2.default.Children.count(spec.children); | ||
var childrenCount = _react.default.Children.count(spec.children); | ||
var startIndex = (0, _innerSliderUtils.lazyStartIndex)(spec); | ||
var endIndex = (0, _innerSliderUtils.lazyEndIndex)(spec); | ||
_react2.default.Children.forEach(spec.children, function (elem, index) { | ||
var child = void 0; | ||
_react.default.Children.forEach(spec.children, function (elem, index) { | ||
var child; | ||
var childOnClickOptions = { | ||
@@ -104,23 +127,30 @@ message: "children", | ||
currentSlide: spec.currentSlide | ||
}; | ||
}; // in case of lazyLoad, whether or not we want to fetch the slide | ||
// in case of lazyLoad, whether or not we want to fetch the slide | ||
if (!spec.lazyLoad || spec.lazyLoad && spec.lazyLoadedList.indexOf(index) >= 0) { | ||
child = elem; | ||
} else { | ||
child = _react2.default.createElement("div", null); | ||
child = _react.default.createElement("div", null); | ||
} | ||
var childStyle = getSlideStyle(_extends({}, spec, { index: index })); | ||
var childStyle = getSlideStyle(_objectSpread({}, spec, { | ||
index: index | ||
})); | ||
var slideClass = child.props.className || ""; | ||
var slideClasses = getSlideClasses(_extends({}, spec, { index: index })); | ||
// push a cloned element of the desired slide | ||
slides.push(_react2.default.cloneElement(child, { | ||
var slideClasses = getSlideClasses(_objectSpread({}, spec, { | ||
index: index | ||
})); // push a cloned element of the desired slide | ||
slides.push(_react.default.cloneElement(child, { | ||
key: "original" + getKey(child, index), | ||
"data-index": index, | ||
className: (0, _classnames2.default)(slideClasses, slideClass), | ||
className: (0, _classnames.default)(slideClasses, slideClass), | ||
tabIndex: "-1", | ||
"aria-hidden": !slideClasses["slick-active"], | ||
style: _extends({ outline: "none" }, child.props.style || {}, childStyle), | ||
style: _objectSpread({ | ||
outline: "none" | ||
}, child.props.style || {}, childStyle), | ||
onClick: function onClick(e) { | ||
child.props && child.props.onClick && child.props.onClick(e); | ||
if (spec.focusOnSelect) { | ||
@@ -130,22 +160,27 @@ spec.focusOnSelect(childOnClickOptions); | ||
} | ||
})); | ||
})); // if slide needs to be precloned or postcloned | ||
// if slide needs to be precloned or postcloned | ||
if (spec.infinite && spec.fade === false) { | ||
var preCloneNo = childrenCount - index; | ||
if (preCloneNo <= (0, _innerSliderUtils.getPreClones)(spec) && childrenCount !== spec.slidesToShow) { | ||
key = -preCloneNo; | ||
if (key >= startIndex) { | ||
child = elem; | ||
} | ||
slideClasses = getSlideClasses(_extends({}, spec, { index: key })); | ||
preCloneSlides.push(_react2.default.cloneElement(child, { | ||
slideClasses = getSlideClasses(_objectSpread({}, spec, { | ||
index: key | ||
})); | ||
preCloneSlides.push(_react.default.cloneElement(child, { | ||
key: "precloned" + getKey(child, key), | ||
"data-index": key, | ||
tabIndex: "-1", | ||
className: (0, _classnames2.default)(slideClasses, slideClass), | ||
className: (0, _classnames.default)(slideClasses, slideClass), | ||
"aria-hidden": !slideClasses["slick-active"], | ||
style: _extends({}, child.props.style || {}, childStyle), | ||
style: _objectSpread({}, child.props.style || {}, childStyle), | ||
onClick: function onClick(e) { | ||
child.props && child.props.onClick && child.props.onClick(e); | ||
if (spec.focusOnSelect) { | ||
@@ -160,15 +195,20 @@ spec.focusOnSelect(childOnClickOptions); | ||
key = childrenCount + index; | ||
if (key < endIndex) { | ||
child = elem; | ||
} | ||
slideClasses = getSlideClasses(_extends({}, spec, { index: key })); | ||
postCloneSlides.push(_react2.default.cloneElement(child, { | ||
slideClasses = getSlideClasses(_objectSpread({}, spec, { | ||
index: key | ||
})); | ||
postCloneSlides.push(_react.default.cloneElement(child, { | ||
key: "postcloned" + getKey(child, key), | ||
"data-index": key, | ||
tabIndex: "-1", | ||
className: (0, _classnames2.default)(slideClasses, slideClass), | ||
className: (0, _classnames.default)(slideClasses, slideClass), | ||
"aria-hidden": !slideClasses["slick-active"], | ||
style: _extends({}, child.props.style || {}, childStyle), | ||
style: _objectSpread({}, child.props.style || {}, childStyle), | ||
onClick: function onClick(e) { | ||
child.props && child.props.onClick && child.props.onClick(e); | ||
if (spec.focusOnSelect) { | ||
@@ -190,3 +230,5 @@ spec.focusOnSelect(childOnClickOptions); | ||
var Track = exports.Track = function (_React$PureComponent) { | ||
var Track = | ||
/*#__PURE__*/ | ||
function (_React$PureComponent) { | ||
_inherits(Track, _React$PureComponent); | ||
@@ -197,24 +239,28 @@ | ||
return _possibleConstructorReturn(this, _React$PureComponent.apply(this, arguments)); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(Track).apply(this, arguments)); | ||
} | ||
Track.prototype.render = function render() { | ||
var slides = renderSlides(this.props); | ||
var _props = this.props, | ||
onMouseEnter = _props.onMouseEnter, | ||
onMouseOver = _props.onMouseOver, | ||
onMouseLeave = _props.onMouseLeave; | ||
var mouseEvents = { onMouseEnter: onMouseEnter, onMouseOver: onMouseOver, onMouseLeave: onMouseLeave }; | ||
return _react2.default.createElement( | ||
"div", | ||
_extends({ | ||
_createClass(Track, [{ | ||
key: "render", | ||
value: function render() { | ||
var slides = renderSlides(this.props); | ||
var _this$props = this.props, | ||
onMouseEnter = _this$props.onMouseEnter, | ||
onMouseOver = _this$props.onMouseOver, | ||
onMouseLeave = _this$props.onMouseLeave; | ||
var mouseEvents = { | ||
onMouseEnter: onMouseEnter, | ||
onMouseOver: onMouseOver, | ||
onMouseLeave: onMouseLeave | ||
}; | ||
return _react.default.createElement("div", _extends({ | ||
className: "slick-track", | ||
style: this.props.trackStyle | ||
}, mouseEvents), | ||
slides | ||
); | ||
}; | ||
}, mouseEvents), slides); | ||
} | ||
}]); | ||
return Track; | ||
}(_react2.default.PureComponent); | ||
}(_react.default.PureComponent); | ||
exports.Track = Track; |
"use strict"; | ||
exports.__esModule = true; | ||
exports.canUseDOM = exports.slidesOnLeft = exports.slidesOnRight = exports.siblingDirection = exports.getTotalSlides = exports.getPostClones = exports.getPreClones = exports.getTrackLeft = exports.getTrackAnimateCSS = exports.getTrackCSS = exports.checkSpecKeys = exports.getSlideCount = exports.checkNavigable = exports.getNavigableIndexes = exports.swipeEnd = exports.swipeMove = exports.swipeStart = exports.keyHandler = exports.changeSlide = exports.slideHandler = exports.initializedState = exports.extractObject = exports.canGoNext = exports.getSwipeDirection = exports.getHeight = exports.getWidth = exports.lazySlidesOnRight = exports.lazySlidesOnLeft = exports.lazyEndIndex = exports.lazyStartIndex = exports.getRequiredLazySlides = exports.getOnDemandLazySlides = undefined; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.canUseDOM = exports.slidesOnLeft = exports.slidesOnRight = exports.siblingDirection = exports.getTotalSlides = exports.getPostClones = exports.getPreClones = exports.getTrackLeft = exports.getTrackAnimateCSS = exports.getTrackCSS = exports.checkSpecKeys = exports.getSlideCount = exports.checkNavigable = exports.getNavigableIndexes = exports.swipeEnd = exports.swipeMove = exports.swipeStart = exports.keyHandler = exports.changeSlide = exports.slideHandler = exports.initializedState = exports.extractObject = exports.canGoNext = exports.getSwipeDirection = exports.getHeight = exports.getWidth = exports.lazySlidesOnRight = exports.lazySlidesOnLeft = exports.lazyEndIndex = exports.lazyStartIndex = exports.getRequiredLazySlides = exports.getOnDemandLazySlides = void 0; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react = require("react"); | ||
var _reactDom = _interopRequireDefault(require("react-dom")); | ||
var _react2 = _interopRequireDefault(_react); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _reactDom = require("react-dom"); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
var _reactDom2 = _interopRequireDefault(_reactDom); | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var getOnDemandLazySlides = exports.getOnDemandLazySlides = function getOnDemandLazySlides(spec) { | ||
var getOnDemandLazySlides = function getOnDemandLazySlides(spec) { | ||
var onDemandSlides = []; | ||
var startIndex = lazyStartIndex(spec); | ||
var endIndex = lazyEndIndex(spec); | ||
for (var slideIndex = startIndex; slideIndex < endIndex; slideIndex++) { | ||
@@ -27,40 +28,63 @@ if (spec.lazyLoadedList.indexOf(slideIndex) < 0) { | ||
} | ||
return onDemandSlides; | ||
}; | ||
}; // return list of slides that need to be present | ||
// return list of slides that need to be present | ||
var getRequiredLazySlides = exports.getRequiredLazySlides = function getRequiredLazySlides(spec) { | ||
exports.getOnDemandLazySlides = getOnDemandLazySlides; | ||
var getRequiredLazySlides = function getRequiredLazySlides(spec) { | ||
var requiredSlides = []; | ||
var startIndex = lazyStartIndex(spec); | ||
var endIndex = lazyEndIndex(spec); | ||
for (var slideIndex = startIndex; slideIndex < endIndex; slideIndex++) { | ||
requiredSlides.push(slideIndex); | ||
} | ||
return requiredSlides; | ||
}; | ||
}; // startIndex that needs to be present | ||
// startIndex that needs to be present | ||
var lazyStartIndex = exports.lazyStartIndex = function lazyStartIndex(spec) { | ||
exports.getRequiredLazySlides = getRequiredLazySlides; | ||
var lazyStartIndex = function lazyStartIndex(spec) { | ||
return spec.currentSlide - lazySlidesOnLeft(spec); | ||
}; | ||
var lazyEndIndex = exports.lazyEndIndex = function lazyEndIndex(spec) { | ||
exports.lazyStartIndex = lazyStartIndex; | ||
var lazyEndIndex = function lazyEndIndex(spec) { | ||
return spec.currentSlide + lazySlidesOnRight(spec); | ||
}; | ||
var lazySlidesOnLeft = exports.lazySlidesOnLeft = function lazySlidesOnLeft(spec) { | ||
exports.lazyEndIndex = lazyEndIndex; | ||
var lazySlidesOnLeft = function lazySlidesOnLeft(spec) { | ||
return spec.centerMode ? Math.floor(spec.slidesToShow / 2) + (parseInt(spec.centerPadding) > 0 ? 1 : 0) : 0; | ||
}; | ||
var lazySlidesOnRight = exports.lazySlidesOnRight = function lazySlidesOnRight(spec) { | ||
exports.lazySlidesOnLeft = lazySlidesOnLeft; | ||
var lazySlidesOnRight = function lazySlidesOnRight(spec) { | ||
return spec.centerMode ? Math.floor((spec.slidesToShow - 1) / 2) + 1 + (parseInt(spec.centerPadding) > 0 ? 1 : 0) : spec.slidesToShow; | ||
}; | ||
}; // get width of an element | ||
// get width of an element | ||
var getWidth = exports.getWidth = function getWidth(elem) { | ||
exports.lazySlidesOnRight = lazySlidesOnRight; | ||
var getWidth = function getWidth(elem) { | ||
return elem && elem.offsetWidth || 0; | ||
}; | ||
var getHeight = exports.getHeight = function getHeight(elem) { | ||
exports.getWidth = getWidth; | ||
var getHeight = function getHeight(elem) { | ||
return elem && elem.offsetHeight || 0; | ||
}; | ||
var getSwipeDirection = exports.getSwipeDirection = function getSwipeDirection(touchObject) { | ||
exports.getHeight = getHeight; | ||
var getSwipeDirection = function getSwipeDirection(touchObject) { | ||
var verticalSwiping = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
var xDist, yDist, r, swipeAngle; | ||
@@ -71,11 +95,15 @@ xDist = touchObject.startX - touchObject.curX; | ||
swipeAngle = Math.round(r * 180 / Math.PI); | ||
if (swipeAngle < 0) { | ||
swipeAngle = 360 - Math.abs(swipeAngle); | ||
} | ||
if (swipeAngle <= 45 && swipeAngle >= 0 || swipeAngle <= 360 && swipeAngle >= 315) { | ||
return "left"; | ||
} | ||
if (swipeAngle >= 135 && swipeAngle <= 225) { | ||
return "right"; | ||
} | ||
if (verticalSwiping === true) { | ||
@@ -90,7 +118,10 @@ if (swipeAngle >= 35 && swipeAngle <= 135) { | ||
return "vertical"; | ||
}; | ||
}; // whether or not we can go next | ||
// whether or not we can go next | ||
var canGoNext = exports.canGoNext = function canGoNext(spec) { | ||
exports.getSwipeDirection = getSwipeDirection; | ||
var canGoNext = function canGoNext(spec) { | ||
var canGo = true; | ||
if (!spec.infinite) { | ||
@@ -103,7 +134,10 @@ if (spec.centerMode && spec.currentSlide >= spec.slideCount - 1) { | ||
} | ||
return canGo; | ||
}; | ||
}; // given an object and a list of keys, return new object with given keys | ||
// given an object and a list of keys, return new object with given keys | ||
var extractObject = exports.extractObject = function extractObject(spec, keys) { | ||
exports.canGoNext = canGoNext; | ||
var extractObject = function extractObject(spec, keys) { | ||
var newObject = {}; | ||
@@ -114,16 +148,22 @@ keys.forEach(function (key) { | ||
return newObject; | ||
}; | ||
}; // get initialized state | ||
// get initialized state | ||
var initializedState = exports.initializedState = function initializedState(spec) { | ||
exports.extractObject = extractObject; | ||
var initializedState = function initializedState(spec) { | ||
// spec also contains listRef, trackRef | ||
var slideCount = _react2.default.Children.count(spec.children); | ||
var listWidth = Math.ceil(getWidth(_reactDom2.default.findDOMNode(spec.listRef))); | ||
var trackWidth = Math.ceil(getWidth(_reactDom2.default.findDOMNode(spec.trackRef))); | ||
var slideWidth = void 0; | ||
var slideCount = _react.default.Children.count(spec.children); | ||
var listWidth = Math.ceil(getWidth(_reactDom.default.findDOMNode(spec.listRef))); | ||
var trackWidth = Math.ceil(getWidth(_reactDom.default.findDOMNode(spec.trackRef))); | ||
var slideWidth; | ||
if (!spec.vertical) { | ||
var centerPaddingAdj = spec.centerMode && parseInt(spec.centerPadding) * 2; | ||
if (typeof spec.centerPadding === "string" && spec.centerPadding.slice(-1) === "%") { | ||
centerPaddingAdj *= listWidth / 100; | ||
} | ||
slideWidth = Math.ceil((listWidth - centerPaddingAdj) / spec.slidesToShow); | ||
@@ -133,12 +173,17 @@ } else { | ||
} | ||
var slideHeight = _reactDom2.default.findDOMNode(spec.listRef) && getHeight(_reactDom2.default.findDOMNode(spec.listRef).querySelector('[data-index="0"]')); | ||
var slideHeight = _reactDom.default.findDOMNode(spec.listRef) && getHeight(_reactDom.default.findDOMNode(spec.listRef).querySelector('[data-index="0"]')); | ||
var listHeight = slideHeight * spec.slidesToShow; | ||
var currentSlide = spec.currentSlide === undefined ? spec.initialSlide : spec.currentSlide; | ||
if (spec.rtl && spec.currentSlide === undefined) { | ||
currentSlide = slideCount - 1 - spec.initialSlide; | ||
} | ||
var lazyLoadedList = spec.lazyLoadedList || []; | ||
var slidesToLoad = getOnDemandLazySlides({ currentSlide: currentSlide, lazyLoadedList: lazyLoadedList }, spec); | ||
var slidesToLoad = getOnDemandLazySlides({ | ||
currentSlide: currentSlide, | ||
lazyLoadedList: lazyLoadedList | ||
}, spec); | ||
lazyLoadedList.concat(slidesToLoad); | ||
var state = { | ||
@@ -162,3 +207,5 @@ slideCount: slideCount, | ||
var slideHandler = exports.slideHandler = function slideHandler(spec) { | ||
exports.initializedState = initializedState; | ||
var slideHandler = function slideHandler(spec) { | ||
var waitForAnimate = spec.waitForAnimate, | ||
@@ -177,12 +224,13 @@ animating = spec.animating, | ||
useCSS = spec.useCSS; | ||
if (waitForAnimate && animating) return {}; | ||
var animationSlide = index, | ||
finalSlide = void 0, | ||
animationLeft = void 0, | ||
finalLeft = void 0; | ||
finalSlide, | ||
animationLeft, | ||
finalLeft; | ||
var state = {}, | ||
nextState = {}; | ||
if (fade) { | ||
if (!infinite && (index < 0 || index >= slideCount)) return {}; | ||
if (index < 0) { | ||
@@ -193,5 +241,7 @@ animationSlide = index + slideCount; | ||
} | ||
if (lazyLoad && lazyLoadedList.indexOf(animationSlide) < 0) { | ||
lazyLoadedList.push(animationSlide); | ||
} | ||
state = { | ||
@@ -202,5 +252,8 @@ animating: true, | ||
}; | ||
nextState = { animating: false }; | ||
nextState = { | ||
animating: false | ||
}; | ||
} else { | ||
finalSlide = animationSlide; | ||
if (animationSlide < 0) { | ||
@@ -218,4 +271,10 @@ finalSlide = animationSlide + slideCount; | ||
} | ||
animationLeft = getTrackLeft(_extends({}, spec, { slideIndex: animationSlide })); | ||
finalLeft = getTrackLeft(_extends({}, spec, { slideIndex: finalSlide })); | ||
animationLeft = getTrackLeft(_objectSpread({}, spec, { | ||
slideIndex: animationSlide | ||
})); | ||
finalLeft = getTrackLeft(_objectSpread({}, spec, { | ||
slideIndex: finalSlide | ||
})); | ||
if (!infinite) { | ||
@@ -225,7 +284,13 @@ if (animationLeft === finalLeft) animationSlide = finalSlide; | ||
} | ||
lazyLoad && lazyLoadedList.concat(getOnDemandLazySlides(_extends({}, spec, { currentSlide: animationSlide }))); | ||
lazyLoad && lazyLoadedList.concat(getOnDemandLazySlides(_objectSpread({}, spec, { | ||
currentSlide: animationSlide | ||
}))); | ||
if (!useCSS) { | ||
state = { | ||
currentSlide: finalSlide, | ||
trackStyle: getTrackCSS(_extends({}, spec, { left: finalLeft })), | ||
trackStyle: getTrackCSS(_objectSpread({}, spec, { | ||
left: finalLeft | ||
})), | ||
lazyLoadedList: lazyLoadedList | ||
@@ -237,3 +302,5 @@ }; | ||
currentSlide: finalSlide, | ||
trackStyle: getTrackAnimateCSS(_extends({}, spec, { left: animationLeft })), | ||
trackStyle: getTrackAnimateCSS(_objectSpread({}, spec, { | ||
left: animationLeft | ||
})), | ||
lazyLoadedList: lazyLoadedList | ||
@@ -244,3 +311,5 @@ }; | ||
currentSlide: finalSlide, | ||
trackStyle: getTrackCSS(_extends({}, spec, { left: finalLeft })), | ||
trackStyle: getTrackCSS(_objectSpread({}, spec, { | ||
left: finalLeft | ||
})), | ||
swipeLeft: null | ||
@@ -250,6 +319,12 @@ }; | ||
} | ||
return { state: state, nextState: nextState }; | ||
return { | ||
state: state, | ||
nextState: nextState | ||
}; | ||
}; | ||
var changeSlide = exports.changeSlide = function changeSlide(spec, options) { | ||
exports.slideHandler = slideHandler; | ||
var changeSlide = function changeSlide(spec, options) { | ||
var indexOffset, previousInt, slideOffset, unevenOffset, targetSlide; | ||
@@ -262,3 +337,2 @@ var slidesToScroll = spec.slidesToScroll, | ||
infinite = spec.infinite; | ||
unevenOffset = slideCount % slidesToScroll !== 0; | ||
@@ -270,2 +344,3 @@ indexOffset = unevenOffset ? 0 : (slideCount - currentSlide) % slidesToScroll; | ||
targetSlide = currentSlide - slideOffset; | ||
if (lazyLoad && !infinite) { | ||
@@ -278,2 +353,3 @@ previousInt = currentSlide - slideOffset; | ||
targetSlide = currentSlide + slideOffset; | ||
if (lazyLoad && !infinite) { | ||
@@ -285,2 +361,3 @@ targetSlide = (currentSlide + slidesToScroll) % slideCount + indexOffset; | ||
targetSlide = options.index * options.slidesToScroll; | ||
if (targetSlide === options.currentSlide) { | ||
@@ -292,7 +369,12 @@ return null; | ||
targetSlide = options.index; | ||
if (targetSlide === options.currentSlide) { | ||
return null; | ||
} | ||
if (infinite) { | ||
var direction = siblingDirection(_extends({}, spec, { targetSlide: targetSlide })); | ||
var direction = siblingDirection(_objectSpread({}, spec, { | ||
targetSlide: targetSlide | ||
})); | ||
if (targetSlide > options.currentSlide && direction === "left") { | ||
@@ -306,2 +388,3 @@ targetSlide = targetSlide - slideCount; | ||
targetSlide = Number(options.index); | ||
if (targetSlide === options.currentSlide) { | ||
@@ -311,5 +394,9 @@ return null; | ||
} | ||
return targetSlide; | ||
}; | ||
var keyHandler = exports.keyHandler = function keyHandler(e, accessibility, rtl) { | ||
exports.changeSlide = changeSlide; | ||
var keyHandler = function keyHandler(e, accessibility, rtl) { | ||
if (e.target.tagName.match("TEXTAREA|INPUT|SELECT") || !accessibility) return ""; | ||
@@ -321,3 +408,5 @@ if (e.keyCode === 37) return rtl ? "next" : "previous"; | ||
var swipeStart = exports.swipeStart = function swipeStart(e, swipe, draggable) { | ||
exports.keyHandler = keyHandler; | ||
var swipeStart = function swipeStart(e, swipe, draggable) { | ||
e.target.tagName === "IMG" && e.preventDefault(); | ||
@@ -335,3 +424,6 @@ if (!swipe || !draggable && e.type.indexOf("mouse") !== -1) return ""; | ||
}; | ||
var swipeMove = exports.swipeMove = function swipeMove(e, spec) { | ||
exports.swipeStart = swipeStart; | ||
var swipeMove = function swipeMove(e, spec) { | ||
// spec also contains, trackRef and slideIndex | ||
@@ -357,7 +449,6 @@ var scrolling = spec.scrolling, | ||
listWidth = spec.listWidth; | ||
if (scrolling) return; | ||
if (animating) return e.preventDefault(); | ||
if (vertical && swipeToSlide && verticalSwiping) e.preventDefault(); | ||
var swipeLeft = void 0, | ||
var swipeLeft, | ||
state = {}; | ||
@@ -369,15 +460,20 @@ var curLeft = getTrackLeft(spec); | ||
var verticalSwipeLength = Math.round(Math.sqrt(Math.pow(touchObject.curY - touchObject.startY, 2))); | ||
if (!verticalSwiping && !swiping && verticalSwipeLength > 10) { | ||
return { scrolling: true }; | ||
return { | ||
scrolling: true | ||
}; | ||
} | ||
if (verticalSwiping) touchObject.swipeLength = verticalSwipeLength; | ||
var positionOffset = (!rtl ? 1 : -1) * (touchObject.curX > touchObject.startX ? 1 : -1); | ||
if (verticalSwiping) positionOffset = touchObject.curY > touchObject.startY ? 1 : -1; | ||
var dotCount = Math.ceil(slideCount / slidesToScroll); | ||
var swipeDirection = getSwipeDirection(spec.touchObject, verticalSwiping); | ||
var touchSwipeLength = touchObject.swipeLength; | ||
if (!infinite) { | ||
if (currentSlide === 0 && swipeDirection === "right" || currentSlide + 1 >= dotCount && swipeDirection === "left" || !canGoNext(spec) && swipeDirection === "left") { | ||
touchSwipeLength = touchObject.swipeLength * edgeFriction; | ||
if (edgeDragged === false && onEdge) { | ||
@@ -389,2 +485,3 @@ onEdge(swipeDirection); | ||
} | ||
if (!swiped && swipeEvent) { | ||
@@ -394,2 +491,3 @@ swipeEvent(swipeDirection); | ||
} | ||
if (!vertical) { | ||
@@ -404,13 +502,19 @@ if (!rtl) { | ||
} | ||
if (verticalSwiping) { | ||
swipeLeft = curLeft + touchSwipeLength * positionOffset; | ||
} | ||
state = _extends({}, state, { | ||
state = _objectSpread({}, state, { | ||
touchObject: touchObject, | ||
swipeLeft: swipeLeft, | ||
trackStyle: getTrackCSS(_extends({}, spec, { left: swipeLeft })) | ||
trackStyle: getTrackCSS(_objectSpread({}, spec, { | ||
left: swipeLeft | ||
})) | ||
}); | ||
if (Math.abs(touchObject.curX - touchObject.startX) < Math.abs(touchObject.curY - touchObject.startY) * 0.8) { | ||
return state; | ||
} | ||
if (touchObject.swipeLength > 10) { | ||
@@ -420,5 +524,9 @@ state["swiping"] = true; | ||
} | ||
return state; | ||
}; | ||
var swipeEnd = exports.swipeEnd = function swipeEnd(e, spec) { | ||
exports.swipeMove = swipeMove; | ||
var swipeEnd = function swipeEnd(e, spec) { | ||
var dragging = spec.dragging, | ||
@@ -440,5 +548,6 @@ swipe = spec.swipe, | ||
} | ||
var minSwipe = verticalSwiping ? listHeight / touchThreshold : listWidth / touchThreshold; | ||
var swipeDirection = getSwipeDirection(touchObject, verticalSwiping); | ||
// reset the state of touch related state variables. | ||
var swipeDirection = getSwipeDirection(touchObject, verticalSwiping); // reset the state of touch related state variables. | ||
var state = { | ||
@@ -453,15 +562,20 @@ dragging: false, | ||
}; | ||
if (scrolling) { | ||
return state; | ||
} | ||
if (!touchObject.swipeLength) { | ||
return state; | ||
} | ||
if (touchObject.swipeLength > minSwipe) { | ||
e.preventDefault(); | ||
if (onSwipe) { | ||
onSwipe(swipeDirection); | ||
} | ||
var slideCount = void 0, | ||
newSlide = void 0; | ||
var slideCount, newSlide; | ||
switch (swipeDirection) { | ||
@@ -474,2 +588,3 @@ case "left": | ||
break; | ||
case "right": | ||
@@ -481,5 +596,7 @@ case "down": | ||
break; | ||
default: | ||
slideCount = currentSlide; | ||
} | ||
state["triggerSlideHandler"] = slideCount; | ||
@@ -489,7 +606,13 @@ } else { | ||
var currentLeft = getTrackLeft(spec); | ||
state["trackStyle"] = getTrackAnimateCSS(_extends({}, spec, { left: currentLeft })); | ||
state["trackStyle"] = getTrackAnimateCSS(_objectSpread({}, spec, { | ||
left: currentLeft | ||
})); | ||
} | ||
return state; | ||
}; | ||
var getNavigableIndexes = exports.getNavigableIndexes = function getNavigableIndexes(spec) { | ||
exports.swipeEnd = swipeEnd; | ||
var getNavigableIndexes = function getNavigableIndexes(spec) { | ||
var max = spec.infinite ? spec.slideCount * 2 : spec.slideCount; | ||
@@ -499,2 +622,3 @@ var breakpoint = spec.infinite ? spec.slidesToShow * -1 : 0; | ||
var indexes = []; | ||
while (breakpoint < max) { | ||
@@ -505,7 +629,12 @@ indexes.push(breakpoint); | ||
} | ||
return indexes; | ||
}; | ||
var checkNavigable = exports.checkNavigable = function checkNavigable(spec, index) { | ||
exports.getNavigableIndexes = getNavigableIndexes; | ||
var checkNavigable = function checkNavigable(spec, index) { | ||
var navigables = getNavigableIndexes(spec); | ||
var prevNavigable = 0; | ||
if (index > navigables[navigables.length - 1]) { | ||
@@ -519,12 +648,20 @@ index = navigables[navigables.length - 1]; | ||
} | ||
prevNavigable = navigables[n]; | ||
} | ||
} | ||
return index; | ||
}; | ||
var getSlideCount = exports.getSlideCount = function getSlideCount(spec) { | ||
exports.checkNavigable = checkNavigable; | ||
var getSlideCount = function getSlideCount(spec) { | ||
var centerOffset = spec.centerMode ? spec.slideWidth * Math.floor(spec.slidesToShow / 2) : 0; | ||
if (spec.swipeToSlide) { | ||
var swipedSlide = void 0; | ||
var slickList = _reactDom2.default.findDOMNode(spec.listRef); | ||
var swipedSlide; | ||
var slickList = _reactDom.default.findDOMNode(spec.listRef); | ||
var slides = slickList.querySelectorAll(".slick-slide"); | ||
@@ -550,2 +687,3 @@ Array.from(slides).every(function (slide) { | ||
} | ||
var currentIndex = spec.rtl === true ? spec.slideCount - spec.currentSlide : spec.currentSlide; | ||
@@ -559,3 +697,5 @@ var slidesTraversed = Math.abs(swipedSlide.dataset.index - currentIndex) || 1; | ||
var checkSpecKeys = exports.checkSpecKeys = function checkSpecKeys(spec, keysArray) { | ||
exports.getSlideCount = getSlideCount; | ||
var checkSpecKeys = function checkSpecKeys(spec, keysArray) { | ||
return keysArray.reduce(function (value, key) { | ||
@@ -566,7 +706,9 @@ return value && spec.hasOwnProperty(key); | ||
var getTrackCSS = exports.getTrackCSS = function getTrackCSS(spec) { | ||
exports.checkSpecKeys = checkSpecKeys; | ||
var getTrackCSS = function getTrackCSS(spec) { | ||
checkSpecKeys(spec, ["left", "variableWidth", "slideCount", "slidesToShow", "slideWidth"]); | ||
var trackWidth = void 0, | ||
trackHeight = void 0; | ||
var trackWidth, trackHeight; | ||
var trackChildren = spec.slideCount + 2 * spec.slidesToShow; | ||
if (!spec.vertical) { | ||
@@ -577,2 +719,3 @@ trackWidth = getTotalSlides(spec) * spec.slideWidth; | ||
} | ||
var style = { | ||
@@ -583,2 +726,3 @@ opacity: 1, | ||
}; | ||
if (spec.useTransform) { | ||
@@ -588,3 +732,3 @@ var WebkitTransform = !spec.vertical ? "translate3d(" + spec.left + "px, 0px, 0px)" : "translate3d(0px, " + spec.left + "px, 0px)"; | ||
var msTransform = !spec.vertical ? "translateX(" + spec.left + "px)" : "translateY(" + spec.left + "px)"; | ||
style = _extends({}, style, { | ||
style = _objectSpread({}, style, { | ||
WebkitTransform: WebkitTransform, | ||
@@ -601,7 +745,9 @@ transform: transform, | ||
} | ||
if (spec.fade) style = { opacity: 1 }; | ||
if (spec.fade) style = { | ||
opacity: 1 | ||
}; | ||
if (trackWidth) style.width = trackWidth; | ||
if (trackHeight) style.height = trackHeight; | ||
if (trackHeight) style.height = trackHeight; // Fallback for IE8 | ||
// Fallback for IE8 | ||
if (window && !window.addEventListener && window.attachEvent) { | ||
@@ -617,6 +763,9 @@ if (!spec.vertical) { | ||
}; | ||
var getTrackAnimateCSS = exports.getTrackAnimateCSS = function getTrackAnimateCSS(spec) { | ||
exports.getTrackCSS = getTrackCSS; | ||
var getTrackAnimateCSS = function getTrackAnimateCSS(spec) { | ||
checkSpecKeys(spec, ["left", "variableWidth", "slideCount", "slidesToShow", "slideWidth", "speed", "cssEase"]); | ||
var style = getTrackCSS(spec); | ||
// useCSS is true by default so it can be undefined | ||
var style = getTrackCSS(spec); // useCSS is true by default so it can be undefined | ||
if (spec.useTransform) { | ||
@@ -632,5 +781,9 @@ style.WebkitTransition = "-webkit-transform " + spec.speed + "ms " + spec.cssEase; | ||
} | ||
return style; | ||
}; | ||
var getTrackLeft = exports.getTrackLeft = function getTrackLeft(spec) { | ||
exports.getTrackAnimateCSS = getTrackAnimateCSS; | ||
var getTrackLeft = function getTrackLeft(spec) { | ||
if (spec.unslick) { | ||
@@ -641,3 +794,2 @@ return 0; | ||
checkSpecKeys(spec, ["slideIndex", "trackRef", "infinite", "centerMode", "slideCount", "slidesToShow", "slidesToScroll", "slideWidth", "listWidth", "variableWidth", "slideHeight"]); | ||
var slideIndex = spec.slideIndex, | ||
@@ -656,4 +808,2 @@ trackRef = spec.trackRef, | ||
vertical = spec.vertical; | ||
var slideOffset = 0; | ||
@@ -669,9 +819,12 @@ var targetLeft; | ||
var slidesToOffset = 0; | ||
if (infinite) { | ||
slidesToOffset = -getPreClones(spec); // bring active slide to the beginning of visual area | ||
// if next scroll doesn't have enough children, just reach till the end of original slides instead of shifting slidesToScroll children | ||
if (slideCount % slidesToScroll !== 0 && slideIndex + slidesToScroll > slideCount) { | ||
slidesToOffset = -(slideIndex > slideCount ? slidesToShow - (slideIndex - slideCount) : slideCount % slidesToScroll); | ||
} | ||
// shift current slide to center of the frame | ||
} // shift current slide to center of the frame | ||
if (centerMode) { | ||
@@ -684,2 +837,3 @@ slidesToOffset += parseInt(slidesToShow / 2); | ||
} | ||
if (centerMode) { | ||
@@ -689,2 +843,3 @@ slidesToOffset = parseInt(slidesToShow / 2); | ||
} | ||
slideOffset = slidesToOffset * slideWidth; | ||
@@ -701,6 +856,9 @@ verticalOffset = slidesToOffset * slideHeight; | ||
var targetSlideIndex; | ||
var trackElem = _reactDom2.default.findDOMNode(trackRef); | ||
var trackElem = _reactDom.default.findDOMNode(trackRef); | ||
targetSlideIndex = slideIndex + getPreClones(spec); | ||
targetSlide = trackElem && trackElem.childNodes[targetSlideIndex]; | ||
targetLeft = targetSlide ? targetSlide.offsetLeft * -1 : 0; | ||
if (centerMode === true) { | ||
@@ -710,5 +868,7 @@ targetSlideIndex = infinite ? slideIndex + getPreClones(spec) : slideIndex; | ||
targetLeft = 0; | ||
for (var slide = 0; slide < targetSlideIndex; slide++) { | ||
targetLeft -= trackElem && trackElem.children[slide] && trackElem.children[slide].offsetWidth; | ||
} | ||
targetLeft -= parseInt(spec.centerPadding); | ||
@@ -722,23 +882,35 @@ targetLeft += targetSlide && (listWidth - targetSlide.offsetWidth) / 2; | ||
var getPreClones = exports.getPreClones = function getPreClones(spec) { | ||
exports.getTrackLeft = getTrackLeft; | ||
var getPreClones = function getPreClones(spec) { | ||
if (spec.unslick || !spec.infinite) { | ||
return 0; | ||
} | ||
if (spec.variableWidth) { | ||
return spec.slideCount; | ||
} | ||
return spec.slidesToShow + (spec.centerMode ? 1 : 0); | ||
}; | ||
var getPostClones = exports.getPostClones = function getPostClones(spec) { | ||
exports.getPreClones = getPreClones; | ||
var getPostClones = function getPostClones(spec) { | ||
if (spec.unslick || !spec.infinite) { | ||
return 0; | ||
} | ||
return spec.slideCount; | ||
}; | ||
var getTotalSlides = exports.getTotalSlides = function getTotalSlides(spec) { | ||
exports.getPostClones = getPostClones; | ||
var getTotalSlides = function getTotalSlides(spec) { | ||
return spec.slideCount === 1 ? 1 : getPreClones(spec) + spec.slideCount + getPostClones(spec); | ||
}; | ||
var siblingDirection = exports.siblingDirection = function siblingDirection(spec) { | ||
exports.getTotalSlides = getTotalSlides; | ||
var siblingDirection = function siblingDirection(spec) { | ||
if (spec.targetSlide > spec.currentSlide) { | ||
@@ -748,2 +920,3 @@ if (spec.targetSlide > spec.currentSlide + slidesOnRight(spec)) { | ||
} | ||
return "right"; | ||
@@ -754,2 +927,3 @@ } else { | ||
} | ||
return "left"; | ||
@@ -759,3 +933,5 @@ } | ||
var slidesOnRight = exports.slidesOnRight = function slidesOnRight(_ref) { | ||
exports.siblingDirection = siblingDirection; | ||
var slidesOnRight = function slidesOnRight(_ref) { | ||
var slidesToShow = _ref.slidesToShow, | ||
@@ -773,9 +949,13 @@ centerMode = _ref.centerMode, | ||
} | ||
if (rtl) { | ||
return 0; | ||
} | ||
return slidesToShow - 1; | ||
}; | ||
var slidesOnLeft = exports.slidesOnLeft = function slidesOnLeft(_ref2) { | ||
exports.slidesOnRight = slidesOnRight; | ||
var slidesOnLeft = function slidesOnLeft(_ref2) { | ||
var slidesToShow = _ref2.slidesToShow, | ||
@@ -793,10 +973,16 @@ centerMode = _ref2.centerMode, | ||
} | ||
if (rtl) { | ||
return slidesToShow - 1; | ||
} | ||
return 0; | ||
}; | ||
var canUseDOM = exports.canUseDOM = function canUseDOM() { | ||
exports.slidesOnLeft = slidesOnLeft; | ||
var canUseDOM = function canUseDOM() { | ||
return !!(typeof window !== "undefined" && window.document && window.document.createElement); | ||
}; | ||
}; | ||
exports.canUseDOM = canUseDOM; |
{ | ||
"name": "react-slick", | ||
"version": "0.23.2", | ||
"version": "0.24.0", | ||
"description": " React port of slick carousel", | ||
@@ -14,3 +14,3 @@ "main": "./lib", | ||
"prepublish": "babel ./src --out-dir ./lib && gulp dist", | ||
"test": "eslint src && jest", | ||
"test": "npm run lint && jest", | ||
"test:watch": "jest --watch", | ||
@@ -36,14 +36,14 @@ "lint": "eslint src", | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0", | ||
"@babel/core": "^7.1.2", | ||
"@babel/plugin-proposal-class-properties": "^7.1.0", | ||
"@babel/polyfill": "^7.0.0", | ||
"@babel/preset-env": "^7.1.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"autoprefixer": "^7.1.2", | ||
"babel-cli": "^6.16.0", | ||
"babel-core": "^6.16.0", | ||
"babel-eslint": "^7.0.0", | ||
"babel-jest": "^19.0.0", | ||
"babel-loader": "^6.2.5", | ||
"babel-plugin-transform-class-properties": "^6.24.1", | ||
"babel-plugin-transform-object-assign": "^6.8.0", | ||
"babel-polyfill": "^6.16.0", | ||
"babel-core": "^7.0.0-bridge.0", | ||
"babel-eslint": "^9.0.0", | ||
"babel-jest": "^23.4.2", | ||
"babel-loader": "^8.0.4", | ||
"babel-preset-airbnb": "^2.1.1", | ||
"babel-preset-es2015": "^6.16.0", | ||
"babel-preset-react": "^6.16.0", | ||
"css-loader": "^0.28.0", | ||
@@ -55,3 +55,3 @@ "deepmerge": "^1.1.0", | ||
"es5-shim": "^4.5.9", | ||
"eslint": "^3.6.1", | ||
"eslint": "^5.9.0", | ||
"eslint-plugin-import": "^2.9.0", | ||
@@ -65,3 +65,3 @@ "eslint-plugin-react": "^6.3.0", | ||
"jasmine-core": "^2.5.2", | ||
"jest": "^19.0.2", | ||
"jest": "^23.6.0", | ||
"jquery": "^3.2.1", | ||
@@ -74,2 +74,3 @@ "js-beautify": "^1.7.5", | ||
"postcss-loader": "^1.3.3", | ||
"prettier": "^1.14.3", | ||
"raf": "^3.4.0", | ||
@@ -84,4 +85,6 @@ "react": "^16.0.0", | ||
"style-loader": "^0.16.1", | ||
"webpack": "^1.13.2", | ||
"webpack-dev-server": "^1.16.1", | ||
"uglifyjs-webpack-plugin": "^2.0.1", | ||
"webpack": "^4.21.0", | ||
"webpack-cli": "^3.1.2", | ||
"webpack-dev-server": "^3.1.9", | ||
"why-did-you-update": "^0.1.1" | ||
@@ -94,3 +97,2 @@ }, | ||
"lodash.debounce": "^4.0.8", | ||
"prettier": "^1.14.3", | ||
"resize-observer-polyfill": "^1.5.0" | ||
@@ -97,0 +99,0 @@ }, |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
764131
7
21
7126
50
6
- Removedprettier@^1.14.3
- Removedprettier@1.19.1(transitive)