!function($){"use strict";function Carousel(element,options){this.$element=$(element),this.$indicators=this.$element.find(".vc_carousel-indicators"),this.options=options,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"===this.options.pause&&this.$element.on("mouseenter",$.proxy(this.pause,this)).on("mouseleave",$.proxy(this.cycle,this)),this._build()}Carousel.DEFAULTS={mode:"horizontal",partial:!1,interval:5e3,pause:"hover",wrap:!1,autoHeight:!1,perView:1},Carousel.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval)),this.touch_start_position=0,this},Carousel.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".vc_item.vc_active"),this.$active.length||(this.$active=this.$element.find(".vc_item:first").addClass("vc_active")),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},Carousel.prototype.showHideControl=function(index){if("undefined"==typeof index)var index=this.getActiveIndex();this.$left_control[0===index?"hide":"show"](),this.$right_control[index===this.items_count-1?"hide":"show"]()},Carousel.prototype.to=function(pos){var that=this,activeIndex=this.getActiveIndex();return pos>this.$items.length-1||0>pos?void 0:this.sliding?this.$element.one("slid",function(){that.to(pos)}):activeIndex==pos?this.pause().cycle():this.slide(pos>activeIndex?"next":"prev",$(this.$items[pos]))},Carousel.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".vc_right.vc_carousel-control, .vc_left.vc_carousel-control").length&&$.support.transition.end&&(this.$element.trigger($.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},Carousel.prototype.next=function(){return this.sliding?void 0:this.slide("next")},Carousel.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},Carousel.prototype.slide=function(type,next){var $active=this.$element.find(".vc_item.vc_active"),$next=next||$active[type](),isCycling=this.interval,direction="next"===type?"vc_left":"vc_right",fallback="next"===type?"first":"last",that=this;if(!$next.length){if(!this.options.wrap)return void this.returnSwipedSlide();$next=this.$element.find(".vc_item")[fallback]()}this.sliding=!0,isCycling&&this.pause();var e=$.Event("slide.vc.carousel",{relatedTarget:$next[0],direction:direction});if(!$next.hasClass("vc_active")){if(this.$indicators.length&&(this.$indicators.find(".vc_active").removeClass("vc_active"),this.$indicators.find(".vc_partial").removeClass("vc_partial"),this.$element.one("slid",function(){var index=that.getActiveIndex(),$nextIndicator=$(that.$indicators.children().slice(index,that.getActiveIndex()+that.options.perView));$nextIndicator&&$nextIndicator.addClass("vc_active"),that.options.partial&&$nextIndicator&&(index+1this.items_count?this.current_index=0:0>this.current_index&&(this.current_index=this.items_count-1),this.options.autoHeight?this.current_pos_value=-1*this._step*this.current_index:this.current_pos_value=-1*$next.position()[this.animation_position],this.options.partial&&this.current_index>=this.items_count-1&&(this.current_pos_value+=this._step*(1-this.partial_part)),$.support.transition&&this.$element.hasClass("vc_slide")){if(this.$element.trigger(e),e.isDefaultPrevented())return;this.$slideline_inner.addClass("vc_transition").css(this.animation_position,this.current_pos_value+that.pos_units),this.options.autoHeight||this.recalculateSlidelineHeight($next.height(),!0),this.$slideline_inner.one($.support.transition.end,function(){$next.addClass("vc_active"),$active.removeClass("vc_active"),that.$slideline_inner.removeClass([type,"vc_transition"].join(" ")),that.sliding=!1,that.removeSwipeAnimationSpeed(),setTimeout(function(){that.$element.trigger("slid")},0)}).emulateTransitionEnd(this.transition_speed)}else{if(this.$element.trigger(e),e.isDefaultPrevented())return;$active.removeClass("vc_active"),$next.addClass("vc_active"),this.sliding=!1,this.$slideline_inner.css(this.animation_position,this.current_pos_value+that.pos_units)}return isCycling&&this.cycle(),this}},Carousel.prototype.setSwipeAnimationSpeed=function(){this.$slideline_inner.addClass("vc_swipe-transition")},Carousel.prototype.removeSwipeAnimationSpeed=function(){this.$slideline_inner.removeClass("vc_swipe-transition")},Carousel.prototype.velocity=function(time,x){return{x:Math.abs(x/time)||0}},Carousel.prototype.recalculateSlidelineHeight=function(height,animate){!0===animate?this.$slideline.animate({height:height}):this.$slideline.height(height)},Carousel.prototype.resizeAction=function(){var max_height=0,new_slideline_height=0;"horizontal"===this.options.mode&&(this.el_effect_size=this.$element.width()*(this.options.partial?this.partial_part:1),this.$slideline.width(this.items_count*this.el_effect_size)),this.options.autoHeight?(this.$items.height("auto"),this.$items.each(function(){var item_height=$(this).height();item_height>max_height&&(max_height=item_height)}),this.$items.height(max_height)):this.recalculateSlidelineHeight(this.$active.height()),"vertical"===this.options.mode&&(this._step=this.$active.height(),new_slideline_height=this.$active.height()*this.options.perView*(this.options.partial?2-this.partial_part:1),this.recalculateSlidelineHeight(new_slideline_height,!1),this.$slideline_inner.css({top:-1*this.$active.position().top}),this.el_effect_size=this._step)},Carousel.prototype.returnSwipedSlide=function(){var params={};params[this.animation_position]=this.current_pos_value+this.pos_units,this.$slideline_inner.animate(params)},Carousel.prototype._build=function(){var el=this.$element.get(0),_touch_start_position=!1,_touch_start_time=0,_pos_before_touch=0,_diff=0,_moved=!1,that=this,mode=this.options.mode;if(this.getActiveIndex(),this.el_width=0,this.items_count=this.$items.length,this.$slideline=this.$element.find(".vc_carousel-slideline"),this.$slideline_inner=this.$slideline.find("> div"),this.slideline_inner=this.$slideline_inner.get(0),this.partial_part=.8,this._slide_width=0,this.swipe_velocity=.7,this.current_pos_value=0,this.current_index=0,this.el_effect_size=0,this.transition_speed=600,this.$left_control=this.$element.find(".vc_left.vc_carousel-control"),this.$right_control=this.$element.find(".vc_right.vc_carousel-control"),this.options.partial&&(this.options.autoHeight=!0),1that.swipe_velocity&&0>part||-.7>=part?(that.setSwipeAnimationSpeed(),that.next()):velocity.x>that.swipe_velocity||part>=.7?(that.setSwipeAnimationSpeed(),that.prev()):that.returnSwipedSlide(),_moved=!1)},!1),this.$element.addClass("vc_build"),this};var old=$.fn.carousel;$.fn.carousel=function(option,value){return this.each(function(){var $this=$(this),data=$this.data("vc.carousel"),options=$.extend({},Carousel.DEFAULTS,$this.data(),"object"==typeof option&&option),action="string"==typeof option?option:options.slide;data||$this.data("vc.carousel",data=new Carousel(this,options)),"number"==typeof option?data.to(option):action?data[action](value):options.interval&&data.pause().cycle()})},$.fn.carousel.Constructor=Carousel,$.fn.carousel.noConflict=function(){return $.fn.carousel=old,this},$(document).off("click.vc.carousel.data-api").on("click.vc.carousel.data-api","[data-slide], [data-slide-to]",function(e){var href,$this=$(this),$target=$($this.attr("data-target")||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"")),options=$.extend({},$target.data(),$this.data()),slideIndex=$this.attr("data-slide-to");slideIndex&&(options.interval=!1),$target.carousel(options),(slideIndex=$this.attr("data-slide-to"))&&$target.data("vc.carousel").to(slideIndex),e.preventDefault()}),$(window).on("load",function(){$('[data-ride="vc_carousel"]').each(function(){var $carousel=$(this);$carousel.carousel($carousel.data())})})}(window.jQuery);