splide.min.js 29 KB

12
  1. function _defineProperties(n,t){for(var e=0;e<t.length;e++){var i=t[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function _createClass(n,t,e){return t&&_defineProperties(n.prototype,t),e&&_defineProperties(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).Splide=t()}(this,function(){"use strict";var j="(prefers-reduced-motion: reduce)",n={CREATED:1,MOUNTED:2,IDLE:3,MOVING:4,SCROLLING:5,DRAGGING:6,DESTROYED:7};function x(n){n.length=0}function S(n,t,e){return Array.prototype.slice.call(n,t,e)}function D(n){return n.bind.apply(n,[null].concat(S(arguments,1)))}function F(){}var g=setTimeout;function p(n){return requestAnimationFrame(n)}function t(n,t){return typeof t===n}function W(n){return!r(n)&&t("object",n)}var o=Array.isArray,m=D(t,"function"),M=D(t,"string"),z=D(t,"undefined");function r(n){return null===n}function v(n){return n instanceof HTMLElement}function y(n){return o(n)?n:[n]}function b(n,t){y(n).forEach(t)}function w(n,t){return-1<n.indexOf(t)}function _(n,t){return n.push.apply(n,y(t)),n}function T(t,n,e){t&&b(n,function(n){n&&t.classList[e?"add":"remove"](n)})}function P(n,t){T(n,M(t)?t.split(" "):t,!0)}function C(n,t){b(t,n.appendChild.bind(n))}function N(n,e){b(n,function(n){var t=(e||n).parentNode;t&&t.insertBefore(n,e)})}function B(n,t){return v(n)&&(n.msMatchesSelector||n.matches).call(n,t)}function E(n,t){n=n?S(n.children):[];return t?n.filter(function(n){return B(n,t)}):n}function I(n,t){return t?E(n,t)[0]:n.firstElementChild}var c=Object.keys;function L(n,t,e){if(n)for(var i=c(n),i=e?i.reverse():i,o=0;o<i.length;o++){var r=i[o];if("__proto__"!==r&&!1===t(n[r],r))break}return n}function A(i){return S(arguments,1).forEach(function(e){L(e,function(n,t){i[t]=e[t]})}),i}function f(e){return S(arguments).forEach(function(n){L(n,function(n,t){o(n)?e[t]=n.slice():W(n)?e[t]=f(W(e[t])?e[t]:{},n):e[t]=n})}),e}function R(n,e){b(n,function(t){b(e,function(n){t&&t.removeAttribute(n)})})}function O(e,t,i){W(t)?L(t,function(n,t){O(e,t,n)}):b(e,function(n){r(i)||""===i?R(n,t):n.setAttribute(t,String(i))})}function G(n,t,e){n=document.createElement(n);return t&&(M(t)?P:O)(n,t),e&&C(e,n),n}function H(n,t,e){if(z(e))return getComputedStyle(n)[t];r(e)||(n.style[t]=""+e)}function k(n,t){H(n,"display",t)}function X(n){n.setActive&&n.setActive()||n.focus({preventScroll:!0})}function Y(n,t){return n.getAttribute(t)}function q(n,t){return n&&n.classList.contains(t)}function U(n){return n.getBoundingClientRect()}function K(n){b(n,function(n){n&&n.parentNode&&n.parentNode.removeChild(n)})}function J(n){return I((new DOMParser).parseFromString(n,"text/html").body)}function Q(n,t){n.preventDefault(),t&&(n.stopPropagation(),n.stopImmediatePropagation())}function V(n,t){return n&&n.querySelector(t)}function Z(n,t){return t?S(n.querySelectorAll(t)):[]}function $(n,t){T(n,t,!1)}function nn(n){return n.timeStamp}function tn(n){return M(n)?n:n?n+"px":""}var en="splide",i="data-"+en;function on(n,t){if(!n)throw new Error("["+en+"] "+(t||""))}var rn=Math.min,un=Math.max,sn=Math.floor,an=Math.ceil,cn=Math.abs;function fn(n,t,e){return cn(n-t)<e}function ln(n,t,e,i){var o=rn(t,e),e=un(t,e);return i?o<n&&n<e:o<=n&&n<=e}function dn(n,t,e){var i=rn(t,e),e=un(t,e);return rn(un(i,n),e)}function pn(n){return(0<n)-(n<0)}function hn(t,n){return b(n,function(n){t=t.replace("%s",""+n)}),t}function gn(n){return n<10?"0"+n:""+n}var vn={};function l(){var s=[];function e(n,e,i){b(n,function(t){t&&b(e,function(n){n.split(" ").forEach(function(n){n=n.split(".");i(t,n[0],n[1])})})})}return{bind:function(n,t,r,u){e(n,t,function(n,t,e){var i="addEventListener"in n,o=i?n.removeEventListener.bind(n,t,r,u):n.removeListener.bind(n,r);i?n.addEventListener(t,r,u):n.addListener(r),s.push([n,t,e,r,o])})},unbind:function(n,t,o){e(n,t,function(t,e,i){s=s.filter(function(n){return!!(n[0]!==t||n[1]!==e||n[2]!==i||o&&n[3]!==o)||(n[4](),!1)})})},dispatch:function(n,t,e){var i;return"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:!0,detail:e}):(i=document.createEvent("CustomEvent")).initEvent(t,!0,!1),n.dispatchEvent(i),i},destroy:function(){s.forEach(function(n){n[4]()}),x(s)}}}var mn="mounted",yn="move",bn="moved",wn="shifted",_n="click",En="active",xn="inactive",Sn="visible",Pn="hidden",Cn="slide:keydown",Ln="refresh",An="updated",kn="resize",Dn="resized",Mn="repositioned",zn="scroll",Tn="scrolled",u="destroy",Nn="navigation:mounted",In="autoplay:play",Rn="autoplay:pause",On="lazyload:loaded";function jn(n){var e=n?n.event.bus:document.createDocumentFragment(),i=l();return n&&n.event.on(u,i.destroy),A(i,{bus:e,on:function(n,t){i.bind(e,y(n).join(" "),function(n){t.apply(t,o(n.detail)?n.detail:[])})},off:D(i.unbind,e),emit:function(n){i.dispatch(e,n,S(arguments,1))}})}function Fn(t,e,i,o){var r,n,u=Date.now,s=0,a=!0,c=0;function f(){if(!a){var n=u()-r;if(t<=n?(s=1,r=u()):s=n/t,i&&i(s),1===s&&(e(),o&&++c>=o))return l();p(f)}}function l(){a=!0}function d(){cancelAnimationFrame(n),a=!(n=s=0)}return{start:function(n){n||d(),r=u()-(n?s*t:0),a=!1,p(f)},rewind:function(){r=u(),s=0,i&&i(s)},pause:l,cancel:d,set:function(n){t=n},isPaused:function(){return a}}}function s(n){var t=n;return{set:function(n){t=n},is:function(n){return w(y(n),t)}}}function Wn(e,i){var o;return function(){var n,t=this;o||(n=S(arguments),(o=Fn(i||0,function(){e.apply(t,n),o=null},null,1)).start())}}var Bn="ttb",a={marginRight:["marginBottom","marginLeft"],autoWidth:["autoHeight"],fixedWidth:["fixedHeight"],paddingLeft:["paddingTop","paddingRight"],paddingRight:["paddingBottom","paddingLeft"],width:["height"],Width:["Height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:["ArrowUp","ArrowRight"],ArrowRight:["ArrowDown","ArrowLeft"]};var Gn="role",Hn="tabindex",e="aria-",Xn=e+"controls",Yn=e+"current",qn=e+"selected",Un=e+"label",Kn=e+"hidden",Jn=e+"orientation",Qn=e+"roledescription",d=e+"atomic",h=e+"live",Vn=[Gn,Hn,"disabled",Xn,Yn,Un,Kn,Jn,Qn,d,h],Zn=en,$n=en+"__track",nt=en+"__list",tt=en+"__slide",et=tt+"--clone",it=tt+"__container",ot=en+"__arrows",rt=en+"__arrow",ut=rt+"--prev",st=rt+"--next",at=en+"__pagination",ct=at+"__page",ft=en+"__progress"+"__bar",lt=en+"__autoplay",dt=en+"__play",pt=en+"__pause",ht=en+"__sr",gt="is-active",vt="is-prev",mt="is-next",yt="is-visible",bt="is-loading",wt=[gt,yt,vt,mt,bt];var _t="slide",Et="loop",xt="fade";function St(o,i,t,r){var u,n=jn(o),e=n.on,s=n.emit,a=n.bind,c=o.Components,f=o.root,l=o.options,d=l.isNavigation,p=l.updateOnMove,h=l.i18n,g=l.pagination,v=l.slideFocus,m=c.Direction.resolve,y=Y(r,"style"),b=Y(r,Un),w=-1<t,_=I(r,"."+it),E=G("span",ht,I(r));function x(){var n=o.splides.map(function(n){n=n.splide.Components.Slides.getAt(i);return n?n.slide.id:""}).join(" ");O(r,Un,hn(h.slideX,(w?t:i)+1)),O(r,Xn,n),O(r,Gn,v?"button":""),C()}function S(){u||P(!0)}function P(n){var t,e;u||(t=o.index,(e=L())!==q(r,gt)&&(T(r,gt,e),s(e?En:xn,k)),function(){var n=A();n!==q(r,yt)&&(T(r,yt,n),s(n?Sn:Pn,k));n||document.activeElement!==r||(n=c.Slides.getAt(o.index))&&X(n.slide)}(),T(r,vt,i===t-1),T(r,mt,i===t+1),n||C())}function C(){var n=L(),t=!A()&&(!n||w);O(r,Yn,d&&n||""),O(r,Kn,t||""),O(Z(r,l.focusableNodes||""),Hn,t?-1:""),v&&O(r,Hn,t?-1:0),l.live&&(t?K(E):N(E,I(r)))}function L(){var n=o.index;return n===i||l.cloneStatus&&n===t}function A(){if(o.is(xt))return L();var n=U(c.Elements.track),t=U(r),e=m("left"),i=m("right");return sn(n[e])<=an(t[e])&&sn(t[i])<=an(n[i])}var k={index:i,slideIndex:t,slide:r,container:_,isClone:w,mount:function(){var n;w||(n=b||hn(h.slideLabel,[i+1,o.length]),r.id=f.id+"-slide"+gn(i+1),O(r,Gn,g?"tabpanel":"group"),O(r,Qn,g?"":h.slide),O(r,Un,n),E.textContent=n),a(r,"click",D(s,_n,k)),a(r,"keydown",D(s,Cn,k)),e([Ln,Mn,bn,Tn],D(P,!1)),e(wn,D(P,!0)),e(Nn,x),p&&e(yn,S)},destroy:function(){u=!0,n.destroy(),K(E),$(r,wt),R(r,Vn),O(r,"style",y),O(r,Un,b||"")},update:P,style:function(n,t,e){H(e&&_||r,n,t)},isWithin:function(n,t){return n=cn(n-i),(n=!w&&(l.rewind||o.is(Et))?rn(n,o.length-n):n)<=t}};return k}var Pt=i+"-interval";var Ct={passive:!1,capture:!0},Lt="touchmove mousemove",At="touchend touchcancel mouseup";var kt={Spacebar:" ",Right:"ArrowRight",Left:"ArrowLeft",Up:"ArrowUp",Down:"ArrowDown"};function Dt(n){return n=M(n)?n:n.key,kt[n]||n}var Mt="keydown";var zt=i+"-lazy",Tt=zt+"-srcset",Nt="["+zt+"], ["+Tt+"]";var It=[" ","Enter"];var Rt=Object.freeze({__proto__:null,Media:function(e,n,i){var o=l(),t=i.breakpoints||{},r=[];function u(n){n&&o.destroy()}function s(n,t){t=matchMedia(t);o.bind(t,"change",a),r.push([n,t])}function a(){var n=i.direction,t=r.reduce(function(n,t){return f(n,t[1].matches?t[0]:{})},{});L(i,function(n,t){delete i[t]}),f(i,t),i.destroy?e.destroy("completely"===i.destroy):e.state.is(7)?(u(!0),e.mount()):(e.options=t,n!==i.direction&&e.refresh())}return{setup:function(){var e="min"===i.mediaQuery;c(t).sort(function(n,t){return e?+n-+t:+t-+n}).forEach(function(n){s(t[n],"("+(e?"min":"max")+"-width:"+n+"px)")}),s(i.reducedMotion||{},j),a()},mount:F,destroy:u,matches:function(t){return r.some(function(n){return n[1].media===t&&n[1].matches})}}},Direction:function(n,t,i){return{resolve:function(n,t,e){return e=e||i.direction,a[n]["rtl"!==e||t?e===Bn?0:-1:1]||n},orient:function(n){return n*("rtl"===i.direction?1:-1)}}},Elements:function(n,t,e){var i,o,r=jn(n).on,u=n.root,s=e.i18n,a={},c=[],f=[],l=[];function d(){var n;i=g("."+$n),o=I(i,"."+nt),on(i&&o,"A track/list element is missing."),_(c,E(o,"."+tt+":not(."+et+")")),L({arrows:ot,pagination:at,autoplay:lt,prev:ut,next:st,bar:ft,play:dt,pause:pt},function(n,t){a[t]=g("."+n)}),A(a,{root:u,track:i,list:o,slides:c}),n=u.id||function(n){return""+n+gn(vn[n]=(vn[n]||0)+1)}(en),u.id=n,i.id=i.id||n+"-track",o.id=o.id||n+"-list",O(u,Qn,s.carousel),O(u,Gn,"SECTION"!==u.tagName&&e.role||""),O(o,Gn,"none"),h()}function p(){x(c),$(u,f),$(i,l),R([u,i,o],Vn.concat("style"))}function h(){$(u,f),$(i,l),f=v(Zn),l=v($n),P(u,f),P(i,l)}function g(n){n=V(u,n);return n&&function(n,t){if(m(n.closest))return n.closest(t);for(var e=n;e&&1===e.nodeType&&!B(e,t);)e=e.parentElement;return e}(n,"."+Zn)===u?n:null}function v(n){return[n+"--"+e.type,n+"--"+e.direction,e.drag&&n+"--draggable",e.isNavigation&&n+"--nav",n===Zn&&gt]}return A(a,{setup:d,mount:function(){r(Ln,p),r(Ln,d),r(An,h)},destroy:p})},Slides:function(i,o,r){var n=jn(i),t=n.on,u=n.emit,s=n.bind,a=(n=o.Elements).slides,c=n.list,f=[];function e(){a.forEach(function(n,t){d(n,t,-1)})}function l(){h(function(n){n.destroy()}),x(f)}function d(n,t,e){n=St(i,t,e,n);n.mount(),f.push(n)}function p(n){return n?g(function(n){return!n.isClone}):f}function h(n,t){p(t).forEach(n)}function g(t){return f.filter(m(t)?t:function(n){return M(t)?B(n.slide,t):w(y(t),n.index)})}return{mount:function(){e(),t(Ln,l),t(Ln,e),t([mn,Ln],function(){f.sort(function(n,t){return n.index-t.index})})},destroy:l,update:function(){h(function(n){n.update()})},register:d,get:p,getIn:function(n){var t=o.Controller,e=t.toIndex(n),i=t.hasFocus()?1:r.perPage;return g(function(n){return ln(n.index,e,e+i-1)})},getAt:function(n){return g(n)[0]},add:function(n,o){b(n,function(n){var t,e,i;v(n=M(n)?J(n):n)&&((t=a[o])?N(n,t):C(c,n),P(n,r.classes.slide),n=n,e=D(u,kn),n=Z(n,"img"),(i=n.length)?n.forEach(function(n){s(n,"load error",function(){--i||e()})}):e())}),u(Ln)},remove:function(n){K(g(n).map(function(n){return n.slide})),u(Ln)},forEach:h,filter:g,style:function(t,e,i){h(function(n){n.style(t,e,i)})},getLength:function(n){return(n?a:f).length},isEnough:function(){return f.length>r.perPage}}},Layout:function(n,t,e){var i,o,r=(a=jn(n)).on,u=a.bind,s=a.emit,a=t.Slides,c=t.Direction.resolve,f=(t=t.Elements).root,l=t.track,d=t.list,p=a.getAt,h=a.style;function g(){o=null,i=e.direction===Bn,H(f,"maxWidth",tn(e.width)),H(l,c("paddingLeft"),m(!1)),H(l,c("paddingRight"),m(!0)),v()}function v(){var n=U(f);o&&o.width===n.width&&o.height===n.height||(H(l,"height",function(){var n="";i&&(on(n=y(),"height or heightRatio is missing."),n="calc("+n+" - "+m(!1)+" - "+m(!0)+")");return n}()),h(c("marginRight"),tn(e.gap)),h("width",e.autoWidth?"":tn(e.fixedWidth)||(i?"":b())),h("height",tn(e.fixedHeight)||(i?e.autoHeight?"":b():y()),!0),o=n,s(Dn))}function m(n){var t=e.padding,n=c(n?"right":"left");return t&&tn(t[n]||(W(t)?0:t))||"0px"}function y(){return tn(e.height||U(d).width*e.heightRatio)}function b(){var n=tn(e.gap);return"calc((100%"+(n&&" + "+n)+")/"+(e.perPage||1)+(n&&" - "+n)+")"}function w(n,t){var e=p(n);if(e){n=U(e.slide)[c("right")],e=U(d)[c("left")];return cn(n-e)+(t?0:_())}return 0}function _(){var n=p(0);return n&&parseFloat(H(n.slide,c("marginRight")))||0}return{mount:function(){g(),u(window,"resize load",Wn(D(s,kn))),r([An,Ln],g),r(kn,v)},listSize:function(){return U(d)[c("width")]},slideSize:function(n,t){return(n=p(n||0))?U(n.slide)[c("width")]+(t?0:_()):0},sliderSize:function(){return w(n.length-1,!0)-w(-1,!0)},totalSize:w,getPadding:function(n){return parseFloat(H(l,c("padding"+(n?"Right":"Left"))))||0}}},Clones:function(s,e,a){var n,t=jn(s),i=t.on,o=t.emit,c=e.Elements,f=e.Slides,r=e.Direction.resolve,l=[];function u(){(n=h())&&(function(o){var r=f.get().slice(),u=r.length;if(u){for(;r.length<o;)_(r,r);_(r.slice(-o),r.slice(0,o)).forEach(function(n,t){var e=t<o,i=function(n,t){n=n.cloneNode(!0);return P(n,a.classes.clone),n.id=s.root.id+"-clone"+gn(t+1),n}(n.slide,t);e?N(i,r[0].slide):C(c.list,i),_(l,i),f.register(i,t-o+(e?0:u),n.index)})}}(n),o(kn))}function d(){K(l),x(l)}function p(){n<h()&&o(Ln)}function h(){var n,t=a.clones;return s.is(Et)?t||(t=(n=a[r("fixedWidth")]&&e.Layout.slideSize(0))&&an(U(c.track)[r("width")]/n)||a[r("autoWidth")]&&s.length||2*a.perPage):t=0,t}return{mount:function(){u(),i(Ln,d),i(Ln,u),i([An,kn],p)},destroy:d}},Move:function(i,s,o){var a,n=jn(i),t=n.on,c=n.emit,f=i.state.set,r=(n=s.Layout).slideSize,e=n.getPadding,u=n.totalSize,l=n.listSize,d=n.sliderSize,p=(n=s.Direction).resolve,h=n.orient,g=(n=s.Elements).list,v=n.track;function m(){s.Controller.isBusy()||(s.Scroll.cancel(),y(i.index),c(Mn))}function y(n){b(E(n,!0))}function b(n,t){i.is(xt)||(t=t?n:function(n){{var t,e;i.is(Et)&&(e=h(n-x()),t=P(!1,n)&&e<0,e=P(!0,n)&&0<e,(t||e)&&(n=w(n,e)))}return n}(n),H(g,"transform","translate"+p("X")+"("+t+"px)"),n!==t&&c(wn))}function w(n,t){var e=n-S(t),i=d();return n-=h(i*(an(cn(e)/i)||1))*(t?1:-1)}function _(){b(x()),a.cancel()}function E(n,t){var e=h(u(n-1)-(e=n,"center"===(n=o.focus)?(l()-r(e,!0))/2:+n*r(e)||0));return t?function(n){o.trimSpace&&i.is(_t)&&(n=dn(n,0,h(d()-l())));return n}(e):e}function x(){var n=p("left");return U(g)[n]-U(v)[n]+h(e(!1))}function S(n){return E(n?s.Controller.getEnd():0,!!o.trimSpace)}function P(n,t){t=z(t)?x():t;var e=!0!==n&&h(t)<h(S(!1)),t=!1!==n&&h(t)>h(S(!0));return e||t}return{mount:function(){a=s.Transition,t([mn,Dn,An,Ln],m)},move:function(n,t,e,i){var o,r,u=x();n!==t&&(o=t<n,r=h(w(x(),o)),o?0<=r:r<=g["scroll"+p("Width")]-U(v)[p("width")])&&(_(),b(w(u,t<n),!0)),f(4),c(yn,t,e,n),a.start(t,function(){f(3),c(bn,t,e,n),i&&i()})},jump:y,translate:b,shift:w,cancel:_,toIndex:function(n){for(var t=s.Slides.get(),e=0,i=1/0,o=0;o<t.length;o++){var r=t[o].index,u=cn(E(r,!0)-n);if(!(u<=i))break;i=u,e=r}return e},toPosition:E,getPosition:x,getLimit:S,exceededLimit:P,reposition:m}},Controller:function(r,o,u){var s,i,a,n=jn(r).on,c=o.Move,f=c.getPosition,l=c.getLimit,d=c.toPosition,t=o.Slides,p=t.isEnough,e=t.getLength,h=r.is(Et),g=r.is(_t),v=D(_,!1),m=D(_,!0),y=u.start||0,b=y;function w(){s=e(!0),i=u.perMove,a=u.perPage;var n=dn(y,0,s-1);n!==y&&(y=n,c.reposition())}function _(n,t){var e=i||(A()?1:a),e=E(y+e*(n?-1:1),y,!(i||A()));return-1===e&&g&&!fn(f(),l(!n),1)?n?0:S():t?e:x(e)}function E(n,t,e){var i,o;return p()?(i=S(),(o=function(n){if(g&&"move"===u.trimSpace&&n!==y)for(var t=f();t===d(n,!0)&&ln(n,0,r.length-1);)n<y?--n:++n;return n}(n))!==n&&(t=n,n=o,e=!1),n<0||i<n?n=ln(0,n,t,!0)||ln(i,t,n,!0)?P(C(n)):h?e?n<0?-(s%a||a):s:n:u.rewind?n<0?i:0:-1:e&&n!==t&&(n=P(C(t)+(n<t?-1:1)))):n=-1,n}function x(n){return h?(n+s)%s||0:n}function S(){return un(s-(A()||h&&i?1:a),0)}function P(n){return dn(A()?n:a*n,0,S())}function C(n){return A()?n:sn((n>=S()?s-1:n)/a)}function L(n){n!==y&&(b=y,y=n)}function A(){return!z(u.focus)||u.isNavigation}function k(){return r.state.is([4,5])&&!!u.waitForTransition}return{mount:function(){w(),n([An,Ln],w)},go:function(n,t,e){var i;k()||-1<(n=x(i=function(n){var t=y;{var e,i;M(n)?(i=n.match(/([+\-<>])(\d+)?/)||[],e=i[1],i=i[2],"+"===e||"-"===e?t=E(y+ +(""+e+(+i||1)),y):">"===e?t=i?P(+i):v(!0):"<"===e&&(t=m(!0))):t=h?n:dn(n,0,S())}return t}(n)))&&(t||n!==y)&&(L(n),c.move(i,n,b,e))},scroll:function(n,t,e,i){o.Scroll.scroll(n,t,e,function(){L(x(c.toIndex(c.getPosition()))),i&&i()})},getNext:v,getPrev:m,getAdjacent:_,getEnd:S,setIndex:L,getIndex:function(n){return n?b:y},toIndex:P,toPage:C,toDest:function(n){return n=c.toIndex(n),g?dn(n,0,S()):n},hasFocus:A,isBusy:k}},Arrows:function(o,n,t){var e,i,r=jn(o),u=r.on,s=r.bind,a=r.emit,c=t.classes,f=t.i18n,l=n.Elements,d=n.Controller,p=l.arrows,h=p,g=l.prev,v=l.next,m={};function y(){!function(){var n=t.arrows;!n||g&&v||(h=p||G("div",c.arrows),g=E(!0),v=E(!1),e=!0,C(h,[g,v]),p||N(h,l.track));g&&v&&(A(m,{prev:g,next:v}),k(h,n?"":"none"),P(h,i=ot+"--"+t.direction),n&&(u([bn,Ln,Tn],x),s(v,"click",D(_,">")),s(g,"click",D(_,"<")),x(),O([g,v],Xn,l.list.id),a("arrows:mounted",g,v)))}(),u(An,b)}function b(){w(),y()}function w(){r.destroy(),$(h,i),e?(K(p?[g,v]:h),g=v=null):R([g,v],Vn)}function _(n){d.go(n,!0)}function E(n){return J('<button class="'+c.arrow+" "+(n?c.prev:c.next)+'" type="button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40"><path d="'+(t.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")+'" />')}function x(){var n=o.index,t=d.getPrev(),e=d.getNext(),i=-1<t&&n<t?f.last:f.prev,n=-1<e&&e<n?f.first:f.next;g.disabled=t<0,v.disabled=e<0,O(g,Un,i),O(v,Un,n),a("arrows:updated",g,v,t,e)}return{arrows:m,mount:y,destroy:w}},Autoplay:function(t,e,i){var o,r,n=jn(t),u=n.on,s=n.bind,a=n.emit,c=Fn(i.interval,t.go.bind(t,">"),function(n){var t=l.bar;t&&H(t,"width",100*n+"%"),a("autoplay:playing",n)}),f=c.isPaused,l=e.Elements,d=i.autoplay,p="pause"===d;function h(n){var t=n?"pause":"play",e=l[t];e&&(O(e,Xn,l.track.id),O(e,Un,i.i18n[t]),s(e,"click",n?v:g))}function g(){f()&&e.Slides.isEnough()&&(c.start(!i.resetProgress),r=o=p=!1,a(In))}function v(n){void 0===n&&(n=!0),f()||(c.pause(),a(Rn)),p=n}function m(){p||(o||r?v(!1):g())}function y(){var n=e.Slides.getAt(t.index);c.set(n&&+Y(n.slide,Pt)||i.interval)}return{mount:function(){d&&(h(!0),h(!1),function(){var n=l.root;i.pauseOnHover&&s(n,"mouseenter mouseleave",function(n){o="mouseenter"===n.type,m()});i.pauseOnFocus&&s(n,"focusin focusout",function(n){r="focusin"===n.type,m()});u([yn,zn,Ln],c.rewind),u(yn,y)}(),p||g())},destroy:c.cancel,play:g,pause:v,isPaused:f}},Cover:function(n,t,e){var i=jn(n).on;function o(e){t.Slides.forEach(function(n){var t=I(n.container||n.slide,"img");t&&t.src&&r(e,t,n)})}function r(n,t,e){e.style("background",n?'center/cover no-repeat url("'+t.src+'")':"",!0),k(t,n?"none":"")}return{mount:function(){e.cover&&(i(On,D(r,!0)),i([mn,An,Ln],D(o,!0)))},destroy:D(o,!1)}},Scroll:function(r,s,u){var a,c,n=jn(r),t=n.on,f=n.emit,l=r.state.set,d=s.Move,p=d.getPosition,h=d.getLimit,g=d.exceededLimit,v=d.translate,m=1;function y(n,t,e,i,o){var r=p();_(),e&&(e=s.Layout.sliderSize(),u=pn(n)*e*sn(cn(n)/e)||0,n=d.toPosition(s.Controller.toDest(n%e))+u);var u=fn(r,n,1);m=1,t=u?0:t||un(cn(n-r)/1.5,800),c=i,a=Fn(t,b,D(w,r,n,o),1),l(5),f(zn),a.start()}function b(){l(3),c&&c(),f(Tn)}function w(n,t,e,i){var o=p(),n=(n+(t-n)*(n=i,(i=u.easingFunc)?i(n):1-Math.pow(1-n,4))-o)*m;v(o+n),r.is(_t)&&!e&&g()&&(m*=.6,cn(n)<10&&y(h(g(!0)),600,!1,void 0,!0))}function _(){a&&a.cancel()}function e(){a&&!a.isPaused()&&(_(),b())}return{mount:function(){t(yn,_),t([An,Ln],e)},destroy:_,scroll:y,cancel:e}},Drag:function(r,u,s){var a,t,o,c,f,l,d,p,n=jn(r),e=n.on,h=n.emit,g=n.bind,i=n.unbind,v=r.state,m=u.Move,y=u.Scroll,b=u.Controller,w=u.Elements.track,_=(n=u.Direction).resolve,E=n.orient,x=m.getPosition,S=m.exceededLimit,P=!1;function C(){var n=s.drag;O(!n),c="free"===n}function L(n){var t,e,i;l=!1,d||(t=R(n),e=n.target,i=s.noDrag,B(e,"."+ct+", ."+rt)||i&&B(e,i)||!t&&n.button||(b.isBusy()?Q(n,!0):(p=t?w:window,f=v.is([4,5]),o=null,g(p,Lt,A,Ct),g(p,At,k,Ct),m.cancel(),y.cancel(),M(n))))}function A(n){var t,e,i,o;v.is(6)||(v.set(6),h("drag")),n.cancelable&&(f?(m.translate(a+z(n)/(P&&r.is(_t)?5:1)),e=200<T(n),i=P!==(P=S()),(e||i)&&M(n),l=!0,h("dragging"),Q(n)):cn(z(o=n))>cn(z(o,!0))&&(t=n,e=s.dragMinThreshold,i=W(e),o=i&&e.mouse||0,e=(i?e.touch:+e)||10,f=cn(z(t))>(R(t)?e:o),Q(n)))}function k(n){v.is(6)&&(v.set(3),h("dragged")),f&&(function(n){var t=function(n){if(r.is(Et)||!P){var t=T(n);if(t&&t<200)return z(n)/t}return 0}(n),e=function(n){return x()+pn(n)*rn(cn(n)*(s.flickPower||600),c?1/0:u.Layout.listSize()*(s.flickMaxPages||1))}(t),i=s.rewind&&s.rewindByDrag,o=u.Media.matches(j),n=b.go;o&&delete s.speed;c?b.scroll(e,0,s.snap):r.is(xt)?n(E(pn(t))<0?i?"<":"-":i?">":"+"):r.is(_t)&&P&&i?n(S(!0)?">":"<"):n(b.toDest(e),!0);o&&(s.speed=0)}(n),Q(n)),i(p,Lt,A),i(p,At,k),f=!1}function D(n){!d&&l&&Q(n,!0)}function M(n){o=t,t=n,a=x()}function z(n,t){return I(n,t)-I(N(n),t)}function T(n){return nn(n)-nn(N(n))}function N(n){return t===n&&o||t}function I(n,t){return(R(n)?n.changedTouches[0]:n)["page"+_(t?"Y":"X")]}function R(n){return"undefined"!=typeof TouchEvent&&n instanceof TouchEvent}function O(n){d=n}return{mount:function(){g(w,Lt,F,Ct),g(w,At,F,Ct),g(w,"touchstart mousedown",L,Ct),g(w,"click",D,{capture:!0}),g(w,"dragstart",Q),e([mn,An],C)},disable:O,isDragging:function(){return f}}},Keyboard:function(t,n,e){var i,o,r=jn(t),u=r.on,s=r.bind,a=r.unbind,c=t.root,f=n.Direction.resolve;function l(){var n=e.keyboard;n&&(i="global"===n?window:c,s(i,Mt,h))}function d(){a(i,Mt)}function p(){var n=o;o=!0,g(function(){o=n})}function h(n){o||((n=Dt(n))===f("ArrowLeft")?t.go("<"):n===f("ArrowRight")&&t.go(">"))}return{mount:function(){l(),u(An,d),u(An,l),u(yn,p)},destroy:d,disable:function(n){o=n}}},LazyLoad:function(e,n,u){var t=jn(e),i=t.on,o=t.off,r=t.bind,s=t.emit,a="sequential"===u.lazyLoad,c=[],f=0;function l(){n.Slides.forEach(function(r){Z(r.slide,Nt).forEach(function(n){var t,e,i=Y(n,zt),o=Y(n,Tt);i===n.src&&o===n.srcset||(t=u.classes.spinner,O(e=I(e=n.parentElement,"."+t)||G("span",t,e),Gn,"presentation"),c.push({_img:n,_Slide:r,src:i,srcset:o,_spinner:e}),n.src||k(n,"none"))})}),a&&g()}function d(){f=0,c=[]}function p(){(c=c.filter(function(n){var t=u.perPage*((u.preloadPages||1)+1)-1;return!n._Slide.isWithin(e.index,t)||h(n)})).length||o(bn)}function h(t){var e=t._img;P(t._Slide.slide,bt),r(e,"load error",function(n){!function(n,t){var e=n._Slide;$(e.slide,bt),t||(K(n._spinner),k(n._img,""),s(On,n._img,e),s(kn));a&&g()}(t,"error"===n.type)}),["srcset","src"].forEach(function(n){t[n]&&(O(e,n,t[n]),R(e,"src"===n?zt:Tt))})}function g(){f<c.length&&h(c[f++])}return{mount:function(){u.lazyLoad&&(l(),i(Ln,d),i(Ln,l),a||i([mn,Ln,bn,Tn],p))},destroy:d}},Pagination:function(f,n,l){var d,p,t=jn(f),e=t.on,i=t.emit,h=t.bind,g=n.Slides,v=n.Elements,o=n.Controller,m=o.hasFocus,r=o.getIndex,u=o.go,s=n.Direction.resolve,y=[];function a(){d&&(t.destroy(),K(v.pagination?S(d.children):d),$(d,p),x(y),d=null)}function b(n){u(">"+n,!0)}function w(n,t){var e=y.length,i=Dt(t),o=_(),r=-1;i===s("ArrowRight",!1,o)?r=++n%e:i===s("ArrowLeft",!1,o)?r=(--n+e)%e:"Home"===i?r=0:"End"===i&&(r=e-1);e=y[r];e&&(X(e.button),u(">"+r),Q(t,!0))}function _(){return l.paginationDirection||l.direction}function c(n){return y[o.toPage(n)]}function E(){var n,t=c(r(!0)),e=c(r());t&&($(n=t.button,gt),R(n,qn),O(n,Hn,-1)),e&&(P(n=e.button,gt),O(n,qn,!0),O(n,Hn,"")),i("pagination:updated",{list:d,items:y},t,e)}return{items:y,mount:function n(){a(),e([An,Ln],n),l.pagination&&g.isEnough()&&(e([yn,zn,Tn],E),function(){var n=f.length,t=l.classes,e=l.i18n,i=l.perPage,o=m()?n:an(n/i);P(d=v.pagination||G("ul",t.pagination,v.root),p=at+"--"+_()),O(d,Gn,"tablist"),O(d,Un,e.select),O(d,Jn,_()===Bn?"vertical":"");for(var r=0;r<o;r++){var u=G("li",null,d),s=G("button",{class:t.page,type:"button"},u),a=g.getIn(r).map(function(n){return n.slide.id}),c=!m()&&1<i?e.pageX:e.slideX;h(s,"click",D(b,r)),l.paginationKeyboard&&h(s,"keydown",D(w,r)),O(u,Gn,"none"),O(s,Gn,"tab"),O(s,Xn,a.join(" ")),O(s,Un,hn(c,r+1)),O(s,Hn,-1),y.push({li:u,button:s,page:r})}}(),E(),i("pagination:mounted",{list:d,items:y},c(f.index)))},destroy:a,getAt:c,update:E}},Sync:function(o,n,e){var t=n.Elements.list,r=[];function i(){var n,t;o.splides.forEach(function(n){var e;n.isParent||(e=n.splide,[o,e].forEach(function(n){var t=jn(n),i=n===o?e:o;t.on(yn,function(n,t,e){i.go(i.is(Et)?e:n)}),r.push(t)}))}),e.isNavigation&&(n=jn(o),(t=n.on)(_n,a),t(Cn,c),t([mn,An],s),r.push(n),n.emit(Nn,o.splides))}function u(){r.forEach(function(n){n.destroy()}),x(r)}function s(){O(t,Jn,e.direction===Bn?"vertical":"")}function a(n){o.go(n.index)}function c(n,t){w(It,Dt(t))&&(a(n),Q(t))}return{mount:i,destroy:u,remount:function(){u(),i()}}},Wheel:function(u,s,a){var n=jn(u).bind,c=0;function t(n){var t,e,i,o,r;n.cancelable&&(r=(t=n.deltaY)<0,e=nn(n),i=a.wheelMinThreshold||0,o=a.wheelSleep||0,cn(t)>i&&o<e-c&&(u.go(r?"<":">"),c=e),r=r,a.releaseWheel&&!u.state.is(4)&&-1===s.Controller.getAdjacent(r)||Q(n))}return{mount:function(){a.wheel&&n(s.Elements.track,"wheel",t,Ct)}}},Live:function(n,t,e){var i=jn(n).on,o=t.Elements.list,r=e.live&&!e.isNavigation;function u(n){r&&O(o,h,n?"off":"polite")}return{mount:function(){r&&(O(o,d,!1),u(!t.Autoplay.isPaused()),i(In,D(u,!0)),i(Rn,D(u,!1)))},disable:u}}}),Ot={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:{slide:tt,clone:et,arrows:ot,arrow:rt,prev:ut,next:st,pagination:at,page:ct,spinner:en+"__spinner"},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",carousel:"carousel",slide:"slide",select:"Select slide to show",slideLabel:"%s of %s"},reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function jt(n,i,t){var e=jn(n).on;return{mount:function(){e([mn,Ln],function(){g(function(){i.Slides.style("transition","opacity "+t.speed+"ms "+t.easing)})})},start:function(n,t){var e=i.Elements.track;H(e,"height",tn(U(e).height)),g(function(){t(),H(e,"height","")})},cancel:F}}function Ft(r,n,u){var s,t=jn(r).bind,a=n.Move,c=n.Controller,f=n.Scroll,e=n.Elements.list,l=D(H,e,"transition");function i(){l(""),f.cancel()}return{mount:function(){t(e,"transitionend",function(n){n.target===e&&s&&(i(),s())})},start:function(n,t){var e=a.toPosition(n,!0),i=a.getPosition(),o=function(n){var t=u.rewindSpeed;if(r.is(_t)&&t){var e=c.getIndex(!0),i=c.getEnd();if(0===e&&i<=n||i<=e&&0===n)return t}return u.speed}(n);1<=cn(e-i)&&1<=o?u.useScroll?f.scroll(e,o,!1,t):(l("transform "+o+"ms "+u.easing),a.translate(e,!0),s=t):(a.jump(n),t())},cancel:i}}e=function(){function e(n,t){this.event=jn(),this.Components={},this.state=s(1),this.splides=[],this._options={},this._Extensions={};n=M(n)?V(document,n):n;on(n,n+" is invalid."),this.root=n,t=f({},Ot,e.defaults,t||{});try{f(t,JSON.parse(Y(n,i)))}catch(n){on(!1,"Invalid JSON")}this._options=Object.create(f({},t))}var n=e.prototype;return n.mount=function(n,t){var e=this,i=this.state,o=this.Components;return on(i.is([1,7]),"Already mounted!"),i.set(1),this._Components=o,this._Transition=t||this._Transition||(this.is(xt)?jt:Ft),this._Extensions=n||this._Extensions,L(A({},Rt,this._Extensions,{Transition:this._Transition}),function(n,t){n=n(e,o,e._options);(o[t]=n).setup&&n.setup()}),L(o,function(n){n.mount&&n.mount()}),this.emit(mn),P(this.root,"is-initialized"),i.set(3),this.emit("ready"),this},n.sync=function(n){return this.splides.push({splide:n}),n.splides.push({splide:this,isParent:!0}),this.state.is(3)&&(this._Components.Sync.remount(),n.Components.Sync.remount()),this},n.go=function(n){return this._Components.Controller.go(n),this},n.on=function(n,t){return this.event.on(n,t),this},n.off=function(n){return this.event.off(n),this},n.emit=function(n){var t;return(t=this.event).emit.apply(t,[n].concat(S(arguments,1))),this},n.add=function(n,t){return this._Components.Slides.add(n,t),this},n.remove=function(n){return this._Components.Slides.remove(n),this},n.is=function(n){return this._options.type===n},n.refresh=function(){return this.emit(Ln),this},n.destroy=function(t){void 0===t&&(t=!0);var n=this.event,e=this.state;return e.is(1)?jn(this).on("ready",this.destroy.bind(this,t)):(L(this._Components,function(n){n.destroy&&n.destroy(t)},!0),n.emit(u),n.destroy(),t&&x(this.splides),e.set(7)),this},_createClass(e,[{key:"options",get:function(){return this._options},set:function(n){var t=this._options;f(t,n),this.state.is(1)||this.emit(An,t)}},{key:"length",get:function(){return this._Components.Slides.getLength(!0)}},{key:"index",get:function(){return this._Components.Controller.getIndex()}}]),e}();return e.defaults={},e.STATES=n,e});
  2. //# sourceMappingURL=splide.min.js.map