"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function delegate_function(){$("body").delegate("[type=vegas][vegas]","mousedown",function(){var t=window.event;startX=t.clientX,window.sliding=!0}),$("body").delegate("[type=vegas][vegas]","mouseup",function(){var t=window.event.clientX;30=$(this).vegas("__total")-1?$(this).find(".vegas-next").hide():$(this).find(".vegas-next").show()})):"disabled"==t.status&&(0==this.slide&&this.$elmt.find(".vegas-prev").addClass("vegas-disabled"),this.$elmt.on("vegaschange",function(){$(this).vegas("current")<=0?$(this).find(".vegas-prev").addClass("vegas-disabled"):$(this).find(".vegas-prev").removeClass("vegas-disabled"),$(this).vegas("current")>=$(this).vegas("__total")-1?$(this).find(".vegas-next").addClass("vegas-disabled"):$(this).find(".vegas-next").removeClass("vegas-disabled")})),"none"==t.hookStatus?($(t.prevHook).hide(),$(t.nextHook).hide()):"hide"==t.hookStatus?(0==this.slide&&$(t.prevHook).hide(),this.$elmt.on("vegaschange",function(){$(this).vegas("current")<=0?$(t.prevHook).hide():$(t.prevHook).show(),$(this).vegas("current")>=$(this).vegas("__total")-1?$(t.nextHook).hide():$(t.nextHook).show()})):"disabled"==t.hookStatus&&(0==this.slide&&$(t.prevHook).addClass("vegas-disabled"),this.$elmt.on("vegaschange",function(){$(this).vegas("current")<=0?$(t.prevHook).addClass("vegas-disabled"):$(t.prevHook).removeClass("vegas-disabled"),$(this).vegas("current")>=$(this).vegas("__total")-1?$(t.nextHook).addClass("vegas-disabled"):$(t.nextHook).removeClass("vegas-disabled")}))},_dots:function(){for(var t=this,s=Object.keys(this.settings).reduce(function(t,s){return s.includes("dot-")&&(t[s.replace("dot-","")]=this.settings[s]),t},{}),e=this.$elmt.find(".vegas-dots .vegas-dot").eq(0),n=$(s.hook),o=$(s.hook).children().eq(0),i=function(){if(e.clone(!0).appendTo(t.$elmt.find(".vegas-dots")),"clone"==s.hookStatus&&o.clone(!0).appendTo(n),"clone-id"==s.hookStatus){var i=a;o.clone(!0).html(function(t,s){return s.replace(/\${i}/g,i+1)}).appendTo(n)}},a=1;a$(this).find(".vegas-dots .vegas-dot").length-1?$(this).find(".vegas-dots .vegas-dot").length-1:$(this).vegas("current");t=$(this).vegas("current")<0?0:t,$(this).find(".vegas-dots .vegas-dot").eq(t).addClass("vegas-dot-active"),$(s.hook).children().eq(t).addClass("vegas-dot-active")});var d=s.hook;$(s.hook).children().on("click",function(){$('[data-dot-hook="'+d+'"] .vegas-dots').children(".vegas-dot").eq($(this).index()).click()})},_init:function(){var t,s,i,e,n="BODY"===this.elmt.tagName,o=this.settings.timer,a=this.settings.overlay,d=this;this._preload(),n||(s=$('
'),t=$('
').css("overflow",this.$elmt.css("overflow")).css("padding",this.$elmt.css("padding")),this.$elmt.css("padding")||t.css("padding-top",this.$elmt.css("padding-top")).css("padding-bottom",this.$elmt.css("padding-bottom")).css("padding-left",this.$elmt.css("padding-left")).css("padding-right",this.$elmt.css("padding-right")),this.$elmt.css("padding",0),this.$elmt.clone(!0).children().appendTo(t),t.children().not(".vegas-dot-controls").wrapAll("
"),t.append($('
')),t.find(".vegas-arrow-controls").append($('
')).find(".vegas-prev").append($('
')),t.find(".vegas-arrow-controls").append($('
')).find(".vegas-next").append($('
')),t.append($('
')).find(".vegas-dot-controls").append($('
')).find(".vegas-dots").append($('
')),this.elmt.innerHTML=""),o&&this.support.transition&&(e=$('
'),this.$timer=e,this.$elmt.prepend(e)),a&&(i=$('
'),"string"==typeof a&&i.css("background-image","url("+a+")"),this.$overlay=i,this.$elmt.prepend(i)),this.$elmt.addClass("vegas-container"),n||(this.$elmt.append(s),s.append(t)),this.$elmt.data("vegas",this),setTimeout(function(){d.trigger("init"),d._goto(d.slide),d.settings.autoplay&&d.trigger("play")},1)},_preload:function(){var t;for(t=0;t
'),this.support.transition&&f&&s.addClass("vegas-transition-"+f),this.support.video&&r?((n=r instanceof Array?this._video(r):this._video(r.src)).loop=void 0===r.loop||r.loop,n.muted=void 0===r.mute||r.mute,!1===n.muted?(n.volume=0,this._fadeInSound(n,m)):n.pause(),e=$(n).addClass("vegas-video").css("background-color",c),this.support.objectFit?e.css("object-position",h+" "+g).css("object-fit",v).css("width","100%").css("height","100%"):"contain"===v&&e.css("width","100%").css("height","100%"),s.append(e)):(o=new Image,i=$('
').css("background-image",'url("'+d+'")').css("background-color",c).css("background-position",h+" "+g),"repeat"===v?i.css("background-repeat","repeat"):i.css("background-size",v),this.support.transition&&y&&i.addClass("vegas-animation-"+y).css("animation-duration",_+"ms"),s.append(i)),this.support.transition||s.css("display","none"),p?a.eq(p-1).after(s):this.$elmt.prepend(s),a.css("transition","all 0ms").each(function(){this.className="vegas-slide","VIDEO"===this.tagName&&(this.className+=" vegas-video"),f&&(this.className+=" vegas-transition-"+f,this.className+=" vegas-transition-"+f+"-in")}),u._timer(!1),n?(4===n.readyState&&(n.currentTime=0),n.play(),w()):(o.src=d,o.complete?w():o.onload=w)},_end:function(){this.ended=!this.settings.autoplay,this._timer(!1),this.trigger("end")},shuffle:function(){for(var t,s,i=this.total-1;0this.total-1||t===this.slide||(this.trigger("jump"),this.slide=t,this.trigger("change"),this._goto(this.slide))},next:function(){if(this.slide++,this.trigger("next"),this.trigger("change"),this.slide>=this.total){if(this.slide--,!this.settings.loop)return this._end();this.slide=0}this._goto(this.slide)},previous:function(){if(this.slide--,this.trigger("previous"),this.trigger("change"),this.slide<0){if(!this.settings.loop)return void this.slide++;this.slide=this.total-1}this._goto(this.slide)},trigger:function(t){var s=[];s="init"===t?[this.settings]:[this.slide,this.settings.slides[this.slide]],this.$elmt.trigger("vegas"+t,s),"function"==typeof this.settings[t]&&this.settings[t].apply(this.$elmt,s)},options:function(t,s){var i=this.settings.slides.slice();if("object"===_typeof(t))this.settings=$.extend({},defaults,$.vegas.defaults,t);else{if("string"!=typeof t)return this.settings;if(void 0===s)return this.settings[t];this.settings[t]=s}this.settings.slides!==i&&(this.total=this.settings.slides.length,this.noshow=this.total<2,this._preload())},destroy:function(){clearTimeout(this.timeout),this.$elmt.removeClass("vegas-container"),this.$elmt.find("> .vegas-slide").remove(),this.$elmt.find("> .vegas-wrapper").clone(!0).children().appendTo(this.$elmt),this.$elmt.find("> .vegas-wrapper").remove(),this.settings.timer&&this.$timer.remove(),this.settings.overlay&&this.$overlay.remove(),this.elmt._vegas=null}},$.fn.vegas=function(s){var i,e=arguments,n=!1;if(void 0===s||"object"===_typeof(s))return this.each(function(){this._vegas||(this._vegas=new Vegas(this,s))});if("string"==typeof s){if(this.each(function(){var t=this._vegas;if(!t)throw new Error("No Vegas applied to this element.");"_"===s[0]&&"_"===s[1]?i=t[s.substring(2)]:"function"==typeof t[s]&&"_"!==s[0]?i=t[s].apply(t,[].slice.call(e,1)):n=!0}),n)throw new Error('No method "'+s+'" in Vegas.');return void 0!==i?i:this}},$.vegas={},$.vegas.defaults=defaults,$.vegas.isVideoCompatible=function(){return!/(Android|webOS|Phone|iPad|iPod|BlackBerry|Windows Phone)/i.test(navigator.userAgent)}}(window.jQuery||window.Zepto||window.m4q),$(document).ready(function(){"function"==typeof $.initialize?$.initialize("[type=vegas]",function(t){window.delegate_vegas||(window.delegate_vegas=!0,delegate_function()),$(this).is(':not("[vegas]")')&&$(this).vegas().attr("vegas","")}):(window.init_vegas=function(){$('[type="vegas"]:not("[vegas]")').vegas().attr("vegas","")},0<$('[type="vegas"]:not("[vegas]")').length&&(window.init_vegas(),window.delegate_vegas=!0,delegate_function()))}); //# sourceMappingURL=vegas.min.js.map