N2Require("SmartSliderWidgetBulletTransition",[],[],function(t,i,e){function s(i,e){this.slider=window[i],this.slider.started(t.proxy(this.start,this,i,e))}return s.prototype.start=function(i,e){if(this.slider.sliderElement.data("bullet"))return!1;this.slider.sliderElement.data("bullet",this),this.axis="horizontal",this.offset=0,this.parameters=e,this.bar=this.slider.sliderElement.find(".nextend-bullet-bar");var s="universalclick";if("mouseenter"==e.action&&(s="mouseenter"),this.originalDots=this.dots=this.bar.find("div").on(s,t.proxy(this.onDotClick,this)),this.slider.isShuffled){for(var o=[],a=[],r=0;r<this.slider.realSlides.length;r++){var n=this.slider.realSlides[r];o.push(this.dots.get(n.originalIndex)),a.push(this.parameters.thumbnails[n.originalIndex]),e.numeric&&this.dots.eq(n.originalIndex).html(r+1)}this.originalDots=this.dots=t(o).appendTo(this.dots.parent()),this.parameters.thumbnails=a}if(this.slider.sliderElement.on({slideCountChanged:t.proxy(this.onSlideCountChanged,this),sliderSwitchTo:t.proxy(this.onSlideSwitch,this)}),this.slider.firstSlideReady.done(t.proxy(this.onFirstSlideSet,this)),0==e.overlay){var h=!1;switch(e.area){case 1:h="Top";break;case 12:h="Bottom";break;case 5:h="Left",this.axis="vertical";break;case 8:h="Right",this.axis="vertical"}h&&(this.offset=parseFloat(this.bar.data("offset")),this.slider.responsive.addStaticMargin(h,this))}this.initThumbnails()},s.prototype.onFirstSlideSet=function(t){this.dots.eq(t.index).addClass("n2-active")},s.prototype.onDotClick=function(i){this.slider.directionalChangeToReal(this.originalDots.index(i.currentTarget)),t(i.target).blur()},s.prototype.onSlideSwitch=function(t,i){this.dots.filter(".n2-active").removeClass("n2-active"),this.dots.eq(i).addClass("n2-active")},s.prototype.isVisible=function(){return this.bar.is(":visible")},s.prototype.getSize=function(){return"horizontal"==this.axis?this.bar.height()+this.offset:this.bar.width()+this.offset},s.prototype.initThumbnails=function(){this.parameters.thumbnails.length>0&&this.dots.each(t.proxy(function(i,e){""!=this.parameters.thumbnails[i]&&t(e).on({universalenter:t.proxy(this.showThumbnail,this,i)},{leaveOnSecond:!0})},this))},s.prototype.showThumbnail=function(i,e){var s=this.getThumbnail(i);NextendTween.to(s,.3,{opacity:1}).play(),this.originalDots.eq(i).on("universalleave",t.proxy(this.hideThumbnail,this,s))},s.prototype.hideThumbnail=function(t,i){i.stopPropagation(),NextendTween.to(t,.3,{opacity:0,onComplete:function(){t.remove()}}).play()},s.prototype.getThumbnail=function(i){var e=this.originalDots.eq(i),s=e.offset(),o=e.outerWidth(),a=e.outerHeight(),r=t("<div/>").append(t("<div/>").css({width:this.parameters.thumbnailWidth,height:this.parameters.thumbnailHeight,backgroundImage:'url("'+this.parameters.thumbnails[i]+'")',backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"}).addClass("n2-bullet-thumbnail")).addClass(this.parameters.thumbnailStyle).addClass("n2-bullet-thumbnail-container").css({position:"absolute",opacity:0,zIndex:1e7}).appendTo("body");switch(this.parameters.thumbnailPosition){case"right":r.css({left:s.left+o,top:s.top+a/2-r.outerHeight(!0)/2});break;case"left":r.css({left:s.left-r.outerWidth(!0),top:s.top+a/2-r.outerHeight(!0)/2});break;case"top":r.css({left:s.left+o/2-r.outerWidth(!0)/2,top:s.top-r.outerHeight(!0)});break;case"bottom":r.css({left:s.left+o/2-r.outerWidth(!0)/2,top:s.top+a})}return e.data("thumbnail",r),r},s.prototype.onSlideCountChanged=function(i,e,s){this.dots=t();for(var o=0;o<this.originalDots.length;o++)o%s==0?this.dots=this.dots.add(this.originalDots.eq(o).css("display","")):this.originalDots.eq(o).css("display","none");this.parameters.numeric&&this.dots.each(function(t,i){i.innerHTML=t+1})},s});
