!function($){"use strict";const e='TouchSwipe.'+$.SliderPro.namespace,t={touchStartPoint:{x:0,y:0},touchEndPoint:{x:0,y:0},touchDistance:{x:0,y:0},touchStartPosition:0,isTouchMoving:!1,touchSwipeEvents:{startEvent:'',moveEvent:'',endEvent:''},initTouchSwipe(){!1!==this.settings.touchSwipe&&(this.touchSwipeEvents.startEvent="touchstart."+e+" mousedown."+e,this.touchSwipeEvents.moveEvent="touchmove."+e+" mousemove."+e,this.touchSwipeEvents.endEvent="touchend."+this.uniqueId+'.'+e+" mouseup."+this.uniqueId+'.'+e,this.$slidesMask.on(this.touchSwipeEvents.startEvent,$.proxy(this._onTouchStart,this)).on('dragstart.'+e,function(t){t.target.closest('[draggable="true"]')||t.preventDefault()}).addClass('sp-grab'))},_onTouchStart(t){const s=t.target;var i;s.closest('.sp-selectable')||s.closest('[contenteditable]')||(i=void 0!==t.originalEvent.touches?t.originalEvent.touches[0]:t.originalEvent,void 0===t.originalEvent.touches&&t.preventDefault(),$(s).parents('.sp-slide').find('a').one('click.'+e,function(t){t.preventDefault()}),this.touchStartPoint.x=i.pageX||i.clientX,this.touchStartPoint.y=i.pageY||i.clientY,this.touchStartPosition=this.slidesPosition,this.touchDistance.x=this.touchDistance.y=0,this.$slides.hasClass('sp-animated')&&(this.isTouchMoving=!0,this._stopMovement(),this.touchStartPosition=this.slidesPosition),this.$slidesMask.on(this.touchSwipeEvents.moveEvent,$.proxy(this._onTouchMove,this)),$(document).on(this.touchSwipeEvents.endEvent,$.proxy(this._onTouchEnd,this)),this.$slidesMask.removeClass('sp-grab').addClass('sp-grabbing'),this.$slider.addClass('sp-swiping'))},_onTouchMove(t){var s=void 0!==t.originalEvent.touches?t.originalEvent.touches[0]:t.originalEvent,s=(this.isTouchMoving=!0,this.touchEndPoint.x=s.pageX||s.clientX,this.touchEndPoint.y=s.pageY||s.clientY,this.touchDistance.x=this.touchEndPoint.x-this.touchStartPoint.x,this.touchDistance.y=this.touchEndPoint.y-this.touchStartPoint.y,'horizontal'===this.settings.orientation?this.touchDistance.x:this.touchDistance.y),i='horizontal'===this.settings.orientation?this.touchDistance.y:this.touchDistance.x;Math.abs(s)>Math.abs(i)&&(t.preventDefault(),!1===this.settings.loop&&(this.slidesPosition>this.touchStartPosition&&0===this.selectedSlideIndex||this.slidesPosition<this.touchStartPosition&&this.selectedSlideIndex===this.getTotalSlides()-1)&&(s*=.2),this._moveTo(this.touchStartPosition+s,!0))},_onTouchEnd(t){var s=this,i='horizontal'===this.settings.orientation?this.touchDistance.x:this.touchDistance.y;this.$slidesMask.off(this.touchSwipeEvents.moveEvent),$(document).off(this.touchSwipeEvents.endEvent),this.$slidesMask.removeClass('sp-grabbing').addClass('sp-grab'),(!1===this.isTouchMoving||!0===this.isTouchMoving&&Math.abs(this.touchDistance.x)<10&&Math.abs(this.touchDistance.y)<10)&&($(t.target).parents('.sp-slide').find('a').off('click.'+e),this.$slider.removeClass('sp-swiping')),setTimeout(function(){s.$slider.removeClass('sp-swiping')},1),!1!==this.isTouchMoving&&(this.isTouchMoving=!1,$(t.target).parents('.sp-slide').one('click',function(t){t.preventDefault()}),t=-parseInt(this.$slides.find('.sp-slide').eq(this.selectedSlideIndex).css(this.positionProperty),10)+this.visibleOffset,Math.abs(i)<this.settings.touchSwipeThreshold?this._moveTo(t):(i=i/(this.slideSize+this.settings.slideDistance),i=parseInt(i,10)+(0<i?1:-1),i=this.slidesOrder[$.inArray(this.selectedSlideIndex,this.slidesOrder)-i],!0===this.settings.loop||void 0!==i?this.gotoSlide(i):this._moveTo(t)))},destroyTouchSwipe(){this.$slidesMask.off(this.touchSwipeEvents.startEvent+' '+this.touchSwipeEvents.moveEvent+' dragstart.'+e).removeClass('sp-grab'),$(document).off(this.touchSwipeEvents.endEvent)},touchSwipeDefaults:{touchSwipe:!0,touchSwipeThreshold:50}};$.SliderPro.addModule('TouchSwipe',t)}(jQuery);