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