Socket
Socket
Sign inDemoInstall

@splidejs/splide

Package Overview
Dependencies
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@splidejs/splide - npm Package Compare versions

Comparing version 1.0.27 to 1.1.0

2

dist/js/splide.min.js

@@ -7,2 +7,2 @@ /*!

*/
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Splide=n():t.Splide=n()}(window,function(){return e={},o.m=i=[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 r(i,e){Object.keys(i).some(function(t,n){return e(i[t],t,n)})}function a(n){return Object.keys(n).map(function(t){return n[t]})}function o(t){return"object"==typeof t}function s(t,n){var i=e({},t);return o(i)&&o(n)&&r(n,function(t,n){o(t)?(o(i[n])||(i[n]={}),i[n]=s(i[n],t)):i[n]=t}),i}i.r(n);var u="splide",l={active:"is-active",visible:"is-visible",loading:"is-loading"},d={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:u,slider:u+"__slider",track:u+"__track",list:u+"__list",slide:u+"__slide",container:u+"__slide__container",arrows:u+"__arrows",arrow:u+"__arrow",prev:u+"__arrow--prev",next:u+"__arrow--next",pagination:u+"__pagination",page:u+"__pagination__page",clone:u+"__slide--clone",progress:u+"__progress",bar:u+"__progress__bar",autoplay:u+"__autoplay",play:u+"__play",pause:u+"__pause",spinner:u+"__spinner",sr:u+"__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 c(t,n){if(t){var i=a(t.children);for(var e in i){var o=i[e];if(m(o,n.split(" ")[0]))return o}}return null}function p(t,n){var i=document.createElement(t);return r(n,function(t,n){return y(i,n,t)}),i}function h(i,t){i&&r(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 v(t,n){t&&t.classList.remove(n)}function m(t,n){return!!t&&t.classList.contains(n)}function y(t,n,i){t&&t.setAttribute(n,i)}function x(t,n){t&&t.removeAttribute(n)}function b(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 w(a,u){return{start:function(t,n,i,e){var o=u.Elements.list,r=a.options,s=b(o,"transitionend",function(t){t.target===o&&(e(),s[0]())});h(o,{transition:"transform "+r.speed+"ms "+r.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 _="loop",k="fade";var P="[SPLIDE]";function C(t){console.error(P+" "+t)}function E(t,n){if(!t)throw new Error(n);return t}function I(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 M(t){var n=t.root.getAttribute("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=s(t.options,i),o=e.breakpoints;o&&r(o,function(t,n){e.breakpoints[n]=s(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=c(e,o.slider),this.track=f(e,"."+o.track),E(this.track,"A track "+t),this.list=c(this.track,o.list),E(this.list,"A list "+t),this.slides=a(this.list.children),E(this.slides.length,"A slide "+t);var n=s(o.arrows);this.arrows={prev:f(n,"."+o.prev),next:f(n,"."+o.next)};var i=s(o.autoplay);this.bar=f(s(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 s(t){return c(e,t)||c(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),E(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];r(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=s(d,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 r(t,function(t,n){e[n]=t(i,e,n.toLowerCase())}),n=n||i.is(k)?S:w,e.Transition=n(i,e),e}(this,s(this._components,t),n);try{r(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 r(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&&I(t.prototype,n),i&&I(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=s(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 O(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 A(t){var n=typeof t;return"string"==n?t:"number"==n&&0<t?parseFloat(t)+"px":""}function j(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 q(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(!1!==o.focus)return t;var n=r.length,i=o.perPage,e=t*i;return n-i<=(e-=(this.pageLength*i-n)*z(e/n))&&e<n&&(e=n-i),e},indexToPage:function(t){if(!1!==o.focus)return t;var n=r.length,i=o.perPage;return z(n-i<=t&&t<n?(n-1)/i:t/i)},trim:function(t){return r.is(_)||(t=o.rewind?this.rewind(t):O(t,0,this.edgeIndex)),t},rewind:function(t){var n=this.edgeIndex;if(r.is(_)){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!1!==o.focus?t:Math.ceil(t/o.perPage)},get edgeIndex(){var t=r.length;return!1!==o.focus||o.isNavigation||r.is(_)?t-1:t-o.perPage},get prevIndex(){var t=this.parse("-");return(r.is(_)||o.rewind)&&(t=this.rewind(t)),-1<t?t:-1},get nextIndex(){var t=this.parse("+");return(r.is(_)||o.rewind)&&(t=this.rewind(t)),r.index<t&&t<=this.edgeIndex||0===t?t:-1}};return n}var z=Math.floor;function R(o,r){var i=[],s=[];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)):m(o,e)&&(v(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,s=d.Components.Layout.numInView,a=r?s/2:parseInt(n)||0;if(i){if(e<a)return u<s;if(o-(s-a)<=e)return o-s<=u}return e-a+(r&&s%2==0?1:0)<=u&&u<e+s-a},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(),s.push(e)},getSlide:function(n){return s.filter(function(t){return t.index===n})[0]},getSlides:function(t,n){return n?t?s:s.filter(function(t){return!t.isClone}):t?s.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 s.filter(function(t){var n=t.index;return i<=n&&n<i+e})},get length(){return i.length},get total(){return s.length}}}function N(s,a){var o,n,u=0,i="ttb"===s.options.direction;return{mount:function(){o=a.Elements.list,n=i?function(r,s){var a=s.Layout;return{translate:function(t,n){h(t,{transform:"translateY("+n+"px)"})},toPosition:function(t){return-(t*(a.slideHeight+a.gap)+this.offset)},toIndex:function(t){return Math.round(-(t+this.offset)/(a.slideHeight+a.gap))},trim:function(t){return O(t,-(a.listHeight-(a.height+a.gap)),0)},get offset(){var t,n=a.height,i=a.slideHeight,e=a.gap,o=r.options.focus;return t="center"===o?(n-i)/2:(parseInt(o)||0)*(i+e),(i+e)*s.Clones.length/2-t}}}(s,a):function(r,s){var a=s.Layout;return{translate:function(t,n){h(t,{transform:"translateX("+n+"px)"})},toPosition:function(t){return this.sign*(t*(a.slideWidth+a.gap)+this.offset)},toIndex:function(t){return Math.round((this.sign*t-this.offset)/(a.slideWidth+a.gap))},trim:function(t){return O(t,this.sign*(a.listWidth-(a.width+a.gap)),0)},get sign(){return s.Controller.isRtl()?1:-1},get offset(){var t,n=a.width,i=a.slideWidth,e=a.gap,o=r.options.focus;return t="center"===o?(n-i)/2:(parseInt(o)||0)*(i+e),(i+e)*s.Clones.length/2-t}}}(s,a)},mounted:function(){var t=this;s.is(k)||s.on("mounted resize updated",function(){t.jump(s.index)})},go:function(t,n,i){var e=this,o=this.trim(this.toPosition(t)),r=s.index;i||s.emit("move",n,r,t),1<=Math.abs(o-u)||s.is(k)?a.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:""}),s.is(k)||this.jump(n),e||s.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!s.options.trimSpace||s.is(_)?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),x(n,"id"),n}return{mount:function(){c.is(_)&&function(){var e=l.Slides,o=l.Elements.list,t=c.options,n=t.perPage,i=t.drag,r=t.flickMaxPages,s=void 0===r?1:r,a=e.length,u=n*(i?s+1:1)+(a<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+a,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 D(e,s){var a,u,d,o=e.root,r="ttb"===e.options.direction,t=s.Elements,c={mount:function(){a=t.list,u=s.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);b(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,s,a,u=t.Elements,d=n.root,c=u.track;return{marginProp:"marginBottom",gap:j(d,i.gap),padding:(e=i.padding,o=e.top,r=void 0===o?e:o,s=e.bottom,a=void 0===s?e:s,{top:j(d,r),bottom:j(d,a)}),init:function(){h(c,{paddingTop:A(this.padding.top),paddingBottom:A(this.padding.bottom)})},get width(){return c.clientWidth},get height(){var t=i.height||this.width*i.heightRatio;return E(t,'"height" or "heightRatio" must be given in TTB mode.'),j(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 j(n.root,i.fixedWidth||this.width)},get slideHeight(){var t=i.fixedHeight||(this.height+this.gap)/i.perPage-this.gap;return j(n.root,t)},get numInView(){return i.fixedHeight?Math.floor((this.height+this.gap)/(this.slideHeight+this.gap))||1:i.perPage}}}(e,s,t):function(t,n,i){var e,o,r,s,a,u=n.Elements,d=t.root,c=u.track;return{marginProp:"rtl"===i.direction?"marginLeft":"marginRight",height:0,listHeight:0,gap:j(d,i.gap),padding:(e=i.padding,o=e.left,r=void 0===o?e:o,s=e.right,a=void 0===s?e:s,{left:j(d,r),right:j(d,a)}),init:function(){h(c,{paddingLeft:A(this.padding.left),paddingRight:A(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 j(d,t)},get slideHeight(){var t=i.height||i.fixedHeight||this.width*i.heightRatio;return j(d,t)},get numInView(){return i.fixedWidth?Math.floor((this.width+this.gap)/(this.slideWidth+this.gap))||1:i.perPage}}}(e,s,t)).init(),h(o,{maxWidth:A(t.width)}),u){var i;h(u[n].slide,((i={})[d.marginProp]=A(d.gap),i))}l()}function l(){h(a,{width:A(c.listWidth),height:A(c.listHeight)}),h(s.Elements.track,{height:A(c.height)});var t=A(d.slideWidth),n=A(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 V(u,d){var i,e,o,c=d.Track,l=d.Controller,r=!1,s="ttb"===u.options.direction,f=s?"y":"x",n={required:u.options.drag,disabled:!1,mount:function(){var t=d.Elements.list;b(t,"touchstart mousedown",a),b(t,"touchmove mousemove",p,!1),b(t,"touchend touchcancel mouseleave mouseup dragend",h)}};function a(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(_)){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 s&&(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,s=c.position;i>o.flickThreshold&&Math.abs(t.offset[f])<150&&(s+=r*Math.min(i*o.flickPower,e.width*(o.flickMaxPages||1)));var a=c.toIndex(s);a===u.index&&(a+=l.isRtl()?r:-r),u.is(_)||(a=O(a,0,l.edgeIndex)),l.go(a,o.isNavigation)}}(o),r=!1)}function g(t,n){var i=t.timeStamp,e=t.touches,o=e?e[0]:t,r=o.clientX,s=o.clientY,a=n.to||{},u=a.x,d=void 0===u?r:u,c=a.y,l=void 0===c?s:c,f={x:r-d,y:s-l},p=i-(n.timeStamp||0);return{from:{x:d,y:l},to:{x:r,y:s},offset:f,timeStamp:i,velocity:{x:f.x/p,y:f.y/p}}}return n}function X(o,r,s){var a,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&&(a=function(n,i,e){function o(t){d||(a=(s=t-(r=r||t))/i,i<=s&&(r=0,a=1,n()),e&&e(a),u(o))}var r,s,a,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(s+":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",J,!0),d(e,"mouseenter",J,!1));t.pauseOnFocus&&(d(e,"focusout",Y,!0),d(e,"focusin",Y,!1));b(n.play,"click",function(){u.play(Y),u.play(K)}),d([n.pause],"click",K,!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(s+":play"),a.play())},pause:function(t){void 0===t&&(t=0),a.pause(),-1===i.indexOf(t)&&i.push(t),1===i.length&&o.emit(s+":pause")}};function d(t,n,i,e){for(var o in t)b(t[o],n,function(){u[e?"play":"pause"](i)})}return u}function F(a,u,d){var c,o=a.classes,r=a.root;function s(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="'+(a.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:a.options.arrows,mount:function(){var t=u.Elements,n=a.options.arrows;if((!(c=t.arrows).prev||!c.next)&&n){c=function(){var t=p("div",{class:o.arrows}),n=s(!0),i=s(!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=a.options.perMove;b(c.prev,"click",function(){a.go(t?"-"+t:"<")}),b(c.next,"click",function(){a.go(t?"+"+t:">")})}(),a.on("mounted move updated",function(){var t=c,n=t.prev,i=t.next,e=u.Controller,o=e.prevIndex,r=e.nextIndex,s=1<a.length;n.disabled=o<0||!s,i.disabled=r<0||!s,a.emit(d+":updated",n,i,o,r)})),this.arrows=c},mounted:function(){a.emit(d+":mounted",c.prev,c.next)}}}function G(a,i,o){var n,r={},s={required:a.options.pagination,mount:function(){r=function(){var n=a.options,o=a.classes,r=p("ul",{class:o.pagination}),s=i.Slides,t=s.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),b(e,"click",function(){a.go(">"+n)}),{li:i,button:e,page:n,Slides:s.getSlidesByPage(n)}});return{list:r,items:t}}();var t=i.Elements.slider;(n="slider"===a.options.pagination&&t?t:a.root).appendChild(r.list),a.on(Q,e).on("updated.page",function(){s.destroy(),a.options.pagination&&(s.mount(),s.mounted())})},mounted:function(){var t=a.index;a.emit(o+":mounted",r,this.getItem(t)),e(t,-1)},destroy:function(){r&&r.list&&n.removeChild(r.list),a.off(Q),r=null},getItem:function(t){return r.items[i.Controller.indexToPage(t)]},get data(){return r}};function e(t,n){var i=s.getItem(n),e=s.getItem(t);i&&v(i.button,l.active),e&&g(e.button,l.active),a.emit(o+":updated",r,i,e)}return s}function U(a,e){var u=a.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,nt,i),y(n,nt,i)}function i(t,n,i,e){var o=a.index,r=-1<i&&o<i?u.last:u.prev,s=-1<e&&e<o?u.first:u.next;y(t,it,r),y(n,it,s)}function o(t,n){n&&y(n.button,tt,!0),t.items.forEach(function(t){var n=a.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,nt,o.join(" ")),y(e,it,i)})}function r(t,n,i){n&&x(n.button,tt),i&&y(i.button,tt,!0)}function s(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,it,e),o&&y(n,nt,o.slide.id)})}function d(t,n){var i=t.slide;n?y(i,tt,!0):x(i,tt)}function c(t){return"button"===t.tagName.toLowerCase()}return{required:a.options.accessibility,mount:function(){a.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),a.options.isNavigation&&a.on("navigation:mounted",s).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,nt,i.track.id),y(t,it,u[0===n?"play":"pause"]))})}()}}}var J=1,Y=2,K=3,Q="move.page",Z="data-splide-lazy",$={horizontal:{ArrowLeft:"<",ArrowRight:">",Left:"<",Right:">"},vertical:{ArrowUp:"<",ArrowDown:">",Up:"<",Down:">"}},tt="aria-current",nt="aria-controls",it="aria-label",et="move.sync",ot=[" ","Enter","Spacebar"],rt={Options:M,Elements:W,Controller:q,Slides:R,Track:N,Clones:B,Layout:D,Drag:V,Autoplay:X,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:F,Pagination:G,LazyLoad:function(o,t,r){var n=0,e=[],i=o.options.lazyLoad,s="sequential"===i;function a(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)},h(t,{visibility:"hidden"}),y(t,"src",t.getAttribute(Z))}function d(){if(n<e.length){var t=e[n];u(t.img,t.Slide)}n++}function c(t,n,i,e){v(i.slide,l.loading),e||(t.parentElement.removeChild(n),h(t,{visibility:"visible"}),o.emit(r+":loaded",t)),s&&d()}return{required:i,mount:function(){t.Slides.getSlides(!0,!0).forEach(function(t){var n=f(t.slide,"["+Z+"]");n&&e.push({img:n,Slide:t})}),e.length&&(s?d():o.on("mounted",function(){a(o.index)}).on("moved."+r,function(t){a(t)}))}}},Keyboard:function(i){var t;return{mount:function(){var n=$["ttb"===i.options.direction?"vertical":"horizontal"];i.on("mounted updated",function(){t&&(t[0](),t=void 0),i.options.keyboard&&(t=b(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(et,function(t,n,i){o.off(et).go(o.is(_)?i:t,!1),s()})}function s(){o.on(et,function(t,n,i){e.off(et).go(e.is(_)?i:t,!1),r()})}function i(t){e.State.is(3)&&o.go(t)}return{required:!!o,mount:function(){r(),s(),t&&o.Components.Slides.getSlides(!0,!0).forEach(function(n){var t=n.slide;b(t,"mouseup touchend",function(t){t.button&&0!==t.button||i(n.index)}),b(t,"keyup",function(t){-1<ot.indexOf(t.key)&&(t.preventDefault(),i(n.index))},!1)})},mounted:function(){t&&o.emit("navigation:mounted",e)}}},A11y:U,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}}}};function st(t,n){return void 0===n&&(n={}),new H(t,n,rt)}i.d(n,"default",function(){return st}),window.splide=st}],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 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}var i,e});
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Splide=n():t.Splide=n()}(window,function(){return e={},o.m=i=[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 r(i,e){Object.keys(i).some(function(t,n){return e(i[t],t,n)})}function a(n){return Object.keys(n).map(function(t){return n[t]})}function o(t){return"object"==typeof t}function s(t,n){var i=e({},t);return o(i)&&o(n)&&r(n,function(t,n){o(t)?(o(i[n])||(i[n]={}),i[n]=s(i[n],t)):i[n]=t}),i}i.r(n);var u="splide",l={active:"is-active",visible:"is-visible",loading:"is-loading"},d={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:u,slider:u+"__slider",track:u+"__track",list:u+"__list",slide:u+"__slide",container:u+"__slide__container",arrows:u+"__arrows",arrow:u+"__arrow",prev:u+"__arrow--prev",next:u+"__arrow--next",pagination:u+"__pagination",page:u+"__pagination__page",clone:u+"__slide--clone",progress:u+"__progress",bar:u+"__progress__bar",autoplay:u+"__autoplay",play:u+"__play",pause:u+"__pause",spinner:u+"__spinner",sr:u+"__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 c(t,n){if(t){var i=a(t.children);for(var e in i){var o=i[e];if(m(o,n.split(" ")[0]))return o}}return null}function p(t,n){var i=document.createElement(t);return r(n,function(t,n){return y(i,n,t)}),i}function h(i,t){i&&r(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 v(t,n){t&&t.classList.remove(n)}function m(t,n){return!!t&&t.classList.contains(n)}function y(t,n,i){t&&t.setAttribute(n,i)}function x(t,n){t&&t.removeAttribute(n)}function b(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 w(o,t){var r,s;return{mount:function(){b(r=t.Elements.list,"transitionend",function(t){t.target===r&&s&&s()})},start:function(t,n,i,e){s=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 _="loop",k="fade";var P="[SPLIDE]";function C(t){console.error(P+" "+t)}function E(t,n){if(!t)throw new Error(n);return t}function I(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 M(t){var n=t.root.getAttribute("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=s(t.options,i),o=e.breakpoints;o&&r(o,function(t,n){e.breakpoints[n]=s(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=c(e,o.slider),this.track=f(e,"."+o.track),E(this.track,"A track "+t),this.list=c(this.track,o.list),E(this.list,"A list "+t),this.slides=a(this.list.children),E(this.slides.length,"A slide "+t);var n=s(o.arrows);this.arrows={prev:f(n,"."+o.prev),next:f(n,"."+o.next)};var i=s(o.autoplay);this.bar=f(s(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 s(t){return c(e,t)||c(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),E(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];r(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=s(d,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 r(t,function(t,n){e[n]=t(i,e,n.toLowerCase())}),n=n||i.is(k)?S:w,e.Transition=n(i,e),e}(this,s(this._components,t),n);try{r(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 r(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&&I(t.prototype,n),i&&I(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=s(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 O(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 T(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 q(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(s())return t;var n=r.length,i=o.perPage,e=t*i;return n-i<=(e-=(this.pageLength*i-n)*z(e/n))&&e<n&&(e=n-i),e},indexToPage:function(t){if(s())return t;var n=r.length,i=o.perPage;return z(n-i<=t&&t<n?(n-1)/i:t/i)},trim:function(t){return r.is(_)||(t=o.rewind?this.rewind(t):O(t,0,this.edgeIndex)),t},rewind:function(t){var n=this.edgeIndex;if(r.is(_)){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 s()?t:Math.ceil(t/o.perPage)},get edgeIndex(){var t=r.length;return s()||o.isNavigation||r.is(_)?t-1:t-o.perPage},get prevIndex(){var t=r.index-1;return(r.is(_)||o.rewind)&&(t=this.rewind(t)),-1<t?t:-1},get nextIndex(){var t=r.index+1;return(r.is(_)||o.rewind)&&(t=this.rewind(t)),r.index<t&&t<=this.edgeIndex||0===t?t:-1}};function s(){return!1!==r.options.focus}return n}var z=Math.floor;function R(o,r){var i=[],s=[];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)):m(o,e)&&(v(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,s=d.Components.Layout.numInView,a=r?s/2:parseInt(n)||0;if(i){if(e<a)return u<s;if(o-(s-a)<=e)return o-s<=u}return e-a+(r&&s%2==0?1:0)<=u&&u<e+s-a},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(),s.push(e)},getSlide:function(n){return s.filter(function(t){return t.index===n})[0]},getSlides:function(t,n){return n?t?s:s.filter(function(t){return!t.isClone}):t?s.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 s.filter(function(t){var n=t.index;return i<=n&&n<i+e})},get length(){return i.length},get total(){return s.length}}}function N(s,a){var o,n,u=0,i="ttb"===s.options.direction;return{mount:function(){o=a.Elements.list,n=i?function(r,s){var a=s.Layout;return{translate:function(t,n){h(t,{transform:"translateY("+n+"px)"})},toPosition:function(t){return-(t*(a.slideHeight+a.gap)+this.offset)},toIndex:function(t){return Math.round(-(t+this.offset)/(a.slideHeight+a.gap))},trim:function(t){return O(t,-(a.listHeight-(a.height+a.gap)),0)},get offset(){var t,n=a.height,i=a.slideHeight,e=a.gap,o=r.options.focus;return t="center"===o?(n-i)/2:(parseInt(o)||0)*(i+e),(i+e)*s.Clones.length/2-t}}}(s,a):function(r,s){var a=s.Layout;return{translate:function(t,n){h(t,{transform:"translateX("+n+"px)"})},toPosition:function(t){return this.sign*(t*(a.slideWidth+a.gap)+this.offset)},toIndex:function(t){return Math.round((this.sign*t-this.offset)/(a.slideWidth+a.gap))},trim:function(t){return O(t,this.sign*(a.listWidth-(a.width+a.gap)),0)},get sign(){return s.Controller.isRtl()?1:-1},get offset(){var t,n=a.width,i=a.slideWidth,e=a.gap,o=r.options.focus;return t="center"===o?(n-i)/2:(parseInt(o)||0)*(i+e),(i+e)*s.Clones.length/2-t}}}(s,a)},mounted:function(){var t=this;s.is(k)||s.on("mounted resize updated",function(){t.jump(s.index)})},go:function(t,n,i){var e=this,o=this.trim(this.toPosition(t)),r=s.index;i||s.emit("move",n,r,t),1<=Math.abs(o-u)||s.is(k)?a.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:""}),s.is(k)||this.jump(n),e||s.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!s.options.trimSpace||s.is(_)?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),x(n,"id"),n}return{mount:function(){c.is(_)&&function(){var e=l.Slides,o=l.Elements.list,t=c.options,n=t.perPage,i=t.drag,r=t.flickMaxPages,s=void 0===r?1:r,a=e.length,u=n*(i?s+1:1)+(a<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+a,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 D(e,s){var a,u,d,o=e.root,r="ttb"===e.options.direction,t=s.Elements,c={mount:function(){a=t.list,u=s.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);b(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,s,a,u=t.Elements,d=n.root,c=u.track;return{marginProp:"marginBottom",gap:T(d,i.gap),padding:(e=i.padding,o=e.top,r=void 0===o?e:o,s=e.bottom,a=void 0===s?e:s,{top:T(d,r),bottom:T(d,a)}),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 E(t,'"height" or "heightRatio" is missing.'),T(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 T(n.root,i.fixedWidth||this.width)},get slideHeight(){var t=i.fixedHeight||(this.height+this.gap)/i.perPage-this.gap;return T(n.root,t)},get numInView(){return i.fixedHeight?Math.floor((this.height+this.gap)/(this.slideHeight+this.gap))||1:i.perPage}}}(e,s,t):function(t,n,i){var e,o,r,s,a,u=n.Elements,d=t.root,c=u.track;return{marginProp:"rtl"===i.direction?"marginLeft":"marginRight",height:0,listHeight:0,gap:T(d,i.gap),padding:(e=i.padding,o=e.left,r=void 0===o?e:o,s=e.right,a=void 0===s?e:s,{left:T(d,r),right:T(d,a)}),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 T(d,t)},get slideHeight(){var t=i.height||i.fixedHeight||this.width*i.heightRatio;return T(d,t)},get numInView(){return i.fixedWidth?Math.floor((this.width+this.gap)/(this.slideWidth+this.gap))||1:i.perPage}}}(e,s,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(a,{width:j(c.listWidth),height:j(c.listHeight)}),h(s.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 V(u,d){var i,e,o,c=d.Track,l=d.Controller,r=!1,s="ttb"===u.options.direction,f=s?"y":"x",n={required:u.options.drag,disabled:!1,mount:function(){var t=d.Elements.list;b(t,"touchstart mousedown",a),b(t,"touchmove mousemove",p,!1),b(t,"touchend touchcancel mouseleave mouseup dragend",h)}};function a(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(_)){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 s&&(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,s=c.position;i>o.flickThreshold&&Math.abs(t.offset[f])<150&&(s+=r*Math.min(i*o.flickPower,e.width*(o.flickMaxPages||1)));var a=c.toIndex(s);a===u.index&&(a+=l.isRtl()?r:-r),u.is(_)||(a=O(a,0,l.edgeIndex)),l.go(a,o.isNavigation)}}(o),r=!1)}function g(t,n){var i=t.timeStamp,e=t.touches,o=e?e[0]:t,r=o.clientX,s=o.clientY,a=n.to||{},u=a.x,d=void 0===u?r:u,c=a.y,l=void 0===c?s:c,f={x:r-d,y:s-l},p=i-(n.timeStamp||0);return{from:{x:d,y:l},to:{x:r,y:s},offset:f,timeStamp:i,velocity:{x:f.x/p,y:f.y/p}}}return n}function X(o,r,s){var a,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&&(a=function(n,i,e){function o(t){d||(a=(s=t-(r=r||t))/i,i<=s&&(r=0,a=1,n()),e&&e(a),u(o))}var r,s,a,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(s+":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",J,!0),d(e,"mouseenter",J,!1));t.pauseOnFocus&&(d(e,"focusout",Y,!0),d(e,"focusin",Y,!1));b(n.play,"click",function(){u.play(Y),u.play(K)}),d([n.pause],"click",K,!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(s+":play"),a.play())},pause:function(t){void 0===t&&(t=0),a.pause(),-1===i.indexOf(t)&&i.push(t),1===i.length&&o.emit(s+":pause")}};function d(t,n,i,e){for(var o in t)b(t[o],n,function(){u[e?"play":"pause"](i)})}return u}function F(a,u,d){var c,o=a.classes,r=a.root;function s(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="'+(a.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:a.options.arrows,mount:function(){var t=u.Elements,n=a.options.arrows;if((!(c=t.arrows).prev||!c.next)&&n){c=function(){var t=p("div",{class:o.arrows}),n=s(!0),i=s(!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=a.options.perMove;b(c.prev,"click",function(){a.go(t?"-"+t:"<")}),b(c.next,"click",function(){a.go(t?"+"+t:">")})}(),a.on("mounted move updated",function(){var t=c,n=t.prev,i=t.next,e=u.Controller,o=e.prevIndex,r=e.nextIndex,s=1<a.length;n.disabled=o<0||!s,i.disabled=r<0||!s,a.emit(d+":updated",n,i,o,r)})),this.arrows=c},mounted:function(){a.emit(d+":mounted",c.prev,c.next)}}}function G(a,i,o){var n,r={},s={required:a.options.pagination,mount:function(){r=function(){var n=a.options,o=a.classes,r=p("ul",{class:o.pagination}),s=i.Slides,t=s.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),b(e,"click",function(){a.go(">"+n)}),{li:i,button:e,page:n,Slides:s.getSlidesByPage(n)}});return{list:r,items:t}}();var t=i.Elements.slider;(n="slider"===a.options.pagination&&t?t:a.root).appendChild(r.list),a.on(Q,e).on("updated.page",function(){s.destroy(),a.options.pagination&&(s.mount(),s.mounted())})},mounted:function(){var t=a.index;a.emit(o+":mounted",r,this.getItem(t)),e(t,-1)},destroy:function(){r&&r.list&&n.removeChild(r.list),a.off(Q),r=null},getItem:function(t){return r.items[i.Controller.indexToPage(t)]},get data(){return r}};function e(t,n){var i=s.getItem(n),e=s.getItem(t);i&&v(i.button,l.active),e&&g(e.button,l.active),a.emit(o+":updated",r,i,e)}return s}function U(a,e){var u=a.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,nt,i),y(n,nt,i)}function i(t,n,i,e){var o=a.index,r=-1<i&&o<i?u.last:u.prev,s=-1<e&&e<o?u.first:u.next;y(t,it,r),y(n,it,s)}function o(t,n){n&&y(n.button,tt,!0),t.items.forEach(function(t){var n=a.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,nt,o.join(" ")),y(e,it,i)})}function r(t,n,i){n&&x(n.button,tt),i&&y(i.button,tt,!0)}function s(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,it,e),o&&y(n,nt,o.slide.id)})}function d(t,n){var i=t.slide;n?y(i,tt,!0):x(i,tt)}function c(t){return"button"===t.tagName.toLowerCase()}return{required:a.options.accessibility,mount:function(){a.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),a.options.isNavigation&&a.on("navigation:mounted",s).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,nt,i.track.id),y(t,it,u[0===n?"play":"pause"]))})}()}}}var J=1,Y=2,K=3,Q="move.page",Z="data-splide-lazy",$={horizontal:{ArrowLeft:"<",ArrowRight:">",Left:"<",Right:">"},vertical:{ArrowUp:"<",ArrowDown:">",Up:"<",Down:">"}},tt="aria-current",nt="aria-controls",it="aria-label",et="move.sync",ot=[" ","Enter","Spacebar"],rt={Options:M,Elements:W,Controller:q,Slides:R,Track:N,Clones:B,Layout:D,Drag:V,Autoplay:X,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:F,Pagination:G,LazyLoad:function(o,t,r){var n=0,e=[],i=o.options.lazyLoad,s="sequential"===i;function a(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)},h(t,{visibility:"hidden"}),y(t,"src",t.getAttribute(Z))}function d(){if(n<e.length){var t=e[n];u(t.img,t.Slide)}n++}function c(t,n,i,e){v(i.slide,l.loading),e||(t.parentElement.removeChild(n),h(t,{visibility:"visible"}),o.emit(r+":loaded",t)),s&&d()}return{required:i,mount:function(){t.Slides.getSlides(!0,!0).forEach(function(t){var n=f(t.slide,"["+Z+"]");n&&e.push({img:n,Slide:t})}),e.length&&(s?d():o.on("mounted",function(){a(o.index)}).on("moved."+r,function(t){a(t)}))}}},Keyboard:function(i){var t;return{mount:function(){var n=$["ttb"===i.options.direction?"vertical":"horizontal"];i.on("mounted updated",function(){t&&(t[0](),t=void 0),i.options.keyboard&&(t=b(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(et,function(t,n,i){o.off(et).go(o.is(_)?i:t,!1),s()})}function s(){o.on(et,function(t,n,i){e.off(et).go(e.is(_)?i:t,!1),r()})}function i(t){e.State.is(3)&&o.go(t)}return{required:!!o,mount:function(){r(),s(),t&&o.Components.Slides.getSlides(!0,!0).forEach(function(n){var t=n.slide;b(t,"mouseup touchend",function(t){t.button&&0!==t.button||i(n.index)}),b(t,"keyup",function(t){-1<ot.indexOf(t.key)&&(t.preventDefault(),i(n.index))},!1)})},mounted:function(){t&&o.emit("navigation:mounted",e)}}},A11y:U,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}}}};function st(t,n){return void 0===n&&(n={}),new H(t,n,rt)}i.d(n,"default",function(){return st}),window.splide=st}],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 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}var i,e});
{
"name": "@splidejs/splide",
"version": "1.0.27",
"version": "1.1.0",
"description": "Splide is a lightweight and powerful slider without any dependencies.",

@@ -5,0 +5,0 @@ "author": "Naotoshi Fujita",

@@ -108,3 +108,3 @@ /**

pageToIndex( page ) {
if ( options.focus !== false ) {
if ( hasFocus() ) {
return page;

@@ -135,3 +135,3 @@ }

indexToPage( index ) {
if ( options.focus !== false ) {
if ( hasFocus() ) {
return index;

@@ -212,3 +212,3 @@ }

const length = Splide.length;
return options.focus !== false ? length : Math.ceil( length / options.perPage );
return hasFocus() ? length : Math.ceil( length / options.perPage );
},

@@ -224,3 +224,3 @@

if ( options.focus !== false || options.isNavigation || Splide.is( LOOP ) ) {
if ( hasFocus() || options.isNavigation || Splide.is( LOOP ) ) {
return length - 1;

@@ -238,3 +238,3 @@ }

get prevIndex() {
let prev = this.parse( '-' );
let prev = Splide.index - 1;

@@ -254,3 +254,3 @@ if ( Splide.is( LOOP ) || options.rewind ) {

get nextIndex() {
let next = this.parse( '+' );
let next = Splide.index + 1;

@@ -277,3 +277,12 @@ if ( Splide.is( LOOP ) || options.rewind ) {

/**
* Verify if the focus option is available or not.
*
* @return {boolean} - True if a slider has the focus option.
*/
function hasFocus() {
return Splide.options.focus !== false;
}
return Controller;
}

@@ -100,3 +100,3 @@ /**

const height = options.height || this.width * options.heightRatio;
exist( height, '"height" or "heightRatio" must be given in TTB mode.' );
exist( height, '"height" or "heightRatio" is missing.' );
return toPixel( Splide.root, height ) - this.padding.top - this.padding.bottom;

@@ -103,0 +103,0 @@ },

@@ -20,24 +20,43 @@ /**

export default ( Splide, Components ) => {
/**
* Hold the list element.
*
* @type {Element}
*/
let list;
/**
* Hold the onEnd callback function.
*
* @type {function}
*/
let endCallback;
return {
/**
* Called when the component is mounted.
*/
mount() {
list = Components.Elements.list;
subscribe( list, 'transitionend', e => {
if ( e.target === list && endCallback ) {
endCallback();
}
} );
},
/**
* Start transition.
*
* @param {number} destIndex - Destination slide index that might be clone's.
* @param {number} newIndex - New index.
* @param {Object} coord - Destination coordinates.
* @param {function} onEnd - Callback function must be invoked when transition is completed.
* @param {number} destIndex - Destination slide index that might be clone's.
* @param {number} newIndex - New index.
* @param {Object} coord - Destination coordinates.
* @param {function} onEnd - Callback function must be invoked when transition is completed.
*/
start( destIndex, newIndex, coord, onEnd ) {
const list = Components.Elements.list;
const options = Splide.options;
endCallback = onEnd;
const removers = subscribe( list, 'transitionend', e => {
if ( e.target === list ) {
onEnd();
removers[0]();
}
} );
applyStyle( list, {
transition: `transform ${ options.speed }ms ${ options.easing }`,
transition: `transform ${ Splide.options.speed }ms ${ Splide.options.easing }`,
transform : `translate(${ coord.x }px,${ coord.y }px)`,

@@ -44,0 +63,0 @@ } );

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc