PageSourceSearch

https://us.ecoflow.com/cdn/shop/t/1497/assets/theme.js?v=76370965199936498091787123234

js ecoflow.com collected 2026-09-24 08:28:59 UTC 395,116 bytes, 7 lines download raw bytes

1window.theme=window.theme||{},window.ecoflowThemeOnReady=window.ecoflowThemeOnReady||function(callback){if(typeof callback=="function"){if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",callback,{once:!0});return}window.setTimeout(callback,0)}},window.theme=window.theme||{},theme.Sections=function(){this.constructors={},this.instances=[],document.addEventListener("shopify:section:load",this._onSectionLoad.bind(this)),document.addEventListener("shopify:section:unload",this._onSectionUnload.bind(this)),document.addEventListener("shopify:section:select",this._onSelect.bind(this)),document.addEventListener("shopify:section:deselect",this._onDeselect.bind(this)),document.addEventListener("shopify:block:select",this._onBlockSelect.bind(this)),document.addEventListener("shopify:block:deselect",this._onBlockDeselect.bind(this)),document.addEventListener("shopify:section:reorder",this._onSectionReorder.bind(this))};var _createClass=(function(){function defineProperties(target,props){for(var i2=0;i2<props.length;i2++){var descriptor=props[i2];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}})();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}window.theme=window.theme||{};function setCookie(name,value,days){var expires="";if(days){var date=new Date;date.setTime(date.getTime()+days*24*60*60*1e3),expires="; expires="+date.toUTCString()}document.cookie=name+"="+(value||"")+expires+"; path=/"}function setCookieWithDomain(name,value,days,domain){var expires="";if(days){var date=new Date;date.setTime(date.getTime()+days*24*60*60*1e3),expires="; expires="+date.toUTCString()}document.cookie=name+"="+(value||"")+expires+"; path=/; domain="+domain}function getCookie(name){let parts=`; ${document.cookie}`.split(`; ${name}=`);if(parts.length===2)return parts.pop().split(";").shift()}var handleizeStr=function(str){return str.toLowerCase().replace(/[^\w\u00C0-\u024f]+/g,"-").replace(/^-+|-+$/g,"")};function checkFirstIndexSection(){var isSlideshowFirstSection=!1,main_wrapper=document.querySelector("#MainContent"),slideShowFirst=!1;if(main_wrapper){var first_shopifySection=main_wrapper.querySelectorAll(".shopify-section")[0];first_shopifySection&&first_shopifySection.classList.contains("index-section--slideshow")&&(isSlideshowFirstSection=!0,slideShowFirst=!0,first_shopifySection.querySelector(".slideshow-section-wrapper").classList.contains("page-width")&&(isSlideshowFirstSection=!1))}if(isSlideshowFirstSection){var isSlideshowFirstSection=!1,main_wrapper=document.querySelector("#MainContent"),no_overlapHeader=document.querySelector("#shopify-section-header").classList.contains("no-overlap");if(!no_overlapHeader&&main_wrapper){var first_shopifySection=main_wrapper.querySelectorAll(".shopify-section")[0];first_shopifySection&&first_shopifySection.classList.contains("index-section--slideshow")&&(isSlideshowFirstSection=!0,first_shopifySection.querySelector(".slideshow-section-wrapper").classList.contains("page-width")&&(isSlideshowFirstSection=!1))}document.querySelector("#shopify-section-header")&&(isSlideshowFirstSection?document.querySelector("#shopify-section-header").classList.remove("showAlternateHeader"):document.querySelector("#shopify-section-header").classList.add("showAlternateHeader"))}else{var noOverlap=!1,showAlternateHeader=!1,custom_page_header_section=document.querySelector(".custom_page_header_section"),alternate_logo=document.querySelector(".alternate_logo"),main_logo=document.querySelector(".main_logo"),PageContainer=document.querySelector("#PageContainer");custom_page_header_section||(showAlternateHeader=!0),document.querySelector(".no-overlap")&&(showAlternateHeader=!0,noOverlap=!0),slideShowFirst&&(showAlternateHeader=!0),showAlternateHeader?(PageContainer&&(noOverlap||PageContainer.classList.add("marginTop")),document.querySelector("#shopify-section-header")&&document.querySelector("#shopify-section-header").classList.add("showAlternateHeader"),alternate_logo&&(alternate_logo.classList.remove("hide"),main_logo.classList.add("hide"))):(document.querySelector("#shopify-section-header").classList.remove("showAlternateHeader"),PageContainer&&PageContainer.classList.remove("marginTop"),alternate_logo&&(alternate_logo.classList.add("hide"),main_logo.classList.remove("hide")))}}theme.Sections.prototype=Object.assign({},theme.Sections.prototype,{_createInstance:function(container,constructor){var id=container.getAttribute("data-section-id"),type=container.getAttribute("data-section-type");if(constructor=constructor||this.constructors[type],!(typeof constructor>"u")){var instance=Object.assign(new constructor(container),{id,type,container});this.instances.push(instance)}},_onSectionLoad:function(evt){var container=document.querySelector('[data-section-id="'+evt.detail.sectionId+'"]');container&&this._createInstance(container),checkFirstIndexSection(),container.classList.contains("fade-in-animation")&&container.classList.add("fadeIn-animation");var zoomFadeAnimationElems=container.querySelectorAll(".zoom-fade-animation:not(.zoomFade-animation)");
1zoomFadeAnimationElems.length&&zoomFadeAnimationElems.forEach(function(block,index){var containerPosition=block.getBoundingClientRect();containerPosition.top+200<window.innerHeight&&block.classList.add("zoomFade-animation")}),window.SPR&&(window.SPR.initDomEls(),window.SPR.loadProducts())},_onSectionReorder:function(evt){checkFirstIndexSection()},_onSectionUnload:function(evt){var sectionEl=evt.target;checkFirstIndexSection(),this.instances=this.instances.filter(function(instance){var isEventInstance=instance.id===evt.detail.sectionId;return isEventInstance&&typeof instance.onUnload=="function"&&instance.onUnload(evt),!isEventInstance})},_onSelect:function(evt){var instance=this.instances.find(function(instance2){return instance2.id===evt.detail.sectionId});typeof instance<"u"&&typeof instance.onSelect=="function"&&instance.onSelect(evt),checkFirstIndexSection()},_onDeselect:function(evt){var instance=this.instances.find(function(instance2){return instance2.id===evt.detail.sectionId});typeof instance<"u"&&typeof instance.onDeselect=="function"&&instance.onDeselect(evt),checkFirstIndexSection()},_onBlockSelect:function(evt){var instance=this.instances.find(function(instance2){return instance2.id===evt.detail.sectionId});typeof instance<"u"&&typeof instance.onBlockSelect=="function"&&instance.onBlockSelect(evt)},_onBlockDeselect:function(evt){var instance=this.instances.find(function(instance2){return instance2.id===evt.detail.sectionId});typeof instance<"u"&&typeof instance.onBlockDeselect=="function"&&instance.onBlockDeselect(evt)},register:function(type,constructor){this.constructors[type]=constructor,document.querySelectorAll('[data-section-type="'+type+'"]').forEach(function(container){this._createInstance(container,constructor)}.bind(this))}}),checkFirstIndexSection(),window.slate=window.slate||{},slate.utils={getParameterByName:function(name,url){url||(url=window.location.href),name=name.replace(/[[\]]/g,"\\$&");var regex=new RegExp("[?&]"+name+"(=([^&#]*)|&|#|$)"),results=regex.exec(url);return results?results[2]?decodeURIComponent(results[2].replace(/\+/g," ")):"":null},resizeSelects:function(selects){selects.forEach(function(select){var arrowWidth=55,test=document.createElement("span");test.innerHTML=select.selectedOptions[0].label,document.querySelector(".site-footer").appendChild(test);var width=test.offsetWidth+arrowWidth;test.remove(),select.style.width=width+"px"})},keyboardKeys:{TAB:9,ENTER:13,ESCAPE:27,LEFTARROW:37,RIGHTARROW:39}},window.slate=window.slate||{},slate.rte={wrapTable:function(options){options.tables.forEach(function(table){var wrapper=document.createElement("div");wrapper.classList.add(options.tableWrapperClass),table.parentNode.insertBefore(wrapper,table),wrapper.appendChild(table)})},wrapIframe:function(options){options.iframes.forEach(function(iframe){var wrapper=document.createElement("div");wrapper.classList.add(options.iframeWrapperClass),iframe.parentNode.insertBefore(wrapper,iframe),wrapper.appendChild(iframe),iframe.src=iframe.src})}},window.slate=window.slate||{},slate.a11y={state:{firstFocusable:null,lastFocusable:null},pageLinkFocus:function(element2){if(!element2)return;var focusClass="js-focus-hidden";element2.setAttribute("tabIndex","-1"),element2.focus(),element2.classList.add(focusClass),element2.addEventListener("blur",callback,{once:!0});function callback(){element2.classList.remove(focusClass),element2.removeAttribute("tabindex")}},trapFocus:function(options){var focusableElements=Array.from(options.container.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex^="-"])')).filter(function(element2){var width=element2.offsetWidth,height=element2.offsetHeight;return width!==0&&height!==0&&getComputedStyle(element2).getPropertyValue("display")!=="none"});this.state.firstFocusable=focusableElements[0],this.state.lastFocusable=focusableElements[focusableElements.length-1],options.elementToFocus||(options.elementToFocus=options.container),options.container.setAttribute("tabindex","-1"),options.elementToFocus.focus(),this._setupHandlers(),document.addEventListener("focusin",this._onFocusInHandler),document.addEventListener("focusout",this._onFocusOutHandler)},_setupHandlers:function(){this._onFocusInHandler||(this._onFocusInHandler=this._onFocusIn.bind(this)),this._onFocusOutHandler||(this._onFocusOutHandler=this._onFocusIn.bind(this)),this._manageFocusHandler||(this._manageFocusHandler=this._manageFocus.bind(this))},_onFocusOut:function(){document.removeEventListener("keydown",this._manageFocusHandler)},_onFocusIn:function(evt){evt.target!==this.state.lastFocusable&&evt.target!==this.state.firstFocusable||document.addEventListener("keydown",this._manageFocusHandler)},_manageFocus:function(evt){evt.keyCode===slate.utils.keyboardKeys.TAB&&(evt.target===this.state.lastFocusable&&!evt.shiftKey&&(evt.preventDefault(),this.state.firstFocusable.focus()),evt.target===this.state.firstFocusable&&evt.shiftKey&&(evt.preventDefault(),this.state.lastFocusable.focus()))},removeTrapFocus:function(options){options.container&&options.container.removeAttribute("tabindex"),document.removeEventListener("focusin",this._onFocusInHandler)},accessibleLinks:function(options){var body=document.querySelector("body"),idSelectors={newWindow:"a11y-new-window-message",external:"a11y-external-message",newWindowExternal:"a11y-new-window-external-message"};(options.links===void 0||!options.links.length)&&(options.links=document.querySelectorAll("a[href]:not([aria-describedby])"));function generateHTML(customMessages){typeof customMessages!="object"&&(customMessages={});var messages=Object.assign({newWindow:"Opens in a new window.",external:"Opens external website.",newWindowExternal:"Opens external website in a new window."},customMessages),container=document.createElement("ul"),htmlMessages="";for(var message in messages)htmlMessages+="<li id="+idSelectors[message]+">"+messages[message]+"</li>";container.setAttribute("hidden",!0),container.innerHTML=htmlMessages,body.appendChild(container)}function _externalSite(link){var hostname=window.location.hostname;return link.hostname!==hostname}options.links.forEach(function(link){var target=link.getAttribute("target"),rel=link.getAttribute("rel"),isExternal=_externalSite(link),isTargetBlank=target==="_blank";if(isExternal&&link.setAttribute("aria-describedby",idSelectors.external),isTargetBlank){if(!rel||rel.indexOf("noopener")===-1){var relValue=rel===void 0?"":rel+" ";relValue=relValue+"noopener",link.setAttribute("rel",relValue)}link.setAttribute("aria-describedby",idSelectors.newWindow)}isExternal&&isTargetBlank&&link.setAttribute("aria-describedby",idSelectors.newWindowExternal)}),generateHTML(options.messages)}},theme.Images=(function(){function preload(images,size){typeof images=="string"&&(images=[images]);for(var i2=0;i2<images.length;i2++){var image=images[i2];this.loadImage(this.getSizedImageUrl(image,size))}}function loadImage(path){new Image().src=path}function switchImage(image,element2,callback){var size=this.imageSize(element2.src),imageUrl=this.getSizedImageUrl(image.src,size);callback?callback(imageUrl,image,element2):element2.src=imageUrl}function imageSize(src){var match=src.match(/.+_((?:pico|icon|thumb|small|compact|medium|large|grande)|\d{1,4}x\d{0,4}|x\d{1,4})[_\\.@]/);return match!==null?match[2]!==void 0?match[1]+match[2]:match[1]:null}function getSizedImageUrl(src,size){if(size===null)return src;if(size==="master")return this.removeProtocol(src);var match=src.match(/\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?$/i);if(match!==null){var prefix=src.split(match[0]),suffix=match[0];
1return this.removeProtocol(prefix[0]+"_"+size+suffix)}return null}function removeProtocol(path){return path.replace(/http(s)?:/,"")}return{preload,loadImage,switchImage,imageSize,getSizedImageUrl,removeProtocol}})(),theme.Currency=(function(){var moneyFormat="${{amount}}";function formatMoney(cents,format){typeof cents=="string"&&(cents=cents.replace(".",""));var value="",placeholderRegex=/\{\{\s*(\w+)\s*\}\}/,formatString=format||moneyFormat;function formatWithDelimiters(number,precision,thousands,decimal){if(thousands=thousands||",",decimal=decimal||".",isNaN(number)||number===null)return 0;number=(number/100).toFixed(precision);var parts=number.split("."),dollarsAmount=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+thousands),centsAmount=parts[1]?decimal+parts[1]:"";return dollarsAmount+centsAmount}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;case"amount_no_decimals_with_space_separator":value=formatWithDelimiters(cents,0," ");break;case"amount_with_apostrophe_separator":value=formatWithDelimiters(cents,2,"'");break}return formatString.replace(placeholderRegex,value)}return{formatMoney}})(),theme.TapAddToCart=function(element2){let start=0,delay=200,moved=!1;element2.addEventListener("touchstart",function(e){moved=!1,start=+new Date}),element2.addEventListener("touchmove",function(e){moved=!0}),element2.addEventListener("touchend",function(e){moved||+new Date-start>delay||ptengine.track("add_cart")})},slate.Variants=(function(){function Variants(options){this.container=options.container,this.product=options.product,this.originalSelectorId=options.originalSelectorId,this.enabledPickAnOption=options.pickAnOption,this.enabledShow_preOrder_btn=options.show_preOrder_btn,this.enableLinkedOptions=options.enableLinkedOptions,this.enableHistoryState=options.enableHistoryState,this.singleOptions=this.container.querySelectorAll(options.singleOptionSelector),this.singleOptionColorSelect=this.container.querySelector(options.singleOptionColorSelector),this.currentVariant=this._getVariantFromOptions(),this._initGallery(),this.singleOptions.forEach(function(option){option.addEventListener("change",this._onSelectChange.bind(this))}.bind(this)),this.singleOptionColorSelect&&this.singleOptionColorSelect.dispatchEvent(new Event("change",{bubbles:!0})),this.delegateElement=new Delegate(this.container),this.delegateElement.on("model:played","[data-product-single-media-group]",this._disableDrag.bind(this)),this.delegateElement.on("model:paused","[data-product-single-media-group]",this._enableDrag.bind(this)),this._onSelectChange()}return Variants.prototype=Object.assign({},Variants.prototype,{_initGallery:function(startIndex){var main_slider=this.container.querySelector(".product-single__media__carousel"),thumbnails_slider=this.container.querySelector(".thumbnails-slider"),main_slider_options=JSON.parse(main_slider.getAttribute("data-flickity-config")),product_image__zoom=this.container.querySelector(".product_image__zoom"),thumbnails_grid=this.container.querySelector(".thumbnails-grid");if(main_slider){startIndex&&(main_slider_options.initialIndex=startIndex),this.flickityInstance=new Flickity(main_slider,main_slider_options),this.flickityInstance.element.classList.add("rendered");var _this=this,slider=this.container.querySelector("[data-product-main-slider]"),flkty=Flickity.data(slider),baseCarouselCounter=main_slider.closest(".section-cust-product-template")?main_slider.closest(".section-cust-product-template").querySelector(".product-single__meida__carousel__num"):null,baseCarouselCurrentEl=baseCarouselCounter?baseCarouselCounter.querySelector(".current"):null,baseCarouselTotalEls=baseCarouselCounter?baseCarouselCounter.querySelectorAll(".total"):[],updateBaseCarouselCounter=function(index){if(baseCarouselCurrentEl&&(baseCarouselCurrentEl.innerText=String((index||
10)+1)),baseCarouselTotalEls&&baseCarouselTotalEls.length){var totalSlides=flkty&&flkty.slides?flkty.slides.length:0;baseCarouselTotalEls.forEach(function(totalEl){totalEl.innerText=String(totalSlides)})}};updateBaseCarouselCounter(flkty&&typeof flkty.selectedIndex=="number"?flkty.selectedIndex:0),document.querySelector(".product__media__arrows .btn-previous").onclick=function(){flkty.previous()},document.querySelector(".product__media__arrows .btn-next").onclick=function(){flkty.next()},this.flickityInstance.on("select",function(index){updateBaseCarouselCounter(index);var flickity_slider=_this.flickityInstance.element,videoSlides=flickity_slider.querySelectorAll("[data-product-media-type-video]"),modelViewerSlides=flickity_slider.querySelectorAll("[data-product-media-type-model]"),selectedSlide=_this.flickityInstance.selectedElement,basePanelThumbs=_this.container.querySelectorAll(".thumbnails-wrapper .product-single__thumbnails-block");basePanelThumbs.forEach(function(elem){elem.classList.remove("selected")});var activeBaseThumb=_this.container.querySelector('.thumbnails-wrapper .product-single__thumbnails-block[data-thumb-index="'+selectedSlide.getAttribute("data-media-index")+'"]');activeBaseThumb&&activeBaseThumb.classList.add("selected"),videoSlides.length>0&&videoSlides.forEach(function(item,index2){var isVideoTag2=item.querySelector("video");if(isVideoTag2){var videoId2=isVideoTag2.getAttribute("id"),videoObj2=document.getElementById(videoId2);videoObj2&&videoObj2.pause()}else{var videoId2=item.querySelector("iframe").getAttribute("id");if(videoId2){var player2=YT.get(videoId2);player2&&player2.pauseVideo()}}});var selectedSlideVideo=selectedSlide.querySelector("[data-product-media-type-video]");if(selectedSlideVideo){var isVideoTag=selectedSlideVideo.querySelector("video");if(isVideoTag){var videoId=isVideoTag.getAttribute("id"),videoObj=document.getElementById(videoId);videoObj&&videoObj.play()}else{var videoId=selectedSlideVideo.querySelector("iframe").getAttribute("id");if(videoId){var player=YT.get(videoId);player&&player.playVideo()}}}var selectedSlideModel=selectedSlide.querySelector("[data-product-media-type-model]");if(selectedSlideModel){var modelViewerEl=selectedSlide.querySelector("model-viewer");modelViewerEl&&modelViewerEl.dispatchEvent(new CustomEvent("mediaVisible",{bubbles:!0,cancelable:!0}))}else modelViewerSlides.length>0&&modelViewerSlides.forEach(function(item,index2){var modelViewerEl2=item.querySelector("model-viewer");modelViewerEl2&&modelViewerEl2.dispatchEvent(new CustomEvent("mediaHidden",{bubbles:!0,cancelable:!0}))})})}var thumb_flickityInstance;if(thumbnails_slider){var thumbnails_slider_options=JSON.parse(thumbnails_slider.getAttribute("data-thumb_flickity_options"));thumbnails_slider_options.asNavFor=main_slider,thumb_flickityInstance=new Flickity(thumbnails_slider,thumbnails_slider_options)}if(product_image__zoom){var imagesArr=main_slider.querySelectorAll(".image_type");imagesArr.length&&imagesArr.forEach(function(item,index){item.addEventListener("click",function(e){e.preventDefault();var pswpElement=document.querySelectorAll(".pswp")[0],items=[],thumbnails="";imagesArr.forEach(function(imageEl,index2){var imageObj={src:imageEl.getAttribute("data-image-url"),w:+imageEl.getAttribute("data-image-width"),h:+imageEl.getAttribute("data-image-height")};items.push(imageObj),thumbnails+='<div class="product_thumbnail"><img src="'+imageEl.getAttribute("data-image-url")+'" /></div>'});var options={index:item.getAttribute("data-media-index"),zoomEl:!1,shareEl:!1,fullscreenEl:!1,counterEl:!1,closeOnScroll:!1,closeOnVerticalDrag:!1},gallery=new PhotoSwipe(pswpElement,PhotoSwipeUI_Default,items,options);gallery.init(),gallery.listen("afterChange",function(index2){document.querySelector(".photoSwipe_innerthumbs .product_thumbnail.selected").classList.remove("selected"),document.querySelectorAll(".photoSwipe_innerthumbs .product_thumbnail")[gallery.getCurrentIndex()].classList.add("selected")}),thumbnails!=""&&(document.querySelector("div.photoSwipe_innerthumbs").innerHTML=thumbnails,document.querySelectorAll("div.photoSwipe_innerthumbs .product_thumbnail")[gallery.getCurrentIndex()].classList.add("selected"),document.querySelectorAll("div.photoSwipe_innerthumbs .product_thumbnail").forEach(function(thumb,index2){thumb.onclick=function(){document.querySelector("div.photoSwipe_innerthumbs .product_thumbnail.selected").classList.remove("selected"),thumb.classList.add("selected"),gallery.goTo(index2)}}),document.querySelector(".pswp__button--close").addEventListener("click",function(e2){gallery.destroy()}))})})}let thumbnail_images;
1thumbnails_grid&&(thumbnail_images=thumbnails_grid.querySelectorAll(".product-single__thumbnails-block"),thumbnail_images.length&&thumbnail_images.forEach(function(thumb,index){thumb.addEventListener("click",function(e){e.preventDefault(),thumbnails_grid.querySelector(".product-single__thumbnails-block.selected").classList.remove("selected"),thumb.classList.add("selected"),_this.flickityInstance.select(index),document.dispatchEvent(new CustomEvent("imageChange",{detail:{},bubbles:!0,cancelable:!0}))})}));const media_items=this.container.querySelectorAll(".media-types .media-types__item");media_items.forEach(media_item=>{media_item.addEventListener("click",()=>{media_items.forEach(temp=>temp.classList.remove("active")),media_item.classList.add("active");const type=media_item.dataset.type;let meida_type="*";type=="photo"?meida_type="product-image-media-photo":type=="video"?meida_type="data-product-media-type-video":type=="360"?meida_type="data-product-media-type-model":type=="spec"&&(meida_type="product-image-media-spec"),flkty&&((this.container.querySelector('[data-cust-media-tab-panel="base"]')||this.container).querySelectorAll(".product-single__media__slide").forEach(cell=>{const el=cell.querySelector(".product-single__media-wrapper");meida_type==="*"||el.hasAttribute(meida_type)?cell.classList.add("is-filtered"):cell.classList.remove("is-filtered")}),flkty.options.cellSelector=".is-filtered",flkty.reloadCells(),flkty.resize(),flkty.select(0)),thumbnail_images&&thumbnail_images.forEach(function(thumb,index){meida_type==="*"||thumb.hasAttribute(meida_type)?thumb.style.display="":thumb.style.display="none"})})}),media_items[0]&&media_items[0].click();var custMediaTabsRoot=this.container.querySelector(".cust-product-media-tabs");if(custMediaTabsRoot){var custTabButtons=custMediaTabsRoot.querySelectorAll("[data-cust-media-tab-btn]"),custTabPanels=custMediaTabsRoot.querySelectorAll("[data-cust-media-tab-panel]"),custTabSliderMap={},pausePanelMedia=function(panel){if(panel){var htmlVideos=panel.querySelectorAll("video");htmlVideos.forEach(function(videoEl){typeof videoEl.pause=="function"&&videoEl.pause()});var iframeVideos=panel.querySelectorAll("iframe");iframeVideos.forEach(function(iframeEl){var iframeSrc=iframeEl.getAttribute("src");if(iframeSrc&&iframeSrc.indexOf("enablejsapi=1")>-1&&iframeEl.id){var player=typeof YT<"u"&&YT.get?YT.get(iframeEl.id):null;player&&typeof player.pauseVideo=="function"&&player.pauseVideo()}});var modelViewerEls=panel.querySelectorAll("model-viewer");modelViewerEls.forEach(function(modelViewerEl){modelViewerEl.dispatchEvent(new CustomEvent("mediaHidden",{bubbles:!0,cancelable:!0}))})}},syncSelectedMediaState=function(panel,sliderInstance){if(panel){pausePanelMedia(panel);var selectedSlide=sliderInstance&&sliderInstance.selectedElement?sliderInstance.selectedElement:panel.querySelector(".product-single__media__slide");if(selectedSlide){var selectedVideo=selectedSlide.querySelector("video");selectedVideo&&typeof selectedVideo.play=="function"&&selectedVideo.play().catch(function(){});var selectedModelViewer=selectedSlide.querySelector("model-viewer");selectedModelViewer&&selectedModelViewer.dispatchEvent(new CustomEvent("mediaVisible",{bubbles:!0,cancelable:!0}))}}},initCustTabSlider=function(panel){if(!panel)return null;var panelName=panel.getAttribute("data-cust-media-tab-panel"),getVisibleCustTabCarousel=function(panelElement){var carouselCandidates=panelElement.querySelectorAll("[data-cust-tab-slider]");if(!carouselCandidates.length)return null;for(var i2=0;i2<carouselCandidates.length;
1i2++){var candidate=carouselCandidates[i2];if(candidate.offsetParent!==null)return candidate}return carouselCandidates[0]},carousel=getVisibleCustTabCarousel(panel),paginationSlider=panel.querySelector(".cust-tab-media-pagination__slider"),scenarioCurrentEl=panel.querySelector(".product-single__meida_scenario__carousel__num .current");if(!panelName||!carousel||custTabSliderMap[panelName])return custTabSliderMap[panelName]||null;var sliderOptions={},rawOptions=carousel.getAttribute("data-flickity-config");if(rawOptions)try{sliderOptions=JSON.parse(rawOptions)}catch{sliderOptions={}}sliderOptions.prevNextButtons=!1;var sliderInstance=new Flickity(carousel,sliderOptions);custTabSliderMap[panelName]=sliderInstance;var updateScenarioCurrent=function(index){panelName==="scenario"&&scenarioCurrentEl&&(scenarioCurrentEl.innerText=String(index+1))};if(updateScenarioCurrent(sliderInstance.selectedIndex||0),sliderInstance.on("select",function(){if(syncSelectedMediaState(panel,sliderInstance),updateScenarioCurrent(sliderInstance.selectedIndex),paginationSlider&&panelName==="scenario"){var paginationInstance2=Flickity.data(paginationSlider);if(paginationInstance2){paginationInstance2.selectCell(sliderInstance.selectedIndex);var selectedThumb=paginationSlider.querySelector(".product-single__thumbnails-block.selected");selectedThumb&&selectedThumb.classList.remove("selected");var targetThumb=paginationSlider.querySelector('.product-single__thumbnails-block[data-thumb-index="'+sliderInstance.selectedIndex+'"]');targetThumb&&targetThumb.classList.add("selected")}}}),sliderInstance.on("change",function(index){if(updateScenarioCurrent(index),paginationSlider&&panelName==="scenario"){var paginationInstance2=Flickity.data(paginationSlider);if(paginationInstance2){paginationInstance2.selectCell(index);var allThumbs=paginationSlider.querySelectorAll(".product-single__thumbnails-block");allThumbs.forEach(function(thumb){thumb.classList.remove("selected")});var targetThumb=paginationSlider.querySelector('.product-single__thumbnails-block[data-thumb-index="'+index+'"]');targetThumb&&targetThumb.classList.add("selected")}}}),paginationSlider&&panelName==="scenario"){var paginationOptions={},rawPaginationOptions=paginationSlider.getAttribute("data-cust-thumb-flickity-options");if(rawPaginationOptions)try{paginationOptions=JSON.parse(rawPaginationOptions)}catch{paginationOptions={}}paginationOptions.prevNextButtons=!1,paginationOptions.pageDots=!1;var paginationInstance=new Flickity(paginationSlider,paginationOptions);paginationSlider.classList.add("thumbnails-slider--active"),paginationInstance.on("select",function(){var paginationSelectedIndex=paginationInstance.selectedIndex;sliderInstance.selectedIndex!==paginationSelectedIndex&&sliderInstance.select(paginationSelectedIndex)}),paginationInstance.on("change",function(index){sliderInstance.selectedIndex!==index&&sliderInstance.select(index)});var initialThumb=paginationSlider.querySelector('.product-single__thumbnails-block[data-thumb-index="0"]');initialThumb&&initialThumb.classList.add("selected");var scenarioArrows=panel.querySelector(".cust-product__media__arrows--scenario");if(scenarioArrows){var scenarioPrevButton=scenarioArrows.querySelector(".btn-previous"),scenarioNextButton=scenarioArrows.querySelector(".btn-next");scenarioPrevButton&&(scenarioPrevButton.onclick=function(event){event&&event.preventDefault(),sliderInstance.previous()}),scenarioNextButton&&(scenarioNextButton.onclick=function(event){event&&event.preventDefault(),sliderInstance.next()})}var thumbItems=paginationSlider.querySelectorAll(".product-single__thumbnails-block");thumbItems.forEach(function(thumbItem){thumbItem.addEventListener("click",function(){var thumbIndex=parseInt(thumbItem.getAttribute("data-thumb-index"),10);isNaN(thumbIndex)||sliderInstance.select(thumbIndex)})})}return sliderInstance},switchCustTab=function(tabName){custTabButtons.forEach(function(buttonEl){var isActive=buttonEl.getAttribute("data-tab-target")===tabName;buttonEl.classList.toggle("is-active",isActive),buttonEl.setAttribute("aria-selected",isActive?"true":"false")}
1),custTabPanels.forEach(function(panelEl){var panelName=panelEl.getAttribute("data-cust-media-tab-panel"),panelIsActive=panelName===tabName;if(panelEl.classList.toggle("is-active",panelIsActive),panelEl.setAttribute("aria-hidden",panelIsActive?"false":"true"),!panelIsActive){pausePanelMedia(panelEl);return}var slider2=initCustTabSlider(panelEl);if(slider2&&slider2.resize(),panelName==="scenario"){var scenarioPaginationSlider=panelEl.querySelector(".cust-tab-media-pagination__slider"),scenarioPaginationInstance=scenarioPaginationSlider?Flickity.data(scenarioPaginationSlider):null;scenarioPaginationInstance&&(scenarioPaginationInstance.resize(),scenarioPaginationInstance.selectCell(slider2?slider2.selectedIndex:0))}!slider2&&panelName==="base"&&_this.flickityInstance&&_this.flickityInstance.resize(),syncSelectedMediaState(panelEl,slider2)})};custTabButtons.forEach(function(buttonEl){buttonEl.addEventListener("click",function(){switchCustTab(buttonEl.getAttribute("data-tab-target"))})}),switchCustTab("base")}},_disableDrag:function(event){this.flickityInstance.options.draggable=!1,this.flickityInstance.updateDraggable()},_enableDrag:function(event){this.flickityInstance.options.draggable=!0,this.flickityInstance.updateDraggable()},_getCurrentOptions:function(){var result=[];return this.singleOptions.forEach(function(option){var type=option.getAttribute("type"),isRadioOrCheckbox=type==="radio"||type==="checkbox";(!isRadioOrCheckbox||option.checked)&&result.push({value:option.value,index:option.getAttribute("data-index")})}),result},_getVariantFromOptions:function(){var selectedValues=this._getCurrentOptions(),variants=this.product.variants,found=variants.find(function(variant){return selectedValues.every(function(values){return variant[values.index]===values.value})});return found},_onSelectChange:function(e){var variant=this._getVariantFromOptions();if(this.enabledPickAnOption)if(variant){var form=this.container.querySelector(".disabled_btns");if(form){var submit_btn=form.querySelector('[type="submit"]');form.classList.remove("disabled_btns"),submit_btn&&(submit_btn.disabled=!1)}}else return;if(variant){var form=this.container.querySelector(".disabled_btns");if(form){var submit_btn=form.querySelector('[type="submit"]');form.classList.remove("disabled_btns"),submit_btn&&(submit_btn.disabled=!1)}}if(this.enableHistoryState&&this._updateHistoryState(variant),variant){this._updateMasterSelect(variant);var originalSelectorId=this.originalSelectorId,originalSelector=this.container.querySelector(originalSelectorId),selectedElement=originalSelector.item(originalSelector.selectedIndex);const addToCartButton=this.container.querySelector("button[data-add-to-cart].product-form__cart-submit"),addToCartStickyBarButton=document.querySelector("button[data-add-to-cart].sticky-shop-now-btn"),openMemberExclusiveButton=document.querySelector(".product-form__cart-submit_wrap .member-exclusive-popup-btn"),openMemberExclusiveStickyButton=document.querySelector(".product-sticky-bar .sticky-product-info-bar .member-exclusive-popup-btn");if(selectedElement.hasAttribute("data-show-member-exclusive-popup")){if(addToCartButton&&(addToCartButton.style.display="none",openMemberExclusiveButton&&(openMemberExclusiveButton.style.display="block")),addToCartStickyBarButton&&(addToCartStickyBarButton.classList.add("hide--for-member-exclusive"),openMemberExclusiveStickyButton&&(openMemberExclusiveStickyButton.style.display="block")),document.getElementById("member-exclusive-popup-dialog")){const memberPrice=selectedElement.getAttribute("data-member-exclusive-member-variant-price"),memberPriceElement=document.querySelector(".member-exclusive-popup__price-value--member"),originalPrice=selectedElement.getAttribute("data-price"),originalPriceElement=document.querySelector(".member-exclusive-popup__price-value--original");memberPriceElement.innerText=theme.Currency.formatMoney(Number(memberPrice),theme.moneyFormat),originalPriceElement.innerText=theme.Currency.formatMoney(Number(originalPrice),theme.moneyFormat)}}else addToCartButton&&addToCartButton.style.display==="none"&&(addToCartButton.style.removeProperty("display"),openMemberExclusiveButton&&(openMemberExclusiveButton.style.display="none")),addToCartStickyBarButton&&addToCartStickyBarButton.classList.contains("hide--for-member-exclusive")&&(addToCartStickyBarButton.classList.remove("hide--for-member-exclusive"),openMemberExclusiveStickyButton&&(openMemberExclusiveStickyButton.style.display="none"));if(this.currentVariant.id!=variant.id&&!this.container.closest(".modal__inner")){var template_name=selectedElement.getAttribute("data-template");if(template_name){var variant_url=selectedElement.getAttribute("data-url");variant_url&&(window.location.href=variant_url+"&view="+template_name)}}this.container.closest(".modal__inner")&&this.container.closest(".modal__inner").querySelector(".checkoutButton").setAttribute("data-variant-id",variant.id)}
1this.container.dispatchEvent(new CustomEvent("variantChange",{detail:{variant},bubbles:!0,cancelable:!0})),variant&&(this._updateImages(variant,e),this._updatePrice(variant),this._updateSKU(variant),this.currentVariant=variant)},_updateImages:function(variant,event){var all_media__block=this.container.querySelector(".all_media__block"),all_thumb_media__block=this.container.querySelector(".all_thumb_media__block"),slider=this.container.querySelector("[data-product-main-slider]");if(all_media__block){var thumb_slider=this.container.querySelector(".product-single__thumbnails"),el_target=event.target,optionName=el_target.getAttribute("data-option-name").toLowerCase(),optionValue=el_target.value.toLowerCase(),rebuild_flag=!1;if(slider.querySelectorAll(".product-single__media__slide").forEach(function(item,index){var item_wrapper=item.querySelector("[data-product-single-media-wrapper]");if(item_wrapper){var itemOptionName=item_wrapper.getAttribute("data-media-option-name");itemOptionName==optionName&&(rebuild_flag=!0)}}),rebuild_flag){if(slider.classList.contains("flickity-enabled")){var flkty=Flickity.data(slider);flkty.destroy()}var slider_old_images=slider.querySelectorAll("[product-image-media]");slider_old_images.length&&slider_old_images.forEach(function(imageEl,index){var parentEl=imageEl.closest(".product-single__media__slide");parentEl&&parentEl.remove()});var show_default_image=!0;if(all_media__block.querySelectorAll(".product-single__media__slide").forEach(function(item,index){var item_wrapper=item.querySelector("[data-product-single-media-wrapper]"),itemOptionName=item_wrapper.getAttribute("data-media-option-name"),itemOptionValue=item_wrapper.getAttribute("data-media-option-value");if(itemOptionName==optionName&&optionValue==itemOptionValue){var clone=item.cloneNode(!0);show_default_image=!1,slider.prepend(clone)}}),thumb_slider){if(thumb_slider.classList.contains("flickity-enabled")){var thumb_flkty=Flickity.data(thumb_slider);thumb_flkty.destroy()}var old_thumbs_images=thumb_slider.querySelectorAll("[product-image-media]");old_thumbs_images.length&&old_thumbs_images.forEach(function(imageEl,index){imageEl.remove()}),all_thumb_media__block.querySelectorAll(".product-single__thumbnails-block").forEach(function(item,index){var itemOptionName=item.getAttribute("data-media-option-name"),itemOptionValue=item.getAttribute("data-media-option-value");if(itemOptionName==optionName&&optionValue==itemOptionValue){var clone=item.cloneNode(!0);thumb_slider.prepend(clone)}})}show_default_image&&(all_media__block.querySelectorAll(".product-single__media__slide").forEach(function(item,index){var clone=item.cloneNode(!0);slider.prepend(clone)}),thumb_slider&&all_thumb_media__block.querySelectorAll(".product-single__thumbnails-block").forEach(function(item,index){var clone=item.cloneNode(!0);thumb_slider.prepend(clone)}));var featuredMediaIndex=0,variantMedia=variant.featured_media;if(variantMedia){var variantMediaId=variant.featured_media.id,featuredMedia=slider.querySelector('.image_type[data-image-id="'+variantMediaId+'"]');if(featuredMedia){var featuredMediaParent=featuredMedia.closest(".product-single__media__slide");featuredMediaParent&&(featuredMediaIndex=[].slice.call(featuredMediaParent.parentNode.children).indexOf(featuredMediaParent))}}this._initGallery(featuredMediaIndex)}}else if(slider.classList.contains("flickity-enabled")){var flkty=Flickity.data(slider);if(flkty){flkty.destroy();const mainSlider=this.container.querySelector("[data-product-main-slider]"),sliderCells=mainSlider?mainSlider.querySelectorAll(".product-single__media__slide"):[],sliderThumbnail=this.container.querySelector(".product-single__thumbnails"),thumbnailsCells=sliderThumbnail?sliderThumbnail.querySelectorAll(".product-single__thumbnails-block"):[];sliderCells.forEach(function(cell){cell.remove()}),thumbnailsCells.forEach(function(cell){cell.remove()}),window.pdpSliders&&window.pdpSliders.media&&(window.pdpSliders.media.filter(item=>item.variantId&&item.variantId===variant.id||item.variantId==="").sort((a,b)=>a.variantId===variant.id?-1:b.variantId===variant.id?1:0).forEac
1h((item,index)=>{const tempDiv=document.createElement("div"),tempThumbnailDiv=document.createElement("div");tempDiv.innerHTML=item.mediaHtml,tempThumbnailDiv.innerHTML=item.thumbnailHtml;const mediaElement=tempDiv.firstElementChild,thumbnailElement=tempThumbnailDiv.firstElementChild;mediaElement.setAttribute("data-media-index",index),thumbnailElement.setAttribute("data-thumb-index",index),mainSlider.append(mediaElement),sliderThumbnail&&sliderThumbnail.append(thumbnailElement)}),this._initGallery(),this.flickityInstance&&this.flickityInstance.selectCell(0))}}if(document.querySelector(".logo-over-image-container")){let logoElem=document.createElement("div");logoElem.classList.add("logo-over-image-container"),logoElem.innerHTML=document.querySelector(".logo-over-image-container").innerHTML,document.querySelectorAll(".product-single__media__slide")[0].appendChild(logoElem)}},_updatePrice:function(variant){const variant_metafields_ele=document.querySelector("[data-variants-custommetafields-json]");let show_price=variant.price;if(variant_metafields_ele){var jsonData=JSON.parse(variant_metafields_ele.innerHTML);jsonData[variant.id]&&(show_price=jsonData[variant.id])}this.container.dispatchEvent(new CustomEvent("variantPriceChange",{detail:{variant},bubbles:!0,cancelable:!0}))},_updateSKU:function(variant){variant.sku!==this.currentVariant.sku&&this.container.dispatchEvent(new CustomEvent("variantSKUChange",{detail:{variant},bubbles:!0,cancelable:!0}))},_updateHistoryState:function(variant){if(!(!history.replaceState||!variant)){var url=new URL(window.location.href);url.searchParams.set("variant",variant.id),window.history.replaceState({path:url.href},"",url.href)}},_updateMasterSelect:function(variant){var masterSelect=this.container.querySelector(this.originalSelectorId);document.querySelector('.product-accessories-section[data-variant="'+variant.id+'"]')?(document.querySelectorAll(".product-accessories-section").forEach(function(elem){elem.classList.remove("selected")}),document.querySelector('.product-accessories-section[data-variant="'+variant.id+'"]').classList.add("selected"),document.querySelector(".product-accessories-wrapper").style.display="block"):document.querySelector(".product-accessories-wrapper")&&(document.querySelector(".product-accessories-wrapper").style.display="none"),masterSelect&&(masterSelect.value=variant.id)}}),Variants})(),this.Shopify=this.Shopify||{},this.Shopify.theme=this.Shopify.theme||{},this.Shopify=this.Shopify||{},this.Shopify.theme=this.Shopify.theme||{},window.theme=window.theme||{},theme.TouchEvents=function(element2,options){this.axis,this.checkEvents=[],this.eventHandlers={},this.eventModel={},this.events=[["touchstart","touchmove","touchend","touchcancel"],["pointerdown","pointermove","pointerup","pointercancel"],["mousedown","mousemove","mouseup"]],this.eventType,this.difference={},this.direction,this.start={},this.element=element2,this.options=Object.assign({},{dragThreshold:10,start:function(){},move:function(){},end:function(){}},options),this.checkEvents=this._getCheckEvents(),this.eventModel=this._getEventModel(),this._setupEventHandlers()},theme.TouchEvents.prototype=Object.assign({},theme.TouchEvents.prototype,{destroy:function(){this.element.removeEventListener("dragstart",this.eventHandlers.preventDefault),this.element.removeEventListener(this.events[this.eventModel][0],this.eventHandlers.touchStart),this.eventModel||this.element.removeEventListener(this.events[2][0],this.eventHandlers.touchStart),this.element.removeEventListener("click",this.eventHandlers.preventClick)},_setupEventHandlers:function(){this.eventHandlers.preventDefault=this._preventDefault.bind(this),this.eventHandlers.preventClick=this._preventClick.bind(this),this.eventHandlers.touchStart=this._touchStart.bind(this),this.eventHandlers.touchMove=this._touchMove.bind(this),this.eventHandlers.touchEnd=this._touchEnd.bind(this),this.element.addEventListener("dragstart",this.eventHandlers.preventDefault),this.element.addEventListener(this.events[this.eventModel][0],this.eventHandlers.touchStart),this.eventModel||this.element.addEventListener(this.events[2][0],this.eventHandlers.touchStart),this.element.addEventListener("click",this.eventHandlers.preventClick)},_touchStart:function(event){this.eventType=this.eventModel,event.type==="mousedown"&&!this.eventModel&&(this.eventType=2),!this.checkEvents[this.eventType](event)&&(this.eventType&&this._preventDefault(event),document.addEventListener(this.events[this.eventType][1],this.eventHandlers.touchMove),document.addEventListener(this.events[this.eventType][2],this.eventHandlers.touchEnd),this.eventType<2&&document.addEventListener(this.events[this.eventType][3],this.eventHandlers.touchEnd),this.start={xPosition:this.eventType?event.clientX:event.touches[0].clientX,yPosition:this.eventType?event.clientY:event.touches[0].clientY,time:new Date().getTime()},Object.keys(this.difference).forEach(function(key){delete this.difference[key]}.bind(this)),this.options.start(event))},_touchMove:function(event){this.difference=this._getDifference(event),document["on"+this.events[this.eventType][1]]=function(event2){this._preventDefault(event2)}.bind(this),this.axis?this.axis==="xPosition"?this.direction=this.difference.xPosition<0?"left":"right":this.axis==="yPosition"&&(this.direction=this.difference.yPosition<0?"up":"down"):this.options.dragThreshold<Math.abs(this.difference.xPosition)?this.axis="xPosition":this.options.dragThreshold<Math.abs(this.difference.yPosition)?this.axis="yPosition":this.axis=!1,this.options.move(event,this.direction,this.difference)},_touchEnd:function(event){document.removeEventListener(this.events[this.eventType][1],this.eventHandlers.touchMove),document.removeEventListener(this.events[this.eventType][2],this.eventHandlers.touchEnd),this.eventType<2&&document.removeEventListener(this.events[this.eventType][3],this.eventHandlers.touchEnd),document["on"+this.events[this.eventType][1]]=function(){return!0},this.options.end(event,this.direction,this.difference),this.axis=!1},_getDifference:function(event){return{xPosition:(this.eventType?event.clientX:event.touches[0].clientX)-this.start.xPosition,yPosition:(this.eventType?event.clientY:event.touches[0].clientY)-this.start.yPosition,time:new Date().getTime()-this.start.time}},_getCheckEvents:function(){return[function(event){return event.touches&&event.touches.length>1||event.scale&&event.scale!==1},function(event){return!event.isPrimary||event.buttons&&event.buttons!==1||event.pointerType!=="touch"&&event.pointerType!=="pen"},function(event){return event.buttons&&event.buttons!==1}]},_getEventModel:function(){return window.navigator.pointerEnabled?1:0},_preventDefault:function(event){event.preventDefault?event.preventDefault():event.returnValue=!1},_preventClick:function(event){Math.abs(this.difference.xPosition)>this.options.dragThreshold&&this._preventDefault(event)}}),theme.Helpers=(function(){var touchDevice=!1,classes={preventScrolling:"prevent-scrolling"},scrollPosition=window.pageYOffset;function setTouch(){touchDevice=!0}function isTouch(){return touchDevice}function enableScrollLock(){scrollPosition=window.pageYOffset,document.body.style.top="-"+scrollPosition+"px",document.body.classList.add(classes.preventScrolling)}function disableScrollLock(){document.body.classList.remove(classes.preventScrolling),document.body.style.removeProperty("top"),window.scrollTo(0,scrollPosition)}function debounce(func,wait,immediate){var timeout;return function(){var context=this,args=arguments,later=function(){timeout=null,immediate||func.apply(context,args)},callNow=immediate&&!timeout;clearTimeout(timeout),timeout=setTimeout(later,wait),callNow&&func.apply(context,args)}}function getScript(source,beforeEl){return new Promise(function(resolve,reject){var script=document.createElement("script"),prior=beforeEl||document.getElementsByTagName("script")[0];script.async=!0,script.defer=!0;function onloadHander(_,isAbort){(isAbort||!script.readyState||/loaded|complete/.test(script.readyState))&&(script.onload=null,
1script.onreadystatechange=null,script=void 0,isAbort?reject():resolve())}script.onload=onloadHander,script.onreadystatechange=onloadHander,script.src=source,prior.parentNode.insertBefore(script,prior)})}function prepareTransition(element2){element2.addEventListener("transitionend",function(event){event.currentTarget.classList.remove("is-transitioning")},{once:!0});var properties=["transition-duration","-moz-transition-duration","-webkit-transition-duration","-o-transition-duration"],duration=0;properties.forEach(function(property){var computedValue=getComputedStyle(element2)[property];computedValue&&(computedValue.replace(/\D/g,""),duration||(duration=parseFloat(computedValue)))}),duration!==0&&(element2.classList.add("is-transitioning"),element2.offsetWidth)}/*!
2 * Serialize all form data into a SearchParams string
3 * (c) 2020 Chris Ferdinandi, MIT License, https://gomakethings.com
4 * @param  {Node}   form The form to serialize
5 * @return {String}      The serialized form data
6 */function serializeFormData(data){let obj={};for(let[key,value]of data)obj[key]!==void 0?(Array.isArray(obj[key])||(obj[key]=[obj[key]]),obj[key].push(value)):obj[key]=value;return obj}function serialize(form){var arr=[];return Array.prototype.slice.call(form.elements).forEach(function(field){if(!(!field.name||field.disabled||["file","reset","submit","button"].indexOf(field.type)>-1)){if(field.type==="select-multiple"){Array.prototype.slice.call(field.options).forEach(function(option){option.selected&&arr.push(encodeURIComponent(field.name)+"="+encodeURIComponent(option.value))});return}["checkbox","radio"].indexOf(field.type)>-1&&!field.checked||arr.push(encodeURIComponent(field.name)+"="+encodeURIComponent(field.value))}}),arr.join("&")}function cookiesEnabled(){var cookieEnabled=navigator.cookieEnabled;return cookieEnabled||(document.cookie="testcookie",cookieEnabled=document.cookie.indexOf("testcookie")!==-1),cookieEnabled}function promiseStylesheet(stylesheet){var stylesheetUrl=stylesheet||theme.stylesheet;return typeof this.stylesheetPromise>"u"&&(this.stylesheetPromise=new Promise(function(resolve){var link=document.querySelector('link[href="'+stylesheetUrl+'"]');link.loaded&&resolve(),link.addEventListener("load",function(){setTimeout(resolve,0)})})),this.stylesheetPromise}return{setTouch,isTouch,enableScrollLock,disableScrollLock,debounce,getScript,prepareTransition,serialize,cookiesEnabled,promiseStylesheet}})(),theme.LibraryLoader=(function(){var types={link:"link",script:"script"},status={requested:"requested",loaded:"loaded"},cloudCdn="https://cdn.shopify.com/shopifycloud/",libraries={plyrShopifyStyles:{tagId:"plyr-shopify-styles",src:cloudCdn+"plyr/v2.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 tag2;switch(library.type){case types.script:tag2=createScriptTag(library,callback);break;case types.link:tag2=createLinkTag(library,callback);break}tag2.id=library.tagId,library.element=tag2;var firstScriptTag2=document.getElementsByTagName(library.type)[0];firstScriptTag2.parentNode.insertBefore(tag2,firstScriptTag2)}}function createScriptTag(library,callback){var tag2=document.createElement("script");return tag2.src=library.src,tag2.addEventListener("load",function(){library.status=status.loaded,callback()}),tag2}function createLinkTag(library,callback){var tag2=document.createElement("link");return tag2.href=library.src,tag2.rel="stylesheet",tag2.type="text/css",tag2.addEventListener("load",function(){library.status=status.loaded,callback()}),tag2}return{load}})(),window.theme=window.theme||{},theme.Header=(function(){var selectors2={body:"body",navigation:"#AccessibleNav",siteNavHasDropdown:"[data-has-dropdowns]",siteNavChildLinks:".site-nav__child-link",siteNavActiveDropdown:".site-nav--active-dropdown",siteNavHasCenteredDropdown:".site-nav--has-centered-dropdown",siteNavCenteredDropdown:".site-nav__dropdown--centered",siteNavLinkMain:".site-nav__link--main",siteNavChildLink:".site-nav__link--last",siteNavDropdown:".site-nav__dropdown",siteHeader:".
6site-header",headerCartLink:"#HeaderCart",disclosureLocale:"[data-disclosure-locale]",disclosureCurrency:"[data-disclosure-currency]"},config={activeClass:"site-nav--active-dropdown",childLinkClass:"site-nav__child-link",rightDropdownClass:"site-nav__dropdown--right",leftDropdownClass:"site-nav__dropdown--left"},cache={};document.querySelector(".header_top_temp_element")&&document.querySelector(selectors2.siteHeader).getAttribute("data-enable_overlap_header")&&document.documentElement.style.setProperty("--top-bar-height",document.querySelector(".header_top_temp_element").clientHeight+"px");const documentHeight=()=>{document.documentElement.style.setProperty("--doc-height",`${window.innerHeight}px`)};window.addEventListener("resize",documentHeight),documentHeight(),document.body.style.setProperty("--sticky-bar-height","0px");function closeSearchMobileDropdown(){var header_toggle_search_btn=document.querySelector(".header-search-button.active");header_toggle_search_btn&&header_toggle_search_btn.classList.remove("active");var searchDropdown=document.querySelector(".search-form__container.show_form");searchDropdown&&(setTimeout(function(){searchDropdown.classList.remove("show_form")},500),searchDropdown.querySelector(".predictive-search-wrapper").classList.remove("visible"),document.querySelector("body").classList.remove("show_overlay"),document.querySelector("body").classList.remove("show_search_overlay"),document.querySelector(".mega_menu_overlay").style.display="none")}function closeCartDrawer(){var Drawer=document.querySelector(".Drawer.show");Drawer&&(Drawer.classList.remove("show"),document.querySelector("body").classList.remove("show_overlay"))}function hydrateCountryPopupImages(popup){!popup||popup.dataset.flagsHydrated==="true"||(popup.querySelectorAll(".flag-image img[data-src]").forEach(function(img){img.setAttribute("src",img.getAttribute("data-src")),img.removeAttribute("data-src")}),popup.dataset.flagsHydrated="true")}function init(){cacheSelectors(),styleDropdowns(document.querySelectorAll(selectors2.siteNavHasDropdown)),positionFullWidthDropdowns(),cache.search_categories_menu_parent&&cache.search_categories_menu_parent.addEventListener("click",submenuParentClickHandler),cache.customer_nav_dropdown_parent&&cache.customer_nav_dropdown_parent.addEventListener("click",submenuParentClickHandler),cache.parents.forEach(function(element2){element2.addEventListener("click",submenuParentClickHandler)}),cache.siteNavChildLink.forEach(function(element2){element2.addEventListener("focusout",submenuFocusoutHandler)}),cache.topLevel.forEach(function(element2){element2.addEventListener("focus",hideDropdown)}),cache.subMenuLinks.forEach(function(element2){element2.addEventListener("click",stopImmediatePropagation)}),window.addEventListener("resize",resizeHandler);var nav_bar=document.querySelector(".site-header__mobile-nav");if(nav_bar){let closeSearchDropdown2=function(){var search_bar__interior=document.querySelector(".search-bar__interior"),searchPopoverEl=document.querySelector(".predictive-search-wrapper--drawer"),searchBarElement=document.querySelector("form.search-bar__form");search_bar__interior&&searchPopoverEl&&searchBarElement&&search_bar__interior.classList.contains("is-fixed")&&document.body.classList.contains("no-mobile-scroll")&&(search_bar__interior.classList.remove("is-fixed"),document.body.classList.remove("no-mobile-scroll"),searchPopoverEl.setAttribute("aria-hidden","true"),searchBarElement.classList.remove("is-expanded"),document.querySelector("[data-predictive-search-drawer-input]")&&document.querySelector("[data-predictive-search-drawer-input]").blur())},initCountrySelector2=function(){var countrySelectors=document.querySelectorAll("[data-country-toggle]"),wrapper=document.querySelector(".country-selector-popup-wrapper"),source=document.querySelector("#shopify-section-country-selector-popup");if(!countrySelectors.length||!wrapper||wrapper.dataset.countrySelectorBound==="true")return;function ensureCountryPopup(){var popup=document.getElementById("country-selector-popup");if(popup)return popup;var template=document.querySelector("#country-selector-popup-template");return template&&template.content?wrapper.appendChild(template.content.cloneNode(!0)):source&&source.innerHTML.trim()&&(wrapper.insertAdjacentHTML("beforeend",source.innerHTML),source.innerHTML=""),document.getElementById("country-selector-popup")}function closeCountryPopup(){var popup=document.getElementById("country-selector-popup");popup&&popup.classList.remove("visible"),document.body.classList.remove("overflow-hidden");var announcement=document.querySelector("#shopify-section-announcement-bar");announcement&&(announcement.style.display="block")}function openCountryPopup(){var popup=ensureCountryPopup();if(popup){if(window.innerWidth<750){var announcement=document.querySelector("#shopify-section-announcement-bar");announcement&&(announcement.style.display="none");var mobileNavToggle=document.querySelector(".js-mobile-nav-toggle");mobileNavToggle&&mobileNavToggle.getAttribute("aria-expanded")==="true"&&mobileNavToggle.click()}var visibleMenu=document.querySelector(".item-has-mega-menu.visible");if(visibleMenu){var activeNavLink=visibleMenu.querySelector(".nav-bar__link.active");activeNavLink&&activeNavLink.classList.remove("active"),visibleMenu.classList.remove("visible");var menuOverlay=document.querySelector(".mega_menu_overlay");menuOverlay&&(menuOverlay.style.display="none")}hydrateCountryPopupImages(popup),popup.classList.add("visible"),document.body.classList.add("overflow-hidden")}}document.addEventListener("pointerdown",function(event){event.target&&event.target.closest&&event.target.closest("[data-country-toggle]")&&ensureCountryPopup()},{passive:!0}),document.addEventListener("focusin",function(event){event.target&&event.target.closest&&event.target.closest("[data-country-toggle]")&&ensureCountryPopup()}),document.addEventListener("click",function(event){if(event.target&&event.target.closest&&event.target.closest("[data-country-toggle]")){openCountryPopup();return}event.target&&event.target.closest&&event.target.closest("[data-country-popup-close]")&&closeCountryPopup()}),wrapper.dataset.countrySelectorBound="true"};var closeSearchDropdown=closeSearchDropdown2,initCountrySelector=initCountrySelector2,nav_bar_links=nav_bar.querySelectorAll(".item-has-mega-menu"),menuItems=document.querySelectorAll(".has-mega-menu");if(nav_bar_links.length){nav_bar.classList.contains("async-load")?fetch("/?view=header-ajax").then(response=>{if(!response.ok)throw new Error(`HTTP error! Status: ${response.status}`);return response.text()}).then(html=>{const doc=new DOMParser().parseFromString(html,"text/html");if(window.matchMedia("(max-width: 1023px)").matches)document.querySelector(".site-header .mobile-nav-wrapper").innerHTML=doc.querySelector(".mobile-nav-wrapper").innerHTML,theme.MobileNav.init();else{nav_bar_links.forEach(item=>{item.innerHTML=doc.querySelector(".nav-bar__item[data-menu-index='"+item.dataset.menuIndex+"']").innerHTML});var custom_menu_links2=document.querySelectorAll(".custom_menu_left_side_hover_item.custom_menu_item_dropdown_title");custom_menu_links2.forEach(function(targetItem){targetItem.onclick=function(){targetItem.closest(".mega_menu_columns__wrapper").querySelectorAll(".custom_menu_left_side_hover_item").forEach(function(block){block.classList.contains("active")&&block.classList.remove("active")}),targetItem.classList.add("active");var block_title=targetItem.getAttribute("data-title");targetItem.closest(".mega_menu_columns__wrapper").querySelectorAll(".custom_menu_block_content").forEach(function(block){block.classList.contains("active")&&block.classList.remove("active")}),targetItem.closest(".mega_menu_columns__wrapper").querySelector('.custom_menu_block_content[data-title="'+block_title+'"]').classList.add("active"),targetItem.closest(".custom_menu_left_side_item_wrap").querySelector(".custom_menu_item_dropdown.open")&&targetItem.closest(".custom_menu_left_side_item_wrap").querySelector(".custom_menu_item_dropdown.open").classList.remove("open")}});var mega_menu_titles=document.querySelectorAll(".custom_menu_item_dropdown_title:not(.custom_menu_left_side_hover_item)");
6mega_menu_titles.forEach(function(element2){element2.onclick=function(){element2.closest(".custom_menu_left_side_item_wrap").querySelector(".custom_menu_item_dropdown.open")&&element2.closest(".custom_menu_left_side_item_wrap").querySelector(".custom_menu_item_dropdown.open").classList.remove("open"),element2.parentElement.classList.add("open"),element2.parentElement.querySelectorAll(".custom_menu_left_side_hover_item")[0].click()}});var custom_menu_links2=document.querySelectorAll(".custom_menu_left_side_hover_item:not(.custom_menu_item_dropdown_title)");custom_menu_links2.forEach(function(targetItem){targetItem.onclick=function(){menuItemEvent(targetItem)},targetItem.onmouseover=function(){menuItemEvent(targetItem)}})}}).finally(initCountrySelector2):initCountrySelector2();var hi=new SV.HoverIntent(nav_bar_links,{onEnter:function(targetItem){targetItem.classList.add("visible"),targetItem.querySelector(".nav-bar__link").classList.add("active"),targetItem.classList.contains("mega_menu_main_parent")&&(document.querySelector(".mega_menu_overlay").style.display="block"),closeSearchDropdown2(),hideDropdown()},onExit:function(targetItem){targetItem.classList.remove("visible"),targetItem.querySelector(".nav-bar__link").classList.remove("active");var targetItemLinks=targetItem.querySelectorAll(".link");document.querySelector(".mega_menu_overlay").style.display="none",targetItemLinks.length&&targetItemLinks.forEach(function(link,index){link.blur()})},exitDelay:0,interval:0,sensitivity:7});document.addEventListener("click",function(e){let el=e.target;(el.classList.contains("mega_menu_overlay")||el.classList.contains("close-mega-menu")||el.closest(".close-mega-menu"))&&(document.querySelectorAll(".item-has-mega-menu.visible").length>0&&document.querySelectorAll(".item-has-mega-menu.visible").forEach(function(elem,index){elem.querySelector(".nav-bar__link.active").classList.remove("active"),elem.classList.remove("visible")}),document.querySelector(".mega_menu_overlay").style.display="none",document.querySelector("body").classList.remove("overflow-hidden"))})}if(menuItems.length)var hi=new SV.HoverIntent(menuItems,{onEnter:function(targetItem){targetItem.classList.add("visible"),closeSearchDropdown2(),hideDropdown()},onExit:function(targetItem){targetItem.classList.remove("visible")},exitDelay:300,interval:100,sensitivity:7})}var headerCartLink=document.querySelector(selectors2.headerCartLink);headerCartLink&&headerCartLink.addEventListener("click",function(e){e.preventDefault();var link_type=this.getAttribute("data-link-type");if(link_type=="drawer"){closeSearchMobileDropdown(),document.querySelector(".js-menu--is-open")&&theme.MobileNav.closeMobileNav();var card_drawer=document.querySelector("#sidebar-cart");card_drawer&&(card_drawer.classList.add("show"),document.querySelector("body").classList.add("show_overlay"),card_drawer.addEventListener("transitionend",()=>{card_drawer.focus(),slate.a11y.trapFocus({container:card_drawer,elementToFocus:card_drawer})},{once:!0}))}else window.location.href=window.routes.cartUrl});var search_product_type_Dropdown=document.querySelector("#search-product-type");search_product_type_Dropdown&&search_product_type_Dropdown.addEventListener("click",function(e){e.preventDefault();let el=e.target;var search_product_type_Dropdown2=el.closest("#search-product-type"),search_categories_menuParent=el.closest("[data-search-form-container]"),search_labelEl=search_categories_menuParent.querySelector(".search_categories_button__label"),value=el.getAttribute("data-value");search_product_type_Dropdown2.setAttribute("data-search-type",value),search_labelEl&&(search_labelEl.innerHTML=value);var inputElement=search_categories_menuParent.querySelector("[data-predictive-search-drawer-input]");inputElement&&inputElement.value!==""&&inputElement.dispatchEvent(new Event("keyup",{bubbles:!0}))});var header_toggle_search_btn=document.querySelector(".header-search-button");if(header_toggle_search_btn){header_toggle_search_btn.addEventListener("click",function(e){e.preventDefault(),document.querySelector(".js-menu--is-open")&&theme.MobileNav.closeMobileNav(),closeCartDrawer(),document.querySelector(".item-has-mega-menu.visible")&&(document.querySelector(".item-has-mega-menu.visible .nav-bar__link.active").classList.remove("active"),document.querySelector(".item-has-mega-menu.visible").classList.remove("visible"),document.querySelector(".mega_menu_overlay").style.display="none");var btn_parent=this.closest(".search-bar__interior"),searchDropdown=btn_parent.querySelector(".search-form__container");searchDropdown&&(this.classList.contains("active")?(searchDropdown.classList.remove("show_form"),searchDropdown.querySelector(".predictive-search-wrapper").classList.remove("visible"),this.classList.remove("active"),document.querySelector("body").classList.remove("show_overlay"),document.querySelector("body").classList.remove("show_search_overlay"),document.querySelector(".mega_menu_overlay").style.display="none"):(searchDropdown.classList.add("show_form"),setTimeout(function(){searchDropdown.querySelector(".predictive-search-wrapper").classList.add("visible")},100),this.classList.add("active"),document.querySelector("body").classList.add("show_overlay"),document.querySelector("body").classList.add("show_search_overlay"),document.querySelector(".mega_menu_overlay").style.display="block"))});var search_close_btn=document.querySelector(".search-close");search_close_btn&&search_close_btn.addEventListener("click",function(e){e.preventDefault(),document.querySelector(".js-menu--is-open")&&theme.MobileNav.closeMobileNav(),closeCartDrawer();var btn_parent=this.closest(".search-bar__interior"),searchDropdown=btn_parent.querySelector(".search-form__container");searchDropdown&&(setTimeout(function(){searchDropdown.classList.remove("show_form")},400),searchDropdown.querySelector(".predictive-search-wrapper").classList.remove("visible"),document.querySelector(".header-search-button").classList.remove("active"),document.querySelector("body").classList.remove("show_overlay"),setTimeout(function(){document.querySelector("body").classList.remove("show_search_overlay")},400),document.querySelector(".mega_menu_overlay").style.display="none")}),document.addEventListener("click",function(e){let el=e.target;if(document.querySelector(".show_search_overlay"),el.classList.contains("search-bar__interior")||el.closest(".search-bar__interior"))return!1;theme.Header.closeSearchMobileDropdown()})}var search_submit_btn=document.querySelector(selectors2.siteHeader).querySelector(".search-button__submit");search_submit_btn&&search_submit_btn.addEventListener("click",function(e){e.preventDefault();var form=this.closest(".search-form__container"),formValue=form.querySelector(".search-form__input").value,searchFilterEl=form.querySelector("#search-product-type"),formProductType="*";searchFilterEl&&(formProductType=searchFilterEl.getAttribute("data-search-type"));var productQuery=""+formValue+"*"+(formProductType!==""?" AND product_type:"+formProductType:"");window.theme.searchMode!=="product"&&(productQuery=""+formValue+"*");var formAction=window.routes.searchUrl+"?q="+productQuery+"&type="+window.theme.searchMode;window.location.href=formAction});var enable_live_search=document.querySelector(selectors2.siteHeader).getAttribute("data-enable_live_search");enable_live_search=="true"&&new theme.SearchBar(document.querySelector(".search-bar__interior"));var enable_overlap_header=document.querySelector(selectors2.siteHeader).getAttribute("data-enable_overlap_header");enable_overlap_header=="false"&&document.querySelector("#shopify-section-header")&&(document.querySelector("#shopify-section-header").classList.add("showAlternateHeader"),document.querySelector("#shopify-section-header").classList.add("no-overlap"),document.querySelector("body").classList.add("no-overlap-header")),cache.localeDisclosure.length&&cache.localeDisclosure.forEach(function(item,index){new theme.Disclosure(item)}),cache.currencyDisclosure.length&&cache.currencyDisclosure.forEach(function(item,index){new theme.Disclosure(item)})}function stopImmediatePropagation(event){event.stopImmediatePropagation()}function cacheSelectors(){var navigation=document.querySelector(selectors2.navigation),search_categories_menu=document.querySelector(".search_categories_menu"),customer_nav_dropdown=document.querySelector(".customer_nav_dropdown__wrapper");cache={nav:navigation,topLevel:document.querySelectorAll(selectors2.siteNavLinkMain),parents:navigation.querySelectorAll(selectors2.siteNavHasDropdown),search_categories_menu_parent:search_categories_menu,customer_nav_dropdown_parent:customer_nav_dropdown,subMenuLinks:document.querySelectorAll(selectors2.siteNavChildLinks),activeDropdown:document.querySelector(selectors2.siteNavActiveDropdown),siteHeader:document.querySelector(selectors2.siteHeader),siteNavChildLink:document.querySelectorAll(selectors2.siteNavChildLink)}
6,cache.localeDisclosure=cache.siteHeader.querySelectorAll(selectors2.disclosureLocale),cache.currencyDisclosure=cache.siteHeader.querySelectorAll(selectors2.disclosureCurrency)}function showDropdown(element2){element2.classList.add(config.activeClass),cache.activeDropdown&&hideDropdown(),cache.activeDropdown=element2,element2.querySelector(selectors2.siteNavLinkMain).setAttribute("aria-expanded","true"),setTimeout(function(){window.addEventListener("keyup",keyUpHandler),document.body.addEventListener("click",hideDropdown)},250)}function hideDropdown(){cache.activeDropdown&&(cache.activeDropdown.querySelector(selectors2.siteNavLinkMain).setAttribute("aria-expanded","false"),cache.activeDropdown.classList.remove(config.activeClass),cache.activeDropdown=document.querySelector(selectors2.siteNavActiveDropdown),window.removeEventListener("keyup",keyUpHandler),document.body.removeEventListener("click",hideDropdown))}function styleDropdowns(dropdownListItems){var mainMenuDropdowns=document.querySelectorAll(".nav-dropdown");mainMenuDropdowns.length&&mainMenuDropdowns.forEach(function(item,index){item.classList.remove("right_side"),overlapDropdown(item)?item.classList.add("right_side"):item.classList.remove("right_side")}),dropdownListItems.forEach(function(item){var dropdownLi=item.querySelector(selectors2.siteNavDropdown);dropdownLi&&(isRightOfLogo(item)?(dropdownLi.classList.remove(config.leftDropdownClass),dropdownLi.classList.add(config.rightDropdownClass)):(dropdownLi.classList.remove(config.rightDropdownClass),dropdownLi.classList.add(config.leftDropdownClass)))})}function overlapDropdown(item){var rect=item.getBoundingClientRect(),rightOffset=rect.right,headerWidth=Math.floor(cache.siteHeader.offsetWidth);return rightOffset>headerWidth}function isRightOfLogo(item){var rect=item.getBoundingClientRect(),win=item.ownerDocument.defaultView,leftOffset=rect.left+win.pageXOffset,headerWidth=Math.floor(cache.siteHeader.offsetWidth)/2;return leftOffset>headerWidth}function positionFullWidthDropdowns(){document.querySelectorAll(selectors2.siteNavHasCenteredDropdown).forEach(function(el){var fullWidthDropdown=el.querySelector(selectors2.siteNavCenteredDropdown),fullWidthDropdownOffset=el.offsetTop+41;fullWidthDropdown.style.top=fullWidthDropdownOffset+"px"})}function keyUpHandler(event){event.keyCode===27&&hideDropdown()}function resizeHandler(){adjustStyleAndPosition()}function submenuParentClickHandler(event){var element2=event.currentTarget;element2.classList.contains(config.activeClass)?hideDropdown():showDropdown(element2)}function submenuFocusoutHandler(){setTimeout(function(){document.activeElement.classList.contains(config.childLinkClass)||!cache.activeDropdown||hideDropdown()})}var adjustStyleAndPosition=theme.Helpers.debounce(function(){styleDropdowns(document.querySelectorAll(selectors2.siteNavHasDropdown)),positionFullWidthDropdowns()},50);function unload(){cache.topLevel.forEach(function(element2){element2.removeEventListener("focus",hideDropdown)}),cache.subMenuLinks.forEach(function(element2){element2.removeEventListener("click",stopImmediatePropagation)}),cache.search_categories_menu_parent&&cache.search_categories_menu_parent.removeEventListener("click",submenuParentClickHandler),cache.customer_nav_dropdown_parent&&cache.customer_nav_dropdown_parent.removeEventListener("click",submenuParentClickHandler),cache.parents.forEach(function(element2){element2.removeEventListener("click",submenuParentClickHandler)}),cache.siteNavChildLink.forEach(function(element2){element2.removeEventListener("focusout",submenuFocusoutHandler)}),window.removeEventListener("resize",resizeHandler),window.removeEventListener("keyup",keyUpHandler),document.body.removeEventListener("click",hideDropdown)}return{init,unload,closeCartDrawer,closeSearchMobileDropdown}})(),window.theme=window.theme||{},theme.MobileNav=(function(){var classes={mobileNavOpenIcon:"mobile-nav--open",mobileNavCloseIcon:"mobile-nav--close",navLinkWrapper:"mobile-nav__item",navLink:"mobile-nav__link",subNavLink:"mobile-nav__sublist-link",return:"mobile-nav__return-btn",subNavActive:"is-active",subNavClosing:"is-closing",navOpen:"js-menu--is-open",subNavShowing:"sub-nav--is-open",thirdNavShowing:"third-nav--is-open",fourthNavShowing:"fourth-nav--is-open",subNavToggleBtn:"js-toggle-submenu"},cache={},isTransitioning,activeSubNav,activeTrigger,menuLevel=1,mediumUpQuery="(min-width: "+theme.breakpoints.medium+"px)",mql=window.matchMedia(mediumUpQuery);
6function init(){cacheSelectors(),cache.mobileNavToggle&&cache.mobileNavToggle.addEventListener("click",toggleMobileNav),cache.subNavToggleBtns.forEach(function(element2){element2.addEventListener("click",toggleSubNav)}),cache.mobileMenuOverlay&&cache.mobileMenuOverlay.addEventListener("click",closeMobileNav),mql.addListener(initBreakpoints)}function initBreakpoints(){mql.matches&&cache.mobileNavContainer.classList.contains(classes.navOpen)&&closeMobileNav()}function toggleMobileNav(){var mobileNavIsOpen=cache.mobileNavToggle.classList.contains(classes.mobileNavCloseIcon);mobileNavIsOpen?closeMobileNav():openMobileNav()}function cacheSelectors(){cache={pageContainer:document.querySelector("#PageContainer"),siteHeader:document.querySelector(".site-header"),mobileNavToggle:document.querySelector(".js-mobile-nav-toggle"),mobileNavContainer:document.querySelector(".mobile-nav-wrapper"),mobileNav:document.querySelector("#MobileNav"),sectionHeader:document.querySelector("#shopify-section-header"),subNavToggleBtns:document.querySelectorAll("."+classes.subNavToggleBtn),bodyElem:document.querySelector("body"),mobileMenuOverlay:document.querySelector(".mobile_menu_overlay")}}function openMobileNav(){theme.Header.closeSearchMobileDropdown(),theme.Header.closeCartDrawer();var translateHeaderHeight=cache.siteHeader.offsetHeight;theme.Helpers.prepareTransition(cache.mobileNavContainer),cache.mobileNavContainer.classList.add(classes.navOpen),cache.bodyElem.classList.add(classes.navOpen);var mobileNavHeight=cache.mobileNav.offsetHeight,mobileNavDropdownsArr=cache.mobileNav.querySelectorAll(".mobile-nav__dropdown");mobileNavDropdownsArr.length&&mobileNavDropdownsArr.forEach(function(item,index){var itemHeight=item.offsetHeight;itemHeight>mobileNavHeight&&(mobileNavHeight=itemHeight)}),cache.mobileNavContainer.style.top=translateHeaderHeight-2+"px",slate.a11y.trapFocus({container:cache.sectionHeader,elementToFocus:cache.mobileNavToggle}),cache.mobileNavToggle.classList.add(classes.mobileNavCloseIcon),cache.mobileNavToggle.classList.remove(classes.mobileNavOpenIcon),cache.mobileNavToggle.setAttribute("aria-expanded",!0),window.addEventListener("keyup",keyUpHandler)}function keyUpHandler(event){event.which===27&&closeMobileNav()}function closeMobileNav(){document.querySelectorAll(".js-toggle-submenu").forEach(function(element2){element2.classList.contains("is-active")&&element2.classList.remove("is-active")}),cache.mobileNavContainer.classList.remove(classes.navOpen),cache.bodyElem.classList.remove(classes.navOpen),slate.a11y.trapFocus({container:document.querySelector("html"),elementToFocus:document.body}),cache.mobileNavContainer.addEventListener("transitionend",mobileNavRemoveTrapFocus,{once:!0}),cache.mobileNavToggle.classList.add(classes.mobileNavOpenIcon),cache.mobileNavToggle.classList.remove(classes.mobileNavCloseIcon),cache.mobileNavToggle.setAttribute("aria-expanded",!1),cache.mobileNavToggle.focus(),window.removeEventListener("keyup",keyUpHandler),window.scrollTo(0,0)}function mobileNavRemoveTrapFocus(){slate.a11y.removeTrapFocus({container:cache.mobileNav})}function toggleSubNav(event){var toggleBtn=event.currentTarget,subNavToggleBtn=document.querySelectorAll("."+classes.subNavToggleBtn+"[data-level='"+(menuLevel-1)+"']"),buttonLevel=toggleBtn.getAttribute("data-level"),activeLink=!!toggleBtn.classList.contains("is-active");buttonLevel>1?toggleBtn.parentElement.querySelector(".mobile-nav__link.is-active")&&toggleBtn.parentElement.querySelector(".mobile-nav__link.is-active").classList.remove(classes.subNavActive):toggleBtn.closest(".mobile-nav").querySelector(".megamenu-btn.is-active")&&toggleBtn.closest(".mobile-nav").querySelector(".megamenu-btn.is-active").classList.remove(classes.subNavActive),activeLink?toggleBtn.classList.remove(classes.subNavActive):toggleBtn.classList.add(classes.subNavActive),activeTrigger=toggleBtn,goToSubnav(toggleBtn.getAttribute("data-target"),toggleBtn)}function goToSubnav(target,button){var targetMenu=target?document.querySelector('.mobile-nav__dropdown[data-parent="'+target+'"]'):cache.mobileNav;menuLevel=targetMenu.dataset.level?Number(targetMenu.dataset.level):1;var translateMenuHeight=targetMenu.offsetHeight,container=menuLevel===1?cache.sectionHeader:targetMenu}function unload(){mql.removeListener(initBreakpoints)}return{init,unload,closeMobileNav}}
6)(),window.Modals=(function(){function Modal(id,name,options){var defaults={close:".js-modal-close",open:".js-modal-open-"+name,openClass:"modal--is-active",closeModalOnClick:!1};if(this.modal=document.getElementById(id),!this.modal)return!1;this.nodes={parents:[document.querySelector("html"),document.body]},this.config=Object.assign(defaults,options),this.modalIsOpen=!1,this.focusOnOpen=this.config.focusOnOpen?document.getElementById(this.config.focusOnOpen):this.modal,this.openElement=document.querySelector(this.config.open),this.init()}return Modal.prototype.init=function(){this.openElement.addEventListener("click",this.open.bind(this)),this.modal.querySelector(this.config.close).addEventListener("click",this.closeModal.bind(this))},Modal.prototype.open=function(evt){var self2=this,externalCall=!1;this.modalIsOpen||(evt?evt.preventDefault():externalCall=!0,evt&&evt.stopPropagation&&evt.stopPropagation(),this.modalIsOpen&&!externalCall&&this.closeModal(),this.modal.classList.add(this.config.openClass),this.nodes.parents.forEach(function(node){node.classList.add(self2.config.openClass),node.classList.add("show_overlay")}),this.modalIsOpen=!0,slate.a11y.trapFocus({container:this.modal,elementToFocus:this.focusOnOpen}),this.bindEvents())},Modal.prototype.closeModal=function(){if(this.modalIsOpen){document.activeElement.blur(),this.modal.classList.remove(this.config.openClass);var self2=this;this.nodes.parents.forEach(function(node){node.classList.remove(self2.config.openClass),node.classList.remove("show_overlay")}),this.modalIsOpen=!1,slate.a11y.removeTrapFocus({container:this.modal}),this.openElement.focus(),this.unbindEvents()}},Modal.prototype.bindEvents=function(){this.keyupHandler=this.keyupHandler.bind(this),this.clickHandler=this.clickHandler.bind(this),document.body.addEventListener("keyup",this.keyupHandler),document.body.addEventListener("click",this.clickHandler)},Modal.prototype.unbindEvents=function(){document.body.removeEventListener("keyup",this.keyupHandler),document.body.removeEventListener("click",this.clickHandler)},Modal.prototype.keyupHandler=function(event){event.keyCode===27&&this.closeModal()},Modal.prototype.clickHandler=function(event){this.config.closeModalOnClick&&!this.modal.contains(event.target)&&this.closeModal()},Modal})(),theme.Slideshow=(function(){var selectors2={button:"[data-slider-button]",indicator:"[data-slider-indicator]",indicators:"[data-slider-indicators]",pause:"[data-slider-pause]",slider:"[data-slider]",sliderItem:"[data-slider-item]",sliderItemLink:"[data-slider-item-link]",sliderTrack:"[data-slider-track]",sliderContainer:"[data-slider-container]"},classes={isPaused:"slideshow__pause--is-paused",indicator:"slider-indicators__item",indicatorActive:"slick-active",sliderInitialized:"slick-initialized",slideActive:"slideshow__slide--active",slideClone:"slick-cloned"},attributes={buttonNext:"data-slider-button-next"};function Slideshow(container,options){this.container=container,this.slider=this.container.querySelector(selectors2.slider);var self2=this;this.slider&&(this.eventHandlers={},this.lastSlide=0,this.slideIndex=0,this.sliderContainer=null,this.slides=[],this.options=Object.assign({},{autoplay:!1,canUseKeyboardArrows:!0,canUseTouchEvents:!1,slideActiveClass:classes.slideActive,slideInterval:0,slidesToShow:0,slidesToScroll:1,type:"slide",swipeEnabled:!0},options),this.sliderContainer=this.slider.querySelector(selectors2.sliderContainer),this.adaptHeight=this.sliderContainer.getAttribute("data-adapt-height")==="true",this.slides=Array.from(this.sliderContainer.querySelectorAll(selectors2.sliderItem)),this.lastSlide=this.slides.length-1,this.buttons=this.container.querySelectorAll(selectors2.button),this.indicators=this.container.querySelectorAll(selectors2.indicators),!(this.slides.length<=1)&&(this.timeout=250,this.options.autoplay&&this.startAutoplay(),this.adaptHeight&&this.setSlideshowHeight(),this.checkSlideshowHeight(),this.options.type==="slide"?(this.isFirstSlide=!1,this.isLastSlide=!1,this.sliderItemWidthTotal=0,this.sliderTrack=this.slider.querySelector(selectors2.sliderTrack),this.sliderItemWidthTotal=0,theme.Helpers.promiseStylesheet().then(function(){this._setupSlideType()}.bind(this))):this.setupSlider(0),this._setupEventHandlers()))}return Slideshow.prototype=Object.assign({},Slideshow.prototype,{previousSlide:function(){this._move()},nextSlide:function(){this._move("next")},setSlide:function(index){this._setPosition(Number(index))},startAutoplay:function(){this.isAutoPlaying=!0,window.clearTimeout(this.autoTimeOut),this.autoTimeOut=window.setTimeout(function(){var nextSlideIndex=this._getNextSlideIndex("next");this._setPosition(nextSlideIndex)}.bind(this),this.options.slideInterval)},stopAutoplay:function(){this.isAutoPlaying=!1,window.clearTimeout(this.autoTimeOut)},setupSlider:function(index){this.slideIndex=index,this.indicators.length&&this._setActiveIndicator(index),this._setupActiveSlide(index)},destroy:function(){this.adaptHeight&&window.removeEventListener("resize",this.eventHandlers.debounceResize),this.container.removeEventListener("focus",this.eventHandlers.focus,!0),this.slider.removeEventListener("focusin",this.eventHandlers.focusIn,!0),this.slider.removeEventListener("focusout",this.eventHandlers.focusOut,!0),this.container.removeEventListener("blur",this.eventHandlers.blur,!0),this.buttons&&this.buttons.forEach(function(button){button.removeEventListener("click",this.eventHandlers.clickButton)}
6.bind(this)),this.indicators.forEach(function(indicatorWrapper){indicatorWrapper.childNodes.forEach(function(indicator){indicator.firstElementChild.removeEventListener("click",this.eventHandlers.onClickIndicator),indicator.firstElementChild.removeEventListener("keydown",this.eventHandlers.onKeydownIndicator)},this)},this),this.options.type==="slide"&&(window.removeEventListener("resize",this.eventHandlers.debounceResizeSlideIn),this.touchEvents&&this.options.canUseTouchEvents&&(this.touchEvents.destroy(),this.touchEvents=null))},_setupEventHandlers:function(){this.eventHandlers.focus=this._onFocus.bind(this),this.eventHandlers.focusIn=this._onFocusIn.bind(this),this.eventHandlers.focusOut=this._onFocusOut.bind(this),this.eventHandlers.blur=this._onBlur.bind(this),this.eventHandlers.keyUp=this._onKeyUp.bind(this),this.eventHandlers.clickButton=this._onClickButton.bind(this),this.eventHandlers.onClickIndicator=this._onClickIndicator.bind(this),this.eventHandlers.onKeydownIndicator=this._onKeydownIndicator.bind(this),this.eventHandlers.onClickPause=this._onClickPause.bind(this),this.adaptHeight&&(this.eventHandlers.debounceResize=theme.Helpers.debounce(function(){this.setSlideshowHeight()}.bind(this),50),window.addEventListener("resize",this.eventHandlers.debounceResize)),this.checkSlideshowHeight(),this.container.addEventListener("focus",this.eventHandlers.focus,!0),this.slider.addEventListener("focusin",this.eventHandlers.focusIn,!0),this.slider.addEventListener("focusout",this.eventHandlers.focusOut,!0),this.container.addEventListener("blur",this.eventHandlers.blur,!0),this.buttons&&this.buttons.forEach(function(button){button.addEventListener("click",this.eventHandlers.clickButton)}.bind(this)),this.indicators.forEach(function(indicatorWrapper){indicatorWrapper.childNodes.forEach(function(indicator){indicator.firstElementChild.addEventListener("click",this.eventHandlers.onClickIndicator),indicator.firstElementChild.addEventListener("keydown",this.eventHandlers.onKeydownIndicator)},this)},this),this.options.type==="slide"&&(this.eventHandlers.debounceResizeSlideIn=theme.Helpers.debounce(function(){this.sliderItemWidthTotal=0,this._setupSlideType(!0)}.bind(this),50),window.addEventListener("resize",this.eventHandlers.debounceResizeSlideIn),this.options.swipeEnabled&&this._setupSwipe(),this.options.canUseTouchEvents&&this.options.slidesToScroll<this.slides.length&&this._setupTouchEvents());var _this=this,containerHover=new SV.HoverIntent(_this.slides,{onEnter:function(targetItem){_this.stopAutoplay()},onExit:function(targetItem){},exitDelay:300,interval:100,sensitivity:7})},_setupSwipe:function(){this.touchEvents=new theme.TouchEvents(this.slider,{start:function(){}.bind(this),move:function(event,direction,difference){this._onSwipeEnd(event,direction,difference)}.bind(this),end:function(event,direction,difference){}.bind(this)})},_setupTouchEvents:function(){this.touchEvents=new theme.TouchEvents(this.sliderTrack,{start:function(){this._onTouchStart()}.bind(this),move:function(event,direction,difference){this._onTouchMove(event,direction,difference)}.bind(this),end:function(event,direction,difference){this._onTouchEnd(event,direction,difference)}.bind(this)})},_setupSlideType:function(onResize){this.sliderItemWidth=Math.floor(this.sliderContainer.offsetWidth/this.options.slidesToShow),this.sliderTranslateXMove=this.sliderItemWidth*this.options.slidesToScroll,onResize||this.sliderContainer.classList.add(classes.sliderInitialized),this.slides.forEach(function(sliderItem,index){var sliderItemLink=sliderItem.querySelector(selectors2.sliderItemLink);sliderItem.style.width=this.sliderItemWidth+"px",this.sliderItemWidthTotal=this.sliderItemWidthTotal+sliderItem.offsetWidth,index<this.options.slidesToShow&&sliderItem.classList.add(this.options.slideActiveClass)},this),this.sliderTrack.style.width=Math.floor(this.sliderItemWidthTotal)+"px",this.sliderTrack.style.transform="translateX(-0px)",this.buttons.length&&(this.buttons[0].setAttribute("aria-disabled",!0),this.buttons[1].removeAttribute("aria-disabled")),this.indicators.length&&this._setActiveIndicator(0)},_onTouchStart:function(){this.touchStartPosition=this._getTranslateXPosition()},_onTouchMove:function(event,direction,difference){var threshold=80;if(Shopify.designMode&&(event.clientX<=threshold||event.clientX>=window.innerWidth-threshold)){event.target.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0,cancelable:!0}));return}direction!=="left"&&direction!=="right"||(this.touchMovePosition=this.touchStartPosition+difference.xPosition,this.sliderTrack.style.transform="translateX("+this.touchMovePosition+"px")},_onSwipeEnd:function(event,direction,difference){var slideDirection=direction==="left"?"next":"",counter=slideDirection==="next"?1:-1,nextSlideIndex=this.slideIndex+counter;if(slideDirection==="next"){if(this.slideIndex===this.lastSlide)var nextSlideIndex=0}else if(!this.slideIndex)var nextSlideIndex=this.lastSlide;this._setPosition(nextSlideIndex)},_onTouchEnd:function(event,direction,difference){var nextTranslateXPosition=0;if(Object.keys(difference).length!==0){var slideDirection=direction==="left"?"next":"";direction==="left"?this._isNextTranslateXLast(this.touchStartPosition)?nextTranslateXPosition=this.touchStartPosition:nextTranslateXPosition=this.touchStartPosition-this.sliderTranslateXMove:(nextTranslateXPosition=this.touchStartPosition+this.sliderTranslateXMove,this._isNextTranslateXFirst(this.touchStartPosition)&&(nextTranslateXPosition=0)),this.slideIndex=this._getNextSlideIndex(slideDirection),this.sliderTrack.style.transition="transform 500ms ease 0s",this.sliderTrack.style.transform="translateX("+nextTranslateXPosition+"px",window.setTimeout(function(){this.sliderTrack.style.transition=""}.bind(this),500),this._verifyFirstLastSlideTranslateX(nextTranslateXPosition),this._postTransitionEnd()}},_onClickButton:function(event){if(!(event.detail>1)){var button=event.currentTarget,nextButton=button.hasAttribute(attributes.buttonNext);this.options.type==="slide"&&button.getAttribute("aria-disabled")==="true"||(this.options.autoplay&&this.isAutoPlaying&&this.stopAutoplay(),nextButton?this.nextSlide():this.previousSlide())}},_onClickIndicator:function(event){event.preventDefault(),!event.target.classList.contains(classe
6s.indicatorActive)&&(this.options.autoplay&&this.isAutoPlaying&&this.stopAutoplay(),this.slideIndex=Number(event.target.dataset.slideNumber),this.goToSlideByIndex(this.slideIndex))},goToSlideByIndex:function(index){if(this._setPosition(index),this.options.type==="slide"&&this.sliderTrack){this.sliderTrack.style.transition="transform 500ms ease 0s";var newPosition=index*this.slides[0].offsetWidth;this.sliderTrack.style.transform="translateX(-"+newPosition+"px)",this.options.slidesToShow>1&&(this._verifyFirstLastSlideTranslateX(newPosition),this.buttons.length&&this._disableArrows(),this._setupMultipleActiveSlide(index,index+(this.options.slidesToShow-1)))}},_onKeydownIndicator:function(event){event.keyCode===slate.utils.keyboardKeys.ENTER&&(this._onClickIndicator(event),this.slider.focus())},_onClickPause:function(event){event.currentTarget.classList.contains(classes.isPaused)?(event.currentTarget.classList.remove(classes.isPaused),this.startAutoplay()):(event.currentTarget.classList.add(classes.isPaused),this.stopAutoplay())},_onFocus:function(){this.container.addEventListener("keyup",this.eventHandlers.keyUp)},_onFocusIn:function(){this.slider.hasAttribute("aria-live")||(this.options.autoplay&&this.isAutoPlaying&&this.stopAutoplay(),this.slider.setAttribute("aria-live","polite"))},_onBlur:function(){this.container.removeEventListener("keyup",this.eventHandlers.keyUp)},_onFocusOut:function(){this.slider.removeAttribute("aria-live"),setTimeout(function(){document.activeElement.closest("#"+this.slider.getAttribute("id"))||this.options.autoplay&&this.isAutoPlaying}.bind(this),this.timeout)},_onKeyUp:function(event){switch(event.keyCode){case slate.utils.keyboardKeys.LEFTARROW:if(!this.options.canUseKeyboardArrows||this.options.type==="slide"&&this.isFirstSlide)return;this.previousSlide();break;case slate.utils.keyboardKeys.RIGHTARROW:if(!this.options.canUseKeyboardArrows||this.options.type==="slide"&&this.isLastSlide)return;this.nextSlide();break;case slate.utils.keyboardKeys.ESCAPE:this.slider.blur();break}},_move:function(direction){if(this.options.type==="slide")this.slideIndex=this._getNextSlideIndex(direction),this._moveSlideshow(direction);else{var nextSlideIndex=this._getNextSlideIndex(direction);this._setPosition(nextSlideIndex)}},_moveSlideshow:function(direction){this.direction=direction;var valueXToMove=0,currentTranslateXPosition=this._getTranslateXPosition(),currentActiveSlidesIndex=this._getActiveSlidesIndex(),currentActiveSlidesMinIndex=Math.min.apply(Math,currentActiveSlidesIndex),currentActiveSlidesMaxIndex=Math.max.apply(Math,currentActiveSlidesIndex);this.nextMinIndex=direction==="next"?currentActiveSlidesMinIndex+this.options.slidesToShow:currentActiveSlidesMinIndex-this.options.slidesToShow,this.nextMaxIndex=direction==="next"?currentActiveSlidesMaxIndex+this.options.slidesToShow:currentActiveSlidesMinIndex-1,this.sliderTrack.style.transition="transform 500ms ease 0s",direction==="next"?(valueXToMove=currentTranslateXPosition-this.sliderTranslateXMove,this.sliderTrack.style.transform="translateX("+valueXToMove+"px)"):(valueXToMove=currentTranslateXPosition+this.sliderTranslateXMove,this.sliderTrack.style.transform="translateX("+valueXToMove+"px)"),this._verifyFirstLastSlideTranslateX(valueXToMove),this._postTransitionEnd(),this._setupMultipleActiveSlide(this.nextMinIndex,this.nextMaxIndex)},_setPosition:function(nextSlideIndex){this.slideIndex=nextSlideIndex,this.indicators.length&&this._setActiveIndicator(nextSlideIndex),this._setupActiveSlide(nextSlideIndex),this.options.autoplay&&this.isAutoPlaying&&this.startAutoplay(),this.container.dispatchEvent(new CustomEvent("slider_slide_changed",{detail:nextSlideIndex}))},_setupActiveSlide:function(index){this.slides.forEach(function(slide){slide.classList.remove(this.options.slideActiveClass)},this),this.slides[index].classList.add(this.options.slideActiveClass)},_setupMultipleActiveSlide:function(minIndex,maxIndex){this.slides.forEach(function(slide){var sliderIndex=Number(slide.getAttribute("data-slider-slide-index")),sliderItemLink=slide.querySelector(selectors2.sliderItemLink);slide.classList.remove(this.options.slideActiveClass),sliderItemLink&&sliderItemLink.setAttribute("tabindex",-1),sliderIndex>=minIndex&&sliderIndex<=maxIndex&&slide.classList.add(this.options.slideActiveClass)},this)}
6,_setActiveIndicator:function(index){this.indicators.forEach(function(indicatorWrapper){var activeIndicator=indicatorWrapper.querySelector("."+classes.indicatorActive),nextIndicator=indicatorWrapper.childNodes[index];activeIndicator&&(activeIndicator.classList.remove(classes.indicatorActive),activeIndicator.firstElementChild.removeAttribute("aria-current")),nextIndicator.classList.add(classes.indicatorActive),nextIndicator.firstElementChild.setAttribute("aria-current",!0)},this)},setSlideshowHeight:function(){var minAspectRatio=this.sliderContainer.getAttribute("data-min-aspect-ratio");this.sliderContainer.style.height=document.documentElement.offsetWidth/minAspectRatio+"px"},checkSlideshowHeight:function(){var sliderContainer=this.sliderContainer,sliderContainerHeight=sliderContainer.offsetHeight,windowWidth=document.documentElement.offsetWidth;if(!sliderContainer.classList.contains("slideshow--adapt")&&windowWidth>1239){var slideSContentArr=sliderContainer.querySelectorAll(".slideshow__text-content");if(slideSContentArr.length){var maxHeight=0;slideSContentArr.forEach(function(item,index){var contentHeight=item.offsetHeight;contentHeight>maxHeight&&(maxHeight=contentHeight)}),windowWidth>1239?maxHeight+=350:maxHeight+=200,maxHeight>sliderContainerHeight&&(sliderContainer.style.minHeight=maxHeight+"px")}}else if(!sliderContainer.classList.contains("mobile-slideshow--adapt")&&windowWidth<=1239){var slideSContentArr=sliderContainer.querySelectorAll(".slideshow__text-content");if(slideSContentArr.length){var maxHeight=0;slideSContentArr.forEach(function(item,index){var contentHeight=item.offsetHeight;contentHeight>maxHeight&&(maxHeight=contentHeight)}),windowWidth>1239?maxHeight+=300:maxHeight+=200,maxHeight>sliderContainerHeight&&(sliderContainer.style.height=maxHeight+"px")}}},_getNextSlideIndex:function(direction){var counter=direction==="next"?1:-1;if(direction==="next"){if(this.slideIndex===this.lastSlide)return this.options.type==="slide"?this.lastSlide:0}else if(!this.slideIndex)return this.options.type==="slide"?0:this.lastSlide;return this.slideIndex+counter},_getActiveSlidesIndex:function(){var currentActiveSlides=this.slides.filter(function(sliderItem){if(sliderItem.classList.contains(this.options.slideActiveClass))return sliderItem},this),currentActiveSlidesIndex=currentActiveSlides.map(function(sliderItem){return Number(sliderItem.getAttribute("data-slider-slide-index"))});return currentActiveSlidesIndex},_disableArrows:function(){if(this.buttons.length!==0){var previousButton=this.buttons[0],nextButton=this.buttons[1];this.isFirstSlide?previousButton.setAttribute("aria-disabled",!0):previousButton.removeAttribute("aria-disabled"),this.isLastSlide?nextButton.setAttribute("aria-disabled",!0):nextButton.removeAttribute("aria-disabled")}},_verifyFirstLastSlideTranslateX:function(translateXValue){this._isNextTranslateXFirst(translateXValue)?this.isFirstSlide=!0:this.isFirstSlide=!1,this._isNextTranslateXLast(translateXValue)?this.isLastSlide=!0:this.isLastSlide=!1},_getTranslateXPosition:function(){return Number(this.sliderTrack.style.transform.match(/(-?[0-9]+)/g)[0])},_isNextTranslateXFirst:function(translateXValue){return translateXValue===0},_isNextTranslateXLast:function(translateXValue){var translateXValueAbsolute=Math.abs(translateXValue),nextTranslateXValue=translateXValueAbsolute+this.sliderTranslateXMove;return nextTranslateXValue>=this.sliderItemWidthTotal},_postTransitionEnd:function(){this.buttons.length&&this._disableArrows(),this.indicators.length&&this._setActiveIndicator(this.slideIndex)}}),Slideshow})();var youtubeLoaded=!1;if(!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)}theme.Video=(function(){var autoplayCheckComplete=!1,playOnClickChecked=!1,playOnClick=!1,videos={},videoPlayers=[],videoOptions={ratio:16/9,scrollAnimationDuration:400,playerVars:{iv_load_policy:3,modestbranding:1,autoplay:1,playsinline:1,controls:0,wmode:"opaque",branding:0,auto
6hide: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",backgroundVideoWrapper:"video-background-wrapper",backgroundVideo:"video--background",supportsAutoplay:"autoplay"},selectors2={section:".video-section",videoWrapper:".video-section-wrapper",fallbackText:".icon__fallback-text"};function init(video){video&&(videos[video.id]={id:video.id,videoId:video.dataset.id,type:video.dataset.type,status:"background",video,videoWrapper:video.closest(selectors2.videoWrapper),section:video.closest(selectors2.section),controls:0},playOnClickCheck())}function customPlayVideo(playerId){!playOnClickChecked&&!playOnClick||playerId&&typeof videoPlayers[playerId].playVideo=="function"&&privatePlayVideo(playerId)}function pauseVideo(playerId){alert("pauseVideo"),videoPlayers[playerId]&&typeof videoPlayers[playerId].pauseVideo=="function"&&videoPlayers[playerId].pauseVideo()}function loadVideos(){for(var key in videos)videos.hasOwnProperty(key)&&createPlayer(key);initEvents(),youtubeLoaded=!0}function editorLoadVideo(key){youtubeLoaded&&(createPlayer(key),initEvents())}function privatePlayVideo(id,clicked){var videoData=videos[id],player=videoPlayers[id],videoWrapper=videoData.videoWrapper;if(playOnClick)setAsPlaying(videoData);else if(clicked||autoplayCheckComplete){videoWrapper.classList.remove(classes.loading),setAsPlaying(videoData),player.playVideo();return}else player.playVideo()}function setAutoplaySupport(supported){var supportClass=classes.supportsAutoplay;document.documentElement.classList.remove(classes.supportsAutoplay),document.documentElement.classList.add(supportClass),supported||(playOnClick=!0),autoplayCheckComplete=!0}function playOnClickCheck(){playOnClickChecked||(playOnClick&&setAutoplaySupport(!1),playOnClickChecked=!0)}function onPlayerReady(evt){evt.target.setPlaybackQuality("hd1080");var videoData=getVideoOptions(evt),videoTitle=evt.target.getVideoData().title;playOnClickCheck(),document.getElementById(videoData.id).setAttribute("tabindex","-1"),sizeBackgroundVideos(),videoData.type==="background"&&(evt.target.mute(),privatePlayVideo(videoData.id)),videoData.videoWrapper.classList.add(classes.loaded)}function onPlayerChange(evt){var videoData=getVideoOptions(evt);switch(videoData.status==="background"&&!autoplayCheckComplete&&(evt.data===YT.PlayerState.PLAYING||evt.data===YT.PlayerState.BUFFERING)&&(setAutoplaySupport(!0),autoplayCheckComplete=!0,videoData.videoWrapper.classList.remove(classes.loading)),evt.data){case YT.PlayerState.ENDED:setAsFinished(videoData);break;case YT.PlayerState.PAUSED:setTimeout(function(){evt.target.getPlayerState()===YT.PlayerState.PAUSED&&setAsPaused(videoData)},200);break}}function setAsFinished(videoData){videoPlayers[videoData.id].seekTo(0)}function setAsPlaying(videoData){var videoWrapper=videoData.videoWrapper;videoWrapper.classList.remove(classes.loading),videoData.status!=="background"&&(document.getElementById(videoData.id).setAttribute("tabindex","0"),setTimeout(function(){},videoOptions.scrollAnimationDuration))}function setAsPaused(videoData){var videoWrapper=videoData.videoWrapper;videoWrapper.classList.remove(classes.playing)}function getVideoOptions(evt){var id=evt.target.getIframe().id;return videos[id]}function toggleExpandVideo(playerId,expand){var video=videos[playerId],elementTop=video.videoWrapper.getBoundingClientRect().top+window.pageYOffset,offset2=0,newHeight=0;if(expand){if(newHeight=video.videoWrapper.offsetWidth/videoOptions.ratio,offset2=(window.innerHeight-newHeight)/2,video.videoWrapper.style.height=video.videoWrapper.getBoundingClientRect().height+"px",video.videoWrapper.style.height=newHeight+"px",Shopify.designMode){var scrollBehavior=document.documentElement.style.scrollBehavior;document.documentElement.style.scrollBehavior="smooth",window.scrollTo({top:elementTop-offset2}),document.documentElement.style.scrollBehavior=scrollBehavior}}else{newHeight=video.videoWrapper.dataset.desktopHeight,video.videoWrapper.style.height=newHeight+"px";var x=window.scrollX,y=window.scrollY;window.scrollTo(x,y)}}function startVideoOnClick(playerId){var video=videos[playerId];video.videoWrapper.classList.add(classes.loading),video.videoWrapper.style.height=video.videoWrapper.offsetHeight+"px",video.status="open",unsetBackgroun
6dVideo(playerId,video),videoPlayers[playerId].unMute(),privatePlayVideo(playerId,!0),toggleExpandVideo(playerId,!0),document.addEventListener("keydown",handleVideoPlayerKeydown)}var handleVideoPlayerKeydown=function(evt){var playerId=document.activeElement.dataset.controls;evt.keyCode!==slate.utils.keyboardKeys.ESCAPE||!playerId||toggleExpandVideo(playerId,!1)};function sizeBackgroundVideos(){var backgroundVideos=document.querySelectorAll("."+classes.backgroundVideo);backgroundVideos.forEach(function(el){sizeBackgroundVideo(el)})}function sizeBackgroundVideo(videoPlayer){if(youtubeLoaded){var videoWrapper=videoPlayer.closest(selectors2.videoWrapper),videoWidth=videoWrapper.clientWidth,playerWidth=videoPlayer.clientWidth,desktopHeight=videoWrapper.clientHeight;if(videoWidth/videoOptions.ratio<desktopHeight){playerWidth=Math.ceil(desktopHeight*videoOptions.ratio);var styles="width: "+playerWidth+"px; height: "+desktopHeight+"px; left: "+(videoWidth-playerWidth)/2+"px; top: 0;";videoPlayer.style.cssText=styles}else{desktopHeight=Math.ceil(videoWidth/videoOptions.ratio);var styles2="width: "+videoWidth+"px; height: "+desktopHeight+"px; top: "+(desktopHeight-desktopHeight)/2+"px; left: 0;";videoPlayer.style.cssText=styles2}theme.Helpers.prepareTransition(videoPlayer),videoWrapper.classList.add(classes.loaded)}}function unsetBackgroundVideo(playerId){var player=document.getElementById(playerId);player.classList.remove(classes.backgroundVideo),setTimeout(function(){document.getElementById(playerId).style.cssText=null},600),videos[playerId].videoWrapper.classList.remove(classes.backgroundVideoWrapper),videos[playerId].videoWrapper.classList.add(classes.playing),videos[playerId].status="open"}function setBackgroundVideo(playerId){var player=document.getElementById(playerId);player.classList.add(classes.backgroundVideo),videos[playerId].videoWrapper.classList.add(classes.backgroundVideoWrapper),videos[playerId].status="background",sizeBackgroundVideo(player)}var handleWindowResize=theme.Helpers.debounce(function(){if(youtubeLoaded){var key,fullscreen=window.innerHeight===screen.height;sizeBackgroundVideos(),setAutoplaySupport(!0);for(key in videos)videoPlayers[key].playVideo(),setAsPlaying(videos[key])}},200),handleWindowScroll=theme.Helpers.debounce(function(){if(youtubeLoaded){for(var key in videos)if(videos.hasOwnProperty(key)){var videoWrapper=videos[key].videoWrapper,condition=videoWrapper.getBoundingClientRect().top+window.pageYOffset+videoWrapper.offsetHeight*.75<window.pageYOffset||videoWrapper.getBoundingClientRect().top+window.pageYOffset+videoWrapper.offsetHeight*.25>window.pageYOffset+window.innerHeight;if(videoWrapper.classList.contains(classes.playing)){if(!condition)return;toggleExpandVideo(key,!1)}}}},50);function initEvents(){window.addEventListener("resize",handleWindowResize),window.addEventListener("scroll",handleWindowScroll)}function createPlayer(key){var args=Object.assign(videoOptions,videos[key]);args.playerVars.controls=args.controls,videoPlayers[key]=new YT.Player(key,args)}function removeEvents(){document.removeEventListener("keydown",handleVideoPlayerKeydown),window.removeEventListener("resize",handleWindowResize),window.removeEventListener("scroll",handleWindowScroll)}return{init,editorLoadVideo,loadVideos,playVideo:customPlayVideo,pauseVideo,removeEvents}})();function onYouTubeIframeAPIReady(){theme.Video.loadVideos(),document.querySelector(".product-main-video")&&document.dispatchEvent(new CustomEvent("youtubeAPIReady",{detail:{},bubbles:!0,cancelable:!0}))}theme.ProductVideo=(function(){var videos={},hosts={shopify:"shopify",external:"external"},selectors2={productMediaWrapper:"[data-product-single-media-wrapper]"},attributes={enableVideoLooping:"enable-video-looping",videoId:"video-id"};function init(videoContainer,sectionId){if(videoContainer){var videoElement=videoContainer.querySelector("iframe, video");if(videoElement){var mediaId=videoContainer.getAttribute("data-media-id");videos[mediaId]={mediaId,sectionId,host:hostFromVideoElement(videoElement),container:videoContainer,element:videoElement,ready:function(){createPlayer(this)}}
6,window.Shopify.loadFeatures([{name:"video-ui",version:"2.0",onLoad:setupVideos}]),theme.LibraryLoader.load("plyrShopifyStyles")}}}function setupVideos(errors){if(errors){fallbackToNativeVideo();return}loadVideos()}function createPlayer(video){if(!video.player){var productMediaWrapper=video.container.closest(selectors2.productMediaWrapper),enableLooping=productMediaWrapper.getAttribute("data-"+attributes.enableVideoLooping);video.player=new Shopify.Video(video.element,{loop:{active:enableLooping}});var pauseVideo=function(){video.player&&video.player.pause()};productMediaWrapper.addEventListener("mediaHidden",pauseVideo),productMediaWrapper.addEventListener("xrLaunch",pauseVideo),productMediaWrapper.addEventListener("mediaVisible",function(){theme.Helpers.isTouch()||video.player&&video.player.play()})}}function hostFromVideoElement(video){return video.tagName==="VIDEO"?hosts.shopify:hosts.external}function loadVideos(){for(var key in videos)if(videos.hasOwnProperty(key)){var video=videos[key];video.ready()}}function fallbackToNativeVideo(){for(var key in videos)if(videos.hasOwnProperty(key)){var video=videos[key];if(video.nativeVideo)continue;video.host===hosts.shopify&&(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,hosts,loadVideos,removeSectionVideos}})(),theme.ProductModel=(function(){var modelJsonSections={},models={},xrButtons={},selectors2={mediaGroup:"[data-product-single-media-group]",xrButton:"[data-shopify-xr]"},_this=this;function init(modelViewerContainers,sectionId){modelJsonSections[sectionId]={loaded:!1},modelViewerContainers.forEach(function(modelViewerContainer,index){var mediaId=modelViewerContainer.getAttribute("data-media-id"),modelViewerElement=modelViewerContainer.querySelector("model-viewer");if(modelViewerElement){var modelId=modelViewerElement.getAttribute("data-model-id");if(index===0){var mediaGroup=modelViewerContainer.closest(selectors2.mediaGroup);if(mediaGroup){modelViewerElement.addEventListener("shopify_model_viewer_ui_toggle_play",function(){mediaGroup.dispatchEvent(new CustomEvent("model:played",{bubbles:!0}))}),modelViewerElement.addEventListener("shopify_model_viewer_ui_toggle_pause",function(){mediaGroup.dispatchEvent(new CustomEvent("model:paused",{bubbles:!0}))});var xrButton=mediaGroup.querySelector(selectors2.xrButton);xrButtons[sectionId]={element:xrButton,defaultId:modelId}}}models[mediaId]={modelId,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}]),theme.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=document.querySelector("#ModelJson-"+sectionId);window.ShopifyXR.addModels(JSON.parse(modelJson.innerHTML)),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.addEventListener("mediaVisible",function(){xrButton.element.setAttribute("data-shopify-model3d-id",model.modelId),!theme.Helpers.isTouch()&&model.modelViewerUi.play()}),model.container.addEventListener("mediaHidden",function(){xrButton.element.setAttribute("data-shopify-model3d-id",xrButton.defaultId),model.modelViewerUi.pause()}),model.container.addEventListener("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,removeSectionModels}})(),theme.FormStatus=(function(){var selectors2={statusMessage:"[data-form-status]"};
6function init(){var statusMessages=document.querySelectorAll(selectors2.statusMessage);statusMessages.forEach(function(statusMessage){statusMessage.setAttribute("tabindex",-1),statusMessage.focus(),statusMessage.addEventListener("blur",function(evt){evt.target.removeAttribute("tabindex")},{once:!0})})}return{init}})(),theme.Disclosure=(function(){var selectors2={disclosureForm:"[data-disclosure-form]",disclosureList:"[data-disclosure-list]",disclosureToggle:"[data-disclosure-toggle]",disclosureInput:"[data-disclosure-input]",disclosureOptions:"[data-disclosure-option]",disclosureClose:"[data-disclosure-close]"},classes={listVisible:"disclosure-list--visible"};function Disclosure(disclosure){this.container=disclosure,this._cacheSelectors(),this._setupListeners()}return Disclosure.prototype=Object.assign({},Disclosure.prototype,{_cacheSelectors:function(){this.cache={disclosureForm:this.container.closest(selectors2.disclosureForm),disclosureList:this.container.querySelector(selectors2.disclosureList),disclosureToggle:this.container.querySelector(selectors2.disclosureToggle),disclosureInput:this.container.querySelector(selectors2.disclosureInput),disclosureOptions:this.container.querySelectorAll(selectors2.disclosureOptions),disclosureClose:document.querySelector(selectors2.disclosureClose)}},_setupListeners:function(){this.eventHandlers=this._setupEventHandlers(),this.cache.disclosureToggle.addEventListener("click",this.eventHandlers.toggleList),this.cache.disclosureClose&&this.cache.disclosureClose.addEventListener("click",this.eventHandlers.toggleList),this.cache.disclosureOptions.forEach(function(disclosureOption){disclosureOption.addEventListener("click",this.eventHandlers.connectOptions)},this)},_setupEventHandlers:function(){return{connectOptions:this._connectOptions.bind(this),toggleList:this._toggleList.bind(this),onBodyClick:this._onBodyClick.bind(this),onDisclosureKeyUp:this._onDisclosureKeyUp.bind(this),onDisclosureListFocusOut:this._onDisclosureListFocusOut.bind(this),onDisclosureToggleFocusOut:this._onDisclosureToggleFocusOut.bind(this)}},_connectOptions:function(event){event.preventDefault(),this._submitForm(event.currentTarget.dataset.value)},_onDisclosureToggleFocusOut:function(event){var disclosureLostFocus=this.container.contains(event.relatedTarget)===!1;disclosureLostFocus&&this._hideList()},_onDisclosureListFocusOut:function(event){var childInFocus=event.currentTarget.contains(event.relatedTarget),isVisible=this.cache.disclosureList.classList.contains(classes.listVisible);isVisible&&!childInFocus&&this._hideList()},_onDisclosureKeyUp:function(event){event.which===slate.utils.keyboardKeys.ESCAPE&&(this._hideList(),this.cache.disclosureToggle.focus())},_onBodyClick:function(event){var isOption=this.container.contains(event.target),isVisible=this.cache.disclosureList.classList.contains(classes.listVisible);isVisible&&!isOption&&this._hideList()},_submitForm:function(value){this.cache.disclosureInput.value=value,this.cache.disclosureForm.submit()},_hideList:function(){this.cache.disclosureList.classList.remove(classes.listVisible),this.cache.disclosureToggle.setAttribute("aria-expanded",!1)},_toggleList:function(){var ariaExpanded=this.cache.disclosureToggle.getAttribute("aria-expanded")==="true";this.cache.disclosureList.classList.toggle(classes.listVisible),this.cache.disclosureToggle.setAttribute("aria-expanded",!ariaExpanded),document.querySelector(".mobile-nav-wrapper").classList.toggle("currency-dropdown-open")},destroy:function(){this.cache.disclosureToggle.removeEventListener("click",this.eventHandlers.toggleList),this.cache.disclosureOptions.forEach(function(disclosureOption){disclosureOption.removeEventListener("click",this.eventHandlers.connectOptions)},this),this.container.removeEventListener("keyup",this.eventHandlers.onDisclosureKeyUp),this.cache.disclosureList.removeEventListener("focusout",this.eventHandlers.onDisclosureListFocusOut),this.cache.disclosureToggle.removeEventListener("focusout",this.eventHandlers.onDisclosureToggleFocusOut),document.body.removeEventListener("click",this.eventHandlers.onBodyClick)}}),Disclosure})(),window.theme=theme||{},theme.customerTemplates=(function(){var selectors2={RecoverHeading:"#RecoverHeading",RecoverEmail:"#RecoverEmail",LoginHeading:"#LoginHeading"};function initEventListeners(){this.recoverHeading=document.querySelector(selectors2.RecoverHeading),this.recoverEmail=document.querySelector(selectors2.RecoverEmail),this.loginHeading=document.querySelector(selectors2.LoginHeading);var recoverPassword=document.getElementById("RecoverPassword"),hideRecoverPasswordLink=document.getElementById("HideRecoverPasswordLink");recoverPassword&&recoverPassword.addEventListener("click",function(evt){evt.preventDefault(),showRecoverPasswordForm(),this.recoverHeading.setAttribute("tabindex","-1"),this.recoverHeading.focus()}.bind(this)),hideRecoverPasswordLink&&hideRecoverPasswordLink.addEventListener("click",function(evt){evt.preventDefault(),hideRecoverPasswordForm(),this.loginHeading.setAttribute("tabindex","-1"),this.loginHeading.focus()}.bind(this)),this.recoverHeading&&this.recoverHeading.addEventListener("blur",function(evt){evt.target.removeAttribute("tabindex")}),this.loginHeading&&this.loginHeading.addEventListener("blur",function(evt){evt.target.removeAttribute("tabindex")})}function showRecoverPasswordForm(){document.getElementById("RecoverPasswordForm").classList.remove("hide"),document.getElementById("CustomerLoginForm").classList.add("hide"),this.recoverEmail.getAttribute("aria-invalid")==="true"&&this.recoverEmail.focus()}function hideRecoverPasswordForm(){document.getElementById("RecoverPasswordForm").classList.add("hide"),document.getElementById("CustomerLoginForm").classList.remove("hide")}function resetPasswordSuccess(){var formState=document.querySelector(".reset-password-success");if(formState){var resetSuccess=document.getElementById("ResetSuccess");resetSuccess.classList.remove("hide"),resetSuccess.focus()}}function customerAddressForm(){var newAddressForm=document.getElementById("AddressNewForm"),newAddressFormButton=document.getElementById("AddressNewButton");newAddressForm&&(Shopify&&new Shopify.CountryProvinceSelector("AddressCountryNew","AddressProvinceNew",{hideElement:"AddressProvinceContainerNew"}),document.querySelectorAll(".address-country-option").forEach(function(option){var formId=option.dataset.formId,countrySelector="AddressCountry_"+formId,provinceSelector="AddressProvince_"+formId,containerSelector="AddressProvinceContainer_"+formId;new Shopify.CountryProvinceSelector(countrySelector,provinceSelector,{hideElement:containerSelector})}),document.querySelectorAll(".address-new-toggle").forEach(function(button){button.addEventListener("click",function(){var isExpanded=newAddressFormButton.getAttribute("aria-expanded")==="true";newAddressForm.classList.toggle("hide"),newAddressFormButton.setAttribute("aria-expanded",!isExpanded),newAddressFormButton.focus()})}),document.querySelectorAll(".address-edit-toggle").forEach(function(button){button.addEventListener("click",function(evt){var formId=evt.target.dataset.formId,editButton=document.getElementById("EditFormButton_"+formId),editAddress=document.getElementById("EditAddress_"+formId),isExpanded=editButton.getAttribute("aria-expanded")==="true";editAddress.classList.toggle("hide"),editButton.setAttribute("aria-expanded",!isExpanded),editButton.focus()})}),document.querySelectorAll(".address-delete").forEach(function(button){button.addEventListener("click",function(evt){var target=evt.target.dataset.target,confirmMessage=evt.target.dataset.confirmMessage;confirm(confirmMessage||"Are you sure you wish to delete this address?")&&Shopify.postLink(target,{parameters:{_method:"delete"}})})}))}function checkUrlHash(){var hash=window.location.hash;
6hash==="#recover"&&showRecoverPasswordForm.bind(this)()}return{init:function(){initEventListeners(),checkUrlHash(),resetPasswordSuccess(),customerAddressForm()}}})(),window.theme=window.theme||{},theme.Cart=(function(){var selectors2={cartErrorMessage:"[data-cart-error-message]",cartErrorMessageWrapper:"[data-cart-error-message-wrapper]"},classes={cartNoCookies:"cart--no-cookies",hide:"hide",inputError:"input--error"},_this;function Cart(container){_this=this,this.container=container,this.options=JSON.parse(this.container.getAttribute("data-section-settings")),this.itemCount=this.options.itemCount,this.totalPrice=this.options.totalPrice,this.delegateElement=new Delegate(this.container),this._onNoteChange=this._onNoteChange.bind(this),theme.Helpers.cookiesEnabled()||this.container.classList.add(classes.cartNoCookies),this.container.addEventListener("change",this._onNoteChange),document.addEventListener("cart:rerender",this._rerenderCart.bind(this)),this.delegateElement.on("click",'[data-action="update-item-quantity"]:not(.Button_disabled), [data-action="remove-item"]',this._updateItemQuantity.bind(this)),this.delegateElement.on("change",".QuantitySelector__CurrentQuantity",this._updateItemQuantity.bind(this)),this.delegateElement.on("click",'[data-action="close-drawer"][data-drawer-id="'+this.container.id+'"]',this._closeModal),document.addEventListener("click",function(e){let el=e.target;if(!el.classList.contains("Cart-Drawer")&&!el.closest(".Cart-Drawer")&&!el.closest("#HeaderCart")&&!el.closest("#shopify-section-password-free-login-popup")){var Drawer=document.querySelector("#sidebar-cart");Drawer&&Drawer.classList.contains("show")&&(Drawer.classList.remove("show"),document.querySelector("body").classList.remove("show_overlay"))}});var checkboxStatus="",cartSubmitElement=this.container.querySelector(".cart__submit_temp_btn"),formElement=this.container.querySelector("form.Cart")||document.querySelector("form.Cart");this._getItemCheckboxes=function(formEl){return formEl?formEl.querySelectorAll(".cartItem__checkbox:not(.cartItem__checkbox--select-all)"):[]},this._getUniqueItemCheckboxes=function(formEl){var unique=[],seen={};return this._getItemCheckboxes(formEl).forEach(function(elem){var lineId=elem.getAttribute("data-line-id");!lineId||seen[lineId]||(seen[lineId]=!0,unique.push(elem))}),unique},this._syncLineItemCheckboxes=function(formEl,lineId,checked){!formEl||!lineId||formEl.querySelectorAll('.cartItem__checkbox:not(.cartItem__checkbox--select-all)[data-line-id="'+lineId+'"] input').forEach(function(cb){cb.checked!==checked&&(cb.checked=checked)})},this._updateSelectAllState=function(formEl){if(formEl){var selectAllInput=formEl.querySelector(".cartItem__select-all-input");if(selectAllInput){var uniqueCheckboxes=this._getUniqueItemCheckboxes(formEl),total=uniqueCheckboxes.length,checkedCount=0;uniqueCheckboxes.forEach(function(elem){var input=elem.querySelector("input");input&&input.checked&&checkedCount++}),selectAllInput.indeterminate=checkedCount>0&&checkedCount<total,selectAllInput.checked=total>0&&checkedCount===total}}},this._recalculateSelectedSubtotal=function(formEl){if(formEl){var subtotalElem=this.container.querySelector(".subtotal-row-wrapper .cart-subtotal-row")||this.container.querySelector(".cart-subtotal-row--drawer")||this.container.querySelector(".cart-subtotal-row[data-price]")||this.container.querySelector(".subtotal-top-row.cart-subtotal-row")||document.querySelector(".subtotal-row-wrapper .cart-subtotal-row")||document.querySelector(".subtotal-top-row.cart-subtotal-row");if(subtotalElem){var totalPrice=0,totalDiscount=0,priceFormat=theme.priceCurrencyCodeEnable?theme.moneyFormatWithCurrency:theme.moneyFormat;this._getUniqueItemCheckboxes(formEl).forEach(function(elem){var input=elem.querySelector("input");if(!(!input||!input.checked)){var quantity=parseInt(elem.getAttribute("data-quantity"),10)||0,itemPrice=parseInt(elem.getAttribute("data-price"),10)||0,comparePrice=parseInt(elem.getAttribute("data-compare-price"),10)||0;totalPrice+=itemPrice*quantity,totalDiscount+=comparePrice*quantity}}),subtotalElem.setAttribute("data-price",totalPrice),subtotalElem.setAttribute("data-saving",totalDiscount);var cartSubtotalEls=this.container.querySelectorAll("[data-cart-subtotal]");cartSubtotalEls.length||(cartSubtotalEls=document.querySelectorAll(".PageContent [data-cart-subtotal], .cart
6-subtotal-row--drawer [data-cart-subtotal]")),cartSubtotalEls.forEach(function(cartSubtotalEl){cartSubtotalEl.innerHTML=theme.Currency.formatMoney(totalPrice,priceFormat)}),this.container.querySelectorAll(".cart-subtotal-row").forEach(function(row){row.setAttribute("data-price",totalPrice),row.setAttribute("data-saving",totalDiscount);var discountEl=row.querySelector(".line-items-discount");if(discountEl){discountEl.innerHTML="-"+theme.Currency.formatMoney(totalDiscount,theme.moneyFormat).replace(".00",""),discountEl.style.display=totalDiscount==0?"none":"block";var discountLine=discountEl.closest(".discount-line");discountLine&&(discountLine.style.display=totalDiscount==0?"none":"")}var compareEl=row.querySelector("[data-cart-subtotal-compare]");compareEl&&(totalDiscount>0?(compareEl.innerHTML=theme.Currency.formatMoney(totalPrice+totalDiscount,theme.moneyFormat).replace(".00","").replace(",",""),compareEl.style.display=""):compareEl.style.display="none")})}}},formElement&&(this._getUniqueItemCheckboxes(formElement).forEach(function(elem){checkboxStatus=checkboxStatus+elem.getAttribute("data-line-id")+"=1&"}),localStorage.setItem("checkboxStatus",checkboxStatus),this._updateSelectAllState(formElement)),this.delegateElement.on("change",".cartItem__checkbox:not(.cartItem__checkbox--select-all) input",function(inputElem){var formElement2=inputElem.target.closest("form.Cart")||_this.container.querySelector("form.Cart")||document.querySelector("form.Cart"),lineId=inputElem.target.parentElement.getAttribute("data-line-id"),checked=inputElem.target.checked;formElement2&&_this._syncLineItemCheckboxes(formElement2,lineId,checked),_this._recalculateSelectedSubtotal(formElement2);var checkboxStatus2="";formElement2&&(_this._getUniqueItemCheckboxes(formElement2).forEach(function(elem){elem.querySelector("input").checked||(checkboxStatus2=checkboxStatus2+elem.getAttribute("data-line-id")+"=0&")}),localStorage.setItem("checkboxStatus",checkboxStatus2),_this._updateSelectAllState(formElement2))}),this.delegateElement.on("change",".cartItem__select-all-input",function(inputElem){var formElement2=inputElem.target.closest("form.Cart")||_this.container.querySelector("form.Cart");if(formElement2){var checked=inputElem.target.checked;inputElem.target.indeterminate=!1,formElement2.querySelectorAll(".cartItem__checkbox:not(.cartItem__checkbox--select-all) input").forEach(function(cb){cb.checked=checked}),_this._recalculateSelectedSubtotal(formElement2);var checkboxStatus2="";_this._getUniqueItemCheckboxes(formElement2).forEach(function(elem){elem.querySelector("input").checked||(checkboxStatus2=checkboxStatus2+elem.getAttribute("data-line-id")+"=0&")}),localStorage.setItem("checkboxStatus",checkboxStatus2),_this._updateSelectAllState(formElement2)}}),cartSubmitElement&&this.delegateElement.on("click",".cart__submit_temp_btn",function(e){e.preventDefault(),e.stopImmediatePropagation();var formElement2=e.target.closest("form.Cart")||_this.container.querySelector("form.Cart")||document.querySelector("form.Cart"),checkoutBtn=_this.container.querySelector(".cart__checkout__btn")||document.querySelector(".cart__checkout__btn"),checkoutProduct=!1,allChecked=!0,cartItems="",removeItems="",checkoutProductCount=0;if(formElement2&&_this._getUniqueItemCheckboxes(formElement2).forEach(function(elem){elem.querySelector("input").checked?checkoutProduct=!0:(allChecked=!1,checkoutProductCount=parseInt(checkoutProductCount)+1,cartItems==""?(cartItems="updates["+elem.getAttribute("data-variant-id")+"]="+elem.getAttribute("data-quantity"),removeItems="updates["+elem.getAttribute("data-variant-id")+"]=0"):(cartItems=cartItems+"&updates["+elem.getAttribute("data-variant-id")+"]="+elem.getAttribute("data-quantity"),removeItems=removeItems+"&updates["+elem.getAttribute("data-variant-id")+"]=0"))}),Object.keys(cartItems).length===0||localStorage.setItem("cartItems",cartItems),checkoutProduct){if(allChecked){checkoutBtn&&checkoutBtn.click();return}var tempCount=0;fetch("/cart/update.js",{body:removeItems,credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(cart){cart.json().then(function(content){checkoutBtn&&checkoutBtn.click()})})}else alert("Please select atleast one item to checkout")});var getCartItems=localStorage.getItem("cartItems");if(getCartItems&&fetch("/cart/update.js",{body:getCartItems,credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(cart){localStorage.removeItem("cartItems"),window.location.reload()}),this.options.hasShippingEstimator){_this.countrySelect=this.container.querySelector('[name="country"]'),_this.provinceSelect=this.container.querySelector('[name="province"]');var defaultCountry=_this.countrySelect.getAttribute("data-default");if(defaultCountry){for(var i2=0;i2!==_this.countrySelect.options.length;++i2)if(_this.countrySelect.options[i2].text===defaultCountry){_this.countrySelect.selectedIndex=i2;break}}else _this.countrySelect.selectedIndex=0;this._onCountryChangedListener=this._onCountryChanged.bind(this),this.countrySelect.addEventListener("change",this._onCountryChangedListener);var event=new Event("change",{bubbles:!0});_this.countrySelect.dispatchEvent(event);var defaultProvince=_this.provinceSelect.getAttribute("data-default");defaultProvince&&(_this.provinceSelect.value=defaultProvince),this.delegateElement.on("click",".ShippingEstimator__Submit",this._fetchRates.bind(this))}var CartSpecialInstructionsSubmit=this.container.querySelector(".CartSpecialInstructionsSubmit");CartSpecialInstructionsSubmit&&CartSpecialInstructionsSubmit.addEventListener("click",function(e){e.preventDefault();var noteField=this.closest("form").querySelector("#CartSpecialInstructions");
6if(noteField){var note=noteField.value,headers=new Headers({"Content-Type":"application/json"}),request={method:"POST",headers,body:JSON.stringify({note})};fetch("/cart/update.js",request).then(function(response){response.status==200&&(CartSpecialInstructionsSubmit.innerHTML=theme.strings.added_note,setTimeout(function(){CartSpecialInstructionsSubmit.innerHTML=theme.strings.add_note},2e3))}).catch(function(){_this._showCartError(noteField)}.bind(this))}})}return Cart.prototype=Object.assign({},Cart.prototype,{_onCountryChanged:function(){var selectedOption=_this.countrySelect.options[_this.countrySelect.selectedIndex],provinces=JSON.parse(selectedOption.getAttribute("data-provinces")||"[]");if(_this.provinceSelect.innerHTML="",provinces.length===0){_this.provinceSelect.parentNode.style.display="none";return}provinces.forEach(function(data){_this.provinceSelect.options.add(new Option(data[1],data[0]))}),_this.provinceSelect.parentNode.style.display="block"},_fetchRates:function(){var country=_this.container.querySelector('[name="country"]').value,province=_this.container.querySelector('[name="province"]').value,city=_this.container.querySelector('[name="city"]').value,zip=_this.container.querySelector('[name="zip"]').value;fetch(window.routes.cartUrl+"/shipping_rates.json?shipping_address[zip]="+zip+"&shipping_address[country]="+country+"&shipping_address[province]="+province,{credentials:"same-origin",method:"GET"}).then(function(response){response.json().then(function(result){var resultsContainer=_this.container.querySelector(".ShippingEstimator__Results"),ShippingEstimatorParentRow=_this.container.querySelector(".ShippingEstimator"),errorContainer=_this.container.querySelector(".ShippingEstimator__Error");if(response.ok){var shippingRates=result.shipping_rates;if(shippingRates.length===0)resultsContainer.innerHTML="<p>"+theme.strings.shippingEstimatorNoResults+"</p>";else{var html="<ul>";shippingRates.forEach(function(item){html+='<li class="h6"><span class="title ">'+item.name+':</span><span class="shipping_price">'+theme.Currency.formatMoney(item.price,theme.moneyFormat)+"</span></li>"}),html+="</ul>";var address_city=city;address_city.length==0&&(address_city=province),html+='<p class="Shipping_to_address h6">'+theme.strings.shippingTo+" "+address_city+"</p>",resultsContainer.firstElementChild.innerHTML=html}errorContainer.style.display="none",resultsContainer.style.display="block",ShippingEstimatorParentRow.classList.remove("hide")}else{var errorHtml="";Object.keys(result).forEach(function(key){errorHtml+='<li class="Alert__ErrorItem">'+key+" "+result[key]+"</li>"}),errorContainer.innerHTML='<ul class="Alert__ErrorList">'+errorHtml+"</ul>",resultsContainer.style.display="none",errorContainer.style.display="block",ShippingEstimatorParentRow.classList.remove("hide")}})})},_sidebarDrawerOpen:function(){var Drawer=document.querySelector("#sidebar-cart");Drawer&&(Drawer.classList.contains("show")||(Drawer.classList.add("show"),document.querySelector("body").classList.add("show_overlay"),Drawer.addEventListener("transitionend",()=>{Drawer.focus(),slate.a11y.trapFocus({container:Drawer,elementToFocus:Drawer})},{once:!0})))},_onProductAdded:function(){var quick_view_modal=document.querySelector('#modal-quick-view[aria-hidden="false"]');quick_view_modal&&quick_view_modal.querySelector(".close-quick-view").dispatchEvent(new Event("click",{bubbles:!0}));var corporate_atc_modal=document.querySelector('#corporate-atc-modal[aria-hidden="false"]');corporate_atc_modal&&corporate_atc_modal.querySelector(".close-corporate-modal").dispatchEvent(new Event("click",{bubbles:!0})),_this.options.type=="drawer"?_this._rerenderCart().then(function(){document.querySelector("[data-best-buy-pick-up]")||_this._sidebarDrawerOpen(),theme.show_citi_msg&&ChargeAfter&&ChargeAfter.promotions.update()}):window.location.href=window.routes.cartUrl},_closeModal:function(){var Drawer=this.closest(".Drawer");Drawer&&(Drawer.classList.remove("show"),document.querySelector("body").classList.remove("show_overlay"))},_updateItemQuantity:function(event,target){var quantity=null,inventory_qty=null,inventory_management="";target.tagName==="INPUT"?quantity=parseInt(target.value):quantity=parseInt(target.getAttribute("data-quantity")),inventory_management=target.getAttribute("data-inventory_management"),inventory_qty=parseInt(target.getAttribute("data-inventory_qty"));var isDiscountProductFound=!1;if(target.closest(".Cart__ItemList").querySelectorAll(".CartItem").forEach(function(){window.discountSettings.variantsList.indexOf(target.getAttribute("data-variant-id"))>-1&&(isDiscountProductFound=!0)}),quantity>inventory_qty&&inventory_management!=""){var parentEl=target.closest(".CartItem");if(parentEl){var qtyErrorEls=parentEl.querySelectorAll(".QuantitySelector__error-message");
6qtyErrorEls.length&&qtyErrorEls.forEach(function(qtyErrorEl,index){qtyErrorEl.classList.remove("hide")})}}else fetch(window.routes.cartChangeUrl+".js",{body:JSON.stringify({id:target.getAttribute("data-line-id"),quantity}),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(cart){cart.json().then(async function(content){_this.itemCount=content.item_count,_this.totalPrice=content.totalPrice;var cartTotal=content.total_price,json=[];if(quantity===0&&window.removeDiyAccessoriesOnCartRemove){var tagContainer=target.closest("[data-product-tags]");tagContainer&&await window.removeDiyAccessoriesOnCartRemove(tagContainer.getAttribute("data-product-tags"))}window.discountSettings.enable&&!window.discountSettings.isGiftpresent&&quantity!=0&&isDiscountProductFound&&cartTotal>=window.discountSettings.minimumCartAmount&&(json.push({id:window.discountSettings.giftProduct,quantity:1,properties:{_isGift:"Yes"}}),window.discountSettings.isGiftpresent=!0,window.discountSettings.cartTotal=cartTotal),(window.enablePromotionsUsingCode||window.autoPromotionsEnable)&&(window.cart_clear=!1,window.promotionValidate(json)),theme.show_citi_msg&&ChargeAfter&&ChargeAfter.promotions.update(),document.querySelector(".bf_sticky_bar")&&(document.querySelectorAll(".bf_sticky_bar .custom-sticky-bar-inner").forEach(function(parentElem2){parentElem2.querySelectorAll(".bar-content").forEach(function(elem){var from_price=elem.getAttribute("data-from-price"),to_price=elem.getAttribute("data-to-price");if(cartTotal>=from_price&&cartTotal<=to_price){parentElem2.querySelector(".bar-content.active").classList.remove("active");let remainingAmount=theme.Currency.formatMoney(to_price-cartTotal,theme.moneyFormat);elem.querySelector(".remaining-amount")&&(elem.querySelector(".remaining-amount").innerText=remainingAmount),elem.classList.add("active")}})}),document.querySelector("body").style.setProperty("--bf-bar-height",document.querySelector(".bf_sticky_bar").offsetHeight+"px"))})});return event.preventDefault(),!1},_rerenderCart:function(){return window._rkUnloadPage("ajax_cart"),_this.options=JSON.parse(_this.container.getAttribute("data-section-settings")),fetch(window.routes.cartUrl+"?view="+(this.options.drawer&&window.theme.pageType!=="cart"?"drawer":"ajax")+"&timestamp="+Date.now(),{credentials:"same-origin",method:"GET"}).then(function(content){content.text().then(async function(html){if(_this._replaceContent(html),window.location.pathname!==window.routes.cartUrl){var isEcoCreditMsgEnabledInCartDrawer=document.querySelector("#sidebar-cart").getAttribute("data-enabled-ecocredit-msg");if(window.location.pathname!==window.routes.cartUrl&&JSON.parse(isEcoCreditMsgEnabledInCartDrawer)){const cartDrawerEcoCreditMsg=document.querySelector(".cart-drawer-ecocredits-msg__container"),cartDrawerEcoCreditPoints=document.querySelector(".cart-drawer-ecocredits-msg__points");if(cartDrawerEcoCreditMsg){const customerId=cartDrawerEcoCreditMsg.getAttribute("data-customer-id");try{const productList=(await(await fetch(`${window.routes.cartUrl}.js`,{credentials:"same-origin",method:"GET"})).json()).items.map(item=>({productId:`${item.product_id}`,variantId:`${item.variant_id}`,quantity:item.quantity,price:`${item.price/100}`})),{apiDomain,acceptedLanguage,xAppid}=theme.emailSubscription,pointsData=await(await fetch(`${apiDomain}/integral/web/pointsCashRule/getRule`,{method:"POST",headers:{"Content-Type":"application/json","x-appid":xAppid,traceId:generateTraceId(),"Accept-Language":acceptedLanguage},body:JSON.stringify({productList,source:"CART",...customerId&&{customerId:Number(customerId)}})})).json();pointsData&&pointsData.code==="0"&&pointsData.data&&pointsData.data.maxPoints&&(cartDrawerEcoCreditMsg.style.display="block",cartDrawerEcoCreditPoints.innerText="$"+Number(pointsData.data.maxPoints*pointsData.data.ratio).toFixed(2).toLocaleString())}catch(error2){cartDrawerEcoCreditMsg.style.display="none",console.error(error2.message)}}}}if(handleCartDiscountBar(),_this.options.hasShippingEstimator){_this.countrySelect=_this.container.querySelector('[name="country"]'),_this.provinceSelect=_this.container.querySelector('[name="province"]');var defaultCountry=_this.countrySelect.getAttribute("data-default");if(defaultCountry){for(var i2=0;i2!==_this.countrySelect.options.length;++i2)if(_this.countrySelect.options[i2].text===defaultCountry){_this.countrySelect.selectedIndex=i2;break}}else _this.countrySelect.selectedIndex=0;_this._onCountryChangedListener=_this._onCountryChanged.bind(this),_this.countrySelect.addEventListener("change",_this._onCountryChangedListener);var event=new Event("change",{bubbles:!0});_this.countrySelect.dispatchEvent(event);var defaultProvince=_this.provinceSelect.getAttribute("data-default");defaultProvince&&(_this.provinceSelect.value=defaultProvince)}var CartSpecialInstructionsSubmit=_this.container.querySelector(".CartSpecialInstructionsSubmit");CartSpecialInstructionsSubmit&&CartSpecialInstructionsSubmit.addEventListener("click",function(e){e.preventDefault();var noteField=this.closest("form").querySelector("#CartSpecialInstructions");
6if(noteField){var note=noteField.value,headers=new Headers({"Content-Type":"application/json"}),request={method:"POST",headers,body:JSON.stringify({note})};fetch("/cart/update.js",request).then(function(response){response.status==200&&(CartSpecialInstructionsSubmit.innerHTML=theme.strings.added_note,setTimeout(function(){CartSpecialInstructionsSubmit.innerHTML=theme.strings.add_note},2e3))}).catch(function(){_this._showCartError(noteField)}.bind(this))}})})})},_replaceContent:function(html){var tempElement=document.createElement("div");tempElement.innerHTML=html;var cartNodeParent=this.container.querySelector(".Cart").parentNode,cartElem=this.container.querySelector(".Cart");if(this.options.drawer&&window.theme.pageType!=="cart"){var currentScrollPosition=this.container.querySelector(".Drawer__Main").scrollTop;cartNodeParent.replaceChild(tempElement.querySelector(".Cart"),this.container.querySelector(".Cart")),this.container.querySelector(".Drawer__Main").scrollTop=currentScrollPosition;var checkboxStatusDrawer=localStorage.getItem("checkboxStatus"),drawerForm=this.container.querySelector("form.Cart");drawerForm&&checkboxStatusDrawer&&drawerForm.querySelectorAll(".cartItem__checkbox:not(.cartItem__checkbox--select-all)").forEach(function(elem){var line_id=elem.getAttribute("data-line-id"),strIndex=parseInt(checkboxStatusDrawer.indexOf(line_id));if(strIndex>=0){var newIndex=strIndex+parseInt(line_id.length)+parseInt(1),status=checkboxStatusDrawer.substring(newIndex);if(status.split("&")[0]==0){var input=elem.querySelector("input");input&&input.checked&&(input.checked=!1)}}}),drawerForm&&this._updateSelectAllState&&this._updateSelectAllState(drawerForm),drawerForm&&this._recalculateSelectedSubtotal&&this._recalculateSelectedSubtotal(drawerForm)}else if(this.itemCount===0)this.container.innerHTML=tempElement.querySelector(".cart-page-width").innerHTML;else{cartElem.replaceChild(tempElement.querySelector(".Cart_ContentSide"),this.container.querySelector(".Cart_ContentSide")),cartElem.querySelector(".cart_sidebar_first_block").innerHTML=tempElement.querySelector(".cart_sidebar_first_block").innerHTML;var checkboxStatus=localStorage.getItem("checkboxStatus");cartNodeParent.querySelectorAll(".cartItem__checkbox:not(.cartItem__checkbox--select-all)").forEach(function(elem){var line_id=elem.getAttribute("data-line-id"),strIndex=parseInt(checkboxStatus.indexOf(line_id));if(strIndex>=0){var newIndex=strIndex+parseInt(line_id.length)+parseInt(1),status=checkboxStatus.substring(newIndex);if(status.split("&")[0]==0){var input=elem.querySelector("input");input&&input.checked&&(input.checked=!1)}}});var cartPageForm=this.container.querySelector("form.Cart");cartPageForm&&this._updateSelectAllState&&this._updateSelectAllState(cartPageForm),cartPageForm&&this._recalculateSelectedSubtotal&&this._recalculateSelectedSubtotal(cartPageForm)}window.theme.pageType==="cart"&&handleCartDiscountBar(),window._rkLoadPage("ajax_cart"),affirm.ui.refresh();var cartResult=JSON.parse(tempElement.querySelector('[data-section-type="cart-template"]').getAttribute("data-section-settings")),header__CartCount=document.querySelector(".header_cart_count"),header_total_priceEl=document.querySelector(".cart_total_price");this.itemCount=cartResult.itemCount,this.totalPrice=cartResult.totalPrice,this.excludedIdsTotalPrice=cartResult.excludedIdsTotalPrice,header__CartCount&&(header__CartCount.textContent=this.itemCount,this.itemCount>0?header__CartCount.classList.remove("hide"):header__CartCount.classList.add("hide")),header_total_priceEl&&(header_total_priceEl.textContent=theme.Currency.formatMoney(this.totalPrice,theme.moneyFormat)),cartResult.itemCount==0&&(window.discountSettings.isGiftpresent=!1,window.discountSettings.cartTotal=0),updatePromotionMessage(this.excludedIdsTotalPrice),updatePromotionMessageAlter(cartResult.totalPrice)},_onNoteChange:function(evt){if(evt.target.hasAttribute("data-cart-notes")){var note=evt.target.value;this._hideCartError();var headers=new Headers({"Content-Type":"application/json"}),request={method:"POST",headers,body:JSON.stringify({note})};fetch("/cart/update.js",request).catch(function(){this._showCartError(evt.target)}.bind(this))}},_showCartError:function(elementToFocus){document.querySelector(selectors2.cartErrorMessage).textContent=theme.strings.cartError,document.querySelector(selectors2.cartErrorMessageWrapper).classList.remove(classes.hide),elementToFocus&&elementToFocus.focus()},_hideCartError:function(){document.querySelector(selectors2.cartErrorMessageWrapper).classList.add(classes.hide),document.querySelector(selectors2.cartErrorMessage).textContent=""}}),Cart})(),window.theme=window.theme||{},theme.HeaderSection=(function(){function Header(){theme.Header.init(),theme.MobileNav.init()}return Header.prototype=Object.assign({},Header.prototype,{onUnload:function(){theme.Header.unload(),theme.MobileNav.unload()}}),Header})(),theme.AnnouncementBar=(function(){function AnnouncementBar(container){var _this=this;if(this.container=container,this.AnnouncementBar__Slider=this.container.querySelector(".AnnouncementBar__Slider"),this.AnnouncementBar__close_button=this.container.querySelector(".AnnouncementBar__close_button"),this.AnnouncementBar__Slider){let slideHeight
6Calculate2=function(){var maxSlideHeight=0,slidesLength=_this.AnnouncementBar__Slider.querySelectorAll(".AnnouncementBar__Content").length;slidesLength>1&&setTimeout(function(){document.documentElement.style.setProperty("--announcement-bar-height",document.getElementById("shopify-section-announcement-bar").offsetHeight+"px")},500)};var slideHeightCalculate=slideHeightCalculate2;this.options=JSON.parse(this.AnnouncementBar__Slider.getAttribute("data-flickity-config")),window.addEventListener("resize",slideHeightCalculate2),slideHeightCalculate2(),this.flickityInstance=new Flickity(this.AnnouncementBar__Slider,this.options),setTimeout(function(){document.documentElement.style.setProperty("--announcement-bar-height",document.getElementById("shopify-section-announcement-bar").offsetHeight+"px")},500)}this.AnnouncementBar__close_button&&this.AnnouncementBar__close_button.addEventListener("click",function(e){e.preventDefault();var parentSection=this.closest('[data-section-type="announcement-bar"]');parentSection.style.display="none",document.documentElement.style.setProperty("--announcement-bar-height",0)})}return AnnouncementBar})(),theme.LogoBar=(function(){function LogoBar(container){this.container=container;var self2=this;if(this.LogoBar__Slider=this.container.querySelector(".logo-bar--slider"),this.LogoBar__Slider){this.options=JSON.parse(this.LogoBar__Slider.getAttribute("data-flickity-config")),this.flickityInstance=new Flickity(this.LogoBar__Slider,this.options);var slider_custom_arrows=container.querySelector(".slider_custom_arrows");if(slider_custom_arrows){var slider_custom_btns=slider_custom_arrows.querySelectorAll(".btn");slider_custom_btns.forEach(function(item,index){item.addEventListener("click",function(e){e.preventDefault();var isNext=item.classList.contains("button-next");isNext?self2.flickityInstance.next():self2.flickityInstance.previous()})})}}}return LogoBar})(),theme.HomepageAccordion=(function(){function HomepageAccordion(container){var _this=this;if(_this.container=container,_this.accordion=_this.container.querySelector(".homepage_accordion"),_this.accordion){var questions_arr=_this.accordion.querySelectorAll(".question"),maxHeightAnswerBlock=0,sectionDefaultHeight=this.container.offsetHeight,sectionHeight=this.container.closest(".shopify-section").offsetHeight,answer_arr=_this.accordion.querySelectorAll(".answer");answer_arr.length&&answer_arr.forEach(function(item,index){item.classList.add("active");var blockHeight=item.offsetHeight;blockHeight>maxHeightAnswerBlock&&(maxHeightAnswerBlock=blockHeight),item.classList.remove("active")}),sectionHeight+=maxHeightAnswerBlock,_this.container.style.minHeight=sectionHeight+"px",questions_arr.length&&questions_arr.forEach(function(item,index){item.addEventListener("click",function(e){e.preventDefault();var self2=this,answer_block=this.closest(".homepage_accordion__block").querySelector(".answer"),block_id=self2.getAttribute("data-id"),current_active_block=_this.accordion.querySelector(".question.active"),current_answer_active_block=_this.accordion.querySelector(".answer.active"),delay=0;if(current_active_block){var current_block_id=current_active_block.getAttribute("data-id");current_block_id!=block_id&&(current_answer_active_block.style.height=current_answer_active_block.scrollHeight+"px",current_answer_active_block.offsetHeight,current_answer_active_block.style.height=0,current_answer_active_block.classList.remove("active"),current_active_block.classList.remove("active"))}if(answer_block.classList.contains("active"))answer_block.style.height="0px",answer_block.addEventListener("transitionend",function(){answer_block.classList.remove("active"),self2.classList.remove("active")},{once:!0});else{self2.classList.add("active"),answer_block.classList.add("active"),answer_block.style.height="auto";var height=answer_block.clientHeight+"px";answer_block.style.height="0px",setTimeout(function(){answer_block.style.height=height},delay)}})}),window.addEventListener("resize",theme.Helpers.debounce(function(e){var findActiveBlock=_this.container.querySelector(".answer.active");findActiveBlock&&(findActiveBlock.classList.remove("active"),findActiveBlock.style.height="0px"),_this.container.removeAttribute("style");var newSectionHeight=_this.container.closest(".shopify-section").offsetHeight,maxHeightAnswerBlock2=0;if(answer_arr.length&&answer_arr.forEach(function(item,index){item.classList.add("active"),item.removeAttribute("style");var blockHeight=item.offsetHeight;item.classList.remove("active"),blockHeight>maxHeightAnswerBlock2&&(maxHeightAnswerBlock2=blockHeight)}),findActiveBlock){findActiveBlock.classList.add("active"),findActiveBlock.style.height="auto";var height=findActiveBlock.clientHeight+"px";findActiveBlock.style.height="0px",setTimeout(function(){findActiveBlock.style.height=height},0)}newSectionHeight+=maxHeightAnswerBlock2,_this.container.style.minHeight=newSectionHeight+"px"}))}}return HomepageAccordion})(),theme.PageAccordion=(function(){function PageAccordion(container){var _this=this;if(_this.container=container,_this.accordion=_this.container.querySelector(".faq_accordion"),_this.accordion){var questions_arr=_this.accordion.querySelectorAll(".question");questions_arr.length&&questions_arr.forEach(function(item,index){item.addEventListener("click",function(e){e.preventDefault();var self2=this,answer_block=this.closest(".accordion__block").querySelector(".answer"),block_id=self2.getAttribute("data-id");if(answer_block.classList.contains("active"))answer_block.style.height="0px",answer_block.addEventListener("transitionend",function(){answer_block.classList.remove("active"),self2.classList.remove("active")},{once:!0});else{self2.classList.add("active"),answer_block.classList.add("active"),answer_block.style.height="auto";var height=answer_block.clientHeight+"px";answer_block.style.height="0px",setTimeout(function(){answer_block.style.height=height},0)}})})}}return PageAccordion})(),theme.MainSearchPage=(function(){function MainSearchPage(container){var _this=this,pagination_mode=container.getAttribute("data-pagination_mode");
6if(pagination_mode!="standart")var endlessScroll=new Ajaxinate({container:"#AjaxinateContainer",pagination:"#AjaxinatePagination",method:pagination_mode,offset:500});theme.ProductItemSwatches();var filter_titles=container.querySelectorAll(".category-filters-section-title");filter_titles.length&&filter_titles.forEach(function(item,index){var self2=item,parentArea=self2.closest(".category-filters-area-section"),filtersBlock=parentArea.querySelector(".category-filters-area-list");if(filtersBlock.classList.contains("active")){filtersBlock.style.height="auto";var height=filtersBlock.clientHeight+"px";filtersBlock.style.height=height}else filtersBlock.style.height="0px";item.addEventListener("click",function(e){e.preventDefault();var self3=this,parentArea2=self3.closest(".category-filters-area-section"),filtersBlock2=parentArea2.querySelector(".category-filters-area-list");if(filtersBlock2.classList.contains("active"))filtersBlock2.style.height="0px",self3.classList.remove("active"),filtersBlock2.classList.remove("active");else{self3.classList.add("active"),filtersBlock2.classList.add("active"),filtersBlock2.style.height="auto";var height2=filtersBlock2.clientHeight+"px";filtersBlock2.style.height="0px",setTimeout(function(){filtersBlock2.style.height=height2},0)}})});var show_more_options=container.querySelectorAll(".show_more_options");show_more_options.length&&(container.querySelectorAll(".advanced-filters").forEach(function(filter,index){var children_length=filter.querySelectorAll("li").length;if(children_length>5){for(var heigth_limit=0,i2=0;i2<filter.querySelectorAll("li").length;i2++){var item=filter.querySelectorAll("li")[i2];if(heigth_limit=heigth_limit+item.offsetHeight,i2==4)break}var show_more_option=filter.nextElementSibling;show_more_option&&(filter.setAttribute("data-heigth_limit",heigth_limit),filter.style.maxHeight=heigth_limit+"px",show_more_option.style.display="inline-block")}}),show_more_options.forEach(function(btn,index){btn.addEventListener("click",function(e){e.preventDefault();var filters_list=this.previousElementSibling,heigth_limit=filters_list.getAttribute("data-heigth_limit"),default_text=this.getAttribute("data-default-text");if(this.classList.contains("openedFilter"))filters_list.style.maxHeight=heigth_limit+"px",this.classList.remove("openedFilter"),this.innerHTML=default_text;else{for(var filterBlockLength=0,i2=0;i2<filters_list.querySelectorAll("li").length;i2++){var item=filters_list.querySelectorAll("li")[i2];filterBlockLength=filterBlockLength+item.offsetHeight}filters_list.style.maxHeight=filterBlockLength+"px",this.classList.add("openedFilter"),this.innerHTML=theme.strings.show_less}})}));var open_sidebar_btn=container.querySelector(".open_mobile_sidebar"),close_sidebar_btn=container.querySelector(".close-collection-sidebar");open_sidebar_btn&&open_sidebar_btn.addEventListener("click",function(e){e.preventDefault();var sidebarEl=container.querySelector(".collection-sidebar");sidebarEl&&(sidebarEl.classList.add("show"),document.querySelector("body").classList.add("show_overlay"))}),close_sidebar_btn&&close_sidebar_btn.addEventListener("click",function(e){e.preventDefault();var sidebarEl=container.querySelector(".collection-sidebar");sidebarEl&&(sidebarEl.classList.remove("show"),document.querySelector("body").classList.remove("show_overlay"))});var check_filter_value_btns=container.querySelectorAll(".advanced-filter a");check_filter_value_btns.length&&check_filter_value_btns.forEach(function(item,index){item.addEventListener("click",function(e){e.preventDefault();var parentFilterNode=this.closest(".advanced-filter"),filterInput=parentFilterNode.querySelector('[type="checkbox"]');filterInput&&(filterInput.checked?filterInput.checked=!1:filterInput.checked=!0);var FitersFormEl=item.closest("form");if(FitersFormEl){const formData=new FormData(FitersFormEl),searchParams=new URLSearchParams(formData).toString();var pathname=window.location.pathname;window.location.href=pathname+"?"+searchParams}else{var href=this.getAttribute("href"),pathname=window.location.pathname,search_url_size=window.location.search.length;search_url_size?window.location.href=href+window.location.search:window.location.href=href}})});var group__price_rangeBlocks=container.querySelectorAll(".filter-group-display__price-range-input");group__price_rangeBlocks.length&&document.addEventListener("change",function(e){let el=e.target;if(el.classList.contains("filter-group-display__price-range-input")){var FitersFormEl=el.closest("form");if(FitersFormEl){const formData=new FormData(FitersFormEl),searchParams=new URLSearchParams(formData).toString();var pathname=window.location.pathname;window.location.href=pathname+"?"+searchParams}}});var price_range_inputs=container.querySelectorAll(".price_range");price_range_inputs.length&&document.addEventListener("change",function(e){let el=e.target;if(el.classList.contains("price_range")){var FitersFormEl=el.closest("form");if(FitersFormEl){var prices_arr=[],price_range_inputs2=FitersFormEl.querySelectorAll(".filter-group-display__price-range-input"),price_range_container=el.closest(".price_range_container");if(price_range_container&&(price_range_container.querySelectorAll(".price_range").forEach(function(item,index){var input_val=item.value*1;prices_arr.push(input_val)}),price_range_inputs2.length)){var min=Math.min.apply(null,prices_arr),max=Math.max.apply(null,prices_arr);price_range_inputs2[0].value=min,price_range_inputs2[1].value=max}const formData=new FormData(FitersFormEl),searchParams=new URLSearchParams(formData).toString();var pathname=window.location.pathname;window.location.href=pathname+"?"+searchParams}}})}return MainSearchPage})(),theme.AdvancedSearch=(function(){function AdvancedSearch(container){var _this=this;_this.container=container;var submit_btn=this.container.querySelector(".search-form__connected-submit");submit_btn&&submit_btn.addEventListener("click",function(e){e.preventDefault();var form=this.closest("form"),formValue=form.querySelector(".search-form__input").value,formProductType=form.querySelector("#advanced-search-product-type").value,productQuery=""+formValue+"*"+(formProductType!==""?" AND product_type:"+formProductType:"");window.theme.searchMode!=="product"&&(productQuery=""+formValue+"*");var formAction=window.routes.searchUrl+"?q="+productQuery+"&type="+window.theme.searchMode;window.location.href=formAction})}return AdvancedSearch})(),theme.CountdownTimer=(function(){function CountdownTimer(container){this.container=container;var countdown_timer=this.container.querySelector(".countdown_timer");if(countdown_timer)var dateStr=countdown_timer.getAttribute("data-time"),timer_behaviour=countdown_timer.getAttribute("data-timer_behaviour"),countDownDate=new Date(dateStr).getTime(),timerDaysElem=countdown_timer.querySelector(".timer-days .timer-value"),timerHoursElem=countdown_timer.querySelector(".timer-hours .timer-value"),timerMinutesElem=countdown_timer.querySelector(".timer-minutes .timer-value"),timerSecondsElem=countdown_timer.querySelector(".timer-seconds .timer-value"),x=setInterval(function(){var now=new Date().getTime(),distance=countDownDate-now;if(distance<=0)if(timer_behaviour=="use_current_day")countDownDate=new Date().setHours(23,59,59,999),distance=countDownDate-now;else if(timer_behaviour=="show_zeros")timerDaysElem.innerHTML="00",timerHoursElem.innerHTML="00",timerMinutesElem.innerHTML="00",timerSecondsElem.innerHTML="00",clearInterval(x);else{timerDaysElem.innerHTML="00",timerHoursElem.innerHTML="00",timerMinutesElem.innerHTML="00",timerSecondsElem.innerHTML="00",clearInterval(x);var sectionEl=container.closest(".shopify-section");sectionEl&&(sectionEl.style.display="none")}if(distance>=0){var days=Math.floor(distance/864e5),hours=Math.floor(distance%(1e3*60*60*24)/(1e3*60*60)),minutes=Math.floor(distance%(1e3*60*60)/(1e3*60)),seconds=Math.floor(distance%(1e3*60)/1e3);days<10&&(days="0"+days),hours<10&&(hours="0"+hours),minutes<10&&(minutes="0"+minutes),seconds<10&&(seconds="0"+seconds),timerDaysElem.innerHTML=days,timerHoursElem.innerHTML=hours,timerMinutesElem.innerHTML=minutes,timerSecondsElem.innerHTML=seconds}},1e3)}return CountdownTimer})(),theme.FeaturedProducts=(function(){function FeaturedProducts(container){var tabs_nav=container.querySelector(".index-tabs_nav"),sliderEl=container.querySelector(".index-tabs-content_block__slider"),flickityInstance2,slider_options,slider_config,windowWidth=window.innerWidth;if(sliderEl){let alignProductInfo2=function(){document.querySelectorAll(".index-tabs-content_block__slider").forEach(function(element2){var infoHeight=0,titleHeight=0;element2.style.setProperty("--product-info-height","auto"),element2.style.setProperty("--product-title-height","auto"),element2.querySelectorAll(".product-item--info").forEach(function(infoElement){if(infoElement.querySelector(".new-label")){element2.classList.add("new-label-present");return}}),element2.querySelectorAll(".product-card__link-title").forEach(function(infoElement){infoElement.clientHeight>titleHeight&&(titleHeight=infoElement.clientHeight)}),element2.querySelectorAll(".product-item--info").forEach(function(infoElement){infoElement.clientHeight>infoHeight&&(infoHeight=infoElement.clientHeight)}),element2.style.setProperty("--product-info-height",infoHeight+"px"),element2.style.setProperty("--product-title-height",titleHeight+"px")})};var alignProductInfo=alignProductInfo2,platter_elem=sliderEl.querySelector(".scroller-platter");if(slider_platter_config=platter_elem.getAttribute("data-flickity-config"),slider_config=sliderEl.getAttribute("data-flickity-config"),slider_platter_config!=""){slider_options=JSON.parse(slider_platter_config),flickityInstance2=new Flickity(platter_elem,slider_options),flickityInstance2.element.classList.add("rendered");var slider_custom_arrows=container.querySelector(".slider_custom_arrows"),total_slides=container.querySelectorAll(".product-item-block").length;if(slider_custom_arrows){var slider_custom_btns=slider_custom_arrows.querySelectorAll(".btn");slider_custom_btns.forEach(function(item,index){item.addEventListener("click",function(e){e.preventDefault();var isNext=item.classList.contains("button-next");isNext?flickityInstance2.next():flickityInstance2.previous()})}
6),flickityInstance2.on("change",function(index){if(windowWidth>=1239){var document_width=document.documentElement.offsetWidth,current_slides=Math.floor(document_width/472);index>0?slider_custom_arrows.querySelector(".button-prev").classList.remove("disabled"):slider_custom_arrows.querySelector(".button-prev").classList.add("disabled"),total_slides-index==current_slides?slider_custom_arrows.querySelector(".button-next").classList.add("disabled"):slider_custom_arrows.querySelector(".button-next").classList.remove("disabled")}})}}alignProductInfo2(),window.addEventListener("resize",function(){setTimeout(function(){alignProductInfo2()},500)})}tabs_nav&&tabs_nav.querySelectorAll(".index-tabs_nav--item").forEach(function(item,index){item.addEventListener("click",function(e){e.preventDefault();var activeItem=tabs_nav.querySelector(".index-tabs_nav--item.active"),href_tab=this.getAttribute("data-href"),content_block=document.querySelector("#"+href_tab);if(activeItem){activeItem.classList.remove("active");var active_content_block=document.querySelector("#"+activeItem.getAttribute("data-href"));if(active_content_block){active_content_block.classList.remove("active");var tab_content_slider=active_content_block.querySelector(".index-tabs-content_block__slider");tab_content_slider&&tab_content_slider.classList.contains("flickity-enabled")&&(flickityInstance2.destroy(),flickityInstance2.element.classList.remove("rendered"))}}if(this.classList.add("active"),content_block){content_block.classList.add("active");var tab_content_slider=content_block.querySelector(".index-tabs-content_block__slider");if(tab_content_slider&&tab_content_slider.getAttribute("data-flickity-config")!=""){slider_options=JSON.parse(tab_content_slider.getAttribute("data-flickity-config")),flickityInstance2=new Flickity(tab_content_slider,slider_options),flickityInstance2.element.classList.add("rendered"),flickityInstance2.on("select",function(index2){var elementsCount2=container.querySelector(".flickity-slider").childElementCount});var elementsCount=tab_content_slider.querySelector(".flickity-slider").childElementCount;slider_custom_arrows&&(elementsCount>1?slider_custom_arrows&&slider_custom_arrows.classList.remove("hide"):slider_custom_arrows&&slider_custom_arrows.classList.add("hide"))}}})});var formsArr=container.querySelectorAll('[action="/cart/add"]');formsArr.length&&formsArr.forEach(function(form,index){theme.AddItemToCart(form)}),theme.ProductItemSwatches()}return FeaturedProducts})(),theme.CollectionListSection=(function(){function CollectionListSection(container){var sectionCarousel=container.querySelector(".collection-list__slider");if(sectionCarousel){var slider_options=JSON.parse(sectionCarousel.getAttribute("data-flickity-config")),flickityInstance2=new Flickity(sectionCarousel,slider_options);if(slider_options.watchCSS){let resizeMobileSliderHeight2=function(){var windowWidth=window.innerWidth;windowWidth<=1199&&(resizeMobileFlag||(flickityInstance2.element.classList.contains("rendered")&&flickityInstance2.element.classList.remove("rendered"),flickityInstance2.resize(),setTimeout(function(){flickityInstance2.element.classList.add("rendered"),resizeMobileFlag=!0},1e3)))};var resizeMobileSliderHeight=resizeMobileSliderHeight2,resizeMobileFlag=!1;resizeMobileSliderHeight2(),window.addEventListener("resize",resizeMobileSliderHeight2)}else flickityInstance2.element.classList.add("rendered");var slider_custom_arrows=container.querySelector(".slider_custom_arrows");if(slider_custom_arrows){slider_options.watchCSS&&slider_custom_arrows.classList.add("desktopHide");var slider_custom_btns=slider_custom_arrows.querySelectorAll(".btn");slider_custom_btns.forEach(function(item,index){item.addEventListener("click",function(e){if(e.preventDefault(),flickityInstance2){var isNext=item.classList.contains("button-next");isNext?flickityInstance2.next():flickityInstance2.previous()}})})}}var formsArr=container.querySelectorAll('[action="/cart/add"]');formsArr.length&&formsArr.forEach(function(form,index){theme.AddItemToCart(form)}),theme.ProductItemSwatches()}return CollectionListSection})(),theme.AddItemToCart=function(form){var self2=this,addToCartBtn=form.querySelector('[type="submit"]');form&&form.addEventListener("submit",function(e){e.preventDefault();var current_variant_id=form.querySelector('[name="id"]').value,variantPrice=form.querySelector('[name="id"]').getAttribute("data-price"),qty=1,json=[];if(window.discountSettings.enable&&!window.discountSettings.isGiftpresent){var cartTotal=parseInt(window.discountSettings.cartTotal)+parseInt(variantPrice*qty);window.discountSettings.variantsList.indexOf(current_variant_id)>-1&&cartTotal>=window.discountSettings.minimumCartAmount&&(json.push({id:window.discountSettings.giftProduct,quantity:1,properties:{_isGift:"Yes"}}),window.discountSettings.isGiftpresent=!0,window.discountSettings.cartTotal=cartTotal)}json.push({id:current_variant_id,quantity:qty});var formData=JSON.stringify({items:json});fetch("/cart/add.js",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:formData}).then(function(response){return response.json()}).then(function(json2){if(addToCartBtn){(window.enablePromotionsUsingCode||window.autoPromotionsEnable)&&(window.cart_clear=!1,window.promotionValidate());var addToCartBtnText=addToCartBtn.querySelector("[data-add-to-cart-text]");addToCartBtn.classList.add("added"),addToCartBtnText.innerHTML=theme.strings.added_to_cart,setTimeout(function(){theme.Cart.prototype._onProductAdded()},1e3);var pre_order_textEl=form.querySelector(".pre_order_text");setTimeout(function(){if(addToCartBtn.classList.remove("added"),self2.show_preOrder_btn){var isPreOrderBtn=addToCartBtn.hasAttribute("data-preOrderButton");isPreOrderBtn?(addToCartBtnText.innerHTML=theme.strings.preOrder,pre_order_textEl&&pre_order_textEl.classList.remove("hide")):(addToCartBtnText.innerHTML=theme.strings.addToCart,pre_order_textEl&&pre_order_textEl.classList.add("hide"))}else addToCartBtnText.innerHTML=theme.strings.addToCart,pre_order_textEl&&pre_order_textEl.classList.add("hide")},2e3)}}).catch(function(error2){console.log(error2)})})},theme.ProductItemSwatches=function(){document.addEventListener("change",function(e){var target=e.target;if(target.classList.contains("color-swatch__radio")){var productItem=target.closest(".product-card"),variantUrl=target.getAttribute("data-variant-url");productItem.querySelector(".product-card__link-image").setAttribute("href",variantUrl),productItem.querySelector(".product-card__link-title").setAttribute("href",variantUrl);var originalImageElement=productItem.querySelector(".product-card__image");target.hasAttribute("data-image-url")&&target.getAttribute("data-media-id")!==originalImageElement.getAttribute("data-media-id")&&(originalImageElement.setAttribute("data-media-id",target.getAttribute("data-media-id")),originalImageElement.setAttribute("srcset",target.getAttribute("data-image-url")),originalImageElement.setAttribute("src",target.getAttribute("data-image-src")),originalImageElement.setAttribute("width",target.getAttribute("ddata-image-width")),originalImageElement.setAttribute("height",target.getAttribute("data-image-height")),target.hasAttribute("data-max_img_width")&&originalImageElement.setAttribute("style",target.getAttribute("data-max_img_width")));var productItemBlock=target.closest(".product-item-block");productItemBlock&&productItemBlock.classList.contains("product-item-block--withAlternateImage")&&productItemBlock.classList.remove("product-item-block--withAlternateImage")}})},theme.Product=(function(){function Product(container){this.container=container;var sectionId=container.getAttribute("data-section-id");this.ajaxEnabled=container.getAttribute("data-ajax-enabled")==="true",this.pickAnOption=container.getAttribute("data-show_pick_an_option")==="true",this.show_preOrder_btn=container.getAttribute("data-show_preOrder_btn")==="true",this.enableLinkedOptions=container.getAttribute("data-enable_linked_options")==="true";var productJsonElement=document.querySelector("[data-product-json]");if(productJsonElement){var jsonData=JSON.parse(productJsonElement.innerHTML);this.productData=jsonData.product,this.productOptionsWithValues=jsonData.options_with_values,this.variantsInventories=jsonData.inventories||{},this.lowInventoryThreshold=jsonData.lowInventoryThreshold}document.querySelectorAll(".variant-accessory").length==0&&document.querySelector(".product-accessories-wrapper")&&(document.querySelector(".product-accessories-wrapper").style.display="none");const desc=document.querySelector(".product-desc-expand");if(desc){let adjustDesc2=function(){document.querySelector(".product-single__description .rte").classList.add("expanded"),window.innerWidth>749?document.querySelector(".product-desc").clientHeight>150?(desc.style.display="flex",desc.classList.remove("expanded"),document.querySelector(".product-single__description .rte").classList.remove("expanded")):(desc.style.display="none",desc.classList.add("expanded"),document.querySelector(".product-single__description .rte").classList.add("expanded")):document.querySelector(".product-desc").clientHeight>175?(desc.style.display="flex",desc.classList.remove("expanded"),document.querySelector(".product-single__description .rte").classList.remove("expanded")):(desc.style.display="none",desc.classList.add("expanded"),document.querySelector(".product-single__description .rte").classList.add("expanded"))};var adjustDesc=adjustDesc2;desc.onclick=function(){document.querySelector(".product-single__description .rte").classList.toggle("expanded"),desc.classList.toggle("expanded")},adjustDesc2(),window.onresize=function(){adjustDesc2()}}if(container.querySelectorAll(".pdp-emarsys-form").length>0&&container.querySelectorAll(".pdp-emarsys-form").forEach(function(formWrap){formWrap.querySelector(".emarsys-form-btn")&&(formWrap.querySelector(".emarsys-form-btn").onclick=function(e){if(CheckInputs(formWrap)==!0){window.onbeforesubmit&&onbeforesubmit();var ProfileForm=container.querySelector("form.pdp-emarsys-form");ProfileForm.querySelector(".form__input").setAttribute("value",formWrap.querySelector(".form__input").value),ProfileForm.setAttribute("target","hidden_iframe"),ProfileForm.submit(),setTimeout(function(){ProfileForm.setAttribute("target",""),ProfileForm.reset(),formWrap.querySelector(".success_message").style.display="block"},1e3)}})}),document.querySelector(".product-coupon_block")&&(document.querySelector(".product-coupon_block").onclick=function(evt){if(evt.target.classList.contains(".coupon_info_popup")==!1){let el=evt.target.closest(".product-coupon_block");var textToCopy=el.getAttribute("data-clipboard-text");
6navigator.clipboard.writeText(textToCopy),setCookie("discount_code",textToCopy,1),el.querySelector(".copy_code_btn")&&(el.querySelector(".copy_code_btn").textContent=el.querySelector(".copy_code_btn").getAttribute("data-copied-text"))}}),document.querySelector(".sticky-tabs-inner")){var sticky_bar_height=0;document.querySelector(".product-sticky-bar")&&(sticky_bar_height=document.querySelector(".product-sticky-bar").clientHeight),document.querySelectorAll(".sticky-tabs-inner a").forEach(function(e){var section_id=e.getAttribute("href")=="#"?"#no-valid-selector":e.getAttribute("href");if(document.querySelector(section_id)){var refElement=document.querySelector(section_id);e.onclick=function(evt){evt.preventDefault();var section_top=refElement.getBoundingClientRect().top+window.scrollY-sticky_bar_height-50;window.scroll({top:section_top,behavior:"smooth"})}}}),window.onscroll=function(event2){if(!event2.isTrusted)return event2.stopImmediatePropagation(),!1;document.querySelectorAll(".sticky-tabs-inner a").forEach(function(e){var section_id=e.getAttribute("href")=="#"?"#no-valid-selector":e.getAttribute("href"),scrollPos_start=window.scrollY+sticky_bar_height+200,scrollPos_end=window.scrollY+sticky_bar_height;if(document.querySelector(section_id)){var refElement=document.querySelector(section_id),section_top=refElement.getBoundingClientRect().top+window.scrollY,ptExperienceEle=document.querySelector("pt-experience");scrollPos_start>=section_top?(document.querySelector(".sticky-tabs-inner a.active")&&document.querySelector(".sticky-tabs-inner a.active").classList.remove("active"),e.classList.add("active"),ptExperienceEle&&ptExperienceEle.classList.add("hide")):(e.classList.remove("active"),ptExperienceEle&&ptExperienceEle.classList.remove("hide"))}})}}document.querySelector(".sticky-shop-now-btn")&&(document.querySelector(".sticky-shop-now-btn").onclick=function(){document.querySelectorAll(".product-form [data-add-to-cart]").forEach(function(elem){var style=window.getComputedStyle(elem);style.display==="none"||style.visibility==="hidden"||elem.click()})}),this.settings={mediaQueryMediumUp:"screen and (min-width: 750px)",mediaQuerySmall:"screen and (max-width: 749px)",bpSmall:!1,enableHistoryState:!!container.getAttribute("data-enable-history-state")||!1,namespace:".slideshow-"+sectionId,sectionId,sliderActive:!1,zoomEnabled:!1},this.selectors={addToCart:"[data-add-to-cart]",addToCartText:"[data-add-to-cart-text]",cartCount:"[data-cart-count]",cartCountBubble:"[data-cart-count-bubble]",loader:"[data-loader]",loaderStatus:"[data-loader-status]",quantity:"[data-quantity-input]",SKU:".variant-sku",productStatus:"[data-product-status]",originalSelectorId:"#ProductSelect-"+sectionId,productForm:"[data-product-form]",errorMessage:"[data-error-message]",errorMessageWrapper:"[data-error-message-wrapper]",productMediaWrapper:"[data-product-single-media-wrapper]",productThumbs:".product-single__thumbnails-"+sectionId,productThumbsWrapper:".thumbnails-wrapper",singleOptionSelector:".single-option-selector-"+sectionId,singleOptionColorSelector:".single_option_color_selector-"+sectionId,shopifyPaymentButton:".shopify-payment-button",productMediaTypeVideo:"[data-product-media-type-video]",productMediaTypeModel:"[data-product-media-type-model]",priceContainer:"[data-price-element]",regularPrice:"[data-regular-price]",salePrice:"[data-sale-price]",savings:"[data-savings]",unitPrice:"[data-unit-price]",unitPriceBaseUnit:"[data-unit-price-base-unit]",productPolicies:"[data-product-policies]",storeAvailabilityContainer:"[data-store-availability-container]",swatchesWrapper:".product_swatches"},this.classes={hidden:"hide",visibilityHidden:"visibility-hidden",inputError:"input--error",productOnSale:"price--on-sale",productUnitAvailable:"price--unit-available",productUnavailable:"price--unavailable",productSoldOut:"price--sold-out",productFormErrorMessageWrapperHidden:"product-form__error-message-wrapper--hidden",activeClass:"active-thumb",variantSoldOut:"product-form--variant-sold-out"},this.eventHandlers={},this.quantityInput=container.querySelector(this.selectors.quantity),this.errorMessageWrapper=container.querySelector(this.selectors.errorMessageWrapper),this.productForm=container.querySelector(this.selectors.productForm),this.addToCart=container.querySelector(this.selectors.addToCart),this.addToCart&&(this.addToCartText=this.addToCart.querySelector(this.selectors.addToCartText),this.addToCart.addEventListener("click",function(e){ptengine.track("add_cart")},!1),theme.TapAddToCart(this.addToCart)),this.shopifyPaymentButton=container.querySelector(this.selectors.shopifyPaymentButton),this.priceContainer=container.querySelector(this.selectors.priceContainer),this.productPolicies=container.querySelector(this.selectors.productPolicies),this.storeAvailabilityContainer=container.querySelector(this.selectors.storeAvailabilityContainer),this.storeAvailabilityContainer&&this._initStoreAvailability(),this.swatchesWrapper=container.querySelector(this.selectors.swatchesWrapper),this.loaderStatus=container.querySelector(this.selectors.loaderStatus);function handleQtyChange(qty){qty<=1&&(qty=1,container.querySelector(".minus_btn").classList.add("disabled"),container.querySelector(".minus_btn").setAttribute("disabled","disabled")),qty>1&&(container.querySelector(".minus_btn").classList.remove("disabled"),container.querySelector(".minus_btn").removeAttribute("disabled"));var priceFormat2=theme.priceCurrencyCodeEnable?theme.moneyFormatWithCurrency:theme.moneyFormat,comparePriceFormat2=theme.comparePriceCurrencyCodeEnable?theme.moneyFormatWithCurrency:theme.moneyFormat,regularPrice=parseInt(document.querySelector(".product-form__controls-group--submit .price-wrapper").getAttribute("data-price")),comparePrice=parseInt(document.querySelector(".product-form__controls-group--submit .price-wrapper").getAttribute("data-compare-price")),saving=parseInt(document.querySelector(".product-form__controls-group--submit .price-wrapper").getAttribute("data-saving")),discount=1;qty>=5&&qty<=10&&(discount=7),qty>=11&&qty<=20&&(discount=9),qty>20&&(discount=10),document.querySelector(".product-container").getAttribute("data-discount-product")=="true"&&discount>1&&(comparePrice=regularPrice,regularPrice=regularPrice-regularPrice*discount/100,saving=comparePrice-regularPrice);var current_variant_id=document.querySelector(".product-form__variants").value;if(document.querySelector('.product-accessories-section[data-variant="'+current_variant_id+'"]')){var accessories_wrap=document.querySelector('.product-accessories-section[data-variant="'+current_variant_id+'"]');accessories_wrap.querySelectorAll(".variant-accessory.selected").length>0&&accessories_wrap.querySelectorAll(".variant-accessory.selected").forEach(function(elem){var accessory_price=parseInt(elem.getAttribute("data-price")),accessory_compare_price=parseInt(elem.getAttribute("data-compare-price"));accessory_compare_price>0&&comparePrice==0&&(comparePrice=regularPrice),comparePrice>0&&accessory_compare_price==0&&(accessory_compare_price=parseInt(elem.getAttribute("data-price")));var accessory_saving=parseInt(elem.getAttribute("data-saving"));elem.getAttribute("data-discount-accessory")=="true"&&discount>1&&(accessory_compare_price=accessory_price,accessory_price=accessory_price-accessory_price*discount/100,accessory_saving=accessory_compare_price-accessory_price),regularPrice=regularPrice+accessory_price,comparePrice=comparePrice+accessory_compare_price,saving=saving+accessory_saving})}var submitPriceWrapper=document.querySelector(".product-form__controls-group--submit .price-wrapper");if(submitPriceWrapper){var wrapperRegularPrice=submitPriceWrapper.querySelector(".regular-price"),wrapperComparePrice=submitPriceWrapper.querySelector(".compare-price"),wrapperTotalSavings=submitPriceWrapper.querySelector(".total-savings");wrapperRegularPrice&&(wrapperRegularPrice.innerHTML=theme.Currency.formatMoney(regularPrice*qty,priceFormat2)),wrapperComparePrice&&(comparePrice>0?wrapperComparePrice.innerHTML=theme.Currency.formatMoney(comparePrice*qty,comparePriceFormat2):wrapperComparePrice.innerHTML=""),wrapperTotalSavings&&(saving>0?wrapperTotalSavings.innerHTML="-"+theme.Currency.formatMoney(saving*qty,theme.moneyFormat):wrapperTotalSavings.innerHTML="")}}var qty_btns=container.querySelectorAll(".qty_btn");qty_btns.length&&qty_btns.forEach(function(item,index){item.addEventListener("click",function(e){if(e.preventDefault(),!item.classList.contains("disabled")){var inputEl=this.closest(".qty").querySelector('[name="quantity"]'),qty=+inputEl.value;if(this.classList.contains("minus_btn")?qty--:qty++,inputEl.value=qty,inputEl.closest(".custom_quantity_info_container")){const event2=new Event("change",{bubbles:!0});inputEl.dispatchEvent(event2),qty>1?this.closest(".qty").querySelector(".minus_btn").classList.remove("disabled"):this.closest(".qty").querySelector(".minus_btn").classList.add("disabled");return}handleQtyChange(qty)}})});var qtyElem=container.querySelectorAll(".product-form__input--quantity");qtyElem.length&&qtyElem.forEach(function(item,index){item.addEventListener("change",function(e){if(e.preventDefault(),!item.classList.contains("disabled")){var qty=this.value;if(item.closest(".custom_quantity_info_container")){qty>1?this.closest(".qty").querySelector(".minus_btn").classList.remove("disabled"):this.closest(".qty").querySelector(".minus_btn").classList.add("disabled");return}handleQtyChange(qty)}})});var variant_accessory=document.querySelectorAll(".variant-accessory");variant_accessory.length>
60&&variant_accessory.forEach(function(elem){elem.onclick=function(event2){elem.classList.toggle("selected");var qtyVal=document.querySelector(".product-form__input--quantity").value,discount=1;qtyVal>=5&&qtyVal<=10&&(discount=7),qtyVal>=11&&qtyVal<=20&&(discount=9),qtyVal>20&&(discount=10);var priceElement=document.querySelector(".product-form__controls-group--submit .price-wrapper"),orig_regular_price=priceElement.getAttribute("data-price"),orig_compare_price=priceElement.getAttribute("data-compare-price"),orig_saving=priceElement.getAttribute("data-saving"),priceFormat2=theme.priceCurrencyCodeEnable?theme.moneyFormatWithCurrency:theme.moneyFormat,comparePriceFormat2=theme.comparePriceCurrencyCodeEnable?theme.moneyFormatWithCurrency:theme.moneyFormat,current_variant_id=document.querySelector(".product-form__variants").value;if(document.querySelector('.product-accessories-section[data-variant="'+current_variant_id+'"]')){var accessories_wrap=document.querySelector('.product-accessories-section[data-variant="'+current_variant_id+'"]');accessories_wrap.querySelectorAll(".variant-accessory.selected").length>0&&accessories_wrap.querySelectorAll(".variant-accessory.selected").forEach(function(elem2){var accessory_price=elem2.getAttribute("data-price");if(elem2.getAttribute("data-discount-accessory")=="true"){if(discount>1){var accessory_compare_price=parseInt(elem2.getAttribute("data-price"));accessory_price=accessory_price-accessory_price*discount/100}}else{var accessory_compare_price=parseInt(elem2.getAttribute("data-compare-price"));accessory_compare_price>0&&orig_compare_price==0&&(orig_compare_price=orig_regular_price),orig_compare_price>0&&accessory_compare_price==0&&(accessory_compare_price=parseInt(elem2.getAttribute("data-price")))}var accessory_saving=accessory_compare_price-accessory_price;orig_regular_price=parseInt(orig_regular_price)+parseInt(accessory_price),orig_compare_price=parseInt(orig_compare_price)+parseInt(accessory_compare_price),orig_saving=parseInt(orig_saving)+parseInt(accessory_saving)})}priceElement.querySelector(".regular-price").innerHTML=theme.Currency.formatMoney(orig_regular_price*qtyVal,priceFormat2),orig_compare_price>0?(priceElement.querySelector(".compare-price").innerHTML=theme.Currency.formatMoney(orig_compare_price*qtyVal,theme.moneyFormat),priceElement.querySelector(".compare-price").style.display="block"):priceElement.querySelector(".compare-price").style.display="none",orig_saving>0?(priceElement.querySelector(".total-savings").innerHTML="-"+theme.Currency.formatMoney(orig_saving*qtyVal,comparePriceFormat2),priceElement.querySelector(".total-savings").style.display="block"):priceElement.querySelector(".total-savings").style.display="none",document.querySelectorAll("[data-payment-trigger]").forEach(dom=>{dom.setAttribute("data-payment-amount",orig_regular_price*qtyVal/100)}),document.querySelectorAll(".affirm-as-low-as").forEach(function(dom){dom.setAttribute("data-amount",String(Math.round(orig_regular_price*qtyVal)))}),window.affirm&&window.affirm.ui&&typeof window.affirm.ui.refresh=="function"&&window.affirm.ui.refresh(),document.querySelectorAll(".variant-accessory.selected").length>0?document.querySelector(".product-accessories-wrapper").classList.remove("disabled"):document.querySelector(".product-accessories-wrapper").classList.add("disabled")}});var product_description_accrordion=container.querySelectorAll(".product_description_accrordion");if(product_description_accrordion.length){var isReviewAccordion=!1;product_description_accrordion.forEach(function(accordionEl,index){var product_accordion__blocks=accordionEl.querySelectorAll(".product_accordion__block");product_accordion__blocks.length&&product_accordion__blocks.forEach(function(accordionBlock,index2){var title=accordionBlock.querySelector(".product_accordion__heading"),content=accordionBlock.querySelector(".product_accordion__content");title.addEventListener("click",function(e){e.preventDefault();var self2=this;if(content.classList.contains("active"))content.getAttribute("style")!=null?(content.style.height="0px",content.addEventListener("transitionend",function(){content.classList.remove("active"),self2.classList.remove("active")},{once:!0})):(content.classList.remove("active"),self2.classList.remove("active"));else{self2.classList.add("active"),content.classList.add("active"),content.style.height="auto";var height=content.clientHeight+"px";content.style.height="0px",setTimeout(function(){content.style.height=height},0)}})});var contaisReviews=accordionEl.querySelector("#shopify-product-reviews");contaisReviews&&(isReviewAccordion=!0)}),isReviewAccordion&&document.addEventListener("click",function(e){let el=e.target;if(el.classList.contains("spr-summary-actions-newreview")||el.closest(".spr-summary-actions-newreview")){el.classList.contains("spr-summary-actions-newreview")||(el=el.closest(".spr-summary-actions-newreview"));var accrodionParent=el.closest(".product_accordion__content");
6if(accrodionParent){var reviewsForm=el.closest("#shopify-product-reviews");accrodionParent.style.height=reviewsForm.clientHeight+"px"}}})}var tabing=container.querySelector(".tabing");tabing&&tabing.querySelectorAll(".nav-tabs a").forEach(function(item,index){item.addEventListener("click",function(e){e.preventDefault();var navParent=this.closest(".nav-tabs"),href=this.getAttribute("href"),tab_contentWrapper=container.querySelector(".tab-content"),tabContent=tab_contentWrapper.querySelector(href);tabContent&&(navParent.querySelector(".active").classList.remove("active"),tab_contentWrapper.querySelector(".active").classList.remove("active"),tabContent.classList.add("active"),this.parentNode.classList.add("active"))})});var productJson=document.getElementById("ProductJson-"+sectionId);if(!productJson||!productJson.innerHTML.length)return;if(this.productSingleObject=JSON.parse(productJson.innerHTML),this.productState={available:!0,soldOut:!1,onSale:!1,showUnitPrice:!1},this._stringOverrides(),this._initVariants(),this._initAddToCart(),this._initProductVideo(),this._initModelViewerLibraries(),this._initShopifyXrLaunch(),this._initSwatches(),this.enableLinkedOptions){let inArray2=function(needle,haystack){if(haystack)return haystack.indexOf(needle)!==-1};var inArray=inArray2,_this=this,parentForm=_this.container.querySelector("[data-product-form]"),initialValue,availableOptions,selector,checkOptions=function(){var updateOptions=!0;if(_this.pickAnOption){var selectOption=parentForm.querySelector(".single-option-selector");if(selectOption){var select_value=selectOption.value;select_value.length==0&&(updateOptions=!1)}}return updateOptions},Shopify2=Shopify2||{};if(Shopify2.arrayIncludes=function(e,t){for(var n=0;n<e.length;n++)if(e[n]==t)return!0;return!1},Shopify2.uniq=function(e){for(var t=[],n=0;n<e.length;n++)Shopify2.arrayIncludes(t,e[n])||t.push(e[n]);return t},Shopify2.optionsMap={},Shopify2.updateOptionsInSelector=function(selectorIndex){switch(selectorIndex){case 0:var key="root";selector=parentForm.querySelector(".single-option-selector");break;case 1:var key=parentForm.querySelector(".single-option-selector").value;selector=parentForm.querySelectorAll(".single-option-selector")[1];break;case 2:var key=parentForm.querySelector(".single-option-selector").value;key+=" / "+parentForm.querySelectorAll(".single-option-selector")[1].value,selector=parentForm.querySelectorAll(".single-option-selector")[2]}var check_swatch=!0;if(_this.pickAnOption&&selectorIndex!=0){var optionSelect=_this.variants.singleOptions[selectorIndex];if(optionSelect){var optionSelectVal=optionSelect.value;optionSelectVal.length==0&&(check_swatch=!1)}}initialValue=selector.value,selector.innerHTML="",availableOptions=Shopify2.optionsMap[key];for(var i2=0;i2<availableOptions.length;i2++){var option=availableOptions[i2],newOption=document.createElement("option");newOption.value=option,newOption.innerHTML=option,selector.appendChild(newOption)}var swatchElements=parentForm.querySelectorAll('.swatch[data-option-index="'+selectorIndex+'"] .swatch-element');if(swatchElements.length&&swatchElements.forEach(function(item,index){var itemValue=item.getAttribute("data-value"),itemRadioBtn=item.querySelector('[type="radio"]');inArray2(itemValue,availableOptions)?(item.classList.remove("soldout"),item.style.display="flex",itemRadioBtn&&(itemRadioBtn.removeAttribute("disabled"),itemRadioBtn.checked=!1)):(item.classList.add("soldout"),item.style.display="none",itemRadioBtn&&(itemRadioBtn.getAttribute("disabled","disabled"),itemRadioBtn.checked=!1))}),inArray2(initialValue,availableOptions)){if(selector){if(check_swatch)selector.value=initialValue;else{selector.selectedIndex=-1;var opt=document.createElement("option");opt.value="",opt.setAttribute("disabled","disabled"),opt.setAttribute("selected","selected"),opt.innerHTML=theme.strings.pick_an_option,selector.prepend(opt)}var activeSwatch=parentForm.querySelector('.swatch[data-option-index="'+selectorIndex+'"] .swatch-element[data-value="'+initialValue+'"] [type="radio"]');activeSwatch&&check_swatch&&(activeSwatch.checked=!0)}}
6else if(selector)if(check_swatch)selector.value=availableOptions[0],selector.dispatchEvent(new Event("change",{bubbles:!0}));else{selector.selectedIndex=-1;var opt=document.createElement("option");opt.value="",opt.setAttribute("disabled","disabled"),opt.setAttribute("selected","selected"),opt.innerHTML=theme.strings.pick_an_option,selector.prepend(opt)}},Shopify2.linkOptionSelectors=function(product){if(product){for(var i2=0;i2<product.variants.length;i2++){var variant2=product.variants[i2];if(variant2.available){if(Shopify2.optionsMap.root=Shopify2.optionsMap.root||[],Shopify2.optionsMap.root.push(variant2.option1),Shopify2.optionsMap.root=Shopify2.uniq(Shopify2.optionsMap.root),product.options.length>1){var key=variant2.option1;Shopify2.optionsMap[key]=Shopify2.optionsMap[key]||[],Shopify2.optionsMap[key].push(variant2.option2),Shopify2.optionsMap[key]=Shopify2.uniq(Shopify2.optionsMap[key])}if(product.options.length===3){var key=variant2.option1+" / "+variant2.option2;Shopify2.optionsMap[key]=Shopify2.optionsMap[key]||[],Shopify2.optionsMap[key].push(variant2.option3),Shopify2.optionsMap[key]=Shopify2.uniq(Shopify2.optionsMap[key])}}}checkOptions()&&(Shopify2.updateOptionsInSelector(0),product.options.length>1&&Shopify2.updateOptionsInSelector(1),product.options.length===3&&Shopify2.updateOptionsInSelector(2));var firstSelectEl=parentForm.querySelectorAll(".single-option-selector")[0];firstSelectEl&&firstSelectEl.addEventListener("change",function(){return checkOptions()&&Shopify2.updateOptionsInSelector(1),product.options.length===3&&checkOptions()&&Shopify2.updateOptionsInSelector(2),!0});var secondSelectEl=parentForm.querySelectorAll(".single-option-selector")[1];secondSelectEl&&secondSelectEl.addEventListener("change",function(){return checkOptions()&&(_this.pickAnOption&&Shopify2.updateOptionsInSelector(1),product.options.length===3&&Shopify2.updateOptionsInSelector(2)),!0})}},_this.productData.available&&_this.productData.options.length>1&&_this.productData.variants.length>1&&window.MutationObserver&&parentForm.length){typeof observer=="object"&&typeof observer.disconnect=="function"&&observer.disconnect();var config={childList:!0,subtree:!0},observer=new MutationObserver(function(){Shopify2.linkOptionSelectors(_this.productData),observer.disconnect()});observer.observe(parentForm,config)}var selector=parentForm.querySelector(".single-option-selector");if(selector&&selector.dispatchEvent(new Event("change",{bubbles:!0})),_this.productData.options.length==1){for(var v=0;v<_this.productData.variants.length;v++){var variant=_this.productData.variants[v];if(!variant.available){var allSelectOptionsEl=parentForm.querySelectorAll(".single-option-selector option");allSelectOptionsEl.length&&allSelectOptionsEl.forEach(function(item,index){var itemText=item.innerHTML.trim();if(itemText==variant.title){item.parentNode.removeChild(item);var swatchEl=parentForm.querySelector(".product_swatches [data-value='"+variant.title+"']");swatchEl&&swatchEl.parentNode.removeChild(swatchEl)}})}}var selectors2=parentForm.querySelectorAll(".single-option-selector");selectors2.length&&(selectors2.forEach(function(select,index){select.dispatchEvent(new Event("change",{bubbles:!0}))}),selector.dispatchEvent(new Event("change",{bubbles:!0})))}}var back_in_stock_row=container.querySelector(".back_in_stock_row");if(back_in_stock_row){var back_in_stock_button=back_in_stock_row.querySelector(".back_in_stock_btn"),contact_formID=back_in_stock_row.getAttribute("data-id"),contactFormEl=document.querySelector("#"+contact_formID);if(contactFormEl){var formStatusBlock=contactFormEl.querySelector(".form-status"),formStatusBlockValue=formStatusBlock.innerHTML.trim();if(formStatusBlockValue.length>0){var back_in_stock_response=back_in_stock_row.querySelector(".back_in_stock_response");back_in_stock_response&&(back_in_stock_response.innerHTML=formStatusBlockValue,back_in_stock_response.classList.add("active"),formStatusBlockValue.indexOf("form-message--success")>=0&&back_in_stock_response.classList.add("success_response"),back_in_stock_row.classList.remove("hide"))}}back_in_stock_button&&back_in_stock_button.addEventListener("click",function(e){e.preventDefault();var back_in_stock_input=back_in_stock_row.querySelector(".Form__Input");if(back_in_stock_input){var back_in_stock_input_val=back_in_stock_input.value,contactFormEl2=document.querySelector("#"+contact_formID);contactFormEl2&&(contactFormEl2.querySelector(".contact-form_email").value=back_in_stock_input_val,contactFormEl2.submit())}})}var stickyBtnsParentEl=container.querySelector(".product-form-sticky-parent");
6if(stickyBtnsParentEl){let checkStickyCTA2=function(){var windowHeight=window.innerHeight,stickyBtnsParentHeight=container.querySelector(".product-form__controls-group--submit").offsetHeight,bottomOffsetButton=stickyBtnsParentEl.offsetTop+200,productMetaEl=container.querySelector(".product-single__meta"),window_scrollY=window.scrollY+windowHeight;window_scrollY>bottomOffsetButton?(document.querySelector("body").classList.add("enabled-mobile-sticky"),productMetaEl.classList.add("enabled_mobile_sticky_btns"),window.innerWidth<750&&(document.querySelector(".template-product").style.paddingBottom=stickyBtnsParentHeight+"px",document.documentElement.style.paddingBottom="0px",document.querySelector("body").style.setProperty("--sticky-form-height",document.querySelector(".product-single__meta.enabled_mobile_sticky_btns .product-form .product-form__controls-group--submit").clientHeight+"px"))):(document.querySelector("body").classList.remove("enabled-mobile-sticky"),productMetaEl.classList.remove("enabled_mobile_sticky_btns"),document.querySelector(".template-product").style.paddingBottom="0px",document.querySelector("body").style.setProperty("--sticky-form-height","0px"))};var checkStickyCTA=checkStickyCTA2;document.addEventListener("resize",checkStickyCTA2),document.addEventListener("scroll",checkStickyCTA2)}var form_popup_linkEl=container.querySelector(".form_popup_link");if(form_popup_linkEl&&(document.addEventListener("click",function(e){var target=e.target;if(target.classList.contains("form_popup_link")||target.closest(".form_popup_link")){target.classList.contains("form_popup_link")||(target=target.closest(".form_popup_link")),e.preventDefault();var modal2=document.querySelector(target.getAttribute("href"));modal2&&(document.querySelector("body").classList.add("show_overlay"),document.querySelector("body").classList.add("active_product_form_popup"),modal2.setAttribute("aria-hidden","false"))}}),document.addEventListener("click",function(e){let el=e.target;if(el.classList.contains("close_form_popup")||el.closest(".close_form_popup")){e.preventDefault();var modal2=el.closest(".modal");modal2.setAttribute("aria-hidden","true"),document.querySelector("body").classList.remove("show_overlay"),document.querySelector("body").classList.remove("active_product_form_popup")}}),document.querySelector(".active_product_form_popup"))){var modal=document.querySelector(".form_popup");modal&&(document.querySelector("body").classList.add("show_overlay"),modal.setAttribute("aria-hidden","false"))}if(document.querySelector(".product-main-video")){let onYouTubeAPIReady2=function(){var youtube_player_id=document.querySelector("#youtube-product-video").getAttribute("data-media-id"),player=new YT.Player("youtube-product-video",{height:"586",width:"100%",videoId:youtube_player_id,playerVars:{cc_load_policy:0,iv_load_policy:0,modestbranding:0,playsinline:1,autohide:0,loop:1,playlist:youtube_player_id,branding:0,showinfo:0,rel:0,fs:0,wmode:"opaque"},events:{onReady:onPlayerReady_temp2}})},onPlayerReady_temp2=function(event2){document.querySelector(".youtube-video-trigger").onclick=function(evt){document.querySelector("[data-product-single-media-group]").classList.add("video-playing"),event2.target.playVideo()},document.addEventListener("imageChange",function(){document.querySelector("[data-product-single-media-group]").classList.remove("video-playing"),event2.target.pauseVideo()}),document.querySelector(".product-video-close").onclick=function(){document.querySelector("[data-product-single-media-group]").classList.remove("video-playing"),event2.target.pauseVideo()}};var onYouTubeAPIReady=onYouTubeAPIReady2,onPlayerReady_temp=onPlayerReady_temp2;document.addEventListener("youtubeAPIReady",onYouTubeAPIReady2)}const paypalBox=document.querySelector(".section-cust-product-template .PayPal_box");if(paypalBox){const paypal_method_btns=document.querySelectorAll(".section-cust-product-template .paypal_method .paypal_text a, a.payments"),closeBtn=paypalBox.querySelector(".close_btn");paypal_method_btns.forEach(paypal_method_btn=>{paypal_method_btn.addEventListener("click",e=>{e.preventDefault(),paypalBox&&paypalBox.classList.add("active")})}),closeBtn.addEventListener("click",()=>{paypalBox&&paypalBox.classList.remove("active")});const popupButtons=document.querySelectorAll(".install-content-richtext a[href='#install-service-learn-more']");if(popupButtons.length>0){const richText=document.querySelector(".install-block.block.show .install-content-richtext"),richTextClassList=document.querySelector(".install-block.block.show .install-content-richtext").classList;if(richTextClassList.contains("link")){const href=richText.getAttribute("data-link");popupButtons.forEach(btn=>{btn.href=href,btn.addEventListener("click",function(e){e.stopPropagation()}),btn.target=richTextClassList.contains("open_in_new_page")?"_blank":"_self"})}else if(richTextClassList.contains("popup")){const popupButtonWrapper=document.querySelector(".popup-button-wrapper"),popupCloseButton=document.querySelector(".popup-close-button");popupButtons.forEach(btn=>{btn.addEventListener("click",function(e){e.stopPropagation(),popupButtonWrapper.style.display="block",document.body.classList.add("overflow-hidden")},!1)}),popupCloseButton.addEventListener("click",function(){popupButtonWrapper.style.display="none",document.body.classList.remove("overflow-hidden"),window.history.pushState("",document.title,window.location.pathname+window.location.search)}),popupButtonWrapper.addEventListener("click",function(e){!e.target.classList.contains("popup-button-popup-content")&&!e.target.closest(".popup-button-popup-content")&&(popupButtonWrapper.style.display="none",document.body.classList.remove("overflow-hidden"))})}}}const customPopup=document.querySelector(".section-product-template .custom-popup");if(customPopup){const customHeading=customPopup.querySelector(".custom-popup__content-heading"),customHtml=customPopup.querySelector(".custom-popup__content-html"),customClose=customPopup.querySelector(".custom-popup__close"),customPopupTrigers=document.querySelectorAll(".section-product-template .custom-popup-triger");customClose.addEventListener("click",()=>{customPopup.classList.remove("show")}
6),customPopupTrigers.forEach(item=>{item.addEventListener("click",()=>{const html=item.querySelector(".custom-popup-triger-html");if(html){let content=html.cloneNode(!0);const title=item.dataset.title;customHeading.innerHTML=title,customHtml.innerHTML=content.innerHTML,customPopup.classList.add("show");const popupSwiperElements=customHtml.querySelectorAll(".swiper");popupSwiperElements.length>0&&popupSwiperElements.forEach(elem=>{new Swiper(elem,{slidesPerView:1,pagination:{el:customHtml.querySelector(".swiper-pagination"),clickable:!0},navigation:{nextEl:customHtml.querySelector(".swiper-button-next"),prevEl:customHtml.querySelector(".swiper-button-prev")}})})}})})}const custAccessoryModals=document.querySelectorAll(".cust-accessorie-modal");document.querySelectorAll(".cust-accessorie-modal-trigger").forEach(trigger=>{trigger.addEventListener("click",()=>{const modalId=trigger.getAttribute("data-modal-id"),modal2=document.getElementById(modalId);if(modal2&&(modal2.classList.add("is-open"),document.body.style.overflow="hidden",!modal2.classList.contains("swiper-initialized-flag"))){modal2.classList.add("swiper-initialized-flag");const mainSwiperEl=modal2.querySelector(".cust-accessorie-modal__main-swiper"),thumbsSwiperEl=modal2.querySelector(".cust-accessorie-modal__thumbs-swiper");let thumbsSwiper=null;thumbsSwiperEl&&(thumbsSwiper=new Swiper(thumbsSwiperEl,{spaceBetween:10,slidesPerView:5,freeMode:!0,watchSlidesProgress:!0})),mainSwiperEl&&new Swiper(mainSwiperEl,{slidesPerView:1,spaceBetween:10,navigation:{nextEl:modal2.querySelector(".swiper-button-next"),prevEl:modal2.querySelector(".swiper-button-prev")},pagination:{el:modal2.querySelector(".swiper-pagination"),clickable:!0},thumbs:thumbsSwiper?{swiper:thumbsSwiper}:void 0})}})}),custAccessoryModals.forEach(modal2=>{const closeBtn=modal2.querySelector(".cust-accessorie-modal__close"),overlay=modal2.querySelector(".cust-accessorie-modal__overlay"),closeModal=()=>{modal2.classList.remove("is-open"),document.body.style.overflow=""};closeBtn&&closeBtn.addEventListener("click",closeModal),overlay&&overlay.addEventListener("click",closeModal)});const custBuyButton=document.querySelector(".section-cust-product-template .cust-buy-button__heading-fixed"),custBuyButtonGroupHeading=document.querySelector(".section-cust-product-template .cust-buy-button__heading"),custBuyButtonGroup=document.querySelector(".section-cust-product-template .product-form__controls-group--submit"),custBuyButtonArrow=document.querySelector(".section-cust-product-template .custom-buy-buttons__arrow");custBuyButtonArrow&&custBuyButtonArrow.addEventListener("click",()=>{custBuyButtonArrow.closest(".product-form__controls-group").querySelector(".cust-selected-products").classList.toggle("show")}),document.querySelectorAll(".custom-buybutton-details-popup__wrapper").forEach(function(contentEl){var variantTitleWrapper=contentEl.querySelector(".variant-title__wrapper");if(variantTitleWrapper){variantTitleWrapper.addEventListener("click",function(e){e.stopPropagation();var parentContent=this.closest(".custom-buybutton-details-popup__wrapper");parentContent&&parentContent.toggleAttribute("open")});var custSelectedProducts=contentEl.closest(".cust-selected-products");custSelectedProducts&&custSelectedProducts.addEventListener("click",function(e){(e.target===custSelectedProducts||e.target===contentEl)&&contentEl.removeAttribute("open")}),document.addEventListener("click",function(e){!contentEl.contains(e.target)&&!variantTitleWrapper.contains(e.target)&&contentEl.removeAttribute("open")})}});let hideButton=!1,hideButtonGroup=!1;if(custBuyButton){new ResizeObserver(entries=>{for(let entry of entries)entry.target.style.setProperty("--fixed-height",-1*entry.target.offsetHeight+"px")}).observe(custBuyButtonGroup);const observerCustBuyButton=new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting?hideButton=!1:(hideButton=!0,window.dispatchEvent(new Event("scroll")))})},{root:null,threshold:0});new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting?hideButtonGroup=!1:(hideButtonGroup=!0,window.dispatchEvent(new Event("scroll")))})},{root:null,threshold:0}).observe(custBuyButtonGroupHeading),observerCustBuyButton.observe(custBuyButton);let lastScrollTop=0;window.addEventListener("scroll",()=>{hideButton&&hideButtonGroup?(custBuyButtonGroup.classList.add("fixed"),custBuyButtonGroup.classList.add("active")):(custBuyButtonGroup.classList.remove("fixed"),custBuyButtonGroup.classList.remove("active"));const scrollTop=window.pageYOffset||document.documentElement.scrollTop;scrollTop>lastScrollTop?scrollTop>custBuyButton.offsetTop&&custBuyButtonGroup.classList.add("active"):scrollTop<lastScrollTop&&(scrollTop>custBuyButton.offsetTop||custBuyButtonGroup.classList.add("active")),lastScrollTop=scrollTop<=0?0:scrollTop})}const event=new Event("change",{bubbles:!0});document.querySelectorAll(".section-product-template .install-block .install-checkbox").forEach(block=>{block.addEventListener("click",()=>{const installVariantBlocks=document.querySelectorAll(".section-product-template .install-blocks .install-block.show"),installCustomBlocks=document.querySelectorAll(".section-product-template .custom-variant-items .install-block.show"),el=block.closest(".install-block"),index=Array.prototype.indexOf.call(el.parentNode.children,el),classList1=installVariantBlocks[index].classList,classList2=installCustomBlocks[index].classList;if(classList1.contains("disabled"))return;const isChecked=classList1.contains("checked"),checkbox1=installVariantBlocks[index].querySelector(".install-checkbox_input"),checkbox2=installCustomBlocks[index].querySelector(".install-checkbox_input");checkbox1.checked=!isChecked,checkbox2.checked=!isChecked,checkbox1.dispatchEvent(event),checkbox2.dispatchEvent(event),isChecked?(classList1.remove("checked"),classList2.remove("checked")):(classList1.add("checked"),classList2.add("checked"),installVariantBlocks.forEach(item=>{installVariantBlocks[index]!=item&&(item.classList.remove("checked"),item.querySelector(".install-checkbox_input").checked=!1)}),installCustomBlocks.forEach(item=>{installCustomBlocks[index]!=item&&(item.classList.remove("checked"),item.querySelector(".install-checkbox_input").checked=!1)}))})});const withoutExpansion=document.querySelector(".section-cust-product-template .cust-expand-capacity__without-expansion");withoutExpansion&&withoutExpansion.addEventListener("click",()=>{document.querySelectorAll(".cust-expand-capacity input[name='expand-capacity-quantity']").forEach(temp=>{temp.checked=!1,temp.dispatchEvent(event)})});const custSolarPanelsHeading=document.querySelector(".section-cust-product-template .cust-solar-panels__heading"),customBuyButtonsPrice=document.querySelector(".section-product-template .price-wrapper"),customVaiantItems=document.querySelectorAll(".section-product-template .custom-variant-item"),customVaiantOthers=document.querySelectorAll(".section-cust-product-template .variant-selected-others"),customStickyPrice=document.querySelector(".sticky-price-wrapper .product-sticky-price");var priceFormat=theme.priceCurrencyCodeEnable?theme.moneyFormatWithCurrency:theme.moneyFormat,comparePriceFormat=theme.comparePriceCurrencyCodeEnable?theme.moneyFormatWithCurrency:theme.moneyFormat,formatRegularPrice=function(regularPriceElement,price){regularPriceElement.innerHTML=theme.Currency.formatMoney(price,comparePriceFormat)};
6const quantity_input=document.querySelector(".quantity_block .product-form__input--quantity");quantity_input.closest(".modal__dialog")||inputChange(quantity_input),customVaiantItems.forEach(item=>{item.querySelectorAll("input").forEach(input=>{inputChange(input,item)})});function inputChange(input,item){input.addEventListener("change",e=>{let selected_html="";const product_quantity=quantity_input?parseInt(quantity_input.value):1;let price=(parseInt(customBuyButtonsPrice.dataset.price)||0)*product_quantity,compare_price=(parseInt(customBuyButtonsPrice.dataset.comparePrice)||0)*product_quantity;if(item&&item.classList.contains("cust-solar-panels__item")&&custSolarPanelsHeading){const panelItems=document.querySelectorAll(".section-cust-product-template .cust-solar-panels__item");let powerTotal=0;panelItems.forEach(panelItem=>{panelItem.querySelector("input").checked&&(powerTotal=powerTotal+parseInt(panelItem.dataset.power))}),custSolarPanelsHeading.innerHTML=custSolarPanelsHeading.dataset.title.replace("{total_power}",powerTotal+" W")}document.querySelectorAll(".section-product-template .custom-variant-item input:checked").forEach(inputChecked=>{const variantItem=inputChecked.closest(".custom-variant-item");if(variantItem){let quantity=variantItem.querySelector(".product-form__input--quantity")?parseInt(variantItem.querySelector(".product-form__input--quantity").value):1;variantItem.querySelector(".product-form__input--quantity")&&variantItem.querySelector(".product-form__input--quantity").name=="expand-capacity-quantity"&&(quantity=parseInt(variantItem.querySelector("input[name='expand-capacity-quantity']:checked").value)),price=price+(parseInt(variantItem.dataset.price)||0)*quantity,compare_price=compare_price+(parseInt(variantItem.dataset.comparePrice)||0)*quantity,selected_html=selected_html+'<div class="variant-selected-others__item"><span class="title">'+variantItem.dataset.title+'</span><span class="num">x'+quantity+"</span></div>"}}),customVaiantOthers&&customVaiantOthers.length>0&&customVaiantOthers.forEach(item2=>{item2.innerHTML=selected_html}),customBuyButtonsPrice.querySelector(".regular-price").innerHTML=theme.Currency.formatMoney(price,priceFormat),customStickyPrice&&(customStickyPrice.innerHTML=theme.Currency.formatMoney(price,priceFormat));var wrapperComparePriceEl=customBuyButtonsPrice.querySelector(".compare-price"),wrapperTotalSavingsEl=customBuyButtonsPrice.querySelector(".total-savings");compare_price>0&&compare_price>price?(wrapperComparePriceEl&&(wrapperComparePriceEl.innerHTML=theme.Currency.formatMoney(compare_price,comparePriceFormat)),wrapperTotalSavingsEl&&(wrapperTotalSavingsEl.innerHTML="-"+theme.Currency.formatMoney(compare_price-price,comparePriceFormat))):(wrapperComparePriceEl&&(wrapperComparePriceEl.innerHTML=""),wrapperTotalSavingsEl&&(wrapperTotalSavingsEl.innerHTML="")),document.querySelectorAll("[data-payment-trigger]").forEach(dom=>{dom.setAttribute("data-payment-amount",price/100)}),document.querySelectorAll(".affirm-as-low-as").forEach(function(dom){dom.setAttribute("data-amount",String(Math.round(price)))}),window.affirm&&window.affirm.ui&&typeof window.affirm.ui.refresh=="function"&&window.affirm.ui.refresh();const selectedInput=document.querySelector(".swatch-element input:checked");if(selectedInput){const swatchEle=selectedInput.closest(".swatch-element"),params1=swatchEle.getAttribute("data-params-1"),params2=swatchEle.getAttribute("data-params-2"),params3=swatchEle.getAttribute("data-params-3");document.querySelectorAll(".product-params-block .product-params__item").forEach((item2,index)=>{index==0&&params1?item2.querySelector(".title").innerHTML=params1:index==1&&params2?item2.querySelector(".title").innerHTML=params2:index==2&&params3&&(item2.querySelector(".title").innerHTML=params3)})}})}custSolarPanelsHeading?document.querySelectorAll(".section-cust-product-template .cust-solar-panels__item input")[0].dispatchEvent(event):customVaiantItems[0]&&customVaiantItems[0].querySelectorAll("input")[0].dispatchEvent(event)}return Product.prototype=Object.assign({},Product.prototype,{_stringOverrides:function(){theme.productStrings=theme.productStrings||{},theme.strings=Object.assign({},theme.strings,theme.productStrings)},_initStoreAvailability:function(){this.storeAvailability=new theme.StoreAvailability(this.storeAvailabilityContainer);var storeAvailabilityModalOpenedCallback=function(event){this.cartPopupWrapper&&!this.cartPopupWrapper.classList.contains(this.classes.cartPopupWrapperHidden)&&this._hideCartPopup(event)};this.storeAvailabilityContainer.addEventListener("storeAvailabilityModalOpened",storeAvailabilityModalOpenedCallback.bind(this))},_initVariants:function(){var enableHistoryStateFlag=!1;this.container.getAttribute("data-enable-history-state")=="true"&&(enableHistoryStateFlag=!0);var options={container:this.container,enableHistoryState:enableHistoryStateFlag,singleOptionSelector:this.selectors.singleOptionSelector,singleOptionColorSelector:this.selectors.singleOptionColorSelector,originalSelectorId:this.selectors.originalSelectorId,product:this.productSingleObject,pickAnOption:this.pickAnOption,show_preOrder_btn:this.show_preOrder_btn,enableLinkedOptions:this.enableLinkedOptions};if(this.eventHandlers.updatePrice=this._updatePrice.bind(this),this.eventHandlers.setProductState=this._setProductState.bind(this),this.container.addEventListener("variantPriceChange",this.eventHandlers.setProductState),this.container.addEventListener("variantPriceChange",this.eventHandlers.updatePrice),this.variants=new slate.Variants(options),this.storeAvailability&&this.variants.currentVariant.available&&this.storeAvailability.updateContent(this.variants.currentVariant.id),this.eventHandlers.updateAvailability=this._updateAvailability.bind(this),this.eventHandlers.updateSKU=this._updateSKU.bind(this),this.container.addEventListener("variantChange",this.eventHandlers.updateAvailability),this.container.addEventListener("variantSKUChange",this.eventHandlers.updateSKU),this.pickAnOption){var variantsSize=this.productData.variants.length;if(variantsSize>1){var singleOptionSelectors=this.productForm.querySelectorAll(this.selectors.singleOptionSelector),submitFormButton=this.productForm.querySelector(this.selectors.addToCart);
6if(singleOptionSelectors.length&&singleOptionSelectors.forEach(function(item,index){item.selectedIndex=-1;var opt=document.createElement("option");opt.value="",opt.setAttribute("disabled","disabled"),opt.setAttribute("selected","selected"),opt.innerHTML=theme.strings.pick_an_option,item.prepend(opt)}),submitFormButton){var submitFormButtonText=submitFormButton.querySelector(this.selectors.addToCartText);submitFormButtonText&&(submitFormButton.setAttribute("disabled","disabled"),submitFormButtonText.innerHTML=theme.strings.pick_an_option)}this.productForm.classList.add("disabled_btns"),this.swatchesWrapper&&this.swatchesWrapper.querySelectorAll('[type="radio"]').forEach(function(item,index){item.checked=!1})}}},_initAddToCart:function(){var self2=this,addToCartBtn=this.productForm.querySelector('[type="submit"]');this.productForm.addEventListener("submit",function(e){var originalSelector=document.querySelector(".product-form__variants"),current_variant_id=originalSelector.value,turnkeyState=window.turnkeyInstallationState||{},hasTurnkeyBlock=!!document.querySelector(".turnkey-installation-block"),shouldUseTurnkeyVariant=hasTurnkeyBlock&&turnkeyState.enabled;if(shouldUseTurnkeyVariant&&!turnkeyState.hasValidFee){e.preventDefault(),self2._showErrorMessage(turnkeyState.notSelectVariantError||turnkeyState.defaultError||"Please complete installation information first.");return}var selectedElement=originalSelector.item(originalSelector.selectedIndex),variantPrice=selectedElement.getAttribute("data-price"),qty=document.querySelector(".product-form__input--quantity").value,json=[];if(window.discountSettings.enable&&!window.discountSettings.isGiftpresent){var cartTotal=parseInt(window.discountSettings.cartTotal)+parseInt(variantPrice*qty);window.discountSettings.variantsList.indexOf(current_variant_id)>-1&&cartTotal>=window.discountSettings.minimumCartAmount&&(json.push({id:window.discountSettings.giftProduct,quantity:1,properties:{_isGift:"Yes"}}),window.discountSettings.isGiftpresent=!0,window.discountSettings.cartTotal=cartTotal)}if(document.querySelector('.product-accessories-section[data-variant="'+current_variant_id+'"]')){var accessories_wrap=document.querySelector('.product-accessories-section[data-variant="'+current_variant_id+'"]');accessories_wrap.querySelectorAll(".variant-accessory.selected").length>0&&document.querySelectorAll(".variant-accessory.selected").forEach(function(elem){if(json.push({id:elem.getAttribute("data-variant-id"),quantity:qty}),window.discountSettings.enable&&!window.discountSettings.isGiftpresent){var cartTotal2=parseInt(window.discountSettings.cartTotal)+parseInt(elem.getAttribute("data-price")*qty);window.discountSettings.variantsList.indexOf(elem.getAttribute("data-variant-id"))>-1&&cartTotal2>=window.discountSettings.minimumCartAmount&&(json.push({id:window.discountSettings.giftProduct,quantity:1,properties:{_isGift:"Yes"}}),window.discountSettings.isGiftpresent=!0,window.discountSettings.cartTotal=cartTotal2)}})}var properties={};self2.productForm.querySelectorAll("[name*=properties]").length>0&&self2.productForm.querySelectorAll("[name*=properties]").forEach(function(item,index){var prop_name=item.getAttribute("data-property-name"),prop_value=item.value;properties[prop_name]=prop_value});var mainVariantId=shouldUseTurnkeyVariant?turnkeyState.finalVariantId:document.querySelector(".product-form__variants").value,mainQty=qty||1;json.push({id:mainVariantId,quantity:mainQty,properties});const customVaiantItemInputs=document.querySelectorAll(".section-product-template .custom-variant-item input:checked");customVaiantItemInputs&&customVaiantItemInputs.forEach(inputChecked=>{const variantItem=inputChecked.closest(".custom-variant-item");if(variantItem){let quantity=variantItem.querySelector(".product-form__input--quantity")?parseInt(variantItem.querySelector(".product-form__input--quantity").value):1;variantItem.querySelector(".product-form__input--quantity")&&variantItem.querySelector(".product-form__input--quantity").name=="expand-capacity-quantity"&&(quantity=parseInt(variantItem.querySelector("input[name='expand-capacity-quantity']:checked").value)),variantItem.dataset.shipping?json.push({id:variantItem.dataset.variantId,quantity,properties:{Shipping:variantItem.dataset.shipping}}):json.push({id:variantItem.dataset.variantId,quantity})}});var formData=JSON.stringify({items:json}),headers={"Content-Type":"application/json"};e.preventDefault(),fetch("/cart/add.js",{method:"POST",credentials:"same-origin",headers,body:formData}).then(function(response){return response.json()}).then(function(json2){if(addToCartBtn){(window.enablePromotionsUsingCode||window.autoPromotionsEnable)&&(window.cart_clear=!1,window.promotionValidate());const result=fetch(window.routes.cartUrl+".js",{headers:{"Content-Type":"application/json",Accept:"application/json"}});var addToCartBtnText=addToCartBtn.querySelector("[data-add-to-cart-text]"),addToCartBtnLoader=addToCartBtn.querySelector("[data-loader]"),stickyAddToCartBtnText=document.querySelector("[data-sticky-add-to-cart-text]"),stickyAddToCartBtnLoader=document.querySelector("[data-sticky-loader]");json2.status==422?self2._showErrorMessage(json2.description):(addToCartBtnLoader.classList.remove("hide"),addToCartBtnText.classList.add("hide"),stickyAddToCartBtnText&&(stickyAddToCartBtnLoader.classList.remove("hide"),stickyAddToCartBtnText.classList.add("hide")),setTimeout(function(){theme.Cart.prototype._onProductAdded()},1e3),setTimeout(function(){addToCartBtnText.classList.remove("hide"),addToCartBtnLoader.classList.add("hide"),stickyAddToCartBtnText&&(stickyAddToCartBtnText.classList.remove("hide"),stickyAddToCartBtnLoader.classList.add("hide"));var pre_order_textEl=self2.container.querySelector(".pre_order_text");if(self2.show_preOrder_btn){var originalSelectorId=self2.variants.originalSelectorId,originalSelector2=self2.container.querySelector(originalSelectorId);if(originalSelector2){var selectedElement2=originalSelector2.item(originalSelector2.selectedIndex),inventory_policy=selectedElement2.getAttribute("data-inventory_policy"),inventory_quantity=selectedElement2.getAttribute("data-inventory_quantity")*1;inventory_policy=="continue"&&inventory_quantity<=0&&(addToCartBtnText.innerHTML=theme.strings.preOrder),pre_order_textEl&&pre_order_textEl.classList.add("hide")}}else pre_order_textEl&&pre_order_textEl.classList.add("hide")},2e3))}}).catch(function(error2){console.log(error2),self2._showErrorMessage(error2.isFromServer&&error2.message.length?error2.message:theme.strings.cartError)})})},_initProductVideo:function(){var sectionId=this.settings.sectionId,productMediaTypeVideo=this.container.querySelectorAll(this.selectors.productMediaTypeVideo);productMediaTypeVideo.forEach(function(el){theme.ProductVideo.init(el,sectionId)})},_initModelViewerLibraries:function(){var modelViewerElements=this.container.querySelectorAll(this.selectors.productMediaTypeModel);modelViewerElements.length<1||theme.ProductModel.init(modelViewerElements,this.settings.sectionId)},_initShopifyXrLaunch:function(){this.eventHandlers.initShopifyXrLaunchHandler=this._initShopifyXrLaunchHandler.bind(this),document.addEventListener("shopify_xr_launch",this.eventHandlers.initShopifyXrLaunchHandler)},_initShopifyXrLaunchHandler:function(){var currentMedia=this.container.querySelector(this.selectors.productMediaWrapper+":not(."+self.classes.hidden+")");currentMedia.dispatchEvent(new CustomEvent("xrLaunch",{bubbles:!0,cancelable:!0}))},_showErrorMessage:function(errorMessage){var errorMessageContainer=this.container.querySelector(this.selectors.errorMessage);errorMessageContainer.innerHTML=errorMessage,this.quantityInput&&this.quantityInput.classList.add(this.classes.inputError),this.errorMessageWrapper.classList.remove(this.classes.productFormErrorMessageWrapperHidden),this.errorMessageWrapper.setAttribute("aria-hidden",!0),this.errorMessageWrapper.removeAttribute("aria-hidden")},_hideErrorMessage:function(){this.errorMessageWrapper&&this.errorMessageWrapper.classList.add(this.classes.productFormErrorMessageWrapperHidden),this.quantityInput&&this.quantityInput.classList.remove(this.classes.inputError)},_enableAddToCart:function(message){this.addToCart&&(this.addToCart.removeAttribute("aria-disabled"),this.addToCart.setAttribute("aria-label",message)),this.addToCartText&&(this.addToCartText.innerHTML=message),this.productForm&&this.productForm.classList.remove(this.classes.variantSoldOut),document.querySelector(".sticky-shop-now-btn")&&(document.querySelector(".sticky-shop-now-btn").removeAttribute("disabled"),document.querySelector(".sticky-shop-now-btn").classList.remove("disabled"),document.querySelector(".sticky-shop-now-btn [data-sticky-add-to-cart-text]").innerHTML=message)},_disableAddToCart:function(message){message=message||theme.strings.unavailable,this.addToCart&&(this.addToCart.setAttribute("aria-disabled",!0),this.addToCart.setAttribute("aria-label",message)),this.addToCartText&&(this.addToCartText.innerHTML=message),this.productForm&&this.productForm.classList.add(this.classes.variantSoldOut),document.querySelector(".sticky-shop-now-btn")&&(document.querySelector(".sticky-shop-now-btn").setAttribute("disabled","disabled"),document.querySelector(".sticky-shop-now-btn").classList.add("disabled"),document.querySelector(".sticky-shop-now-btn [data-sticky-add-to-cart-text]").innerHTML=message)},_updateAddToCart:function(){var pre_order_textEl=this.container.querySelector(".pre_order_text"),originalSelectorId=this.variants.originalSelectorId,originalSelector=this.container.querySelector(originalSelectorId),selectedElement=originalSelector.item(originalSelector.selectedIndex),member_only_variant=selectedElement.getAttribute("data-member-only"),display_tiered_msg=selectedElement.getAttribute("data-display-discount-msg"),display_corporate_msg=selectedElement.getAttribute("data-display-corporate-discount-msg"),show_coupon_block=selectedElement.getAttribute("data-show-coupon-block"),shipping_msg=selectedElement.getAttribute("data-shipping-msg");this.container.querySelector("#shipping_message").value=shipping_msg,this.container.querySelector(".variant-amazon-btn")&&(this.container.querySelector(".variant-amazon-btn").style.display="none",document.querySelector(".product-sticky-bar")&&(document.querySelector(".product-sticky-bar .variant-amazon-btn").style.display="none")),selectedElement.getAttribute("data-amazon-btn-link")!=""&&(this.container.querySelector(".variant-amazon-btn").style.display="flex",this.container.querySelector(".variant-amazon-btn").setAttribute("href",selectedElement.getAttribute("data-amazon-btn-link")),document.querySelector(".product-sticky-bar")&&(document.querySelector(".product-sticky-bar .variant-amazon-btn").style.display="flex",document.querySelector(".product-sticky-bar .variant-amazon-btn").setAttribute("href",selectedElement.getAttribute("data-amazon-btn-link")))),selectedElement.getAttribute("data-show-atc")=="false"?(this.container.querySelector(".product-form__cart-submit_wrap").style.display="none",document.querySelector(".sticky-shop-now-btn")&&document.querySelector(".sticky-shop-now-btn").classList.add("hide")):(this.container.querySelector(".product-form__cart-submit_wrap").style.display="block",document.querySelector(".sticky-shop-now-btn")&&document.querySelector(".sticky-shop-now-btn").classList.remove("hide")),document.querySelector(".product-coupon_block")&&(show_coupon_block=="true"?document.querySelector(".product-coupon_block").style.display="block":document.querySelector(".product-coupon_block").style.display="none");const accessory_discount=document.querySelector(".pdp-discounts-wrapper.accessory-discount");accessory_discount&&(accessory_discount.style.display=display_tiered_msg=="true"?"block":"none");const corporate_discount=document.querySelector(".pdp-discounts-wrapper.corporate-discount");corporate_discount&&(corporate_discount.style.display=display_corporate_msg=="true"?"block":"none");const pdp_discounts=document.querySelector(".pdp_discounts");if(pdp_discounts&&(pdp_discounts.style.display=display_corporate_msg=="true"?"grid":"none"),member_only_variant=="true"&&document.querySelectorAll(".member_only_login_btn").length>0?(this.addToCart.parentElement.style.display="none",document.querySelector(".sticky-shop-now-btn")&&document.querySelector(".sticky-shop-now-btn").classList.add("hide"),document.querySelectorAll(".member_only_login_btn").length>0&&document.querySelectorAll(".member_only_login_btn").forEach(function(elem){elem.setAttribute("href","https://account.ecoflow.com/login?return_to="+window.location.href),elem.style.display="block"})):(selectedElement.getAttribute("data-show-atc")==""&&(this.addToCart.parentElement.style.display="block",document.querySelector(".sticky-shop-now-btn")&&document.querySelector(".sticky-shop-now-btn").classList.remove("hide")),document.querySelectorAll(".member_only_login_btn").length>0&&document.querySelectorAll(".member_only_login_btn").forEach(function(elem){elem.style.display="none"})),member_only_variant=="true"?this.container.querySelector(".product-custom-labels .member-only").style.display="block":this.container.querySelector(".product-custom-labels .member-only").style.display="none",this.productState.available||this._disableAddToCart(theme.strings.unavailable),this.productState.soldOut){var soldout_text=selectedElement.getAttribute("data-soldout-text");this._disableAddToCart(soldout_text),pre_order_textEl&&pre_order_textEl.classList.add("hide");return}else document.querySelectorAll(".sold-out-buttons").length>0&&(this.addToCart.closest(".product-form__item--submit").style.display="flex",document.querySelectorAll(".sold-out-buttons").forEach(function(elem){elem.classList.add("hide")}),document.querySelector(".sticky-shop-now-btn")&&document.querySelector(".sticky-shop-now-btn").parentElement.classList.remove("hide"));if(this.show_preOrder_btn){if(originalSelector){var inventory_policy=selectedElement.getAttribute("data-inventory_policy"),inventory_quantity=selectedElement.getAttribute("data-inventory_quantity")*1;inventory_policy=="continue"&&inventory_quantity<=0?(this._enableAddToCart(theme.strings.preOrder),pre_order_textEl&&pre_order_textEl.classList.remove("hide")):(this._enableAddToCart(theme.strings.addToCart),pre_order_textEl&&pre_order_textEl.classList.add("hide"))}}else this._enableAddToCart(theme.strings.addToCart),pre_order_textEl&&pre_order_textEl.classList.add("hide")},_setProductState:function(evt){var variant=evt.detail.variant;if(!variant){this.productState.available=!1;return}const variant_metafields_ele=document.querySelector("[data-variants-custommetafields-json]");let show_price=variant.price;if(variant_metafields_ele){var jsonData=JSON.parse(variant_metafields_ele.innerHTML);jsonData[variant.id]&&(show_price=jsonData[variant.id])}this.productState.available=!0,this.productState.soldOut=!variant.available,this.productState.onSale=variant.compare_at_price>show_price,this.productState.showUnitPrice=!!variant.unit_price},_updateInventoryQuantity:function(evt){var variant=evt.detail.variant;if(variant){var inventory_qty_info=this.container.querySelector(".inventory_qty_info");if(inventory_qty_info){var variantInventoryIcon=this.variantsInventories[variant.id].inventory_icon,variantInventoryType=this.variantsInventories[variant.id].inventory_type,variantInventoryMessage=this.variantsInventories[variant.id].inventory_message,inventory_icon_statusEl=this.container.querySelector(".product-form__inventory-icon-status"),inventory_iconEl=inventory_icon_statusEl.querySelector("load-icon"),inventory_textEl=this.container.querySelector(".product-form__inventory-text");inventory_icon_statusEl.classList.remove("text-success"),inventory_icon_statusEl.classList.remove("text-warning"),inventory_icon_statusEl.classList.remove("text-danger"),inventory_icon_statusEl.classList.add("text-"+variantInventoryType),inventory_iconEl.setAttribute("name",variantInventoryIcon),inventory_iconEl.render(),inventory_textEl.innerHTML=variantInventoryMessage}
6var back_in_stock_row=this.container.querySelector(".back_in_stock_row");back_in_stock_row&&(variant.available?back_in_stock_row.classList.add("hide"):back_in_stock_row.classList.remove("hide"));var contant_form_current_variant_title=document.querySelector("#contant_form_current_variant_title");contant_form_current_variant_title&&(contant_form_current_variant_title.value=variant.title)}},_updateAvailability:function(evt){this._hideErrorMessage(),this._setProductState(evt),this._updateInventoryQuantity(evt),this._updateStoreAvailabilityContent(evt),this._updatePriceComponentStyles(evt),this._updateAddToCart()},_updateStoreAvailabilityContent:function(evt){this.storeAvailability&&(this.productState.available&&!this.productState.soldOut?this.storeAvailability.updateContent(evt.detail.variant.id):this.storeAvailability.clearContent())},_hidePriceComponent:function(){this.priceContainer.classList.add(this.classes.productUnavailable),this.priceContainer.setAttribute("aria-hidden",!0),this.productPolicies&&this.productPolicies.classList.add(this.classes.visibilityHidden)},_updatePriceComponentStyles:function(evt){var variant=evt.detail.variant;if(this.priceContainer){var unitPriceBaseUnit=this.priceContainer.querySelector(this.selectors.unitPriceBaseUnit);if(!this.productState.available){this._hidePriceComponent();return}this.productState.soldOut?this.priceContainer.classList.add(this.classes.productSoldOut):this.priceContainer.classList.remove(this.classes.productSoldOut),this.productState.showUnitPrice?(unitPriceBaseUnit.innerHTML=this._getBaseUnit(variant),this.priceContainer.classList.add(this.classes.productUnitAvailable)):this.priceContainer.classList.remove(this.classes.productUnitAvailable),this.productState.onSale?this.priceContainer.classList.add(this.classes.productOnSale):this.priceContainer.classList.remove(this.classes.productOnSale),this.priceContainer.classList.remove(this.classes.productUnavailable),this.priceContainer.removeAttribute("aria-hidden"),this.productPolicies&&this.productPolicies.classList.remove(this.classes.visibilityHidden)}},_updatePrice:function(evt){var variant=evt.detail.variant;if(variant&&this.variants&&!this.container.closest(".modal__inner")){var masterSelect=this.container.querySelector(this.variants.originalSelectorId);if(masterSelect&&masterSelect.selectedIndex>=0){var masterOption=masterSelect.item(masterSelect.selectedIndex);if(masterOption){var templateView=masterOption.getAttribute("data-template");if(templateView&&this.variants.currentVariant&&this.variants.currentVariant.id!=variant.id){var variantUrl=masterOption.getAttribute("data-url");if(variantUrl){window.location.href=variantUrl+"&view="+templateView;return}}}}}const customBuyButtonsPrice=document.querySelector(".section-product-template .price-wrapper");if(this.priceContainer&&this.variants){const variant_metafields_ele=document.querySelector("[data-variants-custommetafields-json]");let show_price=variant.price;if(variant_metafields_ele){var jsonData=JSON.parse(variant_metafields_ele.innerHTML);jsonData[variant.id]&&(show_price=jsonData[variant.id])}var originalSelectorId=this.variants.originalSelectorId,originalSelector=this.container.querySelector(originalSelectorId),selectedElement=originalSelector&&originalSelector.selectedIndex>=0?originalSelector.item(originalSelector.selectedIndex):null,variant_show_price=selectedElement?selectedElement.getAttribute("data-show-price"):null,regularPrices=this.priceContainer.querySelectorAll(this.selectors.regularPrice),salePrice=this.priceContainer.querySelector(this.selectors.salePrice),savings=this.priceContainer.querySelector(this.selectors.savings),unitPrice=this.priceContainer.querySelector(this.selectors.unitPrice),priceFormat=theme.priceCurrencyCodeEnable?theme.moneyFormatWithCurrency:theme.moneyFormat,comparePriceFormat=theme.comparePriceCurrencyCodeEnable?theme.moneyFormatWithCurrency:theme.moneyFormat,formatRegularPrice=function(regularPriceElement,price){regularPriceElement.innerHTML=theme.Currency.formatMoney(price,comparePriceFormat)},getRedeemablePointsApi=async({price,variantId})=>{const isEcoCreditMsgEnabled=document.querySelector("#sidebar-cart").getAttribute("data-enabled-ecocredit-msg");
6if(!JSON.parse(isEcoCreditMsgEnabled))return;const{apiDomain,acceptedLanguage,xAppid}=theme.emailSubscription;if(document.querySelector(".product-ecocredits-message__wrapper")){const ecocreditMsgBox=document.querySelector(".product-ecocredits-message__wrapper");if(ecocreditMsgBox.hasAttribute("x-data"))return;const productId=ecocreditMsgBox.getAttribute("data-product-id");if(!productId)return;try{const data=await(await fetch(`${apiDomain}/integral/web/pointsCashRule/getRule`,{method:"POST",headers:{"Content-Type":"application/json","x-appid":xAppid,traceId:generateTraceId(),"Accept-Language":acceptedLanguage},body:JSON.stringify({productList:[{productId,variantId:`${variantId}`,quantity:1,price:`${price/100}`}],source:"CART"})})).json();if(data.code==="0"&&data.data&&data.data.maxPoints){ecocreditMsgBox.style.display="flex";const priceText=document.querySelector(".product-ecocredits-message__price");priceText.innerText="$"+Number(data.data.maxPoints*data.data.ratio).toFixed(2).toLocaleString()}else ecocreditMsgBox.style.display="none"}catch(error2){ecocreditMsgBox.style.display="none",console.error(error2.message)}}};if(this.productState.onSale){if(regularPrices.forEach(function(regularPrice){formatRegularPrice(regularPrice,variant.compare_at_price)}),getRedeemablePointsApi({price:variant.price,variantId:variant.id}),variant_show_price=="false"){var priceStr=theme.Currency.formatMoney("99900",priceFormat);salePrice.innerHTML=priceStr.replace("999.00","???")}else salePrice.innerHTML=theme.Currency.formatMoney(show_price,priceFormat);variant_show_price=="false"?savings.innerHTML="":savings.innerHTML="-"+theme.Currency.formatMoney(variant.compare_at_price-show_price,theme.moneyFormat)}else{if(variant_show_price=="false"){var priceStr=theme.Currency.formatMoney("99900",priceFormat);regularPrices.forEach(function(regularPrice){regularPrice.innerHTML=priceStr.replace("999.00","???")})}else regularPrices.forEach(function(regularPrice){formatRegularPrice(regularPrice,show_price)});getRedeemablePointsApi({price:variant.price,variantId:variant.id})}if(document.querySelector(".sticky-price-wrapper .product-sticky-price"))if(variant_show_price=="false"){var priceStr=theme.Currency.formatMoney("99900",priceFormat);document.querySelector(".sticky-price-wrapper .product-sticky-price").innerHTML=priceStr.replace("999.00","???")}else document.querySelector(".sticky-price-wrapper .product-sticky-price").innerHTML=theme.Currency.formatMoney(show_price,priceFormat);var inputEl=document.querySelector(".quantity_block .product-form__input--quantity")||document.querySelector('[name="quantity"]'),qty=inputEl&&parseInt(inputEl.value,10)||1,discount=1;qty>=5&&qty<=10&&(discount=7),qty>=11&&qty<=20&&(discount=9),qty>20&&(discount=10);var total_regular_price=show_price;if(this.productState.onSale)var total_compare_price=variant.compare_at_price,total_saving=variant.compare_at_price-show_price;else var total_compare_price=show_price,total_saving=0;if(document.querySelector(".product-container").getAttribute("data-discount-product")=="true"&&discount>1&&(total_compare_price=total_regular_price,total_regular_price=total_regular_price-total_regular_price*discount/100,total_saving=total_compare_price-total_regular_price),document.querySelector('.product-accessories-section[data-variant="'+variant.id+'"]')){var accessories_wrap=document.querySelector('.product-accessories-section[data-variant="'+variant.id+'"]');accessories_wrap.querySelectorAll(".variant-accessory.selected").length>0&&accessories_wrap.querySelectorAll(".variant-accessory.selected").forEach(function(elem){var accessory_price=parseInt(elem.getAttribute("data-price")),accessory_compare_price=parseInt(elem.getAttribute("data-compare-price"));accessory_compare_price==0&&(accessory_compare_price=elem.getAttribute("data-price"));var accessory_saving=parseInt(elem.getAttribute("data-saving"));elem.getAttribute("data-discount-accessory")=="true"&&discount>1&&(accessory_compare_price=accessory_price,accessory_price=accessory_price-accessory_price*discount/100,accessory_saving=accessory_compare_price-accessory_price),total_regular_price=total_regular_price+accessory_price,total_compare_price=total_compare_price+accessory_compare_price,total_saving=total_saving+accessory_saving})}var submitPriceWrapper=document.querySelector(".product-form__controls-group--submit .price-wrapper");if(submitPriceWrapper){var variantCompareAtPrice=variant.compare_at_price||0,variantSaving=variantCompareAtPrice>show_price?variantCompareAtPrice-show_price:0;submitPriceWrapper.setAttribute("data-price",show_price),submitPriceWrapper.setAttribute("data-compare-price",variantCompareAtPrice),submitPriceWrapper.setAttribute("data-saving",variantSaving);var wrapperRegularPrice=submitPriceWrapper.querySelector(".regular-price"),wrapperComparePrice=submitPriceWrapper.querySelector(".compare-price"),wrapperTotalSavings=submitPriceWrapper.querySelector(".total-savings");wrapperRegularPrice&&(wrapperRegularPrice.innerHTML=theme.Currency.formatMoney(total_regular_price*qty,priceFormat)),wrapperComparePrice&&(total_compare_price>0&&total_compare_price>total_regular_price?wrapperComparePrice.innerHTML=theme.Currency.formatMoney(total_compare_price*qty,comparePriceFormat):wrapperComparePrice.innerHTML=""),wrapperTotalSavings&&(total_saving>0?wrapperTotalSavings.innerHTML="-"+theme.Currency.formatMoney(total_saving*qty,theme.moneyFormat):wrapperTotalSavings.innerHTML="")}document.querySelectorAll(".product-form__controls-group--submit .cust-selected-products .variant-price .regular-price").forEach(function(regularPriceEl){if(variant_show_price=="false"){var hiddenPriceStr=theme.Currency.formatMoney("99900",priceFormat);regularPriceEl.innerHTML=hiddenPriceStr.replace("999.00","???")}
6else regularPriceEl.innerHTML=theme.Currency.formatMoney(show_price,priceFormat)}),document.querySelectorAll(".product-form__controls-group--submit .cust-selected-products .variant-price .compare-price").forEach(function(comparePriceEl){variant.compare_at_price>show_price?comparePriceEl.innerHTML=theme.Currency.formatMoney(variant.compare_at_price,comparePriceFormat):comparePriceEl.innerHTML=""}),document.querySelectorAll(".product-form__controls-group--submit .cust-selected-products .variant-title").forEach(function(variantTitleEl){variantTitleEl.innerText=variant.title});var quantityBlockInput=document.querySelector(".quantity_block .product-form__input--quantity");quantityBlockInput&&quantityBlockInput.dispatchEvent(new Event("change",{bubbles:!0})),this.productState.showUnitPrice&&(unitPrice.innerHTML=theme.Currency.formatMoney(variant.unit_price,theme.moneyFormat));var affirmMessageVariantItems=this.productForm.querySelectorAll(".affirm-message-container .affirm-message-item"),affirmMessageSelectedVariantItem=this.productForm.querySelectorAll(`.affirm-message-container [data-variant-id="${variant.id}"]`);affirmMessageVariantItems&&affirmMessageVariantItems.forEach(item=>item.classList.remove("selected")),affirmMessageSelectedVariantItem&&affirmMessageSelectedVariantItem.forEach(item=>item.classList.add("selected")),document.querySelectorAll(".product-single__title span").length>0&&(document.querySelector(".product-single__title span.selected").classList.remove("selected"),document.querySelector('.product-single__title span[data-variant="'+variant.title+'"]').classList.add("selected")),document.querySelectorAll(".product-title-label-container .promotion-labels-wrapper").forEach(item=>{item.dataset.variant==variant.title?item.classList.add("selected"):item.classList.remove("selected")}),document.querySelectorAll(".sticky-product-info-bar .product-name span").length>0&&(document.querySelector(".sticky-product-info-bar .product-name span.selected").classList.remove("selected"),document.querySelector('.sticky-product-info-bar .product-name span[data-variant="'+variant.title+'"]').classList.add("selected"))}else if(customBuyButtonsPrice){const variant_metafields_ele=document.querySelector("[data-variants-custommetafields-json]");let show_price=variant.price;if(variant_metafields_ele){var jsonData=JSON.parse(variant_metafields_ele.innerHTML);jsonData[variant.id]&&(show_price=jsonData[variant.id])}customBuyButtonsPrice.dataset.price=show_price,customBuyButtonsPrice.dataset.comparePrice=variant.compare_at_price,customBuyButtonsPrice.dataset.saving=variant.compare_at_price-show_price;const updateItem=document.querySelector(".quantity_block .product-form__input--quantity");updateItem&&updateItem.dispatchEvent(new Event("change",{bubbles:!0})),document.querySelectorAll(".cust-selected-products").forEach(custSelectedProducts=>{const variantTitle=custSelectedProducts.querySelector(".variant-title"),regularPrice=custSelectedProducts.querySelector(".variant-price .regular-price"),comparePrice=custSelectedProducts.querySelector(".variant-price .compare-price"),variantSelectedOthers=custSelectedProducts.querySelector(".variant-selected-others");variantTitle&&(variantTitle.innerText=variant.title),regularPrice&&(regularPrice.innerHTML=theme.Currency.formatMoney(variant.price,theme.moneyFormat)),comparePrice&&(variant.compare_at_price>variant.price?comparePrice.innerHTML=theme.Currency.formatMoney(variant.compare_at_price,theme.moneyFormat):comparePrice.innerHTML=""),variantSelectedOthers&&(variantSelectedOthers.innerHTML="")}),document.querySelectorAll(".product-single__title span").forEach(item=>{item.dataset.variant==variant.title?item.classList.add("selected"):item.classList.remove("selected")}),document.querySelectorAll(".product-title-label-container .promotion-labels-wrapper").forEach(item=>{item.dataset.variant==variant.title?item.classList.add("selected"):item.classList.remove("selected")}),document.querySelectorAll(".sticky-product-info-bar .product-name span").length>0&&(document.querySelector(".sticky-product-info-bar .product-name span.selected").classList.remove("selected"),document.querySelector('.sticky-product-info-bar .product-name span[data-variant="'+variant.title+'"]').classList.add("selected"))}},_getBaseUnit:function(variant){return variant.unit_price_measurement.reference_value===1?variant.unit_price_measurement.reference_unit:variant.unit_price_measurement.reference_value+variant.unit_price_measurement.reference_unit},_updateSKU:function(evt){var variant=evt.detail.variant,sku=document.querySelector(this.selectors.SKU);if(sku){sku.innerHTML=variant.sku;var contant_form_current_variant_sku=document.querySelector("#contant_form_current_variant_sku");contant_form_current_variant_sku&&(contant_form_current_variant_sku.value=variant.sku)}},_initSwatches:function(){const _this=this;this.swatchesWrapper&&this.swatchesWrapper.querySelectorAll('[type="radio"]').forEach(function(item,index){item.addEventListener("change",function(e){var optionIndex=this.closest(".swatch").getAttribute("data-option-index"),optionValue=this.value.replace(/\s{2,}/g," "),triggerSelectEl=this.closest("form").querySelectorAll(".single-option-selector")[optionIndex];triggerSelectEl&&(this.closest(".swatch-element").classList.add("variant-active"),triggerSelectEl.value=optionValue,triggerSelectEl.dispatchEvent(new Event("change",{bubbles:!0})));const variantId=document.querySelector(".product-form__variants").value;console.log("variantId",variantId);const installServiceBlock=document.querySelector(".install-block.show");if(console.log("installServiceBlock",installServiceBlock),installServiceBlock&&installServiceBlock.classList.contains("checked")){const price=installServiceBlock.getAttribute("data-price"),compare_price=installServiceBlock.getAttribute("data-compare-price");var priceElement=document.querySelector(".product-form__controls-group--submit .price-wrapper"),orig_regular_price=priceElement.getAttribute("data-price"),orig_compare_price=priceElement.getAttribute("data-compare-price"),orig_saving=priceElement.getAttribute("data-saving"),priceFormat=theme.priceCurrencyCodeEnable?theme.moneyFormatWithCurrency:theme.moneyFormat,saving=compare_price-price;orig_regular_price=parseInt(orig_regular_price)-parseInt(price),orig_compare_price=parseInt(orig_compare_price)-parseInt(compare_price),orig_saving=parseInt(orig_saving)-parseInt(saving),priceElement.dataset.price=orig_regular_price,priceElement.dataset.comparePrice=orig_compare_price,priceElement.dataset.saving=orig_saving}const installServiceBlocks=document.querySelectorAll(".install-block");console.log("installServiceBlocks",installServiceBlocks),installServiceBlocks.forEach(serviceBlock=>{if(console.log("serviceBlock.dataset.productVariant",serviceBlock.dataset.productVariant),parseInt(variantId)===parseInt(serviceBlock.dataset.productVariant)){serviceBlock.classList.add("show"),serviceBlock.classList.remove("checked"),serviceBlock.classList.remove("disabled");const installCheckbox=serviceBlock.querySelector(".install-checkbox_input");installCheckbox&&(installCheckbox.checked=!1),_this.productState.available||serviceBlock.classList.add("disabled")}else serviceBlock.classList.remove("show")}),document.querySelectorAll(".install-promo-block[data-product-variant]").forEach(promoBlock=>{parseInt(variantId,10)===parseInt(promoBlock.dataset.productVariant,10)?(promoBlock.classList.add("show"),_this.productState.available?promoBlock.classList.remove("disabled"):promoBlock.classList.add("disabled")):promoBlock.classList.remove("show")})})});for(var productJSON=this.productSingleObject,i2=0,length=productJSON.variants.length;i2<length;i2++){var productVariants=productJSON.variants[i2];if(productVariants.available)for(var j=0,optlength=productVariants.options.length;j<optlength;j++){var variantOption=productVariants.options[j];variantOption=handleizeStr(variantOption);var active_swatchEl=this.container.querySelector('.swatch[data-option-index="'+j+'"] .swatch_'+variantOption);active_swatchEl&&(active_swatchEl.classList.remove("soldout"),active_swatchEl.classList.add("available"),active_swatchEl.querySelector('[type="radio"]').removeAttribute("disabled"))}}},onUnload:function(){this.container.removeEventListener("variantChange",this.eventHandlers.updateAvailability),this.container.removeEventListener("variantPriceChange",this.eventHandlers.updatePrice),this.container.removeEventListener("variantSKUChange",this.eventHandlers.updateSKU),theme.ProductVideo.removeSectionVideos(this.settings.sectionId),theme.ProductModel.removeSectionModels(this.settings.sectionId)}}),Product})(),theme.ProductRecommendations=(function(){function ProductRecommendations(container){var baseUrl=container.dataset.baseUrl,productId=container.dataset.productId,sectionId=container.dataset.sectionId,recommendationsSectionUrl=baseUrl+"?section_id="+sectionId+"&product_id="+productId+"&limit=4";window.performance.mark("pursuit:product:fetch_product_recommendations.start"),fetch(recommendationsSectionUrl).then(function(response){return response.text()}).then(function(productHtml){if(productHtml.trim()!==""){container.innerHTML=productHtml,container.innerHTML=container.firstElementChild.innerHTML;var formsArr=container.querySelectorAll('[action="/cart/add"]');formsArr.length&&formsArr.forEach(function(form,index){theme.AddItemToCart(form)}),theme.ProductItemSwatches();var zoomFadeAnimationElems=container.querySelectorAll(".zoom-fade-animation:not(.zoomFade-animation)");
6zoomFadeAnimationElems.length&&zoomFadeAnimationElems.forEach(function(block,index){var containerPosition=block.getBoundingClientRect();containerPosition.top+200<window.innerHeight&&block.classList.add("zoomFade-animation")}),window.performance.mark("pursuit:product:fetch_product_recommendations.end"),performance.measure("pursuit:product:fetch_product_recommendations","pursuit:product:fetch_product_recommendations.start","pursuit:product:fetch_product_recommendations.end")}})}return ProductRecommendations})(),theme.Quotes=(function(){function Quotes(container){this.container=container;var sectionId=container.getAttribute("data-section-id");if(this.slider=container.querySelector(".testimonials_slider[data-flickity-config]"),this.slider){this.options=JSON.parse(this.slider.getAttribute("data-flickity-config"));var flickityInstance2=new Flickity(this.slider,this.options);flickityInstance2.element.classList.add("rendered");var slider_custom_arrows=container.querySelector(".slider_custom_arrows");if(slider_custom_arrows){var slider_custom_btns=slider_custom_arrows.querySelectorAll(".btn");slider_custom_btns.forEach(function(item,index){item.addEventListener("click",function(e){e.preventDefault();var isNext=item.classList.contains("button-next");isNext?flickityInstance2.next():flickityInstance2.previous()})})}}}return Quotes})(),theme.FlickitySlideshowSection=(function(){function FlickitySlideshowSection(container){this.container=container;var sectionId=container.dataset.sectionId,sliderEl=container.querySelector("#Slideshow-"+sectionId),slider_options=JSON.parse(sliderEl.getAttribute("data-flickity-options"));container.querySelectorAll("[data-ecoflow-critical-dots]").forEach(function(node){node.remove()}),this.flickityInstance=new Flickity(sliderEl,slider_options),this.flickityInstance.element.classList.add("rendered");var flickityInstance2=this.flickityInstance,isOptimizedHomeHero=container.dataset.homeHeroOptimized==="true";function markHomeHeroInteraction(){isOptimizedHomeHero&&(container.dataset.homeHeroInteracted="true",container.dispatchEvent(new CustomEvent("ecoflow:home-hero-interaction")))}function fallbackHydrateHomeHeroSlide(slide){if(!slide)return Promise.resolve();if(slide.__homeSlideFallbackHydration)return slide.__homeSlideFallbackHydration;slide.querySelectorAll("source[data-home-slide-srcset], source[data-srcset]").forEach(function(source){var srcset=source.getAttribute("data-home-slide-srcset")||source.getAttribute("data-srcset");srcset&&(source.setAttribute("srcset",srcset),source.removeAttribute("data-home-slide-srcset"),source.removeAttribute("data-srcset"))});var images=Array.prototype.slice.call(slide.querySelectorAll("img.slideshow__image"));return images.forEach(function(image){var src=image.getAttribute("data-home-slide-src")||image.getAttribute("data-src"),srcset=image.getAttribute("data-home-slide-srcset")||image.getAttribute("data-srcset"),wasDeferred=!!(src||srcset);srcset&&(image.setAttribute("srcset",srcset),image.removeAttribute("data-home-slide-srcset"),image.removeAttribute("data-srcset")),src&&(image.setAttribute("src",src),image.removeAttribute("data-home-slide-src"),image.removeAttribute("data-src")),wasDeferred&&image.setAttribute("loading","eager")}),slide.__homeSlideFallbackHydration=Promise.all(images.map(function(image){return image.complete&&image.naturalWidth>0?image.decode?image.decode().catch(function(){}):Promise.resolve():new Promise(function(resolve){var done=function(){image.removeEventListener("load",done),image.removeEventListener("error",done),image.decode?image.decode().catch(function(){}).then(resolve):resolve()};image.addEventListener("load",done,{once:!0}),image.addEventListener("error",done,{once:!0})})})),slide.__homeSlideFallbackHydration}function prepareHomeHeroSlide(slide){return markHomeHeroInteraction(),typeof container.ecoflowWarmSlide=="function"?container.ecoflowWarmSlide(slide):isOptimizedHomeHero?(container.ecoflowWarmSlide=fallbackHydrateHomeHeroSlide,fallbackHydrateHomeHeroSlide(slide)):Promise.resolve()}const dots=sliderEl.querySelector(".flickity-page-dots");if(this.container.classList.contains("hp-slideshow")&&slider_options.customAutoPlay){let isPaused=!1,pausedTime=0,pausedElapsed=0,progressRafId=null;this.container.addEventListener("mouseenter",()=>{isPaused=!0,pausedTime=Date.now(),pausedElapsed=Date.now()-startTime}),this.container.addEventListener("mouseleave",()=>{isPaused=!1,startTime=Date.now()-pausedElapsed});let startTime=Date.now();const canStartProgress=()=>!isOptimizedHomeHero||container.dataset.homeHeroInteracted==="true",scheduleProgress=()=>{!canStartProgress()||progressRafId||(progressRafId=requestAnimationFrame(updateProgress))};let updateProgress=()=>
6{if(progressRafId=null,!!canStartProgress())if(isPaused)scheduleProgress();else{let elapsed=Date.now()-startTime,progress=Math.min(elapsed/slider_options.customAutoPlay*100,100);dots&&dots.style.setProperty("--current-progress",`${progress}%`),progress<100?scheduleProgress():flickityInstance2.next()}},updateDotStyle=()=>{if(!dots)return;let selectedSlide=this.container.querySelector(".slideshow__slide.is-selected");selectedSlide&&selectedSlide.dataset.headerTheme&&(this.container.querySelector(".flickity-page-dots").dataset.theme=this.container.querySelector(".slideshow__slide.is-selected").dataset.headerTheme)};updateDotStyle(),this.flickityInstance.on("change",index=>{updateDotStyle(),dots&&dots.style.setProperty("--current-progress","0%"),startTime=Date.now(),isPaused=!1,scheduleProgress()}),this.container.addEventListener("ecoflow:home-hero-interaction",()=>{canStartProgress()&&(startTime=Date.now(),scheduleProgress())}),scheduleProgress()}var slider_custom_arrows=container.querySelector(".slideshow__arrows");if(slider_custom_arrows){var slider_custom_btns=slider_custom_arrows.querySelectorAll(".btn");slider_custom_btns.forEach(function(item,index){item.addEventListener("click",function(e){if(e.preventDefault(),container.dataset.homeHeroOptimized==="true"){var currentIndex=flickityInstance2.selectedIndex||0,targetIndex=item.classList.contains("slideshow__arrow-next")?currentIndex+1:currentIndex-1,targetSlide=container.querySelectorAll(".slideshow__slide")[(targetIndex+container.querySelectorAll(".slideshow__slide").length)%container.querySelectorAll(".slideshow__slide").length];container.dataset.homeHeroInteracted="true",prepareHomeHeroSlide(targetSlide)}window.innerWidth>750&&flickityInstance2.stopPlayer();var isNext=item.classList.contains("slideshow__arrow-next");isNext?flickityInstance2.next():flickityInstance2.previous()})})}if(document.querySelectorAll(".disclaimer_container").length>0){let alignDisclaimerBlock2=function(){document.querySelectorAll(".disclaimer_container").forEach(function(elem){var blockElem=elem.parentElement.parentElement,blockTextElem=blockElem.querySelector(".slideshow__text-content"),blockHeight=parseInt(blockTextElem.clientHeight);if(blockHeight>0){var blockOffset=parseInt(blockTextElem.offsetTop),blockLeftOffset=parseInt(blockTextElem.querySelector(".slideshow_text_wrapper").offsetLeft);if(elem.classList.contains("block-right"))var blockRightOffset=window.innerWidth-blockLeftOffset-parseInt(blockTextElem.querySelector(".slideshow_text_wrapper").offsetWidth);var style=window.getComputedStyle(blockTextElem),matrix=new WebKitCSSMatrix(style.transform),blockTranslate=matrix.m42,blockXTranslate=matrix.m41;elem.querySelector(".block_disclaimer_box").style.top=blockHeight+blockOffset+blockTranslate+"px",elem.classList.contains("block-right")?elem.querySelector(".block_disclaimer_box").style.right=blockRightOffset+"px":elem.querySelector(".block_disclaimer_box").style.left=blockLeftOffset+blockXTranslate+"px"}else elem.querySelector(".block_disclaimer_box").style.top="50%",elem.querySelector(".block_disclaimer_box").style.left="50%",elem.querySelector(".block_disclaimer_box").style.transform="translate(-50%, -50%)";elem.querySelector(".disclaimer_popup_box_wrap")&&(elem.querySelector(".disclaimer_popup_close").onclick=function(){elem.querySelector(".disclaimer_popup_box_wrap").classList.add("hidden")},elem.querySelector(".disclaimer_popup_box_wrap").onmouseover=function(){elem.querySelector(".disclaimer_popup_box_wrap").classList.remove("hidden")})})};var alignDisclaimerBlock=alignDisclaimerBlock2;window.innerWidth>1240?alignDisclaimerBlock2():(document.querySelectorAll(".disclaimer_popup_box_wrap").forEach(function(elem){elem.onclick=function(){document.querySelector(".disclaimer_popup_box_m").innerHTML=elem.querySelector(".disclaimer_popup_box_inner").innerHTML,document.querySelector(".disclaimer_popup_box_m").style.display="block",document.querySelector("html").classList.add("add-overlay");var popupElem=document.querySelector(".disclaimer_popup_box_m");popupElem.querySelector(".disclaimer_popup_close").onclick=function(){document.querySelector(".disclaimer_popup_box_m").innerHTML="",document.querySelector(".disclaimer_popup_box_m").style.display="none",document.querySelector("html").classList.remove("add-overlay")}}}),document.querySelectorAll(".block_disclaimer_box_close").forEach(function(elem){elem.onclick=function(){elem.parentElement.parentElement.style.display="none"}})),window.onresize=function(){window.innerWidth>1240&&alignDisclaimerBlock2()}}this.flickityInstance.on("change",function(index){var activeSlide=container.querySelectorAll(".slideshow__slide")[index];if(activeSlide){var revealSlide=prepareHomeHeroSlide(activeSlide);Promise.resolve(revealSlide).then(function(){container.querySelectorAll(".slideshow__slide").forEach(function(slide,slideIndex){var isActive=slideIndex===index;slide.classList.toggle("slideshow__slide--active",isActive),container.dataset.homeHeroOptimized==="true"&&slide.setAttribute("aria-hidden",isActive?"false":"true")})})}}),this.container.classList.contains("hp-slideshow")&&this.container.dataset.matchHeader&&this.flickityInstance.on("change",function(index){container.querySelectorAll(".slideshow__slide")[index].dataset.headerTheme&&document.querySelector(".float-header")&&(document.querySelector(".float-header").classList.remove("header-theme-white"),document.querySelector(".float-header").classList.remove("header-theme-black"),document.querySelector(".float-header").classList.add("header-theme-"+container.querySelectorAll(".slideshow__slide")[index].dataset.headerTheme))})}return FlickitySlideshowSection.prototype=Object.assign({},FlickitySlideshowSection.prototype,{onUnload:function(){this.flickityInstance.destroy()},onBlockSelect:function(evt){var slide=this.container.querySelector(".slideshow__slide--"+evt.detail.blockId),slideIndex=sli
6de.getAttribute("data-slider-slide-index");this.flickityInstance.select(slideIndex),this.flickityInstance.pausePlayer()},onBlockDeselect:function(){this.flickityInstance.playPlayer()}}),FlickitySlideshowSection})(),theme.SlideshowSection=(function(){var selectors2={sliderMobileContentIndex:"[data-slider-mobile-content-index]"};function SlideshowSection(container){var sectionId=container.dataset.sectionId,self2=this;this.container=container,this.eventHandlers={},this.slideshowDom=container.querySelector("#Slideshow-"+sectionId),this.sliderMobileContentIndex=container.querySelectorAll(selectors2.sliderMobileContentIndex),this.slideshowDom&&(this.slideshow=new theme.Slideshow(container,{autoplay:this.slideshowDom.getAttribute("data-autorotate")==="true",slideInterval:this.slideshowDom.getAttribute("data-speed")}),this._setupEventListeners())}return SlideshowSection})(),theme.SlideshowSection.prototype=Object.assign({},theme.SlideshowSection.prototype,{_setupEventListeners:function(){this.eventHandlers.onSliderSlideChanged=function(event){this._onSliderSlideChanged(event.detail)}.bind(this),this.container.addEventListener("slider_slide_changed",this.eventHandlers.onSliderSlideChanged),this.container.dispatchEvent(new Event("slider_slide_changed",{bubbles:!0}))},_onSliderSlideChanged:function(slideIndex){var activeClass="slideshow__text-content--mobile-active";this.sliderMobileContentIndex.forEach(function(element2){Number(element2.getAttribute("data-slider-mobile-content-index"))===slideIndex?element2.classList.add(activeClass):element2.classList.remove(activeClass)});var videoSlides=this.container.querySelectorAll(".block_type__video"),_this=this;if(videoSlides.length){var activeSlide=_this.container.querySelector(".slideshow__slide--active");if(activeSlide&&activeSlide.classList.contains("block_type__video")){var isVideoTag=activeSlide.querySelector("video");if(isVideoTag){var videoId=isVideoTag.getAttribute("id"),videoObj=document.getElementById(videoId);videoObj&&videoObj.play()}var videoIframe=activeSlide.querySelector("iframe");if(videoIframe){var videoId=videoIframe.getAttribute("id"),player=YT.get(videoId);player&&player.playVideo()}else{var videoDivEl2=activeSlide.querySelector("div.slideshow_video");videoDivEl2&&(theme.Video.init(videoDivEl2),theme.Video.editorLoadVideo(videoDivEl2.id))}}for(var i2=0;i2<_this.slideshow.slides.length;i2++){var slide=_this.slideshow.slides[i2];if(i2!=_this.slideshow.slideIndex){var hasVideoEl=slide.querySelector(".slideshow_video");if(hasVideoEl){var isVideoTag=slide.querySelector("video");if(isVideoTag){var videoId=isVideoTag.getAttribute("id"),videoObj=document.getElementById(videoId);videoObj&&videoObj.pause()}
6else{var videoIframe=slide.querySelector("iframe");if(videoIframe){var videoId=videoIframe.getAttribute("id"),player=YT.get(videoId);player&&player.pauseVideo()}}}}}}},onUnload:function(){this.slideshow.destroy()},onBlockSelect:function(evt){this.slideshow.adaptHeight&&this.slideshow.setSlideshowHeight(),this.slideshow.checkSlideshowHeight();var slide=this.container.querySelector(".slideshow__slide--"+evt.detail.blockId),slideIndex=slide.getAttribute("data-slider-slide-index");this.slideshow.setSlide(slideIndex),this.slideshow.stopAutoplay()},onBlockDeselect:function(){this.slideshow.startAutoplay()}}),window.theme=window.theme||{},theme.StoreAvailability=(function(){var selectors2={storeAvailabilityModalOpen:"[data-store-availability-modal-open]",storeAvailabilityModalProductTitle:"[data-store-availability-modal-product-title]",storeAvailabilityModalVariantTitle:"[data-store-availability-modal-variant-title]"},classes={hidden:"hide"};function StoreAvailability(container){this.container=container,this.productTitle=this.container.dataset.productTitle,this.hasOnlyDefaultVariant=this.container.dataset.hasOnlyDefaultVariant==="true",document.addEventListener("click",function(e){let el=e.target;if(!el.classList.contains("store-availabilities-modal")&&!el.closest(".store-availabilities-modal")&&!el.closest(".store-availability-information-container")){var StoreAvailabilityModal=document.querySelector(".store-availabilities-modal");if(StoreAvailabilityModal&&StoreAvailabilityModal.classList.contains("store-availabilities-modal--active")){document.querySelector("body").classList.remove("show_overlay");var close_btn=StoreAvailabilityModal.querySelector(".js-modal-close-store-availability-modal");close_btn&&close_btn.dispatchEvent(new Event("click",{bubbles:!0}))}}})}return StoreAvailability.prototype=Object.assign({},StoreAvailability.prototype,{updateContent:function(variantId){var variantSectionUrl=this.container.dataset.baseUrl+"/variants/"+variantId+"/?section_id=store-availability",self2=this,storeAvailabilityModalOpen=self2.container.querySelector(selectors2.storeAvailabilityModalOpen);this.container.style.opacity=.5,storeAvailabilityModalOpen&&(storeAvailabilityModalOpen.disabled=!0,storeAvailabilityModalOpen.setAttribute("aria-busy",!0)),fetch(variantSectionUrl).then(function(response){return response.text()}).then(function(storeAvailabilityHTML){storeAvailabilityHTML.trim()!==""&&(self2.container.innerHTML=storeAvailabilityHTML,self2.container.innerHTML=self2.container.firstElementChild.innerHTML,self2.container.style.opacity=1,storeAvailabilityModalOpen=self2.container.querySelector(selectors2.storeAvailabilityModalOpen),storeAvailabilityModalOpen&&(storeAvailabilityModalOpen.addEventListener("click",self2._onClickModalOpen.bind(self2)),self2.modal=self2._initModal(),self2._updateProductTitle(),self2.hasOnlyDefaultVariant&&self2._hideVariantTitle()))})},clearContent:function(){this.container.innerHTML=""},_onClickModalOpen:function(){this.container.dispatchEvent(new CustomEvent("storeAvailabilityModalOpened",{bubbles:!0,cancelable:!0}))},_initModal:function(){return new window.Modals("StoreAvailabilityModal","store-availability-modal",{close:".js-modal-close-store-availability-modal",closeModalOnClick:!0,openClass:"store-availabilities-modal--active"})},_updateProductTitle:function(){var storeAvailabilityModalProductTitle=this.container.querySelector(selectors2.storeAvailabilityModalProductTitle);storeAvailabilityModalProductTitle.textContent=this.productTitle},_hideVariantTitle:function(){var storeAvailabilityModalVariantTitle=this.container.querySelector(selectors2.storeAvailabilityModalVariantTitle);storeAvailabilityModalVariantTitle.classList.add(classes.hidden)}}),StoreAvailability})();var selectors={disclosureLocale:"[data-disclosure-locale]",disclosureCurrency:"[data-disclosure-currency]"};theme.FooterSection=(function(){function Footer(container){this.container=container,this.cache={},this.cacheSelectors(),this.cache.localeDisclosure&&(this.localeDisclosure=new theme.Disclosure(this.cache.localeDisclosure)),this.cache.currencyDisclosure&&(this.currencyDisclosure=new theme.Disclosure(this.cache.currencyDisclosure))}return Footer.prototype=Object.assign({},Footer.prototype,{cacheSelectors:function(){this.cache={localeDisclosure:this.container.querySelector(selectors.disclosureLocale),currencyDisclosure:this.container.querySelector(selectors.disclosureCurrency)}},onUnload:function(){this.cache.localeDisclosure&&this.localeDisclosure.destroy(),this.cache.currencyDisclosure&&this.currencyDisclosure.destroy()}}),Footer})(),theme.FeaturedBlog=(function(){function FeaturedBlog(container){var sliderEl=container.querySelector(".featured-blog__slider"),flickityInstance2,slider_options;if(sliderEl){slider_options=JSON.parse(sliderEl.getAttribute("data-flickity-config")),flickityInstance2=new Flickity(sliderEl,slider_options),flickityInstance2.element.classList.add("rendered");var slider_custom_arrows=container.querySelector(".slider_custom_arrows");if(slider_custom_arrows){var slider_custom_btns=slider_custom_arrows.querySelectorAll(".btn");slider_custom_btns.forEach(function(item,index){item.addEventListener("click",function(e){e.preventDefault();var isNext=item.classList.contains("button-next");isNext?flickityInstance2.next():flickityInstance2.previous()})})}}}return FeaturedBlog})(),theme.BlogPage=(function(){function BlogPage(container){var sidebar_menu_items=container.querySelectorAll(".panel-heading.collapse");
6sidebar_menu_items.length&&sidebar_menu_items.forEach(function(item,index){item.addEventListener("click",function(e){e.preventDefault();var self2=this,panelId=item.getAttribute("data-collapse-panel"),itemPanel=document.querySelector("#"+panelId),current_active_block=container.querySelector(".panel-heading.collapse.active");if(current_active_block){var current_block_id=current_active_block.getAttribute("data-collapse-panel");current_block_id!=panelId&&current_active_block.dispatchEvent(new Event("click",{bubbles:!0}))}if(itemPanel.classList.contains("active"))itemPanel.style.height="0px",itemPanel.addEventListener("transitionend",function(){itemPanel.classList.remove("active"),self2.classList.remove("active")},{once:!0});else{self2.classList.add("active"),itemPanel.classList.add("active"),itemPanel.style.height="auto";var height=itemPanel.clientHeight+"px";itemPanel.style.height="0px",setTimeout(function(){itemPanel.style.height=height},0)}})});var blog_page_top_bar_dropdowns=container.querySelectorAll(".blog_page_top_bar-dropdown");blog_page_top_bar_dropdowns.length&&blog_page_top_bar_dropdowns.forEach(function(dropdown,index){dropdown.addEventListener("change",function(e){e.preventDefault();var val=this.value,id=this.id,new_url;if(id=="top_bar_tags")if(val.length){var hidden_top_bar_tags_linksEl=container.querySelectorAll(".hidden_top_bar_tags_link");hidden_top_bar_tags_linksEl.length&&hidden_top_bar_tags_linksEl.forEach(function(item,index2){var tag_handle=item.getAttribute("data-tag-handle");tag_handle==val&&(new_url=item.querySelector("a").href)})}else new_url=window.location.href.split("/tagged")[0];else new_url=val;window.location.href=new_url})});var pagination_mode=container.getAttribute("data-pagination_mode");if(pagination_mode!="standart")var endlessScroll=new Ajaxinate({container:"#AjaxinateContainer",pagination:"#AjaxinatePagination",method:pagination_mode,offset:500});var open_sidebar_btn=container.querySelector(".open_mobile_sidebar"),close_sidebar_btn=container.querySelector(".close-blog-sidebar");open_sidebar_btn&&open_sidebar_btn.addEventListener("click",function(e){e.preventDefault();var sidebarEl=container.querySelector(".blog-sidebar");sidebarEl&&(sidebarEl.classList.add("show"),document.querySelector("body").classList.add("show_overlay"))}),close_sidebar_btn&&close_sidebar_btn.addEventListener("click",function(e){e.preventDefault();var sidebarEl=container.querySelector(".blog-sidebar");sidebarEl&&(sidebarEl.classList.remove("show"),document.querySelector("body").classList.remove("show_overlay"))})}return BlogPage})(),theme.ArticlePage=(function(){function ArticlePage(container){var form_reset_btn=container.querySelector(".comment-reset-btn");form_reset_btn&&form_reset_btn.addEventListener("click",function(e){e.preventDefault();var form=this.closest("form"),inputs=form.querySelectorAll(".input-full");inputs.length&&inputs.forEach(function(item,index){item.value="",item.innerHTML=""})})}return ArticlePage})(),theme.Timeline=(function(){function Timeline(container){var timeline_nav_items=container.querySelectorAll(".timeline_nav_item");if(timeline_nav_items.length){var sectionHeightCalculate=function(){var sectionHeight=container.getAttribute("data-blocks_height"),timeline_blocks=container.querySelectorAll(".timeline_block");timeline_blocks.length&&timeline_blocks.forEach(function(item,index){var isActive=item.classList.contains("active");item.classList.add("active");var itemHeight=item.clientHeight;itemHeight>sectionHeight&&(sectionHeight=itemHeight),isActive!=!0&&item.classList.remove("active")});var timeline_blocksEl=container.querySelector(".timeline_blocks");timeline_blocksEl&&(timeline_blocksEl.style.height=sectionHeight+"px")},sectionId=container.getAttribute("data-section-id");timeline_nav_items.forEach(function(item,index){item.addEventListener("click",function(e){e.preventDefault();var active_nav_item=container.querySelector(".timeline_nav_item.active"),active_timeline_block=container.querySelector(".timeline_block.active"),year=this.getAttribute("data-year"),year_timeline_blockId="#block_"+sectionId+"_"+year,newTimeline_block=container.querySelector(year_timeline_blockId);active_nav_item.classList.remove("active"),active_timeline_block.classList.remove("active"),newTimeline_block&&newTimeline_block.classList.add("active"),this.classList.add("active")})})}}return Timeline})(),theme.Mosaic=(function(){function Mosaic(container){var use_lightbox=container.querySelector(".use_lightbox");if(use_lightbox){var mosaic_blocks=container.querySelectorAll(".mosaic_block");if(mosaic_blocks.length){var items=[],pswpElement=document.querySelectorAll(".pswp")[0];mosaic_blocks.forEach(function(item,index){var imageObj={src:item.getAttribute("data-image-url"),w:+item.getAttribute("data-image-width"),h:+item.getAttribute("data-image-height")};items.push(imageObj),item.addEventListener("click",function(e){var target=e.target;if(!(target.classList.contains("mosaic_block-link")||target.closest(".mosaic_block-link"))){e.preventDefault();var options={index},gallery=new PhotoSwipe(pswpElement,PhotoSwipeUI_Default,items,options);gallery.init()}})})}}container.querySelectorAll(".mosaic_video").length>0&&(window.onload=function(){container.querySelectorAll(".mosaic_video_mobile").length>0?window.innerWidth>1239?container.querySelectorAll(".mosaic_video").forEach(function(elem){document.getElementById(elem.getAttribute("id")).play()}):container.querySelectorAll(".mosaic_video_mobile").forEach(function(elem){document.getElementById(elem.getAttribute("id")).play()}):container.querySelectorAll(".mosaic_video").forEach(function(elem){document.getElementById(elem.getAttribute("id")).play()})})}return Mosaic})(),theme.SearchBar=(function(){function SearchBar(element2){this.element=element2,this.delegateElement=new Delegate(this.element),this.headerElement=this.element.closest(".site-header"),this.searchBarElement=this.element.querySelector(".search-form"),this.inputElement=this.element.querySelector('[name="q"]'),this.searchResultsElement=this.element.querySelector(".search-bar__results"),this.searchPopoverEl=this.element.querySelector(".predictive-search-wrapper--drawer"),this.productTypeFilter="",this.isSearchOpen=!1,this._attachListeners()}return SearchBar.prototype=Object.assign({},SearchBar.prototype,{_destroy:function(){this.delegateElement.off()},_attachListeners:function(){this.delegateElement.on("focusin",'[name="q"]',this._onInputFocus.bind(this)),this.delegateElement.on("focusout",'[name="q"]',this._onFocusOut.bind(this)),this.delegateElement.on("key
6down",'[name="q"]',this._handleTab.bind(this)),this.delegateElement.on("input",'[name="q"]',this._debounce(this._doSearch.bind(this),250)),this.delegateElement.on("click","#search-product-type",this._productTypeChanged.bind(this)),this.delegateElement.on("submit",'[type="submit"]',this._onFormSubmit.bind(this));var _this=this;document.addEventListener("click",function(e){let el=e.target;!el.classList.contains("search-bar__form")&&!el.closest(".search-bar__form")&&(_this.element.classList.remove("is-fixed"),document.body.classList.remove("no-mobile-scroll"),_this.element.contains(e.relatedTarget)||(_this.searchPopoverEl.setAttribute("aria-hidden","true"),_this.searchBarElement.classList.remove("is-expanded")))})},_toggleMobileSearch:function(){this.isSearchOpen?(this.headerElement.classList.remove("header--search-expanded"),this.element.classList.remove("is-visible")):(this.headerElement.classList.add("header--search-expanded"),this.element.classList.add("is-visible")),this.isSearchOpen=!this.isSearchOpen},_onInputFocus:function(){this.element.classList.add("is-fixed"),document.body.classList.add("no-mobile-scroll"),this.searchPopoverEl.setAttribute("aria-hidden","false"),this.inputElement.classList.add("is-filled"),this.searchBarElement.classList.add("is-expanded")},_onFocusOut:function(event){this.element.classList.remove("is-fixed"),document.body.classList.remove("no-mobile-scroll"),this.element.contains(event.relatedTarget)||(this.searchPopoverEl.setAttribute("aria-hidden","true"),this.searchBarElement.classList.remove("is-expanded"))},_handleTab:function(event){if(event.keyCode===9){var firstFocusableElement=this.searchResultsElement.querySelector("a");firstFocusableElement&&(firstFocusableElement.focus(),event.preventDefault())}},_doSearch:function(){var _this33=this,currentInput=this.inputElement.value;if(this.lastInputValue=currentInput,currentInput==="")_this33.searchPopoverEl.classList.remove("added_results"),_this33.searchBarElement.querySelector(".search-bar__results-inner").innerHTML="";else{this.searchPopoverEl.setAttribute("aria-hidden","false");var queryOptions={method:"GET",credentials:"same-origin"},productQuery=(this.productTypeFilter!==""?"product_type:"+this.productTypeFilter+" AND ":"")+this.lastInputValue+"*",queries=[fetch(window.routes.searchUrl+"?view=ajax&q="+productQuery+"&type=product",queryOptions)];window.theme.searchMode!=="product"&&queries.push(fetch(window.routes.searchUrl+"?view=ajax&q="+encodeURIComponent(this.lastInputValue)+"*&type="+window.theme.searchMode.replace("product,",""),queryOptions)),Promise.all(queries).then(function(responses){_this33.lastInputValue===currentInput&&Promise.all(responses.map(function(response){return response.text()})).then(function(contents){var contents_length=contents.join("").trim().length,searchContent=document.createElement("div");searchContent.innerHTML=contents.join("").trim();var viewAll=searchContent.querySelector(".search-bar__view-all-button-wrapper");viewAll&&searchContent.insertAdjacentElement("beforeend",viewAll),_this33.searchBarElement.querySelector(".search-bar__results-inner").innerHTML=searchContent.innerHTML,contents_length?_this33.searchPopoverEl.classList.add("added_results"):_this33.searchPopoverEl.classList.remove("added_results")})})}},_productTypeChanged:function(event,target){this.productTypeFilter=target.getAttribute("data-search-type"),this.productTypeFilter=="All Categories"&&(this.productTypeFilter=""),this.inputElement.value!==""&&this._doSearch()},_onFormSubmit:function(event){if(this.inputElement.value==="")event.preventDefault();else{var cloneNode=this.inputElement.cloneNode();cloneNode.setAttribute("type","hidden"),cloneNode.value=(this.productTypeFilter!==""?"product_type:"+this.productTypeFilter+" AND ":"")+this.inputElement.value+"*",this.inputElement.removeAttribute("name"),this.inputElement.insertAdjacentElement("afterend",cloneNode)}},_debounce(fn,delay){var _this34=this,timer=null;return function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];clearTimeout(timer),timer=setTimeout(function(){fn.apply(_this34,args)},delay)}}}),SearchBar})(),theme.Shop_the_Look=(function(){function Shop_the_Look(container){var shop_the_look_product_carousel=container.querySelector(".shop_the_look_product_carousel");if(shop_the_look_product_carousel){var options=JSON.parse(shop_the_look_product_carousel.getAttribute("data-flickity_options")),shop_the_look_productSize=shop_the_look_product_carousel.querySelectorAll(".shop_the_look_product").length;if(shop_the_look_productSize>1){var flickityInstance2=new Flickity(shop_the_look_product_carousel,options);
6flickityInstance2.on("select",function(index){if(shop_the_look_product_carousel.classList.contains("is-active")){var product_dot=container.querySelector('.shop_the_look_dot[data-index="'+index+'"]'),prevProduct_dot=container.querySelector(".shop_the_look_dot.is-active");prevProduct_dot&&prevProduct_dot.classList.remove("is-active"),product_dot&&product_dot.classList.add("is-active")}})}}var shop_the_look_dots=container.querySelectorAll(".shop_the_look_dot");shop_the_look_dots.length&&shop_the_look_dots.forEach(function(shop_the_look_dot,index){shop_the_look_dot.addEventListener("click",function(e){e.preventDefault();var container2=this.closest(".shop-the-look-section"),isActive=this.classList.contains("is-active"),_thisProductBlockId=this.getAttribute("data-block-id"),shop_the_look_product_carousel2=container2.querySelector(".shop_the_look_product_carousel");if(_thisProductBlockId)var _thisProductBlock=container2.querySelector("#"+_thisProductBlockId);if(isActive)this.classList.remove("is-active"),shop_the_look_product_carousel2.classList.remove("is-active"),container2.classList.remove("active_dot");else{var prevActiveDot=container2.querySelector(".shop_the_look_dot.is-active");if(prevActiveDot&&prevActiveDot.classList.remove("is-active"),this.classList.add("is-active"),shop_the_look_product_carousel2.classList.add("is-active"),container2.classList.add("active_dot"),flickityInstance2){var activeDotIndex=this.getAttribute("data-index")*1;flickityInstance2.selectCell(activeDotIndex)}}})});var formsArr=container.querySelectorAll('[action="/cart/add"]');formsArr.length&&formsArr.forEach(function(form,index){theme.AddItemToCart(form)})}return Shop_the_Look})(),theme.HomepageVideo=(function(){function HomepageVideo(container){var play_video_btns=container.querySelectorAll(".play_video_btn");play_video_btns.length&&play_video_btns.forEach(function(btn,index){btn.addEventListener("click",function(e){e.preventDefault();var pswpElement=document.querySelectorAll(".pswp")[0],videoWrapperEl=this.closest(".VideoWrapper"),videoContentEl=videoWrapperEl.querySelector(".VideoModalContent"),items=[{html:videoContentEl.innerHTML}],options={index:0},gallery=new PhotoSwipe(pswpElement,PhotoSwipeUI_Default,items,options);gallery.init();var galleryContentEl=gallery.template.querySelector(".pswp__zoom-wrap iframe");if(galleryContentEl){var videoSrc=galleryContentEl.getAttribute("src"),newvideoSrc=videoSrc=videoSrc.replace("autoplay=0","autoplay=1");galleryContentEl.setAttribute("src",newvideoSrc)}else galleryContentEl=gallery.template.querySelector(".pswp__zoom-wrap video"),galleryContentEl.setAttribute("autoplay",""),galleryContentEl.setAttribute("playsinline","");gallery.listen("close",function(){var galleryContentEl2=gallery.template.querySelector(".pswp__zoom-wrap iframe");galleryContentEl2||(galleryContentEl2=gallery.template.querySelector(".pswp__zoom-wrap video")),galleryContentEl2.remove()})})});var tabs_nav=container.querySelector(".index-tabs_nav");tabs_nav&&tabs_nav.querySelectorAll(".index-tabs_nav--item").forEach(function(item,index){item.addEventListener("click",function(e){e.preventDefault();var activeItem=tabs_nav.querySelector(".index-tabs_nav--item.active"),href_tab=this.getAttribute("data-href"),content_block=document.querySelector("#"+href_tab);if(activeItem){activeItem.classList.remove("active");var active_content_block=document.querySelector("#"+activeItem.getAttribute("data-href"));if(active_content_block){active_content_block.classList.remove("active");var isVideoTag=active_content_block.querySelector("video"),isIframeVideo=active_content_block.querySelector("iframe");if(isIframeVideo){var videoSrc=isIframeVideo.getAttribute("src"),newvideoSrc=videoSrc=videoSrc.replace("autoplay=1","autoplay=0");isIframeVideo.setAttribute("src",newvideoSrc)}isVideoTag&&(isVideoTag.removeAttribute("autoplay"),isVideoTag.removeAttribute("playsinline"))}}this.classList.add("active"),content_block&&content_block.classList.add("active")})})}return HomepageVideo})(),window.ecoflowThemeOnReady(function(){var sections=new theme.Sections;sections.register("video",theme.HomepageVideo),sections.register("shop-the-look",theme.Shop_the_Look),sections.register("search-template",theme.MainSearchPage),sections.register("mosaic",theme.Mosaic),sections.register("timeline",theme.Timeline),sections.register("featured-blog",theme.FeaturedBlog),sections.register("blog-page",theme.BlogPage),sections.register("article-page",theme.ArticlePage),sections.register("collection-list",theme.CollectionListSection),sections.register("featured-products",theme.FeaturedProducts),sections.register("index-countdown-timer",theme.CountdownTimer),sections.register("page-accordion",theme.PageAccordion),sections.register("index-accordion",theme.HomepageAccordion),sections.register("logo-bar",theme.LogoBar),sections.register("announcement-bar",theme.AnnouncementBar),sections.register("cart-template",theme.Cart),sections.register("product",theme.Product),sections.register("product-template",theme.Product),sections.register("header-section",theme.HeaderSection),sections.register("slideshow-section",theme.FlickitySlideshowSection),sections.register("store-availability",theme.StoreAvailability),sections.register("quotes",theme.Quotes),sections.register("product-recommendations",theme.ProductRecommendations),sections.register("advanced-search",theme.AdvancedSearch),sections.register("footer-section",theme.FooterSection);var sort_dropdown_open=document.querySelectorAll(".filters-toolbar__label");
6sort_dropdown_open&&(sort_dropdown_open.forEach(function(elem){elem.onclick=function(event){elem.parentElement.querySelector(".filters-toolbar__input-wrapper").classList.toggle("active"),elem.classList.toggle("active")}}),document.querySelectorAll(".sort-item").forEach(function(elem){elem.onclick=function(event){if(!elem.classList.contains("selected")){elem.closest(".filters-toolbar__input-wrapper").classList.remove("active");var sort_value=event.target.getAttribute("data-value");document.getElementById("SortBy").value=sort_value;let changeEvent=new Event("change");document.getElementById("SortBy").dispatchEvent(changeEvent)}}}),document.addEventListener("click",event=>{if(!event.target.closest(".toolbar_sort_by-block")){const isActiveFilterWrapper=document.querySelector(".filters-toolbar__input-wrapper.active"),isActiveFilterToolbar=document.querySelector(".filters-toolbar__label.active");isActiveFilterWrapper&&isActiveFilterWrapper.classList.remove("active"),isActiveFilterToolbar&&isActiveFilterToolbar.classList.remove("active")}})),document.querySelector(".CollectionGrid")&&(label_present=!1,document.querySelectorAll(".product-item-block").forEach(function(elem){elem.querySelectorAll(".new-label").length>0&&(label_present=!0)}),label_present&&document.querySelector(".CollectionGrid").classList.add("label-present")),document.addEventListener("click",function(e){if(!(!e.target||!e.target.closest)){var passwordFreeLoginTrigger=e.target.closest("[data-open-password-free-login-popup]");if(passwordFreeLoginTrigger){e.preventDefault();var passwordFreeSuccessMessage=passwordFreeLoginTrigger.getAttribute("data-password-free-success-message");if(typeof window.openLoginPopupDialog=="function"){window.openLoginPopupDialog(passwordFreeSuccessMessage);return}var passwordFreeLoginDialog=document.getElementById("login-popup-dialog");if(passwordFreeLoginDialog&&typeof passwordFreeLoginDialog.showModal=="function"){if(window.Alpine&&typeof Alpine.$data=="function")try{var popupData=Alpine.$data(passwordFreeLoginDialog);if(popupData){var trimmedMsg=passwordFreeSuccessMessage!=null&&String(passwordFreeSuccessMessage).trim()!==""?String(passwordFreeSuccessMessage).trim():"";popupData.loggedInMessageOverride=trimmedMsg}}catch{}passwordFreeLoginDialog.showModal()}}}});var quick_viewModal2=document.querySelector("#modal-quick-view");quick_viewModal2&&(document.addEventListener("click",function(e){var target=e.target;if(target.classList.contains("open-quick-view--btn")||target.closest(".open-quick-view--btn")){target.classList.contains("open-quick-view--btn")||(target=target.closest(".open-quick-view--btn")),e.preventDefault();var productUrl=new URL("".concat(window.location.origin).concat(target.getAttribute("data-product-url"))),modal=document.getElementById(target.getAttribute("aria-controls"));modal.classList.add("is-loading"),productUrl.searchParams.set("view","quick-view"),fetch(productUrl.href,{credentials:"same-origin",method:"GET"}).then(function(response){response.text().then(function(content){modal.querySelector(".modal__inner").innerHTML=content;const scripts=content.match(/<script[^>]*>([\s\S]*?)<\/script>/gi);if(scripts&&scripts.forEach(scriptTag=>{try{const content2=scriptTag.match(/<script[^>]*>([\s\S]*?)<\/script>/i);if(content2&&content2[1]){const script=document.createElement("script");script.text=content2[1],document.body.appendChild(script),document.body.removeChild(script)}}catch(error2){console.log(error2)}}),modal.querySelectorAll(".modal__inner .checkoutButton").length>0&&addStarProduct(".modal__inner .checkoutButton","checkout"),modal.classList.remove("is-loading"),initCountdownItem)try{initCountdownItem(modal.querySelector(".modal__inner").querySelector(".countdown_wrapper"))}catch{}if(window.initCountdownAll)try{window.initCountdownAll(modal)}catch{}try{var modalProductSection=new theme.Product(modal.querySelector('[data-section-type="product"]'));window.Shopify.PaymentButton&&window.Shopify.PaymentButton.init&&window.Shopify.PaymentButton.init()}catch{}document.querySelector("body").classList.add("show_overlay"),modal.setAttribute("aria-hidden","false")})})}}),document.addEventListener("click",function(e){let el=e.target;if(el.classList.contains("close-quick-view")||el.closest(".close-quick-view")){e.preventDefault();var modal=el.closest(".modal");modal.setAttribute("aria-hidden","true"),modal.querySelector(".modal__inner").innerHTML="",document.querySelector("body").classList.remove("show_overlay")}}
6)),theme.customerTemplates.init();var tableSelectors=".rte table,.custom__item-inner--html table";slate.rte.wrapTable({tables:document.querySelectorAll(tableSelectors),tableWrapperClass:"scrollable-wrapper"});var iframeSelectors='.rte iframe[src*="youtube.com/embed"],.rte iframe[src*="player.vimeo"],.custom__item-inner--html iframe[src*="youtube.com/embed"],.custom__item-inner--html iframe[src*="player.vimeo"]';slate.rte.wrapIframe({iframes:document.querySelectorAll(iframeSelectors),iframeWrapperClass:"video-wrapper"}),slate.a11y.pageLinkFocus(document.getElementById(window.location.hash.substr(1)));var inPageLink=document.querySelector(".in-page-link");inPageLink&&inPageLink.addEventListener("click",function(evt){slate.a11y.pageLinkFocus(document.getElementById(evt.currentTarget.hash.substr(1)))}),document.querySelectorAll('a[href="#"]').forEach(function(anchor){anchor.addEventListener("click",function(evt){evt.preventDefault()})}),slate.a11y.accessibleLinks({messages:{newWindow:theme.strings.newWindow,external:theme.strings.external,newWindowExternal:theme.strings.newWindowExternal},links:document.querySelectorAll("a[href]:not([aria-describedby]), .product-single__thumbnail")}),theme.FormStatus.init(),document.addEventListener("touchstart",function(){theme.Helpers.setTouch()},{once:!0}),document.fonts&&document.fonts.ready.then(function(){window.performance.mark("pursuit:fonts_loaded")});var cookie_popup=document.querySelector(".cookie_popup");if(cookie_popup){var cookie_popup_wrapper=document.querySelector(".cookie_popup_wrapper");document.addEventListener("click",function(e){let el=e.target;(el.classList.contains("modal_close_btn")||el.closest(".modal_close_btn"))&&(el.classList.contains("modal_close_btn")||(el=el.closest(".modal_close_btn")),el.closest(".cookie_popup_wrapper")&&(cookie_popup_wrapper.classList.remove("show"),window.history.replaceState(null,null,window.location.pathname)))}),document.addEventListener("click",function(e){let el=e.target;(el.classList.contains("accept_cookie_popup")||el.closest(".accept_cookie_popup"))&&(el.classList.contains("accept_cookie_popup")||(el=el.closest(".accept_cookie_popup ")),document.cookie="accept_use_policy=true",cookie_popup_wrapper.classList.remove("show"))});var isShowCookiePopup=getCookie("accept_use_policy");isShowCookiePopup||window.location.href.indexOf("challenge")<0&&cookie_popup_wrapper.classList.add("show")}function otherFormMessage(formId2){var contact_forms=document.querySelectorAll(".contact-form");contact_forms.length&&contact_forms.forEach(function(item,index){var itemId=item.id;if(formId2!=itemId){var form_messageEl=item.querySelector(".form-message");form_messageEl?form_messageEl.remove():(form_messageEl=item.querySelector(".input-error-message"),form_messageEl&&form_messageEl.remove());var form_inputs=item.querySelectorAll(".input--error");form_inputs.length&&form_inputs.forEach(function(input,indexInput){input.classList.remove("input--error")})}})}var entry_popup_wrapper=document.querySelector(".entry_popup_wrapper");if(entry_popup_wrapper){var $container=entry_popup_wrapper.querySelector(".entry-modal"),delay=$c
6ontainer.getAttribute("data-delay")*1e3,cookie=$container.getAttribute("data-cookie"),sumbitted_form=!1,pswpElement=document.querySelectorAll(".pswp")[0],items=[{html:$container}],options={index:0,modal:!1,mainClass:"entry-modal_wrapper",zoomEl:!1,shareEl:!1,counterEl:!1,arrowEl:!1,fullscreenEl:!1,closeOnScroll:!1,closeOnVerticalDrag:!1,clickToCloseNonZoomable:!1,closeElClasses:" ",closeEl:!1,isClickableElement:function(el){return!0}},entry_popup_gallery=new PhotoSwipe(pswpElement,PhotoSwipeUI_Default,items,options),form=$container.querySelector("form"),formId;if(form){formId=form.getAttribute("id");var submitCookieCustomerForm=function(event){event.preventDefault();var cookieTime2=cookie*1;setCookie("pop_confirm","pop_newsletter",cookieTime2)};form.addEventListener("submit",submitCookieCustomerForm,!1),form.removeEventListener("submit",submitCookieCustomerForm,!1)}if(document.addEventListener("click",function(e){let el=e.target;(el.classList.contains("modal_close_btn")||el.closest(".modal_close_btn"))&&(el.classList.contains("modal_close_btn")||(el=el.closest(".modal_close_btn")),el.closest(".entry-modal_wrapper")&&(document.querySelector("body").classList.remove("active_modal"),entry_popup_gallery.close(),window.setTimeout(function(){window.history.replaceState(null,null,window.location.pathname)},500)))}),getCookie("pop_confirm")!=null&&window.location.hash.indexOf(formId)>=0&&(window.location.search=="?customer_posted=true"||window.location.hash=="#contact_form"||$container.querySelector("form .errors")))var sumbitted_form=!0;if(window.location.href.indexOf("challenge")<0){let show_modal2=function(){entry_popup_gallery.init(),document.querySelector("body").classList.add("active_modal"),entry_popup_gallery.listen("close",function(){var cookieTime2=cookie*1;setCookie("pop","modal",cookieTime2),setCookie("pop_confirm",null),document.querySelector("body").classList.remove("active_modal")})};var show_modal=show_modal2;if(getCookie("pop")==null||cookie=="use_test_popup"||sumbitted_form){if(window.setTimeout(show_modal2,delay),cookie!="use_test_popup"||!sumbitted_form){var cookieTime=cookie*1;setCookie("pop","modal",cookieTime)}sumbitted_form&&(setCookie("pop_confirm",null),$container.querySelector("form .errors")||$container.querySelector("form").classList.add("successForm"),window.setTimeout(show_modal2,delay),otherFormMessage(formId))}else window.location.hash.indexOf(formId)>=0&&window.location.search=="?contact%5Btags%5D=newsletter&form_type=customer"&&getCookie("pop")=="modal"&&sumbitted_form==!1&&(window.setTimeout(show_modal2,delay),otherFormMessage(formId))}}if(window.location.href.indexOf("/?contact%5Btags%5D=newsletter")>=0){var formId=window.location.href.split("form_type=customer")[1];if(formId.length){var formEl=document.querySelector(formId);formEl&&otherFormMessage(formEl.id)}}function resizeProductsCarousel(){document.querySelectorAll(".index-tabs-content_block__slider.flickity-enabled").length&&document.querySelectorAll(".index-tabs-content_block__slider.flickity-enabled").forEach(function(item,index){var flkty=Flickity.data(item),hadRenderedClass=!1;item.classList.contains("rendered")&&(hadRenderedClass=!0),hadRenderedClass&&item.classList.remove("rendered"),flkty.resize(),hadRenderedClass&&item.classList.add("rendered")})}var reLoadProductsCarousel=theme.Helpers.debounce(function(event){resizeProductsCarousel()},100);window.addEventListener("resize",reLoadProductsCarousel);function checkSectionVisibility(){var fadeInAnimationElems=document.querySelectorAll(".fade-in-animation:not(.fadeIn-animation)"),zoomFadeAnimationElems=document.querySelectorAll(".zoom-fade-animation:not(.zoomFade-animation)"),removeEvent=!1;fadeInAnimationElems.length&&fadeInAnimationElems.forEach(function(block,index){var containerPosition=block.getBoundingClientRect();containerPosition.top+200<window.innerHeight&&block.classList.add("fadeIn-animation")}),zoomFadeAnimationElems.length&&zoomFadeAnimationElems.forEach(function(block,index){var containerPosition=block.getBoundingClientRect();containerPosition.top+200<window.innerHeight&&block.classList.add("zoomFade-animation")}),fadeInAnimationElems.length==0&&zoomFadeAnimationElems.length==0&&(removeEvent=!0),removeEvent&&window.removeEventListener("scroll",checkSectionVisibility)}checkSectionVisibility(),window.addEventListener("scroll",checkSectionVisibility),document.querySelectorAll(".site-footer__item-inner").forEach(function(element2){element2.querySelector(".h5")&&(element2.querySelector(".h5").onclick=function(){window.innerWidth<=1239&&element2.classList.toggle("active")})});var custom_tabs=document.querySelectorAll(".custom_menu_tab_title");new SV.HoverIntent(custom_tabs,{onEnter:function(element2){var main_elem=element2.parentElement.parentElement;main_elem.querySelectorAll(".custom_menu_tab_content").forEach(function(content){content.classList.remove("active")}),main_elem.querySelectorAll(".custom_menu_tab_title").forEach(function(tab){tab.classList.remove("active")});var tab_title=element2.getAttribute("data-title");main_elem.querySelector('.custom_menu_tab_content[data-title="'+tab_title+'"]').classList.add("active"),element2.classList.add("active")},onExit:function(targetItem){},exitDelay:300,interval:100,sensitivity:7});var custom_menu_links2=document.querySelectorAll(".custom_menu_left_side_hover_item.custom_menu_item_dropdown_title");custom_menu_links2.forEach(function(targetItem){targetItem.onclick=function(){targetItem.closest(".mega_menu_columns__wrapper").querySelectorAll(".custom_menu_left_side_hover_item").forEach(function(block){block.classList.contains("active")&&block.classList.remove("active")}),targetItem.classList.add("active");var block_title=targetItem.getAttribute("data-title");targetItem.closest(".mega_menu_columns__wrapper").querySelectorAll(".custom_menu_block_content").forEach(function(block){block.classList.contains("active")&&block.classList.remove("active")}),targetItem.closest(".mega_menu_columns__wrapper").querySelector('.custom_menu_block_content[data-title="'+block_title+'"]').classList.add("active"),targetItem.closest(".custom_menu_left_side_item_wrap").querySelector(".custom_menu_item_dropdown.open")&&targetItem.closest(".custom_menu_left_side_item_wrap").querySelector(".custom_menu_item_dropdown.open").classList.remove("open")}});var mega_menu_titles=document.querySelectorAll(".custom_menu_item_dropdown_title:not(.custom_menu_left_side_hover_item)");
6mega_menu_titles.forEach(function(element2){element2.onclick=function(){element2.closest(".custom_menu_left_side_item_wrap").querySelector(".custom_menu_item_dropdown.open")&&element2.closest(".custom_menu_left_side_item_wrap").querySelector(".custom_menu_item_dropdown.open").classList.remove("open"),element2.parentElement.classList.add("open"),element2.parentElement.querySelectorAll(".custom_menu_left_side_hover_item")[0].click()}})});function menuItemEvent(targetItem){targetItem.closest(".custom_menu_left_side").querySelectorAll(".custom_menu_left_side_item.active").length>0&&targetItem.closest(".custom_menu_left_side").querySelectorAll(".custom_menu_left_side_item.active").forEach(function(element2){element2.classList.remove("active")}),targetItem.classList.add("active");var block_title=targetItem.getAttribute("data-title");targetItem.closest(".mega_menu_columns__wrapper").querySelector(".custom_menu_block_content.active")&&targetItem.closest(".mega_menu_columns__wrapper").querySelector(".custom_menu_block_content.active").classList.remove("active"),targetItem.closest(".mega_menu_columns__wrapper").querySelector('.custom_menu_block_content[data-title="'+block_title+'"]').classList.add("active")}var custom_menu_links=document.querySelectorAll(".custom_menu_left_side_hover_item:not(.custom_menu_item_dropdown_title)");if(custom_menu_links.forEach(function(targetItem){targetItem.onclick=function(){menuItemEvent(targetItem)},targetItem.onmouseover=function(){menuItemEvent(targetItem)}}),document.querySelector("[data-mobile-slider]")){let inTheBoxMobileSlider2=function(){var inTheBoxMobileSlider3=new Flickity("[data-mobile-slider]",{cellAlign:"left",prevNextButtons:!1,contain:!0,imagesLoaded:!0})};var inTheBoxMobileSlider=inTheBoxMobileSlider2,doit;window.innerWidth<750&&inTheBoxMobileSlider2(),window.onresize=function(){clearTimeout(doit),doit=setTimeout(function(){window.innerWidth<750&&inTheBoxMobileSlider2()},100)}}function scrollIntoView(el,parentElement){var elParent2=parentElement;const elLeft=el.offsetLeft,elParentLeft=elParent2.offsetLeft;elLeft>=elParentLeft+elParent2.scrollLeft&&(elParent2.scrollLeft=elLeft-elParentLeft-elParent2.offsetWidth/2+el.offsetWidth/2)}if(document.querySelector(".collection-top-menu .active")){let el=document.querySelector(".collection-top-menu .active");var elParent=el.parentNode.parentNode;scrollIntoView(el,elParent)}if(document.querySelector(".product-series-slider")){var flickityInstance=new Flickity(".product-series-slider",{cellAlign:"left",pageDots:!1,contain:!0,groupCells:!0,watchCSS:!0});if(document.querySelector(".product-series-item.selected")&&window.innerWidth<750){let el=document.querySelector(".product-series-item.selected");var elParent=el.parentNode;scrollIntoView(el,elParent)}else{var nodes=Array.prototype.slice.call(document.querySelector(".product-series-slider .flickity-slider").children),liRef=document.querySelector(".product-series-slider .selected");flickityInstance.selectCell(nodes.indexOf(liRef))}}if(document.querySelector(".star-page-tab-wrapper.flickity-enabled .sticky-row")){let adjustArrows2=function(){document.querySelector(".star-page-tab-wrapper .flickity-button.previous")?.hasAttribute("disabled")?document.querySelector(".star-page-tab-wrapper .slider-button.previous")?.setAttribute("disabled",""):document.querySelector(".star-page-tab-wrapper .slider-button.previous")?.removeAttribute("disabled"),document.querySelector(".star-page-tab-wrapper .flickity-button.next")?.hasAttribute("disabled")?document.querySelector(".star-page-tab-wrapper .slider-button.next")?.setAttribute("disabled",""):document.querySelector(".star-page-tab-wrapper .slider-button.next")?.removeAttribute("disabled")};var adjustArrows=adjustArrows2,flickityInstance=new Flickity(".star-page-tab-wrapper.flickity-enabled .sticky-row",{cellAlign:"center",pageDots:!1,contain:!0,groupCells:!0,watchCSS:!0});window.innerWidth>750&&adjustArrows2(),document.querySelector(".star-page-tab-wrapper .slider-button.previous").onclick=function(){document.querySelector(".star-page-tab-wrapper .flickity-button.previous").click(),adjustArrows2()},document.querySelector(".star-page-tab-wrapper .slider-button.next").onclick=function(){document.querySelector(".star-page-tab-wrapper .flickity-button.next").click(),adjustArrows2()}}if(document.querySelector(".timeline-slider-wrapper")){var flickityInstance=new Flickity(".timeline-slider-wrapper",{pageDots:!1,initialIndex:document.querySelector(".timeline-slider-wrapper").getAttribute("data-active-slide"),adaptiveHeight:!0});document.querySelectorAll(".timeline-block").length>0&&document.querySelectorAll(".timeline-block").forEach(function(elem){elem.onclick=function(){var block_index=elem.getAttribute("data-block-index");flickityInstance.select(block_index),document.querySelector(".timeline-block.active")&&document.querySelector(".timeline-block.active").classList.remove("active"),elem.classList.add("active")}}),flickityInstance.on("change",function(index){document.querySelector(".timeline-block.active")&&document.querySelector(".timeline-block.active").classList.remove("active"),document.querySelector('.timeline-block[data-block-index="'+index+'"]').classList.add("active")})}if(document.querySelector(".star-page-banner .slideshow_video")){var videoDivEl=document.querySelector(".star-page-banner .slideshow_video");videoDivEl&&(theme.Video.init(videoDivEl),theme.Video.editorLoadVideo(v
6ideoDivEl.id))}function alignProductTitleRow(){document.querySelectorAll(".star-page-product-double-v2-section").length>0&&document.querySelectorAll(".star-page-product-double-v2-section").forEach(function(element2){var infoHeight=0,descHeight=0;element2.style.setProperty("--product-info-height","auto"),element2.style.setProperty("--product-desc-height","auto"),element2.querySelectorAll(".star_product_title").forEach(function(infoElement){infoElement.clientHeight>infoHeight&&(infoHeight=infoElement.clientHeight)}),element2.querySelectorAll(".star_product_desc").forEach(function(infoElement){infoElement.clientHeight>descHeight&&(descHeight=infoElement.clientHeight)}),element2.style.setProperty("--product-info-height",infoHeight+"px"),element2.style.setProperty("--product-desc-height",descHeight+"px")}),document.querySelectorAll(".star-page-product-double-v1-section").length>0&&document.querySelectorAll(".star-page-product-double-v1-section").forEach(function(element2){var infoHeight=0,affirmHeight=0,priceHeight=0,buttons_height=0;element2.style.setProperty("--product-info-height","auto"),element2.style.setProperty("--affirm-msg-height","auto"),element2.style.setProperty("--product-buttons-height","auto"),element2.style.setProperty("--product-price-height","auto"),element2.querySelectorAll(".star-product-info").forEach(function(infoElement){infoElement.clientHeight>infoHeight&&(infoHeight=infoElement.clientHeight)}),element2.querySelectorAll(".subtitle_price_row").forEach(function(infoElement){infoElement.clientHeight>priceHeight&&(priceHeight=infoElement.clientHeight)}),setTimeout(function(){element2.querySelectorAll(".affirm_message").forEach(function(infoElement){infoElement.clientHeight>affirmHeight&&(affirmHeight=infoElement.clientHeight)}),element2.style.setProperty("--affirm-msg-height",affirmHeight+"px")},1e3),window.innerWidth<750&&element2.classList.contains("star-page-product-multiple-v1-section")&&element2.querySelector(".star-products-container").classList.contains("mobile-per-row-2")&&(element2.querySelectorAll(".star_product_buttons").forEach(function(infoElement){infoElement.clientHeight>buttons_height&&(buttons_height=infoElement.clientHeight)}),element2.style.setProperty("--product-buttons-height",buttons_height+"px")),element2.style.setProperty("--product-info-height",infoHeight+"px"),element2.style.setProperty("--product-price-height",priceHeight+"px")})}window.onload=function(){function alignProductTitlePriceLabelRow(){document.querySelectorAll(".star-page-single-product-section").length>0&&document.querySelectorAll(".star-page-single-product-section").forEach(function(element2){var imageHeight=0,infoHeight=0,descHeight=0,labelHeight=0,priceHeight=0,affirmHeight=0;element2.querySelector(".star-products-container").classList.contains("slider-in-mobile")&&(element2.style.setProperty("--product-label-height","auto"),element2.style.setProperty("--product-info-height","auto"),element2.style.setProperty("--product-desc-height","auto"),element2.style.setProperty("--product-price-height","auto"),element2.style.setProperty("--product-affirm-height","auto"),element2.querySelectorAll(".star_product_title").forEach(function(infoElement){infoElement.clientHeight>infoHeight&&(infoHeight=infoElement.clientHeight)}),element2.querySelectorAll(".star_product_desc").forEach(function(infoElement){infoElement.clientHeight>descHeight&&(descHeight=infoElement.clientHeight)}),element2.querySelectorAll(".label_star_ranking").forEach(function(infoElement){infoElement.clientHeight>labelHeight&&(labelHeight=infoElement.clientHeight)}),element2.querySelectorAll(".subtitle_price_row").forEach(function(infoElement){infoElement.clientHeight>priceHeight&&(priceHeight=infoElement.clientHeight)}),element2.querySelectorAll(".affirm_message").length>0&&element2.querySelectorAll(".affirm_message").forEach(function(infoElement){infoElement.clientHeight>affirmHeight&&(affirmHeight=infoElement.clientHeight)}),element2.style.setProperty("--product-info-height",infoHeight+"px"),element2.style.setProperty("--product-desc-height",descHeight+"px"),element2.style.setProperty("--product-label-height",labelHeight+"px"),element2.style.setProperty("--product-price-height",priceHeight+"px"),element2.style.setProperty("--product-affirm-height",affirmHeight+"px"))})}
6window.innerWidth<750&&alignProductTitlePriceLabelRow(),alignProductTitleRow(),window.addEventListener("resize",function(){setTimeout(function(){alignProductTitleRow(),window.innerWidth<750&&alignProductTitlePriceLabelRow()},500)}),document.querySelectorAll(".star-products-container").length>0&&document.querySelectorAll(".star-products-container").forEach(function(element2){if(element2.classList.contains("slider-in-mobile"))var main_slider_options=JSON.parse(element2.getAttribute("data-flickity-config")),flickityInstance2=new Flickity(element2,main_slider_options)})},document.querySelectorAll(".view_more_wrapper").length>0&&document.querySelectorAll(".view_more_wrapper").forEach(function(elem){elem.querySelector(".view_more_btn").onclick=function(){var productsContainer=elem.parentElement;if(productsContainer.classList.toggle("view-all"),elem.classList.toggle("active"),productsContainer.classList.contains("star-page-product-multiple-tab-section")){var block_id=elem.getAttribute("data-block-id"),productsCount=productsContainer.getAttribute("data-products-count"),productsCountM=productsContainer.getAttribute("data-products-count-m");elem.classList.contains("active")?productsContainer.querySelectorAll('.star_product_block[data-block-id="'+block_id+'"]').forEach(function(block){block.style.display="flex"}):productsContainer.querySelectorAll('.star_product_block[data-block-id="'+block_id+'"]').forEach(function(block,index){console.log(index),window.innerWidth<750?index>=productsCountM&&(block.style.display="none"):index>=productsCount&&(block.style.display="none")})}elem.classList.contains("active")?elem.querySelector("span").innerText="View Less":elem.querySelector("span").innerText="View More"}});for(var links=document.links,i=0,linksLength=links.length;i<linksLength;i++)links[i].classList.contains("ecocredit-login-btn")||links[i].classList.contains("main-tab")||links[i].classList.contains("member_only_login_btn")||Array.from(links[i].classList).some(cls=>cls.includes("woohoo-"))||links[i].hostname!=window.location.hostname&&(links[i].target="_blank");const customIconZendesk=document.querySelector("[data-icon-zendesk]");customIconZendesk&&(setTimeout(()=>{customIconZendesk.classList.remove("hide")},2e3),customIconZendesk.addEventListener("click",function(){const zendeskIcon=this;zendeskIcon.classList.contains("active")?(zendeskIcon.classList.remove("active"),zE("messenger","close")):(zendeskIcon.classList.add("active"),zE("messenger","open"))}),zE("messenger:on","open",function(){setTimeout(()=>{document.querySelector('iframe[title="Messaging window"]').parentElement.classList.add("zendesk-message-box-overlap")},250)}),zE("messenger:on","close",function(){customIconZendesk.classList.remove("active")})),document.querySelector(".where-to-buy-container .show-more-btn")&&(document.querySelector(".where-to-buy-container .show-more-btn").onclick=function(){var clickElem=document.querySelector(".where-to-buy-container .show-more-btn");document.querySelectorAll(".country-block").forEach(function(elem){elem.classList.toggle("active")}),clickElem.classList.toggle("active"),clickElem.classList.contains("active")?clickElem.querySelector("span").innerText="SHOW LESS":clickElem.querySelector("span").innerText="SHOW MORE"}),document.querySelectorAll(".bv-tab-title").length>0&&document.querySelectorAll(".bv-tab-title").forEach(function(elem){elem.onclick=function(){var tab_id=elem.getAttribute("tab-id");document.querySelector(".bv-tab-content.active").classList.remove("active"),document.querySelector(".bv-tab-title.active").classList.remove("active"),document.querySelector('[tab-content="'+tab_id+'"]').classList.add("active"),elem.classList.add("active")}});function addStarProduct(elem,type,callback,context){document.querySelectorAll(elem).forEach(function(elem2){elem2.onclick=function(e){if(e.preventDefault(),elem2.classList.contains("disabled"))return;var quantity=1,shipping_message="";if(elem2.closest(".star-product-info-wrapper")&&elem2.closest(".star-product-info-wrapper").querySelector(".quantity_input")&&(quantity=elem2.closest(".star-product-info-wrapper").querySelector(".quantity_input").value),
6context=="modal"){quantity=document.querySelector("#corporate-atc-modal .modal__inner .product-form__input--quantity").value,window.location.href="/cart/"+elem2.getAttribute("data-variant-id")+":"+quantity;return}elem2.getAttribute("data-variant-shipping-msg")&&(shipping_message=elem2.getAttribute("data-variant-shipping-msg"));let formData={items:[{id:elem2.getAttribute("data-variant-id"),quantity,properties:{Shipping:shipping_message}}]};fetch("/cart/add.js",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(formData)}).then(function(response){return response.json()}).then(function(json){(window.enablePromotionsUsingCode||window.autoPromotionsEnable)&&(window.cart_clear=!1,window.promotionValidate()),setTimeout(function(){type=="checkout"?window.location.href="/checkout":(callback&&callback(),theme.Cart.prototype._onProductAdded(),fetch("/cart.js",{method:"GET"}).then(function(cart){cart.json().then(function(content){console.log(content),document.querySelector(".bf_sticky_bar")&&(document.querySelectorAll(".bf_sticky_bar .custom-sticky-bar-inner").forEach(function(parentElem2){parentElem2.querySelectorAll(".bar-content").forEach(function(elem3){var from_price=elem3.getAttribute("data-from-price"),to_price=elem3.getAttribute("data-to-price");if(content.total_price>=from_price&&content.total_price<=to_price){parentElem2.querySelector(".bar-content.active").classList.remove("active");let remainingAmount=theme.Currency.formatMoney(to_price-content.total_price,theme.moneyFormat);elem3.querySelector(".remaining-amount")&&(elem3.querySelector(".remaining-amount").innerText=remainingAmount),elem3.classList.add("active")}})}),document.querySelector("body").style.setProperty("--bf-bar-height",document.querySelector(".bf_sticky_bar").offsetHeight+"px"))})}))},1e3)})}})}document.querySelectorAll(".atcButton").length>0&&addStarProduct(".atcButton",""),document.querySelectorAll(".checkoutButton").length>0&&addStarProduct(".checkoutButton","checkout");function initCountdownItem(elem){var countDownDate=new Date(elem.getAttribute("data-countdown-end-date")).getTime(),x=setInterval(function(){var now=new Date().getTime(),distance=countDownDate-now,distance=countDownDate-now,days=Math.floor(distance/(1e3*60*60*24)).toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1}),hours=Math.floor(distance%(1e3*60*60*24)/(1e3*60*60)).toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1}),minutes=Math.floor(distance%(1e3*60*60)/(1e3*60)).toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1}),seconds=Math.floor(distance%(1e3*60)/1e3).toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1}),flash_hours=hours;days>0&&(flash_hours=24*days+parseInt(hours)),elem.classList.contains("show-days")?(elem.querySelector(".days_num").innerText=days,elem.querySelector(".hours_num").innerText=hours):elem.classList.contains("flash-sale-countdown")?elem.querySelector(".hours_num").innerText=flash_hours:(days>0?elem.querySelector(".days_num").innerText=days:elem.querySelector(".days").style.display="none",elem.querySelector(".hours_num").innerText=hours),elem.querySelector(".mins_num").innerText=minutes,elem.querySelector(".sec_num").innerText=seconds;const bfElem=elem.querySelector("[data-bf-flash-sales]");if(bfElem){const bfDays=bfElem.querySelector("[data-bf-days]"),bfHours=bfElem.querySelector("[data-bf-hours]");days>0?bfDays.querySelector("[data-num]")&&(bfDays.querySelector("[data-num]").innerText=Math.floor(distance/(1e3*60*60*24)),bfHours.style.display="none"):hours>0?bfHours.querySelector("[data-num]")&&(bfHours.querySelector("[data-num]").innerText=hours,bfDays.style.display="none"):bfElem.style.display="none"}distance<0?(clearInterval(x),elem.style.display="none",elem.closest(".countdown-timer__wrapper")&&(elem.closest(".countdown-timer__wrapper").style.display="none")):elem.style.display="block"},1e3)}if(document.querySelectorAll(".countdown_wrapper").length>0&&document.querySelectorAll(".countdown_wrapper").forEach(item=>initCountdownItem(item)),document.querySelector(".mother-day-custom-section .block-content")){var flickityInstance=new Flickity(".mother-day-custom-section .block-content",{cellAlign:"center",pageDots:!1,prevNextButtons:!1,contain:!0,watchCSS:!0,wrapAround:!0});document.querySelector(".mother-day-custom-section .next-btn").onclick=function(){flickityInstance.next()}}if(document.querySelector(".outdoor-image-gallery .block-content")){var flickityInstance=new Flickity(".outdoor-image-gallery .block-content",{cellAlign:"left",pageDots:!1,prevNextButtons:!1,watchCSS:!0,wrapAround:!0});document.querySelector(".outdoor-image-gallery .next-btn").onclick=function(){flickityInstance.next()}}if(document.querySelector(".prime-day-flash-section .products-grid")){var watchCss=!1;document.querySelector(".prime-day-flash-section").classList.contains("text-in-top")&&document.querySelector(".prime-day-flash-section .products-grid").classList.contains("desktop-slider-disabled")&&(watchCss=!0);var flickityInstance=new Flickity(".prime-day-flash-section .products-grid",{cellAlign:"left",pageDots:!0,prevNextButtons:!1,contain:!0,wrapAround:!0,groupCells:!0,watchCSS:watchCss});document.querySelector(".prime-day-flash-section .next-btn")&&(document.querySelector(".prime-day-flash-section .next-btn").onclick=function(){flickityInstance.next()}),document.querySelector(".prime-day-flash-section .prev-btn")&&(document.querySelector(".prime-day-flash-section .prev-btn").onclick=function(){flickityInstance.previous()})}if(document.querySelector(".star-page-tab-wrapper .sticky-row")){var scrollPosEnd=0;document.querySelectorAll(".star-page-tab-wrapper a:not(.main-tab)").forEach(function(element2){element2.onclick=function(e){e.preventDefault();var section_id=element2.getAttribute("href");section_id==""&&(section_id=element2.getAttribute("data-first-section"));var sectionElem=document.querySelector(section_id);if(sectionElem.querySelectorAll(".star-page-container").length>0)var scrollDiv=sectionElem.querySelectorAll(".star-page-container")[0].offsetTop;else{var scrollDiv=document.querySelector(section_id).offsetTop;window.innerWidth<750&&(scrollDiv=document.querySelector(section_id).offsetTop-100)}if(section_id=="#flash_sale"&&document.querySelector(".timeline-slider-wrapper"))var scrollDiv=document.querySelector(section_id).offsetTop+document.querySelector(".timeline-slider-wrapper").offsetTop;document.querySelector(".star-page-tab-wrapper .sticky-row").classList.add("anchor-clicked"),scrollPosEnd=scrollDiv-100,window.scrollTo({top:scrollDiv,behavior:"smooth"}),document.querySelector(".mobile-tab-content.show-content")&&(document.querySelector(".mobile-tab-content.show-content").classList.remove("show-content"),document.querySelector(".mobile-tab-wrapper.show-content").classList.remove("show-content"),document.querySelector(".mobile-tab-wrapper span").innerText=element2.innerText),document.querySelector(".star-page-tab-wrapper div.active")&&document.querySelector(".star-page-tab-wrapper div.active").classList.remove("active"),element2.parentElement.classList.add("active");var elParent2=element2.parentNode.parentNode,elLeft=element2.offsetLeft-20;elParent2.scrollLeft=elLeft}}),document.querySelectorAll(".star-page-tab-wrapper a.main-tab").forEach(function(element2){element2.onclick=function(e){var section_id=element2.getAttribute("href");if(section_id!=""&&section_id.indexOf("#")==0&&(e.preventDefault(),document.querySelector(section_id))){var scrollDiv=document.querySelector(section_id).offsetTop;element2.closest(".prime-day-main-nav").querySelector(".main-tab-wrap.is-selected").classList.remove("is-selected"),element2.parentElement.classList.add("is-selected"),window.scrollTo({top:scrollDiv,behavior:"smooth"})}}});for(var first_section_height=0,i=0;i<document.querySelectorAll(".main-content .shopify-section").length;i++)if(document.querySelectorAll(".main-content .shopify-section")[i].clientHeight>first_section_height){first_section_height=document.querySelectorAll(".main-content .shopify-section")[i].clientHeight;break}if(document.querySelector(".prime-day-nav-section")||document.querySelector(".star-page-tab-wrapper")){if(document.querySelector(".prime-day-nav-section")&&document.querySelector(".prime-day-nav-section").classList.contains("sticky-promotion-section")){var element_1=document.querySelector('.sticky-promotion-section:not([data-self-sticky="true"])');if(element_1)var elemRect=element_1.parentElement.getBoundingClientRect(),offset_1=elemRect.top+window.scrollY}if(document.querySelector(".star-page-tab-wrapper")&&document.querySelector(".star-page-tab-wrapper").classList.contains("is-sticky"))var element_2=document.querySelector(".star-page-tab-wrapper.is-sticky"),elemRect=element_2.getBoundingClientRect(),offset_2=document.querySelector(".star-page-tab-wrapper.is-sticky").offsetTop+170;window.onscroll=function(){element_1&&(window.pageYOffset>offset_1?(element_1.classList.add("fixed"),element_1.parentElement.classList.add("fixed-section"),document.querySelector("body").classList.add("stikcy-bar-enabled")):(element_1.classList.remove("fixed"),element_1.parentElement.classList.remove("fixed-section"),document.querySelector("body").classList.remove("stikcy-bar-enabled"))),document.querySelector(".star-page-tab-wrapper")&&(window.pageYOffset>offset_2?(document.querySelector(".star-page-tab-wrapper.is-sticky").classList.add("fixed"),document.querySelector(".star-page-tab-wrapper").parentElement.classList.add("fixed-section"),document.querySelector("body").classList.add("stikcy-bar-enabled"),document.body.style.setProperty("--sticky-bar-height",document.querySelector(".star-page-tab-wrapper").clientHeight+"px")):(document.querySelector(".star-page-tab-wrapper.is-sticky").classList.remove("fixed"),document.querySelector(".star-page-tab-wrapper").parentElement.classList.remove("fixed-section"),document.querySelector("body").classList.remove("stikcy-bar-enabled"),document.body.style.setProperty("--sticky-bar-height","0px"))),document.querySelector(".star-page-tab-wrapper").classList.contains("is-sticky")&&(document.querySelector(".star-page-tab-wrapper .sticky-row").classList.contains("anchor-clicked")==!1&&document.querySelectorAll(".star-page-tab-wrapper .star_tab a:not(.main-tab):not(.mobile-tab)").forEach(function(e){var section_id=e.getAttribute("href"),first_section_id=e.getAttribute("data-first-section"),last_section_id=e.getAttribute("data-last-section"),scrollPos_start=window.pageYOffset+200,scrollPos_end=window.pageYOffset;if(section_id!=""&&last_section_id==""){var refElement=document.querySelector(section_id);if(refElement){var section_top=refElement.getBoundingClientRect().top+window.pageYOffset;if(scrollPos_start>=section_top&&scrollPos_end<section_top+refElement.clientHeight){e.parentElement.classList.add("active");var elParent2=e.parentNode.parentNode,elLeft=e.offsetLeft-20;elParent2.scrollLeft=elLeft}else e.parentElement.classList.remove("active")}}else if(first_section_id!=""&&last_section_id!=""){var refElement1=document.querySelector(first_section_id),refElement2=document.querySelector(last_section_id);if(refElement1&&refElement2){var section_top=refElement1.getBoundingClientRect().top+window.pageYOffset,section_bottom=refElement2.getBoundingClientRect().top+window.pageYOffset;if(scrollPos_start>=section_top&&scrollPos_end<section_bottom+refElement2.clientHeight){document.querySelector(".sticky-row div.active")&&document.querySelector(".sticky-row div.active").classList.remove("active"),e.parentElement.classList.add("active");var elParent2=e.parentNode.parentNode,elLeft=e.offsetLeft-20;elParent2.scrollLeft=elLeft}else e.parentElement.classList.remove("active")}}}),window.pageYOffset>scrollPosEnd&&document.querySelector(".star-page-tab-wrapper .sticky-row").classList.remove("anchor-clicked"),document.querySelector(".signup-float-icon")&&(window.pageYOffset>first_section_height?document.querySelector(".signup-float-icon").style.opacity=1:document.querySelector(".signup-float-icon").style.opacity=0))}}}if(document.querySelectorAll(".pdp-slideshow-item").length>0){let pdp_slideshow2=function(element2){var autoplaySpeed=element2.closest(".pdp-slideshow").getAttribute("data-autoplay-speed");let options={accessibility:!1,cellAlign:"center",contain:!0,wrapAround:!0,autoPlay:!1}
6;autoplaySpeed&&autoplaySpeed>0&&(options={accessibility:!1,cellAlign:"center",contain:!0,wrapAround:!0,autoPlay:Number(autoplaySpeed)});var flickityInstance2=new Flickity(element2,options),target_elem=element2.parentElement;target_elem.querySelector(".slider-button-prev").onclick=function(){target_elem.querySelector(".flickity-button.previous").click()},target_elem.querySelector(".slider-button-next").onclick=function(){target_elem.querySelector(".flickity-button.next").click()}};var pdp_slideshow=pdp_slideshow2;document.querySelectorAll(".pdp-slideshow-item.active").forEach(function(elem){var flickity_elem=elem.querySelector(".pdp-slideshow-block-images");flickity_elem.querySelectorAll(".pdp-slideshow-block-image-wrapper").length>1&&pdp_slideshow2(flickity_elem)}),document.querySelectorAll(".pdp-slideshow-tab-title").forEach(function(elem){elem.onclick=function(){var parent_elem=elem.closest(".pdp-slideshow-container-inner");parent_elem.querySelector(".pdp-slideshow-tab-title.active").classList.remove("active"),elem.classList.add("active");var target_block=elem.getAttribute("data-target-block");parent_elem.querySelector(".pdp-slideshow-item.active").classList.remove("active"),parent_elem.querySelector(".pdp-slideshow-item[data-block='"+target_block+"']").classList.add("active"),parent_elem.querySelector(".pdp-slideshow-bottom-item.active").classList.remove("active"),parent_elem.querySelector(".pdp-slideshow-bottom-item[data-block='"+target_block+"']").classList.add("active"),parent_elem.querySelector(".pdp-slideshow-top-item.active")?.classList.remove("active"),parent_elem.querySelector(".pdp-slideshow-top-item[data-top-block='"+target_block+"']")?.classList.add("active");var elLeft=elem.offsetLeft,elParent2=elem.parentElement,elParentLeft=elParent2.offsetLeft,window_width=window.innerWidth/2;elLeft>window_width&&(elParent2.parentElement.scrollLeft=elLeft-elParentLeft-window_width+elem.offsetWidth/2);var flickity_elem=parent_elem.querySelector("[data-block='"+target_block+"']").querySelector(".pdp-slideshow-block-images");flickity_elem.querySelectorAll(".pdp-slideshow-block-image-wrapper").length>1&&pdp_slideshow2(flickity_elem)}})}if(document.querySelectorAll(".play-video").length>0&&document.querySelectorAll(".play-video").forEach(function(elem){elem.onclick=function(){var parentElem2=elem.parentElement;elem.classList.contains("video-playing")?parentElem2.querySelector("video").pause():parentElem2.querySelector("video").play(),elem.classList.toggle("video-playing")}}),document.querySelectorAll(".video-autoplay-true").length>0&&document.querySelectorAll(".video-autoplay-true").forEach(function(elem){elem.querySelector("video").play()}),document.querySelectorAll(".memorial-flexbox").length>0){let adjustMemorialTitle2=function(){document.querySelectorAll(".memorial-flexbox").forEach(function(element2){var titleHeight=0,contentHeight=0;element2.style.setProperty("--title-height","auto"),element2.style.setProperty("--content-height","auto"),element2.querySelectorAll(".title").forEach(function(infoElement){infoElement.clientHeight>titleHeight&&(titleHeight=infoElement.clientHeight)}),element2.querySelectorAll(".content").forEach(function(infoElement){infoElement.clientHeight>contentHeight&&(contentHeight=infoElement.clientHeight)}),element2.style.setProperty("--title-height",titleHeight+"px"),element2.style.setProperty("--content-height",contentHeight+"px")})};var adjustMemorialTitle=adjustMemorialTitle2;window.innerWidth>749&&adjustMemorialTitle2(),window.addEventListener("resize",function(){window.innerWidth>749&&setTimeout(function(){adjustMemorialTitle2()},500)})}if(document.querySelectorAll(".product-info-svg").length>0&&(document.querySelectorAll(".product-info-svg").forEach(function(elem){window.innerWidth<750?elem.querySelector("svg")&&elem.querySelector("svg").addEventListener("click",function(e){this.closest(".product-info-svg").querySelector(".product_info").classList.add("active")}):(elem.addEventListener("mouseover",function(e){this.querySelector(".product_info").classList.add("active")}),elem.addEventListener("mouseout",function(e){this.querySelector(".product_info").classList.remove("active")})),elem.querySelector(".info-close")&&elem.querySelector(".info-close").addEventListener("click",function(e){this.closest(".product_info").classList.remove("active")})}),document.addEventListener("click",function(e){let el=e.target;!el.classList.contains("product-info-svg")&&!el.closest(".product-info-svg")&&document.querySelector(".product_info.active")&&document.querySelector(".product_info.active").classList.remove("active")})),document.querySelectorAll(".product_option").length>0&&document.querySelectorAll(".product_option").forEach(function(option){option.addEventListener("click",function(e){e.preventDefault();var parentElem2=this.closest(".star-product-info-wrapper");parentElem2.querySelector(".product_option.selected").classList.remove("selected"),this.classList.add("selected");var nonMemberVariantID=this.getAttribute("data-non-member-variant-id");(this.getAttribute("data-non-member-showing")=="false"||!this.getAttribute("data-non-member-showing"))&&(this.getAttribute("data-member-only-variant")=="false"||!this.getAttribute("data-member-only-variant"))?(parentElem2.querySelector(".star_product_price").innerText=this.getAttribute("data-price"),parentElem2.querySelector(".star_product_compare_price")&&(parentElem2.querySelector(".star_product_compare_price").innerText=this.getAttribute("data-compare-price")),parentElem2.querySelector(".price_row").style.display="flex",parentElem2.querySelector(".member-only-price-wrap")&&(parentElem2.querySelector(".member-only-price-wrap").style.display="none"),parentElem2.querySelector(".subtitle_price_row_alter")&&(parentElem2.querySelector(".subtitle_price_row_alter").style.display="none")):this.getAttribute("data-non-member-showing")=="true"&&this.getAttribute("data-member-only-variant")=="false"?(parentElem2.querySelector(".star_product_price").innerText=this.getAttribute("data-non-member-price"),parentElem2.querySelector(".star_product_compare_price")&&(parentElem2.querySelector(".star_product_compare_price").innerText=this.getAttribute("data-non-member-compare-price")),parentElem2.querySelector(".price_row").style.display="flex",parentElem2.querySelector(".member-only-price-wrap").style.display="none",parentElem2.querySelector(".subtitle_price_row_alter").style.display="none"):parentElem2.querySelector(".member-only-price")&&(parentElem2.querySelector(".member-only-price").innerText=this.getAttribute("data-price"),parentElem2.querySelector(".non-member-price .price_elem").innerText=this.getAttribute("data-non-member-price"),this.getAttribute("data-non-member-compare-price")!=""?(parentElem2.querySelector(".non-member-c-price").innerText=this.getAttribute("data-non-member-compare-price"),parentElem2.querySelector(".non-member-c-price").style.display="inline-block"):parentElem2.querySelector(".non-member-c-price").style.display="none",parentElem2.querySelector(".price_row").style.display="none",parentElem2.querySelector(".member-only-price-wrap").style.display="flex",parentElem2.querySelector(".subtitle_price_row_alter").style.display="block"),this.getAttribute("data-variant-image")!=""&&parentElem2.closest(".star_product_block").querySelector(".star-product-image").setAttribute("srcset",this.getAttribute("data-variant-image")),parentElem2.querySelector(".normal_btn")&&this.getAttribute("data-redirection-url")!=""&&parentElem2.querySelector(".normal_btn").setAttribute("href",this.getAttribute("data-redirection-url")),this.closest(".star_product_block").querySelector(".star-product-image-wrapper a").setAttribute("href",this.getAttribute("data-product-url")),parentElem2.querySelector(".star_product_title a")&&parentElem2.querySelector(".star_product_title a").setAttribute("href",this.getAttribute("data-product-url")),parentElem2.querySelector(".amazon_btn")&&(this.getAttribute("data-amazon-url")!=""?(parentElem2.querySelector(".amazon_btn").setAttribute("href",this.getAttribute("data-amazon-url")),parentElem2.querySelector(".amazon_btn").style.display="flex"):parentElem2.querySelector(".amazon_btn").style.display="none");var isSoldOut=this.getAttribute("data-sold-out")==="true",variantId=this.getAttribute("data-variant-id");parentElem2.querySelectorAll(".purchase_btn, .atc_link").forEach(function(btn
6){if(isSoldOut){if(btn.classList.add("sold_out_btn"),btn.classList.remove("atcButton","checkoutButton"),btn.setAttribute("aria-disabled","true"),btn.setAttribute("tabindex","-1"),btn.removeAttribute("data-variant-id"),btn.removeAttribute("data-variant-shipping-msg"),!btn.classList.contains("atc_link")){var soldOutText=btn.getAttribute("data-soldout-text");if(soldOutText){var textTarget=btn.querySelector("span:not(.btn_icon)")||btn;textTarget.innerText=soldOutText}}}else if(btn.classList.remove("sold_out_btn"),btn.classList.contains("atc_btn")||btn.classList.contains("atc_link")?btn.classList.add("atcButton"):btn.classList.add("checkoutButton"),btn.removeAttribute("aria-disabled"),btn.removeAttribute("tabindex"),btn.setAttribute("data-variant-id",variantId),!btn.classList.contains("atc_link")){var defaultText=btn.getAttribute("data-default-text");if(defaultText){var textTarget=btn.querySelector("span:not(.btn_icon)")||btn;textTarget.innerText=defaultText}}}),this.closest(".star_product_block").querySelector(".discount_tag_wrapper")&&(this.getAttribute("data-discounted")=="yes"?(this.closest(".star_product_block").querySelector(".discount_tag_text span").innerHTML=this.getAttribute("data-discount-price"),this.closest(".star_product_block").querySelector(".discount_tag_wrapper").style.display="block"):this.closest(".star_product_block").querySelector(".discount_tag_wrapper").style.display="none"),this.getAttribute("data-product-title")!=""&&(parentElem2.querySelector(".star_product_title p").innerText=this.getAttribute("data-product-title"))})}),document.querySelector(".prime-day-main-nav")){let handleNav2=function(elem,action){var nav_parent=elem.closest(".prime-day-main-nav-block");nav_parent.querySelector(".prime-day-sub-nav")&&(action=="add"&&nav_parent.classList.add("open"),action=="toggle"&&nav_parent.classList.toggle("open"))};var handleNav=handleNav2;document.querySelectorAll(".main-tab").forEach(function(elem){window.innerWidth>749?elem.onmouseover=function(){handleNav2(elem,"add")}:elem.onclick=function(){handleNav2(elem,"toggle")}}),document.querySelector(".prime-day-nav-section").onmouseleave=function(elem){this.querySelector(".prime-day-main-nav-block.open")&&this.querySelector(".prime-day-main-nav-block.open").classList.remove("open")}}if(document.querySelector(".prime-day-section .progress-bar-fill")&&fetch("https://counter-api.inscoder.workers.dev/get/us.ecoflow.com/community_page_interest",{credentials:"same-origin",method:"GET"}).then(function(response){response.json().then(function(result){if(response.ok){var interestedValue=result.value,find_width=interestedValue*100/400;document.querySelector(".prime-day-section .progress-bar-fill").style.width=find_width+"%"}})}),document.querySelector(".pdp-custom-content")){let openPdpPopupWithCustomContent2=function(){document.querySelector(".pdp-popup-wrapper .popup-content").innerHTML=document.querySelector(".pdp-custom-content-popup-content").innerHTML,document.querySelector(".pdp-popup-wrapper").classList.remove("hide"),document.querySelector(".pdp-popup-wrapper").style.display="block",document.querySelector("body").classList.add("overflow-hidden"),document.querySelector(".pdp-popup-wrapper .accordion-button")&&(document.querySelector(".pdp-popup-wrapper .accordion-button").onclick=function(e){var elem=e.currentTarget;elem.parentElement.querySelector(".accordion-text-inner").classList.toggle("open"),elem.classList.toggle("open"),elem.classList.contains("open")?elem.querySelector("span").innerText="Less Info":elem.querySelector("span").innerText="More Info"})};var openPdpPopupWithCustomContent=openPdpPopupWithCustomContent2;const pdpCustomContent=document.querySelector(".pdp-custom-content");pdpCustomContent&&pdpCustomContent.querySelector(".pdp-custom-content a")&&(pdpCustomContent.querySelector(".pdp-custom-content a").onclick=openPdpPopupWithCustomContent2);const dpuInformationBlockIraTitle=document.querySelector(".dpu-information-block__ira-title");dpuInformationBlockIraTitle&&(dpuInformationBlockIraTitle.onclick=openPdpPopupWithCustomContent2)}if(document.querySelector(".coupon_info_popup")&&(document.querySelector(".coupon_info_popup").onclick=function(){document.querySelector(".pdp-popup-wrapper .popup-content").innerHTML=document.querySelector(".coupon_off .popup_content").innerHTML,document.querySelector(".pdp-popup-wrapper").classList.remove("hide"),document.querySelector("body").classList.add("overflow-hidden")}),document.querySelector(".pdp-popup-wrapper .popup-close")&&(document.querySelector(".pdp-popup-wrapper .popup-close:not(.quote-popup-close)").onclick=function(e){document.querySelector(".pdp-popup-wrapper").classList.add("hide"),document.querySelector(".pdp-popup-wrapper .popup-content").innerHTML="",document.querySelector("body").classList.remove("overflow-hidden")}),document.querySelector(".pdp-popup-wrapper")&&(document.querySelector(".pdp-popup-wrapper").onclick=function(e){document.querySelector(".pdp-popup-wrapper .popup-inner").contains(e.target)||(document.querySelector(".pdp-popup-wrapper").classList.remove("shown"),document.querySelector(".pdp-popup-wrapper").classList.add("hide"),document.querySelector(".pdp-popup-wrapper .popup-content").innerHTML="",document.querySelector("body").classList.remove("overflow-hidden"))}),document.querySelector(".blogs-block-wrapper")){if(window.innerWidth>749)var inTheBoxMobileSlider=new Flickity(".blogs-block-wrapper",{cellAlign:"center",prevNextButtons:!1,wrapAround:!0,contain:!0,imagesLoaded:!0,pageDots:!1});else var inTheBoxMobileSlider=new Flickity(".blogs-block-wrapper",{cellAlign:"left",prevNextButtons:!1,wrapAround:!0,contain:!0,imagesLoaded:!0,pageDots:!0});var parentElem=document.querySelector(".blogs-block-wrapper");parentElem.querySelectorAll(".slider-prev-button").forEach(function(elem){elem.onclick=function(){inTheBoxMobileSlider.previous()}}),parentElem.querySelectorAll(".slider-next-button").forEach(function(elem){elem.onclick=function(){inTheBoxMobileSlider.next()}})}document.querySelector(".klaviyo_popup_content")&&(document.querySelector(".klaviyo_submit_button").onclick=function(){var popupElem=document.createElement("div");popupElem.classList.add("klaviyo_popup"),popupElem.innerHTML=document.querySelector(".klaviyo_popup_content").innerHTML,document.querySelector("body").appendChild(p
6opupElem),document.querySelector("body").classList.add("overflow-hidden"),document.querySelector(".klaviyo_popup .close_popup").onclick=function(){document.querySelector(".klaviyo_popup").remove(),document.querySelector("body").classList.remove("overflow-hidden")}}),document.querySelector(".benefits-popup-btn")&&(document.querySelectorAll(".benefits-popup-btn").forEach(function(elem){elem.onclick=function(){var block_parent=elem.parentElement;document.querySelector(".benefits-popup-content.active")&&(document.querySelector(".benefits-popup-content.active").classList.add("hide"),document.querySelector(".benefits-popup-content.active").classList.remove("active")),block_parent.querySelector(".benefits-popup-content").classList.remove("hide"),block_parent.querySelector(".benefits-popup-content").classList.add("active")}}),document.querySelectorAll(".benefit_popup_close").forEach(function(elem){elem.onclick=function(){var block_parent=elem.parentElement;block_parent.classList.add("hide"),block_parent.classList.remove("active")}}),document.addEventListener("click",function(e){let el=e.target;if(el.classList.contains(".benefits-popup-content")||el.closest(".benefits-popup-content")||el.classList.contains(".benefits-popup-btn")||el.closest(".benefits-popup-btn"))return!1;document.querySelector(".benefits-popup-content.active")&&(document.querySelector(".benefits-popup-content.active").classList.add("hide"),document.querySelector(".benefits-popup-content.active").classList.remove("active"))})),document.querySelector(".recommendation_popup_trigger")&&(document.querySelector(".recommendation_popup_trigger").onclick=function(e){var parentElem2=this.parentElement;if(parentElem2.querySelector(".recommendation_popup_wrapper")){let closePopup2=function(){popupElem.remove(),document.querySelector("body").classList.remove("overflow-hidden")};var closePopup=closePopup2,popupElem=document.createElement("div");popupElem.classList.add("recommendation_popup_wrapper_inner"),popupElem.innerHTML=parentElem2.querySelector(".recommendation_popup_wrapper").innerHTML,document.querySelector("body").appendChild(popupElem),document.querySelector("body").classList.add("overflow-hidden"),popupElem.addEventListener("click",function(e2){let el=e2.target;if(el.classList.contains(".recommendation_popup_inner")||el.closest(".recommendation_popup_inner"))return!1;closePopup2()}),popupElem.querySelector(".recommendation_popup_close").onclick=function(){closePopup2()},popupElem.querySelectorAll(".step_box_inner").length>0&&popupElem.querySelectorAll(".step_box").forEach(function(elem){elem.onclick=function(){if(this.classList.contains("selected"))this.classList.remove("selected"),popupElem.querySelector(".next_btn").setAttribute("disabled","");else{var parentElem3=this.closest(".step_boxes");parentElem3.querySelector(".step_box.selected")&&parentElem3.querySelector(".step_box.selected").classList.remove("selected"),this.classList.add("selected"),popupElem.querySelector(".next_btn").removeAttribute("disabled"),elem.closest(".step_content").getAttribute("data-step")==1&&popupElem.querySelector('.step_content[data-step="2"] .step_box.selected')&&popupElem.querySelector('.step_content[data-step="2"] .step_box.selected').classList.remove("selected")}elem.closest(".step_content").getAttribute("data-step")==1&&this.getAttribute("data-value")==2&&(popupElem.querySelector('.step_content[data-step="2"] .step_box[data-value="2"]').style.display="none"),elem.closest(".step_content").getAttribute("data-step")==1&&this.getAttribute("data-value")==3&&(popupElem.querySelector('.step_content[data-step="2"] .step_box[data-value="1"]').style.display="none")}}),popupElem.querySelectorAll(".recommendation_steps .step").length>0&&popupElem.querySelectorAll(".recommendation_steps .step").forEach(function(elem){elem.onclick=function(){if(elem.classList.contains("selected")){var step=parseInt(elem.getAttribute("data-step")),parentElem3=this.closest(".recommendation_popup_wrapper_inner");step<3&&(parentElem3.querySelector(".next_btn").style.display="inline-flex"),parentElem3.querySelectorAll(".recommendation_steps .step").forEach(function(elem2,index){var step_index=index+parseInt(1);step_index>step&&elem2.classList.contains("active")&&elem2.classList.remove("active")}),parentElem3.querySelectorAll('.step_content[data-step="'+step+'"] .step_box.selected').length>0&&parentElem3.querySelector(".next_btn").removeAttribute("disabled"),parentElem3.querySelector(".recommendation_step_content .step_content.active").classList.remove("active"),parentElem3.querySelector('.recommendation_step_content .step_content[data-step="'+step+'"]').classList.add("active"),parentElem3.querySelector(".next_btn").setAttribute("data-step",step+parseInt(1))}}}),popupElem.querySelectorAll(".next_btn").length>0&&(popupElem.querySelector(".next_btn").onclick=function(){var parentElem3=this.closest(".recommendation_popup_wrapper_inner"),next_step=parseInt(this.getAttribute("data-step"));if(next_step==3){this.style.display="none";var step_1_value=parentElem3.querySelector('.step_content[data-step="1"] .step_box.selected').getAttribute("data-value"),step_2_value=parentElem3.querySelector('.step_content[data-step="2"] .step_box.selected').getAttribute("data-value"),step_value="1-"+step_1_value+"-2-"+step_2_value;parentElem3.querySelector('.step_content[data-step="3"] .product_box.active')&&parentElem3.querySelector('.step_content[data-step="3"] .product_box.active').classList.remove("active"),parentElem3.querySelector('.step_content[data-step="3"] .product_box[data-recommendation-for="'+step_value+'"]').classList.add("active")}var prev_step=next_step-parseInt(1);parentElem3.querySelector('.recommendation_steps .step[data-step="'+prev_step+'"]').classList.add("selected"),parentElem3.querySelectorAll(".recommendation_steps .step").forEach(function(elem,index){var step_index=index+parseInt(1);step_index>next_step&&elem.classList.contains("active")&&elem.classList.remove("active")}),parentElem3.querySelector('.recommendation_steps .step[data-step="'+next_step+'"]').classList.add("active"),parentElem3.querySelector(".recommendation_step_content .step_content.active").classList.remove("active"),parentElem3.querySelector('.recommendation_step_content .step_content[data-step="'+next_step+'"]').classList.add("active"),this.setAttribute("disabled",""),this.setAttribute("data-step",next_step+parseInt(1)),parentElem3.querySelector(".active_step_text").innerText=parentElem3.querySelector('.recommendation_steps .step[data-step="'+next_step+'"]').innerText}),addStarProduct(".atcButton","",closePopup2)}}),document.querySelector(".promotion_popup_close")&&(document.querySelector(".promotion_popup_close").onclick=function(e){this.closest(".promotion_section").remove()});function is_3_valid(input,parentElement){var emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return input===""?(error+=parentElement.querySelector(".blank-email-error").innerHTML,!1):emailRegex.test(input)?parentElement.querySelector("#emarsys_t_c")&&parentElement.querySelector("#emarsys_t_c").checked==!1?(parentElement.querySelector(".disclaimer-error")?error+=parentElement.querySelector(".disclaimer-error").innerHTML:error+="Tick the box and consent to the Terms of Use and Privacy Policy.",!1):!0:(error+=parentElement.querySelector(".invali
6d-email-error").innerHTML,!1)}function CheckInputs(ProfileForm){var check_ok=!0;return error="",check_ok=is_3_valid(ProfileForm.querySelector(".Form__Input").value,ProfileForm)&&check_ok,check_ok==!1&&alert(error),check_ok}if(document.querySelectorAll(".promotion_popup_trigger").length>0){let dragElement2=function(elmnt){var pos1=0,pos2=0,pos3=0,pos4=0;elmnt.onmousedown=dragMouseDown,elmnt.ontouchstart=dragMouseDown;function dragMouseDown(e){drag=!1,e=e||window.event,e.touches&&document.querySelector("body").classList.add("overflow-hidden"),e=e.touches?e.touches[0]:e,pos3=e.clientX,pos4=e.clientY,document.onmouseup=closeDragElement,document.ontouchend=closeDragElement,document.onmousemove=elementDrag,document.ontouchmove=elementDrag}function elementDrag(e){drag=!0,e=e||window.event,e=e.touches?e.touches[0]:e,pos1=pos3-e.clientX,pos2=pos4-e.clientY,pos3=e.clientX,pos4=e.clientY,pos3>0&&pos3<window.innerWidth&&(elmnt.style.left=elmnt.offsetLeft-pos1+"px"),pos4>document.querySelector("[data-header-section]").clientHeight&&pos4<window.innerHeight&&(elmnt.style.top=elmnt.offsetTop-pos2+"px"),elmnt.style.bottom="unset"}function closeDragElement(){document.onmouseup=null,document.onmousemove=null,document.ontouchstart=null,document.ontouchmove=null,document.querySelector("body").classList.remove("overflow-hidden")}};var dragElement=dragElement2;let drag=!1;document.querySelectorAll(".promotion_section").forEach(function(elem){dragElement2(elem),elem.querySelector(".promotion_popup_trigger").onclick=function(e){if(drag==!1){drag=!0;var targetElem=this.getAttribute("data-target");document.querySelector("."+targetElem)&&(document.querySelector("."+targetElem).style.display="block",document.querySelector("body").classList.add("overflow-hidden"))}}})}document.querySelectorAll(".promotion_popup_wrapper_inner").length>0&&document.querySelectorAll(".promotion_popup_wrapper_inner").forEach(function(popupElem){popupElem.addEventListener("click",function(e){let el=e.target;if(el.classList.contains(".promotion_popup_inner")||el.closest(".promotion_popup_inner"))return!1;popupElem.style.display="none",document.querySelector("body").classList.remove("overflow-hidden")}),popupElem.querySelector(".promotion_poup_close").onclick=function(){popupElem.style.display="none",document.querySelector("body").classList.remove("overflow-hidden")};var ProfileForm=popupElem.querySelector(".ls-solution-banner__form");popupElem.querySelector(".emarsys-form-btn")&&(popupElem.querySelector(".emarsys-form-btn").onclick=function(e){CheckInputs(ProfileForm)==!0&&(window.onbeforesubmit&&onbeforesubmit(),ProfileForm.setAttribute("target","hidden_iframe"),ProfileForm.submit(),setTimeout(function(){ProfileForm.setAttribute("target",""),ProfileForm.reset(),popupElem.querySelector(".promotion_popup_inner").classList.add("success")},1e3))})}),document.querySelectorAll(".emarsys__form").length>0&&document.querySelectorAll(".emarsys__form").forEach(function(formWrap){if(formWrap.querySelector(".emarsys-form-btn")){var ProfileForm=formWrap.querySelector("form");ProfileForm.querySelector(".emarsys-form-btn").onclick=function(e){if(CheckInputs(ProfileForm)==!0){window.onbeforesubmit&&onbeforesubmit();var successMessage=ProfileForm.querySelector("#successMessage");ProfileForm.setAttribute("target","hidden_iframe"),ProfileForm.submit(),setTimeout(function(){ProfileForm.setAttribute("target",""),ProfileForm.reset(),formWrap.classList.add("form-success"),successMessage.textContent==""&&(successMessage.textContent="Success!")},1e3)}}}}),theme.renderCorporateModalDiscounts=function(modal,discountsSource,overridePriceCents){if(!(!modal||!discountsSource)){var wrapper=modal.querySelector(".discounts-wrapper");if(wrapper){var rows=discountsSource.querySelectorAll(".corporate-product-discount");if(!rows.length){wrapper.innerHTML="",wrapper.style.display="none";return}var priceCents=overridePriceCents?parseInt(overridePriceCents,10):0;if(priceCents||(priceCents=parseInt(discountsSource.getAttribute("data-base-price"),10)||0),!priceCents){var priceWrap=modal.querySelector(".price-wrapper[data-
6price], [data-variant-price]");priceWrap&&(priceCents=parseInt(priceWrap.getAttribute("data-price")||priceWrap.getAttribute("data-variant-price"),10)||0)}var html="";Array.prototype.forEach.call(rows,function(row){var qtyEl=row.querySelector(".corporate-product-discount-qty"),pctEl=row.querySelector(".corporate-product-discount-percent"),qty=qtyEl?qtyEl.textContent.trim():"",pctText=pctEl?pctEl.textContent.trim():"",match=pctText.match(/(\d+(?:\.\d+)?)\s*%/),percent=match?parseFloat(match[1]):0,unitPriceHtml="";if(priceCents>0&&match){var unitCents=Math.round(priceCents*(100-percent)/100),moneyFmt=theme.Currency&&theme.moneyFormat?theme.Currency.formatMoney(unitCents,theme.moneyFormat):"$"+(unitCents/100).toFixed(2);unitPriceHtml='<div class="corporate-product-discount-price">'+moneyFmt+" Each</div>"}html+='<div class="corporate-product-discount"><div class="corporate-product-discount-qty">'+qty+"</div>"+unitPriceHtml+'<div class="corporate-product-discount-percent">'+pctText+"</div></div>"}),wrapper.innerHTML=html,wrapper.style.display="grid",wrapper.classList.add("corporate-modal-discounts");var priceEl=modal.querySelector("[data-price-element]"),priceBlock=modal.querySelector(".product__price"),anchor=priceEl||priceBlock;anchor&&anchor.insertAdjacentElement("afterend",wrapper)}}};var quick_viewModal=document.querySelector("#corporate-atc-modal");if(quick_viewModal&&(document.addEventListener("click",function(e){var target=e.target;if(target.classList.contains("corporate-atc-btn")||target.closest(".corporate-atc-btn")){target.classList.contains("corporate-atc-btn")||(target=target.closest(".corporate-atc-btn")),e.preventDefault();var productUrl=new URL("".concat(window.location.origin).concat(target.getAttribute("data-product-url"))),modal=document.getElementById(target.getAttribute("aria-controls"));modal.classList.add("is-loading"),productUrl.searchParams.set("view","quick-view"),fetch(productUrl.href,{credentials:"same-origin",method:"GET"}).then(function(response){response.text().then(function(content){modal.querySelector(".modal__inner").innerHTML=content;const scripts=content.match(/<script[^>]*>([\s\S]*?)<\/script>/gi);if(scripts&&scripts.forEach(scriptTag=>{try{const content2=scriptTag.match(/<script[^>]*>([\s\S]*?)<\/script>/i);if(content2&&content2[1]){const script=document.createElement("script");script.text=content2[1],document.body.appendChild(script),document.body.removeChild(script)}}catch(error2){console.log(error2)}}),modal.querySelectorAll(".modal__inner .checkoutButton").length>0&&addStarProduct(".modal__inner .checkoutButton","checkout","","modal"),initCountdownItem)try{initCountdownItem(modal.querySelector(".modal__inner").querySelector(".countdown_wrapper"))}catch{}if(window.initCountdownAll)try{window.initCountdownAll(modal)}catch{}var discountElem=target.parentElement.parentElement,discountsSource=discountElem.querySelector(".corporate-product-discounts");typeof theme.renderCorporateModalDiscounts=="function"?theme.renderCorporateModalDiscounts(modal,discountsSource):modal.querySelector(".discounts-wrapper")&&discountsSource&&(modal.querySelector(".discounts-wrapper").innerHTML=discountsSource.innerHTML),modal.classList.remove("is-loading");var modalProductSection=new theme.Product(modal.querySelector('[data-section-type="product"]'));if(discountsSource&&typeof theme.renderCorporateModalDiscounts=="function"){var modalSectionEl=modal.querySelector('[data-section-type="product"]');modalSectionEl&&modalSectionEl.addEventListener("variantPriceChange",function(e2){!e2.detail||!e2.detail.variant||theme.renderCorporateModalDiscounts(modal,discountsSource,e2.detail.variant.price)})}var min_qty=target.getAttribute("data-min-qty");if(min_qty!=""){let el=modal.querySelector("[data-quantity-input]");el.value=target.getAttribute("data-min-qty"),el.dispatchEvent(new Event("change"))}if(window.innerWidth<750){var slider=modal.querySelector("[data-product-main-slider]"),flkty=Flickity.data(slider);flkty.destroy(),setTimeout(function(){var main_slider=modal.querySelector(".product-single__media__carousel"),main_slider_options=JSON.parse(main_slider.getAttribute("data-flickity-config"));main_slider&&(this.flickityInstance=new Flickity(main_slider,main_slider_options),this.flickityInstance.element.classList.add("rendered"))},1e3)}theme.Video.loadVideos(),modal.querySelector(".product-main-video")&&document.dispatchEvent(new CustomEvent("youtubeAPIReady",{detail:{},bubbles:!0,cancelable:!0})),modal.querySelector("#email_signup_product")&&KlaviyoSubscribe.attachToForms("#email_signup_product",{hide_form_on_success:!0}),document.querySelector("body").classList.add("overflow-hidden"),modal.setAttribute("aria-hidden","false")})})}}),document.addEventListener("click",function(e){let el=e.target;if(el.classList.contains("close-corporate-modal")||el.closest(".close-corporate-modal")){e.preventDefault();var modal=el.closest(".modal");modal.setAttribute("aria-hidden","true"),modal.querySelector(".modal__inner").innerHTML="",document.querySelector("body").classList.remove("overflow-hidden")}})),document.querySelectorAll(".corporate-compare-btn .btn").length>0&&document.querySelectorAll(".corporate-compare-btn .btn").forEach(function(elem){elem.onclick=function(){var parentElem2=elem.parentElement,modal=document.querySelector(".compare-modal");modal.querySelector(".modal__inner").innerHTML=parentElem2.querySelector(".corporate-compare-popup-content").innerHTML,document.querySelector("body").classList.add("overflow-hidden"),modal.setAttribute("aria-hidden","false")}}),document.body.addEventListener("keyup",function(e){if(e.key=="Escape"&&document.querySelector(".modal[aria-hidden=false]")){var modal=document.querySelector(".modal[aria-hidden=false]");modal.setAttribute("aria-hidden","true"),modal.querySelector(".modal__inner").innerHTML="",document.querySelector("body").classList.remove("overflow-hidden")}}),document.addEventListener("click",function(e){let el=e.target;if(el.classList.contains("compare-popup-btn")||el.closest(".compare-popup-btn")){e.preventDefault(),el.classList.contains("compare-popup-btn")||(el=el.closest(".compare-popup-btn"));var popupElem=el.closest(".modal"),image_index=el.getAttribute("data-btn-index");popupElem.querySelector(".compare-popup-btn.active").classList.remove("active"),el.classList.add("active"),popupElem.querySelector(".compare-popup-table-inner.active").classList.remove("active"),popupElem.querySelector('.compare-popup-table-inner[data-table-index="'+image_index+'"]').classList.add("active")}}),document.addEventListener("click",function(e){let el=e.target;if(el.classList.contains("close-popup-modal")||el.closest(".close-popup-modal")){e.preventDefault();var modal=el.closest(".modal");modal.setAttribute("aria-hidden","true"),modal.querySelector(".modal__inner").innerHTML="",document.querySelector("body").classList.remove("overflow-hidden")}}),document.querySelectorAll(".corporate-product-grid").length>0){let alignCorporateProductCard2=function(){document.querySelectorAll(".corporate-product-grid").forEach(function(elem){var titlePriceHeight=0,titleHeight=0;elem.style.setProperty("--product-title-height","auto"),elem.style.setProperty("--title-height","auto"),elem.querySelectorAll(".corporate-product").forEach(function(product){var titlePriceElem=product.querySelector(".corporate-product-title-price"),titleElem=product.querySelector(".corporate-product-title");titlePriceElem.clientHeight>titlePriceHeight&&(titlePriceHeight=titlePriceElem.clientHeight),titleElem.clientHeight>titleHeight&&(titleHeight=titleElem.clientHeight)}),elem.style.setProperty("--product-title-height",titlePriceHeight+"px"),elem.style.setProperty("--title-height",titleHeight+"px")})};var alignCorporateProductCard=alignCorporateProductCard2;alignCorporateProductCard2(),window.addEventListener("resize",function(){setTimeout(function(){alignCorporateProductCard2()},500)})}document.querySelectorAll(".star_section_quantity_block").length>0&&document.querySelectorAll(".star_section_quantity_block").forEach(function(elem){elem.querySelector(".minus_btn").onclick=function(){var parentElem2=this.closest(".star-product-info-wrapper"),inputValue=parentElem2.querySelector(".quantity_input").value;if(inputValue=inputValue-1,inputValue>=1&&(parentElem2.querySelector(".quantity_input").value=inputValue,parentElem2.querySelectorAll(".discount_tier_percentage").length>0)){var discounted_price=parentElem2.querySelector(".discount_tier_product_price").getAttribute("data-price");parentElem2.querySelectorAll(".discount_tier_percentage").forEach(function(tierElem){var pcs=tierElem.getAttribute("data-pcs"),percentage=tierElem.getAttribute("data-percentage"),price=parentElem2.querySelector(".discount_tier_product_price").getAttribute("data-price");inputValue>=pcs&&(discounted_price=price*percentage/100,discounted_price=price-discounted_price)}),parentElem2.querySelector(".star_product_price").innerText=theme.Currency.formatMoney(discounted_price,theme.moneyFormat)}},elem.querySelector(".plus_btn").onclick=function(){var parentElem2=this.closest(".star-product-info-wrapper"),inputValue=parentElem2.querySelector(".quantity_input").value;if(inputValue=parseInt(inputValue)+parseInt(1),parentElem2.querySelector(".quantity_input").value=inputValue,parentElem2.querySelectorAll(".discount_tier_percentage").length>0){var discounted_price=parentElem2.querySelector(".discount_tier_product_price").getAttribute("data-price");parentElem2.querySelectorAll(".discount_tier_percentage").forEach(function(tierElem){var pcs=tierElem.getAttribute("data-pcs"),percentage=tierElem.getAttribute("data-percentage"),price=parseInt(parentElem2.querySelector(".discount_tier_product_price").getAttribute("data-price"));inputValue>=pcs&&(discounted_price=price*percentage/100,discounted_price=price-discounted_price)}),parentElem2.querySelector(".star_product_price").innerText=theme.Currency.formatMoney(discounted_price,theme.moneyFormat)}}});function generateTraceId(){const date=new Date,year=`00${date?.getFullYear()}`.slice(-2),month=`00${date.getMonth()+1}`.slice(-2),day=`00${date.getDay()}`.slice(-2),hour=`00${date.getHours()}`.slice(-2),minute=`00${date.getMinutes()}`.slice(-2),second=`00${date.getSeconds()}`.slice(-2),millSecond=`000${date.getMilliseconds()}`.slice(-3),randomStr1=`${Math.random()}`,randomStr2=`${Math.random()}`;return year+month+day+hour+minute+second+millSecond+randomStr1.slice(-8)+randomStr2.slice(-9)}document.querySelectorAll(".bambu-tabs").length>0&&(document.querySelectorAll(".bambu-tabs .tab-title").forEach(function(elem){elem.onclick=function(){var tabTitle=elem.getAttribute("data-title");document.querySelector(".bambu-tabs .tab-title.active")&&document.querySelector(".bambu-tabs .tab-title.active").classList.remove("active"),elem.classList.add("active"),document.querySelector(".bambu-video-wrapper.active")&&document.querySelector(".bambu-video-wrapper.active").classList.remove("active"),document.querySelector('.bambu-video-wrapper[data-title="'+tabTitle+'"]').classList.add("active");var videoSlider2=new Flickity(".bambu-video-wrapper.active",{prevNextButtons:!1,contain:!0,groupCells:!0,watchCSS:!0})}}),document.querySelectorAll(".bambu-video-wrapper.active").forEach(function(elem){var videoSlider2=new Flickity(elem,{prevNextButtons:!1,contain:!0,groupCells:!0,watchCSS:!0,lazyLoad:!0})})),document.querySelectorAll(".generac-body-section-block .read_more_btn").length>0&&document.querySelectorAll(".generac-body-section-block .read_more_btn").forEach(function(elem){elem.onclick=function(){elem.closest(".generac-body-section-block-content-inner").classList.toggle("active"),elem.classList.contains("active")?elem.querySelector("span").innerText="View More":elem.querySelector("span").innerText="View Less",elem.classList.toggle("active")}}),document.querySelectorAll(".trigger-btn").length>0&&document.querySelectorAll(".trigger-btn").forEach(function(element2){element2.onclick=function(e){e.preventDefault();var section_id=element2.getAttribute("href"),sectionElem=document.querySelector(section_id);if(sectionElem.querySelectorAll(".star-page-container").length>0)var scrollDiv=sectionElem.querySelectorAll(".star-page-container")[0].offsetTop;else{var scrollDiv=document.querySelector(section_id).offsetTop+200;window.innerWidth<750&&(scrollDiv=document.querySelector(section_id).offsetTop)}window.scrollTo({top:scrollDiv,behavior:"smooth"})}}),document.querySelectorAll(".generac-body-section-block-content-inner").length>0&&window.innerWidth>749&&document.querySelectorAll(".generac-body-section").forEach(function(element2){var contentHeight=0;element2.querySelectorAll(".generac-body-section-block-content-inner").forEach(function(elem){elem.querySelector(".generac-body-section-block-content.hideMobile").clientHeight>contentHeight&&(contentHeight=elem.querySelector(".generac-body-section-block-content.hideMobile").clientHeight)}),element2.style.setProperty("--content-height",contentHeight+"px")});function initializeMobileSwiper(elem){var swiperContainer=document.querySelector(elem);if(swiperContainer.classList.contains("swiper-initialized")){var existingSwiper=swiperContainer.swiper;existingSwiper&&existingSwiper.destroy(),swiperContainer.classList.remove("swiper-initialized")}if(window.innerWidth<750){var swiper=new Swiper(swiperContainer,{freeMode:!0,spaceBetween:16,slidesPerView:"auto",scrollbar:{el:swiperContainer.parentElement.querySelector(".swiper-scrollbar")},breakpoints:{768:{spaceBetween:26}}});swiperContainer.swiper=swiper,swiperContainer.classList.add("swiper-initialized")}}if(document.querySelectorAll(".wef_product_block").length>0){let alignWEFProductInfo2=function(){var infoHeight=0,titleHeight=0,swiperSlideHeight=0;document.querySelector(".wef-products-inner").style.setProperty("--product-info-height","auto"),document.querySelector(".wef-products-inner").style.setProperty("--product-title-height","auto"),document.querySelectorAll(".wef_product_block").forEach(function(element2){element2.querySelector(".product-title").clientHeight>titleHeight&&(titleHeight=element2.querySelector(".product-title").clientHeight),element2.querySelector(".product-description").clientHeight>infoHeight&&(infoHeight=element2.querySelector(".product-description").clientHeight)}),document.querySelector(".wef-products-inner").style.setProperty("--product-info-height",infoHeight+"px"),document.querySelector(".wef-products-inner").style.setProperty("--product-title-height",titleHeight+"px"),document.querySelectorAll(".wef_product_block").forEach(function(element2){element2.clientHeight>swiperSlideHeight&&(swiperSlideHeight=element2.clientHeight)}),document.querySelector(".wef-products-inner").style.setProperty("--swiper-slide-height",swiperSlideHeight+"px")};var alignWEFProductInfo=alignWEFProductInfo2;alignWEFProductInfo2(),window.addEventListener("resize",function(){setTimeout(function(){alignWEFProductInfo2()},500)}),initializeMobileSwiper(".wef-products-swiper"),window.addEventListener("resize",function(){initializeMobileSwiper(".wef-products-swiper")})}if(document.querySelectorAll(".valentine-lp-section").length>0){let alignPrimeTitle2=function(){document.querySelectorAll(".valentine-lp-section").forEach(function(element2){var titleHeight=0;element2.style.setProperty("--title-height","auto"),element2.querySelectorAll(".prime-day-block-content-title").forEach(function(titleElem){titleElem.clientHeight>titleHeight&&(titleHeight=titleElem.clientHeight)}),element2.style.setProperty("--title-height",titleHeight+"px")})};var alignPrimeTitle=alignPrimeTitle2;alignPrimeTitle2(),window.addEventListener("resize",function(){setTimeout(function(){alignPrimeTitle2()},500)})}if(document.querySelectorAll(".scenario-block").length>
60&&(initializeMobileSwiper(".scenario-blocks-swiper"),window.addEventListener("resize",function(){initializeMobileSwiper(".scenario-blocks-swiper")})),document.querySelectorAll("div.disaster-sale-tabs-nav__item-title").length>0&&document.querySelectorAll(".disaster-sale-tabs-nav__item").forEach(function(elem){elem.onclick=function(e){if(elem.querySelector("div.disaster-sale-tabs-nav__item-title")){let elemLink=elem.querySelector("div.disaster-sale-tabs-nav__item-title").getAttribute("data-tab-id"),parentElem2=elem.closest(".disaster-sale-tabs-nav");elemLink!=""&&document.querySelector('.disaster-sale-tab-products-container[data-tab="'+elemLink+'"]')&&(parentElem2.querySelector(".disaster-sale-tabs-nav__item.active").classList.remove("active"),elem.classList.add("active"),document.querySelector(".disaster-sale-tab-products-container.active").classList.remove("active"),document.querySelector('.disaster-sale-tab-products-container[data-tab="'+elemLink+'"]').classList.add("active"),alignProductTitleRow()),window.innerWidth<750&&scrollIntoView(elem,elem.parentElement)}}}),document.querySelector(".star-section .bambu-video-wrapper"))var videoSlider=new Flickity(".star-section .bambu-video-wrapper",{prevNextButtons:!1,pageDots:!1,contain:!0,cellAlign:"center",wrapAround:!0,watchCSS:!0});if(document.querySelector(".disaster-sale-tabs.is-sticky")&&document.querySelectorAll(".disaster-sale-products-section").length>0){var element=document.querySelector(".disaster-sale-tabs.is-sticky"),elemRect=element.getBoundingClientRect(),offset=element.offsetTop;window.onscroll=function(){var elementEnd=document.querySelectorAll(".disaster-sale-products-section")[0];document.querySelectorAll(".disaster-sale-products-section").forEach(function(elem){elem.querySelector(".disaster-sale-tab-products-container.active")&&(elementEnd=elem)});var scrollEnd=elementEnd.offsetTop+elementEnd.clientHeight+40;window.pageYOffset>offset&&window.pageYOffset<scrollEnd?element.parentElement.classList.add("fixed"):(window.pageYOffset>scrollEnd||window.pageYOffset<offset)&&element.parentElement.classList.remove("fixed")}}function setPolicySelectEvent(){var policy_country_selector=document.querySelectorAll("[data-policy-country-toggle]");if(policy_country_selector.length>0){var headerOptZIndex=document.querySelector("#shopify-section-header").style.zIndex;policy_country_selector.forEach(function(element2){element2.addEventListener("click",function(e){window.innerWidth<750&&(document.querySelector("#shopify-section-announcement-bar").style.display="none",document.querySelector(".js-mobile-nav-toggle").getAttribute("aria-expanded")=="true"&&document.querySelector(".js-mobile-nav-toggle").click()),document.querySelector(".item-has-mega-menu.visible")&&(document.querySelector(".item-has-mega-menu.visible .nav-bar__link.active").classList.remove("active"),document.querySelector(".item-has-mega-menu.visible").classList.remove("visible"),document.querySelector(".mega_menu_overlay").style.display="none"),document.querySelector(".policy-country-selector-popup-selector").classList.add("visible"),document.querySelector("#shopify-section-header").style.zIndex=99,document.querySelector("body").classList.add("overflow-hidden")})});var popup_close=document.querySelectorAll("[data-policy-country-popup-close]");popup_close.forEach(function(element2){element2.addEventListener("click",function(e){document.querySelector(".policy-country-selector-popup-selector").classList.remove("visible"),document.querySelector("body").classList.remove("overflow-hidden"),document.querySelector("#shopify-section-announcement-bar").style.display="block",setTimeout(()=>{document.querySelector("#shopify-section-header").style.zIndex=headerOptZIndex},500)})})}}setPolicySelectEvent(),document.querySelectorAll(".button-tabs--row").length>0&&document.querySelectorAll(".button-tabs--row").forEach(function(elem){elem.querySelectorAll(".btn").forEach(function(tab){if(tab.classList.contains("active")==!1){var linked_to=tab.getAttribute("data-linked-to");if(linked_to=="section"){var target_1=tab.getAttribute("data-first-section"),target_2=tab.getAttribute("data-second-section"),target_3=tab.getAttribute("data-third-section");target_1!=""&&document.querySelector(target_1)&&(document.querySelector(target_1).style.display="none"),target_2!=""&&document.querySelector(target_2)&&(document.querySelector(target_2).style.display="none"),target_3!=""&&document.querySelector(target_3)&&(document.querySelector(target_3).style.display="none")}else if(linked_to=="blocks"){var block_id=tab.getAttribute("data-block-id");block_id!=""&&document.querySelectorAll('.star_product_block[data-block-id="'+block_id+'"]').length>0&&(document.querySelectorAll('.star_product_block[data-block-id="'+block_id+'"]').forEach(function(elem2){elem2.style.display="none"}),document.querySelector('.view_more_wrapper[data-block-id="'+block_id+'"]')&&(
6document.querySelector('.view_more_wrapper[data-block-id="'+block_id+'"]').style.display="none"))}}tab.addEventListener("click",function(e){var parentElem2=this.closest(".button-tabs--row"),current_target_1=parentElem2.querySelector(".btn.active").getAttribute("data-first-section"),current_target_2=parentElem2.querySelector(".btn.active").getAttribute("data-second-section"),current_target_3=parentElem2.querySelector(".btn.active").getAttribute("data-third-section");current_target_1!=""&&document.querySelector(current_target_1)&&(document.querySelector(current_target_1).style.display="none"),current_target_2!=""&&document.querySelector(current_target_2)&&(document.querySelector(current_target_2).style.display="none"),current_target_3!=""&&document.querySelector(current_target_3)&&(document.querySelector(current_target_3).style.display="none"),parentElem2.querySelector(".btn.active").classList.remove("active"),this.classList.add("active");var linked_to2=this.getAttribute("data-linked-to");if(linked_to2=="section"){var target_12=this.getAttribute("data-first-section"),target_22=this.getAttribute("data-second-section"),target_32=this.getAttribute("data-third-section");target_12!=""&&document.querySelector(target_12)&&(document.querySelector(target_12).style.display="block"),target_22!=""&&document.querySelector(target_22)&&(document.querySelector(target_22).style.display="block"),target_32!=""&&document.querySelector(target_32)&&(document.querySelector(target_32).style.display="block")}else if(linked_to2=="blocks"){document.querySelectorAll(".star-page-product-multiple-tab-section .star_product_block").forEach(function(elem2){elem2.style.display="none"}),document.querySelectorAll(".star-page-product-multiple-tab-section .view_more_wrapper").length>0&&document.querySelectorAll(".star-page-product-multiple-tab-section .view_more_wrapper").forEach(function(elem2){elem2.style.display="none"});var block_id2=this.getAttribute("data-block-id");block_id2!=""&&document.querySelectorAll('.star_product_block[data-block-id="'+block_id2+'"]').length>0&&(document.querySelectorAll('.star_product_block[data-block-id="'+block_id2+'"]').forEach(function(elem2,index){var products_count=elem2.closest(".star-page-product-multiple-tab-section").getAttribute("data-products-count"),products_count_m=elem2.closest(".star-page-product-multiple-tab-section").getAttribute("data-products-count-m");window.innerWidth<750?index<products_count_m&&(elem2.style.display="flex"):index<products_count&&(elem2.style.display="flex")}),document.querySelector('.view_more_wrapper[data-block-id="'+block_id2+'"]')&&(window.innerWidth<750?document.querySelector('.view_more_wrapper[data-block-id="'+block_id2+'"]').classList.contains("hideMobile")||(document.querySelector('.view_more_wrapper[data-block-id="'+block_id2+'"]').style.display="flex"):document.querySelector('.view_more_wrapper[data-block-id="'+block_id2+'"]').classList.contains("hideDesktop")||(document.querySelector('.view_more_wrapper[data-block-id="'+block_id2+'"]').style.display="flex")))}alignProductTitleRow()})})}),document.querySelector(".floating-cart")&&(document.querySelector(".floating-cart").onclick=function(){theme.Cart.prototype._onProductAdded()}),window.ecoflowThemeOnReady(function(){if(document.querySelectorAll(".pdp-tooltip").length>0){var tooltips=document.querySelectorAll(".pdp-tooltip .tooltip-text");tooltips.forEach(function(tooltip){tooltip.addEventListener("click",function(){tooltip.parentElement.classList.toggle("open"),tooltip.parentElement.style.setProperty("--tooltip-width",tooltip.offsetWidth+"px")})});var tooltip_close=document.querySelectorAll(".tooltip-content .close");tooltip_close.forEach(function(close){close.addEventListener("click",function(){close.closest(".pdp-tooltip.open").classList.remove("open")})})}if(document.querySelectorAll(".hotspot").length>0){var hotspots=document.querySelectorAll(".hotspot");hotspots.forEach(function(hotspot){hotspot.addEventListener("click",function(){var target=hotspot.getAttribute("data-target"),content=document.querySelector('.hotspot-content[data-ref="'+target+'"]');content.classList.toggle("open"),hotspot.classList.toggle("open");var content_v_pos=hotspot.offsetTop-20,content_h_pos=parseInt(hotspot.offsetLeft+hotspot.offsetWidth/2-150);content.style.bottom="calc(100% - "+content_v_pos+"px)";var containerWidth=document.querySelector(".pdp-hotspot-images-wrapper").innerWidth/2-40;window.innerWidth<750&&content_h_pos<0?(content.style.left="0",content.style.transform="unset",content.querySelector("span").style.left=parseInt(hotspot.offsetLeft+12)+"px"):content.style.left=content_h_pos+"px"})})}});function getTimeRemaining(endDate){const modifiedEndDate=endDate.replaceAll("-","/")+" GMT+8",beijingEndDateToStoreTimezoneEndDate=new Date(modifiedEndDate).toLocaleStr
6ing("en-US",{timeZone:"Asia/Shanghai"}),storeTimezoneEndDateInUnix=new Date(beijingEndDateToStoreTimezoneEndDate).getTime(),storeTimezoneCurrentDate=new Date().toLocaleString("en-US",{timeZone:"Asia/Shanghai"}),storeTimezoneCurrentDateInUnix=new Date(storeTimezoneCurrentDate).getTime(),total=storeTimezoneEndDateInUnix-storeTimezoneCurrentDateInUnix,seconds=Math.floor(total/1e3%60),minutes=Math.floor(total/1e3/60%60),hours=Math.floor(total/(1e3*60*60)%24),days=Math.floor(total/(1e3*60*60*24));return{total,days,hours,minutes,seconds}}function initializeCartDiscountBar(data){if(!data||data.length===0){hideCartDiscountBar();return}const cartItems=document.querySelector(".Cart__ItemList").querySelectorAll(".CartItemContainer");if(data[0].ruleType==="GIFT_CARD"){let updateBarTimer2=function(){const t=getTimeRemaining(data[0].endTime);if(t.total<=0){giftCardBarCartPage&&(daysElementCartPage.textContent="00",hoursElementCartPage.textContent="00",minutesElementCartPage.textContent="00",secondsElementCartPage.textContent="00"),giftCardBarCartDrawer&&(daysElementCartDrawer.textContent="00",hoursElementCartDrawer.textContent="00",minutesElementCartDrawer.textContent="00",secondsElementCartDrawer.textContent="00"),clearInterval(timeInterval);return}giftCardBarCartPage&&(daysElementCartPage.textContent=t.days<10?"0"+t.days:t.days,hoursElementCartPage.textContent=("0"+t.hours).slice(-2),minutesElementCartPage.textContent=("0"+t.minutes).slice(-2),secondsElementCartPage.textContent=("0"+t.seconds).slice(-2)),giftCardBarCartDrawer&&(daysElementCartDrawer.textContent=t.days<10?"0"+t.days:t.days,hoursElementCartDrawer.textContent=("0"+t.hours).slice(-2),minutesElementCartDrawer.textContent=("0"+t.minutes).slice(-2),secondsElementCartDrawer.textContent=("0"+t.seconds).slice(-2))};var updateBarTimer=updateBarTimer2;cartItems.forEach(cartItem=>{[cartItem.querySelector(".cartItem__discount-code-bar-wrapper--mobile .cartItem__discount-code-bar"),cartItem.querySelector(".cartItem__discount-code-bar-wrapper.hideMobile .cartItem__discount-code-bar"),cartItem.querySelector(".cartItem__discount-code-bar-wrapper--drawer .cartItem__discount-code-bar")].filter(Boolean).forEach(discountBar=>{const mobileWrapper=discountBar.closest(".cartItem__discount-code-bar-wrapper--mobile"),hideMobileWrapper=discountBar.closest(".cartItem__discount-code-bar-wrapper.hideMobile"),drawerWrapper=discountBar.closest(".cartItem__discount-code-bar-wrapper--drawer");mobileWrapper&&!mobileWrapper.classList.contains("cartItem__discount-code-bar-wrapper--hidden")&&mobileWrapper.classList.add("cartItem__discount-code-bar-wrapper--hidden"),hideMobileWrapper&&!hideMobileWrapper.classList.contains("cartItem__discount-code-bar-wrapper--hidden")&&hideMobileWrapper.classList.add("cartItem__discount-code-bar-wrapper--hidden"),drawerWrapper&&!drawerWrapper.classList.contains("cartItem__discount-code-bar-wrapper--hidden")&&drawerWrapper.classList.add("cartItem__discount-code-bar-wrapper--hidden")})});const giftCardBarCartPage=document.querySelector(".cart_sidebar_row.gift_card_line"),giftCardBarCartDrawer=document.querySelector(".cart-gift-card-bar-row");giftCardBarCartPage&&giftCardBarCartPage.classList.contains("cartItem__gift-card-code-bar-wrapper--hidden")&&giftCardBarCartPage.classList.remove("cartItem__gift-card-code-bar-wrapper--hidden"),giftCardBarCartDrawer&&giftCardBarCartDrawer.classList.contains("cart-gift-card-bar-row--hidden")&&giftCardBarCartDrawer.classList.remove("cart-gift-card-bar-row--hidden");const codeElementCartPage=giftCardBarCartPage?.querySelector(".cartItem__gift-card-code-bar--code"),codeElementCartDrawer=giftCardBarCartDrawer?.querySelector(".cart-gift-card-bar--code");codeElementCartPage&&(codeElementCartPage.textContent=`*** ${data[0].code.slice(-4).toUpperCase()}`),codeElementCartDrawer&&(console.log(codeElementCartDrawer,"this should be triggered"),codeElementCartDrawer.textContent=`***${data[0].code.slice(-4).toUpperCase()}`);const priceElementCartPage=giftCardBarCartPage?.querySelector(".cartItem__gift-card-code-bar--price"),priceElementCartDrawer=giftCardBarCartDrawer?.querySelector(".cart-gift-card-bar--price");priceElementCartPage&&(priceElementCartPage.textContent=`-${theme.Currency.formatMoney(Number(data[0].discountAmount)*100,theme.moneyFormat)}`),priceElementCartDrawer&&(priceElementCartDrawer.textContent=`-${theme.Currency.formatMoney(Number(data[0].discountAmount)*100,theme.moneyFormat)}`);const copyButtonCartPage=giftCardBarCartPage?.querySelector(".cartItem__gift-card-code-bar--code-copy-button"),copyButtonCartDrawer=giftCardBarCartDrawer?.querySelector(".cart-gift-card-bar--code-copy-button");(copyButtonCartPage||copyButtonCartDrawer)&&(copyButtonCartPage?.addEventListener("click",function(){navigator.clipboard.writeText(data[0].code)}),copyButtonCartDrawer?.addEventListener("click",function(){navigator.clipboard.writeText(data[0].code)}));let timeInterval;const daysElementCartPage=giftCardBarCartPage?.querySelector(".days"),hoursElementCartPage=giftCardBarCartPage?.querySelector(".hours"),minutesElementCartPage=giftCardBarCartPage?.querySelector(".minutes"),secondsElementCartPage=giftCardBarCartPage?.querySelector(".seconds"),daysElementCartDrawer=giftCardBarCartDrawer?.querySelector(".days"),hoursElementCartDrawer=giftCardBarCartDrawer?.querySelector(".hours"),minutesElementCartDrawer=giftCardBarCartDrawer?.querySelector(".minutes"),secondsElementCartDrawer=giftCardBarCartDrawer?.querySelector(".seconds");updateBarTimer2(),timeInterval=setInterval(updateBarTimer2,1e3)}else{const giftCardBarCartPage=document.querySelector(".cart_sidebar_row.gift_card_line"),giftCardBarCartDrawer=document.querySelector(".cart-gift-card-bar-row");giftCardBarCartPage&&!giftCardBarCartPage.classList.contains("cartItem__gift-card-code-bar-wrapper--hidden")&&giftCardBarCartPage.classList.add("cartItem__gift-card-code-bar-wrapper--hidden"),giftCardBarCartDrawer&&!giftCardBarCartDrawer.classList.contains("cart-gift-card-bar-row--hidden")&&giftCardBarCartDrawer.classList.add("cart-gift-card-bar-row--hidden"),cartItems.forEac
6h(cartItem=>{const variantId=cartItem.getAttribute("data-variant-id"),discountData=data[0].hitProducts.find(item=>item.variantId===variantId);[cartItem.querySelector(".cartItem__discount-code-bar-wrapper--mobile .cartItem__discount-code-bar"),cartItem.querySelector(".cartItem__discount-code-bar-wrapper.hideMobile .cartItem__discount-code-bar"),cartItem.querySelector(".cartItem__discount-code-bar-wrapper--drawer .cartItem__discount-code-bar")].filter(Boolean).forEach(discountBar=>{if(!discountData){const mobileWrapper=discountBar.closest(".cartItem__discount-code-bar-wrapper--mobile"),hideMobileWrapper=discountBar.closest(".cartItem__discount-code-bar-wrapper.hideMobile"),drawerWrapper=discountBar.closest(".cartItem__discount-code-bar-wrapper--drawer");mobileWrapper&&!mobileWrapper.classList.contains("cartItem__discount-code-bar-wrapper--hidden")&&mobileWrapper.classList.add("cartItem__discount-code-bar-wrapper--hidden"),hideMobileWrapper&&!hideMobileWrapper.classList.contains("cartItem__discount-code-bar-wrapper--hidden")&&hideMobileWrapper.classList.add("cartItem__discount-code-bar-wrapper--hidden"),drawerWrapper&&!drawerWrapper.classList.contains("cartItem__discount-code-bar-wrapper--hidden")&&drawerWrapper.classList.add("cartItem__discount-code-bar-wrapper--hidden");return}if(!discountBar)return;discountBar.closest(".cartItem__discount-code-bar-wrapper--hidden")?.classList.remove("cartItem__discount-code-bar-wrapper--hidden");const codeElement=discountBar.querySelector(".cartItem__discount-code-bar--code");codeElement&&(codeElement.textContent=`*** ${data[0].code.slice(-4)}`);const priceElement=discountBar.querySelector(".cartItem__discount-code-bar--price");priceElement&&(priceElement.textContent=`-${theme.Currency.formatMoney(Number(discountData.discount)*100,theme.moneyFormat)}`);const copyButton=discountBar.querySelector(".cartItem__discount-code-bar--code-copy-button");copyButton&&copyButton?.addEventListener("click",function(){navigator.clipboard.writeText(data[0].code)});let timeInterval;const daysElement=discountBar.querySelector(".days"),hoursElement=discountBar.querySelector(".hours"),minutesElement=discountBar.querySelector(".minutes"),secondsElement=discountBar.querySelector(".seconds");function updateBarTimer2(){const t=getTimeRemaining(data[0].endTime);if(t.total<=0){daysElement.textContent="00",hoursElement.textContent="00",minutesElement.textContent="00",secondsElement.textContent="00",clearInterval(timeInterval);return}daysElement.textContent=t.days<10?"0"+t.days:t.days,hoursElement.textContent=("0"+t.hours).slice(-2),minutesElement.textContent=("0"+t.minutes).slice(-2),secondsElement.textContent=("0"+t.seconds).slice(-2)}updateBarTimer2(),timeInterval=setInterval(updateBarTimer2,1e3)})})}}async function handleCartDiscountBar(){const cartItemList=document.querySelector(".Cart__ItemList");if(cartItemList){const customerId=cartItemList.getAttribute("data-customer-id");if(cartItemList&&cartItemList.children.length>0){let userInfoCookie=document.cookie.split("; ").find(row=>row.startsWith("userInfo="));if(console.log(userInfoCookie,"userInfoCookie"),!userInfoCookie||!customerId){hideCartDiscountBar();return}userInfoCookie=userInfoCookie.split("userInfo=").pop(),userInfoCookie=JSON.parse(decodeURIComponent(userInfoCookie));const token=userInfoCookie.token;try{const productList=(await(await fetch(`${window.routes.cartUrl}.js`,{credentials:"same-origin",method:"GET"})).json()).items.map(item=>({productId:`${item.product_id}`,variantId:`${item.variant_id}`,quantity:item.quantity,price:`${item.price/100}`})),{apiDomain,acceptedLanguage,xAppid}=theme.emailSubscription,couponsData=await(await fetch(`${apiDomain}/integral/web/rewardRedeemCoupon/cart/coupon/listForShopify`,{method:"POST",headers:{"Content-Type":"application/json","x-appid":xAppid,traceId:generateTraceId(),"Accept-Language":acceptedLanguage,Authorization:`Bearer ${token}`},body:JSON.stringify({productList,source:"CART"})})).json();initializeCartDiscountBar(couponsData.data.coupons)}catch(error2){console.error("Error fetching redeemable points:",error2)}}}}function hideCartDiscountBar(){const cartItems=document.querySelector(".Cart__ItemList").querySelectorAll(".CartItemContainer"),giftCardBarCartPage=document.querySelector(".cart_sidebar_row.gift_card_line"),giftCardBarCartDrawer=document.querySelector(".cart-gift-card-bar-row");giftCardBarCartPage&&!giftCardBarCartPage.classList.contains("cartItem__gift-card-code-bar-wrapper--hidden")&&giftCardBarCartPage.classList.add("cartItem__gift-card-code-bar-wrapper--hidden"),giftCardBarCartDrawer&&!giftCardBarCartDrawer.classList.contains("cart-gift-card-bar-row--hidden")&&giftCardBarCartDrawer.classList.add("cart-gift-card-bar-row--hidden"),cartItems.forEac
6h(cartItem=>{[cartItem.querySelector(".cartItem__discount-code-bar-wrapper--mobile .cartItem__discount-code-bar"),cartItem.querySelector(".cartItem__discount-code-bar-wrapper.hideMobile .cartItem__discount-code-bar"),cartItem.querySelector(".cartItem__discount-code-bar-wrapper--drawer .cartItem__discount-code-bar")].filter(Boolean).forEach(discountBar=>{const mobileWrapper=discountBar.closest(".cartItem__discount-code-bar-wrapper--mobile"),hideMobileWrapper=discountBar.closest(".cartItem__discount-code-bar-wrapper.hideMobile"),drawerWrapper=discountBar.closest(".cartItem__discount-code-bar-wrapper--drawer");mobileWrapper&&!mobileWrapper.classList.contains("cartItem__discount-code-bar-wrapper--hidden")&&mobileWrapper.classList.add("cartItem__discount-code-bar-wrapper--hidden"),hideMobileWrapper&&!hideMobileWrapper.classList.contains("cartItem__discount-code-bar-wrapper--hidden")&&hideMobileWrapper.classList.add("cartItem__discount-code-bar-wrapper--hidden"),drawerWrapper&&!drawerWrapper.classList.contains("cartItem__discount-code-bar-wrapper--hidden")&&drawerWrapper.classList.add("cartItem__discount-code-bar-wrapper--hidden")})})}function memberTagHeight(){document.querySelectorAll(".member-tag").length>0&&document.querySelectorAll(".member-tag").forEach(function(elem){elem.style.setProperty("--border-width",elem.clientHeight/2+"px")})}memberTagHeight(),window.addEventListener("resize",function(){memberTagHeight()});function compareTableViewBtn(){document.querySelectorAll(".view_features_link").length>0&&document.querySelectorAll(".view_features_link").forEach(function(elem){elem.onclick=function(){var parentElem2=elem.parentElement;parentElem2.querySelector(".comparison_table").classList.toggle("show-all"),elem.classList.contains("showing-all")?elem.querySelector("span").innerText=elem.getAttribute("data-view-more-text"):elem.querySelector("span").innerText=elem.getAttribute("data-view-less-text"),elem.classList.toggle("showing-all")}})}if(compareTableViewBtn(),document.querySelectorAll(".compare_table_product_content").length>0){let alignCompareRow2=function(){document.querySelectorAll(".pdp-comparison-table").forEach(function(elem){elem.style.setProperty("--product-info-height","auto");var contentHeight=0;elem.querySelectorAll(".compare_table_product_title").forEach(function(content){content.offsetHeight>contentHeight&&(contentHeight=content.offsetHeight)}),elem.style.setProperty("--product-info-height",contentHeight+"px")})};var alignCompareRow=alignCompareRow2;alignCompareRow2(),window.onresize=function(){alignCompareRow2()}}if(document.querySelector(".modal-trigger")){let adjustTitleRowFlickity2=function(popup_elem){var title_row_elem=popup_elem.querySelector(".comparison_feature_row.comparison_title_row");if(title_row_elem.querySelector(".compare_column_slider")){var column_parent=title_row_elem.querySelector(".compare_column_slider");title_row_elem.style.setProperty("--row-height","auto");var row_height=0;column_parent.querySelectorAll(".compare_column").forEach(function(elem){row_height<elem.clientHeight&&(row_height=elem.clientHeight)}),title_row_elem.style.setProperty("--row-height",row_height+"px");var flickityInstance2=Flickity.data(column_parent);flickityInstance2.resize()}};var adjustTitleRowFlickity=adjustTitleRowFlickity2,modalTriggers=document.querySelectorAll(".modal-trigger");modalTriggers.forEach(function(trigger){trigger.addEventListener("click",function(e){document.querySelector(".pdp-popup-wrapper .popup-content").innerHTML=document.querySelector(e.currentTarget.getAttribute("href")).innerHTML,document.querySelector(".pdp-popup-wrapper").classList.add("shown"),document.querySelector("body").classList.add("overflow-hidden"),compareTableViewBtn(),document.querySelectorAll(".compare_table_product_content").length>0&&(alignCompareRow(),window.onresize=function(){alignCompareRow()}),document.querySelector(".pdp-popup-wrapper .popup-close")&&(document.querySelector(".pdp-popup-wrapper .popup-close").onclick=function(e2){document.querySelector(".pdp-popup-wrapper").classList.remove("shown"),document.querySelector(".pdp-popup-wrapper").classList.add("hide"),document.querySelector(".pdp-popup-wrapper .popup-content").innerHTML="",document.querySelector("body").classList.remove("overflow-hidden")});
6var popup_elem=document.querySelector(".pdp-popup-wrapper .pdp-compare-table-container"),tabelTop=0;if(document.querySelector(".pdp-popup-wrapper .pdp-compare-table-container").onscroll=function(){var title_row_height=popup_elem.querySelector(".comparison_feature_row.comparison_title_row").clientHeight;if(document.querySelector(".pdp-popup-wrapper .pdp-compare-table-container").scrollTop>title_row_height)popup_elem.querySelector(".comparison_feature_row.comparison_title_row").classList.contains("sticky")==!1&&(popup_elem.querySelector(".comparison_feature_row.comparison_title_row").classList.add("sticky"),window.innerWidth>749&&adjustTitleRowFlickity2(popup_elem));else{var wasSticky=!1;popup_elem.querySelector(".comparison_feature_row.comparison_title_row").classList.contains("sticky")&&(wasSticky=!0),popup_elem.querySelector(".comparison_feature_row.comparison_title_row").classList.remove("sticky"),wasSticky&&window.innerWidth>749&&adjustTitleRowFlickity2(popup_elem)}},document.querySelectorAll(".pdp-popup-wrapper .compare_column_slider").length>0){var asNav=!1;document.querySelectorAll(".pdp-popup-wrapper .compare_column_slider").forEach(function(elem){var row_height=elem.closest(".comparison_feature_row").querySelector(".compare_feature_title").clientHeight;row_height<elem.clientHeight&&(row_height=elem.clientHeight),elem.closest(".comparison_feature_row").style.setProperty("--row-height",row_height+"px"),elem.closest(".comparison_content_row")?new Flickity(elem,{cellAlign:"left",wrapAround:!1,pageDots:!1,contain:!0,groupCells:!0,prevNextButtons:!0,selectedAttraction:1,friction:1,watchCSS:!0,asNavFor:popup_elem.querySelector(".compare_column_slider_title")}):new Flickity(elem,{cellAlign:"left",wrapAround:!1,pageDots:!1,contain:!0,groupCells:!0,prevNextButtons:!0,selectedAttraction:1,friction:1,watchCSS:!0})})}})})}document.querySelectorAll("[data-payment-trigger]").forEach(target=>{const updateText=()=>{const monthly=(parseFloat(target.dataset.paymentAmount||0)/36).toFixed(2),newText=(target.dataset.text||"").replace("[price]",monthly);target.innerHTML=newText};updateText(),new MutationObserver(mutations=>{for(const mutation of mutations)mutation.type==="attributes"&&mutation.attributeName==="data-payment-amount"&&updateText()}).observe(target,{attributes:!0,attributeFilter:["data-payment-amount"]})});function setVH(){const vh=window.visualViewport?window.visualViewport.height*.01:window.innerHeight*.01;document.documentElement.style.setProperty("--vh",`${vh}px`)}setVH(),window.visualViewport?.addEventListener("resize",setVH),window.addEventListener("orientationchange",setVH);
7//# sourceMappingURL=/cdn/shop/t/1497/assets/theme.js.map?v=76370965199936498091787123234

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.