/* Pageable Copyright (c) 2017 Karl Saunders (http://mobius.ovh) Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. Version: 0.6.8 */ function _instanceof(a,b){return null!=b&&"undefined"!=typeof Symbol&&b[Symbol.hasInstance]?b[Symbol.hasInstance](a):a instanceof b}function _typeof(a){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(a){var b=this;do{if(b.matches(a))return b;b=b.parentElement||b.parentNode}while(null!==b&&1===b.nodeType);return null}),function(a,b){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?module.exports=b("Pageable"):"function"==typeof define&&define.amd?define([],b):a.Pageable=b("Pageable")}("undefined"==typeof global?this.window||this.global:global,function(){"use strict";var a=function(){},b=function(a,b){return a.dataset?a.dataset[b]:a.getAttribute("data-"+b)},c=function(a){return"[object Object]"===Object.prototype.toString.call(a)},d=function a(b,d){for(var e in d)if(d.hasOwnProperty(e)){var f=d[e];f&&c(f)?(b[e]=b[e]||{},a(b[e],f)):b[e]=f}return b},e=function(a,b,c){var d;return function(){if(c=c||this,!d)return a.apply(c,arguments),d=!0,setTimeout(function(){d=!1},b)}},f=function(a){this.instance=a,this.running=!1,this.config=this.instance.config.slideshow};f.prototype.start=function(){var a=this;a.running||(a.running=!0,a.instance.slideIndex=a.instance.index,a.instance.interval=setInterval(function(){a.instance.config.onBeforeStart.call(a.instance,a.instance.slideIndex),setTimeout(function(){a.instance.config.infinite&&a.instance._overScroll(!0),a.instance.index=this.config.swipeThreshold,g=this.down&&f;if(this.config.slideshow&&this.slider.start(),this.dragging&&!this.scrolling){var h=this._limitDrag(c);return this.dragging=h,g&&(this.config.infinite&&this._overScroll(0>h,h),0this.down[this.axis];g&&(this.config.infinite&&this._overScroll(i),i?d():j&&e()),this.startIndex===this.index?this.config.onFinish.call(this,this._getData()):this._scrollBy(this._getScrollAmount(this.oldIndex)),this.down=!1}},g.prototype._wheel=function(a){if(a.preventDefault(),this.events.wheel&&!this.scrolling){var b=this.index,c=this.index,d=0c.config.animation){cancelAnimationFrame(c.frame),c.container.style.transform="",c.frame=!1,c.scrolling=!1,c.dragging=!1,c.config.slideshow&&c.slider.start(),c.config.infinite&&(b===c.pageCount?c.index=0:-1===b&&(c.index=c.lastIndex));var i=c._getData();return window.location.hash=c.pages[c.index].id,c.pages.forEach(function(a,b){b===c.index?a.classList.add("pg-active"):a.classList.remove("pg-active")},c),c.slideIndex=c.index,c._setPips(),c._setNavs(),c.config.onFinish.call(c,i),c.emit("scroll.end",i),!1}var j=c.dragging?c.dragging:0,k=c.config.easing(h,j,a,c.config.animation);c.container.style.transform=c.horizontal?"translate3d("+k+"px, 0, 0)":"translate3d(0, "+k+"px, 0)",c.scrollPosition=e[c.axis]-k;var i=c._getData();c.config.infinite&&(b===c.pageCount?i.scrolled=0:-1===b&&(i.scrolled=i.max)),c.config.onScroll.call(c,i),c.emit("scroll",i),c.frame=requestAnimationFrame(f)})},c.dragging?0:c.config.delay)},g.prototype._getScrollOffset=function(){return{x:this.wrapper.scrollLeft,y:this.wrapper.scrollTop}},g.prototype._getScrollAmount=function(a,c){void 0===c&&(c=this.index);var d=this.data.window[this.size[this.axis]],e=d*c;return d*a-e},g.prototype._getScrollBarWidth=function(){var a=document.body,b=document.createElement("div"),c=0;return b.style.cssText="width: 100; height: 100; overflow: scroll; position: absolute; top: -9999;",a.appendChild(b),c=b.offsetWidth-b.clientWidth,a.removeChild(b),c},g.prototype._toggleInfinite=function(a,b){if(a&&this.config.infinite)this.clones.forEach(function(a){this.container.removeChild(a)},this),this.config.infinite=!1;else if(!this.config.infinite||b){this.config.infinite=!0;var c=this.pages[0].cloneNode(!0),d=this.pages[this.lastIndex].cloneNode(!0);c.id+="-clone",d.id+="-clone",c.classList.add("pg-clone"),d.classList.add("pg-clone"),c.classList.remove("pg-active"),d.classList.remove("pg-active"),this.clones=[c,d],this.container.insertBefore(d,this.pages[0]),this.container.appendChild(c)}this.update()},g.prototype._limitDrag=function(a){var b=a[this.mouseAxis[this.axis]]-this.down[this.axis];return!this.config.infinite&&(0===this.index&&0b)&&(b/=10),b},g.prototype._setNavs=function(){this.navPrevEl&&(this.config.infinite||0