swipe.min.js
44 KB
var Swiper=function(e,t){"use strict";function i(e,t){return document.querySelectorAll?(t||document).querySelectorAll(e):jQuery(e,t)}function n(e){return"[object Array]"===Object.prototype.toString.apply(e)?!0:!1}function r(){var e=I-N;return t.freeMode&&(e=I-N),t.slidesPerView>k.slides.length&&!t.centeredSlides&&(e=0),0>e&&(e=0),e}function s(){function e(e){var i=new Image;i.onload=function(){"undefined"!=typeof k&&null!==k&&(void 0!==k.imagesLoaded&&k.imagesLoaded++,k.imagesLoaded===k.imagesToLoad.length&&(k.reInit(),t.onImagesReady&&k.fireCallback(t.onImagesReady,k)))},i.src=e}var n=k.h.addEventListener,r="wrapper"===t.eventTarget?k.wrapper:k.container;if(k.browser.ie10||k.browser.ie11?(n(r,k.touchEvents.touchStart,g),n(document,k.touchEvents.touchMove,w),n(document,k.touchEvents.touchEnd,v)):(k.support.touch&&(n(r,"touchstart",g),n(r,"touchmove",w),n(r,"touchend",v)),t.simulateTouch&&(n(r,"mousedown",g),n(document,"mousemove",w),n(document,"mouseup",v))),t.autoResize&&n(window,"resize",k.resizeFix),o(),k._wheelEvent=!1,t.mousewheelControl){if(void 0!==document.onmousewheel&&(k._wheelEvent="mousewheel"),!k._wheelEvent)try{new WheelEvent("wheel"),k._wheelEvent="wheel"}catch(s){}k._wheelEvent||(k._wheelEvent="DOMMouseScroll"),k._wheelEvent&&n(k.container,k._wheelEvent,d)}if(t.keyboardControl&&n(document,"keydown",l),t.updateOnImagesReady){k.imagesToLoad=i("img",k.container);for(var a=0;a<k.imagesToLoad.length;a++)e(k.imagesToLoad[a].getAttribute("src"))}}function o(){var e=k.h.addEventListener,n;if(t.preventLinks){var r=i("a",k.container);for(n=0;n<r.length;n++)e(r[n],"click",f)}if(t.releaseFormElements){var s=i("input, textarea, select",k.container);for(n=0;n<s.length;n++)e(s[n],k.touchEvents.touchStart,h,!0)}if(t.onSlideClick)for(n=0;n<k.slides.length;n++)e(k.slides[n],"click",p);if(t.onSlideTouch)for(n=0;n<k.slides.length;n++)e(k.slides[n],k.touchEvents.touchStart,u)}function a(){var e=k.h.removeEventListener,n;if(t.onSlideClick)for(n=0;n<k.slides.length;n++)e(k.slides[n],"click",p);if(t.onSlideTouch)for(n=0;n<k.slides.length;n++)e(k.slides[n],k.touchEvents.touchStart,u);if(t.releaseFormElements){var r=i("input, textarea, select",k.container);for(n=0;n<r.length;n++)e(r[n],k.touchEvents.touchStart,h,!0)}if(t.preventLinks){var s=i("a",k.container);for(n=0;n<s.length;n++)e(s[n],"click",f)}}function l(e){var t=e.keyCode||e.charCode;if(!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)){if(37===t||39===t||38===t||40===t){for(var i=!1,n=k.h.getOffset(k.container),r=k.h.windowScroll().left,s=k.h.windowScroll().top,o=k.h.windowWidth(),a=k.h.windowHeight(),l=[[n.left,n.top],[n.left+k.width,n.top],[n.left,n.top+k.height],[n.left+k.width,n.top+k.height]],d=0;d<l.length;d++){var p=l[d];p[0]>=r&&p[0]<=r+o&&p[1]>=s&&p[1]<=s+a&&(i=!0)}if(!i)return}F?((37===t||39===t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1),39===t&&k.swipeNext(),37===t&&k.swipePrev()):((38===t||40===t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1),40===t&&k.swipeNext(),38===t&&k.swipePrev())}}function d(e){var i=k._wheelEvent,n=0;if(e.detail)n=-e.detail;else if("mousewheel"===i)if(t.mousewheelControlForceToAxis)if(F){if(!(Math.abs(e.wheelDeltaX)>Math.abs(e.wheelDeltaY)))return;n=e.wheelDeltaX}else{if(!(Math.abs(e.wheelDeltaY)>Math.abs(e.wheelDeltaX)))return;n=e.wheelDeltaY}else n=e.wheelDelta;else if("DOMMouseScroll"===i)n=-e.detail;else if("wheel"===i)if(t.mousewheelControlForceToAxis)if(F){if(!(Math.abs(e.deltaX)>Math.abs(e.deltaY)))return;n=-e.deltaX}else{if(!(Math.abs(e.deltaY)>Math.abs(e.deltaX)))return;n=-e.deltaY}else n=Math.abs(e.deltaX)>Math.abs(e.deltaY)?-e.deltaX:-e.deltaY;if(t.freeMode){var s=k.getWrapperTranslate()+n;if(s>0&&(s=0),s<-r()&&(s=-r()),k.setWrapperTransition(0),k.setWrapperTranslate(s),k.updateActiveSlide(s),0===s||s===-r())return}else(new Date).getTime()-q>60&&(0>n?k.swipeNext():k.swipePrev()),q=(new Date).getTime();return t.autoplay&&k.stopAutoplay(!0),e.preventDefault?e.preventDefault():e.returnValue=!1,!1}function p(e){k.allowSlideClick&&(c(e),k.fireCallback(t.onSlideClick,k,e))}function u(e){c(e),k.fireCallback(t.onSlideTouch,k,e)}function c(e){if(e.currentTarget)k.clickedSlide=e.currentTarget;else{var i=e.srcElement;do{if(i.className.indexOf(t.slideClass)>-1)break;i=i.parentNode}while(i);k.clickedSlide=i}k.clickedSlideIndex=k.slides.indexOf(k.clickedSlide),k.clickedSlideLoopIndex=k.clickedSlideIndex-(k.loopedSlides||0)}function f(e){return k.allowLinks?void 0:(e.preventDefault?e.preventDefault():e.returnValue=!1,t.preventLinksPropagation&&"stopPropagation"in e&&e.stopPropagation(),!1)}function h(e){return e.stopPropagation?e.stopPropagation():e.returnValue=!1,!1}function g(e){if(t.preventLinks&&(k.allowLinks=!0),k.isTouched||t.onlyExternal)return!1;var i=e.target||e.srcElement;document.activeElement&&document.activeElement!==i&&document.activeElement.blur();var n="input select textarea".split(" ");if(t.noSwiping&&i&&m(i))return!1;if(U=!1,k.isTouched=!0,K="touchstart"===e.type,!K&&"which"in e&&3===e.which)return!1;if(!K||1===e.targetTouches.length){k.callPlugins("onTouchStartBegin"),!K&&!k.isAndroid&&n.indexOf(i.tagName.toLowerCase())<0&&(e.preventDefault?e.preventDefault():e.returnValue=!1);var r=K?e.targetTouches[0].pageX:e.pageX||e.clientX,s=K?e.targetTouches[0].pageY:e.pageY||e.clientY;k.touches.startX=k.touches.currentX=r,k.touches.startY=k.touches.currentY=s,k.touches.start=k.touches.current=F?r:s,k.setWrapperTransition(0),k.positions.start=k.positions.current=k.getWrapperTranslate(),k.setWrapperTranslate(k.positions.start),k.times.start=(new Date).getTime(),D=void 0,t.moveStartThreshold>0&&(Q=!1),t.onTouchStart&&k.fireCallback(t.onTouchStart,k,e),k.callPlugins("onTouchStartEnd")}}function w(e){if(k.isTouched&&!t.onlyExternal&&(!K||"mousemove"!==e.type)){var i=K?e.targetTouches[0].pageX:e.pageX||e.clientX,n=K?e.targetTouches[0].pageY:e.pageY||e.clientY;if("undefined"==typeof D&&F&&(D=!!(D||Math.abs(n-k.touches.startY)>Math.abs(i-k.touches.startX))),"undefined"!=typeof D||F||(D=!!(D||Math.abs(n-k.touches.startY)<Math.abs(i-k.touches.startX))),D)return void(k.isTouched=!1);if(F){if(!t.swipeToNext&&i<k.touches.startX||!t.swipeToPrev&&i>k.touches.startX)return}else if(!t.swipeToNext&&n<k.touches.startY||!t.swipeToPrev&&n>k.touches.startY)return;if(e.assignedToSwiper)return void(k.isTouched=!1);if(e.assignedToSwiper=!0,t.preventLinks&&(k.allowLinks=!1),t.onSlideClick&&(k.allowSlideClick=!1),t.autoplay&&k.stopAutoplay(!0),!K||1===e.touches.length){if(k.isMoved||(k.callPlugins("onTouchMoveStart"),t.loop&&(k.fixLoop(),k.positions.start=k.getWrapperTranslate()),t.onTouchMoveStart&&k.fireCallback(t.onTouchMoveStart,k)),k.isMoved=!0,e.preventDefault?e.preventDefault():e.returnValue=!1,k.touches.current=F?i:n,k.positions.current=(k.touches.current-k.touches.start)*t.touchRatio+k.positions.start,k.positions.current>0&&t.onResistanceBefore&&k.fireCallback(t.onResistanceBefore,k,k.positions.current),k.positions.current<-r()&&t.onResistanceAfter&&k.fireCallback(t.onResistanceAfter,k,Math.abs(k.positions.current+r())),t.resistance&&"100%"!==t.resistance){var s;if(k.positions.current>0&&(s=1-k.positions.current/N/2,.5>s?k.positions.current=N/2:k.positions.current=k.positions.current*s),k.positions.current<-r()){var o=(k.touches.current-k.touches.start)*t.touchRatio+(r()+k.positions.start);s=(N+o)/N;var a=k.positions.current-o*(1-s)/2,l=-r()-N/2;l>a||0>=s?k.positions.current=l:k.positions.current=a}}if(t.resistance&&"100%"===t.resistance&&(k.positions.current>0&&(!t.freeMode||t.freeModeFluid)&&(k.positions.current=0),k.positions.current<-r()&&(!t.freeMode||t.freeModeFluid)&&(k.positions.current=-r())),!t.followFinger)return;if(t.moveStartThreshold)if(Math.abs(k.touches.current-k.touches.start)>t.moveStartThreshold||Q){if(!Q)return Q=!0,void(k.touches.start=k.touches.current);k.setWrapperTranslate(k.positions.current)}else k.positions.current=k.positions.start;else k.setWrapperTranslate(k.positions.current);return(t.freeMode||t.watchActiveIndex)&&k.updateActiveSlide(k.positions.current),t.grabCursor&&(k.container.style.cursor="move",k.container.style.cursor="grabbing",k.container.style.cursor="-moz-grabbin",k.container.style.cursor="-webkit-grabbing"),Z||(Z=k.touches.current),J||(J=(new Date).getTime()),k.velocity=(k.touches.current-Z)/((new Date).getTime()-J)/2,Math.abs(k.touches.current-Z)<2&&(k.velocity=0),Z=k.touches.current,J=(new Date).getTime(),k.callPlugins("onTouchMoveEnd"),t.onTouchMove&&k.fireCallback(t.onTouchMove,k,e),!1}}}function v(e){if(D&&k.swipeReset(),!t.onlyExternal&&k.isTouched){k.isTouched=!1,t.grabCursor&&(k.container.style.cursor="move",k.container.style.cursor="grab",k.container.style.cursor="-moz-grab",k.container.style.cursor="-webkit-grab"),k.positions.current||0===k.positions.current||(k.positions.current=k.positions.start),t.followFinger&&k.setWrapperTranslate(k.positions.current),k.times.end=(new Date).getTime(),k.touches.diff=k.touches.current-k.touches.start,k.touches.abs=Math.abs(k.touches.diff),k.positions.diff=k.positions.current-k.positions.start,k.positions.abs=Math.abs(k.positions.diff);var i=k.positions.diff,n=k.positions.abs,s=k.times.end-k.times.start;5>n&&300>s&&k.allowLinks===!1&&(t.freeMode||0===n||k.swipeReset(),t.preventLinks&&(k.allowLinks=!0),t.onSlideClick&&(k.allowSlideClick=!0)),setTimeout(function(){"undefined"!=typeof k&&null!==k&&(t.preventLinks&&(k.allowLinks=!0),t.onSlideClick&&(k.allowSlideClick=!0))},100);var o=r();if(!k.isMoved&&t.freeMode)return k.isMoved=!1,t.onTouchEnd&&k.fireCallback(t.onTouchEnd,k,e),void k.callPlugins("onTouchEnd");if(!k.isMoved||k.positions.current>0||k.positions.current<-o)return k.swipeReset(),t.onTouchEnd&&k.fireCallback(t.onTouchEnd,k,e),void k.callPlugins("onTouchEnd");if(k.isMoved=!1,t.freeMode){if(t.freeModeFluid){var a=1e3*t.momentumRatio,l=k.velocity*a,d=k.positions.current+l,p=!1,u,c=20*Math.abs(k.velocity)*t.momentumBounceRatio;-o>d&&(t.momentumBounce&&k.support.transitions?(-c>d+o&&(d=-o-c),u=-o,p=!0,U=!0):d=-o),d>0&&(t.momentumBounce&&k.support.transitions?(d>c&&(d=c),u=0,p=!0,U=!0):d=0),0!==k.velocity&&(a=Math.abs((d-k.positions.current)/k.velocity)),k.setWrapperTranslate(d),k.setWrapperTransition(a),t.momentumBounce&&p&&k.wrapperTransitionEnd(function(){U&&(t.onMomentumBounce&&k.fireCallback(t.onMomentumBounce,k),k.callPlugins("onMomentumBounce"),k.setWrapperTranslate(u),k.setWrapperTransition(300))}),k.updateActiveSlide(d)}return(!t.freeModeFluid||s>=300)&&k.updateActiveSlide(k.positions.current),t.onTouchEnd&&k.fireCallback(t.onTouchEnd,k,e),void k.callPlugins("onTouchEnd")}W=0>i?"toNext":"toPrev","toNext"===W&&300>=s&&(30>n||!t.shortSwipes?k.swipeReset():k.swipeNext(!0)),"toPrev"===W&&300>=s&&(30>n||!t.shortSwipes?k.swipeReset():k.swipePrev(!0));var f=0;if("auto"===t.slidesPerView){for(var h=Math.abs(k.getWrapperTranslate()),g=0,w,v=0;v<k.slides.length;v++)if(w=F?k.slides[v].getWidth(!0,t.roundLengths):k.slides[v].getHeight(!0,t.roundLengths),g+=w,g>h){f=w;break}f>N&&(f=N)}else f=A*t.slidesPerView;"toNext"===W&&s>300&&(n>=f*t.longSwipesRatio?k.swipeNext(!0):k.swipeReset()),"toPrev"===W&&s>300&&(n>=f*t.longSwipesRatio?k.swipePrev(!0):k.swipeReset()),t.onTouchEnd&&k.fireCallback(t.onTouchEnd,k,e),k.callPlugins("onTouchEnd")}}function m(e){var i=!1;do e.className.indexOf(t.noSwipingClass)>-1&&(i=!0),e=e.parentElement;while(!i&&e.parentElement&&-1===e.className.indexOf(t.wrapperClass));return!i&&e.className.indexOf(t.wrapperClass)>-1&&e.className.indexOf(t.noSwipingClass)>-1&&(i=!0),i}function S(e,t){var i=document.createElement("div"),n;return i.innerHTML=t,n=i.firstChild,n.className+=" "+e,n.outerHTML}function T(e,i,n){function r(){var s=+new Date,u=s-o;a+=l*u/(1e3/60),p="toNext"===d?a>e:e>a,p?(k.setWrapperTranslate(Math.ceil(a)),k._DOMAnimating=!0,window.setTimeout(function(){r()},1e3/60)):(t.onSlideChangeEnd&&("to"===i?n.runCallbacks===!0&&k.fireCallback(t.onSlideChangeEnd,k,d):k.fireCallback(t.onSlideChangeEnd,k,d)),k.setWrapperTranslate(e),k._DOMAnimating=!1)}var s="to"===i&&n.speed>=0?n.speed:t.speed,o=+new Date;if(k.support.transitions||!t.DOMAnimation)k.setWrapperTranslate(e),k.setWrapperTransition(s);else{var a=k.getWrapperTranslate(),l=Math.ceil((e-a)/s*(1e3/60)),d=a>e?"toNext":"toPrev",p="toNext"===d?a>e:e>a;if(k._DOMAnimating)return;r()}k.updateActiveSlide(e),t.onSlideNext&&"next"===i&&k.fireCallback(t.onSlideNext,k,e),t.onSlidePrev&&"prev"===i&&k.fireCallback(t.onSlidePrev,k,e),t.onSlideReset&&"reset"===i&&k.fireCallback(t.onSlideReset,k,e),("next"===i||"prev"===i||"to"===i&&n.runCallbacks===!0)&&y(i)}function y(e){if(k.callPlugins("onSlideChangeStart"),t.onSlideChangeStart)if(t.queueStartCallbacks&&k.support.transitions){if(k._queueStartCallbacks)return;k._queueStartCallbacks=!0,k.fireCallback(t.onSlideChangeStart,k,e),k.wrapperTransitionEnd(function(){k._queueStartCallbacks=!1})}else k.fireCallback(t.onSlideChangeStart,k,e);if(t.onSlideChangeEnd)if(k.support.transitions)if(t.queueEndCallbacks){if(k._queueEndCallbacks)return;k._queueEndCallbacks=!0,k.wrapperTransitionEnd(function(i){k.fireCallback(t.onSlideChangeEnd,i,e)})}else k.wrapperTransitionEnd(function(i){k.fireCallback(t.onSlideChangeEnd,i,e)});else t.DOMAnimation||setTimeout(function(){k.fireCallback(t.onSlideChangeEnd,k,e)},10)}function x(){var e=k.paginationButtons;if(e)for(var t=0;t<e.length;t++)k.h.removeEventListener(e[t],"click",C)}function b(){var e=k.paginationButtons;if(e)for(var t=0;t<e.length;t++)k.h.addEventListener(e[t],"click",C)}function C(e){for(var i,n=e.target||e.srcElement,r=k.paginationButtons,s=0;s<r.length;s++)n===r[s]&&(i=s);t.autoplay&&k.stopAutoplay(!0),k.swipeTo(i)}function L(){ee=setTimeout(function(){t.loop?(k.fixLoop(),k.swipeNext(!0)):k.swipeNext(!0)||(t.autoplayStopOnLast?(clearTimeout(ee),ee=void 0):k.swipeTo(0)),k.wrapperTransitionEnd(function(){"undefined"!=typeof ee&&L()})},t.autoplay)}function M(){k.calcSlides(),t.loader.slides.length>0&&0===k.slides.length&&k.loadSlides(),t.loop&&k.createLoop(),k.init(),s(),t.pagination&&k.createPagination(!0),t.loop||t.initialSlide>0?k.swipeTo(t.initialSlide,0,!1):k.updateActiveSlide(0),t.autoplay&&k.startAutoplay(),k.centerIndex=k.activeIndex,t.onSwiperCreated&&k.fireCallback(t.onSwiperCreated,k),k.callPlugins("onSwiperCreated")}if(!document.body.outerHTML&&document.body.__defineGetter__&&HTMLElement){var E=HTMLElement.prototype;E.__defineGetter__&&E.__defineGetter__("outerHTML",function(){return(new XMLSerializer).serializeToString(this)})}if(window.getComputedStyle||(window.getComputedStyle=function(e,t){return this.el=e,this.getPropertyValue=function(t){var i=/(\-([a-z]){1})/g;return"float"===t&&(t="styleFloat"),i.test(t)&&(t=t.replace(i,function(){return arguments[2].toUpperCase()})),e.currentStyle[t]?e.currentStyle[t]:null},this}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){for(var i=t||0,n=this.length;n>i;i++)if(this[i]===e)return i;return-1}),(document.querySelectorAll||window.jQuery)&&"undefined"!=typeof e&&(e.nodeType||0!==i(e).length)){var k=this;k.touches={start:0,startX:0,startY:0,current:0,currentX:0,currentY:0,diff:0,abs:0},k.positions={start:0,abs:0,diff:0,current:0},k.times={start:0,end:0},k.id=(new Date).getTime(),k.container=e.nodeType?e:i(e)[0],k.isTouched=!1,k.isMoved=!1,k.activeIndex=0,k.centerIndex=0,k.activeLoaderIndex=0,k.activeLoopIndex=0,k.previousIndex=null,k.velocity=0,k.snapGrid=[],k.slidesGrid=[],k.imagesToLoad=[],k.imagesLoaded=0,k.wrapperLeft=0,k.wrapperRight=0,k.wrapperTop=0,k.wrapperBottom=0,k.isAndroid=navigator.userAgent.toLowerCase().indexOf("android")>=0;var P,A,I,W,D,N,G={eventTarget:"wrapper",mode:"horizontal",touchRatio:1,speed:300,freeMode:!1,freeModeFluid:!1,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,slidesPerView:1,slidesPerGroup:1,slidesPerViewFit:!0,simulateTouch:!0,followFinger:!0,shortSwipes:!0,longSwipesRatio:.5,moveStartThreshold:!1,onlyExternal:!1,createPagination:!0,pagination:!1,paginationElement:"span",paginationClickable:!1,paginationAsRange:!0,resistance:!0,scrollContainer:!1,preventLinks:!0,preventLinksPropagation:!1,noSwiping:!1,noSwipingClass:"swiper-no-swiping",initialSlide:0,keyboardControl:!1,mousewheelControl:!1,mousewheelControlForceToAxis:!1,useCSS3Transforms:!0,autoplay:!1,autoplayDisableOnInteraction:!0,autoplayStopOnLast:!1,loop:!1,loopAdditionalSlides:0,roundLengths:!1,calculateHeight:!1,cssWidthAndHeight:!1,updateOnImagesReady:!0,releaseFormElements:!0,watchActiveIndex:!1,visibilityFullFit:!1,offsetPxBefore:0,offsetPxAfter:0,offsetSlidesBefore:0,offsetSlidesAfter:0,centeredSlides:!1,queueStartCallbacks:!1,queueEndCallbacks:!1,autoResize:!0,resizeReInit:!1,DOMAnimation:!0,loader:{slides:[],slidesHTMLType:"inner",surroundGroups:1,logic:"reload",loadAllSlides:!1},swipeToPrev:!0,swipeToNext:!0,slideElement:"div",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",wrapperClass:"swiper-wrapper",paginationElementClass:"swiper-pagination-switch",paginationActiveClass:"swiper-active-switch",paginationVisibleClass:"swiper-visible-switch"};t=t||{};for(var R in G)if(R in t&&"object"==typeof t[R])for(var H in G[R])H in t[R]||(t[R][H]=G[R][H]);else R in t||(t[R]=G[R]);k.params=t,t.scrollContainer&&(t.freeMode=!0,t.freeModeFluid=!0),t.loop&&(t.resistance="100%");var F="horizontal"===t.mode,O=["mousedown","mousemove","mouseup"];k.browser.ie10&&(O=["MSPointerDown","MSPointerMove","MSPointerUp"]),k.browser.ie11&&(O=["pointerdown","pointermove","pointerup"]),k.touchEvents={touchStart:k.support.touch||!t.simulateTouch?"touchstart":O[0],touchMove:k.support.touch||!t.simulateTouch?"touchmove":O[1],touchEnd:k.support.touch||!t.simulateTouch?"touchend":O[2]};for(var V=k.container.childNodes.length-1;V>=0;V--)if(k.container.childNodes[V].className)for(var z=k.container.childNodes[V].className.split(/\s+/),B=0;B<z.length;B++)z[B]===t.wrapperClass&&(P=k.container.childNodes[V]);k.wrapper=P,k._extendSwiperSlide=function(e){return e.append=function(){return t.loop?e.insertAfter(k.slides.length-k.loopedSlides):(k.wrapper.appendChild(e),k.reInit()),e},e.prepend=function(){return t.loop?(k.wrapper.insertBefore(e,k.slides[k.loopedSlides]),k.removeLoopedSlides(),k.calcSlides(),k.createLoop()):k.wrapper.insertBefore(e,k.wrapper.firstChild),k.reInit(),e},e.insertAfter=function(i){if("undefined"==typeof i)return!1;var n;return t.loop?(n=k.slides[i+1+k.loopedSlides],n?k.wrapper.insertBefore(e,n):k.wrapper.appendChild(e),k.removeLoopedSlides(),k.calcSlides(),k.createLoop()):(n=k.slides[i+1],k.wrapper.insertBefore(e,n)),k.reInit(),e},e.clone=function(){return k._extendSwiperSlide(e.cloneNode(!0))},e.remove=function(){k.wrapper.removeChild(e),k.reInit()},e.html=function(t){return"undefined"==typeof t?e.innerHTML:(e.innerHTML=t,e)},e.index=function(){for(var t,i=k.slides.length-1;i>=0;i--)e===k.slides[i]&&(t=i);return t},e.isActive=function(){return e.index()===k.activeIndex?!0:!1},e.swiperSlideDataStorage||(e.swiperSlideDataStorage={}),e.getData=function(t){return e.swiperSlideDataStorage[t]},e.setData=function(t,i){return e.swiperSlideDataStorage[t]=i,e},e.data=function(t,i){return"undefined"==typeof i?e.getAttribute("data-"+t):(e.setAttribute("data-"+t,i),e)},e.getWidth=function(t,i){return k.h.getWidth(e,t,i)},e.getHeight=function(t,i){return k.h.getHeight(e,t,i)},e.getOffset=function(){return k.h.getOffset(e)},e},k.calcSlides=function(e){var i=k.slides?k.slides.length:!1;k.slides=[],k.displaySlides=[];for(var n=0;n<k.wrapper.childNodes.length;n++)if(k.wrapper.childNodes[n].className)for(var r=k.wrapper.childNodes[n].className,s=r.split(/\s+/),l=0;l<s.length;l++)s[l]===t.slideClass&&k.slides.push(k.wrapper.childNodes[n]);for(n=k.slides.length-1;n>=0;n--)k._extendSwiperSlide(k.slides[n]);i!==!1&&(i!==k.slides.length||e)&&(a(),o(),k.updateActiveSlide(),k.params.pagination&&k.createPagination(),k.callPlugins("numberOfSlidesChanged"))},k.createSlide=function(e,i,n){i=i||k.params.slideClass,n=n||t.slideElement;var r=document.createElement(n);return r.innerHTML=e||"",r.className=i,k._extendSwiperSlide(r)},k.appendSlide=function(e,t,i){return e?e.nodeType?k._extendSwiperSlide(e).append():k.createSlide(e,t,i).append():void 0},k.prependSlide=function(e,t,i){return e?e.nodeType?k._extendSwiperSlide(e).prepend():k.createSlide(e,t,i).prepend():void 0},k.insertSlideAfter=function(e,t,i,n){return"undefined"==typeof e?!1:t.nodeType?k._extendSwiperSlide(t).insertAfter(e):k.createSlide(t,i,n).insertAfter(e)},k.removeSlide=function(e){if(k.slides[e]){if(t.loop){if(!k.slides[e+k.loopedSlides])return!1;k.slides[e+k.loopedSlides].remove(),k.removeLoopedSlides(),k.calcSlides(),k.createLoop()}else k.slides[e].remove();return!0}return!1},k.removeLastSlide=function(){return k.slides.length>0?(t.loop?(k.slides[k.slides.length-1-k.loopedSlides].remove(),k.removeLoopedSlides(),k.calcSlides(),k.createLoop()):k.slides[k.slides.length-1].remove(),!0):!1},k.removeAllSlides=function(){for(var e=k.slides.length-1;e>=0;e--)k.slides[e].remove()},k.getSlide=function(e){return k.slides[e]},k.getLastSlide=function(){return k.slides[k.slides.length-1]},k.getFirstSlide=function(){return k.slides[0]},k.activeSlide=function(){return k.slides[k.activeIndex]},k.fireCallback=function(){var e=arguments[0];if("[object Array]"===Object.prototype.toString.call(e))for(var i=0;i<e.length;i++)"function"==typeof e[i]&&e[i](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]);else"[object String]"===Object.prototype.toString.call(e)?t["on"+e]&&k.fireCallback(t["on"+e],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]):e(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},k.addCallback=function(e,t){var i=this,r;return i.params["on"+e]?n(this.params["on"+e])?this.params["on"+e].push(t):"function"==typeof this.params["on"+e]?(r=this.params["on"+e],this.params["on"+e]=[],this.params["on"+e].push(r),this.params["on"+e].push(t)):void 0:(this.params["on"+e]=[],this.params["on"+e].push(t))},k.removeCallbacks=function(e){k.params["on"+e]&&(k.params["on"+e]=null)};var _=[];for(var Y in k.plugins)if(t[Y]){var X=k.plugins[Y](k,t[Y]);X&&_.push(X)}k.callPlugins=function(e,t){t||(t={});for(var i=0;i<_.length;i++)e in _[i]&&_[i][e](t)},!k.browser.ie10&&!k.browser.ie11||t.onlyExternal||k.wrapper.classList.add("swiper-wp8-"+(F?"horizontal":"vertical")),t.freeMode&&(k.container.className+=" swiper-free-mode"),k.initialized=!1,k.init=function(e,i){var n=k.h.getWidth(k.container,!1,t.roundLengths),r=k.h.getHeight(k.container,!1,t.roundLengths);if(n!==k.width||r!==k.height||e){k.width=n,k.height=r;var s,o,a,l,d,p,u;N=F?n:r;var c=k.wrapper;if(e&&k.calcSlides(i),"auto"===t.slidesPerView){var f=0,h=0;t.slidesOffset>0&&(c.style.paddingLeft="",c.style.paddingRight="",c.style.paddingTop="",c.style.paddingBottom=""),c.style.width="",c.style.height="",t.offsetPxBefore>0&&(F?k.wrapperLeft=t.offsetPxBefore:k.wrapperTop=t.offsetPxBefore),t.offsetPxAfter>0&&(F?k.wrapperRight=t.offsetPxAfter:k.wrapperBottom=t.offsetPxAfter),t.centeredSlides&&(F?(k.wrapperLeft=(N-this.slides[0].getWidth(!0,t.roundLengths))/2,k.wrapperRight=(N-k.slides[k.slides.length-1].getWidth(!0,t.roundLengths))/2):(k.wrapperTop=(N-k.slides[0].getHeight(!0,t.roundLengths))/2,k.wrapperBottom=(N-k.slides[k.slides.length-1].getHeight(!0,t.roundLengths))/2)),F?(k.wrapperLeft>=0&&(c.style.paddingLeft=k.wrapperLeft+"px"),k.wrapperRight>=0&&(c.style.paddingRight=k.wrapperRight+"px")):(k.wrapperTop>=0&&(c.style.paddingTop=k.wrapperTop+"px"),k.wrapperBottom>=0&&(c.style.paddingBottom=k.wrapperBottom+"px")),p=0;var g=0;for(k.snapGrid=[],k.slidesGrid=[],a=0,u=0;u<k.slides.length;u++){s=k.slides[u].getWidth(!0,t.roundLengths),o=k.slides[u].getHeight(!0,t.roundLengths),t.calculateHeight&&(a=Math.max(a,o));var w=F?s:o;if(t.centeredSlides){var v=u===k.slides.length-1?0:k.slides[u+1].getWidth(!0,t.roundLengths),m=u===k.slides.length-1?0:k.slides[u+1].getHeight(!0,t.roundLengths),S=F?v:m;if(w>N){if(t.slidesPerViewFit)k.snapGrid.push(p+k.wrapperLeft),k.snapGrid.push(p+w-N+k.wrapperLeft);else for(var T=0;T<=Math.floor(w/(N+k.wrapperLeft));T++)0===T?k.snapGrid.push(p+k.wrapperLeft):k.snapGrid.push(p+k.wrapperLeft+N*T);k.slidesGrid.push(p+k.wrapperLeft)}else k.snapGrid.push(g),k.slidesGrid.push(g);g+=w/2+S/2}else{if(w>N)if(t.slidesPerViewFit)k.snapGrid.push(p),k.snapGrid.push(p+w-N);else if(0!==N)for(var y=0;y<=Math.floor(w/N);y++)k.snapGrid.push(p+N*y);else k.snapGrid.push(p);else k.snapGrid.push(p);k.slidesGrid.push(p)}p+=w,f+=s,h+=o}t.calculateHeight&&(k.height=a),F?(I=f+k.wrapperRight+k.wrapperLeft,c.style.width=f+"px",c.style.height=k.height+"px"):(I=h+k.wrapperTop+k.wrapperBottom,c.style.width=k.width+"px",c.style.height=h+"px")}else if(t.scrollContainer)c.style.width="",c.style.height="",l=k.slides[0].getWidth(!0,t.roundLengths),d=k.slides[0].getHeight(!0,t.roundLengths),I=F?l:d,c.style.width=l+"px",c.style.height=d+"px",A=F?l:d;else{if(t.calculateHeight){for(a=0,d=0,F||(k.container.style.height=""),c.style.height="",u=0;u<k.slides.length;u++)k.slides[u].style.height="",a=Math.max(k.slides[u].getHeight(!0),a),F||(d+=k.slides[u].getHeight(!0));o=a,k.height=o,F?d=o:(N=o,k.container.style.height=N+"px")}else o=F?k.height:k.height/t.slidesPerView,t.roundLengths&&(o=Math.ceil(o)),d=F?k.height:k.slides.length*o;for(s=F?k.width/t.slidesPerView:k.width,t.roundLengths&&(s=Math.ceil(s)),l=F?k.slides.length*s:k.width,A=F?s:o,t.offsetSlidesBefore>0&&(F?k.wrapperLeft=A*t.offsetSlidesBefore:k.wrapperTop=A*t.offsetSlidesBefore),t.offsetSlidesAfter>0&&(F?k.wrapperRight=A*t.offsetSlidesAfter:k.wrapperBottom=A*t.offsetSlidesAfter),t.offsetPxBefore>0&&(F?k.wrapperLeft=t.offsetPxBefore:k.wrapperTop=t.offsetPxBefore),t.offsetPxAfter>0&&(F?k.wrapperRight=t.offsetPxAfter:k.wrapperBottom=t.offsetPxAfter),t.centeredSlides&&(F?(k.wrapperLeft=(N-A)/2,k.wrapperRight=(N-A)/2):(k.wrapperTop=(N-A)/2,k.wrapperBottom=(N-A)/2)),F?(k.wrapperLeft>0&&(c.style.paddingLeft=k.wrapperLeft+"px"),k.wrapperRight>0&&(c.style.paddingRight=k.wrapperRight+"px")):(k.wrapperTop>0&&(c.style.paddingTop=k.wrapperTop+"px"),k.wrapperBottom>0&&(c.style.paddingBottom=k.wrapperBottom+"px")),I=F?l+k.wrapperRight+k.wrapperLeft:d+k.wrapperTop+k.wrapperBottom,parseFloat(l)>0&&(!t.cssWidthAndHeight||"height"===t.cssWidthAndHeight)&&(c.style.width=l+"px"),parseFloat(d)>0&&(!t.cssWidthAndHeight||"width"===t.cssWidthAndHeight)&&(c.style.height=d+"px"),p=0,k.snapGrid=[],k.slidesGrid=[],u=0;u<k.slides.length;u++)k.snapGrid.push(p),k.slidesGrid.push(p),p+=A,parseFloat(s)>0&&(!t.cssWidthAndHeight||"height"===t.cssWidthAndHeight)&&(k.slides[u].style.width=s+"px"),parseFloat(o)>0&&(!t.cssWidthAndHeight||"width"===t.cssWidthAndHeight)&&(k.slides[u].style.height=o+"px")}k.initialized?(k.callPlugins("onInit"),t.onInit&&k.fireCallback(t.onInit,k)):(k.callPlugins("onFirstInit"),t.onFirstInit&&k.fireCallback(t.onFirstInit,k)),k.initialized=!0}},k.reInit=function(e){k.init(!0,e)},k.resizeFix=function(e){k.callPlugins("beforeResizeFix"),k.init(t.resizeReInit||e),t.freeMode?k.getWrapperTranslate()<-r()&&(k.setWrapperTransition(0),k.setWrapperTranslate(-r())):(k.swipeTo(t.loop?k.activeLoopIndex:k.activeIndex,0,!1),t.autoplay&&(k.support.transitions&&"undefined"!=typeof ee?"undefined"!=typeof ee&&(clearTimeout(ee),ee=void 0,k.startAutoplay()):"undefined"!=typeof te&&(clearInterval(te),te=void 0,k.startAutoplay()))),k.callPlugins("afterResizeFix")},k.destroy=function(){var e=k.h.removeEventListener,i="wrapper"===t.eventTarget?k.wrapper:k.container;k.browser.ie10||k.browser.ie11?(e(i,k.touchEvents.touchStart,g),e(document,k.touchEvents.touchMove,w),e(document,k.touchEvents.touchEnd,v)):(k.support.touch&&(e(i,"touchstart",g),e(i,"touchmove",w),e(i,"touchend",v)),t.simulateTouch&&(e(i,"mousedown",g),e(document,"mousemove",w),e(document,"mouseup",v))),t.autoResize&&e(window,"resize",k.resizeFix),a(),t.paginationClickable&&x(),t.mousewheelControl&&k._wheelEvent&&e(k.container,k._wheelEvent,d),t.keyboardControl&&e(document,"keydown",l),t.autoplay&&k.stopAutoplay(),k.callPlugins("onDestroy"),k=null},k.disableKeyboardControl=function(){t.keyboardControl=!1,k.h.removeEventListener(document,"keydown",l)},k.enableKeyboardControl=function(){t.keyboardControl=!0,k.h.addEventListener(document,"keydown",l)};var q=(new Date).getTime();if(k.disableMousewheelControl=function(){return k._wheelEvent?(t.mousewheelControl=!1,k.h.removeEventListener(k.container,k._wheelEvent,d),!0):!1},k.enableMousewheelControl=function(){return k._wheelEvent?(t.mousewheelControl=!0,k.h.addEventListener(k.container,k._wheelEvent,d),!0):!1},t.grabCursor){var j=k.container.style;j.cursor="move",j.cursor="grab",j.cursor="-moz-grab",j.cursor="-webkit-grab"}k.allowSlideClick=!0,k.allowLinks=!0;var K=!1,Q,U=!0,Z,J;k.swipeNext=function(e){!e&&t.loop&&k.fixLoop(),!e&&t.autoplay&&k.stopAutoplay(!0),k.callPlugins("onSwipeNext");var i=k.getWrapperTranslate(),n=i;if("auto"===t.slidesPerView){for(var s=0;s<k.snapGrid.length;s++)if(-i>=k.snapGrid[s]&&-i<k.snapGrid[s+1]){n=-k.snapGrid[s+1];break}}else{var o=A*t.slidesPerGroup;n=-(Math.floor(Math.abs(i)/Math.floor(o))*o+o)}return n<-r()&&(n=-r()),n===i?!1:(T(n,"next"),!0)},k.swipePrev=function(e){!e&&t.loop&&k.fixLoop(),!e&&t.autoplay&&k.stopAutoplay(!0),k.callPlugins("onSwipePrev");var i=Math.ceil(k.getWrapperTranslate()),n;if("auto"===t.slidesPerView){n=0;for(var r=1;r<k.snapGrid.length;r++){if(-i===k.snapGrid[r]){n=-k.snapGrid[r-1];break}if(-i>k.snapGrid[r]&&-i<k.snapGrid[r+1]){n=-k.snapGrid[r];break}}}else{var s=A*t.slidesPerGroup;n=-(Math.ceil(-i/s)-1)*s}return n>0&&(n=0),n===i?!1:(T(n,"prev"),!0)},k.swipeReset=function(){k.callPlugins("onSwipeReset");var e=k.getWrapperTranslate(),i=A*t.slidesPerGroup,n,s=-r();if("auto"===t.slidesPerView){n=0;for(var o=0;o<k.snapGrid.length;o++){if(-e===k.snapGrid[o])return;if(-e>=k.snapGrid[o]&&-e<k.snapGrid[o+1]){n=k.positions.diff>0?-k.snapGrid[o+1]:-k.snapGrid[o];break}}-e>=k.snapGrid[k.snapGrid.length-1]&&(n=-k.snapGrid[k.snapGrid.length-1]),e<=-r()&&(n=-r())}else n=0>e?Math.round(e/i)*i:0,e<=-r()&&(n=-r());return t.scrollContainer&&(n=0>e?e:0),n<-r()&&(n=-r()),t.scrollContainer&&N>A&&(n=0),n===e?!1:(T(n,"reset"),!0)},k.swipeTo=function(e,i,n){e=parseInt(e,10),k.callPlugins("onSwipeTo",{index:e,speed:i}),t.loop&&(e+=k.loopedSlides);var s=k.getWrapperTranslate();if(!(e>k.slides.length-1||0>e)){var o;return o="auto"===t.slidesPerView?-k.slidesGrid[e]:-e*A,o<-r()&&(o=-r()),o===s?!1:(n=n===!1?!1:!0,T(o,"to",{index:e,speed:i,runCallbacks:n}),!0)}},k._queueStartCallbacks=!1,k._queueEndCallbacks=!1,k.updateActiveSlide=function(e){if(k.initialized&&0!==k.slides.length){k.previousIndex=k.activeIndex,"undefined"==typeof e&&(e=k.getWrapperTranslate()),e>0&&(e=0);var i;if("auto"===t.slidesPerView){var n=0;if(k.activeIndex=k.slidesGrid.indexOf(-e),k.activeIndex<0){for(i=0;i<k.slidesGrid.length-1&&!(-e>k.slidesGrid[i]&&-e<k.slidesGrid[i+1]);i++);var r=Math.abs(k.slidesGrid[i]+e),s=Math.abs(k.slidesGrid[i+1]+e);s>=r?k.activeIndex=i:k.activeIndex=i+1}}else k.activeIndex=Math[t.visibilityFullFit?"ceil":"round"](-e/A);if(k.activeIndex===k.slides.length&&(k.activeIndex=k.slides.length-1),k.activeIndex<0&&(k.activeIndex=0),k.slides[k.activeIndex]){if(k.calcVisibleSlides(e),k.support.classList){var o;for(i=0;i<k.slides.length;i++)o=k.slides[i],o.classList.remove(t.slideActiveClass),k.visibleSlides.indexOf(o)>=0?o.classList.add(t.slideVisibleClass):o.classList.remove(t.slideVisibleClass);k.slides[k.activeIndex].classList.add(t.slideActiveClass)}else{var a=new RegExp("\\s*"+t.slideActiveClass),l=new RegExp("\\s*"+t.slideVisibleClass);for(i=0;i<k.slides.length;i++)k.slides[i].className=k.slides[i].className.replace(a,"").replace(l,""),k.visibleSlides.indexOf(k.slides[i])>=0&&(k.slides[i].className+=" "+t.slideVisibleClass);k.slides[k.activeIndex].className+=" "+t.slideActiveClass}if(t.loop){var d=k.loopedSlides;k.activeLoopIndex=k.activeIndex-d,k.activeLoopIndex>=k.slides.length-2*d&&(k.activeLoopIndex=k.slides.length-2*d-k.activeLoopIndex),k.activeLoopIndex<0&&(k.activeLoopIndex=k.slides.length-2*d+k.activeLoopIndex),
k.activeLoopIndex<0&&(k.activeLoopIndex=0)}else k.activeLoopIndex=k.activeIndex;t.pagination&&k.updatePagination(e)}}},k.createPagination=function(e){if(t.paginationClickable&&k.paginationButtons&&x(),k.paginationContainer=t.pagination.nodeType?t.pagination:i(t.pagination)[0],t.createPagination){var n="",r=k.slides.length,s=r;t.loop&&(s-=2*k.loopedSlides);for(var o=0;s>o;o++)n+="<"+t.paginationElement+' class="'+t.paginationElementClass+'"></'+t.paginationElement+">";k.paginationContainer.innerHTML=n}k.paginationButtons=i("."+t.paginationElementClass,k.paginationContainer),e||k.updatePagination(),k.callPlugins("onCreatePagination"),t.paginationClickable&&b()},k.updatePagination=function(e){if(t.pagination&&!(k.slides.length<1)){var n=i("."+t.paginationActiveClass,k.paginationContainer);if(n){var r=k.paginationButtons;if(0!==r.length){for(var s=0;s<r.length;s++)r[s].className=t.paginationElementClass;var o=t.loop?k.loopedSlides:0;if(t.paginationAsRange){k.visibleSlides||k.calcVisibleSlides(e);var a=[],l;for(l=0;l<k.visibleSlides.length;l++){var d=k.slides.indexOf(k.visibleSlides[l])-o;t.loop&&0>d&&(d=k.slides.length-2*k.loopedSlides+d),t.loop&&d>=k.slides.length-2*k.loopedSlides&&(d=k.slides.length-2*k.loopedSlides-d,d=Math.abs(d)),a.push(d)}for(l=0;l<a.length;l++)r[a[l]]&&(r[a[l]].className+=" "+t.paginationVisibleClass);t.loop?void 0!==r[k.activeLoopIndex]&&(r[k.activeLoopIndex].className+=" "+t.paginationActiveClass):r[k.activeIndex].className+=" "+t.paginationActiveClass}else t.loop?r[k.activeLoopIndex]&&(r[k.activeLoopIndex].className+=" "+t.paginationActiveClass+" "+t.paginationVisibleClass):r[k.activeIndex].className+=" "+t.paginationActiveClass+" "+t.paginationVisibleClass}}}},k.calcVisibleSlides=function(e){var i=[],n=0,r=0,s=0;F&&k.wrapperLeft>0&&(e+=k.wrapperLeft),!F&&k.wrapperTop>0&&(e+=k.wrapperTop);for(var o=0;o<k.slides.length;o++){n+=r,r="auto"===t.slidesPerView?F?k.h.getWidth(k.slides[o],!0,t.roundLengths):k.h.getHeight(k.slides[o],!0,t.roundLengths):A,s=n+r;var a=!1;t.visibilityFullFit?(n>=-e&&-e+N>=s&&(a=!0),-e>=n&&s>=-e+N&&(a=!0)):(s>-e&&-e+N>=s&&(a=!0),n>=-e&&-e+N>n&&(a=!0),-e>n&&s>-e+N&&(a=!0)),a&&i.push(k.slides[o])}0===i.length&&(i=[k.slides[k.activeIndex]]),k.visibleSlides=i};var ee,te;k.startAutoplay=function(){if(k.support.transitions){if("undefined"!=typeof ee)return!1;if(!t.autoplay)return;k.callPlugins("onAutoplayStart"),t.onAutoplayStart&&k.fireCallback(t.onAutoplayStart,k),L()}else{if("undefined"!=typeof te)return!1;if(!t.autoplay)return;k.callPlugins("onAutoplayStart"),t.onAutoplayStart&&k.fireCallback(t.onAutoplayStart,k),te=setInterval(function(){t.loop?(k.fixLoop(),k.swipeNext(!0)):k.swipeNext(!0)||(t.autoplayStopOnLast?(clearInterval(te),te=void 0):k.swipeTo(0))},t.autoplay)}},k.stopAutoplay=function(e){if(k.support.transitions){if(!ee)return;ee&&clearTimeout(ee),ee=void 0,e&&!t.autoplayDisableOnInteraction&&k.wrapperTransitionEnd(function(){L()}),k.callPlugins("onAutoplayStop"),t.onAutoplayStop&&k.fireCallback(t.onAutoplayStop,k)}else te&&clearInterval(te),te=void 0,k.callPlugins("onAutoplayStop"),t.onAutoplayStop&&k.fireCallback(t.onAutoplayStop,k)},k.loopCreated=!1,k.removeLoopedSlides=function(){if(k.loopCreated)for(var e=0;e<k.slides.length;e++)k.slides[e].getData("looped")===!0&&k.wrapper.removeChild(k.slides[e])},k.createLoop=function(){if(0!==k.slides.length){"auto"===t.slidesPerView?k.loopedSlides=t.loopedSlides||1:k.loopedSlides=t.slidesPerView+t.loopAdditionalSlides,k.loopedSlides>k.slides.length&&(k.loopedSlides=k.slides.length);var e="",i="",n,r="",s=k.slides.length,o=Math.floor(k.loopedSlides/s),a=k.loopedSlides%s;for(n=0;o*s>n;n++){var l=n;if(n>=s){var d=Math.floor(n/s);l=n-s*d}r+=k.slides[l].outerHTML}for(n=0;a>n;n++)i+=S(t.slideDuplicateClass,k.slides[n].outerHTML);for(n=s-a;s>n;n++)e+=S(t.slideDuplicateClass,k.slides[n].outerHTML);var p=e+r+P.innerHTML+r+i;for(P.innerHTML=p,k.loopCreated=!0,k.calcSlides(),n=0;n<k.slides.length;n++)(n<k.loopedSlides||n>=k.slides.length-k.loopedSlides)&&k.slides[n].setData("looped",!0);k.callPlugins("onCreateLoop")}},k.fixLoop=function(){var e;k.activeIndex<k.loopedSlides?(e=k.slides.length-3*k.loopedSlides+k.activeIndex,k.swipeTo(e,0,!1)):("auto"===t.slidesPerView&&k.activeIndex>=2*k.loopedSlides||k.activeIndex>k.slides.length-2*t.slidesPerView)&&(e=-k.slides.length+k.activeIndex+k.loopedSlides,k.swipeTo(e,0,!1))},k.loadSlides=function(){var e="";k.activeLoaderIndex=0;for(var i=t.loader.slides,n=t.loader.loadAllSlides?i.length:t.slidesPerView*(1+t.loader.surroundGroups),r=0;n>r;r++)e+="outer"===t.loader.slidesHTMLType?i[r]:"<"+t.slideElement+' class="'+t.slideClass+'" data-swiperindex="'+r+'">'+i[r]+"</"+t.slideElement+">";k.wrapper.innerHTML=e,k.calcSlides(!0),t.loader.loadAllSlides||k.wrapperTransitionEnd(k.reloadSlides,!0)},k.reloadSlides=function(){var e=t.loader.slides,i=parseInt(k.activeSlide().data("swiperindex"),10);if(!(0>i||i>e.length-1)){k.activeLoaderIndex=i;var n=Math.max(0,i-t.slidesPerView*t.loader.surroundGroups),r=Math.min(i+t.slidesPerView*(1+t.loader.surroundGroups)-1,e.length-1);if(i>0){var s=-A*(i-n);k.setWrapperTranslate(s),k.setWrapperTransition(0)}var o;if("reload"===t.loader.logic){k.wrapper.innerHTML="";var a="";for(o=n;r>=o;o++)a+="outer"===t.loader.slidesHTMLType?e[o]:"<"+t.slideElement+' class="'+t.slideClass+'" data-swiperindex="'+o+'">'+e[o]+"</"+t.slideElement+">";k.wrapper.innerHTML=a}else{var l=1e3,d=0;for(o=0;o<k.slides.length;o++){var p=k.slides[o].data("swiperindex");n>p||p>r?k.wrapper.removeChild(k.slides[o]):(l=Math.min(p,l),d=Math.max(p,d))}for(o=n;r>=o;o++){var u;l>o&&(u=document.createElement(t.slideElement),u.className=t.slideClass,u.setAttribute("data-swiperindex",o),u.innerHTML=e[o],k.wrapper.insertBefore(u,k.wrapper.firstChild)),o>d&&(u=document.createElement(t.slideElement),u.className=t.slideClass,u.setAttribute("data-swiperindex",o),u.innerHTML=e[o],k.wrapper.appendChild(u))}}k.reInit(!0)}},M()}};Swiper.prototype={plugins:{},wrapperTransitionEnd:function(e,t){"use strict";function i(a){if(a.target===r&&(e(n),n.params.queueEndCallbacks&&(n._queueEndCallbacks=!1),!t))for(o=0;o<s.length;o++)n.h.removeEventListener(r,s[o],i)}var n=this,r=n.wrapper,s=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],o;if(e)for(o=0;o<s.length;o++)n.h.addEventListener(r,s[o],i)},getWrapperTranslate:function(e){"use strict";var t=this.wrapper,i,n,r,s;return"undefined"==typeof e&&(e="horizontal"===this.params.mode?"x":"y"),this.support.transforms&&this.params.useCSS3Transforms?(r=window.getComputedStyle(t,null),window.WebKitCSSMatrix?s=new WebKitCSSMatrix("none"===r.webkitTransform?"":r.webkitTransform):(s=r.MozTransform||r.OTransform||r.MsTransform||r.msTransform||r.transform||r.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),i=s.toString().split(",")),"x"===e&&(n=window.WebKitCSSMatrix?s.m41:16===i.length?parseFloat(i[12]):parseFloat(i[4])),"y"===e&&(n=window.WebKitCSSMatrix?s.m42:16===i.length?parseFloat(i[13]):parseFloat(i[5]))):("x"===e&&(n=parseFloat(t.style.left,10)||0),"y"===e&&(n=parseFloat(t.style.top,10)||0)),n||0},setWrapperTranslate:function(e,t,i){"use strict";var n=this.wrapper.style,r={x:0,y:0,z:0},s;3===arguments.length?(r.x=e,r.y=t,r.z=i):("undefined"==typeof t&&(t="horizontal"===this.params.mode?"x":"y"),r[t]=e),this.support.transforms&&this.params.useCSS3Transforms?(s=this.support.transforms3d?"translate3d("+r.x+"px, "+r.y+"px, "+r.z+"px)":"translate("+r.x+"px, "+r.y+"px)",n.webkitTransform=n.MsTransform=n.msTransform=n.MozTransform=n.OTransform=n.transform=s):(n.left=r.x+"px",n.top=r.y+"px"),this.callPlugins("onSetWrapperTransform",r),this.params.onSetWrapperTransform&&this.fireCallback(this.params.onSetWrapperTransform,this,r)},setWrapperTransition:function(e){"use strict";var t=this.wrapper.style;t.webkitTransitionDuration=t.MsTransitionDuration=t.msTransitionDuration=t.MozTransitionDuration=t.OTransitionDuration=t.transitionDuration=e/1e3+"s",this.callPlugins("onSetWrapperTransition",{duration:e}),this.params.onSetWrapperTransition&&this.fireCallback(this.params.onSetWrapperTransition,this,e)},h:{getWidth:function(e,t,i){"use strict";var n=window.getComputedStyle(e,null).getPropertyValue("width"),r=parseFloat(n);return(isNaN(r)||n.indexOf("%")>0||0>r)&&(r=e.offsetWidth-parseFloat(window.getComputedStyle(e,null).getPropertyValue("padding-left"))-parseFloat(window.getComputedStyle(e,null).getPropertyValue("padding-right"))),t&&(r+=parseFloat(window.getComputedStyle(e,null).getPropertyValue("padding-left"))+parseFloat(window.getComputedStyle(e,null).getPropertyValue("padding-right"))),i?Math.ceil(r):r},getHeight:function(e,t,i){"use strict";if(t)return e.offsetHeight;var n=window.getComputedStyle(e,null).getPropertyValue("height"),r=parseFloat(n);return(isNaN(r)||n.indexOf("%")>0||0>r)&&(r=e.offsetHeight-parseFloat(window.getComputedStyle(e,null).getPropertyValue("padding-top"))-parseFloat(window.getComputedStyle(e,null).getPropertyValue("padding-bottom"))),t&&(r+=parseFloat(window.getComputedStyle(e,null).getPropertyValue("padding-top"))+parseFloat(window.getComputedStyle(e,null).getPropertyValue("padding-bottom"))),i?Math.ceil(r):r},getOffset:function(e){"use strict";var t=e.getBoundingClientRect(),i=document.body,n=e.clientTop||i.clientTop||0,r=e.clientLeft||i.clientLeft||0,s=window.pageYOffset||e.scrollTop,o=window.pageXOffset||e.scrollLeft;return document.documentElement&&!window.pageYOffset&&(s=document.documentElement.scrollTop,o=document.documentElement.scrollLeft),{top:t.top+s-n,left:t.left+o-r}},windowWidth:function(){"use strict";return window.innerWidth?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:void 0},windowHeight:function(){"use strict";return window.innerHeight?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:void 0},windowScroll:function(){"use strict";return"undefined"!=typeof pageYOffset?{left:window.pageXOffset,top:window.pageYOffset}:document.documentElement?{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}:void 0},addEventListener:function(e,t,i,n){"use strict";"undefined"==typeof n&&(n=!1),e.addEventListener?e.addEventListener(t,i,n):e.attachEvent&&e.attachEvent("on"+t,i)},removeEventListener:function(e,t,i,n){"use strict";"undefined"==typeof n&&(n=!1),e.removeEventListener?e.removeEventListener(t,i,n):e.detachEvent&&e.detachEvent("on"+t,i)}},setTransform:function(e,t){"use strict";var i=e.style;i.webkitTransform=i.MsTransform=i.msTransform=i.MozTransform=i.OTransform=i.transform=t},setTranslate:function(e,t){"use strict";var i=e.style,n={x:t.x||0,y:t.y||0,z:t.z||0},r=this.support.transforms3d?"translate3d("+n.x+"px,"+n.y+"px,"+n.z+"px)":"translate("+n.x+"px,"+n.y+"px)";i.webkitTransform=i.MsTransform=i.msTransform=i.MozTransform=i.OTransform=i.transform=r,this.support.transforms||(i.left=n.x+"px",i.top=n.y+"px")},setTransition:function(e,t){"use strict";var i=e.style;i.webkitTransitionDuration=i.MsTransitionDuration=i.msTransitionDuration=i.MozTransitionDuration=i.OTransitionDuration=i.transitionDuration=t+"ms"},support:{touch:window.Modernizr&&Modernizr.touch===!0||function(){"use strict";return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}(),transforms3d:window.Modernizr&&Modernizr.csstransforms3d===!0||function(){"use strict";var e=document.createElement("div").style;return"webkitPerspective"in e||"MozPerspective"in e||"OPerspective"in e||"MsPerspective"in e||"perspective"in e}(),transforms:window.Modernizr&&Modernizr.csstransforms===!0||function(){"use strict";var e=document.createElement("div").style;return"transform"in e||"WebkitTransform"in e||"MozTransform"in e||"msTransform"in e||"MsTransform"in e||"OTransform"in e}(),transitions:window.Modernizr&&Modernizr.csstransitions===!0||function(){"use strict";var e=document.createElement("div").style;return"transition"in e||"WebkitTransition"in e||"MozTransition"in e||"msTransition"in e||"MsTransition"in e||"OTransition"in e}(),classList:function(){"use strict";var e=document.createElement("div");return"classList"in e}()},browser:{ie8:function(){"use strict";var e=-1;if("Microsoft Internet Explorer"===navigator.appName){var t=navigator.userAgent,i=new RegExp(/MSIE ([0-9]{1,}[\.0-9]{0,})/);null!==i.exec(t)&&(e=parseFloat(RegExp.$1))}return-1!==e&&9>e}(),ie10:window.navigator.msPointerEnabled,ie11:window.navigator.pointerEnabled}},(window.jQuery||window.Zepto)&&!function($){"use strict";$.fn.swiper=function(e){var t;return this.each(function(i){var n=$(this);if(!n.data("swiper")){var r=new Swiper(n[0],e);i||(t=r),n.data("swiper",r)}}),t}}(window.jQuery||window.Zepto),"undefined"!=typeof module&&(module.exports=Swiper),"function"==typeof define&&define.amd&&define([],function(){"use strict";return Swiper});