/*! * WPBakery Page Builder v6.0.0 (https://wpbakery.com) * Copyright 2011-2021 Michael M, WPBakery * License: Commercial. More details: http://go.wpbakery.com/licensing */ // jscs:disable // jshint ignore: start !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){void 0===index&&(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();if(!(pos>this.$items.length-1||pos<0))return this.sliding?this.$element.one("slid",function(){that.to(pos)}):activeIndex==pos?this.pause().cycle():this.slide(activeIndexthis.items_count?this.current_index=0:this.current_index<0&&(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 new_slideline_height,max_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();max_height 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&&part<0||part<=-.7?(that.setSwipeAnimationSpeed(),that.next()):velocity.x>that.swipe_velocity||.7<=part?(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||(data=new Carousel(this,options),$this.data("vc.carousel",data)),"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 slideIndex=$(this),$target=$(slideIndex.attr("data-target")||(options=slideIndex.attr("href"))&&options.replace(/.*(?=#[^\s]+$)/,"")),options=$.extend({},$target.data(),slideIndex.data()),slideIndex=slideIndex.attr("data-slide-to");slideIndex&&(options.interval=!1),$target.carousel(options),slideIndex&&$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);