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