function replaceUrlParam(e,r,a){var n=new RegExp("("+r+"=).*?(&|$)"),c=e;return c=e.search(n)>=0?e.replace(n,"$1"+a+"$2"):c+(c.indexOf("?")>0?"&":"?")+r+"="+a}typeof Shopify=="undefined"&&(Shopify={}),Shopify.formatMoney||(Shopify.formatMoney=function(cents,format){var value="",placeholderRegex=/\{\{\s*(\w+)\s*\}\}/,formatString=format||this.money_format;typeof cents=="string"&&(cents=cents.replace(".",""));function defaultOption(opt,def){return typeof opt=="undefined"?def:opt}function formatWithDelimiters(number,precision,thousands,decimal){if(precision=defaultOption(precision,2),thousands=defaultOption(thousands,","),decimal=defaultOption(decimal,"."),isNaN(number)||number==null)return 0;number=(number/100).toFixed(precision);var parts=number.split("."),dollars=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+thousands),cents2=parts[1]?decimal+parts[1]:"";return dollars+cents2}switch(formatString.match(placeholderRegex)[1]){case"amount":value=formatWithDelimiters(cents,2);break;case"amount_no_decimals":value=formatWithDelimiters(cents,0);break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",",");break;case"amount_no_decimals_with_comma_separator":value=formatWithDelimiters(cents,0,".",",");break}return formatString.replace(placeholderRegex,value)}),Shopify.optionsMap={},Shopify.updateOptionsInSelector=function(selectorIndex){switch(selectorIndex){case 0:var key="root",selector=jQuery(".single-option-selector:eq(0)");break;case 1:var key=jQuery(".single-option-selector:eq(0)").val(),selector=jQuery(".single-option-selector:eq(1)");break;case 2:var key=jQuery(".single-option-selector:eq(0)").val();key+=" / "+jQuery(".single-option-selector:eq(1)").val();var selector=jQuery(".single-option-selector:eq(2)")}var initialValue=selector.val();selector.empty();for(var availableOptions=Shopify.optionsMap[key],i2=0;i2").val(option).html(option);selector.append(newOption)}jQuery('.swatch[data-option-index="'+selectorIndex+'"] .swatch-element').each(function(){jQuery.inArray($(this).attr("data-value"),availableOptions)!==-1?$(this).removeClass("soldout").show().find(":radio").removeAttr("disabled","disabled").removeAttr("checked"):window.swatch_show_unvailable==!0?$(this).addClass("soldout").find(":radio").removeAttr("checked").attr("disabled","disabled"):$(this).addClass("soldout").hide().find(":radio").removeAttr("checked").attr("disabled","disabled")}),jQuery.inArray(initialValue,availableOptions)!==-1&&selector.val(initialValue),selector.trigger("change")},Shopify.linkOptionSelectors=function(product){for(var i2=0;i21){var key=variant.option1;Shopify.optionsMap[key]=Shopify.optionsMap[key]||[],Shopify.optionsMap[key].push(variant.option2),Shopify.optionsMap[key]=Shopify.uniq(Shopify.optionsMap[key])}if(product.options.length===3){var key=variant.option1+" / "+variant.option2;Shopify.optionsMap[key]=Shopify.optionsMap[key]||[],Shopify.optionsMap[key].push(variant.option3),Shopify.optionsMap[key]=Shopify.uniq(Shopify.optionsMap[key])}}}Shopify.updateOptionsInSelector(0),product.options.length>1&&Shopify.updateOptionsInSelector(1),product.options.length===3&&Shopify.updateOptionsInSelector(2),jQuery(".single-option-selector:eq(0)").change(function(){return Shopify.updateOptionsInSelector(1),product.options.length===3&&Shopify.updateOptionsInSelector(2),!0}),jQuery(".single-option-selector:eq(1)").change(function(){return product.options.length===3&&Shopify.updateOptionsInSelector(2),!0})},window.vela=window.vela||{},vela.cacheSelectors=function(){vela.cache={$html:$("html"),$body:$("body"),$velaProductImage:$("#ProductPhotoImg"),$velaLoading:$("#loading"),$velaNewletterModal:$("#velaNewsletterModal")}},vela.init=function(){vela.cacheSelectors(),vela.preLoading(),vela.startTheme(),vela.drawersInit(),vela.swatchProduct(),vela.productThumbImage(),vela.ajaxSearch(),vela.ajaxFilter(),vela.accordion(),vela.responsiveVideos(),vela.floatHeader(),vela.menuMobile(),vela.productCountdown(),vela.owlOneCarousel(),vela.quickview(),vela.lookbook(),vela.flytocart(),vela.goToTop(),vela.newsletter(),vela.productLoadMore(),vela.velaAccountPage(),vela.velaBannerTop(),vela.filterByPrice(),vela.disclosure(),window.ajaxcart_type=="modal"&&ajaxCart.load()},vela.flytocart=function(){function flyToElement(flyer,flyingTo){var divider=3,flyerClone=$(flyer).clone();$(flyerClone).css({position:"absolute",top:$(flyer).offset().top+"px",left:$(flyer).offset().left+"px",opacity:1,"z-index":1e3}),$("body").append($(flyerClone));var gotoX=$(flyingTo).offset().left+$(flyingTo).width()/2-$(flyer).width()/divider/2,gotoY=$(flyingTo).offset().top+$(flyingTo).height()/2-$(flyer).height()/divider/2;$(flyerClone).animate({opacity:.4,left:gotoX,top:gotoY,width:$(flyer).width()/divider,height:$(flyer).height()/divider},700,function(){$(flyerClone).fadeOut("fast",function(){$(flyerClone).remove()})})}window.ajaxcart_type=="fly"&&$(".formAddToCart button.btnAddToCart").on("click",function(e){$("html, body").animate({scrollTop:$(".velaCartTop").position().top});var itemImg=$(this).parents(".proFlyBlock").find(".imgFlyCart");flyToElement($(itemImg),$(".velaCartTop"))})},vela.disclosure=function(){var $disclosure=$(".js-disclosure");$disclosure.each(function(){var $disclosureOptions=$(this).find(".js-disclosure-item"),$disclosureInput=$(this).find(".js-disclosure-input");$disclosureOptions.on("click",function(evt){evt.preventDefault();var value=$(this).data("value");$disclosureInput.val(value),$(this).closest("form").submit()})})},vela.filterByPrice=function(){var $range=$("#rangePrice"),$btnFilter=$(".btnFilterPrice"),minPrice=0,maxPrice=0;function processFilterPrice(minPrice2,maxPrice2){$("#loading").show(),$("#velaProList .rowFlexMargin .velaProBlock").hide().filter(function(){var bprice=$(this).data("price").toString().replace(/,/g,""),price=parseInt(bprice,10);return console.log("Min: "+minPrice2),console.log("Max: "+maxPrice2),console.log("Price: "+price),price>=minPrice2&&price<=maxPrice2}).show(),$("body,html").animate({scrollTop:400},600),setTimeout(function(){$("#loading").hide()},200)}$btnFilter.on("click",function(){minPrice=$range.data("from"),maxPrice=$range.data("to"),processFilterPrice(minPrice,maxPrice)}),$range.ionRangeSlider({onFinish:function(data){}})},vela.getHash=function(){return window.location.hash},vela.productPage=function(options){var moneyFormat=options.money_format,variant=options.variant,selector=options.selector,$addToCart=$("#AddToCart"),$productPrice=$("#ProductPrice"),$comparePrice=$("#ComparePrice"),$quantityElements=$(".qtySelector, .qtySelector + .velaQty"),$addToCartText=$("#AddToCartText");if(variant){if(variant.available?($addToCart.removeClass("disabled").prop("disabled",!1),$addToCartText.html("Add to Cart"),$quantityElements.show()):($addToCart.addClass("disabled").prop("disabled",!0),$addToCartText.html("Sold Out"),$quantityElements.hide()),$productPrice.html(Shopify.formatMoney(variant.price,moneyFormat)),variant.compare_at_price>variant.price?$comparePrice.html(Shopify.formatMoney(variant.compare_at_price,moneyFormat)).show():$comparePrice.hide(),window.swatch_enable)for(var form=$("#"+selector.domIdPrefix).closest("form"),i2=0,length=variant.options.length;i2SKU: "+proSKU),variant.available?($(".productAvailability").removeClass("outstock"),$(".productAvailability").addClass("instock"),$(".productAvailability").html(" In stock ")):($(".productAvailability").removeClass("instock"),$(".productAvailability").addClass("outstock"),$(".productAvailability").html(" Out Of Stock")),window.currencies&&Currency.convertAll(window.currency,$(".jsvela-currency__item.active").data("value"),"span.money","money_format")}else $addToCart.addClass("disabled").prop("disabled",!0),$addToCartText.html("Out Of Stock"),$quantityElements.hide();if(variant&&variant.featured_media){var currentMediaID=variant.featured_media.id,mediaID,slideIndex=0;$("#productThumbs .product-single__thumbnail").removeClass("active-thumb"),$("#productThumbs .product-single__thumbnail").each(function(){var $self=$(this);if(mediaID=$self.data("imageid"),mediaID===currentMediaID){var currentSlide=$self.closest(".product-single__thumbnails-item");return slideIndex=currentSlide.data("slick-index")?currentSlide.data("slick-index"):0,$self.addClass("active-thumb"),$("#ProductPhotoImg").attr("src",$self.data("image")).attr("data-zoom-image",$self.data("zoom-image")),$self.trigger("click"),!1}}),slideIndex!="undefined"&&$("#productThumbs .product-single__thumbnails").slick("slickGoTo",slideIndex)}},vela.preLoading=function(){var counter=0,preLoading=$("#velaPreLoading"),preLoadingBar=$("#velaPreLoading > span"),items=new Array;preLoading.css({position:"fixed",top:0,left:0,zIndex:99999,width:"100%",height:"100%",backgroundColor:"rgba(255, 255, 255, 1)"}),$("body").removeClass("bodyPreLoading");function getImages(element){$(element).find("*:not(script)").each(function(){var url="";if($(this).css("background-image").indexOf("none")==-1&&$(this).css("background-image").indexOf("-gradient")==-1){if(url=$(this).css("background-image"),url.indexOf("url")!=-1){var temp=url.match(/url\((.*?)\)/);url=temp[1].replace(/\"/g,"")}}else $(this).get(0).nodeName.toLowerCase()=="img"&&typeof $(this).attr("src")!="undefined"&&(url=$(this).attr("src"));url.length>0&&items.push(url)})}function preLoadingImage(url){var imgPreLoading=new Image;$(imgPreLoading).load(function(){runPreLoading()}).error(function(){runPreLoading()}).attr("src",url)}function preLoadingStart(){for(var i2=0;i2=items.length&&(counter=items.length,$(preLoadingBar).stop().animate({width:"100%"},500,"linear",function(){$(preLoading).fadeOut(200,function(){$(preLoading).remove()})}))}getImages($("body")),preLoadingStart()},vela.startTheme=function(){$(".swatch :radio").change(function(){var t=$(this).closest(".swatch").attr("data-option-index"),n=$(this).val();$(this).closest("form").find(".single-option-selector").eq(t).val(n).trigger("change")}),$(".headerCartModal .overlayCart, .headerCartModal .closeCartModal").on("click",function(){$(".headerCartModal").removeClass("active")}),$("body").on("click",".velaCartModal",function(){$(this).parent().toggleClass("active")}),$("body").click(function(e){var target=$(e.target);target.parents(".velaCartTop").length===0&&$(".velaCartTop").removeClass("active")}),$('[data-toggle="tooltip"]').tooltip(),$(".googleOverPlay").on("click",function(){$(this).fadeOut()}),$(".velaGoogleMap").on("mouseleave",function(){$(this).find(".googleOverPlay").fadeIn()})},vela.drawersInit=function(){vela.RightDrawer=new vela.Drawers("cartDrawer","Right",!0,{onDrawerOpen:ajaxCart.load})},vela.swatchProduct=function(){$(".velaSwatchProduct > li").each(function(){var eImage=$(this).parents(".velaProBlock").find(".proSwatch .product-card__image > img"),eImgSrc=eImage.attr("src");$(this).mouseover(function(){var newImage=$(this).find(".hidden a").attr("href");newImage!="#"&&eImage.attr({src:newImage,srcset:""})}),$(this).mouseout(function(){var eImgsrcset=eImage.data("srcset");eImage.attr({srcset:eImgsrcset}),eImage.removeAttr("src")})})},vela.productThumbImage=function(){$("#productThumbs").length>0&&$("#productThumbs .owl-carousel").each(function(){var owlCarousel=$(this),item=owlCarousel.data("item");(item===void 0||item==null)&&(item=5);var vertical=owlCarousel.data("vertical");(vertical===void 0||vertical==null)&&(vertical=!1);var mItem=item;vertical&&(mItem=4);var config={navigation:!0,autoplaySpeed:0,slidesToScroll:1,slidesToShow:1,responsive:[{breakpoint:768,settings:{slidesToShow:1,cssEase:"linear",speed:150,dots:!0}},{breakpoint:992,settings:{slidesToShow:5}},{breakpoint:1200,settings:{slidesToShow:5}},{breakpoint:1400,settings:{slidesToShow:5}},{breakpoint:1600,settings:{slidesToShow:5}},{breakpoint:3840,settings:{slidesToShow:5}}]};owlCarousel.slick(config)})},vela.ajaxSearch=function(){var currentAjaxRequest=null,searchForms=$('form[action="/search"]').each(function(){var inputSearch=$(this).find('input[name="q"]'),inputProduct=$(this).find('input[name="type"]'),offSet=inputSearch.position().top+inputSearch.innerHeight();$('
    ').appendTo($(this)).hide(),inputProduct.val()=="product"&&inputSearch.attr("autocomplete","off").bind("keyup change",function(){var term=$(this).val(),form=$(this).closest("form"),searchURL="/search?type=product&q="+term,resultsList=form.find(".velaAjaxSearch");term.length>1&&term!=$(this).attr("data-old-term")&&($(this).attr("data-old-term",term),currentAjaxRequest!=null&¤tAjaxRequest.abort(),currentAjaxRequest=$.getJSON(searchURL+"&view=json",function(data){resultsList.empty(),data.results_count==0?resultsList.hide():($.each(data.results,function(index,item){var link=$("").attr("href",item.url);link.append('
    '),link.append('
    '+item.title+''+item.price+"
    "),link.wrap("
  • "),resultsList.append(link.parent())}),data.results_count>10&&resultsList.append('
  • See all results ('+data.results_count+")
  • "),resultsList.fadeIn(200))}))})});$("body").bind("click",function(){$(".velaAjaxSearch").hide()}),$(".searchBoxTop").hover(function(){$(".velaSearchbox .velaSearch").focus()}),vela.cache.$body.on("click",".velaSearchIcon",function(){$(".searchBoxTop").toggleClass("active"),$(".searchClose").toggleClass("active"),$(".searchOverLayer").toggleClass("active")}),vela.cache.$body.on("click",".searchClose, .searchOverLayer",function(){var hasClass=$(this).hasClass("active");hasClass&&($(".searchBoxTop").removeClass("active"),$(".searchClose").removeClass("active"),$(".searchOverLayer").removeClass("active"))})},vela.ajaxFilter=function(){var btnOpenFilter=$(".filterTagFullwidthButton"),filterContent=$(".filterTagFullwidthContent");vela.cache.$body.on("click",".filterTagFullwidthButton",function(){filterContent.hasClass("active")?(btnOpenFilter.removeClass("active"),filterContent.removeClass("active"),$(".filterTagFullwidthOverlay").each(function(){$(this).remove()})):($('
    ').css("display","none").insertAfter(filterContent),$(".filterTagFullwidthOverlay").fadeIn(300),btnOpenFilter.addClass("active"),filterContent.addClass("active"))}),vela.cache.$body.on("click",".filterTagFullwidthOverlay, .filterTagFullwidthClose",function(){$(".filterTagFullwidthOverlay").each(function(){$(this).remove()}),btnOpenFilter.removeClass("active"),filterContent.removeClass("active")});var isAjaxFilterClick=!1;$(".template-collection")&&History.Adapter.bind(window,"statechange",function(){var State=History.getState();if(!isAjaxFilterClick){ajaxFilterParams();var newurl=ajaxFilterCreateUrl();ajaxFilterGetContent(newurl),reActivateSidebar()}vela.isSidebarAjaxClick=!1}),ajaxFilterParams=function(){if(Shopify.queryParams={},location.search.length)for(var aKeyValue,i2=0,aCouples=location.search.substr(1).split("&");i21&&(Shopify.queryParams[decodeURIComponent(aKeyValue[0])]=decodeURIComponent(aKeyValue[1]))},ajaxFilterCreateUrl=function(baseLink){var newQuery=$.param(Shopify.queryParams).replace(/%2B/g,"+");return baseLink?newQuery!=""?baseLink+"?"+newQuery:baseLink:location.pathname+"?"+newQuery},ajaxFilterClick=function(baseLink){delete Shopify.queryParams.page;var newurl=ajaxFilterCreateUrl(baseLink);isAjaxFilterClick=!0,History.pushState({param:Shopify.queryParams},newurl,newurl),ajaxFilterGetContent(newurl)},ajaxFilterSortby=function(){if(Shopify.queryParams.sort_by){var sortby=Shopify.queryParams.sort_by;$("#SortBy").val(sortby)}vela.cache.$body.on("change","#SortBy",function(event){Shopify.queryParams.sort_by=$(this).val(),ajaxFilterClick()})},ajaxFilterView=function(){vela.cache.$body.on("click",".changeView",function(event){event.preventDefault(),$(this).hasClass("changeViewActive")||(Shopify.queryParams.view=$(this).data("view"),$(".changeView").removeClass("changeViewActive"),$(this).addClass("changeViewActive"),ajaxFilterClick())})},ajaxFilterTags=function(){vela.cache.$body.on("click",".ajaxFilter li > a",function(event){event.preventDefault();var currentTags=[];if(Shopify.queryParams.constraint&&(currentTags=Shopify.queryParams.constraint.split("+")),!window.sidebar_multichoise&&!$(this).parent().hasClass("active")){var otherTag=$(this).parents(".listFilter").find("li.active");if(otherTag.length>0){var tagName=otherTag.data("filter");if(tagName){var tagPos=currentTags.indexOf(tagName);tagPos>=0&¤tTags.splice(tagPos,1)}}}var dataHandle=$(this).parent().data("filter");if(dataHandle){var tagPos=currentTags.indexOf(dataHandle);tagPos>=0?currentTags.splice(tagPos,1):currentTags.push(dataHandle)}currentTags.length?Shopify.queryParams.constraint=currentTags.join("+"):delete Shopify.queryParams.constraint,ajaxFilterClick()})},ajaxFilterPaging=function(){vela.cache.$body.on("click","#collPagination .pagination a",function(event){event.preventDefault();var linkPage=$(this).attr("href").match(/page=\d+/g);if(linkPage&&(Shopify.queryParams.page=parseInt(linkPage[0].match(/\d+/g)),Shopify.queryParams.page)){var newurl=ajaxFilterCreateUrl();isAjaxFilterClick=!0,History.pushState({param:Shopify.queryParams},newurl,newurl),ajaxFilterGetContent(newurl),$("body,html").animate({scrollTop:300},600)}})},ajaxFilterReview=function(){if(window.review&&$(".shopify-product-reviews-badge").length>0)return window.SPR.registerCallbacks(),window.SPR.initRatingHandler(),window.SPR.initDomEls(),window.SPR.loadProducts(),window.SPR.loadBadges()},ajaxFilterClear=function(){$(".ajaxFilter").each(function(){var sidebarTag=$(this);sidebarTag.find(".listFilter > li.active").length>0&&sidebarTag.find(".velaClear").show().click(function(e){var currentTags=[];Shopify.queryParams.constraint&&(currentTags=Shopify.queryParams.constraint.split("+")),sidebarTag.find(".listFilter > li.active").each(function(){var selectedTag=$(this),tagName=selectedTag.data("filter");if(tagName){var tagPos=currentTags.indexOf(tagName);tagPos>=0&¤tTags.splice(tagPos,1)}}),currentTags.length?Shopify.queryParams.constraint=currentTags.join("+"):delete Shopify.queryParams.constraint,ajaxFilterClick(),e.preventDefault()})})},ajaxFilterClearAll=function(){vela.cache.$body.on("click","a.velaClearAll",function(e){delete Shopify.queryParams.constraint,delete Shopify.queryParams.q,ajaxFilterClick(),e.preventDefault()})},ajaxFilterAddToCart=function(){window.ajaxcart_type!="page"&&ajaxCart.init({formSelector:".formAddToCart",cartContainer:"#cartContainer",addToCartSelector:".btnAddToCart",cartCountSelector:"#CartCount",cartCostSelector:"#CartCost",moneyFormat:null})},ajaxAccordionMobile=function(){$(".velaSidebar").hasClass("accordion")&&$("#sidebarAjaxFilter .titleSidebar").on("click",function(e){$(this).toggleClass("active").parent().find(".velaContent").stop().slideToggle("medium"),e.preventDefault()})},ajaxFilterData=function(data){var currentList=$("#proListCollection .proList"),dataList=$(data).find("#proListCollection .proList");currentList.replaceWith(dataList),$("#collPagination").length>0?$("#collPagination").replaceWith($(data).find("#collPagination")):$("#shopify-section-vela-template-collection").append($(data).find("#collPagination"));var currentSidebarFilter=$("#sidebarAjaxFilter"),dataSidebarFilter=$(data).find("#sidebarAjaxFilter");currentSidebarFilter.replaceWith(dataSidebarFilter)},ajaxFilterGetContent=function(newurl){$.ajax({type:"get",url:newurl,beforeSend:function(){vela.cache.$velaLoading.show()},success:function(data){var newTitle=$(data).filter("title").text();document.title=newTitle,ajaxFilterData(data),ajaxFilterSortby(),ajaxFilterReview(),ajaxFilterClear(),ajaxFilterAddToCart(),ajaxAccordionMobile(),vela.flytocart(),vela.cache.$velaLoading.hide(),vela.swatchProduct()},error:function(xhr,text){vela.cache.$velaLoading.hide()}})},ajaxFilterParams(),ajaxFilterSortby(),ajaxFilterView(),ajaxFilterTags(),ajaxFilterPaging(),ajaxFilterClear(),ajaxFilterClearAll()},vela.accordion=function(){function accordionSidebar(){$(window).width()<=767?$(".velaBlogSidebar").hasClass("accordion")||($(".velaBlogSidebar .titleSidebar").on("click",function(e){$(this).toggleClass("active").parent().find(".velaContent").stop().slideToggle("medium"),e.preventDefault()}),$(".velaBlogSidebar").addClass("accordion").find(".velaContent").slideUp("fast")):($(".velaBlogSidebar .titleSidebar").removeClass("active").off().parent().find(".velaContent").removeAttr("style").slideDown("fast"),$(".velaBlogSidebar").removeClass("accordion"))}function accordionFooter(){$(window).width()<=767?$(".velaFooterMenu").hasClass("accordion")||($(".velaFooterMenu .velaFooterTitle").on("click",function(e){$(this).toggleClass("active").parent().find(".velaContent").stop().slideToggle("medium"),e.preventDefault()}),$(".velaFooterMenu").addClass("accordion").find(".velaContent").slideUp("fast")):($(".velaFooterMenu .velaFooterTitle").removeClass("active").off().parent().find(".velaContent").removeAttr("style").slideDown("fast"),$(".velaFooterMenu").removeClass("accordion"))}accordionSidebar(),accordionFooter(),$(window).resize(accordionSidebar),$(window).resize(accordionFooter)},vela.responsiveVideos=function(){var $iframeVideo=$('.proDetailInfo iframe[src*="youtube.com/embed"], .proDetailInfo iframe[src*="player.vimeo"]'),$iframeReset=$iframeVideo.add("iframe#admin_bar_iframe");$iframeVideo.each(function(){$(this).wrap('
    ')}),$iframeReset.each(function(){this.src=this.src})},vela.floatHeader=function(){function doFloatHeader(status){if(status){$("#velaHeader").addClass("headerFixed");var hideheight=$("#velaHeader").height()+120,pos=$(window).scrollTop();pos>=hideheight?$(".headerMenu").addClass("velaHeaderFixed"):$(".headerMenu").removeClass("velaHeaderFixed")}else $("#velaHeader").removeClass("headerFixed"),$(".headerMenu").removeClass("velaHeaderFixed")}function velaFloatHeader(){window.float_header&&($(window).width()>=992?doFloatHeader(!0):$(window).width()<=991&&doFloatHeader(!1))}function velaFloatHeaderChange(){if(window.float_header)if($(window).width()>=992){var hideheight=$("#velaHeader").height()+120,pos=$(window).scrollTop();pos>=hideheight?$(".headerMenu").addClass("velaHeaderFixed"):$(".headerMenu").removeClass("velaHeaderFixed")}else $(window).width()<=991&&$("#velaMegamenu").removeClass("velaHeaderFixed")}velaFloatHeader(),$(window).resize(velaFloatHeader),$(window).scroll(velaFloatHeaderChange)},vela.menuMobile=function(){vela.cache.$body.on("click","#btnMenuMobile",function(e){e.preventDefault(),$("body").toggleClass("menuMobileActive")}),vela.cache.$body.on("click",".btnMenuClose, .menuMobileOverlay",function(e){e.preventDefault(),$("body").removeClass("menuMobileActive")})},vela.productCountdown=function(){$("[data-countdown]").each(function(){var $this=$(this),finalDate=$(this).data("countdown");$this.countdown(finalDate,function(event){$this.html(event.strftime(window.countdown_format))})})},vela.owlOneCarousel=function(){$(".owlCarouselPlay .owl-carousel").each(function(){var owlCarousel=$(this),nav=owlCarousel.data("nav"),navText=owlCarousel.data("navText"),dots=owlCarousel.data("dots"),autoplay=owlCarousel.data("autoplay"),autoplayTimeout=owlCarousel.data("autoplaytimeout"),loop=owlCarousel.data("loop"),margin=owlCarousel.data("margin"),center=owlCarousel.data("center"),columnOne=owlCarousel.data("columnone"),columnTwo=owlCarousel.data("columntwo"),columnThree=owlCarousel.data("columnthree"),columnFour=owlCarousel.data("columnfour"),columnFive=owlCarousel.data("columnfive");(margin===void 0||margin==null)&&(margin=20);var config={margin:margin,nav:nav,responsive:{0:{items:columnFive},480:{items:columnFour},768:{items:columnThree},992:{items:columnTwo},1200:{items:columnOne}}};dots===void 0||dots==null||dots.length<=0||dots!=!0?config.dots=!1:config.dots=!0,navText===void 0||navText==null||navText.length<=0||(config.navText=navText),loop===void 0||loop==null||loop.length<=0||(config.loop=loop),center===void 0||center==null||loop.center<=0||(config.center=center),autoplay&&(config.autoplay=autoplay,config.autoplayTimeout=autoplayTimeout,config.autoplayHoverPause=!0),columnOne!=null&&owlCarousel.owlCarousel(config)})},vela.lookbook=function(){vela.cache.$body.on("click",".lookbItemButton",function(){var boxLookBook=$(this).parents(".velaBoxLookbook"),itemLookBook=boxLookBook.find(".lookbItem"),itemLookBookContent=boxLookBook.find(".lookbItemContent");boxLookBook.hasClass("active")?(boxLookBook.removeClass("active"),$(".velaBoxLookbookOverlay").remove(),$(".velaBoxLookbookClose").remove()):(boxLookBook.addClass("active"),itemLookBook.prepend('
    '),itemLookBookContent.prepend('
    '),itemLookBookContent.fadeIn(500))}),vela.cache.$body.on("click",".velaBoxLookbookOverlay, .velaBoxLookbookClose",function(){$(".velaBoxLookbook").removeClass("active"),$(".velaBoxLookbookOverlay").remove(),$(".velaBoxLookbookClose").remove(),$(".lookbItemContent").fadeOut(500)})},vela.quickview=function(){var product={},option1="",option2="";Shopify.doNotTriggerClickOnThumb=!1,selectCallbackQuickView=function(variant,selector){var productItem=jQuery(".jsQuickview .proBoxInfo"),addToCart=productItem.find(".btnAddToCart"),productQty=productItem.find(".proQuantity"),productPrice=productItem.find(".pricePrimary"),comparePrice=productItem.find(".priceCompare");if(variant){if(variant.sku=="")var variantSku="N/A";else var variantSku=variant.sku;if(productItem.find(".quickViewSKU").html(""+variantSku),variant.available?(addToCart.removeClass("disabled").removeAttr("disabled"),addToCart.html("Add to Cart"),productQty.show(),productItem.find(".proBoxInfo .quickviewAvailability").removeClass("outstock").addClass("instock"),productItem.find(".proBoxInfo .quickviewAvailability").append("In stock ")):(addToCart.addClass("disabled").attr("disabled","disabled"),addToCart.html("Sold Out"),productQty.hide(),productItem.find(".proBoxInfo .quickviewAvailability").removeClass("instock").addClass("outstock"),productItem.find(".proBoxInfo .quickviewAvailability").append("Out Of Stock")),productPrice.html(Shopify.formatMoney(variant.price,window.money)),variant.compare_at_price>variant.price?comparePrice.html(Shopify.formatMoney(variant.compare_at_price,window.money)).show():comparePrice.hide(),window.swatch_enable){productItem.find(".selector-wrapper").addClass("hiddenVariant");for(var form=jQuery("#"+selector.domIdPrefix).closest("form"),i2=0,length=variant.options.length;i2").val(u).html(u);r.append(a)}$('.jsQuickview .swatch[data-option-index="'+t+'"] .swatch-element').each(function(){var variantValue=$(this).find(".js-qv-variant-value").text();$.inArray(variantValue,s)!==-1?$(this).removeClass("soldout").show().find(":radio").removeAttr("disabled","disabled"):window.swatch_show_unvailable==!0?$(this).addClass("soldout").find(":radio").removeAttr("checked").attr('disabled", "disabled'):$(this).addClass("soldout").hide().find(":radio").removeAttr("checked").attr("disabled","disabled")}),$.inArray(i2,s)!==-1&&r.val(i2),r.trigger("change")},velaLinkOptionSelectors=function(t){for(var n=0;n1){var i2=r.option1;Shopify.optionsMapQuickview[i2]=Shopify.optionsMapQuickview[i2]||[],Shopify.optionsMapQuickview[i2].push(r.option2),Shopify.optionsMapQuickview[i2]=Shopify.uniq(Shopify.optionsMapQuickview[i2])}if(t.options.length===3){var i2=r.option1+" / "+r.option2;Shopify.optionsMapQuickview[i2]=Shopify.optionsMapQuickview[i2]||[],Shopify.optionsMapQuickview[i2].push(r.option3),Shopify.optionsMapQuickview[i2]=Shopify.uniq(Shopify.optionsMapQuickview[i2])}}}velaUpdateOptionsInSelector(0),t.options.length>1&&velaUpdateOptionsInSelector(1),t.options.length===3&&velaUpdateOptionsInSelector(2),$("#productSelectQuickview-option-0").change(function(){return velaUpdateOptionsInSelector(1),t.options.length===3&&velaUpdateOptionsInSelector(2),!0}),$("#productSelectQuickview-option-1").change(function(){return t.options.length===3&&velaUpdateOptionsInSelector(2),!0})},loadQuickViewSlider=function(n,r){var loadingImgQuickView=$(".loadingImage"),s=Shopify.resizeImage(n.featured_image,"grande");loadingImgQuickView.hide();var activeClass="";if(n.media.length>0){var o=r.find(".proThumbnailsQuickview .owl-carousel");for(i in n.media){i==0?activeClass="active":activeClass="";var f='
    '+n.media[i].preview_image.alt+'
    ';o.append(f)}o.find("a").click(function(){var t=r.find(".proImageQuickview");if(t.attr("src")!=$(this).attr("data-image")){for(i in n.media)o.find("a").hasClass("active")&&o.find("a").removeClass("active");t.attr("src",$(this).attr("data-image")),$(this).addClass("active"),loadingImgQuickView.show(),t.load(function(t2){$(this).unbind("load"),loadingImgQuickView.hide()})}}),o.owlCarousel({items:4,nav:!0,mouseDrag:!1,dots:!1}).css("visibility","visible")}else r.find(".jsQuickview .proThumbnailsQuickview").remove()},convertToSlug=function(e){return e.toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")},addCheckedSwatch=function(){vela.cache.$body.on("click",".swatch .color label",function(){$(".swatch .color").each(function(){$(this).find("label").removeClass("checkedBox")}),$(this).addClass("checkedBox")})},quickViewVariants=function(t,quickview){if(t.variants.length>1){for(var r=0;r'+i2.title+"";quickview.find("form.formQuickview .proVariantsQuickview > select").append(s)}if(new Shopify.OptionSelectors("productSelectQuickview",{product:t,onVariantSelected:selectCallbackQuickView}),t.options.length==1&&$("form.formQuickview .selector-wrapper:eq(0)").prepend(""),quickview.find("form.formQuickview .selector-wrapper label").each(function(n,r2){$(this).html(t.options[n].name)}),window.swatch_enable){for(var o=window.file_url.substring(0,window.file_url.lastIndexOf("?")),u=window.asset_url.substring(0,window.asset_url.lastIndexOf("?")),a="",r=0;r',a+='
    '+t.options[r].name+":  
    ";var f=!1;/Color|Colour/i.test(t.options[r].name)&&(f=!0);for(var l=new Array,c=0;c',f&&(a+='
    '+h+"
    "),a+='",a+='",f?a+='':a+='',a+="",i2.available&&$('.jsQuickview .swatch[data-option-index="'+r+'"] .'+p).removeClass("soldout").addClass("available").find(":radio").removeAttr("disabled"),l.push(h)}}a+=""}quickview.find("form.formQuickview .proVariantsQuickview > select").after(a),quickview.find(".swatch :radio").change(function(){var t2=$(this).closest(".swatch").attr("data-option-index"),q=$(this).prev(".js-qv-variant-value").text();$(this).closest("form").find(".single-option-selector").eq(t2).val(q).trigger("change")}),addCheckedSwatch()}t.available&&(Shopify.optionsMapQuickview={},window.swatch_show_unvailable?window.swatch_enable&&velaLinkOptionSelectors(t):velaLinkOptionSelectors(t))}else{quickview.find("form.formQuickview .proVariantsQuickview > select").remove();var v='';quickview.find("form.formQuickview").append(v)}},validateQty=function(qty){return parseFloat(qty)==parseInt(qty)&&!isNaN(qty)||(qty=1),qty},qvAddToCart=function(){window.ajaxcart_type!="page"&&ajaxCart.init({formSelector:".formQuickview",cartContainer:"#cartContainer",addToCartSelector:".btnAddToCart",cartCountSelector:"#CartCount",cartCostSelector:"#CartCost",moneyFormat:null})},$(document).on("click",".proThumbnailsQuickview li",function(){changeImageQuickView($(this).find("img:first-child"),".proImageQuickview")}),$(document).on("click",".quickviewClose, .quickviewOverlay",function(e){$("#velaQuickView").fadeOut(0),$(".jsQuickview").html(""),$(".jsQuickview").removeClass("velaFadeOut")}),$(document).on("click",".btnProductQuickview",function(e){vela.cache.$velaLoading.show();var producthandle=$(this).data("handle");return Shopify.getProduct(producthandle,function(product2){var qvhtml=$("#quickviewModal").html();$(".jsQuickview").html(qvhtml);var quickview=$(".jsQuickview"),productdes=product2.description.replace(/(<([^>]+)>)/ig,""),shortProductDesc="",featured_image=product2.media[0].preview_image.src;if(product2.description.indexOf("[SHORTDESCRIPTION]")!=-1?(shortProductDesc=product2.description.split("[SHORTDESCRIPTION]")[0],quickview.find(".proShortDescription").html(shortProductDesc)):(shortProductDesc=productdes.split(" ").splice(0,30).join(" ")+"...",quickview.find(".proShortDescription").text(shortProductDesc)),quickview.find(".proImageQuickview").attr("src",featured_image),quickview.find(".proImage").attr("href",product2.url),quickview.find(".pricePrimary").html(Shopify.formatMoney(product2.price,window.money)),quickview.find(".proBoxInfo").attr("id","product-"+product2.id),quickview.find(".formQuickview").attr("id","product-actions-"+product2.id),quickview.find(".formQuickview select").attr("id","productSelectQuickview"),quickview.find(".proBoxInfo .quickviewName").html(""+product2.title+""),quickview.find(".proBoxInfo .quickViewVendor").append(" "+product2.vendor),product2.variants[0].sku=="")var variantSku="N/A";else var variantSku=product2.variants[0].sku;quickview.find(".proBoxInfo .quickViewSKU").append(" "+variantSku),product2.available?(quickview.find(".proBoxInfo .quickviewAvailability").removeClass("outstock").addClass("instock"),quickview.find(".proBoxInfo .quickviewAvailability").append(" In stock ")):(quickview.find(".proBoxInfo .quickviewAvailability").removeClass("instock").addClass("outstock"),quickview.find(".proBoxInfo .quickviewAvailability").append(" Out Of Stock")),product2.compare_at_price>product2.price?(quickview.find(".priceCompare").html(Shopify.formatMoney(product2.compare_at_price_max,window.money)).show(),quickview.find(".pricePrimary").addClass("priceSale")):quickview.find(".priceCompare").html(""),product2.available?quickViewVariants(product2,quickview):(quickview.find("select, input").hide(),quickview.find(".btnAddToCart").html("Sold Out").addClass("disabled").attr("disabled","disabled"),quickview.find(".proQuantity").hide()),loadQuickViewSlider(product2,quickview),$("#velaQuickView").fadeIn(500),$(".jsQuickview").fadeIn(500),$(".jsQuickview").addClass("velaFadeOut"),vela.cache.$velaLoading.hide(),qvAddToCart(),window.currencies&&Currency.convertAll(window.currency,Currency.cookie.read())}),!1})},vela.goToTop=function(){$(window).scroll(function(){$(window).scrollTop()>=200?$("#goToTop").fadeIn():$("#goToTop").fadeOut()}),$("#goToTop").click(function(){return $("body,html").animate({scrollTop:0},"normal"),$("#pageContainer").animate({scrollTop:0},"normal"),!1})},vela.newsletter=function(){var alertNewsletter;$(".js-vela-newsletter").each(function(){var $form=$(this);$form.on("submit",function(event){event.preventDefault(),$(".js-alert-newsletter").remove(),$.ajax({type:$form.attr("method"),url:$form.attr("action"),data:$form.serialize(),cache:!1,dataType:"json",contentType:"application/json; charset=utf-8",success:function(data){data.result==="success"?($form.prepend(alertNewsletter(window.newsletter_success,"success")),$(".js-input-newsletter").val("")):$form.prepend(alertNewsletter(data.msg.replace("0 - ",""),"error"))},error:function(err){$form.prepend(alertNewsletter(err,"error"))}})})}),alertNewsletter=function(message,type){var alert='
    '+message+'
    ';return alert}},vela.productLoadMore=function(){function loadmoreExecute(){var velaLoadNode=$(".productLoadMore .btnLoadMore"),velaLoadUrl=$(".productLoadMore .btnLoadMore").attr("href");$.ajax({type:"GET",url:velaLoadUrl,beforeSend:function(){vela.cache.$velaLoading.show()},success:function(data){velaLoadNode.remove(),vela.cache.$velaLoading.hide();var filteredData=$(data).find(".producsLoadMore");filteredData.insertBefore($(".proLoadMoreBottom")),btnMoreEvent()},dataType:"html"})}function btnMoreEvent(){$(".productLoadMore .btnLoadMore").click(function(e){return $(this).hasClass("disableLoadMore")?(e.stopPropagation(),!1):(loadmoreExecute(),e.stopPropagation(),!1)})}btnMoreEvent()},vela.velaAccountPage=function(){$("body").on("click",".velaRecoverPassword",function(evt){evt.preventDefault(),$("#RecoverPasswordForm").removeClass("hidden"),$("#CustomerLoginForm").addClass("hidden")}),$("body").on("click",".velaHideRecoverPasswordLink",function(evt){evt.preventDefault(),$("#RecoverPasswordForm").addClass("hidden"),$("#CustomerLoginForm").removeClass("hidden")}),vela.getHash()=="#recover"&&($("#RecoverPasswordForm").removeClass("hidden"),$("#CustomerLoginForm").addClass("hidden")),$("body").on("click",".velaShowPassword",function(event){var btnPassword=$(this),passwordField=btnPassword.prev("input");passwordField.attr("type")=="password"?(passwordField.attr("type","text"),btnPassword.text("Hide")):(passwordField.attr("type","password"),btnPassword.text("Show"))})},vela.productImage=function(){if(vela.cache.$velaProductImage.length>0){if($(window).width()>=992){var zoomYN=vela.cache.$velaProductImage.data("zoom-enable"),zoomScroll=vela.cache.$velaProductImage.data("zoom-scroll"),zoomType=vela.cache.$velaProductImage.data("zoom-type"),zoomWindowWidth=vela.cache.$velaProductImage.data("zoom-width"),zoomWindowHeight=vela.cache.$velaProductImage.data("zoom-height"),zoomLensSize=vela.cache.$velaProductImage.data("zoom-lens"),zoomLensShape=vela.cache.$velaProductImage.data("lens-shape"),zoomLensBorderColor=vela.cache.$velaProductImage.data("lens-border");vela.cache.$velaProductImage.elevateZoom({zoomEnabled:zoomYN,gallery:"productThumbs",galleryActiveClass:"active",cursor:"pointer",zoomType:zoomType,scrollZoom:zoomScroll,zoomWindowWidth:zoomWindowWidth,zoomWindowHeight:zoomWindowHeight,lensSize:zoomLensSize,lensShape:zoomLensShape,onImageSwapComplete:function(){$(".zoomWrapper div").hide()}}),vela.cache.$velaProductImage.bind("click",function(e){var ez1=$("#ProductPhotoImg").data("elevateZoom"),imageGallery1=[];return $.each(ez1.getGalleryList(),function(index,value){imageGallery1.push({src:value.href})}),$.fancybox.open(imageGallery1),!1}),$("#velaViewImage").bind("click",function(e){var ez1=$("#ProductPhotoImg").data("elevateZoom"),imageGallery1=[];return $.each(ez1.getGalleryList(),function(index,value){imageGallery1.push({src:value.href})}),$.fancybox.open(imageGallery1),!1})}else if($(window).width()<=991){vela.cache.$velaProductImage.elevateZoom({zoomEnabled:!1,gallery:"productThumbs"});var imageGallery=[],ez=vela.cache.$velaProductImage.data("elevateZoom");$.each(ez.getGalleryList(),function(index,value){imageGallery.push({src:value.href})})}}},vela.Drawers=function(){var Drawer=function(id,position,iscart,options){var defaults={close:".jsDrawerClose",open:".jsDrawerOpen"+position,openClass:"jsDrawerOpen",dirOpenClass:"jsDrawerOpen"+position};if(this.$nodes={parent:$("body, html"),page:$("#pageContainer"),moved:$(".isMoved")},this.config=$.extend(defaults,options),this.position=position,this.iscart=iscart,this.$drawer=$("#"+id),!this.$drawer.length)return!1;this.drawerIsOpen=!1,this.init()};return Drawer.prototype.init=function(){$(this.config.open).on("click",$.proxy(this.open,this)),this.$drawer.find(this.config.close).on("click",$.proxy(this.close,this))},Drawer.prototype.open=function(evt){if(window.ajaxcart_type=="modal"&&this.iscart){var externalCall=!1;this.$drawer.modal(),evt?evt.preventDefault():externalCall=!0,evt&&evt.stopPropagation&&(evt.stopPropagation(),this.$activeSource=$(evt.currentTarget)),this.config.onDrawerOpen&&typeof this.config.onDrawerOpen=="function"&&(externalCall||this.config.onDrawerOpen())}else{var externalCall=!1;if(evt?evt.preventDefault():externalCall=!0,evt&&evt.stopPropagation&&(evt.stopPropagation(),this.$activeSource=$(evt.currentTarget)),this.drawerIsOpen&&!externalCall)return this.close();this.$nodes.moved.addClass("is-transitioning"),this.$drawer.prepareTransition(),this.$nodes.parent.addClass(this.config.openClass+" "+this.config.dirOpenClass),this.drawerIsOpen=!0,this.trapFocus(this.$drawer,"drawer_focus"),this.config.onDrawerOpen&&typeof this.config.onDrawerOpen=="function"&&(externalCall||this.config.onDrawerOpen()),this.$activeSource&&this.$activeSource.attr("aria-expanded")&&this.$activeSource.attr("aria-expanded","true"),this.$nodes.page.on("touchmove.drawer",function(){return!1}),this.$nodes.page.on("click.drawer",$.proxy(function(){return this.close(),!1},this))}},Drawer.prototype.close=function(){this.drawerIsOpen&&($(document.activeElement).trigger("blur"),this.$nodes.moved.prepareTransition({disableExisting:!0}),this.$drawer.prepareTransition({disableExisting:!0}),this.$nodes.parent.removeClass(this.config.dirOpenClass+" "+this.config.openClass),this.drawerIsOpen=!1,this.removeTrapFocus(this.$drawer,"drawer_focus"),this.$nodes.page.off(".drawer"))},Drawer.prototype.trapFocus=function($container,eventNamespace){var eventName=eventNamespace?"focusin."+eventNamespace:"focusin";$container.attr("tabindex","-1"),$container.focus(),$(document).on(eventName,function(evt){$container[0]!==evt.target&&!$container.has(evt.target).length&&$container.focus()})},Drawer.prototype.removeTrapFocus=function($container,eventNamespace){var eventName=eventNamespace?"focusin."+eventNamespace:"focusin";$container.removeAttr("tabindex"),$(document).off(eventName)},Drawer}(),window.velatheme=window.velatheme||{},velatheme.Sections=function(){this.constructors={},this.instances=[]},velatheme.Sections.prototype=_.assignIn({},velatheme.Sections.prototype,{_createInstance:function(container,constructor){var $container=$(container),id=$container.attr("data-section-id"),type=$container.attr("data-section-type");if(constructor=constructor||this.constructors[type],!_.isUndefined(constructor)){var instance=_.assignIn(new constructor(container),{id:id,type:type,container:container});this.instances.push(instance)}},register:function(type,constructor){this.constructors[type]=constructor,$("[data-section-type="+type+"]").each(function(index,container){this._createInstance(container,constructor)}.bind(this))}}),vela.velaBannerTop=function(){var date=new Date,minutes=5;date.setTime(date.getTime()+minutes*60*1e3),$.cookie("velaBannerTop")=="closed"?$("#bannerTop").removeClass("active"):$("#bannerTop").addClass("active"),$("#bannerTop .btn-bannerTop").click(function(){$("#bannerTop").hasClass("active")?($.cookie("velaBannerTop","closed",date),$("#bannerTop").removeClass("active")):($.cookie("velaBannerTop","opened",date),$("#bannerTop").addClass("active"))})},velatheme.Slideshow=function(){this.$slideshow=null;var classes={wrapper:"velaSlideshowWrapper",slideshow:"vela--slideshow",currentSlide:"slick-current",video:"velassVideo",videoBackground:"velassVideoBackground",closeVideoBtn:"btnssVideoControlClose",pauseButton:"btnssPause",isPaused:"is-paused"};function slideshow(el){this.$slideshow=$(el),this.$wrapper=this.$slideshow.closest("."+classes.wrapper),this.$pause=this.$wrapper.find("."+classes.pauseButton),this.settings={accessibility:!0,arrows:this.$slideshow.data("navigation"),dots:this.$slideshow.data("pagination"),fade:!0,pauseOnHover:!0,draggable:!0,touchThreshold:20,autoplay:this.$slideshow.data("autoplay"),autoplaySpeed:this.$slideshow.data("speed")},this.$slideshow.on("beforeChange",beforeChange.bind(this)),this.$slideshow.on("init",slideshowA11y.bind(this)),this.$slideshow.slick(this.settings),this.$pause.on("click",this.togglePause.bind(this))}function slideshowA11y(event,obj){var $slider=obj.$slider,$list=obj.$list,$wrapper=this.$wrapper,autoplay=this.settings.autoplay;$slider.removeClass("velaSliderLoading"),$list.removeAttr("aria-live"),$wrapper.on("focusin",function(evt){$wrapper.has(evt.target).length&&($list.attr("aria-live","polite"),autoplay&&$slider.slick("slickPause"))}),$wrapper.on("focusout",function(evt){if($wrapper.has(evt.target).length&&($list.removeAttr("aria-live"),autoplay)){if($(evt.target).hasClass(classes.closeVideoBtn))return;$slider.slick("slickPlay")}}),obj.$dots&&obj.$dots.on("keydown",function(evt){evt.which===37&&$slider.slick("slickPrev"),evt.which===39&&$slider.slick("slickNext"),(evt.which===37||evt.which===39)&&obj.$dots.find(".slick-active button").focus()})}function beforeChange(event,slick,currentSlide,nextSlide){var $slider=slick.$slider,$currentSlide=$slider.find("."+classes.currentSlide),$nextSlide=$slider.find('.velassSlide[data-slick-index="'+nextSlide+'"]');if(isVideoInSlide($currentSlide)){var $currentVideo=$currentSlide.find("."+classes.video),currentVideoId=$currentVideo.attr("id");velatheme.SlideshowVideo.pauseVideo(currentVideoId),$currentVideo.attr("tabindex","-1")}if(isVideoInSlide($nextSlide)){var $video=$nextSlide.find("."+classes.video),videoId=$video.attr("id"),isBackground=$video.hasClass(classes.videoBackground);isBackground?velatheme.SlideshowVideo.playVideo(videoId):$video.attr("tabindex","0")}}function isVideoInSlide($slide){return $slide.find("."+classes.video).length}slideshow.prototype.togglePause=function(){var slideshowSelector=getSlideshowId(this.$pause);this.$pause.hasClass(classes.isPaused)?(this.$pause.removeClass(classes.isPaused),$(slideshowSelector).slick("slickPlay")):(this.$pause.addClass(classes.isPaused),$(slideshowSelector).slick("slickPause"))};function getSlideshowId($el){return"#velaSlideshows"+$el.data("id")}return slideshow}(),velatheme.SlideshowVideo=function(){var autoplayCheckComplete=!1,autoplayAvailable=!1,playOnClickChecked=!1,playOnClick=!1,youtubeLoaded=!1,videos={},videoPlayers=[],videoOptions={ratio:16/9,playerVars:{iv_load_policy:3,modestbranding:1,autoplay:0,controls:0,showinfo:0,wmode:"opaque",branding:0,autohide:0,rel:0},events:{onReady:onPlayerReady,onStateChange:onPlayerChange}},classes={playing:"video-is-playing",paused:"video-is-paused",loading:"video-is-loading",loaded:"video-is-loaded",slideshowWrapper:"velaSlideshowWrapper",slide:"velassSlide",slideBackgroundVideo:"velassSlideBackgroundVideo",slideDots:"slick-dots",videoChrome:"velassVideo-chrome",videoBackground:"velassVideoBackground",playVideoBtn:"btnssVideoControlPlay",closeVideoBtn:"btnssVideoControlClose",currentSlide:"slick-current",slickClone:"slick-cloned",supportsAutoplay:"autoplay",supportsNoAutoplay:"no-autoplay"};function init($video){if($video.length&&(videos[$video.attr("id")]={id:$video.attr("id"),videoId:$video.data("id"),type:$video.data("type"),status:$video.data("type")==="chrome"?"closed":"background",videoSelector:$video.attr("id"),$parentSlide:$video.closest("."+classes.slide),$parentSlideshowWrapper:$video.closest("."+classes.slideshowWrapper),controls:$video.data("type")==="background"?0:1,slideshow:$video.data("slideshow")},!youtubeLoaded)){var tag=document.createElement("script");tag.src="https://www.youtube.com/iframe_api";var firstScriptTag=document.getElementsByTagName("script")[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}}function customPlayVideo(playerId){!playOnClickChecked&&!playOnClick||playerId&&typeof videoPlayers[playerId].playVideo=="function"&&privatePlayVideo(playerId)}function pauseVideo(playerId){videoPlayers[playerId]&&typeof videoPlayers[playerId].pauseVideo=="function"&&videoPlayers[playerId].pauseVideo()}function loadVideos(){for(var key in videos)if(videos.hasOwnProperty(key)){var args=$.extend({},videoOptions,videos[key]);args.playerVars.controls=args.controls,videoPlayers[key]=new YT.Player(key,args)}initEvents(),youtubeLoaded=!0}function loadVideo(key){if(youtubeLoaded){var args=$.extend({},videoOptions,videos[key]);args.playerVars.controls=args.controls,videoPlayers[key]=new YT.Player(key,args),initEvents()}}function privatePlayVideo(id,clicked){var videoData=videos[id],player=videoPlayers[id],$slide=videos[id].$parentSlide;if(playOnClick)setAsPlaying(videoData);else if(clicked||autoplayCheckComplete&&autoplayAvailable){$slide.removeClass(classes.loading),setAsPlaying(videoData),player.playVideo();return}autoplayCheckComplete||autoplayCheckFunction(player,$slide)}function setAutoplaySupport(supported){var supportClass=supported?classes.supportsAutoplay:classes.supportsNoAutoplay;$(document.documentElement).addClass(supportClass),supported||(playOnClick=!0),autoplayCheckComplete=!0}function autoplayCheckFunction(player,$slide){player.playVideo(),autoplayTest(player).then(function(){setAutoplaySupport(!0)}).fail(function(){setAutoplaySupport(!1),player.stopVideo()}).always(function(){autoplayCheckComplete=!0,$slide.removeClass(classes.loading)})}function autoplayTest(player){var deferred=$.Deferred(),wait,timeout;return wait=setInterval(function(){player.getCurrentTime()<=0||(autoplayAvailable=!0,clearInterval(wait),clearTimeout(timeout),deferred.resolve())},500),timeout=setTimeout(function(){clearInterval(wait),deferred.reject()},4e3),deferred}function playOnClickCheck(){playOnClickChecked||($(window).width()<767&&(playOnClick=!0),playOnClick&&setAutoplaySupport(!1),playOnClickChecked=!0)}function onPlayerReady(evt){evt.target.setPlaybackQuality("hd1080");var videoData=getVideoOptions(evt);switch(playOnClickCheck(),$("#"+videoData.id).attr("tabindex","-1"),sizeBackgroundVideos(),videoData.type){case"background-chrome":case"background":evt.target.mute(),videoData.$parentSlide.hasClass(classes.currentSlide)&&privatePlayVideo(videoData.id);break}videoData.$parentSlide.addClass(classes.loaded)}function onPlayerChange(evt){var videoData=getVideoOptions(evt);switch(evt.data){case 0:setAsFinished(videoData);break;case 1:setAsPlaying(videoData);break;case 2:setAsPaused(videoData);break}}function setAsFinished(videoData){switch(videoData.type){case"background":videoPlayers[videoData.id].seekTo(0);break;case"background-chrome":videoPlayers[videoData.id].seekTo(0),closeVideo(videoData.id);break;case"chrome":closeVideo(videoData.id);break}}function setAsPlaying(videoData){var $slideshow=videoData.$parentSlideshowWrapper,$slide=videoData.$parentSlide;if($slide.removeClass(classes.loading),videoData.status!=="background"){switch($("#"+videoData.id).attr("tabindex","0"),videoData.type){case"chrome":case"background-chrome":$slideshow.removeClass(classes.paused).addClass(classes.playing),$slide.removeClass(classes.paused).addClass(classes.playing);break}$slide.find("."+classes.closeVideoBtn).focus()}}function setAsPaused(videoData){var $slideshow=videoData.$parentSlideshowWrapper,$slide=videoData.$parentSlide;if(videoData.type==="background-chrome"){closeVideo(videoData.id);return}videoData.status!=="closed"&&videoData.type!=="background"&&($slideshow.addClass(classes.paused),$slide.addClass(classes.paused)),videoData.type==="chrome"&&videoData.status==="closed"&&($slideshow.removeClass(classes.paused),$slide.removeClass(classes.paused)),$slideshow.removeClass(classes.playing),$slide.removeClass(classes.playing)}function closeVideo(playerId){var videoData=videos[playerId],$slideshow=videoData.$parentSlideshowWrapper,$slide=videoData.$parentSlide,classesToRemove=[classes.pause,classes.playing].join(" ");switch($("#"+videoData.id).attr("tabindex","-1"),videoData.status="closed",videoData.type){case"background-chrome":videoPlayers[playerId].mute(),setBackgroundVideo(playerId);break;case"chrome":videoPlayers[playerId].stopVideo(),setAsPaused(videoData);break}$slideshow.removeClass(classesToRemove),$slide.removeClass(classesToRemove)}function getVideoOptions(evt){var videosid=$(".slideShowVela .slick-active .velassVideo").attr("id");return videosid==null&&(videosid=evt.target.l.id),videos[videosid]}function startVideoOnClick(playerId){var videoData=videos[playerId];switch(videoData.$parentSlide.addClass(classes.loading),videoData.status="open",videoData.type){case"background-chrome":unsetBackgroundVideo(playerId,videoData),videoPlayers[playerId].unMute(),privatePlayVideo(playerId,!0);break;case"chrome":privatePlayVideo(playerId,!0);break}$(document).on("keydown.videoPlayer",function(evt){evt.keyCode===27&&closeVideo(playerId)})}function sizeBackgroundVideos(){$("."+classes.videoBackground).each(function(index,el){sizeBackgroundVideo($(el))})}function sizeBackgroundVideo($player){var $slide=$player.closest("."+classes.slide);if(!$slide.hasClass(classes.slickClone)){var slideWidth=$slide.width(),playerWidth=$player.width(),playerHeight=$player.height();slideWidth/videoOptions.ratio$(window).scrollTop()+$(window).height())&&(closeVideo(key),toggleExpandVideo(key,!1))}}}))}function createPlayer(key){var args=$.extend({},videoOptions,videos[key]);args.playerVars.controls=args.controls,videoPlayers[key]=new YT.Player(key,args)}function removeEvents(){$(document).off(".videoPlayer"),$(window).off(".videoPlayer")}function setButtonLabels($videoWrapper,title){var $playButtons=$videoWrapper.find(selectors.playVideoBtn),$closeButton=$videoWrapper.find(selectors.closeVideoBtn),$pauseButton=$videoWrapper.find(selectors.pauseVideoBtn),$closeButtonText=$closeButton.find(selectors.fallbackText),$pauseButtonStopText=$pauseButton.find(selectors.pauseVideoStop).find(selectors.fallbackText),$pauseButtonResumeText=$pauseButton.find(selectors.pauseVideoResume).find(selectors.fallbackText);$playButtons.each(function(){var $playButton=$(this),$playButtonText=$playButton.find(selectors.fallbackText);$playButtonText.text($playButtonText.text().replace("[video_title]",title))}),$closeButtonText.text($closeButtonText.text().replace("[video_title]",title)),$pauseButtonStopText.text($pauseButtonStopText.text().replace("[video_title]",title)),$pauseButtonResumeText.text($pauseButtonResumeText.text().replace("[video_title]",title))}return{init:init,editorLoadVideo:editorLoadVideo,loadVideos:loadVideos,playVideo:customPlayVideo,pauseVideo:pauseVideo,removeEvents:removeEvents}}(),velatheme.Helpers=function(){var touchDevice=!1;function setTouch(){touchDevice=!0}function isTouch(){return touchDevice}return{setTouch:setTouch,isTouch:isTouch}}(),velatheme.LibraryLoader=function(){var types={link:"link",script:"script"},status={requested:"requested",loaded:"loaded"},cloudCdn="https://cdn.shopify.com/shopifycloud/",libraries={youtubeSdk:{tagId:"youtube-sdk",src:"https://www.youtube.com/iframe_api",type:types.script},plyrShopifyStyles:{tagId:"plyr-shopify-styles",src:cloudCdn+"shopify-plyr/v1.0/shopify-plyr.css",type:types.link},modelViewerUiStyles:{tagId:"shopify-model-viewer-ui-styles",src:cloudCdn+"model-viewer-ui/assets/v1.0/model-viewer-ui.css",type:types.link}};function load(libraryName,callback){var library=libraries[libraryName];if(library&&library.status!==status.requested){if(callback=callback||function(){},library.status===status.loaded){callback();return}library.status=status.requested;var tag;switch(library.type){case types.script:tag=createScriptTag(library,callback);break;case types.link:tag=createLinkTag(library,callback);break}tag.id=library.tagId,library.element=tag;var firstScriptTag=document.getElementsByTagName(library.type)[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}}function createScriptTag(library,callback){var tag=document.createElement("script");return tag.src=library.src,tag.addEventListener("load",function(){library.status=status.loaded,callback()}),tag}function createLinkTag(library,callback){var tag=document.createElement("link");return tag.href=library.src,tag.rel="stylesheet",tag.type="text/css",tag.addEventListener("load",function(){library.status=status.loaded,callback()}),tag}return{load:load}}(),velatheme.ProductVideo=function(){var videos={},hosts={html5:"html5",youtube:"youtube"},selectors={productMediaWrapper:"[data-product-single-media-wrapper]"},attributes={enableVideoLooping:"enable-video-looping",videoId:"video-id"};function init(videoContainer,sectionId){if(videoContainer.length){var videoElement=videoContainer.find("iframe, video")[0],mediaId=videoContainer.data("mediaId");if(videoElement){videos[mediaId]={mediaId:mediaId,sectionId:sectionId,host:hostFromVideoElement(videoElement),container:videoContainer,element:videoElement,ready:function(){createPlayer(this)}};var video=videos[mediaId];switch(video.host){case hosts.html5:window.Shopify.loadFeatures([{name:"video-ui",version:"1.0",onLoad:setupPlyrVideos}]),velatheme.LibraryLoader.load("plyrShopifyStyles");break;case hosts.youtube:velatheme.LibraryLoader.load("youtubeSdk",setupYouTubeVideos);break}}}}function setupPlyrVideos(errors){if(errors){fallbackToNativeVideo();return}loadVideos(hosts.html5)}function setupYouTubeVideos(){window.YT.Player&&loadVideos(hosts.youtube)}function createPlayer(video){if(!video.player){var productMediaWrapper=video.container.closest(selectors.productMediaWrapper),enableLooping=productMediaWrapper.data(attributes.enableVideoLooping);switch(video.host){case hosts.html5:video.player=new Shopify.Plyr(video.element,{loop:{active:enableLooping}});break;case hosts.youtube:var videoId=productMediaWrapper.data(attributes.videoId);video.player=new YT.Player(video.element,{videoId:videoId,events:{onStateChange:function(event){event.data===0&&enableLooping&&event.target.seekTo(0)}}});break}productMediaWrapper.on("mediaHidden xrLaunch",function(){video.player&&(video.host===hosts.html5&&video.player.pause(),video.host===hosts.youtube&&video.player.pauseVideo&&video.player.pauseVideo())}),productMediaWrapper.on("mediaVisible",function(){velatheme.Helpers.isTouch()||video.player&&(video.host===hosts.html5&&video.player.play(),video.host===hosts.youtube&&video.player.playVideo&&video.player.playVideo())})}}function hostFromVideoElement(video){return video.tagName==="VIDEO"?hosts.html5:video.tagName==="IFRAME"&&/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(video.src)?hosts.youtube:null}function loadVideos(host){for(var key in videos)if(videos.hasOwnProperty(key)){var video=videos[key];video.host===host&&video.ready()}}function fallbackToNativeVideo(){for(var key in videos)if(videos.hasOwnProperty(key)){var video=videos[key];if(video.nativeVideo)continue;video.host===hosts.html5&&(video.element.setAttribute("controls","controls"),video.nativeVideo=!0)}}function removeSectionVideos(sectionId){for(var key in videos)if(videos.hasOwnProperty(key)){var video=videos[key];video.sectionId===sectionId&&(video.player&&video.player.destroy(),delete videos[key])}}return{init:init,hosts:hosts,loadVideos:loadVideos,removeSectionVideos:removeSectionVideos}}(),velatheme.ProductModel=function(){var modelJsonSections={},models={},xrButtons={},selectors={mediaGroup:"[data-product-single-media-group]",xrButton:"[data-shopify-xr]"};function init(modelViewerContainers,sectionId){modelJsonSections[sectionId]={loaded:!1},modelViewerContainers.each(function(index){var $modelViewerContainer=$(this),mediaId=$modelViewerContainer.data("media-id"),$modelViewerElement=$($modelViewerContainer.find("model-viewer")[0]),modelId=$modelViewerElement.data("model-id");if(index===0){var $xrButton=$modelViewerContainer.closest(selectors.mediaGroup).find(selectors.xrButton);xrButtons[sectionId]={$element:$xrButton,defaultId:modelId}}models[mediaId]={modelId:modelId,sectionId:sectionId,$container:$modelViewerContainer,$element:$modelViewerElement}}),window.Shopify.loadFeatures([{name:"shopify-xr",version:"1.0",onLoad:setupShopifyXr},{name:"model-viewer-ui",version:"1.0",onLoad:setupModelViewerUi}]),velatheme.LibraryLoader.load("modelViewerUiStyles")}function setupShopifyXr(errors){if(!errors){if(!window.ShopifyXR){document.addEventListener("shopify_xr_initialized",function(){setupShopifyXr()});return}for(var sectionId in modelJsonSections)if(modelJsonSections.hasOwnProperty(sectionId)){var modelSection=modelJsonSections[sectionId];if(modelSection.loaded)continue;var $modelJson=$("#ModelJson-"+sectionId);window.ShopifyXR.addModels(JSON.parse($modelJson.html())),modelSection.loaded=!0}window.ShopifyXR.setupXRElements()}}function setupModelViewerUi(errors){if(!errors){for(var key in models)if(models.hasOwnProperty(key)){var model=models[key];model.modelViewerUi||(model.modelViewerUi=new Shopify.ModelViewerUI(model.$element)),setupModelViewerListeners(model)}}}function setupModelViewerListeners(model){var xrButton=xrButtons[model.sectionId];model.$container.on("mediaVisible",function(){xrButton.$element.attr("data-shopify-model3d-id",model.modelId),!velatheme.Helpers.isTouch()&&model.modelViewerUi.play()}),model.$container.on("mediaHidden",function(){xrButton.$element.attr("data-shopify-model3d-id",xrButton.defaultId),model.modelViewerUi.pause()}).on("xrLaunch",function(){model.modelViewerUi.pause()})}function removeSectionModels(sectionId){for(var key in models)if(models.hasOwnProperty(key)){var model=models[key];model.sectionId===sectionId&&(models[key].modelViewerUi.destroy(),delete models[key])}delete modelJsonSections[sectionId]}return{init:init,removeSectionModels:removeSectionModels}}(),velatheme.Product={},velatheme.Product=function(){function Product(container){var $container=this.$container=$(container),sectionId=$container.attr("data-section-id");this.settings={mediaQueryMediumUp:"screen and (min-width: 767px)",mediaQuerySmall:"screen and (max-width: 749px)",bpSmall:!1,enableHistoryState:$container.data("enable-history-state")||!1,namespace:".slideshow-"+sectionId,sectionId:sectionId},this.selectors={productMediaWrapper:"[data-product-single-media-wrapper]",productThumbImages:".product-single__thumbnail--"+sectionId,productThumbs:".product-single__thumbnails-"+sectionId,productThumb:".product-single__thumbnail",productThumbListItem:".product-single__thumbnails-item",productThumbsWrapper:".thumbnails-wrapper",productMediaTypeVideo:"[data-product-media-type-video]",productMediaTypeModel:"[data-product-media-type-model]"},this.classes={hidden:"hide",visibilityHidden:"visibility-hidden",activeClass:"active-thumb"},this.$loaderStatus=$(this.selectors.loaderStatus,$container),$("#ProductJson-"+sectionId).html()&&(this.productSingleObject=JSON.parse(document.getElementById("ProductJson-"+sectionId).innerHTML),this._initMediaSwitch(),this._initProductVideo(),this._initModelViewerLibraries(),this._initShopifyXrLaunch())}return Product.prototype=_.assignIn({},velatheme.Product.prototype,{_initProductVideo:function(){var sectionId=this.settings.sectionId;$(this.selectors.productMediaTypeVideo,this.$container).each(function(){var $el=$(this);velatheme.ProductVideo.init($el,sectionId)})},_initMediaSwitch:function(){if($(this.selectors.productThumbImages).length){var self=this;$(this.selectors.productThumbImages).on("click",function(evt){evt.preventDefault();var $el=$(this),mediaId=$el.data("thumbnail-id"),productType=$el.data("stype"),zoomImg=$el.data("zoom-image");$("#ProductPhotoImg").attr("data-zoom-image",zoomImg),productType=="image"?(window.innerWidth<760?$("#proFeaturedImage").css("display","none"):$("#proFeaturedImage").css("display","block"),$("#groupProImage").css("display","block"),$("#groupMedia").css("display","none")):($("#groupProImage").css("display","none"),$("#groupMedia").css("display","block")),self._switchMedia(mediaId),self._setActiveThumbnail(mediaId)}).on("keyup",self._handleMediaFocus.bind(self))}},_setActiveThumbnail:function(mediaId){typeof mediaId=="undefined"&&(mediaId=$(this.selectors.productMediaWrapper+":not(.hide)",this.$container).data("media-id"));var $thumbnailWrappers=$(this.selectors.productThumbListItem+":not(.slick-cloned)",this.$container),$activeThumbnail=$thumbnailWrappers.find(this.selectors.productThumbImages+"[data-thumbnail-id='"+mediaId+"']");$(this.selectors.productThumbImages).removeClass(this.classes.activeClass).removeAttr("aria-current"),$activeThumbnail.addClass(this.classes.activeClass),$activeThumbnail.attr("aria-current",!0),$thumbnailWrappers.hasClass("slick-slide")},_switchMedia:function(mediaId){var $currentMedia=$(this.selectors.productMediaWrapper+":not(."+this.classes.hidden+")",this.$container),$newMedia=$(this.selectors.productMediaWrapper+"[data-media-id='"+mediaId+"']",this.$container),$otherMedia=$(this.selectors.productMediaWrapper+":not([data-media-id='"+mediaId+"'])",this.$container);$currentMedia.trigger("mediaHidden"),$newMedia.removeClass(this.classes.hidden).trigger("mediaVisible"),$otherMedia.addClass(this.classes.hidden)},_handleMediaFocus:function(evt){if(evt.keyCode===slate.utils.keyboardKeys.ENTER){var mediaId=$(evt.currentTarget).data("thumbnail-id");$(this.selectors.productMediaWrapper+"[data-media-id='"+mediaId+"']",this.$container).focus()}},_initModelViewerLibraries:function(){var $modelViewerElements=$(this.selectors.productMediaTypeModel,this.$container);$modelViewerElements.length<1||velatheme.ProductModel.init($modelViewerElements,this.settings.sectionId)},_initShopifyXrLaunch:function(){var self=this;$(document).on("shopify_xr_launch",function(){var $currentMedia=$(self.selectors.productMediaWrapper+":not(."+self.classes.hidden+")",self.$container);$currentMedia.trigger("xrLaunch")})},onUnload:function(){this.$container.off(this.settings.namespace),velatheme.ProductVideo.removeSectionVideos(this.settings.sectionId),velatheme.ProductModel.removeSectionModels(this.settings.sectionId)}}),Product}();function onYouTubeIframeAPIReady(){velatheme.SlideshowVideo.loadVideos(),velatheme.Video.loadVideos(),velatheme.ProductVideo.loadVideos(velatheme.ProductVideo.hosts.youtube)}$(document).ready(function(){$(vela.init),$("body").on("ajaxCart.afterCartLoad",function(evt,cart){window.ajaxcart_type=="drawer"&&vela.RightDrawer.open()});var sections=new velatheme.Sections;sections.register("velaSlideshowSection",velatheme.SlideshowSection),sections.register("product",velatheme.Product),sections.register("vela-template-product",velatheme.Product)}),$(window).on("load",function(){$(vela.productImage)}); //# sourceMappingURL=/cdn/shop/t/9/assets/vela.js.map?v=105007438639972701081717596852