@splidejs/splide
Advanced tools
Comparing version 1.2.4 to 1.2.5
/*! | ||
* Splide.js | ||
* Version : 1.2.4 | ||
* Version : 1.2.5 | ||
* License : MIT | ||
* Copyright: 2019 Naotoshi Fujita | ||
*/!function(i){var e={};function o(t){if(e[t])return e[t].exports;var n=e[t]={i:t,l:!1,exports:{}};return i[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=i,o.c=e,o.d=function(t,n,i){o.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(n,t){if(1&t&&(n=o(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var e in n)o.d(i,e,function(t){return n[t]}.bind(null,e));return i},o.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(n,"a",n),n},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="",o(o.s=0)}([function(t,n,i){"use strict";function e(){return(e=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])}return t}).apply(this,arguments)}function v(i,e){Object.keys(i).some(function(t,n){return e(i[t],t,n)})}function s(n){return Object.keys(n).map(function(t){return n[t]})}function o(t){return"object"==typeof t}function r(t,n){var i=e({},t);return o(i)&&o(n)&&v(n,function(t,n){o(t)?(o(i[n])||(i[n]={}),i[n]=r(i[n],t)):i[n]=t}),i}i.r(n);var a="splide",l={active:"is-active",visible:"is-visible",loading:"is-loading"},u={type:"slide",rewind:!1,speed:400,width:0,height:0,fixedWidth:0,fixedHeight:0,heightRatio:0,perPage:1,perMove:0,start:0,focus:!1,gap:0,padding:0,arrows:!0,arrowPath:"",pagination:!0,autoplay:!1,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,lazyLoad:!1,preloadPages:1,easing:"cubic-bezier(.42,.65,.27,.99)",keyboard:!0,drag:!0,flickThreshold:.6,flickPower:600,flickMaxPages:1,direction:"ltr",cover:!1,accessibility:!0,isNavigation:!1,trimSpace:!0,breakpoints:!1,classes:{root:a,slider:a+"__slider",track:a+"__track",list:a+"__list",slide:a+"__slide",container:a+"__slide__container",arrows:a+"__arrows",arrow:a+"__arrow",prev:a+"__arrow--prev",next:a+"__arrow--next",pagination:a+"__pagination",page:a+"__pagination__page",clone:a+"__slide--clone",progress:a+"__progress",bar:a+"__progress__bar",autoplay:a+"__autoplay",play:a+"__play",pause:a+"__pause",spinner:a+"__spinner",sr:a+"__sr"},i18n:{prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay"}};function f(t,n){return t&&n?t.querySelector(n.split(" ")[0]):null}function d(t,n){if(t){var i=s(t.children);for(var e in i){var o=i[e];if(c(o,n.split(" ")[0]))return o}}return null}function p(t,n){var i=document.createElement(t);return v(n,function(t,n){return y(i,n,t)}),i}function h(i,t){i&&v(t,function(t,n){i.style[n]=t||""})}function g(n){if(n){for(var t=arguments.length,i=new Array(1<t?t-1:0),e=1;e<t;e++)i[e-1]=arguments[e];i.forEach(function(t){t&&n.classList.add(t)})}}function m(t,n){t&&t.classList.remove(n)}function c(t,n){return!!t&&t.classList.contains(n)}function y(t,n,i){t&&t.setAttribute(n,i)}function x(t,n){return t?t.getAttribute(n):null}function b(t,n){t&&t.removeAttribute(n)}function w(n,t,i,e){return void 0===e&&(e=!0),n?t.split(" ").map(function(t){return n.addEventListener(t,i,{passive:e}),function(){return n.removeEventListener(t,i)}}):[]}function _(o,t){var r,a;return{mount:function(){w(r=t.Elements.list,"transitionend",function(t){t.target===r&&a&&a()})},start:function(t,n,i,e){a=e,h(r,{transition:"transform "+o.options.speed+"ms "+o.options.easing,transform:"translate("+i.x+"px,"+i.y+"px)"})}}}function S(e,o){function r(t){var n=o.Slides.getSlide(t),i=e.options;n&&h(n.slide,{transition:"opacity "+i.speed+"ms "+i.easing})}return o.Options.fix({perPage:1,gap:0,padding:0}),o.Drag&&(o.Drag.required=!1),{mount:function(){r(e.index)},start:function(t,n,i,e){r(n),e()}}}var k="loop",P="fade";var E="[SPLIDE]";function C(t){console.error(E+" "+t)}function I(t,n){if(!t)throw new Error(n);return t}function M(t,n){for(var i=0;i<n.length;i++){var e=n[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function L(t){var n=x(t.root,"data-splide");if(n)try{t.options=JSON.parse(n)}catch(t){C('"data-splide" must be a valid JSON.')}return{mount:function(){t.index=t.options.start},fix:function(i){var e=r(t.options,i),o=e.breakpoints;o&&v(o,function(t,n){e.breakpoints[n]=r(o[n],i)}),t.options=e}}}function O(i){var e=i.root,o=i.classes;if(!e.id){var t=window[H]||0;window[H]=++t,e.id="splide"+(t<10?"0"+t:t)}var r={mount:function(){var t="was not found.";this.slider=d(e,o.slider),this.track=f(e,"."+o.track),I(this.track,"A track "+t),this.list=d(this.track,o.list),I(this.list,"A list "+t),this.slides=s(this.list.children),I(this.slides.length,"A slide "+t);var n=a(o.arrows);this.arrows={prev:f(n,"."+o.prev),next:f(n,"."+o.next)};var i=a(o.autoplay);this.bar=f(a(o.progress),"."+o.bar),this.play=f(i,"."+o.play),this.pause=f(i,"."+o.pause),function(){r.track.id||(r.track.id=e.id+"-track");r.list.id||(r.list.id=e.id+"-list")}()},mounted:function(){var t=o.root,n=i.options;g(e,""+t,t+"--"+n.type,t+"--"+n.direction,n.drag?t+"--draggable":"",n.isNavigation?t+"--nav":"")}};function a(t){return d(e,t)||d(r.slider,t)}return r}var W=function(){function t(t,n,i){var e=this;void 0===n&&(n={}),void 0===i&&(i={}),this.root=t instanceof HTMLElement?t:f(document,t),I(this.root,"An invalid root element or selector was given."),this.Components={},this.Event=function(){var i={};return{on:function(t,n){t.split(" ").forEach(function(t){-1<t.indexOf(".")&&i[t]||(i[t]||(i[t]=[]),i[t].push(n))})},off:function(t){t.split(" ").forEach(function(t){return delete i[t]})},emit:function(e){for(var t=arguments.length,o=new Array(1<t?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];v(i,function(t,n){if(n.split(".")[0]===e&&t)for(var i in t)t[i].apply(t,o)})}}}(),this.State=function(t){var n=t;return{set:function(t){n=t},is:function(t){return t===n}}}(1),this._options=r(u,n),this._index=0,this._components=i,this.on("move drag",function(){return e.State.set(4)}).on("moved dragged",function(){return e.State.set(3)})}var n=t.prototype;return n.mount=function(t,n){var e=this;void 0===t&&(t={}),void 0===n&&(n=null),this.Components=function(i,t,n){var e={};return v(t,function(t,n){e[n]=t(i,e,n.toLowerCase())}),n=n||i.is(P)?S:_,e.Transition=n(i,e),e}(this,r(this._components,t),n);try{v(this.Components,function(t,n){var i=t.required;void 0===i||i?t.mount&&t.mount():delete e.Components[n]})}catch(t){return C(t.message),null}return v(this.Components,function(t){t.mounted&&t.mounted()}),this.State.set(2),this.emit("mounted"),this.State.set(3),this.emit("ready"),h(this.root,{visibility:"visible"}),this},n.sync=function(t){return this.sibling=t,this},n.on=function(t,n){return this.Event.on(t,n),this},n.off=function(t){return this.Event.off(t),this},n.emit=function(t){for(var n,i=arguments.length,e=new Array(1<i?i-1:0),o=1;o<i;o++)e[o-1]=arguments[o];return(n=this.Event).emit.apply(n,[t].concat(e)),this},n.go=function(t,n){void 0===n&&(n=!0),(this.State.is(3)||this.State.is(4)&&!n)&&this.Components.Controller.go(t,!1)},n.is=function(t){return t===this._options.type},function(t,n,i){n&&M(t.prototype,n),i&&M(t,i)}(t,[{key:"index",get:function(){return this._index},set:function(t){this._index=parseInt(t)}},{key:"length",get:function(){return this.Components.Slides.length}},{key:"options",get:function(){return this._options},set:function(t){this._options=r(this._options,t),this.State.is(1)||this.emit("updated",this._options)}},{key:"classes",get:function(){return this._options.classes}},{key:"i18n",get:function(){return this._options.i18n}}]),t}(),H="splideUid";function T(t,n,i){return Math.min(Math.max(t,i<n?i:n),i<n?n:i)}function A(t){for(var n=arguments.length,i=new Array(1<n?n-1:0),e=1;e<n;e++)i[e-1]=arguments[e];var o=0;return t.replace(/%s/g,function(){return i[o++]})}function j(t){var n=typeof t;return"string"==n?t:"number"==n&&0<t?parseFloat(t)+"px":""}function q(t,n){if("number"==typeof n)return n;var i=p("div",{});h(i,{position:"absolute",width:n}),t.appendChild(i);var e=i.clientWidth;return t.removeChild(i),e}function z(r,e){var o,n={mount:function(){o=r.options,r.on("move",function(t){r.index=t}).on("updated",function(t){o=t,r.index=n.rewind(n.trim(r.index))})},go:function(t,n){var i=this.trim(this.parse(t));e.Track.go(i,this.rewind(i),n)},parse:function(t){var n=r.index,i=String(t).match(/([+\-<>])(\d+)?/),e=i&&i[1]||"",o=i?parseInt(i[2]):0;switch(e){case"+":n+=o||1;break;case"-":n-=o||1;break;case">":n=this.pageToIndex(-1<o?o:this.indexToPage(n)+1);break;case"<":n=this.pageToIndex(-1<o?o:this.indexToPage(n)-1);break;default:n=parseInt(t)}return n},pageToIndex:function(t){if(a())return t;var n=r.length,i=o.perPage,e=t*i;return n-i<=(e-=(this.pageLength*i-n)*N(e/n))&&e<n&&(e=n-i),e},indexToPage:function(t){if(a())return t;var n=r.length,i=o.perPage;return N(n-i<=t&&t<n?(n-1)/i:t/i)},trim:function(t){return r.is(k)||(t=o.rewind?this.rewind(t):T(t,0,this.edgeIndex)),t},rewind:function(t){var n=this.edgeIndex;if(r.is(k)){for(;n<t;)t-=n+1;for(;t<0;)t+=n+1}else n<t?t=0:t<0&&(t=n);return t},isRtl:function(){return"rtl"===o.direction},get pageLength(){var t=r.length;return a()?t:Math.ceil(t/o.perPage)},get edgeIndex(){var t=r.length;return a()||o.isNavigation||r.is(k)?t-1:t-o.perPage},get prevIndex(){var t=r.index-1;return(r.is(k)||o.rewind)&&(t=this.rewind(t)),-1<t?t:-1},get nextIndex(){var t=r.index+1;return(r.is(k)||o.rewind)&&(t=this.rewind(t)),r.index<t&&t<=this.edgeIndex||0===t?t:-1}};function a(){return!1!==r.options.focus}return n}var N=Math.floor;function R(o,r){var i=[],a=[];return{mount:function(){for(var t in i=r.Elements.slides)this.register(parseInt(t),-1,i[t])},register:function(t,n,i){var e=function(u,t,o,d){return{slide:o,index:u,realIndex:t,container:f(o,"."+d.classes.container),isClone:-1<t,init:function(){var t=this;if(!o.id&&!this.isClone){var n=u+1;o.id=d.root.id+"-slide"+(n<10?"0"+n:n)}d.on("mounted moved updated",function(){t.update(t.isActive(),!1),t.update(t.isVisible(),!0)}).on("resize",function(){t.update(t.isVisible(),!0)})},update:function(t,n){var i=n?"visible":"active",e=l[i];t?(g(o,e),d.emit(i,this)):c(o,e)&&(m(o,e),d.emit(n?"hidden":"inactive",this))},isActive:function(){return d.index===u},isVisible:function(){var t=d.options,n=t.focus,i=t.trimSpace,e=d.index,o=d.length,r="center"===n,a=d.Components.Layout.numInView,s=r?a/2:parseInt(n)||0;if(i){if(e<s)return u<a;if(o-(a-s)<=e)return o-a<=u}return e-s+(r&&a%2==0?1:0)<=u&&u<e+a-s},isWithin:function(t,n){var i=Math.abs(t-u);return d.is("slide")||this.isClone||(i=Math.min(i,d.length-i)),i<n}}}(t,n,i,o);e.init(),a.push(e)},getSlide:function(n){return a.filter(function(t){return t.index===n})[0]},getSlides:function(t,n){return n?t?a:a.filter(function(t){return!t.isClone}):t?a.map(function(t){return t.slide}):i},getSlidesByPage:function(t){var i=r.Controller.pageToIndex(t),n=o.options,e=!1!==n.focus?1:n.perPage;return a.filter(function(t){var n=t.index;return i<=n&&n<i+e})},get length(){return i.length},get total(){return a.length}}}function B(a,s){var o,n,u=0,i="ttb"===a.options.direction;return{mount:function(){o=s.Elements.list,n=i?function(r,a){var s=a.Layout;return{translate:function(t,n){h(t,{transform:"translateY("+n+"px)"})},toPosition:function(t){return-(t*(s.slideHeight+s.gap)+this.offset)},toIndex:function(t){return Math.round(-(t+this.offset)/(s.slideHeight+s.gap))},trim:function(t){return T(t,-(s.listHeight-(s.height+s.gap)),0)},get offset(){var t,n=s.height,i=s.slideHeight,e=s.gap,o=r.options.focus;return t="center"===o?(n-i)/2:(parseInt(o)||0)*(i+e),(i+e)*a.Clones.length/2-t}}}(a,s):function(r,a){var s=a.Layout;return{translate:function(t,n){h(t,{transform:"translateX("+n+"px)"})},toPosition:function(t){return this.sign*(t*(s.slideWidth+s.gap)+this.offset)},toIndex:function(t){return Math.round((this.sign*t-this.offset)/(s.slideWidth+s.gap))},trim:function(t){return T(t,this.sign*(s.listWidth-(s.width+s.gap)),0)},get sign(){return a.Controller.isRtl()?1:-1},get offset(){var t,n=s.width,i=s.slideWidth,e=s.gap,o=r.options.focus;return t="center"===o?(n-i)/2:(parseInt(o)||0)*(i+e),(i+e)*a.Clones.length/2-t}}}(a,s)},mounted:function(){var t=this;a.is(P)||a.on("mounted resize updated",function(){t.jump(a.index)})},go:function(t,n,i){var e=this,o=this.trim(this.toPosition(t)),r=a.index;i||a.emit("move",n,r,t),1<=Math.abs(o-u)||a.is(P)?s.Transition.start(t,n,this.toCoord(o),function(){e.end(t,n,r,i)}):this.end(t,n,r,i)},end:function(t,n,i,e){h(o,{transition:""}),a.is(P)||this.jump(n),e||a.emit("moved",n,i,t)},jump:function(t){var n=this.trim(this.toPosition(t));this.translate(n)},translate:function(t){u=t,n.translate(o,t)},toPosition:function(t){return n.toPosition(t)},toIndex:function(t){return n.toIndex(t)},trim:function(t){return!a.options.trimSpace||a.is(k)?t:n.trim(t)},toCoord:function(t){return{x:i?0:t,y:i?t:0}},get position(){return u},get offset(){return n.offset}}}function D(c,l){var f=[];function p(t){var n=t.cloneNode(!0);return g(n,c.classes.clone),b(n,"id"),n}return{mount:function(){c.is(k)&&function(){var e=l.Slides,o=l.Elements.list,t=c.options,n=t.perPage,i=t.drag,r=t.flickMaxPages,a=void 0===r?1:r,s=e.length,u=n*(i?a+1:1)+(s<n?n:0),d=e.getSlides(!1,!1);for(;d.length<u;)d=d.concat(d);d.slice(0,u).forEach(function(t,n){var i=p(t);o.appendChild(i),f.push(i),e.register(n+s,n,i)}),d.slice(-u).forEach(function(t,n){var i=p(t);o.insertBefore(i,d[0]),f.push(i),e.register(n-u,n,i)})}()},get clones(){return f},get length(){return f.length}}}function V(e,a){var s,u,d,o=e.root,r="ttb"===e.options.direction,t=a.Elements,c={mount:function(){s=t.list,u=a.Slides.getSlides(!0,!0),function(){var t=function(t,n){var i=null;return function(){i=i||setTimeout(function(){t(),i=null},n)}}(function(){e.emit("resize")},50);w(window,"resize",t),e.on("mounted resize",l).on("updated",n)}(),n()},get width(){return d.width},get height(){return d.height},get listWidth(){return d.listWidth},get listHeight(){return d.listHeight},get slideWidth(){return d.slideWidth},get slideHeight(){return d.slideHeight},get gap(){return d.gap},get padding(){return d.padding},get numInView(){return d.numInView}};function n(){var t=e.options;for(var n in(d=r?function(n,t,i){var e,o,r,a,s,u=t.Elements,d=n.root,c=u.track;return{marginProp:"marginBottom",gap:q(d,i.gap),padding:(e=i.padding,o=e.top,r=void 0===o?e:o,a=e.bottom,s=void 0===a?e:a,{top:q(d,r),bottom:q(d,s)}),init:function(){h(c,{paddingTop:j(this.padding.top),paddingBottom:j(this.padding.bottom)})},get width(){return c.clientWidth},get height(){var t=i.height||this.width*i.heightRatio;return I(t,'"height" or "heightRatio" is missing.'),q(n.root,t)-this.padding.top-this.padding.bottom},get listWidth(){return this.width},get listHeight(){return(this.slideHeight+this.gap)*t.Slides.total},get slideWidth(){return q(n.root,i.fixedWidth||this.width)},get slideHeight(){var t=i.fixedHeight||(this.height+this.gap)/i.perPage-this.gap;return q(n.root,t)},get numInView(){return i.fixedHeight?Math.floor((this.height+this.gap)/(this.slideHeight+this.gap))||1:i.perPage}}}(e,a,t):function(t,n,i){var e,o,r,a,s,u=n.Elements,d=t.root,c=u.track;return{marginProp:"rtl"===i.direction?"marginLeft":"marginRight",height:0,listHeight:0,gap:q(d,i.gap),padding:(e=i.padding,o=e.left,r=void 0===o?e:o,a=e.right,s=void 0===a?e:a,{left:q(d,r),right:q(d,s)}),init:function(){h(c,{paddingLeft:j(this.padding.left),paddingRight:j(this.padding.right)})},get width(){return c.clientWidth-this.padding.left-this.padding.right},get listWidth(){return(this.slideWidth+this.gap)*n.Slides.total},get slideWidth(){var t=i.fixedWidth||(this.width+this.gap)/i.perPage-this.gap;return q(d,t)},get slideHeight(){var t=i.height||i.fixedHeight||this.width*i.heightRatio;return q(d,t)},get numInView(){return i.fixedWidth?Math.floor((this.width+this.gap)/(this.slideWidth+this.gap))||1:i.perPage}}}(e,a,t)).init(),h(o,{maxWidth:j(t.width)}),u){var i;h(u[n].slide,((i={})[d.marginProp]=j(d.gap),i))}l()}function l(){h(s,{width:j(c.listWidth),height:j(c.listHeight)}),h(a.Elements.track,{height:j(c.height)});var t=j(d.slideWidth),n=j(d.slideHeight);for(var i in u){var e=u[i],o=e.slide,r=e.container;h(r,{height:n}),h(o,{width:t,height:r?"":n})}}return c}function X(u,d){var i,e,o,c=d.Track,l=d.Controller,r=!1,a="ttb"===u.options.direction,f=a?"y":"x",n={required:u.options.drag,disabled:!1,mount:function(){var t=d.Elements.list;w(t,"touchstart mousedown",s),w(t,"touchmove mousemove",p,!1),w(t,"touchend touchcancel mouseleave mouseup dragend",h),v(t.getElementsByTagName("img"),function(t){w(t,"dragstart",function(t){t.preventDefault()},!1)})}};function s(t){n.disabled||r||!u.State.is(3)||(i=c.toCoord(c.position),e=g(t,{}),o=e)}function p(t){if(e)if(o=g(t,e),r){t.cancelable&&t.preventDefault();var n=i[f]+o.offset[f];c.translate(function(t){if(!u.is(k)){var n=c.trim,i=c.toPosition,e=l.isRtl()?-1:1,o=e*n(i(0)),r=e*n(i(l.edgeIndex));o<(t*=e)?t=5*Math.log(t-o)+o:t<r&&(t=-5*Math.log(r-t)+r),t*=e}return t}(n))}else!function(t){var n=t.offset;if(u.State.is(3)){var i=180*Math.atan(Math.abs(n.y)/Math.abs(n.x))/Math.PI;return a&&(i=90-i),i<30}return!1}(o)||(u.emit("drag",e),r=!0)}function h(){e=null,r&&(u.emit("dragged",o),function(t){var n=t.velocity[f],i=Math.abs(n);if(0<i){var e=d.Layout,o=u.options,r=n<0?-1:1,a=c.position;i>o.flickThreshold&&Math.abs(t.offset[f])<150&&(a+=r*Math.min(i*o.flickPower,e.width*(o.flickMaxPages||1)));var s=c.toIndex(a);s===u.index&&(s+=l.isRtl()?r:-r),u.is(k)||(s=T(s,0,l.edgeIndex)),l.go(s,o.isNavigation)}}(o),r=!1)}function g(t,n){var i=t.timeStamp,e=t.touches,o=e?e[0]:t,r=o.clientX,a=o.clientY,s=n.to||{},u=s.x,d=void 0===u?r:u,c=s.y,l=void 0===c?a:c,f={x:r-d,y:a-l},p=i-(n.timeStamp||0);return{from:{x:d,y:l},to:{x:r,y:a},offset:f,timeStamp:i,velocity:{x:f.x/p,y:f.y/p}}}return n}function F(o,r,a){var s,i=[],u={required:o.options.autoplay,mount:function(){var t=o.options,n=r.Elements,i=n.slides,e=n.bar;i.length>t.perPage&&(s=function(n,i,e){function o(t){d||(s=(a=t-(r=r||t))/i,i<=a&&(r=0,s=1,n()),e&&e(s),u(o))}var r,a,s,u=window.requestAnimationFrame,d=!0;return{pause:function(){d=!0,r=0},play:function(){r=0,d&&(d=!1,u(o))}}}(function(){o.go(">")},t.interval,function(t){o.emit(a+":playing",t),e&&h(e,{width:100*t+"%"})}),function(){var t=o.options,n=r.Elements,i=o.sub,e=[o.root,i?i.root:null];t.pauseOnHover&&(d(e,"mouseleave",K,!0),d(e,"mouseenter",K,!1));t.pauseOnFocus&&(d(e,"focusout",Q,!0),d(e,"focusin",Q,!1));w(n.play,"click",function(){u.play(Q),u.play(Z)}),d([n.pause],"click",Z,!1),o.on("move",function(){u.play()})}(),this.play())},play:function(n){void 0===n&&(n=0),(i=i.filter(function(t){return t!==n})).length||(o.emit(a+":play"),s.play())},pause:function(t){void 0===t&&(t=0),s.pause(),-1===i.indexOf(t)&&i.push(t),1===i.length&&o.emit(a+":pause")}};function d(t,n,i,e){for(var o in t)w(t[o],n,function(){u[e?"play":"pause"](i)})}return u}function G(s,u,d){var c,o=s.classes,r=s.root;function a(t){var n=p("button",{class:o.arrow+" "+(t?o.prev:o.next)});return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg"\tviewBox="0 0 40 40"\twidth="40"\theight="40"><path d="'+(s.options.arrowPath||"m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z")+'" /></svg>',n}return{required:s.options.arrows,mount:function(){var t=u.Elements,n=s.options.arrows;if((!(c=t.arrows).prev||!c.next)&&n){c=function(){var t=p("div",{class:o.arrows}),n=a(!0),i=a(!1);return t.appendChild(n),t.appendChild(i),{wrapper:t,prev:n,next:i}}();var i=t.slider,e="slider"===n&&i?i:r;e.insertBefore(c.wrapper,e.firstChild)}c&&(function(){var t=s.options.perMove;w(c.prev,"click",function(){s.go(t?"-"+t:"<")}),w(c.next,"click",function(){s.go(t?"+"+t:">")})}(),s.on("mounted move updated",function(){var t=c,n=t.prev,i=t.next,e=u.Controller,o=e.prevIndex,r=e.nextIndex,a=1<s.length;n.disabled=o<0||!a,i.disabled=r<0||!a,s.emit(d+":updated",n,i,o,r)})),this.arrows=c},mounted:function(){s.emit(d+":mounted",c.prev,c.next)}}}function U(s,i,o){var n,r={},a={required:s.options.pagination,mount:function(){r=function(){var n=s.options,o=s.classes,r=p("ul",{class:o.pagination}),a=i.Slides,t=a.getSlides(!1,!0).filter(function(t){return!1!==n.focus||t.index%n.perPage==0}).map(function(t,n){var i=p("li",{}),e=p("button",{class:o.page});return i.appendChild(e),r.appendChild(i),w(e,"click",function(){s.go(">"+n)}),{li:i,button:e,page:n,Slides:a.getSlidesByPage(n)}});return{list:r,items:t}}();var t=i.Elements.slider;(n="slider"===s.options.pagination&&t?t:s.root).appendChild(r.list),s.on($,e).on("updated.page",function(){a.destroy(),s.options.pagination&&(a.mount(),a.mounted())})},mounted:function(){var t=s.index;s.emit(o+":mounted",r,this.getItem(t)),e(t,-1)},destroy:function(){r&&r.list&&n.removeChild(r.list),s.off($),r=null},getItem:function(t){return r.items[i.Controller.indexToPage(t)]},get data(){return r}};function e(t,n){var i=a.getItem(n),e=a.getItem(t);i&&m(i.button,l.active),e&&g(e.button,l.active),s.emit(o+":updated",r,i,e)}return a}function J(s,e){var u=s.i18n;function n(t,n){y(t,"aria-hidden",!n),y(t,"tabindex",n?0:-1)}function t(t,n){var i=e.Elements.track.id;y(t,et,i),y(n,et,i)}function i(t,n,i,e){var o=s.index,r=-1<i&&o<i?u.last:u.prev,a=-1<e&&e<o?u.first:u.next;y(t,ot,r),y(n,ot,a)}function o(t,n){n&&y(n.button,it,!0),t.items.forEach(function(t){var n=s.options,i=A(!1===n.focus&&1<n.perPage?u.pageX:u.slideX,t.page+1),e=t.button,o=[];t.Slides.forEach(function(t){o.push(t.slide.id)}),y(e,et,o.join(" ")),y(e,ot,i)})}function r(t,n,i){n&&b(n.button,it),i&&y(i.button,it,!0)}function a(r){e.Slides.getSlides(!0,!0).forEach(function(t){var n=t.slide;c(n)||y(n,"role","button");var i=-1<t.realIndex?t.realIndex:t.index,e=A(u.slideX,i+1),o=r.Components.Slides.getSlide(i);y(n,ot,e),o&&y(n,et,o.slide.id)})}function d(t,n){var i=t.slide;n?y(i,it,!0):b(i,it)}function c(t){return"button"===t.tagName.toLowerCase()}return{required:s.options.accessibility,mount:function(){s.on("visible",function(t){n(t.slide,!0)}).on("hidden",function(t){n(t.slide,!1)}).on("arrows:mounted",t).on("arrows:updated",i).on("pagination:mounted",o).on("pagination:updated",r),s.options.isNavigation&&s.on("navigation:mounted",a).on("active",function(t){d(t,!0)}).on("inactive",function(t){d(t,!1)}),function(){var i=e.Elements;[i.play,i.pause].forEach(function(t,n){t&&(c(t)||y(t,"role","button"),y(t,et,i.track.id),y(t,ot,u[0===n?"play":"pause"]))})}()}}}var Y="data-splide-href",K=1,Q=2,Z=3,$="move.page",tt="data-splide-lazy",nt={horizontal:{ArrowLeft:"<",ArrowRight:">",Left:"<",Right:">"},vertical:{ArrowUp:"<",ArrowDown:">",Up:"<",Down:">"}},it="aria-current",et="aria-controls",ot="aria-label",rt="move.sync",at=[" ","Enter","Spacebar"],st={Options:L,Elements:O,Controller:z,Slides:R,Track:B,Clones:D,Layout:V,Drag:X,Links:function(t,n){var i=[];function e(){i.forEach(function(t){return b(t,"href")})}function o(){i.forEach(function(t){return y(t,"href",x(t,Y))})}return{required:t.options.drag&&!t.is(P),mount:function(){(i=s(n.Elements.list.getElementsByTagName("a"))).forEach(function(t){y(t,Y,x(t,"href"))}),t.on("drag",e),t.on("moved",o)}}},Autoplay:F,Cover:function(t,n){var i=t.options;function e(t){var n=t.parentElement;n&&(h(n,{background:'center/cover no-repeat url("'+t.src+'")'}),h(t,{display:"none"}))}return{required:i.cover&&(i.height||i.heightRatio||i.fixedHeight),mount:function(){n.Slides.getSlides(!0,!1).forEach(function(t){var n=f(t,"img");n&&n.src&&e(n)}),t.on("lazyload:loaded",function(t){e(t)})}}},Arrows:G,Pagination:U,LazyLoad:function(o,t,r){var n=0,e=[],i=o.options.lazyLoad,a="sequential"===i;function s(n){var i=o.options;(e=e.filter(function(t){return!t.Slide.isWithin(n,i.perPage*(i.preloadPages+1))||(u(t.img,t.Slide),!1)})).length||o.off("moved."+r)}function u(t,n){g(n.slide,l.loading);var i=p("span",{class:o.classes.spinner});t.parentElement.appendChild(i),t.onload=function(){c(t,i,n,!1)},t.onerror=function(){c(t,i,n,!0)},y(t,"src",x(t,tt))}function d(){if(n<e.length){var t=e[n];u(t.img,t.Slide)}n++}function c(t,n,i,e){m(i.slide,l.loading),e||(t.parentElement.removeChild(n),h(t,{visibility:"visible"}),o.emit(r+":loaded",t)),a&&d()}return{required:i,mount:function(){t.Slides.getSlides(!0,!0).forEach(function(t){var n=f(t.slide,"["+tt+"]");n&&(e.push({img:n,Slide:t}),h(n,{visibility:"hidden"}))}),e.length&&(a?d():o.on("mounted",function(){s(o.index)}).on("moved."+r,function(t){s(t)}))}}},Keyboard:function(i){var t;return{mount:function(){var n=nt["ttb"===i.options.direction?"vertical":"horizontal"];i.on("mounted updated",function(){t&&(t[0](),t=void 0),i.options.keyboard&&(t=w(i.root,"keydown",function(t){n[t.key]&&i.go(n[t.key])}))})}}},Sync:function(e){var o=e.sibling,t=o&&o.options.isNavigation;function r(){e.on(rt,function(t,n,i){o.off(rt).go(o.is(k)?i:t,!1),a()})}function a(){o.on(rt,function(t,n,i){e.off(rt).go(e.is(k)?i:t,!1),r()})}function i(t){e.State.is(3)&&o.go(t)}return{required:!!o,mount:function(){r(),a(),t&&o.Components.Slides.getSlides(!0,!0).forEach(function(n){var t=n.slide;w(t,"mouseup touchend",function(t){t.button&&0!==t.button||i(n.index)}),w(t,"keyup",function(t){-1<at.indexOf(t.key)&&(t.preventDefault(),i(n.index))},!1)})},mounted:function(){t&&o.emit("navigation:mounted",e)}}},A11y:J,Breakpoints:function(n){var i,e,o=n.options.breakpoints,r=[];return{required:o&&matchMedia,mount:function(){r=Object.keys(o).sort(function(t,n){return parseInt(t)-parseInt(n)}).map(function(t){return{point:t,mql:matchMedia("(max-width:"+t+"px)")}}),n.on("mounted resize",function(){var t=function(){var t=r.filter(function(t){return t.mql.matches})[0];return t?t.point:-1}();t!==e&&(n.options=o[t]||i,e=t)})},mounted:function(){i=n.options}}}};i.d(n,"Splide",function(){return ut});var ut=function(i){function t(t,n){return i.call(this,t,n,st)||this}return function(t,n){t.prototype=Object.create(n.prototype),(t.prototype.constructor=t).__proto__=n}(t,i),t}(W);window.Splide=ut}]); | ||
*/!function(i){var e={};function o(t){if(e[t])return e[t].exports;var n=e[t]={i:t,l:!1,exports:{}};return i[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=i,o.c=e,o.d=function(t,n,i){o.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(n,t){if(1&t&&(n=o(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var e in n)o.d(i,e,function(t){return n[t]}.bind(null,e));return i},o.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(n,"a",n),n},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="",o(o.s=0)}([function(t,n,i){"use strict";function e(){return(e=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])}return t}).apply(this,arguments)}function v(i,e){Object.keys(i).some(function(t,n){return e(i[t],t,n)})}function s(n){return Object.keys(n).map(function(t){return n[t]})}function o(t){return"object"==typeof t}function r(t,n){var i=e({},t);return o(i)&&o(n)&&v(n,function(t,n){o(t)?(o(i[n])||(i[n]={}),i[n]=r(i[n],t)):i[n]=t}),i}i.r(n);var a="splide",l={active:"is-active",visible:"is-visible",loading:"is-loading"},u={type:"slide",rewind:!1,speed:400,width:0,height:0,fixedWidth:0,fixedHeight:0,heightRatio:0,perPage:1,perMove:0,start:0,focus:!1,gap:0,padding:0,arrows:!0,arrowPath:"",pagination:!0,autoplay:!1,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,lazyLoad:!1,preloadPages:1,easing:"cubic-bezier(.42,.65,.27,.99)",keyboard:!0,drag:!0,flickThreshold:.6,flickPower:600,flickMaxPages:1,direction:"ltr",cover:!1,accessibility:!0,isNavigation:!1,trimSpace:!0,breakpoints:!1,classes:{root:a,slider:a+"__slider",track:a+"__track",list:a+"__list",slide:a+"__slide",container:a+"__slide__container",arrows:a+"__arrows",arrow:a+"__arrow",prev:a+"__arrow--prev",next:a+"__arrow--next",pagination:a+"__pagination",page:a+"__pagination__page",clone:a+"__slide--clone",progress:a+"__progress",bar:a+"__progress__bar",autoplay:a+"__autoplay",play:a+"__play",pause:a+"__pause",spinner:a+"__spinner",sr:a+"__sr"},i18n:{prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay"}};function f(t,n){return t&&n?t.querySelector(n.split(" ")[0]):null}function d(t,n){if(t){var i=s(t.children);for(var e in i){var o=i[e];if(c(o,n.split(" ")[0]))return o}}return null}function p(t,n){var i=document.createElement(t);return v(n,function(t,n){return y(i,n,t)}),i}function h(i,t){i&&v(t,function(t,n){i.style[n]=t||""})}function g(n){if(n){for(var t=arguments.length,i=new Array(1<t?t-1:0),e=1;e<t;e++)i[e-1]=arguments[e];i.forEach(function(t){t&&n.classList.add(t)})}}function m(t,n){t&&t.classList.remove(n)}function c(t,n){return!!t&&t.classList.contains(n)}function y(t,n,i){t&&t.setAttribute(n,i)}function x(t,n){return t?t.getAttribute(n):null}function b(t,n){t&&t.removeAttribute(n)}function w(n,t,i,e){return void 0===e&&(e={}),n?t.split(" ").map(function(t){return n.addEventListener(t,i,e),function(){return n.removeEventListener(t,i)}}):[]}function _(o,t){var r,a;return{mount:function(){w(r=t.Elements.list,"transitionend",function(t){t.target===r&&a&&a()})},start:function(t,n,i,e){a=e,h(r,{transition:"transform "+o.options.speed+"ms "+o.options.easing,transform:"translate("+i.x+"px,"+i.y+"px)"})}}}function S(e,o){function r(t){var n=o.Slides.getSlide(t),i=e.options;n&&h(n.slide,{transition:"opacity "+i.speed+"ms "+i.easing})}return o.Options.fix({perPage:1,gap:0,padding:0}),o.Drag&&(o.Drag.required=!1),{mount:function(){r(e.index)},start:function(t,n,i,e){r(n),e()}}}var k="loop",P="fade";var C="[SPLIDE]";function E(t){console.error(C+" "+t)}function I(t,n){if(!t)throw new Error(n);return t}function M(t,n){for(var i=0;i<n.length;i++){var e=n[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function O(t){var n=x(t.root,"data-splide");if(n)try{t.options=JSON.parse(n)}catch(t){E('"data-splide" must be a valid JSON.')}return{mount:function(){t.index=t.options.start},fix:function(i){var e=r(t.options,i),o=e.breakpoints;o&&v(o,function(t,n){e.breakpoints[n]=r(o[n],i)}),t.options=e}}}function W(i){var e=i.root,o=i.classes;if(!e.id){var t=window[L]||0;window[L]=++t,e.id="splide"+(t<10?"0"+t:t)}var r={mount:function(){var t="was not found.";this.slider=d(e,o.slider),this.track=f(e,"."+o.track),I(this.track,"A track "+t),this.list=d(this.track,o.list),I(this.list,"A list "+t),this.slides=s(this.list.children),I(this.slides.length,"A slide "+t);var n=a(o.arrows);this.arrows={prev:f(n,"."+o.prev),next:f(n,"."+o.next)};var i=a(o.autoplay);this.bar=f(a(o.progress),"."+o.bar),this.play=f(i,"."+o.play),this.pause=f(i,"."+o.pause),function(){r.track.id||(r.track.id=e.id+"-track");r.list.id||(r.list.id=e.id+"-list")}()},mounted:function(){var t=o.root,n=i.options;g(e,""+t,t+"--"+n.type,t+"--"+n.direction,n.drag?t+"--draggable":"",n.isNavigation?t+"--nav":"")}};function a(t){return d(e,t)||d(r.slider,t)}return r}var H=function(){function t(t,n,i){var e=this;void 0===n&&(n={}),void 0===i&&(i={}),this.root=t instanceof HTMLElement?t:f(document,t),I(this.root,"An invalid root element or selector was given."),this.Components={},this.Event=function(){var i={};return{on:function(t,n){t.split(" ").forEach(function(t){-1<t.indexOf(".")&&i[t]||(i[t]||(i[t]=[]),i[t].push(n))})},off:function(t){t.split(" ").forEach(function(t){return delete i[t]})},emit:function(e){for(var t=arguments.length,o=new Array(1<t?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];v(i,function(t,n){if(n.split(".")[0]===e&&t)for(var i in t)t[i].apply(t,o)})}}}(),this.State=function(t){var n=t;return{set:function(t){n=t},is:function(t){return t===n}}}(1),this._options=r(u,n),this._index=0,this._components=i,this.on("move drag",function(){return e.State.set(4)}).on("moved dragged",function(){return e.State.set(3)})}var n=t.prototype;return n.mount=function(t,n){var e=this;void 0===t&&(t={}),void 0===n&&(n=null),this.Components=function(i,t,n){var e={};return v(t,function(t,n){e[n]=t(i,e,n.toLowerCase())}),n=n||i.is(P)?S:_,e.Transition=n(i,e),e}(this,r(this._components,t),n);try{v(this.Components,function(t,n){var i=t.required;void 0===i||i?t.mount&&t.mount():delete e.Components[n]})}catch(t){return E(t.message),null}return v(this.Components,function(t){t.mounted&&t.mounted()}),this.State.set(2),this.emit("mounted"),this.State.set(3),this.emit("ready"),h(this.root,{visibility:"visible"}),this},n.sync=function(t){return this.sibling=t,this},n.on=function(t,n){return this.Event.on(t,n),this},n.off=function(t){return this.Event.off(t),this},n.emit=function(t){for(var n,i=arguments.length,e=new Array(1<i?i-1:0),o=1;o<i;o++)e[o-1]=arguments[o];return(n=this.Event).emit.apply(n,[t].concat(e)),this},n.go=function(t,n){void 0===n&&(n=!0),(this.State.is(3)||this.State.is(4)&&!n)&&this.Components.Controller.go(t,!1)},n.is=function(t){return t===this._options.type},function(t,n,i){n&&M(t.prototype,n),i&&M(t,i)}(t,[{key:"index",get:function(){return this._index},set:function(t){this._index=parseInt(t)}},{key:"length",get:function(){return this.Components.Slides.length}},{key:"options",get:function(){return this._options},set:function(t){this._options=r(this._options,t),this.State.is(1)||this.emit("updated",this._options)}},{key:"classes",get:function(){return this._options.classes}},{key:"i18n",get:function(){return this._options.i18n}}]),t}(),L="splideUid";function A(t,n,i){return Math.min(Math.max(t,i<n?i:n),i<n?n:i)}function T(t){for(var n=arguments.length,i=new Array(1<n?n-1:0),e=1;e<n;e++)i[e-1]=arguments[e];var o=0;return t.replace(/%s/g,function(){return i[o++]})}function j(t){var n=typeof t;return"string"==n?t:"number"==n&&0<t?parseFloat(t)+"px":""}function q(t,n){if("number"==typeof n)return n;var i=p("div",{});h(i,{position:"absolute",width:n}),t.appendChild(i);var e=i.clientWidth;return t.removeChild(i),e}function z(r,e){var o,n={mount:function(){o=r.options,r.on("move",function(t){r.index=t}).on("updated",function(t){o=t,r.index=n.rewind(n.trim(r.index))})},go:function(t,n){var i=this.trim(this.parse(t));e.Track.go(i,this.rewind(i),n)},parse:function(t){var n=r.index,i=String(t).match(/([+\-<>])(\d+)?/),e=i&&i[1]||"",o=i?parseInt(i[2]):0;switch(e){case"+":n+=o||1;break;case"-":n-=o||1;break;case">":n=this.pageToIndex(-1<o?o:this.indexToPage(n)+1);break;case"<":n=this.pageToIndex(-1<o?o:this.indexToPage(n)-1);break;default:n=parseInt(t)}return n},pageToIndex:function(t){if(a())return t;var n=r.length,i=o.perPage,e=t*i;return n-i<=(e-=(this.pageLength*i-n)*R(e/n))&&e<n&&(e=n-i),e},indexToPage:function(t){if(a())return t;var n=r.length,i=o.perPage;return R(n-i<=t&&t<n?(n-1)/i:t/i)},trim:function(t){return r.is(k)||(t=o.rewind?this.rewind(t):A(t,0,this.edgeIndex)),t},rewind:function(t){var n=this.edgeIndex;if(r.is(k)){for(;n<t;)t-=n+1;for(;t<0;)t+=n+1}else n<t?t=0:t<0&&(t=n);return t},isRtl:function(){return"rtl"===o.direction},get pageLength(){var t=r.length;return a()?t:Math.ceil(t/o.perPage)},get edgeIndex(){var t=r.length;return a()||o.isNavigation||r.is(k)?t-1:t-o.perPage},get prevIndex(){var t=r.index-1;return(r.is(k)||o.rewind)&&(t=this.rewind(t)),-1<t?t:-1},get nextIndex(){var t=r.index+1;return(r.is(k)||o.rewind)&&(t=this.rewind(t)),r.index<t&&t<=this.edgeIndex||0===t?t:-1}};function a(){return!1!==r.options.focus}return n}var R=Math.floor;function N(o,r){var i=[],a=[];return{mount:function(){for(var t in i=r.Elements.slides)this.register(parseInt(t),-1,i[t])},register:function(t,n,i){var e=function(u,t,o,d){return{slide:o,index:u,realIndex:t,container:f(o,"."+d.classes.container),isClone:-1<t,init:function(){var t=this;if(!o.id&&!this.isClone){var n=u+1;o.id=d.root.id+"-slide"+(n<10?"0"+n:n)}d.on("mounted moved updated",function(){t.update(t.isActive(),!1),t.update(t.isVisible(),!0)}).on("resize",function(){t.update(t.isVisible(),!0)})},update:function(t,n){var i=n?"visible":"active",e=l[i];t?(g(o,e),d.emit(i,this)):c(o,e)&&(m(o,e),d.emit(n?"hidden":"inactive",this))},isActive:function(){return d.index===u},isVisible:function(){var t=d.options,n=t.focus,i=t.trimSpace,e=d.index,o=d.length,r="center"===n,a=d.Components.Layout.numInView,s=r?a/2:parseInt(n)||0;if(i){if(e<s)return u<a;if(o-(a-s)<=e)return o-a<=u}return e-s+(r&&a%2==0?1:0)<=u&&u<e+a-s},isWithin:function(t,n){var i=Math.abs(t-u);return d.is("slide")||this.isClone||(i=Math.min(i,d.length-i)),i<n}}}(t,n,i,o);e.init(),a.push(e)},getSlide:function(n){return a.filter(function(t){return t.index===n})[0]},getSlides:function(t,n){return n?t?a:a.filter(function(t){return!t.isClone}):t?a.map(function(t){return t.slide}):i},getSlidesByPage:function(t){var i=r.Controller.pageToIndex(t),n=o.options,e=!1!==n.focus?1:n.perPage;return a.filter(function(t){var n=t.index;return i<=n&&n<i+e})},get length(){return i.length},get total(){return a.length}}}function D(a,s){var o,n,u=0,i="ttb"===a.options.direction;return{mount:function(){o=s.Elements.list,n=i?function(r,a){var s=a.Layout;return{translate:function(t,n){h(t,{transform:"translateY("+n+"px)"})},toPosition:function(t){return-(t*(s.slideHeight+s.gap)+this.offset)},toIndex:function(t){return Math.round(-(t+this.offset)/(s.slideHeight+s.gap))},trim:function(t){return A(t,-(s.listHeight-(s.height+s.gap)),0)},get offset(){var t,n=s.height,i=s.slideHeight,e=s.gap,o=r.options.focus;return t="center"===o?(n-i)/2:(parseInt(o)||0)*(i+e),(i+e)*a.Clones.length/2-t}}}(a,s):function(r,a){var s=a.Layout;return{translate:function(t,n){h(t,{transform:"translateX("+n+"px)"})},toPosition:function(t){return this.sign*(t*(s.slideWidth+s.gap)+this.offset)},toIndex:function(t){return Math.round((this.sign*t-this.offset)/(s.slideWidth+s.gap))},trim:function(t){return A(t,this.sign*(s.listWidth-(s.width+s.gap)),0)},get sign(){return a.Controller.isRtl()?1:-1},get offset(){var t,n=s.width,i=s.slideWidth,e=s.gap,o=r.options.focus;return t="center"===o?(n-i)/2:(parseInt(o)||0)*(i+e),(i+e)*a.Clones.length/2-t}}}(a,s)},mounted:function(){var t=this;a.is(P)||a.on("mounted resize updated",function(){t.jump(a.index)})},go:function(t,n,i){var e=this,o=this.trim(this.toPosition(t)),r=a.index;i||a.emit("move",n,r,t),1<=Math.abs(o-u)||a.is(P)?s.Transition.start(t,n,this.toCoord(o),function(){e.end(t,n,r,i)}):this.end(t,n,r,i)},end:function(t,n,i,e){h(o,{transition:""}),a.is(P)||this.jump(n),e||a.emit("moved",n,i,t)},jump:function(t){var n=this.trim(this.toPosition(t));this.translate(n)},translate:function(t){u=t,n.translate(o,t)},toPosition:function(t){return n.toPosition(t)},toIndex:function(t){return n.toIndex(t)},trim:function(t){return!a.options.trimSpace||a.is(k)?t:n.trim(t)},toCoord:function(t){return{x:i?0:t,y:i?t:0}},get position(){return u},get offset(){return n.offset}}}function B(c,l){var f=[];function p(t){var n=t.cloneNode(!0);return g(n,c.classes.clone),b(n,"id"),n}return{mount:function(){c.is(k)&&function(){var e=l.Slides,o=l.Elements.list,t=c.options,n=t.perPage,i=t.drag,r=t.flickMaxPages,a=void 0===r?1:r,s=e.length,u=n*(i?a+1:1)+(s<n?n:0),d=e.getSlides(!1,!1);for(;d.length<u;)d=d.concat(d);d.slice(0,u).forEach(function(t,n){var i=p(t);o.appendChild(i),f.push(i),e.register(n+s,n,i)}),d.slice(-u).forEach(function(t,n){var i=p(t);o.insertBefore(i,d[0]),f.push(i),e.register(n-u,n,i)})}()},get clones(){return f},get length(){return f.length}}}function V(e,a){var s,u,d,o=e.root,r="ttb"===e.options.direction,t=a.Elements,c={mount:function(){s=t.list,u=a.Slides.getSlides(!0,!0),function(){var t=function(t,n){var i=null;return function(){i=i||setTimeout(function(){t(),i=null},n)}}(function(){e.emit("resize")},50);w(window,"resize",t),e.on("mounted resize",l).on("updated",n)}(),n()},get width(){return d.width},get height(){return d.height},get listWidth(){return d.listWidth},get listHeight(){return d.listHeight},get slideWidth(){return d.slideWidth},get slideHeight(){return d.slideHeight},get gap(){return d.gap},get padding(){return d.padding},get numInView(){return d.numInView}};function n(){var t=e.options;for(var n in(d=r?function(n,t,i){var e,o,r,a,s,u=t.Elements,d=n.root,c=u.track;return{marginProp:"marginBottom",gap:q(d,i.gap),padding:(e=i.padding,o=e.top,r=void 0===o?e:o,a=e.bottom,s=void 0===a?e:a,{top:q(d,r),bottom:q(d,s)}),init:function(){h(c,{paddingTop:j(this.padding.top),paddingBottom:j(this.padding.bottom)})},get width(){return c.clientWidth},get height(){var t=i.height||this.width*i.heightRatio;return I(t,'"height" or "heightRatio" is missing.'),q(n.root,t)-this.padding.top-this.padding.bottom},get listWidth(){return this.width},get listHeight(){return(this.slideHeight+this.gap)*t.Slides.total},get slideWidth(){return q(n.root,i.fixedWidth||this.width)},get slideHeight(){var t=i.fixedHeight||(this.height+this.gap)/i.perPage-this.gap;return q(n.root,t)},get numInView(){return i.fixedHeight?Math.floor((this.height+this.gap)/(this.slideHeight+this.gap))||1:i.perPage}}}(e,a,t):function(t,n,i){var e,o,r,a,s,u=n.Elements,d=t.root,c=u.track;return{marginProp:"rtl"===i.direction?"marginLeft":"marginRight",height:0,listHeight:0,gap:q(d,i.gap),padding:(e=i.padding,o=e.left,r=void 0===o?e:o,a=e.right,s=void 0===a?e:a,{left:q(d,r),right:q(d,s)}),init:function(){h(c,{paddingLeft:j(this.padding.left),paddingRight:j(this.padding.right)})},get width(){return c.clientWidth-this.padding.left-this.padding.right},get listWidth(){return(this.slideWidth+this.gap)*n.Slides.total},get slideWidth(){var t=i.fixedWidth||(this.width+this.gap)/i.perPage-this.gap;return q(d,t)},get slideHeight(){var t=i.height||i.fixedHeight||this.width*i.heightRatio;return q(d,t)},get numInView(){return i.fixedWidth?Math.floor((this.width+this.gap)/(this.slideWidth+this.gap))||1:i.perPage}}}(e,a,t)).init(),h(o,{maxWidth:j(t.width)}),u){var i;h(u[n].slide,((i={})[d.marginProp]=j(d.gap),i))}l()}function l(){h(s,{width:j(c.listWidth),height:j(c.listHeight)}),h(a.Elements.track,{height:j(c.height)});var t=j(d.slideWidth),n=j(d.slideHeight);for(var i in u){var e=u[i],o=e.slide,r=e.container;h(r,{height:n}),h(o,{width:t,height:r?"":n})}}return c}function X(u,d){var i,e,o,c=d.Track,l=d.Controller,r=!1,a="ttb"===u.options.direction,f=a?"y":"x",n={required:u.options.drag,disabled:!1,mount:function(){var t=d.Elements.list;w(t,"touchstart mousedown",s),w(t,"touchmove mousemove",p,{passive:!1}),w(t,"touchend touchcancel mouseleave mouseup dragend",h),v(t.querySelectorAll("img, a"),function(t){w(t,"dragstart",function(t){t.preventDefault()},{passive:!1})})}};function s(t){n.disabled||r||!u.State.is(3)||(i=c.toCoord(c.position),e=g(t,{}),o=e)}function p(t){if(e)if(o=g(t,e),r){t.cancelable&&t.preventDefault();var n=i[f]+o.offset[f];c.translate(function(t){if(!u.is(k)){var n=c.trim,i=c.toPosition,e=l.isRtl()?-1:1,o=e*n(i(0)),r=e*n(i(l.edgeIndex));o<(t*=e)?t=5*Math.log(t-o)+o:t<r&&(t=-5*Math.log(r-t)+r),t*=e}return t}(n))}else!function(t){var n=t.offset;if(u.State.is(3)){var i=180*Math.atan(Math.abs(n.y)/Math.abs(n.x))/Math.PI;return a&&(i=90-i),i<30}return!1}(o)||(u.emit("drag",e),r=!0)}function h(){e=null,r&&(u.emit("dragged",o),function(t){var n=t.velocity[f],i=Math.abs(n);if(0<i){var e=d.Layout,o=u.options,r=n<0?-1:1,a=c.position;i>o.flickThreshold&&Math.abs(t.offset[f])<150&&(a+=r*Math.min(i*o.flickPower,e.width*(o.flickMaxPages||1)));var s=c.toIndex(a);s===u.index&&(s+=l.isRtl()?r:-r),u.is(k)||(s=A(s,0,l.edgeIndex)),l.go(s,o.isNavigation)}}(o),r=!1)}function g(t,n){var i=t.timeStamp,e=t.touches,o=e?e[0]:t,r=o.clientX,a=o.clientY,s=n.to||{},u=s.x,d=void 0===u?r:u,c=s.y,l=void 0===c?a:c,f={x:r-d,y:a-l},p=i-(n.timeStamp||0);return{from:{x:d,y:l},to:{x:r,y:a},offset:f,timeStamp:i,velocity:{x:f.x/p,y:f.y/p}}}return n}function F(o,r,a){var s,i=[],u={required:o.options.autoplay,mount:function(){var t=o.options,n=r.Elements,i=n.slides,e=n.bar;i.length>t.perPage&&(s=function(n,i,e){function o(t){d||(s=(a=t-(r=r||t))/i,i<=a&&(r=0,s=1,n()),e&&e(s),u(o))}var r,a,s,u=window.requestAnimationFrame,d=!0;return{pause:function(){d=!0,r=0},play:function(){r=0,d&&(d=!1,u(o))}}}(function(){o.go(">")},t.interval,function(t){o.emit(a+":playing",t),e&&h(e,{width:100*t+"%"})}),function(){var t=o.options,n=r.Elements,i=o.sub,e=[o.root,i?i.root:null];t.pauseOnHover&&(d(e,"mouseleave",Y,!0),d(e,"mouseenter",Y,!1));t.pauseOnFocus&&(d(e,"focusout",K,!0),d(e,"focusin",K,!1));w(n.play,"click",function(){u.play(K),u.play(Q)}),d([n.pause],"click",Q,!1),o.on("move",function(){u.play()})}(),this.play())},play:function(n){void 0===n&&(n=0),(i=i.filter(function(t){return t!==n})).length||(o.emit(a+":play"),s.play())},pause:function(t){void 0===t&&(t=0),s.pause(),-1===i.indexOf(t)&&i.push(t),1===i.length&&o.emit(a+":pause")}};function d(t,n,i,e){for(var o in t)w(t[o],n,function(){u[e?"play":"pause"](i)})}return u}function G(s,u,d){var c,o=s.classes,r=s.root;function a(t){var n=p("button",{class:o.arrow+" "+(t?o.prev:o.next)});return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg"\tviewBox="0 0 40 40"\twidth="40"\theight="40"><path d="'+(s.options.arrowPath||"m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z")+'" /></svg>',n}return{required:s.options.arrows,mount:function(){var t=u.Elements,n=s.options.arrows;if((!(c=t.arrows).prev||!c.next)&&n){c=function(){var t=p("div",{class:o.arrows}),n=a(!0),i=a(!1);return t.appendChild(n),t.appendChild(i),{wrapper:t,prev:n,next:i}}();var i=t.slider,e="slider"===n&&i?i:r;e.insertBefore(c.wrapper,e.firstChild)}c&&(function(){var t=s.options.perMove;w(c.prev,"click",function(){s.go(t?"-"+t:"<")}),w(c.next,"click",function(){s.go(t?"+"+t:">")})}(),s.on("mounted move updated",function(){var t=c,n=t.prev,i=t.next,e=u.Controller,o=e.prevIndex,r=e.nextIndex,a=1<s.length;n.disabled=o<0||!a,i.disabled=r<0||!a,s.emit(d+":updated",n,i,o,r)})),this.arrows=c},mounted:function(){s.emit(d+":mounted",c.prev,c.next)}}}function U(s,i,o){var n,r={},a={required:s.options.pagination,mount:function(){r=function(){var n=s.options,o=s.classes,r=p("ul",{class:o.pagination}),a=i.Slides,t=a.getSlides(!1,!0).filter(function(t){return!1!==n.focus||t.index%n.perPage==0}).map(function(t,n){var i=p("li",{}),e=p("button",{class:o.page});return i.appendChild(e),r.appendChild(i),w(e,"click",function(){s.go(">"+n)}),{li:i,button:e,page:n,Slides:a.getSlidesByPage(n)}});return{list:r,items:t}}();var t=i.Elements.slider;(n="slider"===s.options.pagination&&t?t:s.root).appendChild(r.list),s.on(Z,e).on("updated.page",function(){a.destroy(),s.options.pagination&&(a.mount(),a.mounted())})},mounted:function(){var t=s.index;s.emit(o+":mounted",r,this.getItem(t)),e(t,-1)},destroy:function(){r&&r.list&&n.removeChild(r.list),s.off(Z),r=null},getItem:function(t){return r.items[i.Controller.indexToPage(t)]},get data(){return r}};function e(t,n){var i=a.getItem(n),e=a.getItem(t);i&&m(i.button,l.active),e&&g(e.button,l.active),s.emit(o+":updated",r,i,e)}return a}function J(s,e){var u=s.i18n;function n(t,n){y(t,"aria-hidden",!n),y(t,"tabindex",n?0:-1)}function t(t,n){var i=e.Elements.track.id;y(t,it,i),y(n,it,i)}function i(t,n,i,e){var o=s.index,r=-1<i&&o<i?u.last:u.prev,a=-1<e&&e<o?u.first:u.next;y(t,et,r),y(n,et,a)}function o(t,n){n&&y(n.button,nt,!0),t.items.forEach(function(t){var n=s.options,i=T(!1===n.focus&&1<n.perPage?u.pageX:u.slideX,t.page+1),e=t.button,o=[];t.Slides.forEach(function(t){o.push(t.slide.id)}),y(e,it,o.join(" ")),y(e,et,i)})}function r(t,n,i){n&&b(n.button,nt),i&&y(i.button,nt,!0)}function a(r){e.Slides.getSlides(!0,!0).forEach(function(t){var n=t.slide;c(n)||y(n,"role","button");var i=-1<t.realIndex?t.realIndex:t.index,e=T(u.slideX,i+1),o=r.Components.Slides.getSlide(i);y(n,et,e),o&&y(n,it,o.slide.id)})}function d(t,n){var i=t.slide;n?y(i,nt,!0):b(i,nt)}function c(t){return"button"===t.tagName.toLowerCase()}return{required:s.options.accessibility,mount:function(){s.on("visible",function(t){n(t.slide,!0)}).on("hidden",function(t){n(t.slide,!1)}).on("arrows:mounted",t).on("arrows:updated",i).on("pagination:mounted",o).on("pagination:updated",r),s.options.isNavigation&&s.on("navigation:mounted",a).on("active",function(t){d(t,!0)}).on("inactive",function(t){d(t,!1)}),function(){var i=e.Elements;[i.play,i.pause].forEach(function(t,n){t&&(c(t)||y(t,"role","button"),y(t,it,i.track.id),y(t,et,u[0===n?"play":"pause"]))})}()}}}var Y=1,K=2,Q=3,Z="move.page",$="data-splide-lazy",tt={horizontal:{ArrowLeft:"<",ArrowRight:">",Left:"<",Right:">"},vertical:{ArrowUp:"<",ArrowDown:">",Up:"<",Down:">"}},nt="aria-current",it="aria-controls",et="aria-label",ot="move.sync",rt=[" ","Enter","Spacebar"],at={Options:O,Elements:W,Controller:z,Slides:N,Track:D,Clones:B,Layout:V,Drag:X,Click:function(t,n){var i=!1;function e(t){i&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}return{required:t.options.drag&&!t.is(P),mount:function(){w(n.Elements.track,"click",e,{capture:!0}),t.on("drag",function(){i=!0}).on("moved",function(){i=!1})}}},Autoplay:F,Cover:function(t,n){var i=t.options;function e(t){var n=t.parentElement;n&&(h(n,{background:'center/cover no-repeat url("'+t.src+'")'}),h(t,{display:"none"}))}return{required:i.cover&&(i.height||i.heightRatio||i.fixedHeight),mount:function(){n.Slides.getSlides(!0,!1).forEach(function(t){var n=f(t,"img");n&&n.src&&e(n)}),t.on("lazyload:loaded",function(t){e(t)})}}},Arrows:G,Pagination:U,LazyLoad:function(o,t,r){var n=0,e=[],i=o.options.lazyLoad,a="sequential"===i;function s(n){var i=o.options;(e=e.filter(function(t){return!t.Slide.isWithin(n,i.perPage*(i.preloadPages+1))||(u(t.img,t.Slide),!1)})).length||o.off("moved."+r)}function u(t,n){g(n.slide,l.loading);var i=p("span",{class:o.classes.spinner});t.parentElement.appendChild(i),t.onload=function(){c(t,i,n,!1)},t.onerror=function(){c(t,i,n,!0)},y(t,"src",x(t,$))}function d(){if(n<e.length){var t=e[n];u(t.img,t.Slide)}n++}function c(t,n,i,e){m(i.slide,l.loading),e||(t.parentElement.removeChild(n),h(t,{visibility:"visible"}),o.emit(r+":loaded",t)),a&&d()}return{required:i,mount:function(){t.Slides.getSlides(!0,!0).forEach(function(t){var n=f(t.slide,"["+$+"]");n&&(e.push({img:n,Slide:t}),h(n,{visibility:"hidden"}))}),e.length&&(a?d():o.on("mounted",function(){s(o.index)}).on("moved."+r,function(t){s(t)}))}}},Keyboard:function(i){var t;return{mount:function(){var n=tt["ttb"===i.options.direction?"vertical":"horizontal"];i.on("mounted updated",function(){t&&(t[0](),t=void 0),i.options.keyboard&&(t=w(i.root,"keydown",function(t){n[t.key]&&i.go(n[t.key])}))})}}},Sync:function(e){var o=e.sibling,t=o&&o.options.isNavigation;function r(){e.on(ot,function(t,n,i){o.off(ot).go(o.is(k)?i:t,!1),a()})}function a(){o.on(ot,function(t,n,i){e.off(ot).go(e.is(k)?i:t,!1),r()})}function i(t){e.State.is(3)&&o.go(t)}return{required:!!o,mount:function(){r(),a(),t&&o.Components.Slides.getSlides(!0,!0).forEach(function(n){var t=n.slide;w(t,"mouseup touchend",function(t){t.button&&0!==t.button||i(n.index)}),w(t,"keyup",function(t){-1<rt.indexOf(t.key)&&(t.preventDefault(),i(n.index))},{passive:!1})})},mounted:function(){t&&o.emit("navigation:mounted",e)}}},A11y:J,Breakpoints:function(n){var i,e,o=n.options.breakpoints,r=[];return{required:o&&matchMedia,mount:function(){r=Object.keys(o).sort(function(t,n){return parseInt(t)-parseInt(n)}).map(function(t){return{point:t,mql:matchMedia("(max-width:"+t+"px)")}}),n.on("mounted resize",function(){var t=function(){var t=r.filter(function(t){return t.mql.matches})[0];return t?t.point:-1}();t!==e&&(n.options=o[t]||i,e=t)})},mounted:function(){i=n.options}}}};i.d(n,"Splide",function(){return st});var st=function(i){function t(t,n){return i.call(this,t,n,at)||this}return function(t,n){t.prototype=Object.create(n.prototype),(t.prototype.constructor=t).__proto__=n}(t,i),t}(H);window.Splide=st}]); |
{ | ||
"name": "@splidejs/splide", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "Splide is a lightweight and powerful slider without any dependencies.", | ||
@@ -5,0 +5,0 @@ "author": "Naotoshi Fujita", |
@@ -9,3 +9,3 @@ # Splide | ||
* Pure JavaScript without any dependencies | ||
* Small size, less than 26kB(10kB gzipped) | ||
* Small size, less than 27kB(10kB gzipped) | ||
* Flexible and extensible | ||
@@ -12,0 +12,0 @@ * Multiple slides |
@@ -132,8 +132,8 @@ /** | ||
subscribe( list, 'touchstart mousedown', start ); | ||
subscribe( list, 'touchmove mousemove', move, false ); | ||
subscribe( list, 'touchmove mousemove', move, { passive: false } ); | ||
subscribe( list, 'touchend touchcancel mouseleave mouseup dragend', end ); | ||
// Prevent dragging an image itself. | ||
each( list.getElementsByTagName( 'img' ), img => { | ||
subscribe( img, 'dragstart', e => { e.preventDefault() }, false ); | ||
// Prevent dragging an image or anchor itself. | ||
each( list.querySelectorAll( 'img, a' ), elm => { | ||
subscribe( elm, 'dragstart', e => { e.preventDefault() }, { passive: false } ); | ||
} ); | ||
@@ -140,0 +140,0 @@ }, |
@@ -16,3 +16,3 @@ /** | ||
import Drag from './drag'; | ||
import Links from './links'; | ||
import Click from './click'; | ||
import Autoplay from './autoplay'; | ||
@@ -37,3 +37,3 @@ import Cover from './cover'; | ||
Drag, | ||
Links, | ||
Click, | ||
Autoplay, | ||
@@ -40,0 +40,0 @@ Cover, |
@@ -141,3 +141,3 @@ /** | ||
} | ||
}, false ); | ||
}, { passive: false } ); | ||
} ); | ||
@@ -144,0 +144,0 @@ } |
@@ -163,10 +163,10 @@ /** | ||
* @param {function} handler - Callback function. | ||
* @param {boolean} passive - Optional. Set false if the event is not passive. | ||
* @param {Object} options - Optional. Options. | ||
* | ||
* @return {function[]} - Functions to stop subscription. | ||
*/ | ||
export function subscribe( elm, event, handler, passive = true ) { | ||
export function subscribe( elm, event, handler, options = {} ) { | ||
if ( elm ) { | ||
return event.split( ' ' ).map( e => { | ||
elm.addEventListener( e, handler, { passive } ); | ||
elm.addEventListener( e, handler, options ); | ||
return () => elm.removeEventListener( e, handler ); | ||
@@ -173,0 +173,0 @@ } ); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
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
312247
9219