!function(e,i){"use strict";var t={item:3,autoWidth:!1,slideMove:1,slideMargin:10,addClass:"",mode:"slide",useCSS:!0,cssEasing:"ease",easing:"linear",speed:400,auto:!1,pauseOnHover:!1,loop:!1,slideEndAnimation:!0,pause:2e3,keyPress:!1,controls:!0,prevHtml:"",nextHtml:"",rtl:!1,adaptiveHeight:!1,vertical:!1,verticalHeight:500,vThumbWidth:100,thumbItem:10,pager:!0,gallery:!1,galleryMargin:5,thumbMargin:5,currentPagerPosition:"middle",enableTouch:!0,enableDrag:!0,freeMove:!0,swipeThreshold:40,responsive:[],onBeforeStart:function(e){},onSliderLoad:function(e){},onBeforeSlide:function(e,i){},onAfterSlide:function(e,i){},onBeforeNextSlide:function(e,i){},onBeforePrevSlide:function(e,i){}};e.fn.lightSlider=function(i){if(0===this.length)return this;if(this.length>1)return this.each(function(){e(this).lightSlider(i)}),this;var n={},l=e.extend(!0,{},t,i),a={},s=this;n.$el=this,"fade"===l.mode&&(l.vertical=!1);var o=s.children(),r=e(window).width(),d=null,c=null,u=0,f=0,h=!1,g=0,v="",p=0,$=!0===l.vertical?"height":"width",m=!0===l.vertical?"margin-bottom":"margin-right",S=0,_=0,b=0,C=0,M=null,T="ontouchstart"in document.documentElement,x={};return x.chbreakpoint=function(){if(r=e(window).width(),l.responsive.length){var i;if(!1===l.autoWidth&&(i=l.item),rl.responsive[0].breakpoint)for(var s in a)a.hasOwnProperty(s)&&(l[s]=a[s]);!1===l.autoWidth&&S>0&&b>0&&i!==l.item&&(p=Math.round(S/((b+l.slideMargin)*l.slideMove)))}},x.calSW=function(){!1===l.autoWidth&&(b=(g-(l.item*l.slideMargin-l.slideMargin))/l.item)},x.calWidth=function(e){var i=!0===e?v.find(".lslide").length:o.length;if(!1===l.autoWidth)f=i*(b+l.slideMargin);else{f=0;for(var t=0;t'+l.prevHtml+''+l.nextHtml+""),l.autoWidth?x.calWidth(!1)
'),v=s.parent(".lSSlideWrapper"),!0===l.rtl&&v.parent().addClass("lSrtl"),l.vertical?(v.parent().addClass("vertical"),g=l.verticalHeight,v.css("height",g+"px")):g=s.outerWidth(),o.addClass("lslide"),!0===l.loop&&"slide"===l.mode&&(x.calSW(),x.clone=function(){if(x.calWidth(!0)>g){for(var i=0,t=0,n=0;n=g+l.slideMargin));n++);var a=!0===l.autoWidth?t:l.item;if(ao.length-1-s.find(".clone.right").length;d--)p--,o.eq(d).remove();for(var c=s.find(".clone.right").length;cs.find(".lslide").length-a;u--)s.find(".lslide").eq(u-1).clone().removeClass("lslide").addClass("clone left").prependTo(s);o=s.children()}else o.hasClass("clone")&&(s.find(".clone").remove(),e.move(s,0))},x.clone()),x.sSW=function(){u=o.length,!0===l.rtl&&!1===l.vertical&&(m="margin-left"),!1===l.autoWidth&&o.css($,b+"px"),o.css(m,l.slideMargin+"px"),f=x.calWidth(!1),s.css($,f+"px"),!0===l.loop&&"slide"===l.mode&&!1===h&&(p=s.find(".clone.left").length)},x.calL=function(){u=(o=s.children()).length},this.doCss()&&v.addClass("usingCss"),x.calL(),"slide"===l.mode?(x.calSW(),x.sSW(),!0===l.loop&&(S=e.slideValue(),this.move(s,S)),!1===l.vertical&&this.setHeight(s,!1)):(this.setHeight(s,!0),s.addClass("lSFade"),this.doCss()||(o.fadeOut(0),o.eq(p).fadeIn(0))),!0===l.loop&&"slide"===l.mode?o.eq(p).addClass("active"):o.first().addClass("active")},pager:function(){var e=this;if(x.createPager=function(){C=(g-(l.thumbItem*l.thumbMargin-l.thumbMargin))/l.thumbItem;var i=v.find(".lslide"),t=v.find(".lslide").length,n=0,a="",o=0;for(n=0;n':a+='
  • '+(n+1)+"
  • ","slide"===l.mode&&o>=f-g-l.slideMargin){n+=1;var d=2;l.autoWidth&&(a+='
  • '+(n+1)+"
  • ",d=1),n');var t=l.vertical?"margin-left":"margin-top";v.parent().find(".lSPager").css(t,l.galleryMargin+"px"),x.createPager()}setTimeout(function(){x.init()},0)},setHeight:function(e,i){var t=null,n=this;t=l.loop?e.children(".lslide ").first():e.children().first();var a=function(){var n=t.outerHeight(),l=0,a=n;i&&(n=0,l=100*a/g),e.css({height:n+"px","padding-bottom":l+"%"})};a(),t.find("img").length?t.find("img")[0].complete?(a(),M||n.auto()):t.find("img").on("load",function(){setTimeout(function(){a(),M||n.auto()},100)}):M||n.auto()},active:function(e,i){this.doCss()&&"fade"===l.mode&&v.addClass("on");var t,n,a=0;p*l.slideMove=t&&(a=n)),!0===l.loop&&"slide"===l.mode&&(a=!0===i?p-s.find(".clone.left").length:p*l.slideMove,!0===i&&(n=(t=e.length)-1,a+1===t?a=n:a+1>t&&(a=0))),this.doCss()||"fade"!==l.mode||!1!==i||e.eq(a).fadeIn(l.speed),e.eq(a).addClass("active")):(e.removeClass("active"),e.eq(e.length-1).addClass("active"),this.doCss()||"fade"!==l.mode||!1!==i||(e.fadeOut(l.speed),e.eq(a).fadeIn(l.speed)))},move:function(e,i){!0===l.rtl&&(i=-i),this.doCss()?!0===l.vertical?e.css({transform:"translate3d(0px, "+-i+"px, 0px)","-webkit-transform":"translate3d(0px, "+-i+"px, 0px)"}):e.css({transform:"translate3d("+-i+"px, 0px, 0px)","-webkit-transform":"translate3d("+-i+"px, 0px, 0px)"}):!0===l.vertical?e.css("position","relative").animate({top:-i+"px"},l.speed,l.easing):e.css("position","relative").animate({left:-i+"px"},l.speed,l.easing);var t=v.parent().find(".lSPager").find("li");this.active(t,!0)},fade:function(){this.active(o,!1);var e=v.parent().find(".lSPager").find("li");this.active(e,!0)},slide:function(){var e=this;x.calSlide=function(){f>g&&(S=e.slideValue(),e.active(o,!1),S>f-g-l.slideMargin?S=f-g-l.slideMargin:S<0&&(S=0),e.move(s,S),!0===l.loop&&"slide"===l.mode&&(p>=u-s.find(".clone.left").length/l.slideMove&&e.resetSlide(s.find(".clone.left").length),0===p&&e.resetSlide(v.find(".lslide").length)))},x.calSlide()},resetSlide:function(e){var i=this;v.find(".lSAction a").addClass("disabled"),setTimeout(function(){p=e,v.css("transition-duration","0ms"),S=i.slideValue(),i.active(o,!1),n.move(s,S),setTimeout(function(){v.css("transition-duration",l.speed+"ms"),v.find(".lSAction a").removeClass("disabled")},50)},l.speed+100)},slideValue:function(){var e=0;if(!1===l.autoWidth)e=p*((b+l.slideMargin)*l.slideMove);else{e=0;for(var i=0;i=t.children().length?i=0:i<0&&(i=t.children().length));var n=i*(C+l.thumbMargin)-e;n+g>_&&(n=_-g-l.thumbMargin),n<0&&(n=0),this.move(t,n)},auto:function(){l.auto&&(clearInterval(M),M=setInterval(function(){s.goToNextSlide()},l.pause))},pauseOnHover:function(){var i=this;l.auto&&l.pauseOnHover&&(v.on("mouseenter",function(){e(this).addClass("ls-hover"),s.pause(),l.auto=!0}),v.on("mouseleave",function(){e(this).removeClass("ls-hover"),v.find(".lightSlider").hasClass("lsGrabbing")||i.auto()}))},touchMove:function(e,i){if(v.css("transition-duration","0ms"),"slide"===l.mode){var t=S-(e-i);if(t>=f-g-l.slideMargin){if(!1===l.freeMove)t=f-g-l.slideMargin;else{var n=f-g-l.slideMargin;t=n+(t-n)/5}}else t<0&&(!1===l.freeMove?t=0:t/=5);this.move(s,t)}},touchEnd:function(e){if(v.css("transition-duration",l.speed+"ms"),"slide"===l.mode){var i=!1,t=!0;(S-=e)>f-g-l.slideMargin?(S=f-g-l.slideMargin,!1===l.autoWidth&&(i=!0)):S<0&&(S=0);var n=function(e){var t=0;if(!i&&e&&(t=1),l.autoWidth)for(var n=0,a=0;a=S));a++);else{var s=S/((b+l.slideMargin)*l.slideMove);p=parseInt(s)+t,S>=f-g-l.slideMargin&&s%1!=0&&p++}};e>=l.swipeThreshold?(n(!1),t=!1):e<=-l.swipeThreshold&&(n(!0),t=!1),s.mode(t),this.slideThumb()}else e>=l.swipeThreshold?s.goToPrevSlide():e<=-l.swipeThreshold&&s.goToNextSlide()},enableDrag:function(){var i=this;if(!T){var t=0,n=0,a=!1;v.find(".lightSlider").addClass("lsGrab"),v.on("mousedown",function(i){if(f=l.swipeThreshold&&e(window).on("click.ls",function(i){i.preventDefault?i.preventDefault():i.returnValue=!1,i.stopImmediatePropagation(),i.stopPropagation(),e(window).off("click.ls")}),i.touchEnd(o)}})}},enableTouch:function(){var e=this;if(T){var i={},t={};v.on("touchstart",function(e){t=e.originalEvent.targetTouches[0],i.pageX=e.originalEvent.targetTouches[0].pageX,i.pageY=e.originalEvent.targetTouches[0].pageY,clearInterval(M)}),v.on("touchmove",function(n){if(fa&&n.preventDefault(),e.touchMove(t.pageY,i.pageY)):(3*a>s&&n.preventDefault(),e.touchMove(t.pageX,i.pageX))}),v.on("touchend",function(){var n;if(f1?l.verticalHeight:o.outerHeight(),v.css("height",g+"px")):g=v.outerWidth(),!0===l.loop&&"slide"===l.mode&&x.clone(),x.calL(),"slide"===l.mode&&s.removeClass("lSSlide"),"slide"===l.mode&&(x.calSW(),x.sSW()),setTimeout(function(){"slide"===l.mode&&s.addClass("lSSlide")},1e3),l.pager&&x.createPager(),!0===l.adaptiveHeight&&!1===l.vertical&&s.css("height",o.eq(p).outerHeight(!0)),!1===l.adaptiveHeight&&("slide"===l.mode?!1===l.vertical?n.setHeight(s,!1):n.auto():n.setHeight(s,!0)),!0===l.gallery&&n.slideThumb(),"slide"===l.mode&&n.slide(),!1===l.autoWidth?o.length<=l.item?v.find(".lSAction").hide():v.find(".lSAction").show():x.calWidth(!1)0?(l.onBeforePrevSlide.call(this,s,p),p--,s.mode(!1),!0===l.gallery&&n.slideThumb()):!0===l.loop?(l.onBeforePrevSlide.call(this,s,p),"fade"===l.mode&&(p=parseInt((u-1)/l.slideMove)),s.mode(!1),!0===l.gallery&&n.slideThumb()):!0===l.slideEndAnimation&&(s.addClass("leftEnd"),setTimeout(function(){s.removeClass("leftEnd")},400))},s.goToNextSlide=function(){var e=!0;"slide"===l.mode&&(e=n.slideValue()=i+t?p-i-t:p-t}return e+1},s.getTotalSlideCount=function(){return v.find(".lslide").length},s.goToSlide=function(e){p=l.loop?e+s.find(".clone.left").length-1:e,s.mode(!1),!0===l.gallery&&n.slideThumb()},s.destroy=function(){s.lightSlider&&(s.goToPrevSlide=function(){},s.goToNextSlide=function(){},s.mode=function(){},s.play=function(){},s.pause=function(){},s.refresh=function(){},s.getCurrentSlideCount=function(){},s.getTotalSlideCount=function(){},s.goToSlide=function(){},s.lightSlider=null,x={init:function(){}},s.parent().parent().find(".lSAction, .lSPager").remove(),s.removeClass("lightSlider lSFade lSSlide lsGrab lsGrabbing leftEnd right").removeAttr("style").unwrap().unwrap(),s.children().removeAttr("style"),o.removeClass("lslide active"),s.find(".clone").remove(),o=null,M=null,h=!1,p=0)},setTimeout(function(){l.onSliderLoad.call(this,s)},10),e(window).on("resize orientationchange",function(e){setTimeout(function(){e.preventDefault?e.preventDefault():e.returnValue=!1,x.init()},200)}),this}}(jQuery);