PageSourceSearch

https://bokksu.com/cdn/shop/t/3/assets/theme.js?v=132526422010737728721788431937

js bokksu.com collected 2026-09-24 17:11:31 UTC 300,350 bytes, 407 lines download raw bytes

1/*
2@license
3  Expanse by Archetype Themes (https://archetypethemes.co)
4  Access unminified JS in assets/theme.js
5
6  Use this event listener to run your own JS outside of this file.
7  Documentation - https://archetypethemes.co/blogs/expanse/javascript-events-for-developers
8
9  document.addEventListener('page:loaded', function() {
10    // Page has loaded and theme assets are ready
11  });
12*/var storeUrl=Shopify.shop;let currentPage=location.href,collectionPage=currentPage.includes("collections"),productPage=currentPage.includes("/product"),isSearch=currentPage.includes("search-results");(function(){var themeRef=typeof window<"u"?window.theme:null;if(!themeRef)return;function tagList(tags){return tags?Array.isArray(tags)?tags:String(tags).split(",").map(function(t){return t.trim()}):[]}function tagIncludes(tags,needle){var n=String(needle).toLowerCase();return tagList(tags).some(function(t){return String(t).toLowerCase()===n})}function normalizeShopifyRecoProduct(p){if(!p||!p.variants||!p.variants.length)return null;var v=p.variants[0],imgRaw=p.featured_image||p.images&&p.images[0]||"",img=String(imgRaw);img.indexOf("//")===0&&(img="https:"+img);var priceCents=Number(v.price)||0,compareCents=v.compare_at_price!=null&&v.compare_at_price!==""?Number(v.compare_at_price):null,priceStr=(priceCents/100).toFixed(2),invOk=v.available!==!1;return typeof v.inventory_quantity=="number"&&(invOk=invOk&&v.inventory_quantity>0),{id:p.id,title:p.title,handle:p.handle,product_type:p.type,type:p.type,tags:tagList(p.tags),images:[{src:img,alt:p.title||""}],variants:[{id:v.id,price:priceStr,price_cents:priceCents,compare_at_price:compareCents&&compareCents>0?(compareCents/100).toFixed(2):null,inventory_quantity:typeof v.inventory_quantity=="number"?v.inventory_quantity:v.available?1:0,sku:v.sku||"",available:v.available}],link:p.url,url:p.url,_invOk:invOk}}function shopifyRecoFetch(productId,limit,intent){if(!productId)return Promise.resolve([]);var params=new URLSearchParams({product_id:String(productId),limit:String(limit||10)});return intent&&params.set("intent",intent),fetch("/recommendations/products.json?"+params.toString()).then(function(r){return r.ok?r.json():{products:[]}}).then(function(json){var products=json.products||[];return products.filter(function(p){var skipReco=tagIncludes(p.tags,"exclude_recommendations")||tagIncludes(p.tags,"exclude_rebuy")||tagIncludes(p.tags,"hide-from-listing");return!skipReco})}).catch(function(){return[]})}function mergeFromSeeds(seedIds,limitPerSeed,intent){var unique=[];return(seedIds||[]).forEach(function(id){id&&unique.indexOf(id)<0&&unique.push(id)}),unique=unique.slice(0,3),unique.length?Promise.all(unique.map(function(id){return shopifyRecoFetch(id,limitPerSeed||10,intent)})).then(function(arrays){var seen={},merged=[];return arrays.forEach(function(arr){arr.forEach(function(p){var n=normalizeShopifyRecoProduct(p);n&&n.id&&!seen[n.id]&&(seen[n.id]=!0,merged.push(n))})}),merged}):Promise.resolve([])}themeRef.ShopifyRecommendations={fetch:shopifyRecoFetch,mergeFromSeeds,normalizeProduct:normalizeShopifyRecoProduct,tagIncludes}})(),$.ajax({type:"GET",url:"/cart.js",dataType:"json",success:function(cart){let items=cart.items;for(var i=0;i<items.length;i++){let item=items[i];item.variant_id===41663894126787&&item.product_title==="Japanese Kit Kat: Variety Pack (3-pack)"&&$(".vertical-line--right.product-weight").addClass("kitItem")}},error:function(XMLHttpRequest,textStatus,errorThrown){console.log("Error: "+errorThrown)}}),window.theme=window.theme||{},window.Shopify=window.Shopify||{},theme.config={bpSmall:!1,hasSessionStorage:!0,hasLocalStorage:!0,mediaQuerySmall:"screen and (max-width: 769px)",youTubeReady:!1,vimeoReady:!1,vimeoLoading:!1,isTouch:!!("ontouchstart"in window||window.DocumentTouch&&window.document instanceof DocumentTouch||window.navigator.maxTouchPoints||window.navigator.msMaxTouchPoints),stickyHeader:!1,rtl:document.documentElement.getAttribute("dir")=="rtl"},theme.recentlyViewedIds=[],theme.config.isTouch&&(document.documentElement.className+=" supports-touch"),console&&console.log&&console.log("Expanse theme ("+theme.settings?.themeVersion+") by ARCH\u039ETYPE | Learn more at https://archetypethemes.co"),window.lazySizesConfig=window.lazySizesConfig||{},lazySizesConfig.expFactor=4;let freeGiftOneVariantId=null,freeGiftTwoVariantId=null,freeGiftOneExistInCart=!1,freeGiftTwoExistInCart=!1,hostname=window.location.hostname,freeGiftCertificateWith4TiersFeatureOn=!1;$("#free-gift-certificate-feature-with-4-tiers").text().trim()==="On"&&$("#selected-free-gift-certificate-product").text()&&($("#free-gift-certificate-tier-1-amount").text()||$("#free-gift-certificate-tier-2-amount").text()||$("#free-gift-certificate-tier-3-amount").text()||$("#free-gift-certificate-tier-4-amount").text())&&(freeGiftCertificateWith4TiersFeatureOn=!0),localStorage.getItem("freeGiftCertFirstTierActive")===null&&localStorage.setItem("freeGiftCertFirstTierActive","No"),localStorage.getItem("freeGiftCertSecondTierActive")===null&&localStorage.setItem("freeGiftCertSecondTierActive","No"),localStorage.getItem("freeGiftCertThirdTierActive")===null&&localStorage.setItem("freeGiftCertThirdTierActive","No"),localStorage.getItem("freeGiftCertFourthTierActive")===null&&localStorage.setItem("freeGiftCertFourthTierActive","No"),localStorage.getItem("btqFreeGiftCertManuallyRemoveFromCart")===null&&localStorage.setItem("btqFreeGiftCertManuallyRemoveFromCart","No");var waitForEl=function(selector,callback){jQuery(selector).length?callback():setTimeout(function(){waitForEl(selector,callback)},100)};(function(){"use strict";$.ajax({url:"/apps/loggedincustomer",success:function(customer){localStorage.setItem("customerData",customer)}}),(window.location.pathname==="/collections/all"||window.location.pathname==="/collections")&&(storeUrl.includes("bok-hashi.myshopify.com")||(window.location.href="/collections/all-products"));function watchOpacity(selector,targetOpacity,interval,callback){var previousOpacity=null,checkInterval2=setInterval(function(){var element=$(selector),currentOpacity=parseFloat(element.css("opacity"));previousOpacity!==currentOpacity&&(typeof callback=="function"&&callback(currentOpacity),previousOpacity=currentOpacity)},interval)}function isMobile(){return/Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}document.addEventListener("userway:render_completed",function(event){setTimeout(function(){$(".uwy.uen .uai .check_on").css("opacity")=="1"},500),$("#userwayAccessibilityIcon").on("touchstart click",function(){watchOpacity(".uwy .uai .check_on",1,100,function(opacity){}),watchOpacity(".uwy .uai .check_on",0,100,function(opacity){})})});function isAppWebview(){try{if(sessionStorage.getItem("app-webview")==="1")return!0}catch{}var flagged=/\bFuego\//i.test(navigator.userAgent||"");if(flagged)try{sessionStorage.setItem("app-webview","1")}catch{}return flagged}
12if(isAppWebview())try{if(!document.getElementById("pieeye-webview-kill")){var pieEyeWebviewStyle=document.createElement("style");pieEyeWebviewStyle.id="pieeye-webview-kill",pieEyeWebviewStyle.textContent="html body #websiteOverlay,html body #myFrame {  display: none !important;  visibility: hidden !important;  opacity: 0 !important;  pointer-events: none !important;}",(document.head||document.documentElement).appendChild(pieEyeWebviewStyle)}}catch{}else if(!localStorage.getItem("pieeye-consent-date")){(function(){try{if(document.getElementById("pieeye-overlay-kill"))return;var s=document.createElement("style");s.id="pieeye-overlay-kill",s.textContent="html body.pieeye-consent-done #websiteOverlay,html body.pieeye-consent-done #myFrame {  display: none !important;  visibility: hidden !important;  opacity: 0 !important;  pointer-events: none !important;}",(document.head||document.documentElement).appendChild(s)}catch{}})();var pieEyeForceHide=function(){var cartCookie=localStorage.getItem("cartCookie");cartCookie&&(document.cookie="cart="+cartCookie+"; expires=Thu, 18 Dec 3030 12:00:00 UTC; path=/"),document.body&&document.body.classList&&document.body.classList.add("pieeye-consent-done");var overlay=document.getElementById("websiteOverlay");if(overlay){overlay.style.setProperty("display","none","important");try{overlay.parentNode&&overlay.parentNode.removeChild(overlay)}catch{}}var frame=document.getElementById("myFrame");if(frame)try{frame.parentNode&&frame.parentNode.removeChild(frame)}catch{}},pieEyeAttempts=0,pieEyeInterval=setInterval(function(){if(pieEyeAttempts++,localStorage.getItem("pieeye-consent-date")){pieEyeForceHide(),clearInterval(pieEyeInterval);return}pieEyeAttempts>=600&&clearInterval(pieEyeInterval)},500)}var pathname=window.location.pathname;pathname=="/cart"?window.location="/":pathname=="/"&&document.referrer.includes("/cart")&&new MutationObserver((mutations,obs)=>{if(document.getElementById("HeaderCartTrigger")){$("#HeaderCartTrigger")[0].click(),obs.disconnect();return}}).observe(document,{childList:!0,subtree:!0}),theme.delegate={on:function(event,callback,options){return this.namespaces||(this.namespaces={}),this.namespaces[event]=callback,options=options||!1,this.addEventListener(event.split(".")[0],callback,options),this},off:function(event){if(this.namespaces)return this.removeEventListener(event.split(".")[0],this.namespaces[event]),delete this.namespaces[event],this}},window.on=Element.prototype.on=theme.delegate.on,window.off=Element.prototype.off=theme.delegate.off,theme.utils={defaultTo:function(value,defaultValue){return value==null||value!==value?defaultValue:value},wrap:function(el,wrapper){el.parentNode.insertBefore(wrapper,el),wrapper.appendChild(el)},debounce:function(wait,callback,immediate){var timeout;return function(){var context=this,args=arguments,later=function(){timeout=null,immediate||callback.apply(context,args)},callNow=immediate&&!timeout;clearTimeout(timeout),timeout=setTimeout(later,wait),callNow&&callback.apply(context,args)}},throttle:function(limit,callback){var waiting=!1;return function(){waiting||(callback.apply(this,arguments),waiting=!0,setTimeout(function(){waiting=!1},limit))}},prepareTransition:function(el,callback){el.addEventListener("transitionend",removeClass);function removeClass(evt){el.classList.remove("is-transitioning"),el.removeEventListener("transitionend",removeClass)}el.classList.add("is-transitioning"),el.offsetWidth,typeof callback=="function"&&callback()},compact:function(array){for(var index=-1,length=array==null?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];value&&(result[resIndex++]=value)}return result},serialize:function(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("&")}},theme.a11y={trapFocus:function(options){var eventsName={focusin:options.namespace?"focusin."+options.namespace:"focusin",focusout:options.namespace?"focusout."+options.namespace:"focusout",keydown:options.namespace?"keydown."+options.namespace:"keydown.handleFocus"},focusableEls=options.container.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not
12([tabindex^="-"])'),elArray=[].slice.call(focusableEls),focusableElements=elArray.filter(el=>el.offsetParent!==null),firstFocusable=focusableElements[0],lastFocusable=focusableElements[focusableElements.length-1];options.elementToFocus||(options.elementToFocus=options.container),options.container.setAttribute("tabindex","-1"),options.elementToFocus.focus(),document.documentElement.off("focusin"),document.documentElement.on(eventsName.focusout,function(){document.documentElement.off(eventsName.keydown)}),document.documentElement.on(eventsName.focusin,function(evt){evt.target!==lastFocusable&&evt.target!==firstFocusable||document.documentElement.on(eventsName.keydown,function(evt2){_manageFocus(evt2)})});function _manageFocus(evt){evt.keyCode===9&&evt.target===firstFocusable&&evt.shiftKey&&(evt.preventDefault(),lastFocusable.focus())}},removeTrapFocus:function(options){var eventName=options.namespace?"focusin."+options.namespace:"focusin";options.container&&options.container.removeAttribute("tabindex"),document.documentElement.off(eventName)},lockMobileScrolling:function(namespace,element){var el=element||document.documentElement;document.documentElement.classList.add("lock-scroll"),el.on("touchmove"+namespace,function(){return!0})},unlockMobileScrolling:function(namespace,element){document.documentElement.classList.remove("lock-scroll");var el=element||document.documentElement;el.off("touchmove"+namespace)}},document.documentElement.on("keyup.tab",function(evt){evt.keyCode===9&&(document.documentElement.classList.add("tab-outline"),document.documentElement.off("keyup.tab"))});const trapFocusHandlers={};if(theme.Currency=(function(){var moneyFormat="${{amount}}",superScript=theme&&theme.settings&&theme.settings.superScriptPrice;function formatMoney(cents,format){format||(format=theme.settings.moneyFormat),typeof cents=="string"&&(cents=cents.replace(".",""));var value="",placeholderRegex=/\{\{\s*(\w+)\s*\}\}/,formatString=format||moneyFormat;function formatWithDelimiters(number,precision,thousands,decimal){if(precision=theme.utils.defaultTo(precision,2),thousands=theme.utils.defaultTo(thousands,","),decimal=theme.utils.defaultTo(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),superScript&&value&&value.includes(".")&&(value=value.replace(".","<sup>")+"</sup>");break;case"amount_no_decimals":value=formatWithDelimiters(cents,0);break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",","),superScript&&value&&value.includes(".")&&(value=value.replace(",","<sup>")+"</sup>");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}return formatString.replace(placeholderRegex,value)}function getBaseUnit(variant){if(variant&&!(!variant.unit_price_measurement||!variant.unit_price_measurement.reference_value))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}return{formatMoney,getBaseUnit}})(),theme.Images=(function(){function imageSize(src){if(!src)return"620x";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[1]:null}function getSizedImageUrl(src,size){if(!src||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];return this.removeProtocol(prefix[0]+"_"+size+suffix)}return null}function removeProtocol(path){return path.replace(/http(s)?:/,"")}function buildImagePath(string,widths){if(string==null)return[];if(widths){const imageUrls=[];return widths.forEach(width=>
12{let url=`${string}?width=${width}`;width===widths[widths.length-1]?url+=` ${width}w`:url+=` ${width}w,`,imageUrls.push(url)}),imageUrls}else return[string]}return{imageSize,getSizedImageUrl,removeProtocol,buildImagePath}})(),document.addEventListener("DOMContentLoaded",function(){const isHomepage=window.location.pathname==="/",storeUrl2=window.location.hostname,slidesPerView=isHomepage&&storeUrl2.includes("bokksuboutique.com")?5:5.3;if(document.querySelectorAll(".main-grid-swiper").forEach(swiperContainer=>{if(swiperContainer.closest("#shopify-reco-pdp-widget"))return;const slideCount=swiperContainer.querySelectorAll(".swiper-slide").length,swiper2=new Swiper(swiperContainer,{slidesPerView:2,spaceBetween:10,pagination:{el:".swiper-pagination",clickable:!0},loop:!1,a11y:{enabled:!0,containerRoleDescriptionMessage:"product carousel",itemRoleDescriptionMessage:"product",slideLabelMessage:"Product {{index}} of {{slidesLength}}",prevSlideMessage:"Previous products",nextSlideMessage:"Next products",paginationBulletMessage:"Go to slide {{index}}"},watchSlidesProgress:!0,breakpoints:{450:{slidesPerView:2,spaceBetween:10,loop:!1},640:{slidesPerView:2.4,spaceBetween:10,loop:!1},768:{slidesPerView:3.2,loop:!1,spaceBetween:10},1250:{slidesPerView,loop:slideCount>5,spaceBetween:10}}}),wrapperEl=swiperContainer.querySelector(".swiper-wrapper");wrapperEl&&wrapperEl.setAttribute("aria-live","off");const notifEl=swiperContainer.querySelector(".swiper-notification");notifEl&&notifEl.setAttribute("aria-live","off");const syncSlideA11y=()=>
12{swiperContainer.querySelectorAll(".swiper-slide").forEach(slide=>{const isDuplicate=slide.classList.contains("swiper-slide-duplicate"),isVisible=slide.classList.contains("swiper-slide-visible");isDuplicate||!isVisible?(slide.setAttribute("aria-hidden","true"),slide.hasAttribute("inert")||slide.setAttribute("inert","")):(slide.removeAttribute("aria-hidden"),slide.removeAttribute("inert"))})};syncSlideA11y(),swiper2.on("slideChange",syncSlideA11y),swiper2.on("slideChangeTransitionEnd",syncSlideA11y),swiper2.on("resize",syncSlideA11y)}),document.querySelector(".swiper")){var silenceSwiperLiveRegions=function(){document.querySelectorAll(".swiper-wrapper[aria-live]").forEach(function(w){w.getAttribute("aria-live")!=="off"&&w.setAttribute("aria-live","off")}),document.querySelectorAll(".swiper-notification[aria-live]").forEach(function(n){n.getAttribute("aria-live")!=="off"&&n.setAttribute("aria-live","off")})};silenceSwiperLiveRegions();var silenceTries=0,silencePoll=setInterval(function(){silenceSwiperLiveRegions(),++silenceTries>=10&&clearInterval(silencePoll)},500)}}),$(document).ready(function(){window.location.pathname==="/"||window.location.href==="https://sugoimart.com"||window.location.href==="https://sgm-hashi.myshopify.com"?$("#SiteHeader").addClass("home-search-show"):$("#SiteHeader").removeClass("home-search-show"),$(".main-search-icon").click(function(){$("body").toggleClass("ab-test-collectin"),$(".main-new-search.show-on-mob").slideToggle()}),$(window).on("scroll",function(){let targetDiv;if(storeUrl.includes("bokksu.com")||storeUrl.includes("bok-hashi.myshopify.com")){let shadowRoot=document.querySelector("#fast-simon-serp-app").shadowRoot;targetDiv=$(shadowRoot).find(".buttons-wrapper-mobile")}else targetDiv=$(".buttons-wrapper-mobile");const wrapperClass="sticky-filters";window.location.href.includes("bokksumarket")?$(window).scroll(function(){if($(window).scrollTop()>148){if(targetDiv.parent().hasClass(wrapperClass)===!1){const wrapperDiv=$("<div>").addClass(wrapperClass);targetDiv.wrap(wrapperDiv)}}else targetDiv.parent().hasClass(wrapperClass)&&targetDiv.unwrap();if(storeUrl.includes("bok-hashi.myshopify.com")||storeUrl.includes("btq-hashi.myshopify.com")){$("#HeaderWrapper").hasClass("header-wrapper--compressed")&&$("#HeaderWrapper").removeClass("is-light");var scrollTop2=$(window).scrollTop();scrollTop2>40?($(".site-header__cart").css({paddingTop:"65px"}),$("#HeaderWrapper").addClass("is-light-new")):($(".site-header__cart").css({paddingTop:"95px"}),$("#HeaderWrapper").removeClass("is-light-new"))}}):$(window).scroll(function(){if($(window).scrollTop()>55){if(targetDiv.parent().hasClass(wrapperClass)===!1){const wrapperDiv=$("<div>").addClass(wrapperClass);targetDiv.wrap(wrapperDiv)}}else targetDiv.parent().hasClass(wrapperClass)&&targetDiv.unwrap()})}),$(document).on("click",".disclaimer-main p span, .overlay-popup , .close",function(event){$("body").toggleClass("show-overlay no-scroll-enable-disclaimer"),$(".main-popup").toggleClass("show")}),$(".popup_btn_check , .popup_close").click(function(){$("body , #main_popup").toggleClass("active-modal-footer"),$("body").removeClass("unloading")}),$(".hero__animation-contents").css("display","none")}),theme.initWhenVisible=function(options){var threshold=options.threshold?options.threshold:0,observer2=new IntersectionObserver((entries,observer3)=>{entries.forEach(entry=>{entry.isIntersecting&&typeof options.callback=="function"&&(options.callback(),observer3.unobserve(entry.target))})},{rootMargin:"0px 0px "+threshold+"px 0px"});observer2.observe(options.element)},theme.LibraryLoader=(function(){var types={link:"link",script:"script"},status={requested:"requested",loaded:"loaded"},cloudCdn="https://cdn.shopify.com/shopifycloud/",libraries={youtubeSdk:{tagId:"youtube-sdk",src:"https://www.youtube.com/iframe_api",type:types.script},vimeo:{tagId:"vimeo-api",src:"https://player.vimeo.com/api/player.js",type:types.script},shopifyXr:{tagId:"shopify-model-viewer-xr",src:cloudCdn+"shopify-xr-js/assets/v1.0/shopify-xr.en.js",type:types.script},modelViewerUi:{tagId:"shopify-model-viewer-ui",src:cloudCdn+"model-viewer-ui/assets/v1.0/model-viewer-ui.en.js",type:types.script},modelViewerUiStyles:{tagId:"shopify-model-viewer-ui-styles",src:cloudCdn+"model-viewer-ui/assets/v1.0/model-viewer-ui.css",type:types.link}};function load(libraryName,callback){var library=libraries[libraryName];if(library&&library.status!==status.requested){if(callback=callback||function(){},library.status===status.loaded){callback();return}library.status=status.requested;var tag;switch(library.type){case types.script:tag=createScriptTag(library,callback);break;case types.link:tag=createLinkTag(library,callback);break}tag.id=library.tagId,library.element=tag;var firstScriptTag=document.getElementsByTagName(library.type)[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)}}function createScriptTag(library,callback){var tag=document.createElement("script");return tag.src=library.src,tag.addEventListener("load",function(){library.status=status.loaded,callback()}),tag}function createLinkTag(library,callback){var tag=document.createElement("link");return tag.href=library.src,tag.rel="stylesheet",tag.type="text/css",tag.addEventListener("load",function(){library.status=status.loaded,callback()}),tag}return{load}})(),theme.rteInit=function(){document.querySelectorAll(".rte table").forEach(table=>{var wrapWith=document.createElement("div");wrapWith.classList.add("table-wrapper"),theme.utils.wrap(table,wrapWith)}),document.querySelectorAll('.rte iframe[src*="youtube.com/embed"]').forEach(iframe=>{wrapVideo(iframe)}),document.querySelectorAll('.rte iframe[src*="player.vimeo"]').forEach(iframe=>{wrapVideo(iframe)});
12function wrapVideo(iframe){iframe.src=iframe.src;var wrapWith=document.createElement("div");wrapWith.classList.add("video-wrapper"),theme.utils.wrap(iframe,wrapWith)}document.querySelectorAll(".rte a img").forEach(img=>{img.parentNode.classList.add("rte__image")})},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))},theme.Sections.prototype=Object.assign({},theme.Sections.prototype,{_createInstance:function(container,constructor,scope){var id=container.getAttribute("data-section-id"),type=container.getAttribute("data-section-type");if(constructor=constructor||this.constructors[type],!(typeof constructor>"u")){if(scope){var instanceExists=this._findInstance(id);instanceExists&&this._removeInstance(id)}try{var instance=Object.assign(new constructor(container),{id,type,container});this.instances.push(instance)}catch{}}},_findInstance:function(id){for(var i=0;i<this.instances.length;i++)if(this.instances[i].id===id)return this.instances[i]},_removeInstance:function(id){for(var i=this.instances.length,instance;i--;)if(this.instances[i].id===id){instance=this.instances[i],this.instances.splice(i,1);break}return instance},_onSectionLoad:function(evt,subSection,subSectionId){window.AOS&&AOS.refreshHard(),theme&&theme.initGlobals&&theme.initGlobals();var container=subSection||evt.target,section=subSection||evt.target.querySelector("[data-section-id]");if(section){this._createInstance(section);var instance=subSection?subSectionId:this._findInstance(evt.detail.sectionId),haveSubSections=container.querySelectorAll("[data-subsection]");haveSubSections.length&&this.loadSubSections(container),instance&&typeof instance.onLoad=="function"&&instance.onLoad(evt),setTimeout(function(){window.dispatchEvent(new Event("scroll"))},200)}},_onSectionUnload:function(evt){this.instances=this.instances.filter(function(instance){var isEventInstance=instance.id===evt.detail.sectionId;return isEventInstance&&typeof instance.onUnload=="function"&&instance.onUnload(evt),!isEventInstance})},loadSubSections:function(scope){if(scope){var sections=scope.querySelectorAll("[data-section-id]");sections.forEach(el=>{this._onSectionLoad(null,el,el.dataset.sectionId)})}},_onSelect:function(evt){var instance=this._findInstance(evt.detail.sectionId);typeof instance<"u"&&typeof instance.onSelect=="function"&&instance.onSelect(evt)},_onDeselect:function(evt){var instance=this._findInstance(evt.detail.sectionId);typeof instance<"u"&&typeof instance.onDeselect=="function"&&instance.onDeselect(evt)},_onBlockSelect:function(evt){var instance=this._findInstance(evt.detail.sectionId);typeof instance<"u"&&typeof instance.onBlockSelect=="function"&&instance.onBlockSelect(evt)},_onBlockDeselect:function(evt){var instance=this._findInstance(evt.detail.sectionId);typeof instance<"u"&&typeof instance.onBlockDeselect=="function"&&instance.onBlockDeselect(evt)},register:function(type,constructor,scope){this.constructors[type]=constructor;var sections=document.querySelectorAll('[data-section-type="'+type+'"]');scope&&(sections=scope.querySelectorAll('[data-section-type="'+type+'"]')),sections.forEach(function(container){this._createInstance(container,constructor,scope)}.bind(this))},reinit:function(section){for(var i=0;i<this.instances.length;i++){var instance=this.instances[i];instance.type===section&&typeof instance.forceReload=="function"&&instance.forceReload()}}}),theme.Variants=(function(){function Variants(options){this.container=options.container,this.variants=options.variants,this.singleOptionSelector=options.singleOptionSelector,this.originalSelectorId=options.originalSelectorId,this.enableHistoryState=options.enableHistoryState,this.dynamicVariantsEnabled=options.dynamicVariantsEnabled,this.currentlySelectedValues=this._getCurrentOptions(),this.currentVariant=this._getVariantFromOptions(),this.container.querySelectorAll(this.singleOptionSelector).forEach(el=>{el.addEventListener("change",this._onSelectChange.bind(this))})}return Variants.prototype=Object.assign({},Variants.prototype,{_getCurrentOptions:function(){var result=[];return this.container.querySelectorAll(this.singleOptionSelector).forEach(el=>{var type=el.getAttribute("type");type==="radio"||type==="checkbox"?el.checked&&result.push({value:el.value,index:el.dataset.index,optionIndex:el.dataset.indexOption}):result.push({value:el.value,index:el.dataset.index,optionIndex:el.dataset.indexOption})}),result=theme.utils.compact(result),result},_numberFromOptionKey:function(key){return parseInt(key.substr(-1))},_getWeightedOptionMatchCount:function(variant){return this._getCurrentOptions().reduce((count,{value,index})=>{const weightedCount=4-this._numberFromOptionKey(index);return variant[index]===value?count+weightedCount:count},0)},_getFullMatch(needsToBeAvailable){const currentlySelectedOptions=this._getCurrentOptions();return this.variants.find(variant=>{const isMatch=currentlySelectedOptions.every(({value,index})=>variant[index]===value);return needsToBeAvailable?isMatch&&variant.available:isMatch})},_getClosestAvailableMatch:function(lastSelectedOption){if(!lastSelectedOption)return null;const currentlySelectedOptions=this._getCurrentOptions(),variants=this.variants;return(lastSelectedOption&&variants.filter(variant=>currentlySelectedOptions.filter(({value,index})=>this._numberFromOptionKey(index)<=this._numberFromOptionKey(lastSelectedOption.index)).every(({value,index})=>variant[index]===value)&&variant.available)).reduce((bestMatch,variant)=>{if(bestMatch===null)return variant;const bestMatchCount=this._getWeightedOptionMatchCount(bestMatch,lastSelectedOption);return this._getWeightedOptionMatchCount(variant,lastSelectedOption)>bestMatchCount?variant:bestMatch},null)},_getVariantFromOptions:function(lastSelectedOption){const availableFullMatch=this._getFullMatch(!0),closestAvailableMatch=this._getClosestAvailableMatch(lastSelectedOption),fullMatch=this._getFullMatch(!1);return this.dynamicVariantsEnabled?availableFullMatch||closestAvailableMatch||fullMatch||null:fullMatch||null},_updateInputState:function(variant,el){return input=>{if(variant===null)return;const index=input.dataset.index,value=input.value,type=input.getAttribute("type");type==="radio"||type==="checkbox"?input.checked=variant[index]===value:input.value=variant[index]}},_onSelectChange:function({srcElement}){var addVariantToCartButton=$(srcElement).closest(".product-single__meta").find("button");const optionSelectElements=this.container.querySelectorAll(this.singleOptionSelector),variant=this._getVariantFromOptions({index:srcElement.dataset.index,value:srcElement.value});
12optionSelectElements.forEach(this._updateInputState(variant,srcElement));const currentlySelectedValues=this.currentlySelectedValues=this._getCurrentOptions(),detail={variant,currentlySelectedValues,originalSelectorId:this.originalSelectorId,value:srcElement.value,index:srcElement.parentElement.dataset.index,datePassed:srcElement.dataset.datePassed,visualVariant:srcElement.dataset.visualVariant,variantId:srcElement.dataset.variantId,adcVariant:srcElement.dataset.variantAvailable};this.container.dispatchEvent(new CustomEvent("variantChange",{detail})),document.dispatchEvent(new CustomEvent("variant:change",{detail})),variant&&(this._updateMasterSelect(variant,addVariantToCartButton),this._updateImages(variant),this._updatePrice(variant),this._updateUnitPrice(variant),this._updateSKU(variant),this.currentVariant=variant,setTimeout(()=>{$(".js-qty__adjust--plus").prop("disabled",!1),$(".js-qty__adjust--minus").prop("disabled",!1)},2100),this.enableHistoryState&&this._updateHistoryState(variant),this._updateQuantity(variant))},_updateQuantity:async function(variant){$(".add-to-cart").attr("data-variant-id",variant.id),$(".cro-pdp-updates button.pdp-qty").attr("data-variant-id",variant.id),$(".js-qty__num").attr("data-id",variant.id),$(".js-qty__adjust").attr("data-variant-id",variant.id);const cart=await theme.cart.getCart(),isInCart=cart.items.some(item=>item.variant_id===variant.id),getItemCount=cart.items.find(item=>item.variant_id===variant.id);$(".cro-pdp-updates input").val(getItemCount?.quantity||1),$(".product_quantity").val(getItemCount?.quantity||1),$(".pdp-product-quantity").val(getItemCount?.quantity||1),$(".cro-pdp-updates button.add-to-cart").show(),$(".cro-pdp-updates .js-qty__wrapper.qty-wrapper.cro-qty-wrapper").show()},_updateImages:function(variant){var variantImage=variant.featured_image||{},currentVariantImage=this.currentVariant&&this.currentVariant.featured_image||{};!variant.featured_image||variantImage.src===currentVariantImage.src||this.container.dispatchEvent(new CustomEvent("variantImageChange",{detail:{variant}}))},_updatePrice:function(variant){this.currentVariant&&variant.price===this.currentVariant.price&&variant.compare_at_price===this.currentVariant.compare_at_price||this.container.dispatchEvent(new CustomEvent("variantPriceChange",{detail:{variant}}))},_updateUnitPrice:function(variant){this.currentVariant&&variant.unit_price===this.currentVariant.unit_price||this.container.dispatchEvent(new CustomEvent("variantUnitPriceChange",{detail:{variant}}))},_updateSKU:function(variant){this.currentVariant&&variant.sku===this.currentVariant.sku||this.container.dispatchEvent(new CustomEvent("variantSKUChange",{detail:{variant}}))},_updateHistoryState:function(variant){if(!(!history.replaceState||!variant)){var newurl=window.location.protocol+"//"+window.location.host+window.location.pathname+"?variant="+variant.id;window.history.replaceState({path:newurl},"",newurl)}},_updateMasterSelect:function(variant,targetBtn){let masterSelect=this.container.querySelector(this.originalSelectorId);$(targetBtn).attr("data-variant-id",variant.id),masterSelect&&(masterSelect.value=variant.id,masterSelect.dispatchEvent(new Event("change",{bubbles:!0})))}}),Variants})(),window.onYouTubeIframeAPIReady=function(){theme.config.youTubeReady=!0,document.dispatchEvent(new CustomEvent("youTubeReady"))},(function(){var e=!1,t;document.body.addEventListener("touchstart",function(i){if(!i.target.closest(".flickity-slider"))return e=!1;e=!0,t={x:i.touches[0].pageX,y:i.touches[0].pageY}}),document.body.addEventListener("touchmove",function(i){if(e&&i.cancelable){var n={x:i.touches[0].pageX-t.x,y:i.touches[0].pageY-t.y};Math.abs(n.x)>Flickity.defaults.dragThreshold&&i.preventDefault()}},{passive:!1})})(),window.Shopify&&window.Shopify.theme&&navigator&&navigator.sendBeacon&&window.Shopify.designMode&&navigator.sendBeacon("https://api.archetypethemes.co/api/beacon",new URLSearchParams({shop:window.Shopify.shop,themeName:window.theme&&window.theme.settings&&`${window.theme.settings.themeName} v${window.theme.settings.themeVersion}`,role:window.Shopify.theme.role,route:window.location.pathname,themeId:window.Shopify.theme.id,themeStoreId:window.Shopify.theme.theme_store_id||0,isThemeEditor:!!window.Shopify.designMode})),theme.cart={getCart:function(){var url="".concat(theme.routes.cart,"?t=").concat(Date.now());return fetch(url,{credentials:"same-origin",method:"GET"}).then(response=>response.json())},getCartProductMarkup:function(){var url="".concat(theme.routes.cartPage,"?t=").concat(Date.now());return url=url.indexOf("?")===-1?url+"?view=ajax":url+"&view=ajax",fetch(url,{credentials:"same-origin",method:"GET"}).then(function(response){return response.text()})},changeItem:function(key,qty,isGiftCard=!1,itemLine){return isGiftCard?this._updateCart({url:"".concat(theme.routes.cartChange,"?t=").concat(Date.now()),data:JSON.stringify({line:itemLine,quantity:qty})}):this._updateCart({url:"".concat(theme.routes.cartChange,"?t=").concat(Date.now()),data:JSON.stringify({id:key,quantity:qty})})},_updateCart:function(params){return $(".cart__checkout").attr("disabled",!0),$(".cart__checkout").addClass("btn-disabled"),$(".cart__checkout").removeClass("btn-orange-bg"),fetch(params.url,{method:"POST",body:params.data,credentials:"same-origin",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest",Accept:"application/json"}}).then(response=>response.json()).then(function(cart){if(cart.status==422)alert(cart.message);else return window.global_popup_qty=1,updateCartItems(cart),HideCALSection(),cart})},updateAttribute:function(key,value){return this._updateCart({url:"/cart/update.js",data:JSON.stringify({attributes:{[key]:theme.cart.attributeToString(value)}})})},updateNote:function(note){return this._updateCart({url:"/cart/update.js",data:JSON.stringify({note:theme.cart.attributeToString(note)})})},attributeToString:function(attribute){return typeof attribute!="string"&&(attribute+="",attribute==="undefined"&&(attribute="")),attribute.trim()},OOSAlert:function(evt){theme.cart.getCart().then(function(cart){let items=cart.items;var inStock=!0;let itemsToRemove={};if(checkDateForAdventProduct()){let productIds=items.map(item=>item.variant_id);var preOrderExists=!1,PreOrderProductId=[],uniqueProductIds=[];$(".cart__item").each(function(i,itemEl){var tags=$(itemEl).attr("data-tags");if(tags){var tagArr=tags.split(",");tagArr.includes("preorder")&&PreOrderProductId.push($(itemEl).attr("data-variant-id"));const productIdArray=PreOrderProductId.map(str=>parseInt(str));productIdArray.length>0&&(uniqueProductIds=productIds.filter(id=>!productIdArray.includes(id)));var isPreOrderInCart2=tagArr.filter(function(tag){return tag=="preorder"});isPreOrderInCart2.length>0?preOrderExists=!0:preOrderExists=!1}}),uniqueProductIds.length>
120?removeItems(uniqueProductIds,evt):items.forEach(function(item,index){theme.cart._getCurrentProduct(item.handle).then(function(res){res&&(inStock=!1,itemsToRemove[item.variant_id]=0),index===items.length-1&&inStock==!1&&(alert("Some of the Out of Stock items will be removed from your cart!"),theme.cart.removeOOSItems(itemsToRemove,evt)),index===items.length-1&&inStock&&(window.location="/checkout")})})}else items.forEach(function(item,index){theme.cart._getCurrentProduct(item.handle).then(function(res){res&&(inStock=!1,itemsToRemove[item.variant_id]=0),index===items.length-1&&inStock==!1&&(alert("Some of the Out of Stock items will be removed from your cart!"),theme.cart.removeOOSItems(itemsToRemove,evt)),index===items.length-1&&inStock&&(window.location="/checkout")})})})},removeOOSItems:function(items,evt){evt.preventDefault(),theme.cart._updateCart({url:"/cart/update.js",data:JSON.stringify({updates:items})}).then(function(cart){document.dispatchEvent(new CustomEvent("cart:build",{detail:{product:cart}})),setTimeout(function(){$("#checkout_button").prop("disabled")?evt.preventDefault():setTimeout(function(){window.location="/checkout"},1e3)},1e3)})},_getCurrentProduct:async function(handle){const url=`https://${window.location.host+"/products/"+handle}.json`;let response=await fetch(url),{product}=await response.json();return!!(product.tags.includes("Out of Stock")&&!product.tags.includes("Gift Card"))}},theme.CartForm=(function(){var selectors={products:"[data-products]",qtySelector:".js-qty__wrapper",discounts:"[data-discounts]",savings:"[data-savings]",subTotal:"[data-subtotal]",cartBubble:".cart-link__bubble",cartNote:'[name="note"]',termsCheckbox:".cart__terms-checkbox",checkoutBtn:".cart__checkout"},classes={btnLoading:"btn--loading"},config={requiresTerms:!1};function CartForm(form){form&&(this.form=form,this.wrapper=form.parentNode,this.location=form.dataset.location,this.namespace=".cart-"+this.location,this.products=form.querySelector(selectors.products),this.submitBtn=form.querySelector(selectors.checkoutBtn),this.discounts=form.querySelector(selectors.discounts),this.savings=form.querySelector(selectors.savings),this.subtotal=form.querySelector(selectors.subTotal),this.termsCheckbox=form.querySelector(selectors.termsCheckbox),this.noteInput=form.querySelector(selectors.cartNote),this.cartItemsUpdated=!1,this.termsCheckbox&&(config.requiresTerms=!0),this.init())}return CartForm.prototype=Object.assign({},CartForm.prototype,{init:function(){this.initQtySelectors(),document.addEventListener("cart:quantity"+this.namespace,this.quantityChanged.bind(this)),this.form.on("submit",function(evt){evt.preventDefault(),theme.settings.localization?localStorage.getItem("zipcode")?getCartItems(evt):$(".zip-code-button").click():theme.cart.OOSAlert(evt)}),this.noteInput&&this.noteInput.addEventListener("change",function(){var newNote=this.value;theme.cart.updateNote(newNote)}),document.addEventListener("cart:build",function(){this.buildCart()}.bind(this))},reInit:function(){this.initQtySelectors()},_parseProductHTML:function(text){if(text==null||typeof text!="string")return{items:null,discounts:null};const html=document.createElement("div");return html.innerHTML=text,{items:html.querySelector(".cart__items"),discounts:html.querySelector(".cart__discounts")}},buildCart:function(){theme.cart.getCartProductMarkup().then(this.cartMarkup.bind(this)).catch(function(){this.cartMarkup(null)}.bind(this))},cartMarkup:function(text){let minCheckoutPrice=$("body").attr("data-min-checkout")*100,freeShippingText=$("#free-shipping-text-msg").html(),self2=this;var markup=this._parseProductHTML(text),items=markup&&markup.items;if(items){var count=parseInt(items.dataset.count,10)||0,subtotal=items.dataset.cartSubtotal,savings=items.dataset.cartSavings,barColor=getComputedStyle(document.documentElement).getPropertyValue("--brand_color_1");this.updateCartDiscounts(markup.discounts),this.updateSavings(savings),count>0?(this.wrapper.classList.remove("is-empty"),$(".align-main-cart-customer").removeClass("is-empty"),$(".mob-cart-align").removeClass("empty-cart"),$(".cart__scrollable").removeClass("is-empty"),$(".customer-loved").removeClass("is-empty"),$(".mob-cart-align").removeClass("bg-color")):(this.wrapper.classList.add("is-empty"),$(".align-main-cart-customer").addClass("is-empty"),$(".mob-cart-align").addClass("empty-cart"),$(".customer-loved").removeClass("is-empty"),$(".cart__scrollable").addClass("is-empty"),$(".mob-cart-align").addClass("bg-color")),this.updateCount(count),theme.cart.getCart().then(function(cartItem){let cartItems=cartItem.items;if(theme.settings.preoderProducts&&theme.settings.disableRebuyCartUpsell){let preorderProductIds=theme.settings.preoderProducts.split(",").map(id=>id.trim());if(preorderProductIds.length>0){let adventCalendarExists=cartItems.some(item=>preorderProductIds.includes(item.product_id.toString()));console.log(adventCalendarExists),adventCalendarExists?($(".customer-loved-v1").addClass("d-none"),$(".purchase-items").addClass("d-none")):($(".customer-loved-v1").removeClass("d-none"),$(".purchase-items").removeClass("d-none"))}}theme.cart.getCart().then(function(cart){let items2=cart.items,giftCardsAmount=0;items2.forEach(function(item){item.discounts&&item.discounts.length>
120&&item.discounts.forEach(function(discount){discount.title==="Free Gift"&&discount.amount===item.original_price&&(item.properties=item.properties||{},item.properties._free_gift="1")}),item.properties&&item.properties._free_gift==="1"&&(item.discounts&&item.discounts.length>0&&item.discounts.some(function(discount){return discount.title==="Free Gift"&&discount.amount===item.original_price})||delete item.properties._free_gift),[42232998396099,42232998428867,42232998461635,42232998494403,41089417379939,41089417412707,41257333489862,31963795554409,37660558459078,37660558524614].includes(item.variant_id)&&(giftCardsAmount+=item.final_line_price)}),giftCardsAmount>0&&(giftCardsAmount=(giftCardsAmount/100).toFixed(2)),checkMinBundleInCart();let isFrozen=items2.filter(item=>item.sku?.startsWith("FZ")),isMarket=items2.filter(item=>!item.sku?.startsWith("FZ")),isGift=items2.filter(item=>item.sku?.startsWith("GC"));items2.length>0?$(".cart__footer").show():$(".cart__footer").hide();let marketSubTotal=0;window.location.href.includes("bokksu.com")||window.location.href.includes("bok-hashi.myshopify.com")||storeUrl.includes("btq-hashi.myshopify.com")?customerAlsoLoved():fetchCustomerLovedProductsSection2(null,null,null,null);let marketQty=0,marketItems2=items2.length>0&&items2.filter(item=>!item.product_type.startsWith("FZ")),cartItems2=[],marketSubtotaWithoutSubscription=0,marketQtdWithoutSubscription=0;for(let i=0;i<marketItems2.length;i++){let freeGift=0,marketItemsubTotal=marketItems2[i].final_price*marketItems2[i].quantity;marketSubTotal+=marketItemsubTotal,marketQty=marketQty+marketItems2[i].quantity,marketItems2[i].product_type!="Subscription Box"&&(marketSubtotaWithoutSubscription+=marketItemsubTotal,marketQtdWithoutSubscription=marketQtdWithoutSubscription+marketItems2[i].quantity),marketItems2[i].properties&&marketItems2[i].properties._free_gift&&(freeGift=1);let cartItemsObj={id:marketItems2[i].id,_free_gift:freeGift};cartItems2.push(cartItemsObj)}marketQtdWithoutSubscription>0?($(".boutique-container").show(),$(".mini-cart-market-items-count").text(marketQtdWithoutSubscription),$(".mini-cart-market-items-count").attr("aria-label",marketQtdWithoutSubscription),$(".market-items-final-price").text("$"+(marketSubtotaWithoutSubscription/100).toFixed(2)),$(".market-items-final-price").attr("aria-label","total price $"+(marketSubtotaWithoutSubscription/100).toFixed(2))):$(".boutique-container").hide();let marketItemsMinFreeShipping=$("body").attr("data-min-shipping")*100;var marketItemsBarPercent=0;giftCardsAmount>0?marketItemsBarPercent=(parseFloat(marketSubtotaWithoutSubscription)-parseFloat(giftCardsAmount*100))/marketItemsMinFreeShipping*100:marketItemsBarPercent=marketSubtotaWithoutSubscription/marketItemsMinFreeShipping*100,freeGiftCertificateWith4TiersFeatureOn&&add4TiersFreeGiftCertificate();let freeGift1Value=parseFloat($("#free-gift-1-amount").text()),freeGift2Value=parseFloat($("#free-gift-2-amount").text());freeGift1Value=parseFloat(freeGift1Value),freeGift2Value=parseFloat(freeGift2Value);let freeGift1InventoryQuantity=$("#selected-gift-1-product-inventory-quantity").text(),freeGift2InventoryQuantity=$("#selected-gift-2-product-inventory-quantity").text();freeGift1InventoryQuantity=parseInt(freeGift1InventoryQuantity),freeGift2InventoryQuantity=parseInt(freeGift2InventoryQuantity);let gift1Handle=$("#selected-gift-1-product").text(),freeGiftCollectionName=$(".selected_gift_collection_name").text(),marketGiftIcon=location.href.includes("grocery")||location.href.includes("market")?"https://cdn.shopify.com/s/files/1/0557/4269/3571/files/gift-icon.svg?v=1688554567":"https://cdn.shopify.com/s/files/1/1426/3142/files/gift-icon-sgm.png?v=1715069714",marketTruckIcon=location.href.includes("grocery")||location.href.includes("market")?"https://cdn.shopify.com/s/files/1/0557/4269/3571/files/truck.svg?v=1688554453":"https://cdn.shopify.com/s/files/1/0557/4269/3571/files/delivery.svg?v=1710318546";if(freeGift1Value&&gift1Handle&&freeGiftCollectionName&&freeGift1InventoryQuantity>0){localStorage.getItem("freeGiftOneVariantId")&&(freeGiftOneVariantId=parseInt(localStorage.getItem("freeGiftOneVariantId"))),freeGift2Value&&freeGift2Value>0&&freeGift2InventoryQuantity>0&&localStorage.getItem("freeGiftTwoVariantId")&&(freeGiftTwoVariantId=parseInt(localStorage.getItem("freeGiftTwoVariantId"))),cartItems2.forEach(function(item){item.id===freeGiftOneVariantId&&item._free_gift===1&&(freeGiftOneExistInCart=!0),freeGift2Value&&freeGift2Value>0&&freeGift2InventoryQuantity>0&&item.id===freeGiftTwoVariantId&&item._free_gift===1&&(freeGiftTwoExistInCart=!0)});let existingCollectionCartItemsSubTotal=(marketSubtotaWithoutSubscription/100).toFixed(2);giftCardsAmount>0&&(existingCollectionCartItemsSubTotal=parseFloat(existingCollectionCartItemsSubTotal)-parseFloat(giftCardsAmount),existingCollectionCartItemsSubTotal=existingCollectionCartItemsSubTotal.toFixed(2)),existingCollectionCartItemsSubTotal=parseFloat(existingCollectionCartItemsSubTotal);
12let freeGift1RemainingAmount=freeGift1Value-existingCollectionCartItemsSubTotal,freeGift2RemainingAmount=0;freeGift2Value&&freeGift2Value>0&&freeGift2InventoryQuantity>0&&(freeGift2RemainingAmount=freeGift2Value-existingCollectionCartItemsSubTotal);let marketItemsGift1BarPercent=0,marketItemsGift2BarPercent=0,marketMessage="",marketHeading="",marketHeadingTwo="";if(freeGift1RemainingAmount===freeGift1Value&&existingCollectionCartItemsSubTotal===0?(removeFreeGiftOne(freeGiftOneExistInCart),removeFreeGiftTwo(freeGiftTwoExistInCart,!1)):freeGift1RemainingAmount===0&&freeGift1RemainingAmount<freeGift1Value&&existingCollectionCartItemsSubTotal<=freeGift1Value?(addFreeGiftOne(),removeFreeGiftTwo(freeGiftTwoExistInCart,!1),marketItemsGift1BarPercent=existingCollectionCartItemsSubTotal/freeGift1Value*100,marketMessage="You've unlocked your Free Gift!",marketHeading="Congrats!",marketHeadingTwo="Congrats!"):freeGift1RemainingAmount>0&&freeGift1RemainingAmount<freeGift1Value&&existingCollectionCartItemsSubTotal<=freeGift1Value?(removeFreeGiftOne(freeGiftOneExistInCart),removeFreeGiftTwo(freeGiftTwoExistInCart,!1),marketItemsGift1BarPercent=existingCollectionCartItemsSubTotal/freeGift1Value*100,marketMessage="You're <span class='amount-text-color'> $"+freeGift1RemainingAmount.toFixed(2)+" </span> away from Free Gift",marketHeading="Get to Free Gift",marketHeadingTwo="Unlock Free Gift"):!freeGift2Value&&existingCollectionCartItemsSubTotal>freeGift1Value?(addFreeGiftOne(),removeFreeGiftOne(!1),marketItemsGift1BarPercent=100,marketMessage="You've unlocked your Free Gift!",marketHeading="Congrats",marketHeadingTwo="Congrats"):freeGift2Value&&freeGift2Value>0&&freeGift2InventoryQuantity>0&&existingCollectionCartItemsSubTotal===freeGift2Value?(removeFreeGiftOne(!1),addFreeGiftTwo(),marketItemsGift2BarPercent=existingCollectionCartItemsSubTotal/freeGift2Value*100,marketMessage="You've unlocked your Free Gift!",marketHeading="Congrats",marketHeadingTwo="Congrats"):freeGift2Value&&freeGift2Value>0&&freeGift2InventoryQuantity>0&&existingCollectionCartItemsSubTotal>freeGift1Value&&existingCollectionCartItemsSubTotal<freeGift2Value?(addFreeGiftOne(),removeFreeGiftTwo(freeGiftTwoExistInCart,!1),marketItemsGift2BarPercent=existingCollectionCartItemsSubTotal/freeGift2Value*100,marketMessage="You're <span class='amount-text-color'> $"+freeGift2RemainingAmount.toFixed(2)+" </span> away from another Free Gift",marketHeading="Get to Free Gift",marketHeadingTwo="Unlock Free Gift"):freeGift2Value&&freeGift2Value>0&&freeGift2InventoryQuantity>0&&existingCollectionCartItemsSubTotal>=freeGift2Value&&(removeFreeGiftOne(!1),addFreeGiftTwo()),!freeGift2Value&&marketItemsMinFreeShipping/100>freeGift1Value&&existingCollectionCartItemsSubTotal<=freeGift1Value||!freeGift2Value&&marketItemsMinFreeShipping/100<freeGift1Value&&existingCollectionCartItemsSubTotal>marketItemsMinFreeShipping/100&&existingCollectionCartItemsSubTotal<=freeGift1Value||!freeGift2Value&&marketItemsMinFreeShipping/100<freeGift1Value&&existingCollectionCartItemsSubTotal>marketItemsMinFreeShipping/100&&existingCollectionCartItemsSubTotal>=freeGift1Value)$(".free-shipping-text").hide(),$(".free-shipping-text-for-gift").show(),$(".market-icon").attr("src",marketGiftIcon),$(".bar-heading").html(marketHeading),$(".bar-heading-2").html(marketHeadingTwo),$(".free-shipping-text-for-gift").html(marketMessage),$(".free-shipping-progress").css("width","0"),$(".free-shipping-progress").css("background",barColor),$(".free-shipping-progress").css("width",marketItemsGift1BarPercent+"%"),$("#floating-shipping-text").html(marketMessage);else if(!freeGift2Value&&existingCollectionCartItemsSubTotal>=marketItemsMinFreeShipping/100&&existingCollectionCartItemsSubTotal>freeGift1Value&&freeGift1Value<marketItemsMinFreeShipping/100)marketMessage="You've unlocked your Free Shipping!",$(".free-shipping-text-for-gift").hide(),marketHeading="Congrats!",marketHeadingTwo="Congrats!",$(".free-shipping-text").show(),$(".market-icon").attr("src",marketTruckIcon),$(".bar-heading").html(marketHeading),$(".bar-heading-2").html(marketHeadingTwo),$(".free-shipping-text").html(marketMessage),$("#floating-shipping-text").html(marketMessage),$(".free-shipping-progress").css("width","0"),$(".free-shipping-progress").css("background",barColor),$(".free-shipping-progress").css("width","100%");else if(freeGift2Value&&freeGift2Value>0&&freeGift2InventoryQuantity>0&&marketItemsMinFreeShipping/100>freeGift1Value&&existingCollectionCartItemsSubTotal<=freeGift1Value||freeGift2Value&&freeGift2Value>0&&freeGift2InventoryQuantity>0&&marketItemsMinFreeShipping/100<freeGift1Value&&existingCollectionCartItemsSubTotal>marketItemsMinFreeShipping/100&&existingCollectionCartItemsSubTotal<=freeGift1Value)$(".free-shipping-text").hide(),$(".free-shipping-text-for-gift").show(),$(".market-icon").attr("src",marketGiftIcon),$(".bar-heading").html(marketHeading),$(".bar-heading-2").html(marketHeadingTwo),$(".free-shipping-text-for-gift").html(marketMessage),$(".free-shipping-progress").css("width","0"),$(".free-shipping-progress").css("background",barColor),$(".free-shipping-progress").css("width",marketItemsGift1BarPercent+"%"),$("#floating-shipping-text").html(marketMessage);else if(existingCollectionCartItemsSubTotal<marketItemsMinFreeShipping/100&&existingCollectionCartItemsSubTotal>freeGift1Value&&existingCollectionCartItemsSubTotal<freeGift1Value||freeGift2Value&&freeGift2Value>0&&freeGift2InventoryQuantity>0&&existingCollectionCartItemsSubTotal>=freeGift1Value&&existingCollectionCartItemsSubTotal<freeGift2Value&&existingCollectionCartItemsSubTotal<marketItemsMinFreeShipping/100&&marketItemsMinFreeShipping/100<freeGift2Value||marketItemsMinFreeShipping/100<freeGift1Value&&existingCollectionCartItemsSubTotal<marketItemsMinFreeShipping/100&&existingCollectionCartItemsSubTotal<freeGift1Value||freeGift2Value&&freeGift2Value>0&&freeGift2InventoryQuantity>0&&existingCollectionCartItemsSubTotal>freeGift1Value&&existingCollectionCartItemsSubTotal>freeGift2Value&&existingCollectionCartItemsSubTotal<marketItemsMinFreeShipping/100||!freeGift2Value&&existingCollectionCartItemsSubTotal<freeGift1Value&&existingCollectionCartItemsSubTotal<marketItemsMinFreeShipping/100||!freeGift2Value&&existingCollectionCartItemsSubTotal>freeGift1Value&&existingCollectionCartItemsSubTotal<marketItemsMinFreeShipping/100){$(".free-shipping-text").show(),$(".free-shipping-text-for-gift").hide();let amount=marketItemsMinFreeShipping-marketSubtotaWithoutSubscription;amount=amount/100,giftCardsAmount>0&&(amount=parseFloat(amount)+parseFloat(giftCardsAmount),amount=amount.toFixed(2));let marketMsg="You're <span class='amount-text-color'> $"+amount+" </span> away from Free Shipping",marketHead=freeShippingText,marketHeadTwo=freeShippingText;$(".market-icon").attr("src",marketTruckIcon),$(".bar-heading").html(marketHead),$(".bar-heading-2").html(marketHeadTwo),$(".free-shipping-text").html(marketMsg),$(".free-shipping-progress").css("background",barColor),$(".free-shipping-progress").css("width",marketItemsBarPercent+"%"),$("#floating-shipping-text").html(marketMsg)}else freeGift2Value&&freeGift2Value>0&&freeGift2InventoryQuantity>0&&existingCollectionCartItemsSubTotal>marketItemsMinFreeShipping/100&&existingCollectionCartItemsSubTotal>freeGift1Value&&existingCollectionCartItemsSubTotal<=freeGift2Value||freeGift2Value&&freeGift2Value>0&&freeGift2InventoryQuantity>0&&marketItemsMinFreeShipping/100>freeGift2Value&&existingCollectionCartItemsSubTotal<marketItemsMinFreeShipping/100&&existingCollectionCartItemsSubTotal<=freeGift2Value?(existingCollectionCartItemsSubTotal===freeGift1Value&&(marketItemsGift2BarPercent=existingCollectionCartItemsSubTotal/freeGift2Value*100,marketMessage="You're <span class='amount-text-color'>
12 $"+freeGift2RemainingAmount.toFixed(2)+" </span> away from Free Gift"),$(".free-shipping-text").hide(),$(".free-shipping-text-for-gift").show(),$(".market-icon").attr("src",marketGiftIcon),$(".bar-heading").html(marketHeading),$(".bar-heading-2").html(marketHeadingTwo),$(".free-shipping-text-for-gift").html(marketMessage),$(".free-shipping-progress").css("width","0"),$(".free-shipping-progress").css("background",barColor),$(".free-shipping-progress").css("width",marketItemsGift2BarPercent+"%"),$("#floating-shipping-text").html("Click your cart to redeem your free gift!"),$(".free-shipping-progress-floating").css("width","100%")):freeGift2Value&&freeGift2Value>0&&freeGift2InventoryQuantity>0&&existingCollectionCartItemsSubTotal>marketItemsMinFreeShipping/100&&existingCollectionCartItemsSubTotal>=freeGift2Value&&(existingCollectionCartItemsSubTotal>marketItemsMinFreeShipping/100&&existingCollectionCartItemsSubTotal<freeGift2Value||existingCollectionCartItemsSubTotal>marketItemsMinFreeShipping/100&&marketItemsMinFreeShipping/100>freeGift1Value&&marketItemsMinFreeShipping/100>freeGift2Value?(marketMessage="You've unlocked your Free Shipping!",$(".free-shipping-text-for-gift").hide(),marketHeading="Congrats!",marketHeadingTwo="Congrats!",$(".free-shipping-text").show(),$(".market-icon").attr("src",marketTruckIcon),$(".bar-heading").html(marketHeading),$(".bar-heading-2").html(marketHeadingTwo),$(".free-shipping-text").html(marketMessage),$("#floating-shipping-text").html(marketMessage)):existingCollectionCartItemsSubTotal>=freeGift2Value&&(marketMessage="You've unlocked all Free Gifts",marketHeading="Congrats!",marketHeadingTwo="Congrats!",$(".free-shipping-text").hide(),$(".market-icon").attr("src",marketGiftIcon),$(".bar-heading").html(marketHeading),$(".bar-heading-2").html(marketHeadingTwo),$(".free-shipping-text-for-gift").show(),$(".free-shipping-text-for-gift").html(marketMessage),$("#floating-shipping-text").html("Click your cart to redeem your free gift!"),$(".free-shipping-progress-floating").css("width","100%")),$(".free-shipping-progress").css("width","0"),$(".free-shipping-progress").css("background",barColor),$(".free-shipping-progress").css("width","100%"))}else{let giftThresholdDollars=parseFloat($(".main-progress-bar-gift").data("free-gift-amount"));if(giftThresholdDollars>0){let giftThreshold=giftThresholdDollars*100,currentAmountInCart=Math.min(marketSubtotaWithoutSubscription/giftThreshold*100,100).toFixed(2),remainingAmountGiftRaw=(giftThreshold-marketSubtotaWithoutSubscription)/100,remainingAmountGift=remainingAmountGiftRaw%1===0?remainingAmountGiftRaw.toFixed(0):remainingAmountGiftRaw.toFixed(1);marketSubtotaWithoutSubscription>=giftThreshold?$(".free-gift-text").html("Congrats, you unlocked a FREE gift"):$(".free-gift-text").html("You're $"+remainingAmountGift+" away from a Free Gift"),$(".free-gift-progress").css("width",currentAmountInCart+"%")}let fpPreorderFreeShip=!1;if(theme.settings.preoderProducts){const fpPreorderIds=theme.settings.preoderProducts.split(",").map(id=>id.trim());fpPreorderFreeShip=items2.some(item=>fpPreorderIds.includes(item.product_id.toString()))}if(fpPreorderFreeShip?$(".main-progress-bar").removeClass("d-none").addClass("is-preorder-freeship"):$(".main-progress-bar").removeClass("is-preorder-freeship"),!fpPreorderFreeShip&&marketSubtotaWithoutSubscription<marketItemsMinFreeShipping){let remainingAmount=marketItemsMinFreeShipping-marketSubtotaWithoutSubscription;remainingAmount=remainingAmount/100,giftCardsAmount>0&&(remainingAmount=parseFloat(remainingAmount)+parseFloat(giftCardsAmount),remainingAmount=remainingAmount.toFixed(2));let marketMsg="You're $"+remainingAmount+" away from Free Shipping",marketHead=freeShippingText,marketHeadTwo=freeShippingText;$(".market-icon").attr("src",marketTruckIcon),$(".bar-heading").html(marketHead),$(".bar-heading-2").html(marketHeadTwo),$(".free-shipping-text").html(marketMsg),$(".free-shipping-progress").css("width",marketItemsBarPercent+"%"),$("#floating-shipping-text").html(marketMsg)}else{let remainingAmount=marketItemsMinFreeShipping-marketSubTotal;
12if(remainingAmount=remainingAmount/100,giftCardsAmount>0&&(remainingAmount=parseFloat(remainingAmount)+parseFloat(giftCardsAmount),remainingAmount=remainingAmount.toFixed(2)),!fpPreorderFreeShip&&(giftCardsAmount<marketItemsMinFreeShipping/100||giftCardsAmount>=marketItemsMinFreeShipping/100)&&remainingAmount>0){let marketMsg="You're $"+remainingAmount+" away from Free Shipping",marketHead=freeShippingText,marketHeadTwo=freeShippingText;$(".market-icon").attr("src",marketTruckIcon),$(".bar-heading").html(marketHead),$(".bar-heading-2").html(marketHeadTwo),$(".free-shipping-text").html(marketMsg),$(".free-shipping-progress").css("width",marketItemsBarPercent+"%"),$("#floating-shipping-text").html(marketMsg)}else{let marketHead="Congrats!",marketHeadTwo="Congrats!",unlockedMsg=fpPreorderFreeShip?"Enjoy free shipping on your Advent Calendar!":"You've unlocked your Free Shipping!";$(".market-icon").attr("src",marketTruckIcon),$(".bar-heading").html(marketHead),$(".bar-heading-2").html(marketHeadTwo),$(".free-shipping-text").html(unlockedMsg),$(".free-shipping-progress").css("width","100%"),$("#floating-shipping-text").html(unlockedMsg)}}}let frozenTruckIcon=location.href.includes("grocery")||location.href.includes("market")?"https://cdn.shopify.com/s/files/1/0557/4269/3571/files/truck.svg?v=1688554453":"https://cdn.shopify.com/s/files/1/0557/4269/3571/files/delivery.svg?v=1710318546",frozenItemsMinFreeShipping=$("body").attr("data-frozen-min-shipping")*100,frozenItemsFreeShipping=25,frozenSubtotal=0,frozenQty=0,frozenItems2=items2.length>0&&items2.filter(item=>
12item.sku?.startsWith("FZ"));for(let i=0;i<frozenItems2.length;i++){let frozenItemSubtotal=frozenItems2[i].price*frozenItems2[i].quantity;frozenSubtotal+=frozenItemSubtotal,frozenQty=frozenQty+frozenItems2[i].quantity}frozenQty>0?($(".subscription-container").show(),$(".mini-cart-subscription-items-count").text(frozenQty),$(".subscription-items-final-price").text("$"+(frozenSubtotal/100).toFixed(2)),$(".subscription-items-final-price").attr("aria-label","price $"+(frozenSubtotal/100).toFixed(2))):$(".subscription-container").hide();var frozenItemsBarPercent=frozenSubtotal/frozenItemsMinFreeShipping*100;if(frozenSubtotal<frozenItemsMinFreeShipping){let amount=frozenItemsMinFreeShipping-frozenSubtotal;amount=amount/100;let ajaxText="You're $"+amount+" away from Free Shipping",shippingFrozenMsg="Frozen orders under $"+frozenItemsMinFreeShipping/100+" ship for $"+frozenItemsFreeShipping,frozenHeading=freeShippingText;$(".frozen-icon").attr("src",frozenTruckIcon),$(".frozen-heading").html(frozenHeading),$(".ajax-cart__cart-msg-frozen").html(ajaxText),$(".ajax-cart__cart-shipping-msg-frozen").html(shippingFrozenMsg),$(".free-shipping-progress-frozen").css("width",frozenItemsBarPercent+"%")}else if(frozenSubtotal<frozenItemsMinFreeShipping){let amount=frozenItemsMinFreeShipping-frozenSubtotal;amount=amount/100;let ajaxText="You're $"+amount+" away from Free Shipping",shippingFrozenMsg="Frozen orders under $"+frozenItemsMinFreeShipping/100+" ship for $"+frozenItemsFreeShipping,frozenHeading=freeShippingText;$(".frozen-icon").attr("src",frozenTruckIcon),$(".frozen-heading").html(frozenHeading),$(".ajax-cart__cart-msg-frozen").html(ajaxText),$(".free-shipping-progress-frozen").css("width",frozenItemsBarPercent+"%")}else{let frozenHeading="Congrats!";$(".frozen-icon").attr("src",frozenTruckIcon),$(".frozen-heading").html(frozenHeading),$(".ajax-cart__cart-msg-frozen").html("You've unlocked your Free Shipping!"),$(".ajax-cart__cart-shipping-msg-frozen").html(""),$(".free-shipping-progress-frozen").css("width","100%")}if(marketSubTotal<minCheckoutPrice&&!isFrozen.length){let marketDifference=minCheckoutPrice-marketSubTotal,marketDifferenceFormat=theme.Currency.formatMoney(marketDifference,theme.settings.moneyFormat);$(".cart__checkout_enabled, .cart__checkout").attr("disabled",!0),$(".cart__checkout_enabled, .cart__checkout").addClass("cart-checkout-btn-disabled"),$(".cart-checkout-btn-checkout").hide(),$(".cart-checkout-btn-text").show(),$(".cart__checkout").html("ADD "+marketDifferenceFormat+" TO CHECKOUT"),$(".shipping-at-checkout-text").hide(),$(".min-order-text").show(),$(".min-order-text").text("$30 minimum order.")}else if(frozenSubtotal<minCheckoutPrice&&!isMarket.length&&!isGift.length){$(".cart__checkout_enabled, .cart__checkout").attr("disabled",!0),$(".cart__checkout_enabled, .cart__checkout").addClass("cart-checkout-btn-disabled");let forzenDifference=minCheckoutPrice-frozenSubtotal,frozenDifferenceFormat=theme.Currency.formatMoney(forzenDifference,theme.settings.moneyFormat);$(".cart__checkout").html("ADD "+frozenDifferenceFormat+" TO CHECKOUT")}else if((isMarket.length||isGift.length)&&marketSubTotal<minCheckoutPrice||isFrozen.length&&frozenSubtotal<minCheckoutPrice){let marketDifference=minCheckoutPrice-marketSubTotal,marketDifferenceFormat=theme.Currency.formatMoney(marketDifference,theme.settings.moneyFormat);if($(".cart__checkout").html(`Market Cart: Add ${marketDifferenceFormat} to Checkout`),marketSubTotal>=minCheckoutPrice){let forzenDifference=minCheckoutPrice-frozenSubtotal,frozenDifferenceFormat=theme.Currency.formatMoney(forzenDifference,theme.settings.moneyFormat);$(".cart__checkout").html(`Frozen Cart: Add ${frozenDifferenceFormat} to Checkout`)}$(".cart__checkout_enabled, .cart__checkout").attr("disabled",!0),$(".cart__checkout_enabled, .cart__checkout").addClass("cart-checkout-btn-disabled")}else{$(".cart__checkout_enabled, .cart__checkout").attr("disabled",!1),$(".cart__checkout_enabled, .cart__checkout").removeClass("cart-checkout-btn-disabled");let lockimg=$("<img>",{src:"https://cdn.shopify.com/s/files/1/0557/4269/3571/files/lock-icon.png?v=1696586868",alt:"lock Image checkout",class:"lock-img"}),checkoutTxt=$("<p>",{text:"CHECKOUT",class:"checkout-txt"});$(".cart__checkout_enabled, .cart__checkout").html([lockimg,checkoutTxt]),$(".cart-checkout-btn-text").hide(),$(".cart-checkout-btn-checkout").show(),$(".min-order-text").hide(),$(".shipping-at-checkout-text").show()}});let exitsingCartMilestoneHTML=document.querySelector(".cart__scrollable #cart-milestone-bar-container")?.innerHTML;const frozenItems=$(items).find(".frozen-cart"),marketItems=$(items).find(".market-cart");if($(".frozen-cart").length)$(".frozen-cart").html(""),$(".market-cart").html(""),$(".frozen-cart").append(frozenItems),$(".market-cart").append(marketItems);else for(var allContainers=document.querySelectorAll("div[data-products]"),c=0;c<allContainers.length;c++){var container=allContainers[c],clone=items.cloneNode(!0),firstDiv=container.querySelector(":scope > div");firstDiv?container.replaceChild(clone,firstDiv):container.appendChild(clone)}exitsingCartMilestoneHTML&&document.querySelector(".cart__scrollable #cart-milestone-bar-container")&&(document.querySelector(".cart__scrollable #cart-milestone-bar-container").innerHTML=exitsingCartMilestoneHTML);const sectionElement=$(".cart-milestone")[0],section=sectionElement?sectionElement.id:null;async function reRenderSection(section2){try{const url=`/?section_id=${section2}`,response=await fetch(url,{method:"POST",headers:{"Content-Type":"application/json"}});if(!response.ok)throw new Error("Network response was not ok");const html=await response.text();let $cartMilestoneContainer=document.createRange().createContextualFragment(html).querySelector(".cart-milestone"),$existingSection=document.getElementById("cart-milestone-bar-container"),gwpSectionTitle=$(".gwp-with-choice-section-title").data("section-title");if($existingSection&&$cartMilestoneContainer){$existingSection.innerHTML="",$existingSection.appendChild($cartMilestoneContainer),document.dispatchEvent(new CustomEvent("cart:updated"));let productIdList=[],productHandleList=[],gwpWithChoiceFeature=!1;
12$("#cart-milestone-bar-container .gift_wrapper svg.gift.active").each(function(){let productId=$(this).data("product-id"),productHandle=$(this).data("product-handle");productId&&productHandle&&(productIdList.push(productId),productHandleList.push(productHandle));let product1IdForChoice=$(this).data("product-1-id-for-choice"),product1HandleForChoice=$(this).data("product-1-handle-for-choice"),product2IdForChoice=$(this).data("product-2-id-for-choice"),product2HandleForChoice=$(this).data("product-2-handle-for-choice"),product3IdForChoice=$(this).data("product-3-id-for-choice"),product3HandleForChoice=$(this).data("product-3-handle-for-choice");(product1IdForChoice&&product1HandleForChoice||product2IdForChoice&&product2HandleForChoice||product3IdForChoice&&product3HandleForChoice)&&(product1IdForChoice&&(productIdList.push(product1IdForChoice),productHandleList.push(product1HandleForChoice)),product2IdForChoice&&(productIdList.push(product2IdForChoice),productHandleList.push(product2HandleForChoice)),product3IdForChoice&&(productIdList.push(product3IdForChoice),productHandleList.push(product3HandleForChoice)),gwpWithChoiceFeature=!0)});const state=await theme.cart.getCart();if(!state||!state.items)throw new Error("Failed to fetch cart items");let giftItemIds=state.items.filter(item=>item.properties&&item.properties._free_gift&&item.properties._free_gift==1&&item.properties._free_gift_from_bar&&item.properties._free_gift_from_bar==1).map(item=>item.variant_id),productListObject=[],productChosen=!1;for(let i=0;i<productHandleList.length;i++){if(!giftItemIds.includes(productIdList[i])){let urlGiftProduct=`https://${hostname}/products/${productHandleList[i]}.js`.replace(/%20/g,"").split(" ").join("");const res=await(await fetch(urlGiftProduct)).json();productListObject.push(res)}giftItemIds.includes(productIdList[i])&&(productChosen=!0)}for(let i=0;i<giftItemIds.length;i++)if(!productIdList.includes(giftItemIds[i])){const items2={id:giftItemIds[i],quantity:0,properties:{_free_gift:1,_free_gift_from_bar:1}};$.ajax({url:"/cart/change.js",dataType:"json",data:items2,success:function(result){document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product:result}})),atcAndQtyButtonSwitch(items2.id,"remove"),(window.location.href.includes("bokksu.com")||window.location.href.includes("bok-hashi.myshopify.com")||window.location.href.includes("btq-hashi.myshopify.com"))&&customerAlsoLoved()},error:function(error){console.error("Error updating cart:",error.responseJSON.description)}})}let output2="";productListObject.length>0?gwpWithChoiceFeature&&!productChosen?(output2+=`<div class="product-grid main-free-gift section-minicart-products main-dualcart gwp-with-choice">
13                  <div class="align-free-gift">
14                    <div class="align-title-minicart title-section-minicart">
15                        <h3> ${gwpSectionTitle||"Choose one for free"} </h3>
16                    </div>
17
18                    <div class="free-gifts-listings">
19                        <div class="align-free-gift">`,productListObject.forEach(product=>{output2+=`<div class="gift-products">
20                                      <div class="align-gift-prod">
21                                          <div class="free-gift-img">
22                                              <img src="${product.images[0]}" />
23                                          </div>
24                                          <div class="align-name-free-gift">
25                                              <div class="free-gift-titles">
26                                                  ${product.title}
27                                              </div>
28                                              <div class="ajax-cart__price price">
29                                                  <span class="money">$0.00</span>
30                                              </div>
31                                          </div>
32                                      </div>
33
34                                      <div class="gift-free-add-btn">
35                                          <button type="button" class="text-link quick-add-btn js-quick-add-btn" title="Add to Cart" tabindex="-1" onclick="atcFreeGift(this, ${product.variants[0].id})" data-id="${product.variants[0].id}" data-frequency="" data-unit-type="">Add</button>
36                                      </div>
37                                  </div>`}
37),$("#cart-milestone-free-gift-container").html(output2)):gwpWithChoiceFeature||(output2+=`<div class="product-grid main-free-gift section-minicart-products main-dualcart">
38                                                <div class="align-free-gift">
39                                                    <div class="align-title-minicart title-section-minicart">
40                                                        <h3> Grab Your Free Gift(s) </h3>
41                                                    </div>
42                            
43                                                    <div class="free-gifts-listings">
44                                                        <div class="align-free-gift">
45                                                            <div class="main-slider-gift">
46                                                                <div class="swiper giftSlider">
47                                                                    <div class="swiper-wrapper">`,productListObject.forEach(product=>{output2+=`<div class="swiper-slide">
48                                                    <div class="gift-products">
49                                                        <div class="align-gift-prod">
50                                                            <div class="free-gift-img">
51                                                                <img src="${product.images[0]}" />
52                                                            </div>
53                                                            <div class="align-name-free-gift">
54                                                                <div class="free-gift-titles">
55                                                                    ${product.title}
56                                                                </div>
57                                                                <div class="ajax-cart__price price">
58                                                                    <span class="money">$0.00</span>
59                                                                </div>
60                                                            </div>
61                                                        </div>
62                            
63                                                        <div class="gift-free-add-btn">
64                                                            <button type="button" class="text-link quick-add-btn js-quick-add-btn" title="Add to Cart" tabindex="-1" onclick="atcFreeGift(this, ${product.variants[0].id})" data-id="${product.variants[0].id}" data-frequency="" data-unit-type="">Add</button>
65                                                        </div>
66                                                    </div>
67                                                </div>`}),output2+=`</div>
68                                                <div class="swiper-button-next"></div>
69                                                <div class="swiper-button-prev"></div>
70                                            </div>
71                                            </div>
72                                            </div>
73                                            </div>
74                                            </div>`,$("#cart-milestone-free-gift-container").html(output2),productListObject.length===1?($("#cart-milestone-free-gift-container .swiper-button-next").hide(),$("#cart-milestone-free-gift-container .swiper-button-prev").hide()):productListObject.length>1&&($("#cart-milestone-free-gift-container .swiper-button-next").show(),$("#cart-milestone-free-gift-container .swiper-button-prev").show()),swiper()):$("#cart-milestone-free-gift-container").html("")}else console.error("Existing section element not found")}catch(error){console.error("Error re-rendering section:",error)}}section&&reRenderSection(section),self2.subtotal.innerHTML=theme.Currency.formatMoney(subtotal,theme.settings.moneyFormat),$("#price-text").attr("aria-label","price $"+(subtotal/100).toFixed(2));let totalCartAmount=subtotal/100;if(totalCartAmount=totalCartAmount.toFixed(2),$(".total-price").html(`$${totalCartAmount}`),subtotal<4e3){let difference=4e3-subtotal,differenceFormat=theme.Currency.formatMoney(difference,theme.settings.moneyFormat);$(".cart__checkout_enabled, .cart__checkout").attr("disabled",!0),$(".cart__checkout_enabled, .cart__checkout").addClass("cart-checkout-btn-disabled"),$(".checkout-btn-class button").attr("aria-hidden",!0),$(".checkout-btn-class button").attr("id","checkout_button"),$(".checkout-btn-class").attr("id","checkout-btn"),$("#checkout-btn").attr("aria-label","to checkout minimum c
74art amount needs to be 40$"),$("#checkout-btn").attr("tabindex",0),$("#checkout-btn").attr("role","button"),$("#checkout-btn").attr("aria-hidden",!1),$(".cart-checkout-btn-checkout").hide(),$(".cart-checkout-btn-text").show(),$(".cart__checkout").html("ADD "+differenceFormat+" TO CHECKOUT"),$(".shipping-at-checkout-text").hide(),$(".min-order-text").show(),$(".min-order-text").text("$40 minimum order.")}else $(".checkout-btn-class").removeAttr("id"),$(".checkout-btn-class").removeAttr("tabindex"),$(".checkout-btn-class").removeAttr("role"),$(".checkout-btn-class").attr("aria-label"),$(".checkout-btn-class").attr("aria-hidden",!1),$(".checkout-btn-class button").attr("id","checkout-btn"),$(".checkout-btn-class button").attr("aria-label","add to checkout"),$(".checkout-btn-class button").attr("aria-hidden",!1),$(".cart__checkout_enabled, .cart__checkout").attr("disabled",!1),$(".cart__checkout_enabled, .cart__checkout").removeClass("cart-checkout-btn-disabled"),$(".cart__checkout_enabled, .cart__checkout").html("CHECKOUT"),$(".cart-checkout-btn-text").hide(),$(".cart-checkout-btn-checkout").show(),$(".min-order-text").hide(),$(".shipping-at-checkout-text").show();$(".cart__item-title > div:not([class])").remove(),self2.reInit(),$(".js-qty__wrapper").addClass("is-loading"),setTimeout(function(){$(".js-qty__wrapper").removeClass("is-loading")},700),window.AOS&&AOS.refreshHard(),Shopify&&Shopify.StorefrontExpressButtons&&Shopify.StorefrontExpressButtons.initialize()}),updateCartItems(null)}},updateCartDiscounts:function(markup){this.discounts&&(this.discounts.innerHTML="",this.discounts.append(markup))},initQtySelectors:function(){this.form.querySelectorAll(selectors.qtySelector).forEach(el=>{var selector=new theme.QtySelector(el,{namespace:this.namespace,isCart:!0})})},quantityChanged:function(evt){if(evt.detail&&evt.detail.processed)return;evt.detail.processed=!0;var key=evt.detail[0],qty=evt.detail[1],el=evt.detail[2],cartItem=el.closest(".cart__item"),tagsData=cartItem?cartItem.dataset.tags:null,isGiftCard=!1,itemLine=cartItem?cartItem.dataset.line:null;tagsData&&tagsData.toLowerCase().includes("gift card")&&(isGiftCard=!0);let productIdArray=key.split(":"),productId=null,productName=$(this).attr("data-product-name"),productHandle=$(this).attr("data-product-handle"),productTag=$(this).attr("data-pre-order");productIdArray&&productIdArray[0]&&(productId=productIdArray[0],productId&&qty>
740?($(".pdp-product-quantity").each(function(index){$(this).attr("data-id")==productId&&$(this).val(qty)}),$(".qty-custom-plus").each(function(index){$(this).attr("data-prod-id")==productId&&$(this).attr("data-prod-qty",qty)}),$(".qty-custom-minus").each(function(index){$(this).attr("data-prod-id")==productId&&$(this).attr("data-prod-qty",qty)}),$(".quick_add_to_cart").each(function(index){$(this).attr("data-prod-id")==productId&&$(this).find(".custom-qty").text(qty)})):($(".quick_add_to_cart").each(function(index){if($(this).attr("data-prod-id")==productId){let preorderTag=$(this).attr("data-pre-order");$(this).find(".add-item-to-cart").empty(),$(this).find(".add-item-to-cart").append(`
75                   <button type="button" data-pre-order='${preorderTag=="undefined"?"":preorderTag}' class="qty-custom-add" data-prod-id="${productId}" data-product-handle="${productHandle}">  <svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24" fill="none">
76                   <path d="M12.4004 5V19" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
77                   <path d="M5.40039 12H19.4004" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
78                   </svg>  <span>${preorderTag=="undefined"||preorderTag==""||!preorderTag?"Add to Cart":"Preorder"}</span> </button>
79      
80                    `),$(".add-item-to-cart").find("button.qty-custom-add").on("click",async function(){let prodId=$(this).attr("data-prod-id"),preOrder=$(this).attr("data-pre-order"),prodQty=1;if(collectionPage&&!productPage||isSearch){var preorderInCart=isPreOrderInCart();let items=(await theme.cart.getCart()).items;checkDateForAdventProduct()?preorderInCart?preOrder&&preorderInCart?addItem(this,prodId,prodQty):showAlert(theme.settings.preorderMessage||"Pre-order items cannot be combined in your purchase with other items that can be shipped immediately. To pre-order, place a separate order with only the Advent Calendar in your cart and we'll notify you when it ships!",this):preOrder&&items.length>0?showAlert(theme.settings.preorderMessage||"Pre-order items cannot be combined in your purchase with other items that can be shipped immediately. To pre-order, place a separate order with only the Advent Calendar in your cart and we'll notify you when it ships!",this):addItem(this,prodId,prodQty):addItem(this,prodId,prodQty)}})}}),$(".qty-custom-plus").each(function(index){$(this).attr("data-prod-id")==productId&&$(this).hide()}),$(".qty-custom-minus").each(function(index){$(this).attr("data-prod-id")==productId&&$(this).hide()}),$(".quick_add_to_cart").each(function(index){$(this).attr("data-prod-id")==productId&&$(this).find(".custom-qty").hide()}))),!(!key||qty<0)&&theme.cart.getCart().then(function(cart){var itemInCart=cart.items.find(function(item){return item.variant_id==productId||item.key==key});if(!itemInCart&&qty>0){var variantId=productId||key.split(":")[0];if(variantId){if(el&&el.querySelector){var input=el.querySelector(".js-qty__num");input&&(input.value=1)}$(".pdp-product-quantity").val(1),$(".product_quantity").val(1),addItem(el,variantId,1),setTimeout(function(){document.dispatchEvent(new CustomEvent("cart:build")),document.dispatchEvent(new CustomEvent("cart:updated"))},500);return}}itemInCart&&theme.cart.changeItem(key,qty,isGiftCard,itemLine).then(function(cart2){return qty==0?this.removeOrphanGiftWrap(cart2):cart2}.bind(this)).then(function(cart2){cart2.item_count>0?this.wrapper.classList.remove("is-empty"):this.wrapper.classList.add("is-empty");let variantId2=$(".cro-pdp-updates button").data("variant-id");qty==0&&productId==variantId2&&($(".product_quantity").val(1),$(".cro-qty-wrapper").hide(),$(".pdp-atc").show()),this.buildCart(),document.dispatchEvent(new CustomEvent("cart:updated",{detail:{cart:cart2}}))}.bind(this)).catch(function(XMLHttpRequest){})}.bind(this))},removeOrphanGiftWrap:function(cart){var tagsByVariant={};document.querySelectorAll(".cart__item[data-tags]").forEach(function(el){tagsByVariant[el.dataset.variantId]=(el.dataset.tags||"").toLowerCase()});var adventInCart=!1,giftWrapKeys=[];
80if(cart.items.forEach(function(item){var tags=tagsByVariant[String(item.variant_id)]||"";tags.indexOf("ad26-wrap")!==-1?giftWrapKeys.push(item.key):tags.indexOf("preorder")!==-1&&(adventInCart=!0)}),adventInCart||!giftWrapKeys.length)return Promise.resolve(cart);var updates={};giftWrapKeys.forEach(function(giftKey){updates[giftKey]=0});try{sessionStorage.removeItem("cartGiftMessageData")}catch{}return theme.cart._updateCart({url:"/cart/update.js",data:JSON.stringify({updates,attributes:{sender:"",recepient:"",gift_note:"",gift_option:""}})}).then(function(updatedCart){return updatedCart||cart}).catch(function(){return cart})},updateSubtotal:function(subtotal){this.form.querySelector(selectors.subTotal).innerHTML=theme.Currency.formatMoney(subtotal,theme.settings.moneyFormat),$("#price-text").attr("aria-label","price "+subtotal)},updateSavings:function(savings){if(this.savings)if(savings>0){var amount=theme.Currency.formatMoney(savings,theme.settings.moneyFormat);this.savings.classList.remove("hide"),this.savings.innerHTML=theme.strings.cartSavings.replace("[savings]",amount)}else this.savings.classList.add("hide")},updateCount:function(count){var countEls=document.querySelectorAll(".cart-link__bubble-num"),totalAmount="";document.querySelectorAll(".total-price").length>0&&(totalAmount=document.querySelectorAll(".total-price")[0].textContent),countEls.length&&countEls.forEach(el=>{el.innerText=count,$("#HeaderCartTrigger").attr("aria-label","Cart, "+count+" "+(count===1?"item":"items"))});var bubbles=document.querySelectorAll(selectors.cartBubble);bubbles.length&&(count>0?bubbles.forEach(b=>{b.classList.add("cart-link__bubble--visible")}):bubbles.forEach(b=>{b.classList.remove("cart-link__bubble--visible")}))}}),CartForm})(),theme.collapsibles=(function(){var selectors={trigger:".collapsible-trigger",module:".collapsible-content",moduleInner:".collapsible-content__inner",tabs:".collapsible-trigger--tab"},classes={hide:"hide",open:"is-open",autoHeight:"collapsible--auto-height",tabs:"collapsible-trigger--tab"},namespace=".collapsible",isTransitioning=!1;function init(scope){var el=scope||document;el.querySelectorAll(selectors.trigger).forEach(trigger=>{var state=trigger.classList.contains(classes.open);trigger.setAttribute("aria-expanded",state),trigger.off("click"+namespace),trigger.on("click"+namespace,toggle)})}function toggle(evt){if(!isTransitioning){isTransitioning=!0;var el=evt.currentTarget,isOpen=el.classList.contains(classes.open),isTab=el.classList.contains(classes.tabs),moduleId=el.getAttribute("aria-controls"),container=document.getElementById(moduleId);if(moduleId||(moduleId=el.dataset.controls),!!moduleId){if(!container){var multipleMatches=document.querySelectorAll('[data-id="'+moduleId+'"]');multipleMatches.length>0&&(container=el.parentNode.querySelector('[data-id="'+moduleId+'"]'))}if(!container){isTransitioning=!1;return}var height=container.querySelector(selectors.moduleInner).offsetHeight,isAutoHeight=container.classList.contains(classes.autoHeight),parentCollapsibleEl=container.parentNode.closest(selectors.module),childHeight=height;if(isTab){if(isOpen){isTransitioning=!1;return}var newModule;document.querySelectorAll(selectors.tabs+'[data-id="'+el.dataset.id+'"]').forEach(el2=>{el2.classList.remove(classes.open),newModule=document.querySelector("#"+el2.getAttribute("aria-controls")),setTransitionHeight(newModule,0,!0)})}if(isOpen&&isAutoHeight&&setTimeout(function(){height=0,setTransitionHeight(container,height,isOpen,isAutoHeight)},0),isOpen&&!isAutoHeight&&(height=0),el.setAttribute("aria-expanded",!isOpen),isOpen?el.classList.remove(classes.open):el.classList.add(classes.open),setTransitionHeight(container,height,isOpen,isAutoHeight),parentCollapsibleEl){var parentHeight=parentCollapsibleEl.style.height;isOpen&&parentHeight==="auto"&&(childHeight=0);var totalHeight=isOpen?parentCollapsibleEl.offsetHeight-childHeight:height+parentCollapsibleEl.offsetHeight;setTransitionHeight(parentCollapsibleEl,totalHeight,!1,!1)}if(window.SPR){var btn=container.querySelector(".spr-summary-actions-newreview");if(!btn)return;btn.off("click"+namespace),btn.on("click"+namespace,function(){height=container.querySelector(selectors.moduleInner).offsetHeight,setTransitionHeight(container,height,isOpen,isAutoHeight)})}}}}function setTransitionHeight(container,height,isOpen,isAutoHeight){if(container.classList.remove(classes.hide),theme.utils.prepareTransition(container,function(){container.style.height=height+"px",isOpen?container.classList.remove(classes.open):container.classList.add(classes.open)}),!isOpen&&isAutoHeight){var o=container;window.setTimeout(function(){o.css("height","auto"),isTransitioning=!1},500)}else isTransitioning=!1}return{init}})(),theme.Disclosure=(function(){var selectors={disclosureForm:"[data-disclosure-form]",disclosureList:"[data-disclosure-list]",disclosureToggle:"[data-disclosure-toggle]",disclosureInput:"[data-disclosure-input]",disclosureOptions:"[data-disclosure-option]"},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(selectors.disclosureForm),disclosureList:this.container.querySelector(selectors.disclosureList),disclosureToggle:this.container.querySelector(selectors.disclosureToggle),disclosureInput:this.container.querySelector(selectors.disclosureInput),disclosureOptions:this.container.querySelectorAll(selectors.disclosureOptions)}},_setupListeners:function(){this.eventHandlers=this._setupEventHandlers(),this.cache.disclosureToggle.addEventListener("click",this.eventHandlers.toggleList),this.cache.disclosureOptions.forEach(function(disclosureOption){disclosureOption.addEventListener("click",this.eventHandlers.connectOptions)},this),this.container.addEventListener("keyup",this.eventHandlers.onDisclosureKeyUp),this.cache.disclosureList.addEventListener("focusout",this.eventHandlers.onDisclosureListFocusOut),this.cache.disclosureToggle.addEventListener("focusout",this.eventHandlers.onDisclosureToggleFocusOut),document.body.addEventListener("click",this.eventHandlers.onBodyClick)},_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(classe
80s.listVisible);isVisible&&!childInFocus&&this._hideList()},_onDisclosureKeyUp:function(event){event.which===27&&(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)},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})(),theme.Modals=(function(){function Modal(id,name,options){var defaults={close:".js-modal-close",open:".js-modal-open-"+name,openClass:"modal--is-active",closingClass:"modal--is-closing",bodyOpenClass:["modal-open"],bodyOpenSolidClass:"modal-open--solid",bodyClosingClass:"modal-closing",closeOffContentClick:!0};if(this.id=id,this.modal=document.getElementById(id),!this.modal)return!1;this.modalContent=this.modal.querySelector(".modal__inner"),this.config=Object.assign(defaults,options),this.modalIsOpen=!1,this.focusOnOpen=this.config.focusIdOnOpen?document.getElementById(this.config.focusIdOnOpen):this.modal,this.isSolid=this.config.solid,this.init()}return Modal.prototype.init=function(){document.querySelectorAll(this.config.open).forEach(btn=>{btn.setAttribute("aria-expanded","false"),btn.addEventListener("click",this.open.bind(this))}),this.modal.querySelectorAll(this.config.close).forEach(btn=>{btn.addEventListener("click",this.close.bind(this))}),document.addEventListener("drawerOpen",function(){this.close()}.bind(this))},Modal.prototype.open=function(evt){var externalCall=!1;if(this.modalIsOpen)return;evt?evt.preventDefault():externalCall=!0,evt&&evt.stopPropagation&&(evt.stopPropagation(),this.activeSource=evt.currentTarget.setAttribute("aria-expanded","true")),this.modalIsOpen&&!externalCall&&this.close(),this.modal.classList.add(this.config.openClass),document.documentElement.classList.add(...this.config.bodyOpenClass),this.isSolid&&document.documentElement.classList.add(this.config.bodyOpenSolidClass),this.modalIsOpen=!0,setTimeout(()=>{theme.a11y.trapFocus({container:this.modal,elementToFocus:this.focusOnOpen,namespace:"modal_focus"})},500);var unavailableProducts=JSON.parse(localStorage.getItem("unavailableProducts"))||[],availableProducts=JSON.parse(localStorage.getItem("availableProducts"))||[];function isVariantUnavailable(variantId){return unavailableProducts.includes(variantId)}function isVariantAvailable(variantId){return availableProducts.filter(item=>item.variantId==variantId)}async function checkElement(){let warehouseLocation=localStorage.getItem("locationName");if($(".modal--is-active .product-form-holder--loaded").length>0){clearInterval(interval);let _variantId=$(".modal--is-active  .js-qty__adjust").attr("data-variant-id"),IspreorderProduct=$(".modal--is-active  .js-qty__adjust").attr("data-pre-order");warehouseLocation!=null&&$(".icon--inventory").parent().removeClass("d-none");let stockMessage="In stock, ready to ship",availalebleProducts=isVariantAvailable(_variantId);if($(".sales-point .icon-and-text").removeClass("inventory--low"),$(".sales-point .icon-and-text").removeClass("inventory--zero"),isVariantUnavailable(_variantId))$(".modal--is-active .cro-pdp-updates").hide(),stockMessage="Item is out of stock",$(".icon--inventory").parent().addClass("inventory--zero"),$(".modal--is-active .sold-out-modal").length==0&&$(".modal--is-active .cro-pdp-updates").before(`<button style="pointer-events:none;" disabled class="soldout-btn btn btn-custom btn--full add-to-cart  sold-out-modal">
81                    <span data-add-to-cart-text="" data-default-text="Sold Out">
82                   Sold Out 
83                </span>
84                  </button>`);else if(availalebleProducts.length>0){let availableQuantity=availalebleProducts[0].quantity;availableQuantity>0&&availableQuantity<10&&(stockMessage="Low Stock - "+availableQuantity+" items left",$(".icon--inventory").parent().addClass("inventory--low"))}else IspreorderProduct?(stockMessage="Pre-order item",$(".sales-point .icon-and-text").addClass("inventory--low")):stockMessage="In stock, ready to ship",$(".modal--is-active .sold-out-modal").hide(),$(".modal--is-active .cro-pdp-updates").show();theme.cart.getCart().then(function(cart){let items=cart.items,result;items.length>0?(result=items.find(function(item){return item.variant_id==$(".modal--is-active  .js-qty__adjust").attr("data-variant-id")}),result==null?($(".modal--is-active #product_quantity-modal").val(1),$(".modal--is-active .cro-pdp-updates button").removeAttr("style"),$(".modal--is-active .cro-pdp-updates .cro-qty-wrapper").attr("style","display:none")):($(".modal--is-active .cro-pdp-updates .cro-qty-wrapper").removeAttr("style"),$(".modal--is-active .cro-pdp-updates .cro-qty-wrapper input").val(result.quantity),$(".modal--is-active .cro-pdp-updates button:first").attr("style","display:none"),$(".modal--is-active #product_quantity-modal").val(result.quantity))):($(".modal--is-active #product_quantity-modal").val(1),$(".modal--is-active .cro-pdp-updates button").removeAttr("style"),$(".modal--is-active .cro-pdp-updates .cro-qty-wrapper").attr("style","display:none"))})}}let interval=setInterval(checkElement,500);document.dispatchEvent(new CustomEvent("modalOpen")),document.dispatchEvent(new CustomEvent("modalOpen."+this.id)),this.bindEvents()},Modal.prototype.close=function(evt){if(this.modalIsOpen){if(evt&&!evt.target.closest(".js-modal-close")){if(evt.target.closest(".modal__inner"))return}document.activeElement.blur(),this.modal.classList.remove(this.config.openClass),this.modal.classList.add(this.config.closingClass),document.documentElement.classList.remove(...this.config.bodyOpenClass),document.documentElement.classList.add(this.config.bodyClosingClass),window.setTimeout(function(){document.documentElement.classList.remove(this.config.bodyClosingClass),$("body").removeClass("show-overlay no-scroll-enable-disclaimer"),$(".main-popup").removeClass("show"),this.modal.classList.remove(this.config.closingClass),this.activeSource&&this.activeSource.getAttribute("aria-expanded")&&this.activeSource.setAttribute("aria-expanded","false").focus()}.bind(this),500),this.isSolid&&document.documentElement.classList.remove(this.config.bodyOpenSolidClass),this.modalIsOpen=!1,theme.a11y.removeTrapFocus({container:this.modal,namespace:"modal_focus"}),document.dispatchEvent(new CustomEvent("modalClose."+this.id)),this.unbindEvents()}},Modal.prototype.bindEvents=function(){window.on("keyup.modal",function(evt){evt.keyCode===27&&this.close()}.bind(this)),this.config.closeOffContentClick&&this.modal.on("click.modal",this.close.bind(this))},Modal.prototype.unbindEvents=function(){document.documentElement.off(".modal"),this.config.closeOffContentClick&&this.modal.off(".modal")},Modal})(),window.onpageshow=function(evt){evt.persisted&&(document.body.classList.remove("unloading"),document.querySelectorAll(".cart__checkout").forEach(el=>{el.classList.remove("btn--loading")}))},theme.pageTransitions=function(){document.body.dataset.transitions==="true"&&(navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)&&document.querySelectorAll("a").forEach(a=>{window.setTimeout(function(){document.body.classList.remove("unloading")},1200)}),document.querySelectorAll('a.rca-add-to-cart-submit, a.hero__slide-link, a[href^="mailto:"], a[href^="#"], a[target="_blank"], a[href*="youtube.com/watch"], a[href*="youtu.be/"], a[download]').forEach(el=>{el.classList.add("js-no-transition")}),document.querySelectorAll("a:not(.js-no-transition)").forEach(el=>{el.addEventListener("click",function(evt){if(evt.metaKey)return!0;evt.preventDefault(),document.body.classList.add("unloading");var src=el.getAttribute("href");window.setTimeout(function(){location.href=src},50)})}),document.querySelectorAll("a.mobile-nav__link").forEach(el=>{el.addEventListener("click",function(){theme.NavDrawer.close()})}))},typeof window.noUiSlider>"u")throw new Error("theme.PriceRange is missing vendor noUiSlider: // =require vendor/nouislider.js");function getCookie(cookieName){let cookie={};return document.cookie.split(";").forEach(function(el){let[key,value]=el.split("=");cookie[key.trim()]=value}),cookie[cookieName]}theme.AjaxProduct=(function(){var status={loading:!1};function ProductForm(form,submit,args){this.form=form,this.args=args;var submitSelector=submit||".add-to-cart";this.form&&(this.addToCart=form.querySelector(submitSelector),this.form.addEventListener("submit",this.addItemFromForm.bind(this)))}return ProductForm.prototype=Object.assign({},ProductForm.prototype,{addItemFromForm:async function(evt,callback){evt.preventDefault();var submitter=evt&&evt.submitter;$(".cart__checkout").attr("disabled",!0),$(".cart__checkout").addClass("btn-disabled"),$(".cart__checkout").removeClass("btn-orange-bg");var btn=evt.currentTarget;let prodTitle2=$(evt.currentTarget).attr("data-product-name"),prodHandle=$(evt.currentTarget).attr("data-product-handle"),preOrder=$(evt.currentTarget).find("button").attr("data-pre-order");var formEl=evt&&evt.target&&evt.target.tagName==="FORM"?evt.target:this.form;let productQty=$(".modal--quick-shop").hasClass("modal--is-active")?parseInt($(".modal--is-active #product_quantity-modal").val(),10):parseInt(formEl?$(formEl).find(".product_quantity").val():$(".product_quantity").val(),10)||1,bundleQtyOverride=formEl?$(formEl).find("[data-bundle-quantity]").val():$("[data-bundle-quantity]").val();bundleQtyOverride&&bundleQtyOverride!==""&&!isNaN(parseInt(bundleQtyOverride,10))&&(productQty=parseInt(bundleQtyOverride,10));let qtyVal;if(storeUrl=="mkt-hashi.myshopify.com"&&productQty!==0&&submitter&&submitter.classList&&submitter.classList.contains("pdp-qty__plus")?qtyVal=productQty+1:storeUrl=="mkt-hashi.myshopify.com"&&productQty==0&&submitter&&submitter.classList&&submitter.classList.contains("pdp-qty__minus")?qtyVal=productQty:storeUrl=="sgm-hashi.myshopify.com"&&productQty!==0&&submitter&&submitter.classList&&submitter.classList.contains("pdp-qty__plus")?qtyVal=productQty+1:(storeUrl=="sgm-hashi.myshopify.com"&&productQty==0&&submitter&&submitter.classList&&submitter.classList.contains("pdp-qty__minus"),qtyVal=productQty),productQty==0?productQty=1:productQty=productQty,submitter&&submitter.classList&&(submitter.classList.contains("pdp-qty__minus")||submitter.classList.contains("pdp-qty__plus"))){let variantId2=$(".modal--quick-shop").hasClass("modal--is-active")?$(".modal--is-active .pdp-qty__minus").attr("data-variant-id"):$(".pdp-qty__minus").attr("data-variant-id"),updates={};updates[variantId2]=qtyVal,theme.cart._updateCart({url:"/cart/update.js",data:JSON.stringify({updates}),method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"}}).then(function(cart){updateCartItems(cart),qtyVal==0&&($(".cro-qty-wrapper").hide(),$(".pdp-atc").show()),document.dispatchEvent(new CustomEvent("cart:build",{detail:{product:cart}}))})}else{var atcBtn=formEl&&formEl.querySelector&&formEl.querySelector("[data-add-to-cart]"),variantId=$(".modal--quick-shop").hasClass("modal--is-active")?$(".modal--is-active .add-to-cart").attr("data-variant-id"):atcBtn&&atcBtn.getAttribute("data-variant-id")||formEl&&formEl.querySelector("select[name=id]")&&formEl.querySelector("select[name=id]").value||$(".add-to-cart").attr("data-variant-id");if(!variantId){status.loading=!1;return}if(status.loading)return;status.loading=!0;var currentCart=await theme.cart.getCart(),currentQty=0,lineKeyForVariant=null;if(currentCart&&currentCart.items){var existingItem=currentCart.items.find(function(i){return String(i.variant_id)===String(variantId)});existingItem&&(currentQty=existingItem.quantity,lineKeyForVariant=existingItem.key)}var incrementalAtc=document.querySelector(".product-block--quote-cta")!==null,quantityToAdd=incrementalAtc?productQty:Math.max(0,productQty-currentQty),data={id:variantId,quantity:quantityToAdd};if(!incrementalAtc&&quantityToAdd===0&&currentQty>productQty&&lineKeyForVariant){status.loading=!1,fetch(theme.routes.cartUpdate||"/cart/update.js",{method:"POST",body:JSON.stringify({updates:{[lineKeyForVariant]:productQty}}),credentials:"same-origin",headers:{"Content-Type":"application/json"}}).then(function(r){return r.json()}).then(function(cart){cart&&cart.items&&(updateCartItems(cart),document.dispatchEvent(new CustomEvent("cart:build",{detail:{product:cart}}))),typeof checkQtyButton=="function"&&checkQtyButton()}).catch(function(){status.loading=!1});return}if(quantityToAdd===0){status.loading=!1,typeof checkQtyButton=="function"&&checkQtyButton();return}if(theme.settings.localization)if(localStorage.getItem("zipcode")){let productInventory=await availableInventory(variantId);productQty<=productInventory.availableQuantity&&productInventory.isInStock||prodHandle==="bokksu-digital-gift-card"?cartItemAdd(data,this,status):(status.loading=!1,alert(productInventory.availableQuantity?`We can ship a maximum of ${productInventory.availableQuantity} ${prodTitle2} to your zip code.`:"Item is out of stock at your location"))}else status.loading=!1,$(".zip-code-button").click();else if(checkDateForAdventProduct()){var preorderInCart=isPreOrderInCart();let items=(await theme.cart.getCart()).items;preorderInCart?preOrder&&preorderInCart?window.location.href.includes("gift-card")?setTimeout(()=>{cartItemAdd(data,this,status)},2e3):cartItemAdd(data,this,status):(status.loading=!1,preOrderAlert()):preOrder&&items.length>0?(status.loading=!1,preOrderAlert()):window.location.href.includes("gift-card")?setTimeout(()=>{cartItemAdd(data,this,status)},2e3):cartItemAdd(data,this,status)}else window.location.href.includes("gift-card")?setTimeout(()=>{cartItemAdd(data,this,status)},4e3):cartItemAdd(data,this,status)}},success:function(product){var errors=this.form.querySelector(".errors");errors&&errors.remove(),document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product,addToCartBtn:this.addToCart}})),this.args&&this.args.scopedEventId&&document.dispatchEvent(new CustomEvent("ajaxProduct:added:"+this.args.scopedEventId,{detail:{product,addToCartBtn:this.addToCart}}))},error:function(error){if(!error.description){console.warn(error);return}var errors=this.form.querySelector(".errors");errors&&errors.remove();var errorDiv=document.createElement("div");errorDiv.classList.add("errors","text-center"),errorDiv.textContent=error.description,this.form.append(errorDiv),document.dispatchEvent(new CustomEvent("ajaxProduct:error",{detail:{errorMessage:error.description}})),this.args&&this.args.scopedEventId&&document.dispatchEvent(new CustomEvent("ajaxProduct:error:"+this.args.scopedEventId,{detail:{errorMessage:error.description}}))}}),ProductForm})();function cartItemAdd(data,evt,status){fetch(theme.routes.cartAdd,{method:"POST",body:JSON.stringify(data),credentials:"same-origin",headers:{"Content-Type":"application/json"}}).then(response=>response.json()).then(function(data2){if(updateCartItems(null),$(".modal--is-active").length==0&&$(".pdp__qty,.pdp-product-quantity,#product_quantity,#product_quantity-modal").val(1),data2.status===422)evt.error(data2);else{HideCALSection(),$(".modal--is-active").length==0?($(".pdp-atc").each(function(){$(this).hasClass("gwbutton")||$(this).hide()}),atcAndQtyButtonSwitch(data2,"add")):($(".modal--is-active .pdp-atc").hide(),$(".modal--is-active .cro-qty-wrapper").show());var product=data2;evt.success(product),document.dispatchEvent(new CustomEvent("cart:build",{detail:{product:d
84ata2}}))}status.loading=!1,localStorage.setItem("cartCookie",getCookie("cart")),document.body.classList.contains("template-cart")&&(window.scrollTo(0,0),location.reload())}.bind(evt)).catch(function(){status.loading=!1})}theme.ProductMedia=(function(){var modelJsonSections={},models={},xrButtons={},selectors={mediaGroup:"[data-product-single-media-group]",xrButton:"[data-shopify-xr]"};function init(modelViewerContainers,sectionId){modelJsonSections[sectionId]={loaded:!1},modelViewerContainers.forEach(function(container,index){var mediaId=container.dataset.mediaId,modelViewerElement=container.querySelector("model-viewer"),modelId=modelViewerElement.dataset.modelId;if(index===0){var mediaGroup=container.closest(selectors.mediaGroup),xrButton=mediaGroup.querySelector(selectors.xrButton);xrButtons[sectionId]={element:xrButton,defaultId:modelId}}models[mediaId]={modelId,sectionId,container,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&&Shopify&&(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.config.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&&delete models[key]}delete modelJsonSections[sectionId]}return{init,removeSectionModels}})(),theme.QtySelector=(function(){var selectors={input:".js-qty__num",plus:".js-qty__adjust--plus",minus:".js-qty__adjust--minus"};function QtySelector(el,options){this.wrapper=el,this.plus=el.querySelector(selectors.plus),this.minus=el.querySelector(selectors.minus),this.input=el.querySelector(selectors.input),this.minValue=this.input.getAttribute("min")||1;var defaults={namespace:null,isCart:!1,key:this.input.dataset.id};this.options=Object.assign({},defaults,options),this.init()}return QtySelector.prototype=Object.assign({},QtySelector.prototype,{init:function(){var isProcessing=!1;this.plus.addEventListener("click",async function(e){if(e.stopImmediatePropagation(),!isProcessing){isProcessing=!0;var qty=this._getQty(),variantId=$(e.currentTarget).attr("data-variant-id"),self2=this;(async function(){var cart=await theme.cart.getCart(),itemInCart=cart.items.find(function(item){return item.variant_id==variantId}),newQty=itemInCart?qty+1:1;window.global_popup_qty=Number(newQty);let prodHandle=$(e.currentTarget).attr("data-product-handle");if(theme.settings.localization){let prodTitle2=$(e.currentTarget).attr("data-product-name");if(localStorage.getItem("zipcode")){let variantId2=$(e.currentTarget).attr("data-variant-id"),productInventory=variantId2&&await availableInventory(variantId2),checkIsModal=$(".modal__inner .product-single__title").hasClass("product-temp");variantId2?newQty<=productInventory.availableQuantity&&productInventory.isInStock||prodHandle==="bokksu-digital-gift-card"?(self2._change(newQty),setTimeout(()=>{isProcessing=!1},1500)):(self2._change(productInventory.availableQuantity??0),setTimeout(()=>{isProcessing=!1},500),alert(productInventory.availableQuantity?`We can ship a maximum of ${productInventory.availableQuantity} ${prodTitle2} to your zip code.`:"Item is out of stock at your location")):(self2._change(newQty),setTimeout(()=>{isProcessing=!1},1500))}else isProcessing=!1,$(".zip-code-button").click()}else if(checkDateForAdventProduct()){let productIds=cart.items.map(item=>item.variant_id);var preOrderExists=!1,PreOrderProductId=[],uniqueProductIds=[];$(".cart__item").each(function(i,itemEl){var tags=$(itemEl).attr("data-tags");if(tags){var tagArr=tags.split(",");tagArr.includes("preorder")&&PreOrderProductId.push($(itemEl).attr("data-variant-id"));const productIdArray=PreOrderProductId.map(str=>parseInt(str));productIdArray.length>0&&(uniqueProductIds=productIds.filter(id=>!productIdArray.includes(id)));var isPreOrderInCart2=tagArr.filter(function(tag){return tag=="preorder"});isPreOrderInCart2.length>0?preOrderExists=!0:preOrderExists=!1}}),uniqueProductIds.length>0?(removeItems(uniqueProductIds,null),setTimeout(()=>{isProcessing=!1},1500)):(self2._change(newQty),setTimeout(()=>{isProcessing=!1},1500))}else self2._change(newQty),setTimeout(()=>{isProcessing=!1},1500)})()}}.bind(this)),this.minus.addEventListener("click",function(e){var qty=this._getQty();window.global_popup_qty=Number(qty-1),this._change(qty-1)}.bind(this)),this.input.addEventListener("change",async function(evt){if(theme.settings.localization){evt.stopImmediatePropagation();let quantity=this._getQty(),variantId=$(evt.currentTarget).attr("data-variant-id")?$(evt.currentTarget).attr("data-variant-id"):$(evt.currentTarget).attr("data-id"),prodTitle2=$(evt.currentTarget).attr("data-product-name"),prodHandle=$(evt.currentTarget).attr("data-product-handle"),productInventory=await availableInventory(variantId);quantity<=productInventory.availableQuantity&&productInventory.isInStock||prodHandle==="bokksu-digital-gift-card"?this._change(this._getQty()):(this._change(productInventory.availableQuantity),alert(productInventory.availableQuantity?`We can ship a maximum of ${productInventory.availableQuantity} ${prodTitle2} to your zip code.`:"Item is out of stock at your location"))}else evt.stopImmediatePropagation(),this._change(this._getQty())}.bind(this))},_getQty:function(){var qty=this.input.value;return parseFloat(qty)==parseInt(qty)&&!isNaN(qty)||(qty=1),parseInt(qty)},_change:function(qty){if(!this._changing){if(this._changing=!0,qty<=this.minValue&&(qty=this.minValue),this.input.value=qty,this.options.isCart==!1){$(".modal--is-active").length&&$(".modal--is-active .pdp-qty").attr("data-variant-id")!==$(".pdp-qty").attr("data-variant-id")?($(".modal--is-active .pdp-product-quantity").val(this.input.value),$(".modal--is-active .product_quantity").val(this.input.value)):($(".pdp-product-quantity").val(this.input.value),$(".product_quantity").val(this.input.value)),console.log("Add quantity");var eventDetail=[this.options.key,qty,this.wrapper];eventDetail.processed=!1,document.dispatchEvent(new CustomEvent("cart:quantity"+this.options.namespace,{detail:eventDetail}));var self2=this;setTimeout(function(){self2._changing=!1},500);let updates={};updates[this.options.key]=qty}if(this.options.isCart){var eventDetail=[this.options.key,qty,this.wrapper];eventDetail.processed=!1,document.dispatchEvent(new CustomEvent("cart:quantity"+this.options.namespace,{detail:eventDetail}));var self2=this;setTimeout(function(){self2._changing=!1},500)}}}}),QtySelector})(),theme.Slideshow=(function(){var classes={animateOut:"animate-out",isPaused:"is-paused",isActive:"is-active"},selectors={allSlides:".slideshow__slide",currentSlide:".is-selected",wrapper:".slideshow-wrapper",pauseButton:".slideshow__pause"},productSelectors={thumb:".product__thumb-item:not(.hide)",links:".product__thumb-item:not(.hide) a",arrow:".product__thumb-arrow"},defaults={adaptiveHeight:!1,autoPlay:!1,avoidReflow:!1,childNav:null,childNavScroller:null,childVertical:!1,dragThreshold:7,fade:!1,friction:.8,initialIndex:0,pageDots:!1,pauseAutoPlayOnHover:!1,prevNextButtons:!1,rightToLeft:theme.config.rtl,selectedAttraction:.14,setGallerySize:!0,wrapAround:!0};function slideshow(el,args){if(this.el=el,this.args=Object.assign({},defaults,args),this.args.on={ready:this.init.bind(this),change:this.slideChange.bind(this),settle:this.afterChange.bind(this)},this.args.childNav&&(this.childNavEls=this.args.childNav.querySelectorAll(productSelectors.thumb),this.childNavLinks=this.args.childNav.querySelectorAll(productSelectors.links),this.arrows=this.args.childNav.querySelectorAll(productSelectors.arrow),this.childNavLinks.length&&this.initChildNav()),this.args.avoidReflow&&avoidReflow(el),this.slideshow=new Flickity(el,this.args),el.dataset.zoom&&el.dataset.zoom==="true"&&(this.slideshow.on("dragStart",()=>{this.slideshow.slider.style.pointerEvents="none",this.slideshow.options.fade&&(this.slideshow.slider.querySelector(".is-selected").style.pointerEvents="none")}),this.slideshow.on("dragEnd",()=>{this.slideshow.slider.style.pointerEvents="auto",this.slideshow.options.fade&&(this.slideshow.slider.querySelector(".is-selected").style.pointerEvents="auto")})),this.args.autoPlay){var wrapper=el.closest(selectors.wrapper);this.pauseBtn=wrapper.querySelector(selectors.pauseButton),this.pauseBtn&&this.pauseBtn.addEventListener("click",this._togglePause.bind(this))}window.on("resize",theme.utils.debounce(300,function(){this.resize()}.bind(this)));function avoidReflow(el2){if(el2.id){for(var firstChild=el2.firstChild;firstChild!=null&&firstChild.nodeType==3;)firstChild=firstChild.nextSibling;var style=document.createElement("style");style.innerHTML=`#${el2.id} .flickity-viewport{height:${firstChild.offsetHeight}px}`,document.head.appendChild(style)}}}return slideshow.prototype=Object.assign({},slideshow.prototype,{init:function(el){this.currentSlide=this.el.querySelector(selectors.currentSlide),this.args.callbacks&&this.args.callbacks.onInit&&typeof this.args.callbacks.onInit=="function"&&this.args.callbacks.onInit(this.currentSlide),window.AOS&&AOS.refresh()},slideChange:function(index){this.args.fade&&this.currentSlide&&(this.currentSlide.classList.add(classes.animateOut),this.currentSlide.addEventListener("transitionend",function(){this.currentSlide.classList.remove(classes.animateOut)}.bind(this))),this.args.childNav&&this.childNavGoTo(index),this.args.callbacks&&this.args.callbacks.onChange&&typeof this.args.callbacks.onChange=="function"&&this.args.callbacks.onChange(index),this.arrows&&this.arrows.length&&(this.arrows[0].classList.toggle("hide",index===0),this.arrows[1].classList.toggle("hide",index===this.childNavLinks.length-1))},afterChange:function(index){this.args.fade&&this.el.querySelectorAll(selectors.allSlides).forEac
84h(slide=>{slide.classList.remove(classes.animateOut)}),this.currentSlide=this.el.querySelector(selectors.currentSlide),this.args.childNav&&this.childNavGoTo(this.slideshow.selectedIndex)},destroy:function(){this.args.childNav&&this.childNavLinks.length&&this.childNavLinks.forEach(a=>{a.classList.remove(classes.isActive)}),this.slideshow.destroy()},reposition:function(){this.slideshow.reposition()},_togglePause:function(){var paused;this.pauseBtn.classList.contains(classes.isPaused)?(this.pauseBtn.classList.remove(classes.isPaused),this.slideshow.playPlayer(),paused=!1):(this.pauseBtn.classList.add(classes.isPaused),this.slideshow.pausePlayer(),paused=!0),this.pauseBtn.setAttribute("aria-pressed",paused?"true":"false")},resize:function(){this.slideshow.resize()},play:function(){this.slideshow.playPlayer()},pause:function(){this.slideshow.pausePlayer()},goToSlide:function(i){this.slideshow.select(i)},setDraggable:function(enable){this.slideshow.options.draggable=enable,this.slideshow.updateDraggable()},initChildNav:function(){this.childNavLinks[this.args.initialIndex].classList.add("is-active"),this.childNavLinks.forEach((link,i)=>{link.setAttribute("data-index",i),link.addEventListener("click",function(evt){evt.preventDefault(),this.goToSlide(this.getChildIndex(evt.currentTarget))}.bind(this)),link.addEventListener("focus",function(evt){this.goToSlide(this.getChildIndex(evt.currentTarget))}.bind(this)),link.addEventListener("keydown",function(evt){evt.keyCode===13&&this.goToSlide(this.getChildIndex(evt.currentTarget))}.bind(this))}),this.arrows.length&&this.arrows.forEach(arrow=>{arrow.addEventListener("click",this.arrowClick.bind(this))})},getChildIndex:function(target){return parseInt(target.dataset.index)},childNavGoTo:function(index){this.childNavLinks.forEach(a=>{a.blur(),a.classList.remove(classes.isActive)});var el=this.childNavLinks[index];if(el.classList.add(classes.isActive),!!this.args.childNavScroller)if(this.args.childVertical){var elTop=el.offsetTop;this.args.childNavScroller.scrollTop=elTop-100}else{var elLeft=el.offsetLeft;this.args.childNavScroller.scrollLeft=elLeft-100}},arrowClick:function(evt){evt.currentTarget.classList.contains("product__thumb-arrow--prev")?this.slideshow.previous():this.slideshow.next()}}),slideshow})(),theme.VariantAvailability=(function(){var classes={disabled:"disabled"};function availability(args){this.type=args.type,this.variantsObject=args.variantsObject,this.currentVariantObject=args.currentVariantObject,this.container=args.container,this.namespace=args.namespace,this.init()}return availability.prototype=Object.assign({},availability.prototype,{init:function(){this.container.on("variantChange"+this.namespace,this.setAvailability.bind(this)),this.setInitialAvailability()},createAvailableOptionsTree(variants,currentlySelectedValues){return variants.reduce((options,variant)=>(Object.keys(options).forEach(index=>{if(variant[index]===null)return;let entry=options[index].find(option=>option.value===variant[index]);typeof entry>"u"&&(entry={value:variant[index],soldOut:!0},options[index].push(entry));const currentOption1=currentlySelectedValues.find(({value,index:index2})=>index2==="option1"),currentOption2=currentlySelectedValues.find(({value,index:index2})=>index2==="option2");switch(index){case"option1":entry.soldOut=entry.soldOut&&variant.available?!1:entry.soldOut;break;case"option2":currentOption1&&variant.option1===currentOption1.value&&(entry.soldOut=entry.soldOut&&variant.available?!1:entry.soldOut);case"option3":currentOption1&&variant.option1===currentOption1.value&&currentOption2&&variant.option2===currentOption2.value&&(entry.soldOut=entry.soldOut&&variant.available?!1:entry.soldOut)}}),options),{option1:[],option2:[],option3:[]})},setInitialAvailability:function(){this.container.querySelectorAll(".variant-input-wrap").forEach(group=>{this.disableVariantGroup(group)});const currentlySelectedValues=this.currentVariantObject.options.map((value,index)=>({value,index:`option${index+1}`})),initialOptions=this.createAvailableOptionsTree(this.variantsObject,currentlySelectedValues,this.currentVariantObject);for(var[option,values]of Object.entries(initialOptions))this.manageOptionState(option,values)},setAvailability:function(evt){const{value:lastSelectedValue,index:lastSelectedIndex,currentlySelectedValues,variant}=evt.detail,valuesToManage=this.createAvailableOptionsTree(this.variantsObject,currentlySelectedValues,variant,lastSelectedIndex,lastSelectedValue);for(var[option,values]of Object.entries(valuesToManage))this.manageOptionState(option,values,lastSelectedValue)},manageOptionState:function(option,values){var group=this.container.querySelector('.variant-input-wrap[data-index="'+option+'"]');
84values.forEach(obj=>{this.enableVariantOption(group,obj)})},enableVariantOption:function(group,obj){var value=obj.value.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g,"\\$1");if(this.type==="dropdown")group.querySelector('option[value="'+value+'"]').disabled=!1;else{var buttonGroup=group.querySelector('.variant-input[data-value="'+value+'"]'),input=buttonGroup.querySelector("input"),label=buttonGroup.querySelector("label");input.classList.remove(classes.disabled),label.classList.remove(classes.disabled),obj.soldOut&&(input.classList.add(classes.disabled),label.classList.add(classes.disabled))}},disableVariantGroup:function(group){this.type==="dropdown"?group.querySelectorAll("option").forEach(option=>{option.disabled=!0}):(group.querySelectorAll("input").forEach(input=>{input.classList.add(classes.disabled)}),group.querySelectorAll("label").forEach(label=>{label.classList.add(classes.disabled)}))}}),availability})(),theme.videoModal=function(){var youtubePlayer,vimeoPlayer,videoHolderId="VideoHolder",selectors={youtube:'a[href*="youtube.com/watch"], a[href*="youtu.be/"]',vimeo:'a[href*="player.vimeo.com/player/"], a[href*="vimeo.com/"]',mp4Trigger:".product-video-trigger--mp4",mp4Player:".product-video-mp4-sound"},youtubeTriggers=document.querySelectorAll(selectors.youtube),vimeoTriggers=document.querySelectorAll(selectors.vimeo),mp4Triggers=document.querySelectorAll(selectors.mp4Trigger);if(!youtubeTriggers.length&&!vimeoTriggers.length&&!mp4Triggers.length)return;var videoHolderDiv=document.getElementById(videoHolderId);youtubeTriggers.length&&theme.LibraryLoader.load("youtubeSdk"),vimeoTriggers.length&&theme.LibraryLoader.load("vimeo",window.vimeoApiReady);var modal=new theme.Modals("VideoModal","video-modal",{closeOffContentClick:!0,bodyOpenClass:["modal-open","video-modal-open"],solid:!0});youtubeTriggers.forEach(btn=>{btn.addEventListener("click",triggerYouTubeModal)}),mp4Triggers.forEach(btn=>{btn.addEventListener("click",triggerMp4Modal)}),vimeoTriggers.forEach(btn=>{btn.addEventListener("click",triggerVimeoModal)}),document.addEventListener("modalClose.VideoModal",closeVideoModal);function triggerYouTubeModal(evt){if(theme.config.youTubeReady){evt.preventDefault(),emptyVideoHolder(),modal.open(evt);var videoId=getYoutubeVideoId(evt.currentTarget.getAttribute("href"));youtubePlayer=new theme.YouTube(videoHolderId,{videoId,style:"sound",events:{onReady:onYoutubeReady}})}}function triggerVimeoModal(evt){if(theme.config.vimeoReady){evt.preventDefault(),emptyVideoHolder(),modal.open(evt);var videoId=evt.currentTarget.dataset.videoId,videoLoop=evt.currentTarget.dataset.videoLoop;vimeoPlayer=new theme.VimeoPlayer(videoHolderId,videoId,{style:"sound",loop:videoLoop})}}function triggerMp4Modal(evt){emptyVideoHolder();var el=evt.currentTarget,player=el.parentNode.querySelector(selectors.mp4Player),playerClone=player.cloneNode(!0);playerClone.classList.remove("hide"),videoHolderDiv.append(playerClone),modal.open(evt),videoHolderDiv.querySelector("video").play()}function onYoutubeReady(evt){evt.target.unMute(),evt.target.playVideo()}function getYoutubeVideoId(url){var regExp=/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/,match=url.match(regExp);return match&&match[7].length==11?match[7]:!1}function emptyVideoHolder(){videoHolderDiv.innerHTML=""}function closeVideoModal(){youtubePlayer&&typeof youtubePlayer.destroy=="function"?youtubePlayer.destroy():vimeoPlayer&&typeof vimeoPlayer.destroy=="function"?vimeoPlayer.destroy():emptyVideoHolder()}};class PredictiveSearch extends HTMLElement{constructor(){super(),this.enabled=this.getAttribute("data-enabled"),this.context=this.getAttribute("data-context"),this.input=this.querySelector('input[type="search"]'),this.predictiveSearchResults=this.querySelector("#predictive-search"),this.closeBtn=this.querySelector(".btn--close-search"),this.closeBtn1=this.querySelector(".btn--close-search1"),this.screen=this.querySelector("[data-screen]"),this.SearchModal=this.closest("#SearchModal")||null,document.addEventListener("predictive-search:open",e=>{e.detail.context===this.context&&(this.classList.add("is-active"),setTimeout(()=>{this.input.focus()},100))}),this.SearchModal&&new MutationObserver(mutations=>{mutations.forEach(mutation=>{mutation.attributeName==="class"&&mutation.target.className.indexOf("modal--is-active")>-1&&setTimeout(()=>{this.input.focus()},100)})}).observe(this.SearchModal,{attributes:!0}),this.enabled!=="false"&&(this.input.addEventListener("keydown",()=>{this.classList.add("is-active")}),this.input.addEventListener("input",this.debounce(event=>{this.onChange(event)},300).bind(this)),document.addEventListener("predictive-search:close",()=>{this.close()}),document.addEventListener("keydown",event=>{event.keyCode===27&&this.close()}),this.closeBtn.addEventListener("click",e=>{e.preventDefault(),this.close()}),this.screen.addEventListener("click",()=>{this.close()}))}onChange(){const searchTerm=this.input.value.trim();if(!searchTerm.length){this.close();return}this.getSearchResults(searchTerm)}getSearchResults(searchTerm){const searchObj={q:searchTerm,"resources[limit]":3,"resources[limit_scope]":"each","resources[options][unavailable_products]":"last"},params=this.paramUrl(searchObj);fetch(`${theme.routes.predictiveSearch}?${params}&section_id=search-results`).then(response=>{if(!response.ok){const error=new Error(response.status);throw this.close(),error}return response.text()}).then(text=>{const resultsMarkup=new DOMParser().parseFromString(text,"text/html").querySelector("#shopify-section-search-results").innerHTML;this.predictiveSearchResults.innerHTML=resultsMarkup,this.open(),AOS.refreshHard()}).catch(error=>{throw this.close(),error})}open(){this.predictiveSearchResults.style.display="block",document.body.classList.add("predictive-overflow-hidden")}close(){this.predictiveSearchResults.style.display="none",this.predictiveSearchResults.innerHTML="",this.classList.remove("is-active"),document.body.classList.remove("predictive-overflow-hidden"),document.dispatchEvent(new CustomEvent("predictive-search:close-all"))}debounce(fn,wait){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}}paramUrl(obj){return Object.keys(obj).map(function(key){return key+"="+encodeURIComponent(obj[key])}).join("&")}}customElements.define("predictive-search",PredictiveSearch);class ImageElement extends HTMLElement{constructor(){super(),this.init()}init(){const handleIntersection=(entries,observer2)=>{entries[0].isIntersecting&&(this.removeAnimations(),observer2.unobserve(this))};new IntersectionObserver(handleIntersection.bind(this),{rootMargin:"0px 0px 400px 0px"}).observe(this)}removeAnimations(){const imageWrap=this.closest(".image-wrap"),skrimWrap=this.closest(".skrim__link");imageWrap&&imageWrap.classList.add("loaded"),skrimWrap&&skrimWrap.classList.add("loaded")}}customElements.define("image-element",ImageElement),theme.announcementBar=(function(){var args={autoPlay:5e3,avoidReflow:!0,cellAlign:theme.config.rtl?"right":"left",fade:!0},bar,flickity;
84function init(){bar=document.getElementById("AnnouncementSlider"),bar&&(unload(),bar.dataset.blockCount!==1&&(flickity=new theme.Slideshow(bar,args)))}function onBlockSelect(id){var slide=bar.querySelector("#AnnouncementSlide-"+id),index=parseInt(slide.dataset.index);flickity&&typeof flickity.pause=="function"&&(flickity.goToSlide(index),flickity.pause())}function onBlockDeselect(){flickity&&typeof flickity.play=="function"&&flickity.play()}function unload(){flickity&&typeof flickity.destroy=="function"&&flickity.destroy()}return{init,onBlockSelect,onBlockDeselect,unload}})(),theme.headerNav=(function(){var selectors={wrapper:"#HeaderWrapper",siteHeader:"#SiteHeader",logo:"#LogoContainer img",megamenu:".megamenu",navigation:".site-navigation",navItems:".site-nav__item",navLinks:".site-nav__link",navLinksWithDropdown:".site-nav__link--has-dropdown",navDropdownLinks:".site-nav__dropdown-link--second-level",triggerCollapsedMenu:".site-nav__compress-menu",collapsedMenu:'[data-type="nav"]',bottomSearch:'[data-type="search"]',navDetails:".site-nav__details"},classes={hasDropdownClass:"site-nav--has-dropdown",hasSubDropdownClass:"site-nav__deep-dropdown-trigger",dropdownActive:"is-focused",headerCompressed:"header-wrapper--compressed",overlay:"header-wrapper--overlay",overlayStyle:"is-light"},config={namespace:".siteNav",wrapperOverlayed:!1,stickyEnabled:!1,stickyActive:!1,subarPositionInit:!1,threshold:0},wrapper,siteHeader,bottomNav,bottomSearch;function init(){wrapper=document.querySelector(selectors.wrapper),siteHeader=document.querySelector(selectors.siteHeader),bottomNav=wrapper.querySelector(selectors.collapsedMenu),bottomSearch=wrapper.querySelector(selectors.bottomSearch),config.threshold=wrapper.getBoundingClientRect().top,config.subarPositionInit=!1,config.stickyEnabled=siteHeader.dataset.sticky==="true",config.stickyEnabled?(config.wrapperOverlayed=wrapper.classList.contains(classes.overlayStyle),stickyHeaderCheck()):disableSticky(),theme.settings.overlayHeader=siteHeader.dataset.overlay==="true",theme.settings.overlayHeader&&Shopify&&Shopify.designMode&&document.body.classList.contains("template-collection")&&!document.querySelector(".collection-hero")&&this.disableOverlayHeader(),setAbsoluteBottom(),window.on("resize"+config.namespace,theme.utils.debounce(250,setAbsoluteBottom));var collapsedNavTrigger=wrapper.querySelector(selectors.triggerCollapsedMenu);collapsedNavTrigger&&collapsedNavTrigger.on("click",function(){collapsedNavTrigger.classList.toggle("is-active"),theme.utils.prepareTransition(bottomNav,function(){bottomNav.classList.toggle("is-active")})}),menuDetailsHandler();var navigation=siteHeader.querySelector(selectors.navigation);navigation.querySelectorAll(".grid-product")&&(new theme.QuickAdd(navigation),new theme.QuickShop(navigation))}function setAbsoluteBottom(){theme.settings.overlayHeader&&document.querySelector(".header-section").classList.add("header-section--overlay");var activeSubBar=theme.config.bpSmall?document.querySelector('.site-header__element--sub[data-type="search"]'):document.querySelector('.site-header__element--sub[data-type="nav"]');if(activeSubBar){var h=activeSubBar.offsetHeight;h!==0&&document.documentElement.style.setProperty("--header-padding-bottom",h+"px"),config.subarPositionInit||(wrapper.classList.add("header-wrapper--init"),config.subarPositionInit=!0)}}function disableOverlayHeader(){wrapper.classList.remove(config.overlayEnabledClass,classes.overlayStyle),config.wrapperOverlayed=!1,theme.settings.overlayHeader=!1}function stickyHeaderCheck(){theme.config.stickyHeader=doesMegaMenuFit(),theme.config.stickyHeader?(config.forceStopSticky=!1,stickyHeader()):(config.forceStopSticky=!0,disableSticky())}function disableSticky(){document.querySelector(".header-section").style.position="relative"}function removeOverlayClass(){config.wrapperOverlayed&&wrapper.classList.remove(classes.overlayStyle)}function doesMegaMenuFit(){var largestMegaNav=0;return siteHeader.querySelectorAll(selectors.megamenu).forEach(nav=>{var h=nav.offsetHeight;h>largestMegaNav&&(largestMegaNav=h)}),!(window.innerHeight<largestMegaNav+120)}function stickyHeader(){window.scrollY>config.threshold&&stickyHeaderScroll(),window.on("scroll"+config.namespace,stickyHeaderScroll)}function stickyHeaderScroll(){config.stickyEnabled&&(config.forceStopSticky||requestAnimationFrame(scrollHandler))}function scrollHandler(){if(window.scrollY>config.threshold){if(config.stickyActive)return;bottomNav&&theme.utils.prepareTransition(bottomNav),bottomSearch&&theme.utils.prepareTransition(bottomSearch),config.stickyActive=!0,wrapper.classList.add(classes.headerCompressed),$("body").addClass("body-scroll-content"),config.wrapperOverlayed&&wrapper.classList.remove(classes.overlayStyle),document.dispatchEvent(new CustomEvent("headerStickyChange"))}else{if(!config.stickyActive)return;bottomNav&&theme.utils.prepareTransition(bottomNav),bottomSearch&&theme.utils.prepareTransition(bottomSearch),config.stickyActive=!1,config.threshold=wrapper.getBoundingClientRect().top,wrapper.classList.remove(classes.headerCompressed),$("body").removeClass("body-scroll-content"),$(".main-menu-new").removeClass("show-categories"),$(".ctaegories-icon").removeClass("icon-change"),config.wrapperOverlayed&&($(".site-header__drawer.is-active").is(":visible")||wrapper.classList.add(classes.overlayStyle)),document.dispatchEvent(new CustomEvent("headerStickyChange"))}}function menuDetailsHandler(){document.querySelectorAll(selectors.navDetails).forEac
84h(navDetail=>{const summary=navDetail.querySelector("summary");document.addEventListener("click",evt=>{navDetail.hasAttribute("open")&&!navDetail.contains(evt.target)?(navDetail.removeAttribute("open"),summary.setAttribute("aria-expanded","false")):navDetail.hasAttribute("open")?summary.setAttribute("aria-expanded","false"):summary.setAttribute("aria-expanded","true")})})}return{init,removeOverlayClass,disableOverlayHeader}})(),theme.MobileNav=(function(){var selectors={wrapper:".slide-nav__wrapper",nav:".slide-nav",childList:".slide-nav__dropdown",allLinks:"a.slide-nav__link",subNavToggleBtn:".js-toggle-submenu",openBtn:".mobile-nav-trigger"},classes={isActive:"is-active"},defaults={isOpen:!1,menuLevel:1,inHeader:!1};function MobileNav(args){this.config=Object.assign({},defaults,args),this.namespace=".nav-header-"+args.id,this.container=document.getElementById(this.config.id),this.container&&(this.wrapper=this.container.querySelector(selectors.wrapper),this.wrapper&&(this.nav=this.wrapper.querySelector(selectors.nav),this.openTriggers=document.querySelectorAll(selectors.openBtn),this.init()))}return MobileNav.prototype=Object.assign({},MobileNav.prototype,{init:function(){this.openTriggers.length&&this.openTriggers.forEach(btn=>{btn.addEventListener("click",function(){this.config.isOpen?this.close():this.open()}.bind(this))}),this.nav.querySelectorAll(selectors.subNavToggleBtn).forEach(btn=>{btn.addEventListener("click",this.toggleSubNav.bind(this))}),this.nav.querySelectorAll(selectors.allLinks).forEach(link=>{link.addEventListener("click",this.close.bind(this))}),this.inHeader&&(document.addEventListener("unmatchSmall",function(){this.close(null,!0)}.bind(this)),document.addEventListener("CartDrawer:open",this.close.bind(this)),document.addEventListener("mobileNav:open",this.open.bind(this)),document.addEventListener("mobileNav:close",this.close.bind(this)))},open:function(evt){evt&&evt.preventDefault(),theme.sizeDrawer(),this.openTriggers.forEach(btn=>{btn.classList.add("is-active")}),theme.utils.prepareTransition(this.container,function(){this.container.classList.add("is-active")}.bind(this)),window.on("keyup"+this.namespace,function(evt2){evt2.keyCode===27&&this.close()}.bind(this)),theme.headerNav.removeOverlayClass(),document.documentElement.classList.add("mobile-nav-open"),document.dispatchEvent(new CustomEvent("MobileNav:open")),this.config.isOpen=!0,setTimeout(function(){window.on("click"+this.namespace,function(evt2){this.close(evt2)}.bind(this))}.bind(this),0)},close:function(evt,noAnimate){var forceClose=!1;evt&&evt.target.closest&&evt.target.closest(".site-header__drawer")&&(evt.currentTarget&&evt.currentTarget.classList&&evt.currentTarget.classList.contains("slide-nav__link")&&(forceClose=!0),!forceClose)||(this.openTriggers.forEach(btn=>{btn.classList.remove("is-active")}),noAnimate?($("#MainContent").removeClass("blur-body"),this.container.classList.remove("is-active")):theme.utils.prepareTransition(this.container,function(){$("#MainContent").removeClass("blur-body"),this.container.classList.remove("is-active")}.bind(this)),document.documentElement.classList.remove("mobile-nav-open"),document.dispatchEvent(new CustomEvent("MobileNav:close")),window.off("keyup"+this.namespace),window.off("click"+this.namespace),this.config.isOpen=!1)},toggleSubNav:function(evt){var btn=evt.currentTarget;this.goToSubnav(btn.dataset.target)},goToSubnav:function(target){var targetMenu=this.nav.querySelector(selectors.childList+'[data-parent="'+target+'"]');targetMenu?(this.config.menuLevel=targetMenu.dataset.level,this.config.menuLevel==2&&this.nav.querySelectorAll(selectors.childList+'[data-level="3"]').forEach(list=>{list.classList.remove(classes.isActive)}),targetMenu.classList.add(classes.isActive),this.setWrapperHeight(targetMenu.offsetHeight)):(this.config.menuLevel=1,this.wrapper.removeAttribute("style"),this.nav.querySelectorAll(selectors.childList).forEach(list=>{list.classList.remove(classes.isActive)})),this.wrapper.dataset.level=this.config.menuLevel},setWrapperHeight:function(h){this.wrapper.style.height=h+"px"}}),MobileNav})(),theme.headerSearch=(function(){var currentString="",isLoading=!1,searchTimeout,selectors={form:".site-header__search-form",input:'input[type="search"]',searchInlineContainer:".site-header__search-container",searchInlineBtn:".js-search-header",searchButton:"[data-predictive-search-button]",closeSearch:".site-header__search-btn--cancel",closeSearch1:".btn--close-search1",wrapper:"#SearchResultsWrapper",topSearched:"#TopSearched",predictiveWrapper:"#PredictiveWrapper",resultDiv:"#PredictiveResults"},cache={},activeForm,classes={isActive:"predicitive-active"},config={namespace:".search",topSearched:!1,predictiveSearch:!1,imageSize:"square",predictiveImageFill:!0},keys={esc:27,up_arrow:38,down_arrow:40,tab:9};
84function init(){if(initInlineSearch(),cache.wrapper=document.querySelector(selectors.wrapper),!!cache.wrapper){if(cache.topSearched=document.querySelector(selectors.topSearched),cache.topSearched&&(config.topSearched=!0),theme.settings.predictiveSearch&&document.getElementById("shopify-features")){var supportedShopifyFeatures=JSON.parse(document.getElementById("shopify-features").innerHTML);supportedShopifyFeatures.predictiveSearch&&(config.predictiveSearch=!0)}config.predictiveSearch&&(cache.predictiveWrapper=document.querySelector(selectors.predictiveWrapper),config.imageSize=cache.predictiveWrapper.dataset.imageSize,cache.results=document.querySelector(selectors.resultDiv),cache.submit=cache.predictiveWrapper.querySelector(selectors.searchButton),cache.submit.on("click"+config.namespace,triggerSearch)),document.querySelectorAll(selectors.form).forEach(form=>{initForm(form)})}}function initForm(form){form.setAttribute("autocomplete","off"),form.on("submit"+config.namespace,submitSearch);var input=form.querySelector(selectors.input);input.on("focus"+config.namespace,handleFocus),config.predictiveSearch&&input.on("keyup"+config.namespace,handleKeyup)}function reset(){config.predictiveSearch&&(cache.predictiveWrapper.classList.add("hide"),cache.results.innerHTML="",clearTimeout(searchTimeout)),config.topSearched?cache.topSearched.classList.remove("hide"):cache.wrapper.classList.add("hide")}function close(evt){if(evt&&evt.target.closest&&!evt.target.closest(selectors.closeSearch)){if(evt.target.closest(".site-header__search-form"))return;if(evt.target.closest(".site-header__element--sub"))return;if(evt.target.closest("#SearchResultsWrapper"))return;if(evt.target.closest(".site-header__search-container"))return}document.dispatchEvent(new CustomEvent("predictive-search:close",{bubbles:!0})),document.activeElement.blur(),cache.wrapper&&cache.wrapper.classList.add("hide"),config.topSearched&&cache.topSearched.classList.remove("hide"),config.predictiveSearch&&(cache.predictiveWrapper.classList.add("hide"),clearTimeout(searchTimeout)),cache.inlineSearchContainer&&cache.inlineSearchContainer.classList.remove("is-active"),document.querySelectorAll(selectors.form).forEach(form=>{form.classList.remove("is-active")}),window.off("click"+config.namespace)}function initInlineSearch(){cache.inlineSearchContainer=document.querySelector(selectors.searchInlineContainer),document.querySelectorAll(selectors.searchInlineBtn).forEach(btn=>{btn.addEventListener("click",openInlineSearch)})}function openInlineSearch(evt){evt.preventDefault(),evt.stopImmediatePropagation();var container=document.querySelector(selectors.searchInlineContainer);container.classList.add("is-active"),container.focus(),document.querySelector(selectors.closeSearch1).style.display="block",document.dispatchEvent(new CustomEvent("predictive-search:open",{detail:{context:"header"},bubbles:!0})),enableCloseListeners()}function triggerSearch(){activeForm&&activeForm.submit()}function submitSearch(evt){evt.preventDefault?evt.preventDefault():evt.returnValue=!1;var obj={},formData=new FormData(evt.target);for(var key of formData.keys())obj[key]=formData.get(key);obj.q&&(obj.q+="*");var params=paramUrl(obj);return window.location.href=`${theme.routes.search}?${params}`,!1}function handleKeyup(evt){if(activeForm=evt.currentTarget.closest("form"),evt.keyCode!==keys.up_arrow&&evt.keyCode!==keys.down_arrow&&evt.keyCode!==keys.tab){if(evt.keyCode===keys.esc){close();return}search(evt.currentTarget)}}function handleFocus(evt){evt.currentTarget.parentNode.classList.add("is-active"),config.topSearched&&cache.wrapper.classList.remove("hide"),enableCloseListeners()}function enableCloseListeners(){setTimeout(function(){window.on("click"+config.namespace,function(evt){close(evt)})},0),window.on("keyup",function(evt){evt.keyCode===27&&close()}),document.addEventListener("predictive-search:close-all",function(){close()},{once:!0})}function search(input){var keyword=input.value;if(keyword===""){reset();return}var q=_normalizeQuery(keyword);clearTimeout(searchTimeout),searchTimeout=setTimeout(function(){predictQuery(q)}.bind(this),500)}function predictQuery(q){if(!isLoading&&currentString!==q){currentString=q,isLoading=!0;var searchObj={q,"resources[type]":window.location.href.includes("/blogs/")?"article":theme.settings.predictiveSearchType,"resources[limit]":4,"resources[options][unavailable_products]":"last","resources[options][fields]":"title,product_type,variants.title,vendor"},params=paramUrl(searchObj);fetch("/search/suggest.json?"+params).then(response=>response.json()).then(suggestions=>{isLoading=!1;var data={},resultCount=0;cache.topSearched&&cache.topSearched.classList.add("hide"),cache.predictiveWrapper.classList.remove("hide");var resultTypes=Object.entries(suggestions.resources.results);
84if(Object.keys(resultTypes).forEach(function(i){var obj=resultTypes[i],type=obj[0],results=obj[1];switch(resultCount+=results.length,type){case"products":data[type]=buildProducts(results);break;case"collections":data[type]=buildCollections(results);break;case"pages":data[type]=buildPages(results);break;case"articles":data[type]=buildArticles(results);break}}),resultCount===0){reset();return}var output2=buildOutput(data);cache.results.innerHTML="",cache.results.innerHTML=output2,cache.wrapper.classList.remove("hide")})}}function buildProducts(results){var output2="",products=[];if(results.forEach(product=>{if(!product.tags.includes("free gift")&&!product.tags.includes("hide-from-listing")){var new_product={title:product.title,url:product.url,type:product.type,image_responsive_url:theme.Images.buildImagePath(product.image),image_aspect_ratio:product.featured_image.aspect_ratio};products.push(new_product)}}),products.length){var markup=theme.buildProductGridItem(products,config.imageSize);output2=`
85          <div data-type-products>
86            <div class="new-grid product-grid" data-view="small">
87              ${markup}
88            </div>
89          </div>
90        `}return output2}function buildCollections(collections){var output2="";if(collections.length){var markup=theme.buildCollectionItem(collections);output2=`
91          <div data-type-collections>
92            <p class="h6 predictive__label">${theme.strings.searchCollections}</p>
93            <ul class="no-bullets">
94              ${markup}
95            </ul>
96          </div>
97        `}return output2}function buildPages(pages){var output2="";if(pages.length){var markup=theme.buildPageItem(pages);output2=`
98          <div data-type-pages>
99            <p class="h6 predictive__label">${theme.strings.searchPages}</p>
100            <ul class="no-bullets">
101              ${markup}
102            </ul>
103          </div>
104        `}return output2}function buildArticles(articles){var output2="";if(articles.forEach(article=>{article.image&&(article.image=theme.Images.getSizedImageUrl(article.image,"200x200_crop_center"))}),articles.length){var markup=theme.buildArticleItem(articles,config.imageSize);output2=`
105          <div data-type-articles>
106            <p class="h6 predictive__label">${theme.strings.searchArticles}</p>
107            <div class="grid grid--uniform grid--no-gutters">
108              ${markup}
109            </div>
110          </div>
111        `}return output2}function buildOutput(data){var output2="";return data.products&&data.products!==""&&(output2+=data.products),data.collections&&data.collections!==""&&(output2+=data.collections),data.pages&&data.pages!==""&&(output2+=data.pages),data.articles&&data.articles!==""&&(output2+=data.articles),output2}function _normalizeQuery(string){return typeof string!="string"?null:string.trim().replace(/\ /g,"-").toLowerCase()}function paramUrl(obj){return Object.keys(obj).map(function(key){return key+"="+encodeURIComponent(obj[key])}).join("&")}return{init}})(),theme.HeaderCart=(function(){var selectors={cartTrigger:"#HeaderCartTrigger",cart:"#HeaderCart",closeBtn:".js-close-header-cart",noteBtn:".add-note"},classes={hidden:"hide"},config={cartOpen:!1,namespace:".cart-header"};function HeaderCart(){this.wrapper=document.querySelector(selectors.cart),this.wrapper&&(this.trigger=document.querySelector(selectors.cartTrigger),this.noteBtn=this.wrapper.querySelector(selectors.noteBtn),this.form=this.wrapper.querySelector("form"),document.addEventListener("MobileNav:open",this.close.bind(this)),document.addEventListener("modalOpen",this.close.bind(this)),this.init())}return HeaderCart.prototype=Object.assign({},HeaderCart.prototype,{init:function(){this.cartForm=new theme.CartForm(this.form),this.quickAdd=new theme.QuickAdd(this.wrapper),this.quickShop=new theme.QuickShop(this.wrapper),this.cartForm.buildCart(),$(".mini-cart").on("click",this.open.bind(this)),document.querySelectorAll(selectors.closeBtn).forEach(btn=>{btn.addEventListener("click",function(){this.close()}.bind(this))}),this.noteBtn&&this.noteBtn.addEventListener("click",function(){this.noteBtn.classList.toggle("is-active"),this.wrapper.querySelector(".cart__note").
111classList.toggle("hide")}.bind(this)),document.addEventListener("cart:open",this.open.bind(this)),document.addEventListener("cart:close",this.close.bind(this))},open:function(evt){$(".sticky-filters").addClass("d-none"),$(".box-cart-main").addClass("hide-floating"),$("#main-class").addClass("hide-banner"),theme.settings.cartType==="dropdown"&&($(".site-header__drawer-animate").hasClass("is-empty")?setTimeout(()=>{$($(".listing-empty-cart a")[0]).focus()},2e3):setTimeout(()=>{$("#title-price-minicart").focus()},0),evt&&evt.preventDefault(),theme.sizeDrawer(),theme.utils.prepareTransition(this.wrapper,function(){this.wrapper.classList.add("is-active"),$("#HeaderCart").addClass("is-cart-open"),this.wrapper.scrollTop=0}.bind(this)),document.documentElement.classList.add("cart-open"),(storeUrl.includes("bok-hashi.myshopify.com")||storeUrl.includes("btq-hashi.myshopify.com"))&&($("body").addClass("no-scroll"),window.screen.width<900&&$("body").css({overflowY:"hidden"})),!theme.config.bpSmall&&theme.settings.overlayHeader&&theme.a11y.lockMobileScrolling(config.namespace),window.on("keyup"+config.namespace,function(evt2){evt2.keyCode===27&&this.close()}.bind(this)),theme.headerNav.removeOverlayClass(),document.dispatchEvent(new CustomEvent("CartDrawer:open")),document.dispatchEvent(new CustomEvent("drawerOpen")),setTimeout(function(){window.on("click"+config.namespace,function(evt2){let clickedElement=evt2.target;var parentElement=clickedElement.parentElement;!parentElement.classList.contains("sn-close-noty")&&clickedElement.tagName!=="svg"&&clickedElement.tagName!=="line"&&clickedElement.tagName!=="a"&&clickedElement.tagName!=="A"&&this.close(evt2)}.bind(this))}.bind(this),0),updateCartItems(null),config.cartOpen=!0)},close:function(evt){$(".sticky-filters").removeClass("d-none"),$("#main-class").removeClass("hide-banner"),theme.settings.cartType==="dropdown"&&(evt&&evt.target&&typeof evt.target.closest=="function"&&evt.target.closest(".quick-add-btn")&&$("#HeaderCart").hasClass("is-active")||evt&&evt.target.closest&&evt.target.closest(".site-header__cart")||evt&&evt.target.closest&&evt.target.closest(".cart-items-new")||(evt&&evt.target.closest&&(evt.target.closest(".js-qty__adjust--minus")||evt.target.closest(".adjust js-qty__adjust--plus"))?$(".box-cart-main").addClass("hide-floating"):$(".box-cart-main").removeClass("hide-floating hide-floating-new"),config.cartOpen&&(evt&&evt.type==="MobileNav:open"?this.wrapper.classList.remove("is-active"):theme.utils.prepareTransition(this.wrapper,function(){this.wrapper.classList.remove("is-active"),$("#HeaderCart").removeClass("is-cart-open")}.bind(this)),window.off("keyup"+config.namespace),window.off("click"+config.namespace),!theme.config.bpSmall&&theme.settings.overlayHeader&&theme.a11y.unlockMobileScrolling(config.namespace),document.documentElement.classList.remove("cart-open"),(storeUrl.includes("bok-hashi.myshopify.com")||storeUrl.includes("btq-hashi.myshopify.com"))&&($("body").removeClass("no-scroll"),$("body").css({overflowY:"auto"})),config.cartOpen=!1)))}}),document.addEventListener("ajaxProduct:added",async function(evt){var headerCartInstance=new theme.HeaderCart;if(headerCartInstance.cartForm.buildCart(),!config.cartOpen&&(headerCartInstance.open(),checkDateForAdventProduct())){let productIds=(await theme.cart.getCart()).items.map(item=>item.variant_id);var preOrderExists=!1,PreOrderProductId=[],uniqueProductIds=[];$(".cart__item").each(function(i,itemEl){var tags=$(itemEl).attr("data-tags");if(tags){var tagArr=tags.split(",");tagArr.includes("preorder")&&PreOrderProductId.push($(itemEl).attr("data-variant-id"));const productIdArray=PreOrderProductId.map(str=>parseInt(str));productIdArray.length>0&&(uniqueProductIds=productIds.filter(id=>!productIdArray.includes(id)));var isPreOrderInCart2=tagArr.filter(function(tag){return tag=="preorder"});isPreOrderInCart2.length>0?preOrderExists=!0:preOrderExists=!1}}),uniqueProductIds.length>0&&removeItems(uniqueProductIds,null)}headerCartInstance.cartForm.cartItemsUpdated&&(headerCartInstance.cartForm.cartItemsUpdated=!1)}),HeaderCart})();const focusTrapDiv=document.querySelector(".customer-cart");focusTrapDiv&&focusTrapDiv.addEventListener("keydown",function(event){if(event.key==="Tab"&&!event.shiftKey){const focusableElements=focusTrapDiv.querySelectorAll('button:not(:disabled), h1, h2, h3, h4, h5, h6, [href], a, input, select, textarea, [tabindex]:not
111([tabindex="-1"])');var firstFocusableElement=focusableElements[0],lastFocusableElement=focusableElements[focusableElements.length-1];lastelementCustomersection=lastFocusableElement,document.activeElement===lastFocusableElement&&(event.preventDefault(),setTimeout(function(){$(".customer-loved-heading h3").focus()},0))}event.shiftKey&&event.keyCode==9&&document.activeElement===firstFocusableElement&&(event.preventDefault(),setTimeout(function(){$($(".js-close-header-cart")[0]).focus()},0))});const focusCustomerLovedSection=document.querySelector(".customer-loved");focusCustomerLovedSection&&focusCustomerLovedSection.addEventListener("keydown",function(event){if(event.key==="Tab"){const focusableElements=focusCustomerLovedSection.querySelectorAll('button, h1, h2, h3, h4, h5, h6, [href], a, [tabindex]:not([tabindex="-1"])'),firstFocusableElement=focusableElements[0],lastFocusableElement=focusableElements[focusableElements.length-1];event.shiftKey?document.activeElement===firstFocusableElement&&(event.preventDefault(),setTimeout(function(){lastelementCustomersection.focus()},0)):document.activeElement===lastFocusableElement&&(event.preventDefault(),setTimeout(function(){$("#close-cart-btn").focus()},0))}});const focusQuickModal=document.querySelector(".quick-shop-modal-focus");focusQuickModal&&focusQuickModal.addEventListener("keydown",function(event){if(event.key==="Tab"){const focusableElements=focusQuickModal.querySelectorAll('button, h1, h2, h3, h4, h5, h6, [href], a, [tabindex]:not([tabindex="-1"])'),firstFocusableElement=focusableElements[0],lastFocusableElement=focusableElements[focusableElements.length-1];event.shiftKey?document.activeElement===firstFocusableElement&&(event.preventDefault(),setTimeout(function(){lastFocusableElement.focus()},0)):document.activeElement===lastFocusableElement&&(event.preventDefault(),console.log("lastFocusableElement",lastFocusableElement),setTimeout(function(){firstFocusableElement.focus()},0))}}),$("#close-cart-btn").on("keydown",function(){setTimeout(()=>{$("#title-price-minicart").focus()},0)}),$(".eligibal-text").on("focus",function(){setTimeout(()=>{$("#buttonid").focus()},3e3)}),$(".section-header--with-link a").keydown(function(event){event.keyCode==32&&$(".section-header--with-link a:focus")&&(window.location=$(".section-header--with-link a:focus").attr("href"),event.preventDefault())}),$(".grid-item__link").keydown(function(event){event.keyCode==32&&$(".grid-item__link:focus")&&(window.location=$(".grid-item__link:focus").attr("href"))}),$(".user-auth-icon a").keydown(function(event){event.keyCode==32&&$(".user-auth-icon a:focus")&&(window.location=$(".user-auth-icon a:focus").attr("href"),event.preventDefault())}),$(".section-header__title a").keydown(function(event){if(event.keyCode==32&&$(".section-header__title a:focus"))return window.location=$(".section-header__title a:focus").attr("href"),event.preventDefault(),!1}),$(".grid-product__actions button").on("focus",function(event){}),$(".grid-product__actions button").on("blur",function(event){$(event.currentTarget).parent().css("opacity",0)}),$(".grid-item__content").on("mouseover",function(event){$($(event.currentTarget).find(".grid-product__actions")[0]).css("opacity",1)}),$(".grid-item__content").on("mouseout",function(event){$($(event.currentTarget).find(".grid-product__actions")[0]).css("opacity",0)});let zoom=(window.outerWidth-10)/window.innerWidth*100;$(".main-menu-item").on("mouseover",function(event){!isMobile()&&zoom<175&&$($(event.currentTarget).find(".listing-hovered-items")[0]).css({opacity:1,visibility:"visible"})}),$(".main-menu-item").on("mouseout",function(event){!isMobile()&&zoom<175&&$($(event.currentTarget).find(".listing-hovered-items")[0]).css({opacity:0,visibility:"hidden"})}),$(".main-menu-item .listing-hovered-items ul li:last-child a").on("keydown",function(event){console.log($(event.currentTarget).parents(".listing-hovered-items")),!isMobile()&&zoom<175&&(event.keyCode==9&&!event.shiftKey||event.key=="ArrowRight"||event.key=="ArrowDown")&&$(event.currentTarget).parents(".listing-hovered-items").css({opacity:0,visibility:"hidden"})}),$(".main-menu-item .new-menu-item a").on("keydown",function(event){(event.keyCode==9&&event.shiftKey||event.key=="ArrowLeft"||event.key=="ArrowUp")&&!isMobile()&&zoom<175&&($(event.currentTarget).parent().next().css({opacity:0,visibility:"hidden"}),setTimeout(()=>{$(".main-menu-item .listing-hovered-items ul li:last-child a").focus()},1e3))}),$(".site-nav__item a").on("keydown",function(event){event.keyCode==32&&$(".site-nav__item a:focus")&&(setTimeout(()=>(window.location=$(".site-nav__item a:focus").attr("href"),!1),0),event.preventDefault())}),$(".site-header__logo-link").on("keydown",function(event){event.keyCode==32&&$(".site-header__logo-link:focus")&&(window.location=$(".site-header__logo-link:focus").attr("href"),event.preventDefault())}),theme.QuickAdd=(function(){var selectors={quickAddBtn:".js-quick-add-btn",quickAddForm:".js-quick-add-form",quickAddHolder:"#QuickAddHolder"},modalInitailized=!1,modal;function QuickAdd(container){container&&theme.settings.quickAdd&&(this.container=container,this.init())}return QuickAdd.prototype=Object.assign({},QuickAdd.prototype,{init:function(){try{var quickAddBtns=this.container.querySelectorAll(selectors.quickAddBtn)}catch{var quickAddBtns=document.querySelectorAll(".shopify-reco-cart-add .js-quick-add-btn");if(console.log("quick add buttons ",quickAddBtns),quickAddBtns){quickAddBtns.forEach(btn=>{btn.addEventListener("click",this.addToCart.bind(this))});return}}var quickAddForms=this.container.querySelectorAll(selectors.quickAddForm);quickAddForms.length&&(this.quickAddHolder=document.querySelector(selectors.quickAddHolder),modalInitailized||(modal=new theme.Modals("QuickAddModal","quick-add"),modalInitailized=!0,document.addEventListener("modalClose.QuickAddModal",function(){setTimeout(function(){this.quickAddHolder.innerHTML=""}.bind(this),350)}
111.bind(this))),quickAddForms.forEach(btn=>{btn.addEventListener("click",this.loadQuickAddForm.bind(this))}))},addToCart:function(evt){evt.preventDefault();var btn=evt.currentTarget;$(".quick-add-btn").addClass("cart-btn-disabled");var visibleBtn=btn.querySelector(".btn"),id=btn.dataset.id;let variantId=$(btn).attr("data-variant-id");var data={items:[{id,quantity:1}]};fetch(theme.routes.cartAdd,{method:"POST",body:JSON.stringify(data),credentials:"same-origin",headers:{"Content-Type":"application/json"}}).then(response=>response.json()).then(function(data2){if(!(data2.status===422||data2.status==="bad_request")){setTimeout(function(){$(".quick-add-btn").removeClass("cart-btn-disabled")},1200),HideCALSection();var product=data2;console.log("6666"+product),$(".box-cart-main").addClass("hide-floating"),document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product,addToCartBtn:btn}})),freeGiftCertificateWith4TiersFeatureOn&&add4TiersFreeGiftCertificate()}}.bind(this))},loadQuickAddForm:function(evt){this.quickAddHolder.innerHTML="";var btn=evt.currentTarget,gridItem=evt.currentTarget.closest(".grid-product"),handle=gridItem.getAttribute("data-product-handle"),prodId=gridItem.getAttribute("data-product-id"),url=theme.routes.home+"/products/"+handle+"?view=form";url=url.replace("//","/"),fetch(url).then(function(response){return response.text()}).then(function(html){var parser=new DOMParser,doc=parser.parseFromString(html,"text/html"),div=doc.querySelector('.product-section[data-product-handle="'+handle+'"]');this.quickAddHolder.append(div),theme.sections.register("product",theme.Product,this.quickAddHolder),Shopify&&Shopify.PaymentButton&&Shopify.PaymentButton.init(),window.dispatchEvent(new CustomEvent("quickadd:loaded:"+prodId)),document.dispatchEvent(new CustomEvent("quickadd:loaded",{detail:{productId:prodId,handle}})),modal.open()}.bind(this))}}),QuickAdd})(),theme.QuickShop=(function(){var loadedIds=[],selectors={product:".grid-product",triggers:".quick-product__btn",modalContainer:"#ProductModals"};function QuickShop(container){theme.settings.quickView&&(this.container=container,this.init())}function getData(el){return{id:el.dataset.productId,handle:el.dataset.productHandle,preorder:el.dataset.preorder}}function productMouseover(evt){var el=evt.currentTarget;if($(".main-loved-pro:last-child .plus-icon-loved #cart-button:focus"),!theme.config.bpSmall&&!(!el||!el.dataset.productId)){var data=getData(el);el.removeEventListener("mouseover",productMouseover),el.removeEventListener("focusin",productMouseover),preloadProductModal(data)}}function preloadProductModal(data){var modals=document.querySelectorAll('.modal--quick-shop[data-product-id="'+data.id+'"]');if(modals.length){if(loadedIds.indexOf(data.id)>-1)removeDuplicateModals(modals),enableTriggers(data);else{moveModal(modals);var holder=document.getElementById("QuickShopHolder-"+data.handle),url=theme.routes.home+"/products/"+data.handle+"?view=modal";url=url.replace("//","/"),fetch(url).then(response=>response.text()).then(text=>{const html=document.createElement("div");html.innerHTML=text;const div=html.querySelector('.product-section[data-product-handle="'+data.handle+'"]');holder&&(holder.append(div),theme.sections.register("product",theme.Product,holder),theme.collapsibles.init(),theme.videoModal(),enableTriggers(data))}).catch(e=>{console.error(e)})}loadedIds.push(data.id)}}function moveModal(modals){var el=modals[0];if(el){modals.length>1&&modals.forEach(function(m,i){i>0&&m.remove()});var container=document.querySelector(selectors.modalContainer);container.appendChild(el)}}function removeDuplicateModals(modals){modals.length>1&&modals.forEach(function(m,i){m.closest("#ProductModals")||m.remove()})}function enableTriggers(data){var modalId="QuickShopModal-"+data.id,name="quick-modal-"+data.id;new theme.Modals(modalId,name);var triggers=document.querySelectorAll(selectors.triggers+'[data-handle="'+data.handle+'"]');triggers.length&&triggers.forEach(trigger=>
111{trigger.classList.remove("quick-product__btn--not-ready")})}return QuickShop.prototype=Object.assign({},QuickShop.prototype,{init:function(){try{var products=this.container.querySelectorAll(selectors.product);if(!products.length)return;products.forEach(product=>{product.addEventListener("mouseover",productMouseover),product.addEventListener("focusin",productMouseover)})}catch{var products=document.querySelectorAll(".shopify-reco-cart-add .grid-product");return products.forEach(product=>{product.addEventListener("mouseover",productMouseover),product.addEventListener("focusin",productMouseover)}),QuickShop}}}),QuickShop})(),theme.buildProductGridItem=function(items,imageSize){var output2="";let filteredArr=items.filter(res=>res.type!="Subscription Box"&&res.type!="Gift Box"&&res.type!="Corporate Box");return filteredArr.length?filteredArr.map(product=>{var image=theme.buildProductImage(product,imageSize);$(".text-center.predictive-results__footer").show();var markup=`
112          <div class="grid-item grid-product">
113            <div class="grid-item__content">
114              <a href="${product.url}" class="grid-item__link">
115                <div class="grid-product__image-wrap">
116                  ${image}
117                </div>
118                <div class="grid-item__meta">
119                  <div class="grid-product__title">${product.title}</div>
120                </div>
121              </a>
122            </div>
123          </div>
124        `;output2+=markup}):$(".text-center.predictive-results__footer").hide(),output2},theme.buildProductImage=function(product,imageSize){var size=imageSize||theme.settings.productImageSize,output2="";if(size==="natural")output2=`
125        <div class="image-wrap" style="height: 0; padding-bottom: ${product.image_aspect_ratio}%;">
126          <img class="grid-product__image lazyload"
127            data-src="${product.image_responsive_url}"
128            data-widths="[180, 360, 540, 720, 900]"
129            data-aspectratio="${product.image_aspect_ratio}"
130            data-sizes="auto"
131            alt="${product.title}">
132        </div>`;else{var classes="lazyload";theme.settings.productImageCover||(classes+=" grid__image-contain"),output2=`
133        <div class="grid__image-ratio grid__image-ratio--${size}">
134          <img class="${classes}"
135              data-src="${product.image_responsive_url}"
136              data-widths="[360, 540, 720, 900, 1080]"
137              data-aspectratio="${product.aspect_ratio}"
138              data-sizes="auto"
139              alt="${product.title}">
140        </div>
141      `}return output2},theme.buildCollectionItem=function(items){var output2="";return items.forEach(collection=>{var markup=`
142        <li>
143          <a href="${collection.url}">
144            ${collection.title}
145          </a>
146        </li>
147      `;output2+=markup}),output2},theme.buildPageItem=function(items){var output2="";return items.forEach(page=>{var markup=`
148        <li>
149          <a href="${page.url}">
150            ${page.title}
151          </a>
152        </li>
153      `;output2+=markup}),output2},theme.buildArticleItem=function(items,imageSize){var output2="";return items.forEach(article=>{var image=theme.buildPredictiveImage(article),markup=`
154        <div class="grid__item small--one-half medium-up--one-quarter">
155          <a href="${article.url}" class="grid-item__link grid-item__link--inline">
156            <div class="grid-product__image-wrap">
157              <div
158                class="grid__image-ratio grid__image-ratio--object grid__image-ratio--${imageSize}">
159                <div class="predictive__image-wrap">
160                  ${image}
161                </div>
162              </div>
163            </div>
164            <div class="grid-item__meta">
165              ${article.title}
166            </div>
167          </a>
168        </div>
169      `;output2+=markup}),output2},theme.buildPredictiveImage=function(obj){var imageMarkup="";return obj.image&&(imageMarkup=`<img class="lazyload"
170            data-src="${obj.image}"
171            data-widths="[360, 540, 720]"
172            data-sizes="auto">`),imageMarkup},theme.animationObserver=function(){var els=document.querySelectorAll(".animation-contents");
172els.forEach(el=>{var observer2=new IntersectionObserver((entries,observer3)=>{entries.forEach(entry=>{entry.isIntersecting&&(entry.target.classList.add("is-visible"),observer3.unobserve(entry.target))})},{threshold:1});observer2.observe(el)})},theme.Photoswipe=(function(){var selectors={trigger:".js-photoswipe__zoom",images:".photoswipe__image",slideshowTrack:".flickity-viewport ",activeImage:".is-selected"};function Photoswipe(container,sectionId){this.container=container,this.sectionId=sectionId,this.namespace=".photoswipe-"+this.sectionId,this.gallery,this.images,this.items,this.inSlideshow=!1,!(!container||container.dataset.zoom==="false")&&this.init()}return Photoswipe.prototype=Object.assign({},Photoswipe.prototype,{init:function(){this.container.querySelectorAll(selectors.trigger).forEach(trigger=>{trigger.on("click"+this.namespace,this.triggerClick.bind(this))})},triggerClick:function(evt){this.container.dataset&&this.container.dataset.hasSlideshow==="true"?this.inSlideshow=!0:this.inSlideshow=!1,this.items=this.getImageData();var image=this.inSlideshow?this.container.querySelector(selectors.activeImage):evt.currentTarget,index=this.inSlideshow?this.getChildIndex(image):image.dataset.index;this.initGallery(this.items,index)},getChildIndex:function(el){for(var i=0;(el=el.previousSibling)!=null;)i++;return i+1},getImageData:function(){this.images=this.inSlideshow?this.container.querySelectorAll(selectors.slideshowTrack+selectors.images):this.container.querySelectorAll(selectors.images);var items=[],options={};return this.images.forEach(el=>{var item={msrc:el.currentSrc||el.src,src:el.getAttribute("data-photoswipe-src"),w:el.getAttribute("data-photoswipe-width"),h:el.getAttribute("data-photoswipe-height"),el,initialZoomLevel:.5};items.push(item)}),items},initGallery:function(items,index){var pswpElement=document.querySelectorAll(".pswp")[0],options={allowPanToNext:!1,captionEl:!1,closeOnScroll:!1,counterEl:!1,history:!1,index:index-1,pinchToClose:!1,preloaderEl:!1,scaleMode:"zoom",shareEl:!1,tapToToggleControls:!1,getThumbBoundsFn:function(index2){var pageYScroll=window.pageYOffset||document.documentElement.scrollTop,thumbnail=items[index2].el,rect=thumbnail.getBoundingClientRect();return{x:rect.left,y:rect.top+pageYScroll,w:rect.width}}};this.gallery=new PhotoSwipe(pswpElement,PhotoSwipeUI_Default,items,options),this.gallery.listen("afterChange",this.afterChange.bind(this)),this.gallery.init(),this.preventiOS15Scrolling()},afterChange:function(){var index=this.gallery.getCurrentIndex();this.container.dispatchEvent(new CustomEvent("photoswipe:afterChange",{detail:{index}}))},syncHeight:function(){document.documentElement.style.setProperty("--window-inner-height",`${window.innerHeight}px`)},preventiOS15Scrolling:function(){let initialScrollPos;/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&(this.syncHeight(),initialScrollPos=window.scrollY,document.documentElement.classList.add("pswp-open-in-ios"),window.addEventListener("resize",this.syncHeight),this.gallery.listen("destroy",()=>{document.documentElement.classList.remove("pswp-open-in-ios"),window.scrollTo(0,initialScrollPos)}))}}),Photoswipe})(),theme.StoreAvailability=(function(){var selectors={drawerOpenBtn:".js-drawer-open-availability",modalOpenBtn:".js-modal-open-availability",productTitle:"[data-availability-product-title]"};function StoreAvailability(container){this.container=container,this.baseUrl=container.dataset.baseUrl,this.productTitle=container.dataset.productName}return StoreAvailability.prototype=Object.assign({},StoreAvailability.prototype,{updateContent:function(variantId){var variantSectionUrl=this.baseUrl+"/variants/"+variantId+"/?section_id=store-availability",self2=this;fetch(variantSectionUrl).then(function(response){return response.text()}).then(function(html){if(html.trim()===""){this.container.innerHTML="";return}self2.container.innerHTML=html,self2.container.innerHTML=self2.container.firstElementChild.innerHTML,self2.container.querySelector(selectors.drawerOpenBtn)&&(self2.drawer=new theme.Drawers("StoreAvailabilityDrawer","availability")),self2.container.querySelector(selectors.modalOpenBtn)&&(self2.modal=new theme.Modals("StoreAvailabilityModal","availability"));var title=self2.container.querySelector(selectors.productTitle);title&&(title.textContent=self2.productTitle)})}}),StoreAvailability})();class HotSpots extends HTMLElement{constructor(){super(),this.el=this,this.buttons=this.querySelectorAll("[data-button]"),this.hotspotBlocks=this.querySelectorAll("[data-hotspot-block]"),this.blockContainer=this.querySelector("[data-block-container]"),this.colorImages=this.querySelectorAll(".grid-product__color-image"),this.colorSwatches=this.querySelectorAll(".color-swatch--with-image"),this._bindEvents(),this._setupQuickShop(),this.colorImages.length&&this._colorSwatchHovering()}
172_colorSwatchHovering(){this.colorSwatches.forEach(swatch=>{swatch.addEventListener("mouseenter",function(){this._setActiveColorImage(swatch)}.bind(this)),swatch.addEventListener("touchstart",function(evt){evt.preventDefault(),this._setActiveColorImage(swatch)}.bind(this),{passive:!0}),swatch.addEventListener("mouseleave",function(){this._removeActiveColorImage(swatch)}.bind(this))})}_setActiveColorImage(swatch){var id=swatch.dataset.variantId,image=swatch.dataset.variantImage;this.colorImages.forEach(el=>{el.classList.remove("is-active")}),this.colorSwatches.forEach(el=>{el.classList.remove("is-active")});var imageEl=this.el.querySelector(".grid-product__color-image--"+id);imageEl.style.backgroundImage="url("+image+")",imageEl.classList.add("is-active"),swatch.classList.add("is-active");var variantUrl=swatch.dataset.url,gridItem=swatch.closest(".grid-item__link");gridItem&&gridItem.setAttribute("href",variantUrl)}_removeActiveColorImage(swatch){const id=swatch.dataset.variantId;this.querySelector(`.grid-product__color-image--${id}`).classList.remove("is-active")}_bindEvents(){this.buttons.forEach(button=>{const id=button.dataset.button;button.on("click",e=>{e.preventDefault(),e.stopPropagation(),this._showContent(id)})}),document.addEventListener("shopify:block:select",e=>{const blockId=e.detail.blockId;this._showContent(`${blockId}`)})}_showContent(id){this.hotspotBlocks.forEach(block=>{block.dataset.hotspotBlock===id?block.classList.add("is-active"):block.classList.remove("is-active")})}_setupQuickShop(){this.querySelectorAll('[data-block-type="product"]').length>0&&(typeof theme.QuickShop=="function"?new theme.QuickShop(this.blockContainer):typeof theme.initQuickShop=="function"&&theme.initQuickShop(),typeof theme.QuickAdd=="function"&&new theme.QuickAdd(this.blockContainer))}}if(customElements.define("hot-spots",HotSpots),theme.FooterSection=(function(){var selectors={locale:"[data-disclosure-locale]",currency:"[data-disclosure-currency]"},ids={mobileNav:"MobileNav",footerNavWrap:"FooterMobileNavWrap",footerNav:"FooterMobileNav"};function FooterSection(container){this.container=container,this.localeDisclosure=null,this.currencyDisclosure=null,theme.initWhenVisible({element:this.container,callback:this.init.bind(this),threshold:1e3})}return FooterSection.prototype=Object.assign({},FooterSection.prototype,{init:function(){var localeEl=this.container.querySelector(selectors.locale),currencyEl=this.container.querySelector(selectors.currency);localeEl&&(this.localeDisclosure=new theme.Disclosure(localeEl)),currencyEl&&(this.currencyDisclosure=new theme.Disclosure(currencyEl)),theme.config.bpSmall&&this.initDoubleMobileNav(),theme.collapsibles.init(this.container)},initDoubleMobileNav:function(){var menuPlaceholder=document.getElementById(ids.footerNavWrap);if(menuPlaceholder){var mobileNav=document.getElementById(ids.mobileNav),footerNav=document.getElementById(ids.footerNav),clone=mobileNav.cloneNode(!0),navEl=clone.querySelector(".slide-nav__wrapper");footerNav.appendChild(navEl),new theme.MobileNav({id:ids.footerNav,inHeader:!1}),menuPlaceholder.classList.remove("hide")}},onUnload:function(){this.localeDisclosure&&this.localeDisclosure.destroy(),this.currencyDisclosure&&this.currencyDisclosure.destroy()}}),FooterSection})(),theme.HeaderSection=(function(){var selectors={headerFooter:"#MobileNavFooter",footerMenus:"#FooterMenus"},namespace=".header";function HeaderSection(container){this.container=container,this.sectionId=this.container.getAttribute("data-section-id"),this.init()}return HeaderSection.prototype=Object.assign({},HeaderSection.prototype,{init:function(){Shopify&&Shopify.designMode&&(theme.sections.reinit("slideshow-section"),setTimeout(function(){window.dispatchEvent(new Event("resize"))},500)),theme.headerNav.init(),theme.announcementBar.init(),theme.headerSearch.init(),this.hoverMenu(),document.body.classList.contains("template-cart")||new theme.HeaderCart,new theme.MobileNav({id:"MobileNav",inHeader:!0}),theme.config.bpSmall&&this.cloneFooter(),window.on("resize"+namespace,theme.utils.debounce(300,theme.sizeDrawer))},hoverMenu:function(){document.querySelectorAll('[data-section-type="header"] details[data-hover="true"]').forEach(detail=>{const summary=detail.querySelector("summary"),summaryLink=summary.dataset.link;summary.setAttribute("aria-expanded",detail.open?"true":"false"),detail.addEventListener("toggle",()=>{summary.setAttribute("aria-expanded",detail.open?"true":"false")}),summary.addEventListener("click",e=>{e.detail!==0&&(e.preventDefault(),summaryLink&&(window.location.href=summaryLink))}),detail.addEventListener("mouseover",()=>{detail.hasAttribute("open")||detail.setAttribute("open","")}),detail.addEventListener("mouseleave",()=>{detail.hasAttribute("open")&&!detail.contains(document.activeElement)&&detail.removeAttribute("open")}),detail.addEventListener("keydown",e=>{e.key==="Escape"&&detail.hasAttribute("open")&&(detail.removeAttribute("open"),summary.focus())})})},cloneFooter:function(){var headerFooter=document.querySelector(selectors.headerFooter);if(headerFooter){var footerMenus=document.querySelector(selectors.footerMenus),clone=footerMenus.cloneNode(!0);clone.id="",headerFooter.appendChild(clone);var localizationForm=headerFooter.querySelector(".multi-selectors");localizationForm&&localizationForm.querySelectorAll("[data-disclosure-toggle]").forEach(el=>{var controls=el.getAttribute("aria-controls"),describedby=el.getAttribute("aria-describedby");el.setAttribute("aria-controls",controls+"-header"),el.setAttribute("aria-describedby",describedby+"-header");var list=document.getElementById(controls);list&&(list.id=controls+"-header");var label=document.getElementById(describedby);label&&(label.id=describedby+"-header");var parent=el.parentNode;parent&&new theme.Disclosure(parent)})}},onUnload:function(){}}),HeaderSection})(),theme.Product=(function(){var videoObjects={},classes={onSale:"on-sale",disabled:"disabled",isModal:"is-modal",loading:"loading",loaded:"loaded",hidden:"hide",interactable:"video-interactable",visuallyHide:"visually-invisible"},selectors={productVideo:".product__video",videoParent:".product__video-wrapper",slide:".product-main-slide",currentSlide:".is-selected",startingSlide:".starting-slide",variantType:".variant-wrapper",blocks:"[data-product-blocks]",blocksHolder:"[data-blocks-holder]",dynamicVariantsEnabled:"[data-dynamic-variants-enabled]"};function Product(container){this.container=container;var sectionId=this.sectionId=container.getAttribute("data-section-id"),productId=this.productId=container.getAttribute("data-product-id");this.inModal=container.dataset.modal==="true",this.modal,this.settings={enableHistoryState:container.dataset.history==="true"||!1,namespace:".product-"+sectionId,inventory:!1,inventoryThreshold:10,modalInit:!1,hasImages:!0,imageSetName:null,imageSetIndex:null,currentImageSet:null,imageSize:"620x",currentSlideIndex:0,videoLooping:container.dataset.videoLooping},this.inModal&&(this.settings.enableHistoryState=!1,this.settings.namespace=".product-"+sectionId+"-modal",this.modal=document.getElementById("QuickShopModal-"+productId)),this.selectors={variantsJson:"[data-variant-json]",currentVariantJson:"[data-current-variant-json]",form:".product-single__form",media:"[data-product-media-type-model]",closeMedia:".product-single__close-media",photoThumbs:"[data-product-thumb]",thumbSlider:"[data-product-thumbs]",thumbScroller:".product__thumbs--scroller",mainSlider:"[data-product-photos]",imageContainer:"[data-product-images]",productImageMain:"[data-product-image-main]",priceWrapper:"[data-product-price-wrap]",price:"[data-product-price]",comparePrice:"[data-compare-price]",savePrice:"[data-save-price]",priceA
17211y:"[data-a11y-price]",comparePriceA11y:"[data-compare-price-a11y]",unitWrapper:"[data-unit-price-wrapper]",unitPrice:"[data-unit-price]",unitPriceBaseUnit:"[data-unit-base]",sku:"[data-sku]",inventory:"[data-product-inventory]",incomingInventory:"[data-incoming-inventory]",colorLabel:"[data-variant-color-label]",addToCart:"[data-add-to-cart]",addToCartText:"[data-add-to-cart-text]",originalSelectorId:"[data-product-select]",singleOptionSelector:"[data-variant-input]",variantColorSwatch:".variant__input--color-swatch",availabilityContainer:"[data-store-availability-holder]"},this.cacheElements();try{this.firstProductImage=this.cache.mainSlider.querySelector("img")}catch{}this.firstProductImage||(this.settings.hasImages=!1);try{var dataSetEl=this.cache.mainSlider.querySelector("[data-set-name]")}catch{}dataSetEl&&(this.settings.imageSetName=dataSetEl.dataset.setName),this.init()}return Product.prototype=Object.assign({},Product.prototype,{init:function(){this.inModal&&(this.container.classList.add(classes.isModal),document.addEventListener("modalOpen.QuickShopModal-"+this.productId,this.openModalProduct.bind(this)),document.addEventListener("modalClose.QuickShopModal-"+this.productId,this.closeModalProduct.bind(this))),this.inModal||(this.formSetup(),this.productSetup(),this.videoSetup(),this.initProductSlider(),this.customMediaListners(),this.addIdToRecentlyViewed()),window.off("quickadd:loaded:"+this.sectionId),window.on("quickadd:loaded:"+this.sectionId,this.initQuickAddForm.bind(this))},cacheElements:function(){this.cache={form:this.container.querySelector(this.selectors.form),mainSlider:this.container.querySelector(this.selectors.mainSlider),thumbSlider:this.container.querySelector(this.selectors.thumbSlider),thumbScroller:this.container.querySelector(this.selectors.thumbScroller),productImageMain:this.container.querySelector(this.selectors.productImageMain),priceWrapper:this.container.querySelector(this.selectors.priceWrapper),comparePriceA11y:this.container.querySelector(this.selectors.comparePriceA11y),comparePrice:this.container.querySelector(this.selectors.comparePrice),price:this.container.querySelector(this.selectors.price),savePrice:this.container.querySelector(this.selectors.savePrice),priceA11y:this.container.querySelector(this.selectors.priceA11y)}},formSetup:function(){this.initQtySelector(),this.initAjaxProductForm(),this.availabilitySetup(),this.initVariants(),this.settings.imageSetName&&this.updateImageSet()},availabilitySetup:function(){var container=this.container.querySelector(this.selectors.availabilityContainer);container&&(this.storeAvailability=new theme.StoreAvailability(container))},productSetup:function(){this.setImageSizes(),this.initImageZoom(),this.initModelViewerLibraries(),this.initShopifyXrLaunch(),window.SPR&&(SPR.initDomEls(),SPR.loadBadges())},setImageSizes:function(){if(this.settings.hasImages){var currentImage=this.firstProductImage.currentSrc;currentImage&&(this.settings.imageSize=theme.Images.imageSize(currentImage))}},addIdToRecentlyViewed:async function(){var id=this.container.getAttribute("data-product-id");let checkZipcode=localStorage.getItem("zipcode");if(theme.settings.localization&&checkZipcode){let productInventory=await vendorInventories(id);if((productInventory.length>0&&productInventory[0]).isAvailable){if(!id)return;var i=theme.recentlyViewedIds.indexOf(id);i>-1&&theme.recentlyViewedIds.splice(i,1),theme.recentlyViewedIds.unshift(id),theme.config.hasLocalStorage&&window.localStorage.setItem("recently-viewed",JSON.stringify(theme.recentlyViewedIds))}}else{if(!id)return;var i=theme.recentlyViewedIds.indexOf(id);i>-1&&theme.recentlyViewedIds.splice(i,1),theme.recentlyViewedIds.unshift(id),theme.config.hasLocalStorage&&window.localStorage.setItem("recently-viewed",JSON.stringify(theme.recentlyViewedIds))}},initVariants:function(){var variantJson=this.container.querySelector(this.selectors.variantsJson);if(variantJson){this.variantsObject=JSON.parse(variantJson.innerHTML);var dynamicVariantsEnabled=!!this.container.querySelector(selectors.dynamicVariantsEnabled),options={container:this.container,enableHistoryState:this.settings.enableHistoryState,singleOptionSelector:this.selectors.singleOptionSelector,originalSelectorId:this.selectors.originalSelectorId,variants:this.variantsObject,dynamicVariantsEnabled},swatches=this.container.querySelectorAll(this.selectors.variantColorSwatch);
172if(swatches.length&&swatches.forEach(swatch=>{swatch.addEventListener("change",function(evt){var color=swatch.dataset.colorName,index=swatch.dataset.colorIndex;this.updateColorName(color,index)}.bind(this))}),this.variants=new theme.Variants(options),this.storeAvailability){var variant_id=this.variants.currentVariant?this.variants.currentVariant.id:this.variants.variants[0].id;this.storeAvailability.updateContent(variant_id),this.container.on("variantChange"+this.settings.namespace,this.updateAvailability.bind(this))}this.container.on("variantChange"+this.settings.namespace,this.updateCartButton.bind(this)),storeUrl=="sgm-hashi.myshopify.com"&&this.container.on("variantChange"+this.settings.namespace,this.updatedSelectedVariantStyle.bind(this)),this.container.on("variantImageChange"+this.settings.namespace,this.updateVariantImage.bind(this)),this.container.on("variantPriceChange"+this.settings.namespace,this.updatePrice.bind(this)),this.container.on("variantUnitPriceChange"+this.settings.namespace,this.updateUnitPrice.bind(this)),this.container.querySelectorAll(this.selectors.sku).length&&this.container.on("variantSKUChange"+this.settings.namespace,this.updateSku.bind(this));var inventoryEl=this.container.querySelector(this.selectors.inventory);if(inventoryEl&&(this.settings.inventory=!0,this.settings.inventoryThreshold=inventoryEl.dataset.threshold,this.container.on("variantChange"+this.settings.namespace,this.updateInventory.bind(this))),theme.settings.dynamicVariantsEnable){var currentVariantJson=this.container.querySelector(this.selectors.currentVariantJson);if(currentVariantJson){var variantType=this.container.querySelector(selectors.variantType);variantType&&new theme.VariantAvailability({container:this.container,namespace:this.settings.namespace,type:variantType.dataset.type,variantsObject:this.variantsObject,currentVariantObject:JSON.parse(currentVariantJson.innerHTML)})}}if(this.settings.imageSetName){var variantWrapper=this.container.querySelector('.variant-input-wrap[data-handle="'+this.settings.imageSetName+'"]');variantWrapper?(this.settings.imageSetIndex=variantWrapper.dataset.index,this.container.on("variantChange"+this.settings.namespace,this.updateImageSet.bind(this))):this.settings.imageSetName=null}}},initQtySelector:function(){this.container.querySelectorAll(".js-qty__wrapper").forEach(el=>{new theme.QtySelector(el,{namespace:".product"})})},initAjaxProductForm:function(){theme.settings.cartType==="dropdown"&&new theme.AjaxProduct(this.cache.form,".add-to-cart")},updateColorName:function(color,index){this.container.querySelector(this.selectors.colorLabel+`[data-index="${index}"`).textContent=color},updateCartButton:async function(evt){var variant=evt.detail.variant,cartBtn=this.container.querySelector(this.selectors.addToCart),quantityBtn=this.container.querySelector(".js-qty__wrapper"),isDatePassed=evt.detail.datePassed,isVisualVariant=evt.detail.visualVariant,adcVariant=evt.detail.adcVariant;let variantId=evt.detail.variantId;var cartBtnText=this.container.querySelector(this.selectors.addToCartText);if(cartBtn)if(variant)if(variant.available)if(isDatePassed=="true")cartBtn.classList.add(classes.disabled),cartBtn.disabled=!0,cartBtnText.textContent=theme.strings.soldOut;else{cartBtn.classList.remove(classes.disabled),cartBtn.disabled=!1;var defaultText=cartBtnText.dataset.defaultText;cartBtnText.textContent=defaultText}else cartBtn.classList.add(classes.disabled),cartBtn.disabled=!0,cartBtnText.textContent=theme.strings.soldOut;else if(cartBtn.classList.add(classes.disabled),cartBtn.disabled=!0,isVisualVariant=="true"&&isDatePassed=="true")quantityBtn.setAttribute("style","display:none"),cartBtn.setAttribute("style","display:block"),cartBtnText.textContent=theme.strings.soldOut;else if(isVisualVariant=="true"&&isDatePassed=="false")if(adcVariant=="true"){(await theme.cart.getCart()).items.find(items=>items.id==variantId)!=null&&(cartBtn.setAttribute("style","display:none"),quantityBtn.setAttribute("style","display:inline-block")),cartBtn.classList.remove(classes.disabled),cartBtn.disabled=!1,cartBtn.removeAttribute("disabled");var defaultText=cartBtnText.dataset.defaultText;cartBtnText.textContent=defaultText}else quantityBtn.setAttribute("style","display:none"),cartBtn.setAttribute("style","display:block"),cartBtn.classList.add(classes.disabled),c
172artBtn.disabled=!0,cartBtnText.textContent=theme.strings.soldOut;else cartBtnText.textContent=theme.strings.unavailable},updatePrice:function(evt){var variant=evt.detail.variant;if(variant&&variant.inventory_quantity===0?($(".product-floating-cta .add-to-cart").text("Sold Out"),$(".product-floating-cta .add-to-cart").css({pointerEvents:"none",opacity:"0.3"}),$(".product-floating-cta .add-to-cart").prop("disabled",!0)):($(".product-floating-cta .add-to-cart").text("Add to Cart"),$(".product-floating-cta .add-to-cart").css({pointerEvents:"inherit",opacity:"1"}),$(".product-floating-cta .add-to-cart").prop("disabled",!1),$(".product-floating-cta .add-to-cart").removeClass("disabled")),variant){if(this.cache.price||this.cacheElements(),this.cache.price.innerHTML=theme.Currency.formatMoney(variant.price,theme.settings.moneyFormat),variant.compare_at_price>variant.price){this.cache.comparePrice.innerHTML=theme.Currency.formatMoney(variant.compare_at_price,theme.settings.moneyFormat),this.cache.priceWrapper.classList.remove(classes.hidden),this.cache.price.classList.add(classes.onSale),this.cache.comparePriceA11y&&this.cache.comparePriceA11y.setAttribute("aria-hidden","false"),this.cache.priceA11y&&this.cache.priceA11y.setAttribute("aria-hidden","false");var savings=variant.compare_at_price-variant.price;theme.settings.saveType=="percent"?savings=Math.round(savings*100/variant.compare_at_price)+"%":savings=theme.Currency.formatMoney(savings,theme.settings.moneyFormat),this.cache.savePrice.classList.remove(classes.hidden),this.cache.savePrice.innerHTML=theme.strings.savePrice.replace("[saved_amount]",savings)}else this.cache.priceWrapper&&this.cache.priceWrapper.classList.add(classes.hidden),this.cache.savePrice.classList.add(classes.hidden),this.cache.price.classList.remove(classes.onSale),this.cache.comparePriceA11y&&this.cache.comparePriceA11y.setAttribute("aria-hidden","true"),this.cache.priceA11y&&this.cache.priceA11y.setAttribute("aria-hidden","true");let price=$(".product-single__meta .product-block--price").html();$(".product-floating-cta .product-block--price").html(""),$(".product-floating-cta .product-block--price").html(price),$(".product-floating-cta .add-to-cart").attr("data-variant-id",variant.id)}},updateUnitPrice:function(evt){var variant=evt.detail.variant;variant&&variant.unit_price?(this.container.querySelector(this.selectors.unitPrice).innerHTML=theme.Currency.formatMoney(variant.unit_price,theme.settings.moneyFormat),this.container.querySelector(this.selectors.unitPriceBaseUnit).innerHTML=theme.Currency.getBaseUnit(variant),this.container.querySelector(this.selectors.unitWrapper).classList.remove(classes.hidden)):this.container.querySelector(this.selectors.unitWrapper).classList.add(classes.hidden)},imageSetArguments:function(variant){var variant=variant||(this.variants?this.variants.currentVariant:null);if(variant){var setValue=this.settings.currentImageSet=this.getImageSetName(variant[this.settings.imageSetIndex]),set=this.settings.imageSetName+"_"+setValue;return this.settings.currentSlideIndex=0,{cellSelector:'[data-group="'+set+'"]',imageSet:set,initialIndex:this.settings.currentSlideIndex}}},updateImageSet:function(evt){var variant=evt?evt.detail.variant:this.variants?this.variants.currentVariant:null;if(variant){var setValue=this.getImageSetName(variant[this.settings.imageSetIndex]);this.settings.currentImageSet!==setValue&&this.initProductSlider(variant)}},updateImageSetThumbs:function(set){this.cache.thumbSlider.querySelectorAll(".product__thumb-item").forEach(thumb=>{thumb.classList.toggle(classes.hidden,thumb.dataset.group!==set)})},getImageSetName:function(string){return string.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-$/,"").replace(/^-/,"")},updateSku:function(evt){var variant=evt.detail.variant,newSku="",hide
172Sku=!0;variant&&(variant.sku&&(newSku=variant.sku,hideSku=!1),this.container.querySelectorAll(this.selectors.sku).forEach(el=>{el.classList.toggle(classes.hidden,hideSku),el.querySelector("[data-sku-id]").textContent=newSku}))},updateInventory:function(evt){var variant=evt.detail.variant,isDatePassed=evt.detail.datePassed,isVisualVariant=evt.detail.visualVariant,adcVariant=evt.detail.adcVariant;if(!variant||!variant.inventory_management||variant.inventory_policy==="continue"){this.toggleInventoryQuantity(variant,!1,isDatePassed,isVisualVariant,adcVariant),this.toggleIncomingInventory(!1);return}if(variant.inventory_management==="shopify"&&window.inventories&&window.inventories[this.productId]){var variantInventoryObject=window.inventories[this.productId][variant.id];if(variantInventoryObject.policy==="continue"){this.toggleInventoryQuantity(variant,!1,isDatePassed,isVisualVariant,adcVariant),this.toggleIncomingInventory(!1);return}var quantity=variantInventoryObject.quantity,showInventory=!0,showIncomingInventory=!1;(quantity<=0||quantity>this.settings.inventoryThreshold)&&(showInventory=!1),this.toggleInventoryQuantity(variant,variantInventoryObject,isDatePassed,isVisualVariant,adcVariant),!showInventory&&variantInventoryObject.incoming==="true"&&quantity<=this.settings.inventoryThreshold&&(showIncomingInventory=!0),this.toggleIncomingInventory(showIncomingInventory,variant.available,variantInventoryObject.next_incoming_date)}if(isVisualVariant=="true"){this.toggleInventoryQuantity(variant,!1,isDatePassed,isVisualVariant,adcVariant),this.toggleIncomingInventory(!1);return}},updateAvailability:function(evt){var variant=evt.detail.variant;variant&&this.storeAvailability.updateContent(variant.id)},toggleInventoryQuantity:function(variant,variantInventoryObject,isDatePassed,isVisualVariant,adcVariant){const{quantity,policy}=variantInventoryObject||{};if(this.settings.inventory){var el=this.container.querySelector(this.selectors.inventory),salesPoint=el.closest(".product-block");parseInt(quantity)<=parseInt(this.settings.inventoryThreshold)&&policy!=="continue"?(el.parentNode.classList.add("inventory--low"),quantity>1?el.textContent=theme.strings.otherStockLabel.replace("[count]",quantity):el.textContent=theme.strings.oneStockLabel.replace("[count]",quantity)):(el.parentNode.classList.remove("inventory--low"),el.textContent=theme.strings.inStockLabel,el.dataset.hideReadyToShip&&el.dataset.hideReadyToShip=="true"&&(el.textContent="In stock")),variant&&variant.available?isDatePassed=="true"?(el.parentNode.classList.add("inventory--zero"),el.textContent="Out of stock"):(el.parentNode.classList.remove(classes.hidden),el.parentNode.classList.remove("inventory--zero"),salesPoint&&salesPoint.classList.remove(classes.hidden)):isVisualVariant=="true"&&isDatePassed=="true"?(el.parentNode.classList.add("inventory--zero"),el.textContent="Out of stock"):isVisualVariant=="true"&&isDatePassed=="false"&&adcVariant=="true"?(el.parentNode.classList.remove("inventory--zero"),el.textContent="In stock, ready to ship"):(el.parentNode.classList.add("inventory--zero"),el.textContent="Out of stock")}},toggleIncomingInventory:function(show,available,date){var el=this.container.querySelector(this.selectors.incomingInventory);if(el){var salesPoint=el.closest(".product-block"),textEl=el.querySelector(".js-incoming-text");if(show){var string=available?theme.strings.willNotShipUntil.replace("[date]",date):theme.strings.willBeInStockAfter.replace("[date]",date);date||(string=theme.strings.waitingForStock),el.classList.remove(classes.hidden),salesPoint&&salesPoint.classList.remove(classes.hidden),textEl.textContent=string}else el.classList.add(classes.hidden)}},updatedSelectedVariantStyle:function(evt){let optionIndex=evt.detail.currentlySelectedValues[0].optionIndex;this.container.querySelectorAll(".variant-input-wrap label").forEach(function(label){label.dataset.indexOption==optionIndex?(label.classList.add("variant-selected"),label.previousSibling.setAttribute("checked","true")):label.dataset.indexOption!=optionIndex&&(label.previousSibling.removeAttribute("checked"),label.classList.remove("variant-selected"))})},videoSetup:function(){var productVideos=this.cache.mainSlider.querySelectorAll(selectors.productVideo);if(!productVideos.length)return!1;productVideos.forEach(vid=>{var type=vid.dataset.videoType;type==="youtube"?this.initYoutubeVideo(vid):type==="vimeo"?this.initVimeoVideo(vid):type==="mp4"&&this.initMp4Video(vid)})},initYoutubeVideo:function(div){videoObjects[div.id]=new theme.YouTube(div.id,{videoId:div.dataset.youtubeId,videoParent:selectors.videoParent,autoplay:!1,style:div.dataset.videoStyle,loop:div.dataset.videoLoop,events:{onReady:this.youtubePlayerReady.bind(this),onStateChange:this.youtubePlayerStateChange.bind(this)}})},youtubePlayerReady:function(evt){var iframeId=evt.target.getIframe().id;if(videoObjects[iframeId]){var obj=videoObjects[iframeId],player=obj.videoPlayer;obj.options.style!=="sound"&&player.mute(),obj.parent.classList.remove("loading"),obj.parent.classList.add("loaded"),obj.parent.classList.add("video-interactable"),this._isFirstSlide(iframeId)&&obj.options.style!=="sound"&&player.playVideo()}},_isFirstSlide:function(id){return this.cache.mainSlider.querySelector(selectors.startingSlide+" #"+id)},youtubePlayerStateChange:function(evt){var iframeId=evt.target.getIframe().id,obj=videoObjects[iframeId];switch(evt.data){case-1:obj.attemptedToPlay&&obj.parent.classList.add("video-interactable");break;case 0:obj&&obj.options.loop==="true"&&obj.videoPlayer.playVideo();break;case 3:obj.attemptedToPlay=!0;break}},initMp4Video:function(div){videoObjects[div.id]={id:div.id,type:"mp4"},this._isFirstSlide(div.id)&&this.playMp4Video(div.id)},stopVideos:function(){for(var[id,vid]of Object.entries(videoObjects))vid.videoPlayer?typeof vid.videoPlayer.stopVideo=="function"&&vid.videoPlayer.stopVideo():vid.type==="mp4"&&this.stopMp4Video(vid.id)},_getVideoType:function(video){return video.getAttribute("data-video-type")},_getVideoDivId:function(video){return video.id},playMp4Video:function(id){var player=this.container.querySelector("#"+id),playProm
172ise=player.play();player.setAttribute("controls",""),player.focus(),player.addEventListener("focusout",this.returnFocusToThumbnail.bind(this)),playPromise!==void 0&&playPromise.then(function(){}).catch(function(error){player.setAttribute("controls",""),player.closest(selectors.videoParent).setAttribute("data-video-style","unmuted")})},stopMp4Video:function(id){var player=this.container.querySelector("#"+id);player.removeEventListener("focusout",this.returnFocusToThumbnail.bind(this)),player&&typeof player.pause=="function"&&(player.removeAttribute("controls"),player.pause())},returnFocusToThumbnail:function(evt){if(evt.relatedTarget&&evt.relatedTarget.classList.contains("product__thumb")){var thumb=this.container.querySelector('.product__thumb-item[data-index="'+this.settings.currentSlideIndex+'"] a');thumb&&thumb.focus()}},initImageZoom:function(){var container=this.container.querySelector(this.selectors.imageContainer);if(container){var imageZoom=new theme.Photoswipe(container,this.sectionId);container.addEventListener("photoswipe:afterChange",function(evt){this.flickity&&this.flickity.goToSlide(evt.detail.index)}.bind(this))}},getThumbIndex:function(target){return target.dataset.index},updateVariantImage:function(evt){var variant=evt.detail.variant,sizedImgUrl=theme.Images.getSizedImageUrl(variant.featured_media.preview_image.src,this.settings.imageSize),newImage=this.container.querySelector('.product__thumb[data-id="'+variant.featured_media.id+'"]'),imageIndex=this.getThumbIndex(newImage);$(".product-floating-cta-image").attr("src",variant.featured_image.src),!(typeof imageIndex>"u")&&this.flickity&&this.flickity.goToSlide(imageIndex)},initProductSlider:function(variant){if(this.cache.mainSlider.querySelectorAll(selectors.slide).length<=1){var slide=this.cache.mainSlider.querySelector(selectors.slide);slide&&slide.classList.add("is-selected");return}if(this.flickity&&typeof this.flickity.destroy=="function"&&this.flickity.destroy(),!variant){var activeSlide=this.cache.mainSlider.querySelector(selectors.startingSlide);this.settings.currentSlideIndex=this._slideIndex(activeSlide)}var mainSliderArgs={dragThreshold:25,adaptiveHeight:!0,avoidReflow:!0,initialIndex:this.settings.currentSlideIndex,childNav:this.cache.thumbSlider,childNavScroller:this.cache.thumbScroller,childVertical:this.cache.thumbSlider.dataset.position==="beside",pageDots:!0,wrapAround:!0,callbacks:{onInit:this.onSliderInit.bind(this),onChange:this.onSlideChange.bind(this)}};if(this.settings.imageSetName){var imageSetArgs=this.imageSetArguments(variant);mainSliderArgs=Object.assign({},mainSliderArgs,imageSetArgs),this.updateImageSetThumbs(mainSliderArgs.imageSet)}this.flickity=new theme.Slideshow(this.cache.mainSlider,mainSliderArgs),setTimeout(()=>{this.flickity.resize()},100)},onSliderInit:function(slide){this.settings.imageSetName&&this.prepMediaOnSlide(slide)},onSlideChange:function(index){if(this.flickity){var prevSlide=this.cache.mainSlider.querySelector('.product-main-slide[data-index="'+this.settings.currentSlideIndex+'"]'),nextSlide=this.settings.imageSetName?this.cache.mainSlider.querySelectorAll(".flickity-slider .product-main-slide")[index]:this.cache.mainSlider.querySelector('.product-main-slide[data-index="'+index+'"]');prevSlide.setAttribute("tabindex","-1"),nextSlide.setAttribute("tabindex",0),this.stopMediaOnSlide(prevSlide),this.prepMediaOnSlide(nextSlide),this.settings.currentSlideIndex=index}},stopMediaOnSlide(slide){var video=slide.querySelector(selectors.productVideo);if(video){var videoType=this._getVideoType(video),videoId=this._getVideoDivId(video);if(videoType==="youtube"){if(videoObjects[videoId].videoPlayer){videoObjects[videoId].videoPlayer.stopVideo();return}}else if(videoType==="mp4"){this.stopMp4Video(videoId);return}}var currentMedia=slide.querySelector(this.selectors.media);currentMedia&&currentMedia.dispatchEvent(new CustomEvent("mediaHidden",{bubbles:!0,cancelable:!0}))},prepMediaOnSlide(slide){var video=slide.querySelector(selectors.productVideo);if(video){this.flickity.reposition();var videoType=this._getVideoType(video),videoId=this._getVideoDivId(video);if(videoType==="youtube"){if(videoObjects[videoId].videoPlayer&&videoObjects[videoId].options.style!=="sound"){videoObjects[videoId].videoPlayer.playVideo();return}}else videoType==="mp4"&&this.playMp4Video(videoId)}var nextMedia=slide.querySelector(this.selectors.media);nextMedia&&(nextMedia.dispatchEvent(new CustomEvent("mediaVisible",{bubbles:!0,cancelable:!0})),slide.querySelector(".shopify-model-viewer-ui__button").setAttribute("tabindex",0),slide.querySelector(".product-single__close-media").setAttribute("tabindex",0))},_slideIndex:function(el){return el.getAttribute("data-index")},openModalProduct:function(){var initialized=!1;if(this.settings.modalInit)initialized=!0;else{this.blocksHolder=this.container.querySelector(selectors.blocksHolder);var url=this.blocksHolder.dataset.url;fetch(url).then(function(response){return response.text()}).then(function(html){var parser=new DOMParser,doc=parser.parseFromString(html,"text/html"),blocks=doc.querySelector(selectors.blocks);blocks.querySelectorAll("[id]").forEach(el=>{var val=el.getAttribute("id");el.setAttribute("id",val+"-modal");var label=blocks.querySelector(`[for="${val}"]`);label&&label.setAttribute("for",val+"-modal");var collapsibleTrigger=blocks.querySelector(`[aria-controls="${val}"]`);collapsibleTrigger&&collapsibleTrigger.setAttribute("aria-controls",val+"-modal")});var form=blocks.querySelector(this.selectors.form);if(form){var formId=form.getAttribute("id");blocks.querySelectorAll("[form]").forEach(el=>{el.setAttribute("form",formId)})}this.blocksHolder.innerHTML="",this.blocksHolder.append(blocks),this.blocksHolder.classList.add("product-form-holder--loaded"),this.cacheElements(),this.formSetup(),this.updateModalProductInventory(),Shopify&&Shopify.PaymentButton&&Shopify.PaymentButton.init(),$(".modal__centered-content .js-qty__num").on({focu
172sin:function(){$(this).addClass("remove-padding-input"),$(".cart-text-main").hide(),$(this).removeClass("three-digit-space"),$(this).removeClass("two-digit-space")}}),$(".modal__centered-content .js-qty__num").on("focusout",checkNumber);function checkNumber(){$(this).removeClass("remove-padding-input"),$(".cart-text-main").show();var inputValue=$(this).val(),twoDigitRegex=/^\d{2}$/,threeDigitRegex=/^\d{3}$/;twoDigitRegex.test(inputValue)?($(this).removeClass("three-digit-space"),$(this).addClass("two-digit-space")):threeDigitRegex.test(inputValue)?($(this).removeClass("two-digit-space"),$(this).addClass("three-digit-space")):($(this).removeClass("three-digit-space"),$(this).removeClass("two-digit-space"))}theme.collapsibles.init(this.container),document.dispatchEvent(new CustomEvent("quickview:loaded",{detail:{productId:this.productId}}))}.bind(this)),this.productSetup(),this.videoSetup(),this.settings.imageSetName?this.variants?this.initProductSlider():document.addEventListener("quickview:loaded",function(evt){evt.detail.productId===this.productId&&this.initProductSlider()}.bind(this)):this.initProductSlider(),this.customMediaListners(),this.addIdToRecentlyViewed(),this.settings.modalInit=!0}AOS.refreshHard(),document.dispatchEvent(new CustomEvent("quickview:open",{detail:{initialized,productId:this.productId}}))},updateModalProductInventory:function(){window.inventories=window.inventories||{},this.container.querySelectorAll(".js-product-inventory-data").forEach(el=>{var productId=el.dataset.productId;window.inventories[productId]={},el.querySelectorAll(".js-variant-inventory-data").forEach(el2=>{window.inventories[productId][el2.dataset.id]={quantity:el2.dataset.quantity,policy:el2.dataset.policy,incoming:el2.dataset.incoming,next_incoming_date:el2.dataset.date}})})},closeModalProduct:function(){this.stopVideos()},initQuickAddForm:function(){this.updateModalProductInventory(),Shopify&&Shopify.PaymentButton&&Shopify.PaymentButton.init()},initModelViewerLibraries:function(){var modelViewerElements=this.container.querySelectorAll(this.selectors.media);modelViewerElements.length<1||theme.ProductMedia.init(modelViewerElements,this.sectionId)},initShopifyXrLaunch:function(){document.addEventListener("shopify_xr_launch",function(){var currentMedia=this.container.querySelector(this.selectors.productMediaWrapper+":not(."+self.classes.hidden+")");currentMedia.dispatchEvent(new CustomEvent("xrLaunch",{bubbles:!0,cancelable:!0}))}.bind(this))},customMediaListners:function(){document.querySelectorAll(this.selectors.closeMedia).forEach(el=>{el.addEventListener("click",function(){var slide=this.cache.mainSlider.querySelector(selectors.currentSlide),media=slide.querySelector(this.selectors.media);media&&media.dispatchEvent(new CustomEvent("mediaHidden",{bubbles:!0,cancelable:!0}))}.bind(this))});var modelViewers=this.container.querySelectorAll("model-viewer");modelViewers.length&&modelViewers.forEach(el=>{el.addEventListener("shopify_model_viewer_ui_toggle_play",function(evt){this.mediaLoaded(evt)}.bind(this)),el.addEventListener("shopify_model_viewer_ui_toggle_pause",function(evt){this.mediaUnloaded(evt)}.bind(this))})},mediaLoaded:function(evt){this.container.querySelectorAll(this.selectors.closeMedia).forEach(el=>{el.classList.remove(classes.hidden)}),this.flickity&&this.flickity.setDraggable(!1)},mediaUnloaded:function(evt){this.container.querySelectorAll(this.selectors.closeMedia).forEach(el=>{el.classList.add(classes.hidden)}),this.flickity&&this.flickity.setDraggable(!0)},onUnload:function(){theme.ProductMedia.removeSectionModels(this.sectionId),this.flickity&&typeof this.flickity.destroy=="function"&&this.flickity.destroy()}}),Product})(),theme.VendorProducts=(function(){var maxProducts=storeUrl=="bok-hashi.myshopify.com"||storeUrl=="bokksu.com"?6:4;function VendorProducts(container){container&&(this.container=container,this.sectionId=this.container.getAttribute("data-section-id"),this.currentProduct=this.container.getAttribute("data-product-id"),theme.initWhenVisible({element:this.container,callback:this.init.bind(this),threshold:600}))}return VendorProducts.prototype=Object.assign({},VendorProducts.prototype,{init:async function(){if(this.outputContainer=document.getElementById("VendorProducts-"+this.sectionId),this.vendor=this.container.getAttribute("data-vendor"),this.vendor=="Bokksu")var url=theme.routes.collections+"/vendors?q="+this.vendor;else var url=theme.routes.collections+"/vendors?view=vendor-ajax&q="+this.vendor;url=url.replace("//","/"),fetch(url).then(async function(response){return response.text()}).then(async html=>{var count=0,products=[],modals=[],parser=new DOMParser;let prodInventory;var doc=parser.parseFromString(html,"text/html"),allProds=doc.querySelectorAll(".grid-product");
172if(this.vendor=="Bokksu"){var Prods=[...allProds];allProds=Prods.reverse()}let checkZipcode=localStorage.getItem("zipcode"),filterProducts=[];if(theme.settings.localization){let productIds=[];allProds.forEach(el=>{productIds.push(el.dataset.productId)}),prodInventory=await vendorInventory(productIds)}allProds.forEach(el=>{if(theme.settings.localization){let product=prodInventory.find(item=>item.variantId==el.dataset.variantId);product.variantId==el.dataset.variantId&&product.isAvailable==!0&&filterProducts.push(el)}else{var id=el.dataset.productId;if(count===maxProducts||id===this.currentProduct)return;var modal=doc.querySelector('.modal[data-product-id="'+id+'"]');modal&&modals.push(modal),count++,products.push(el)}}),theme.settings.localization&&(checkZipcode?filterProducts:allProds).forEach(el=>{var id=el.dataset.productId;if(count!==maxProducts&&id!==this.currentProduct){var modal=doc.querySelector('.modal[data-product-id="'+id+'"]');modal&&modals.push(modal),count++,products.push(el)}}),this.outputContainer.innerHTML="",products.length===0?this.container.classList.add("hide"):(this.outputContainer.classList.remove("hide"),this.outputContainer.append(...products),modals.length&&(this.outputContainer.append(...modals),new theme.QuickShop(this.outputContainer)),setTimeout(()=>{addChangeCartItem();let outputContainerfinal=document.getElementById("VendorProducts-"+this.sectionId);if($(outputContainerfinal).addClass("no-vendor-padding"),outputContainerfinal){let gridItems=outputContainerfinal.querySelectorAll(".grid-item");if(gridItems.length>0){const swiperContainer=document.createElement("div");swiperContainer.classList.add("swiper-container");const swiperWrapper=document.createElement("div");swiperWrapper.classList.add("swiper-wrapper"),gridItems.forEach(item=>{const swiperSlide=document.createElement("div");swiperSlide.classList.add("swiper-slide"),swiperSlide.appendChild(item),swiperWrapper.appendChild(swiperSlide)}),swiperContainer.appendChild(swiperWrapper),outputContainerfinal.innerHTML="",outputContainerfinal.appendChild(swiperContainer);const totalSlides=swiperContainer.querySelectorAll(".swiper-slide").length,swiper2=new Swiper(".swiper-container",{slidesPerView:2,spaceBetween:10,pagination:{el:".swiper-pagination",clickable:!0},loop:!1,breakpoints:{450:{slidesPerView:2,spaceBetween:10,loop:!1},640:{slidesPerView:2.4,spaceBetween:10,loop:!1},768:{slidesPerView:3.2,loop:!1,spaceBetween:10},1250:{slidesPerView:totalSlides>5?5.3:5,spaceBetween:10}}})}}},1500),new theme.QuickAdd(this.outputContainerfinal),yotpoWidgetsContainer.initWidgets())})}}),VendorProducts})(),theme.isStorageSupported=function(type){if(window.self!==window.top)return!1;var testKey="test",storage;type==="session"&&(storage=window.sessionStorage),type==="local"&&(storage=window.localStorage);try{return storage.setItem(testKey,"1"),storage.removeItem(testKey),!0}catch{return!1}},theme.reinitProductGridItem=function(scope){window.SPR&&(SPR.initDomEls(),SPR.loadBadges()),theme.collapsibles.init()},theme.sizeDrawer=function(){var header=document.getElementById("HeaderWrapper").offsetHeight,max=window.innerHeight-header;document.documentElement.style.setProperty("--maxDrawerHeight",`${max}px`)},theme.config.hasSessionStorage=theme.isStorageSupported("session"),theme.config.hasLocalStorage=theme.isStorageSupported("local"),AOS.init({easing:"ease-out-quad",once:!0,offset:60,disableMutationObserver:!0}),theme.config.hasLocalStorage){var recentIds=window.localStorage.getItem("recently-viewed");recentIds&&typeof recentIds!==void 0&&(theme.recentlyViewedIds=JSON.parse(recentIds))}theme.config.bpSmall=matchMedia(theme.config.mediaQuerySmall).matches,matchMedia(theme.config.mediaQuerySmall).addListener(function(mql){mql.matches?(theme.config.bpSmall=!0,document.dispatchEvent(new CustomEvent("matchSmall"))):(theme.config.bpSmall=!1,document.dispatchEvent(new CustomEvent("unmatchSmall")))});function DOMready(callback){document.readyState!="loading"?callback():document.addEventListener("DOMContentLoaded",callback)}theme.initGlobals=function(){theme.collapsibles.init(),theme.videoModal(),theme.animationObserver()},DOMready(function(){if(theme.sections=new theme.Sections,theme.sections.register("slideshow-section",theme.SlideshowSection),theme.sections.register("header",theme.HeaderSection),theme.sections.register("toolbar",theme.Toolbar),theme.sections.register("product",theme.Product),theme.sections.register("password-header",theme.PasswordHeader),theme.sections.register("photoswipe",theme.Photoswipe),theme.sections.register("background-image",theme.Backgroun
172dImage),theme.sections.register("testimonials",theme.Testimonials),theme.sections.register("video-section",theme.VideoSection),theme.sections.register("map",theme.Maps),theme.sections.register("footer-section",theme.FooterSection),theme.sections.register("store-availability",theme.StoreAvailability),theme.sections.register("recently-viewed",theme.RecentlyViewed),theme.sections.register("vendor-products",theme.VendorProducts),theme.sections.register("past-products",theme.PastProducts),theme.sections.register("newsletter-popup",theme.NewsletterPopup),theme.sections.register("collection-header",theme.CollectionHeader),theme.sections.register("collection-template",theme.Collection),theme.initGlobals(),theme.rteInit(),window.addEventListener("pageshow",()=>{let form=$(".pdp_form_id").val();form&&$("#"+form).get(0).reset()}),document.body.classList.contains("template-cart")){var cartPageForm=document.getElementById("CartPageForm");if(cartPageForm){var cartForm=new theme.CartForm(cartPageForm),recommendations=document.querySelector('.cart-recommendations[data-location="page"]');recommendations&&(new theme.QuickAdd(recommendations),new theme.QuickShop(recommendations));var noteBtn=cartPageForm.querySelector(".add-note");noteBtn&&noteBtn.addEventListener("click",function(){noteBtn.classList.toggle("is-active"),cartPageForm.querySelector(".cart__note").classList.toggle("hide")}),document.addEventListener("ajaxProduct:added",function(evt){cartForm.buildCart()}.bind(this))}}if(document.body.classList.contains("template-search")){var searchGrid=document.querySelector(".search-grid");if(searchGrid){var searchProducts=searchGrid.querySelectorAll(".grid-product");searchProducts.length&&(new theme.QuickAdd(searchGrid),new theme.QuickShop(searchGrid))}}if(document.body.classList.contains("template-article")){var prodGrid=document.querySelectorAll(".product-grid");if(prodGrid.length)for(let i=0;i<prodGrid.length;i++){var gridProducts=prodGrid[i].querySelectorAll(".grid-product");gridProducts.length&&(new theme.QuickAdd(prodGrid[i]),new theme.QuickShop(prodGrid[i]))}}document.addEventListener("recommendations:loaded",function(evt){evt&&evt.detail&&evt.detail.section&&(new theme.QuickAdd(evt.detail.section),new theme.QuickShop(evt.detail.section))}),theme.pageTransitions(),document.dispatchEvent(new CustomEvent("page:loaded")),$(".js-qty__adjust--plus").click(function(){$(".pdp-quantity-validation").text("");let productQty=parseInt($(".product_quantity").val());productQty>0&&(productQty=productQty,$(".product_quantity").val(productQty),$("#quantity-notification").html(`${productQty} quantity added`))}),$(".js-qty__adjust--minus").click(function(){$(".pdp-quantity-validation").text(""),$("#quantity-notification").html("1 quantity decrease");let productQty=parseInt($(".product_quantity").val());productQty>1&&(productQty=productQty,$(".product_quantity").val(productQty))}),$(".js-qty__num").on("input",function(){$(".pdp-quantity-validation").text("");let productQty=parseInt($(this).val());productQty>0?($(".product_quantity").val(parseInt(productQty)),window.global_popup_qty=productQty):isNaN(productQty)&&($(".product_quantity").val(1),window.global_popup_qty=1)}),window.onload=function(){$("#yotpo-main-widget-btn").click(function(){setTimeout(function(){$(".yotpo-new-review-content")[0]&&$(window).width()<767&&$(".yotpo-new-review-content textarea").attr("rows",2)},500)})}})})(),$(".mobile-nav-trigger").on("click",function(){$(".site-header__mobile-nav").hasClass("is-active")?($("#MainContent, .footer__section").addClass("blur-body"),$(".header-wrapper--overlay").removeClass("is-light")):($("#MainContent, .footer__section").removeClass("blur-body"),$(".header-wrapper--overlay").addClass("is-light"))}),$(".social-links").on("keydown",function(event){if(event.keyCode==32)return window.location=$(".social-links:focus").attr("href"),!1;$(".footer__base-links .social-links:first-child").is(":focus")&&event.keyCode==9&&event.shiftKey&&$("#payment-icon").focus()}),$(".footer-menu-links").on("keydown",function(event){if(event.keyCode==32)return window.location=$(".footer-menu-links:focus").attr("href"),!1}),$(".policies-link").on("keydown",function(event){if(event.keyCode==32)return window.location=$(".policies-link:focus").attr("href"),!1});let childFalg=!1;var childId,parentId;$(".navbar-parent").each(function(i,element){$(this).on("click",function(event){let parent=$(this).attr("data-parent");parentId=$(this).attr("data-parent"),$('.child[data-parent="'+parent+'"]').is(":visible")?($('.child[data-parent="'+parent+'"]').hide(),$('.navbar-parent[data-parent="'+parent+'"] .icon').css("rotate","0deg"),$(".child .child-dropdown-items").css("color","black"),$('.navbar-parent[data-parent="'+parent+'"] .link-title span').css("color","black"),childFalg=!1):($(".grand-child").hide(),$(".child .icon").css("rotate","0deg"),$(".navbar-parent .icon").css("rotate","0deg"),$(".child .child-dropdown-items").css("color","black"),$(".navbar-parent .link-title span").css("color","black"),$('.child[data-parent="'+parent+'"]').show(),$('.child[data-parent="'+parent+'"]').addClass("brands-child"),$('.navbar-parent[data-parent="'+parent+'"] .link-title span').css("color","#294F2E"),$('.navbar-parent[data-parent="'+parent+'"] .icon').css("rotate","-180deg")),$('.child[data-parent="'+parent+'"]').not(":visible")&&!childFalg&&($('.grand-child[data-child="'+childId+'"]').hide(),$('.icon[data-child="'+childId+'"]').css("rotate","0deg"))})}),$(".child").each(function(e){$(this).on("click",function(){let child=$(this).attr("data-child");childId=$(this).attr("data-child"),childFalg=!0,$('.grand-child[data-child="'+child+'"]').is(":visible")?($('.grand-child[data-child="'+child+'"]').hide(),$('.icon[data-child="'+child+'"]').css("rotate","0deg"),$('.child[data-child="'+child+'"] .child-dropdown-items').css("color","black")):($(".grand-child").hide(),$('.child[data-parent="teir-2-brand4"]').hide(),$(".child .icon").css("rotate","0deg"),$('.child[data-parent="'+parentId+'"]').hide(),$('.navbar-parent[data-parent="'+parentId+'"] .icon').css("rotate","0deg"),$(".child .child-dropdown-items").css("color","black"),$('.grand-child[data-child="'+child+'"]').show(),$('.icon[data-child="'+child+'"]').css("rotate","-180deg"),$('.child[data-child="'+child+'"] .child-dropdown-items').css("color","#294F2E"),$('.navbar-parent[data-parent="'+parentId+'"] .link-title span').css("color","black"))})}),setTimeout(function(){if($(".shopify-reco-cart-add").length){var seedRecoGrid=$(".shopify-reco-cart-add"),products=$(".shopify-reco-cart-add .grid-product");products.length&&(new theme.QuickAdd(seedRecoGrid),new theme.QuickShop(seedRecoGrid))}},2e3);function checkWindowScroll(){$("#HeaderWrapper").hasClass("header-wrapper--compressed")&&$("#HeaderWrapper").removeClass("is-light");var scrollTop2=$(window).scrollTop();scrollTop2>40?($(".site-header__cart").css({top:"62px"}),$(".site-header__cart").addClass("scrolled-body"),$("#HeaderWrapper").addClass("is-light-new"),$(".snb-header-cart")?.css({top:"59px"})):($(".site-header__cart").css({top:"98px"}),$(".site-header__cart").removeClass("scrolled-body"),$("#HeaderWrapper").removeClass("is-light-new"),$(".snb-header-cart")?.css({top:"90px"}),$(window).innerWidth()<576&&$(".snb-header-cart")?.css({top:"74px"}))}$(window).scroll(function(){checkWindowScroll()});var scrollTop=$(window).scrollTop();scrollTop>40?$(".site-header__cart").css({paddingTop:"65px"}):storeUrl.includes("bok-hashi.myshopify.com")||$(".site-header__cart").css({paddingTop:"95px"});function calRecoProductHref(product){if(!product)return"#";var u=product.url||product.link;return u?String(u):product.handle?"/products/"+product.handle:"#"}function calRecoEscapeAttr(s){return String(s||"").replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var clicked,removedProducts=[];$(".close-loved-pro").click(function(){$(".purchase-items").length>0?$(".purchase-items").toggleClass("orient-add"):$(".customer-loved").length>0&&$(".customer-loved").toggleClass("orient-add"),$(".align-main-cart-customer").toggleClass("background-trans
172parency")});let lastProductId="";function checkMarketCart(){$(".cart-items-new p .cart-link__bubble-num").text()==0&&(lastProductId=localStorage.removeItem("last-prod-id"))}checkMarketCart();let output="",filteredProducts,backupData,defaultProducts;async function defaultSeedRecoProducts(){var seed=theme.settings&&theme.settings.recommendationsSeedProductId?theme.settings.recommendationsSeedProductId:null;if(!seed||!theme.ShopifyRecommendations)return[];var raw=await theme.ShopifyRecommendations.fetch(seed,15,"related");return raw.map(theme.ShopifyRecommendations.normalizeProduct).filter(Boolean).filter(function(obj){return obj._invOk&&(parseFloat(obj.variants[0].price)>0||!theme.ShopifyRecommendations.tagIncludes(obj.tags,"free gift"))})}window.location.href.includes("bokksu.com")||window.location.href.includes("bok-hashi.myshopify.com")||window.location.href.includes("btq-hashi.myshopify.com")?customerAlsoLoved():fetchCustomerLovedProductsSection2(null,null,null,null);async function fetchCustomerLovedProductsSection2(productId,variantId,isFirstProdRefreh,index){let state=await theme.cart.getCart(),productsId=state.items.map(items=>items.product_id);productId&&productsId.unshift(productId);var seeds=[];if(productsId.forEach(function(pid){pid&&seeds.indexOf(pid)<0&&seeds.push(pid)}),seeds=seeds.slice(0,3),!seeds.length&&theme.settings&&theme.settings.recommendationsSeedProductId&&(seeds=[theme.settings.recommendationsSeedProductId]),variantId&&await addTocartRecommendation(variantId,!1,null),!theme.ShopifyRecommendations){$(".section-2").html("");return}var merged=[];seeds.length&&theme.ShopifyRecommendations&&(merged=await theme.ShopifyRecommendations.mergeFromSeeds(seeds,20,"related")),setTimeout(function(){$(".quick-add-btn").removeClass("cart-btn-disabled")},1200),state=await theme.cart.getCart(),filteredProducts=merged.filter(function(obj){return obj._invOk&&parseFloat(obj.variants[0].price)>0&&!theme.ShopifyRecommendations.tagIncludes(obj.tags,"free gift")&&!theme.ShopifyRecommendations.tagIncludes(obj.tags,"location-exclusive")});let arr=filteredProducts.filter(function(item1){return!state.items.some(function(item2){return item1.id===item2.product_id})});localStorage.setItem("last-prod-id",state.items[0]?.product_id),defaultProducts=arr.length<=0?await defaultSeedRecoProducts():null,filteredProducts=arr.length>0?arr:defaultProducts||[];let output2=" ";if(!isFirstProdRefreh)backupData=filteredProducts;else if(backupData&&backupData.length){for(j=0;j<backupData.length;j++)if(j==index){let checkId=filteredProducts.filter(function(items){return!backupData.some(function(item2){return items.id===item2.id})});backupData[j]=checkId[0];break}}else backupData=filteredProducts;backupData||(backupData=[]);for(let i=0;i<backupData.length;i++){let product=backupData[i];if(!product||!product.images||!product.images[0])continue;let isFirstProductRefresh;output2+=`<div class="main-loved-pro grid-product2" data-index=${i} product-data-id=${product.id}>
173          <a class="main-loved-pro__link" href="${calRecoEscapeAttr(calRecoProductHref(product))}">
174          <div class="loved-pro-img"><img alt="${product.images[0].alt||""}" src="${product.images[0].src}&width=99&quality=100" /></div>
175          <div class="about-loved-pro">
176            <div class="title-loved-pro"><p>${product.title}</p></div>
177            <div class="price-loved-pro"><p><span>${product.variants[0].compare_at_price?product.variants[0].compare_at_price:""}</span> $${product.variants[0].price}</p></div>
178          </div>
179          </a>
180          <div class="plus-icon-loved shopify-reco-cart-add">
181            <button type="button" class="text-link quick-add-btn js-quick-add-btn" title="Add to cart" tabindex="-1" 
182              data-product-name="${product.title}" data-product-handle="${product.handle}"                   
183              data-id="${product.variants[0].id}"
184              data-variant-id="${product.variants[0].id}"
185              data-frequency="" data-unit-type=""
186              onclick="addToCartSection2(this,${product.id},${product.variants[0].id},${isFirstProductRefresh=!0},${i})"
187            >
188              <span class="btn btn--circle btn--icon">
189                <svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-plus" viewBox="0 0 64 64"><path class="cls-1" d="M32 9v46m23-23H9"></path></svg>
190                <span class="icon__fallback-text">Add to cart</span>
191              </span>
192            </button>
193          </div>
194        </div>`}$(".section-2").html(output2)}async function customerAlsoLoved(flag=!1,lastAddedVariantId=null,productId){let state=await theme.cart.getCart();if(lastAddedVariantId){let data={id:lastAddedVariantId,quantity:1};$.ajax({type:"POST",url:"/cart/add.js",data,dataType:"json",success:function(product){document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product}})),setTimeout(function(){$(".quick-add-btn").removeClass("cart-btn-disabled")},1200)},error:function(response){console.log(response)}})}if(!theme.ShopifyRecommendations){$(".section-2").html("");return}let marketCartProductIds=[],output2="",isSubs=!1,isBoutique=!1,isSubscriptionItem,customerData=localStorage.getItem("customerData"),calParsedData=null;try{calParsedData=customerData?JSON.parse(customerData):null}catch{calParsedData=null}let calTagsArray=calParsedData&&calParsedData.tags;calParsedData&&calTagsArray&&calTagsArray.length>0&&calTagsArray.includes("Active Subscriber")?setTimeout(function(){$(".cal-with-login").show(),$(".cal-without-login").hide()},2e3):setTimeout(function(){$(".cal-with-login").hide(),$(".cal-without-login").show()},2e3),(await theme.cart.getCart()).items.forEach(function(item){item.product_type=="Market"&&marketCartProductIds.push(item.product_id)});var seeds=[];marketCartProductIds.forEach(function(pid){pid&&seeds.indexOf(pid)<0&&seeds.push(pid)}),seeds=seeds.slice(0,3),!seeds.length&&theme.settings&&theme.settings.recommendationsSeedProductId&&(seeds=[theme.settings.recommendationsSeedProductId]);var lim=Math.min(15+marketCartProductIds.length,25),merged=seeds.length&&theme.ShopifyRecommendations?await theme.ShopifyRecommendations.mergeFromSeeds(seeds,lim,"related"):[];function bokksuMarketRecoFilter(obj){return!obj||!obj.variants||
194!obj.variants[0]?!1:obj._invOk&&obj.product_type=="Market"&&!String(obj.variants[0].sku).includes("FZ")&&!theme.ShopifyRecommendations.tagIncludes(obj.tags,"Hello Kitty Exclusive")}state=await theme.cart.getCart();var mergedFiltered=merged.filter(bokksuMarketRecoFilter),notInCart=mergedFiltered.filter(function(item1){return!state.items.some(function(item2){return item1.id===item2.product_id})});if(filteredProducts=state.items.length?notInCart:mergedFiltered,flag&&lastAddedVariantId&&backupData&&backupData.length&&theme.ShopifyRecommendations){var seedReplace=productId||seeds[0],rawRep=seedReplace?await theme.ShopifyRecommendations.fetch(seedReplace,10,"related"):[],candidates=rawRep.map(theme.ShopifyRecommendations.normalizeProduct).filter(bokksuMarketRecoFilter),replacement=candidates.find(function(p){return!backupData.some(function(b){return b&&b.id===p.id})})||candidates[0];if(replacement){var newProducts=[];backupData.forEach(function(obj){!obj||!obj.variants||!obj.variants[0]||(String(obj.variants[0].id)!==String(lastAddedVariantId)?newProducts.push(obj):newProducts.push(replacement))}),filteredProducts=newProducts}}else flag||(backupData=filteredProducts);filteredProducts=filteredProducts.reduce(function(acc,current){return!current||!current.id||acc.some(function(o){return o.id===current.id})||acc.push(current),acc},[]),filteredProducts=filteredProducts.filter(function(item1){return!state.items.some(function(item2){return item1.id===item2.product_id})});var priceNum=function(product){return Number(product.variants[0].price)};for(let i=0;i<filteredProducts.length;i++){let product=filteredProducts[i];if(!product.images||!product.images[0])continue;let formatedPrice=product.variants[0].price.split(".")[0],priceSup=product.variants[0].price.split(".")[1],discountedPrice="",orginalFormatedPrice="",originalPriceSup="",percentOff="";calTagsArray&&calTagsArray.length>0&&calTagsArray.includes("swell_vip_platinum")&&calTagsArray.includes("Active Subscriber")?(discountedPrice=(priceNum(product)*.85).toFixed(2),orginalFormatedPrice=discountedPrice.split(".")[0],originalPriceSup=discountedPrice.split(".")[1],percentOff="Platinum 15% Off"):calTagsArray&&calTagsArray.length>0&&calTagsArray.includes("swell_vip_diamond")&&calTagsArray.includes("Active Subscriber")?(discountedPrice=(priceNum(product)*.85).toFixed(2),orginalFormatedPrice=discountedPrice.split(".")[0],originalPriceSup=discountedPrice.split(".")[1],percentOff="Diamond 15% Off"):calTagsArray&&calTagsArray.length>0&&calTagsArray.includes("swell_vip_gold")&&calTagsArray.includes("Active Subscriber")?(discountedPrice=(priceNum(product)*.9).toFixed(2),orginalFormatedPrice=discountedPrice.split(".")[0],originalPriceSup=discountedPrice.split(".")[1],percentOff="Gold 10% Off"):calParsedData&&calTagsArray&&calTagsArray.length>0&&calTagsArray.includes("Active Subscriber")&&(discountedPrice=(priceNum(product)*.95).toFixed(2),orginalFormatedPrice=discountedPrice.split(".")[0],originalPriceSup=discountedPrice.split(".")[1],percentOff="Silver 5% Off");let isFirstProductRefresh;output2+=`<div class="main-loved-pro grid-product2" data-index=${i} product-data-id=${product.id}>
195            <a class="main-loved-pro__link" href="${calRecoEscapeAttr(calRecoProductHref(product))}">
196            <div class="loved-pro-img"><img src="${product.images[0].src}&width=99&quality=100" alt="${calRecoEscapeAttr(product.title)}" /></div>
197            <div class="about-loved-pro">
198              <div class="title-loved-pro"><p>${product.title}</p></div>
199
200            <div class="price-loved-pro cal-without-login">
201              <p> <span>${product.variants[0].compare_at_price?product.variants[0].compare_at_price:""}</span> $${formatedPrice}<sup>${priceSup}</sup></p></div>
202            <div class="grid-product__price cal-with-login" style="display: none;">
203              <span class="grid-product__price--original">
204                <span aria-hidden="true">$${formatedPrice}<sup style="margin-left:1px">${priceSup}</sup></span>
205              </span>
206              <span class="grid-product__price--current cart__discount" >
207                <span aria-hidden="true">$${orginalFormatedPrice}<sup style="margin-left:1px">${originalPriceSup}</sup></span>
208              </span>
209            </div>
210            <div>
211              ${percentOff?`<span class="grid-product__price--savings" > ${percentOff} </span>`:""}
212            </div>
213            </div>
214            </a>
215            <div class="plus-icon-loved shopify-reco-cart-add">
216              <button type="button" class="text-link quick-add-btn js-quick-add-btn" title="Add to cart" tabindex="-1" 
217                data-product-name="${product.title}" data-product-handle="${product.handle}"                   
218                data-id="${product.variants[0].id}"
219                data-variant-id="${product.variants[0].id}"
220                data-frequency="" data-unit-type=""
221                onclick="addToCartSection2(this,${product.id},${product.variants[0].id},${isFirstProductRefresh=!0},${i})"
222              >
223                <span class="btn btn--circle btn--icon">
224                  <svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-plus" viewBox="0 0 64 64"><path class="cls-1" d="M32 9v46m23-23H9"></path></svg>
225                  <span class="icon__fallback-text">Add to cart</span>
226                </span>
227              </button>
228            </div>
229          </div>`}$(".section-2").html(output2),calParsedData&&calTagsArray&&calTagsArray.length>0&&calTagsArray.includes("Active Subscriber")?($(".cal-with-login").show(),$(".cal-without-login").hide()):($(".cal-with-login").hide(),$(".cal-without-login").show()),isSubs=!1,isBoutique=!1,isSubscriptionItem=state.items.filter(product=>{(product.sku.includes("CBS")||product.sku.includes("SML")||product.sku.includes("HBS")||product.sku.includes("CBG"))&&product.product_type!=="Market"&&(isSubs=!0),product.sku.includes("SM")&&product.product_type!=="Free gift product"&&(isBoutique=!0)}),filteredProducts&&filteredProducts.length>0&&(isBoutique||isBoutique&&isSubs)?($(".customer-loved-v1").removeClass("hide-customer-also-loved"),$(".purchase-items").removeClass("hide-purchase-items")):($(".customer-loved-v1").addClass("hide-customer-also-loved"),$(".purchase-items").addClass("hide-purchase-items"))}async function addToCartSection2(evt,productId,variantId,isFirstProdRefresh,index){if(theme.settings.localization)if(localStorage.getItem("zipcode")){$(".quick-add-btn").addClass("cart-btn-disabled"),$('.js-quick-add-btn[data-id="'+variantId+'"]').hide();let prodTitle2=$(evt).attr("data-product-name"),item=(await theme.cart.getCart()).items.filter(items=>items.variant_id==variantId),itemInventory=item.length>0&&item[0].quantity,productInventory=await availableInventory(variantId);itemInventory<productInventory.availableQuantity&&productInventory.isInStock?window.location.href.includes("bokksu.com")||window.location.href.includes("bok-hashi.myshopify.com")||window.location.href.includes("btq-hashi.myshopify.com")?customerAlsoLoved(!0,variantId,productId):fetchCustomerLovedProductsSection2(productId,variantId,isFirstProdRefresh,index):($(".quick-add-btn").removeClass("cart-btn-disabled"),$('.js-quick-add-btn[data-id="'+variantId+'"]').show(),alert(productInventory.availableQuantity?`We can ship a maximum of ${productInventory.availableQuantity} ${prodTitle2} to your zip code.`:"Item is out of stock at your location"))}else $(".zip-code-button").click();else if(checkDateForAdventProduct()){let productIds=(await theme.cart.getCart()).items.map(item=>item.variant_id);var preOrderExists=!1,PreOrderProductId=[],uniqueProductIds=[];$(".cart__item").each(function(i,itemEl){var tags=$(itemEl).attr("data-tags");if(tags){var tagArr=tags.split(",");tagArr.includes("preorder")&&PreOrderProductId.push($(itemEl).attr("data-variant-id"));const productIdArray=PreOrderProductId.map(str=>parseInt(str));productIdArray.length>0&&(uniqueProductIds=productIds.filter(id=>!productIdArray.includes(id)));var isPreOrderInCart2=tagArr.filter(function(tag){return tag=="preorder"});isPreOrderInCart2.length>0?preOrderExists=!0:preOrderExists=!1}}),preOrderExists?preOrderAlert():uniqueProductIds.length>0?removeItems(uniqueProductIds,null):($(".quick-add-btn").addClass("cart-btn-disabled"),$('.js-quick-add-btn[data-id="'+variantId+'"]').hide(),window.location.href.includes("bokksu.com")||window.location.href.includes("bok-hashi.myshopify.com")||window.location.href.includes("btq-hashi.myshopify.com")?customerAlsoLoved(!0,variantId,productId):fetchCustomerLovedProductsSection2(productId,variantId,isFirstProdRefresh,index))}else $(".quick-add-btn").addClass("cart-btn-disabled"),$('.js-quick-add-btn[data-id="'+variantId+'"]').hide(),window.location.href.includes("bokksu.com")||window.location.href.includes("bok-hashi.myshopify.com")||window.location.href.includes("btq-hashi.myshopify.com")?customerAlsoLoved(!0,variantId,productId):fetchCustomerLovedProductsSection2(productId,variantId,isFirstProdRefresh,index)}function HideCALSection(){$(".listing-loved-products .main-loved-pro").length==0&&$(".customer-loved").hide()}function addFreeGiftOne(){let gift1Handle=$("#selected-gift-1-product").text();if(gift1Handle){let url=`https://${hostname}/products/${gift1Handle}.js`;url=url.replace(/%20/g,""),url=url.split(" ").join(""),fetch(url).then(response=>response.json()).then(async res=>{let state,filteredProduct=[],product="",output2="";if(res&&res.variants[0].available===!0){output2="",state=await theme.cart.getCart();let giftItemIds=[];
229state.items.forEach(function(item){item.properties&&item.properties._free_gift&&item.properties._free_gift==1&&giftItemIds.push(item.product_id)}),giftItemIds.includes(res.id)||filteredProduct.push(res),filteredProduct&&filteredProduct[0]?(product=filteredProduct[0],freeGiftOneVariantId=product.variants[0].id,localStorage.setItem("freeGiftOneVariantId",product.variants[0].id),output2=`<div class="main-free-gift section-minicart-products main-dualcart">
230           <div class="align-free-gift">
231             <div class="align-title-minicart title-section-minicart">
232               <h3> Grab Your Free Gift(s) </h3>
233             </div>
234             
235             <div class="free-gifts-listings">
236               <div class="align-free-gift">
237                 <div class="main-slider-gift">
238                     <div class="swiper giftSlider">
239                      <div class="swiper-wrapper">
240                        <div class="swiper-slide">
241                          <div class="gift-products">
242                              <div class="align-gift-prod">
243                                <div class="free-gift-img">
244                                  <img src="${product.images[0]}" />
245                                </div>
246                                <div class="align-name-free-gift">
247                                  <div class="free-gift-titles">
248                                    ${product.title}
249                                  </div>
250                                  <div class="ajax-cart__price price">
251                                    <span class="money">$0.00</span>
252                                  </div>
253                                </div>
254                              </div>
255                              
256                              <div class="gift-free-add-btn">
257                                 <button type="button" class="text-link quick-add-btn js-quick-add-btn" title="Add to Cart" tabindex="-1" onclick="addToCartFreeGift(this, ${product.variants[0].id})" data-id="${product.variants[0].id}" data-frequency="" data-unit-type="">Add</button>
258                              </div>
259                          </div>
260                        </div>
261                      </div>
262                      <div class="swiper-button-next"></div>
263                      <div class="swiper-button-prev"></div>
264                    </div>
265                 </div>
266               </div>
267             </div>
268           </div>
269        </div>`,$(".free-gift-1-products").html(output2),$(".swiper-button-next").hide(),$(".swiper-button-prev").hide()):($(".main-free-gift").hide(),$(".free-gift-1-products").html(""))}swiper()})}}function addFreeGiftTwo(){$(".free-gift-1-products").html("");let gift1Handle=$("#selected-gift-1-product").text();if(gift1Handle){let urlGift1Product=`https://${hostname}/products/${gift1Handle}.js`;urlGift1Product=urlGift1Product.replace(/%20/g,""),urlGift1Product=urlGift1Product.split(" ").join(""),fetch(urlGift1Product).then(response=>response.json()).then(async resProductOne=>{let productOne=resProductOne;productOne&&(freeGiftOneVariantId=productOne.variants[0].id,localStorage.setItem("freeGiftOneVariantId",freeGiftOneVariantId));let gift2Handle=$("#selected-gift-2-product").text();if(gift2Handle){let urlGift2Product=`https://${hostname}/products/${gift2Handle}.js`;urlGift2Product=urlGift2Product.replace(/%20/g,""),urlGift2Product=urlGift2Product.split(" ").join(""),fetch(urlGift2Product).then(response=>response.json()).then(async res=>{if(res){let productTwo=res;productTwo&&(freeGiftTwoVariantId=productTwo.variants[0].id,localStorage.setItem("freeGiftTwoVariantId",freeGiftTwoVariantId))}let state,filteredProducts2=[],product="",output2="";state=await theme.cart.getCart();let giftItemIds=[];if(state.items.forEach(function(item){item.properties&&item.properties._free_gift&&item.properties._free_gift==1&&giftItemIds.push(item.product_id)}),giftItemIds.includes(productOne.id)||filteredProducts2.push(productOne),giftItemIds.includes(res.id)||filteredProducts2.push(res),filteredProducts2.length>0){output2+=`<div class="product-grid main-free-gift section-minicart-products main-dualcart">
270                     <div class="align-free-gift">
271                       <div class="align-title-minicart title-section-minicart">
272                         <h3> Grab Your Free Gift(s) </h3>
273                       </div>
274                       
275                       <div class="free-gifts-listings">
276                         <div class="align-free-gift">
277                           <div class="main-slider-gift">
278                               <div class="swiper giftSlider">
279                                <div class="swiper-wrapper">`;for(let i=0;i<filteredProducts2.length;i++)product=filteredProducts2[i],output2+=`<div class="swiper-slide">
280                                                  <div class="gift-products">
281                                                      <div class="align-gift-prod">
282                                                        <div class="free-gift-img">
283                                                          <img src="${product.images[0]}" />
284                                                        </div>
285                                                        <div class="align-name-free-gift">
286                                                          <div class="free-gift-titles">
287                                                            ${product.title}
288                                                          </div>
289                                                          <div class="ajax-cart__price price">
290                                                            <span class="money">$0.00</span>
291                                                          </div>
292                                                        </div>
293                                                      </div>
294                                                      
295                                                      <div class="gift-free-add-btn">
296                                                         <button type="button" class="text-link quick-add-btn js-quick-add-btn" title="Add to Cart" tabindex="-1" onclick="addToCartFreeGift(this, ${product.variants[0].id})" data-id="${product.variants[0].id}" data-frequency="" data-unit-type="">Add</button>
297                                                      </div>
298                                                  </div>
299                                                </div>`;output2+=` </div>
300                              <div class="swiper-button-next"></div>
301                              <div class="swiper-button-prev"></div>
302                            </div>
303                         </div>
304                       </div>
305                     </div>
306                   </div>
307                </div>`,$(".free-gift-2-products").html(output2),filteredProducts2.length===1?($(".swiper-button-next").hide(),$(".swiper-button-prev").hide()):filteredProducts2.length>1&&($(".swiper-button-next").show(),$(".swiper-button-prev").show())}else $(".main-free-gift").hide(),$(".free-gift-2-products").html("");swiper()})}})}}function removeFreeGiftOne(freeGiftOneExistInCart2){$(".free-gift-1-products").html(""),freeGiftOneExistInCart2===!0&&freeGiftOneVariantId&&removeFreeGiftOneGiftTwo(freeGiftOneVariantId)}function removeFreeGiftTwo(freeGiftTwoExistInCart2,removeGiftOne){$(".free-gift-2-products").html(""),freeGiftTwoExistInCart2===!0&&(removeGiftOne===!0&&freeGiftOneVariantId&&removeFreeGiftOneGiftTwo(freeGiftOneVariantId),freeGiftTwoVariantId&&(removeGiftOne===!0?setTimeout(function(){removeFreeGiftOneGiftTwo(freeGiftTwoVariantId)},2e3):removeFreeGiftOneGiftTwo(freeGiftTwoVariantId)))}function removeFreeGiftFromBar(variantId){let properties={};properties={_free_gift:1,_free_gift_from_bar:1};const items={id:variantId,quantity:0,properties};$.ajax({url:"/cart/change.js",dataType:"json",data:items,success:function(result){document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product:result}}))},error:function(error){console.log("error: ",error.responseJSON.description)}})}function removeFreeGiftOneGiftTwo(variantId){let message=$("#free-gift-certificate-message").text(),properties={};freeGiftCertificateWith4TiersFeatureOn&&message?properties={_free_gift:1,Note:message}:properties={_free_gift:1};const items={id:variantId,quantity:0,properties};$.ajax({url:"/cart/change.js",dataType:"json",data:items,success:function(result){freeGiftOneExistInCart=!1,freeGiftTwoExistInCart=!1;let btqFreeGiftCertVariantId=localStorage.getItem("btqFreeGiftCertVariantId");variantId===btqFreeGiftCertVariantId&&localStorage.setItem("btqFreeGiftCertManuallyRemoveFromCart","Yes"),document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product:result}})),atcAndQtyButtonSwitch(variantId,"remove")},error:function(error){console.log("error: ",error.responseJSON.description)}})}async function addToCartFreeGift(button,variantId){button.disabled=!0;let data={id:variantId,quantity:1,properties:{_free_gift:1}};$.ajax({type:"POST",url:"/cart/add.js",data,dataType:"json",success:function(product){document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product}})),atcAndQtyButtonSwitch(product,"add")},error:function(response){console.log(response)}})}async function add4TiersFreeGiftCertificate(){let giftCertificateHandle=$("#selected-free-gift-certificate-product").text();if(giftCertificateHandle){let urlGiftCertificateProduct=`https://${hostname}/products/${giftCertificateHandle}.js`;urlGiftCertificateProduct=urlGiftCertificateProduct.replace(/%20/g,""),urlGiftCertificateProduct=urlGiftCertificateProduct.split(" ").join(""),fetch(urlGiftCertificateProduct).then(response=>response.json()).then(async giftCertificateProduct=>{if(giftCertificateProduct){let output2="",items=(await theme.cart.getCart()).items,itemSubTotal=0,freeGiftItemExistInCart=!1,freeGiftItemExistInCartQuantity=0,isSubscriptionItemExist=!1,isNonSubscriptionItemExist=!1;
307if(items.forEach(function(item){item.product_id===giftCertificateProduct.id&&(freeGiftItemExistInCart=!0,freeGiftItemExistInCartQuantity=item.quantity),item.product_type==="Subscription Box"||item.product_type==="Gift Box"?isSubscriptionItemExist=!0:isNonSubscriptionItemExist=!0}),isNonSubscriptionItemExist&&isSubscriptionItemExist||isNonSubscriptionItemExist&&!isSubscriptionItemExist){for(let i=0;i<items.length;i++){let itemFinalSubTotal=items[i].final_price*items[i].quantity;itemSubTotal+=itemFinalSubTotal}itemSubTotal=itemSubTotal/100;let freeGiftCertificateText="",itemRemainingAmount=0,itemFreeGiftBarPercentage=0,freeGiftQuantity=0,freeGiftFirstTierAmount=parseFloat($("#free-gift-certificate-tier-1-amount").text()),freeGiftSecondTierAmount=parseFloat($("#free-gift-certificate-tier-2-amount").text()),freeGiftThirdTierAmount=parseFloat($("#free-gift-certificate-tier-3-amount").text()),freeGiftFourthTierAmount=parseFloat($("#free-gift-certificate-tier-4-amount").text()),freeGiftCertFirstTierActive=localStorage.getItem("freeGiftCertFirstTierActive"),freeGiftCertSecondTierActive=localStorage.getItem("freeGiftCertSecondTierActive"),freeGiftCertThirdTierActive=localStorage.getItem("freeGiftCertThirdTierActive"),freeGiftCertFourthTierActive=localStorage.getItem("freeGiftCertFourthTierActive"),btqFreeGiftCertManuallyRemoveFromCart=localStorage.getItem("btqFreeGiftCertManuallyRemoveFromCart"),featureEnabledTiers=0,featureEnabledTierAmount=0;if(freeGiftFirstTierAmount>0&&!freeGiftSecondTierAmount?(featureEnabledTiers=1,featureEnabledTierAmount=freeGiftFirstTierAmount):freeGiftFirstTierAmount>0&&freeGiftSecondTierAmount>0&&!freeGiftThirdTierAmount?(featureEnabledTiers=2,featureEnabledTierAmount=freeGiftSecondTierAmount):freeGiftFirstTierAmount>0&&freeGiftSecondTierAmount>0&&freeGiftThirdTierAmount>0&&!freeGiftFourthTierAmount?(featureEnabledTiers=3,featureEnabledTierAmount=freeGiftThirdTierAmount):freeGiftFirstTierAmount>0&&freeGiftSecondTierAmount>0&&freeGiftThirdTierAmount>0&&freeGiftFourthTierAmount>0&&(featureEnabledTiers=4,featureEnabledTierAmount=freeGiftFourthTierAmount),freeGiftFirstTierAmount>0&&itemSubTotal<freeGiftFirstTierAmount?(console.log("Here in If All 4 Free Gift Tiers are Active - Case 1"),itemRemainingAmount=(freeGiftFirstTierAmount-itemSubTotal).toFixed(2),freeGiftCertificateText="<span class='free-gift-certificate-amount-text'> Add $"+itemRemainingAmount+"</span> to get a Free Gift",itemFreeGiftBarPercentage=itemSubTotal/freeGiftFirstTierAmount*100,freeGiftItemExistInCart&&btqFreeGiftCertManuallyRemoveFromCart=="No"&&addFreeGiftCert(null,giftCertificateProduct.variants[0].id,0),localStorage.setItem("freeGiftCertFirstTierActive","No"),localStorage.setItem("freeGiftCertSecondTierActive","No"),localStorage.setItem("freeGiftCertThirdTierActive","No"),localStorage.setItem("freeGiftCertFourthTierActive","No"),freeGiftQuantity=0):freeGiftFirstTierAmount>0&&!freeGiftSecondTierAmount&&itemSubTotal>=freeGiftFirstTierAmount?(console.log("Here in If Only Free Gift Tier 1 is Active"),freeGiftCertFirstTierActive=="No"&&btqFreeGiftCertManuallyRemoveFromCart=="No"&&addFreeGiftCert(null,giftCertificateProduct.variants[0].id,1),localStorage.setItem("freeGiftCertFirstTierActive","Yes"),localStorage.setItem("freeGiftCertSecondTierActive","No"),localStorage.setItem("freeGiftCertThirdTierActive","No"),localStorage.setItem("freeGiftCertFourthTierActive","No"),freeGiftQuantity=1):freeGiftFirstTierAmount>0&&freeGiftSecondTierAmount>0&&itemSubTotal>=freeGiftFirstTierAmount&&itemSubTotal<freeGiftSecondTierAmount?(console.log("Here in If All 4 Free Gift Tiers are Active - Case 2"),itemRemainingAmount=(freeGiftSecondTierAmount-itemSubTotal).toFixed(2),freeGiftCertificateText="<span class='free-gift-certificate-amount-text'> Add $"+itemRemainingAmount+"</span> to get a Free Gift",itemFreeGiftBarPercentage=(itemSubTotal-freeGiftFirstTierAmount)/(freeGiftSecondTierAmount-freeGiftFirstTierAmount)*100,freeGiftCertFirstTierActive=="No"&&btqFreeGiftCertManuallyRemoveFromCart=="No"&&addFreeGiftCert(null,giftCertificateProduct.variants[0].id,1),localStorage.setItem("freeGiftCertFirstTierActive","Yes"),localStorage.setItem("freeGiftCertSecondTierActive","No"),localStorage.setItem("freeGiftCertThirdTierActive","No"),localStorage.setItem("freeGiftCertFourthTierActive","No"),freeGiftQuantity=1):freeGiftFirstTierAmount>0&&freeGiftSecondTierAmount>0&&!freeGiftThirdTierAmount&&itemSubTotal>=freeGiftSecondTierAmount?(console.log("Here in If Free Gift Tier 1 and Free Gift Tier 2 are Active"),freeGiftCertSecondTierActive=="No"&&btqFreeGiftCertManuallyRemoveFromCart=="No"&&addFreeGiftCert(null,giftCertificateProduct.variants[0].id,2),localStorage.setItem("freeGiftCertFirstTierActive","No"),localStorage.setItem("freeGiftCertSecondTierActive","Yes"),localStorage.setItem("freeGiftCertThirdTierActive","No"),localStorage.setItem("freeGiftCertFourthTierActive","No"),freeGiftQuantity=2):freeGiftFirstTierAmount>0&&freeGiftSecondTierAmount>0&&freeGiftThirdTierAmount>0&&itemSubTotal>=freeGiftSecondTierAmount&&itemSubTotal<freeGiftThirdTierAmount?(console.log("Here in If All 4 Free Gift Tiers are Active - Case 3"),itemRemainingAmou
307nt=(freeGiftThirdTierAmount-itemSubTotal).toFixed(2),freeGiftCertificateText="<span class='free-gift-certificate-amount-text'> Add $"+itemRemainingAmount+"</span> to get a Free Gift",itemFreeGiftBarPercentage=(itemSubTotal-freeGiftSecondTierAmount)/(freeGiftThirdTierAmount-freeGiftSecondTierAmount)*100,freeGiftCertSecondTierActive=="No"&&btqFreeGiftCertManuallyRemoveFromCart=="No"&&addFreeGiftCert(null,giftCertificateProduct.variants[0].id,2),localStorage.setItem("freeGiftCertFirstTierActive","No"),localStorage.setItem("freeGiftCertSecondTierActive","Yes"),localStorage.setItem("freeGiftCertThirdTierActive","No"),localStorage.setItem("freeGiftCertFourthTierActive","No"),freeGiftQuantity=2):freeGiftFirstTierAmount>0&&freeGiftSecondTierAmount>0&&freeGiftThirdTierAmount>0&&!freeGiftFourthTierAmount&&itemSubTotal>=freeGiftThirdTierAmount?(console.log("Here in If Free Gift Tier 1, Free Gift Tier 2 and Free Gift Tier 3 are Active"),freeGiftCertThirdTierActive=="No"&&btqFreeGiftCertManuallyRemoveFromCart=="No"&&addFreeGiftCert(null,giftCertificateProduct.variants[0].id,3),localStorage.setItem("freeGiftCertFirstTierActive","No"),localStorage.setItem("freeGiftCertSecondTierActive","No"),localStorage.setItem("freeGiftCertThirdTierActive","Yes"),localStorage.setItem("freeGiftCertFourthTierActive","No"),freeGiftQuantity=3):freeGiftFirstTierAmount>0&&freeGiftSecondTierAmount>0&&freeGiftThirdTierAmount>0&&freeGiftFourthTierAmount>0&&itemSubTotal>=freeGiftThirdTierAmount&&itemSubTotal<freeGiftFourthTierAmount?(console.log("Here in If All 4 Free Gift Tiers are Active - Case 4"),itemRemainingAmount=(freeGiftFourthTierAmount-itemSubTotal).toFixed(2),freeGiftCertificateText="<span class='free-gift-certificate-amount-text'> Add $"+itemRemainingAmount+"</span> to get a Free Gift",itemFreeGiftBarPercentage=(itemSubTotal-freeGiftThirdTierAmount)/(freeGiftFourthTierAmount-freeGiftThirdTierAmount)*100,freeGiftCertThirdTierActive=="No"&&btqFreeGiftCertManuallyRemoveFromCart=="No"&&addFreeGiftCert(null,giftCertificateProduct.variants[0].id,3),localStorage.setItem("freeGiftCertFirstTierActive","No"),localStorage.setItem("freeGiftCertSecondTierActive","No"),localStorage.setItem("freeGiftCertThirdTierActive","Yes"),localStorage.setItem("freeGiftCertFourthTierActive","No"),freeGiftQuantity=3):freeGiftFirstTierAmount>0&&freeGiftSecondTierAmount>0&&freeGiftThirdTierAmount>0&&freeGiftFourthTierAmount>0&&itemSubTotal>=freeGiftFourthTierAmount&&(console.log("Here in If All 4 Free Gift Tiers are Active - Case 5"),freeGiftCertFourthTierActive=="No"&&btqFreeGiftCertManuallyRemoveFromCart=="No"&&addFreeGiftCert(null,giftCertificateProduct.variants[0].id,4),localStorage.setItem("freeGiftCertFirstTierActive","No"),localStorage.setItem("freeGiftCertSecondTierActive","No"),localStorage.setItem("freeGiftCertThirdTierActive","No"),localStorage.setItem("freeGiftCertFourthTierActive","Yes"),freeGiftQuantity=4),localStorage.setItem("btqFreeGiftCertVariantId",giftCertificateProduct.variants[0].id),freeGiftItemExistInCartQuantity<featureEnabledTiers&&itemSubTotal<featureEnabledTierAmount||!freeGiftItemExistInCart&&freeGiftQuantity>0){if(output2+=`<div class="main-free-gift section-minicart-products main-dualcart">
308              <div class="align-free-gift">
309                <div class="align-title-minicart title-section-minicart title-section-minicart-free-gifts">
310                  <h3> Free Gift(s) with Purchase </h3>`,freeGiftQuantity!==featureEnabledTiers&&(output2+=`<div class="main-progress-bar free-gift-certificate-bar-btq">
311                      <div class="progress-bar-titles">
312                          <p class="free-gift-certificate-text"> </p>
313                      </div>
314                      <div class="free-shipping-bar">
315                        <div class="min-shipping-mark" style="left: 61.22%"></div>
316                        <div class="free-gift-certificate-progress" style="width: 0%;"></div>
317                      </div>
318                    </div>`),output2+="</div>",!freeGiftItemExistInCart&&freeGiftQuantity>0&&btqFreeGiftCertManuallyRemoveFromCart=="Yes"){let btqUrl=document.querySelector(".gift-products-icons").getAttribute("data-btq-url");output2+=`<div class="gift-products gift-products-certificate">
319                                <div class="align-gift-prod">
320                                  <div class="free-gift-img">
321                      <img
322                        src="${btqUrl}"
323                      >
324  
325                    </div>
326                    <div class="align-name-free-gift-certificate">
327                      <div class="free-gift-titles">
328                        <span class="cart__item-name"> ${giftCertificateProduct.title} </span>
329                      </div>
330                      <div class="ajax-cart__price price">
331                        <small class="cart__discount">Quantity: ${freeGiftQuantity} </small>
332                      </div>
333                    </div>
334                  </div>
335  
336                  <div class="gift-free-add-btn">
337                    <button type="button" class="text-link quick-add-btn js-quick-add-btn" title="Add to Cart" tabindex="-1" onclick="addFreeGiftCert(this,${giftCertificateProduct.variants[0].id}, ${freeGiftQuantity})" data-id="${giftCertificateProduct.variants[0].id}" data-frequency="" data-unit-type="">Add</button>
338                  </div>
339                </div>`}else output2+=`<div class="gift-products gift-products-certificate">
340                  <div class="align-gift-prod">
341                    <div class="free-gift-img">
342                      <img src="https://cdn.shopify.com/s/files/1/1083/2612/files/lock-icon_5061950e-c799-4f66-a92f-467de9126e5e.png?v=1698929827" />
343                    </div>
344                    <div class="align-name-free-gift-certificate">
345                      <div class="free-gift-titles">
346                        <span class="cart__item-name"> ${giftCertificateProduct.title} </span>
347                      </div>
348                      <div class="ajax-cart__price price">
349                        <small class="cart__discount">Earn a ${giftCertificateProduct.title} for every $${freeGiftFirstTierAmount} spent</small>
350                      </div>
351                    </div>
352                  </div>
353                </div>`;output2+=`</div>
354              </div>`}$(".free-gift-1-products").html(output2),$(".free-gift-certificate-text").html(freeGiftCertificateText),$(".free-gift-certificate-progress").css("width",itemFreeGiftBarPercentage+"%")}}else $(".main-free-gift").hide(),$(".free-gift-1-products").html("")})}}async function addFreeGiftCert(btn=null,variantId,quantity){btn&&(btn.disabled=!0);let freeGiftCertExist=!1,url="",message=$("#free-gift-certificate-message").text(),properties={};message?properties={_free_gift:1,Note:message}:properties={_free_gift:1};let item={id:variantId,quantity,properties};theme.cart.getCart().then(function(cart){cart.items.forEach(function(item2){item2.variant_id==variantId&&(freeGiftCertExist=!0)}),freeGiftCertExist?url="/cart/change.js":url="/cart/add.js",$.ajax({url,dataType:"json",data:item,success:function(product){let btqFreeGiftCertVariantId=localStorage.getItem("btqFreeGiftCertVariantId");variantId===parseInt(btqFreeGiftCertVariantId)&&localStorage.setItem("btqFreeGiftCertManuallyRemoveFromCart","No"),document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product}})),setTimeout(function(){$(".cart__checkout").removeClass("cart-btn-disabled")},3e3)},error:function(error){console.log("error: ",error.responseJSON.description)}})})}async function atcFreeGift(button,variantId){button.disabled=!0;let data={id:variantId,quantity:1,properties:{_free_gift:1,_free_gift_from_bar:1}};$.ajax({type:"POST",url:"/cart/add.js",data,dataType:"json",success:function(product){document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product}})),window.location.href.includes("bokksu.com")||window.location.href.includes("bok-hashi.myshopify.com")||window.location.href.includes("btq-hashi.myshopify.com")?customerAlsoLoved():fetchCustomerLovedProductsSection2(null,null,null,null)},error:function(response){console.log(response)}})}function swiper(){if(showFreeGiftSwiper){let swiper2=new Swiper(".giftSlider",{navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}})}}async function addItem(el,ItemId,quantity=1){const items={id:ItemId,quantity};let productName=$(el).attr("data-product-name"),productHandle=$(el).attr("data-product-handle"),productTag=$(el).attr("data-pre-order");fetch(theme.routes.cartAdd,{method:"POST",body:JSON.stringify(items),credentials:"same-origin",headers:{"Content-Type":"application/json"}}).then(response=>response.json()).then(function(data){if(theme.cart.getCart().then(state=>{let frozenItems=state.items.filter(res=>res.sku.includes("FZ")),marketItems=state.items.filter(res=>!res.sku.includes("FZ")),frozenTotal=0,marketTotal=0;frozenTotal=calculateTotal(frozenItems)/100,marketTotal=calculateTotal(marketItems)/100,data.sku.includes("FZ")?frozenItems.length==1&&openCart():(marketItems.length==1&&openCart(),data.sku.includes("FZ"),state.item_count==1)}),!(data.status===422||data.status==="bad_request")){quantity>
3540?$(el).parent().html(`<button data-pre-order='${productTag=="undefined"?"":productTag}' class="qty-custom-minus test2" aria-label=" reduce quantity by 1 for ${productName}" tabindex="0" data-prod-id="${ItemId}" data-prod-qty="${quantity}"><div class="expanded-qty-btn">
355              <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
356<path d="M3.33337 8H12.6667" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
357</svg>
358
359                </div></button>
360                <span class="custom-qty">${quantity}</span>
361                <div aria-live="polite" role="status" id="quantity-notification" class="visually-hidden"></div>
362                <button data-pre-order='${productTag=="undefined"?"":productTag}' class="qty-custom-plus" data-product-handle="${productHandle}" aria-label="increase quantity by 1 for ${productName}" data-product-name="${productName}" tabindex="0"  data-prod-id="${ItemId}" data-prod-qty="${quantity}"><div class="expanded-qty-btn">
363               <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
364<path d="M8 3.33301V12.6663" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
365<path d="M3.33331 8H12.6666" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
366</svg>
367
368                </div></button>`):$(el).parent().html(`<button data-pre-order='${productTag=="undefined"?"":productTag}' aria-label="Add to cart" data-product-handle="${productHandle}" data-product-name="${productName}" class="qty-custom-add test2" data-prod-id="${ItemId}"> <img  src="https://cdn.shopify.com/s/files/1/0557/4269/3571/files/plus1.svg?v=1696942105" width="24" /></button>`);let product=data;document.dispatchEvent(new CustomEvent("cart:build",{detail:{product}}))}}.bind(this))}async function changeItem(el,ItemId,quantity=1){let prevState=await theme.cart.getCart(),idx1,prevSku;prevState.items.filter((res,index)=>{res.id==ItemId&&(idx1=index,prevSku=res.sku)});const items={id:ItemId.toString(),quantity};let productName=$(el).attr("data-product-name"),productHandle=$(el).attr("data-product-handle"),productTag=$(el).attr("data-pre-order");fetch(theme.routes.cartChange,{method:"POST",body:JSON.stringify(items),credentials:"same-origin",headers:{"Content-Type":"application/json"}}).then(response=>response.json()).then(function(data){if(data&&Array.isArray(data.items)&&document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product:data}})),theme.cart.getCart().then(state=>{let idx;state.items.filter((res,index)=>{res.id==ItemId&&(idx=index)});let productIndex=data.items[idx],frozenItems=state.items.filter(res=>res.sku.includes("FZ")),marketItems=state.items.filter(res=>!res.sku.includes("FZ")),frozenTotal=0,marketTotal=0;frozenTotal=calculateTotal(frozenItems)/100,marketTotal=calculateTotal(marketItems)/100,productIndex?.sku.includes("FZ")||prevSku.includes("FZ")?frozenItems.length==1&&openCart():state.item_count==1&&(openCart(),console.log("1 item added"))}),!(data.status===422||data.status==="bad_request")){if(quantity>0){var isVariantUnavailable=function(variantId){return unavailableProducts.includes(variantId)},unavailableProducts=JSON.parse(localStorage.getItem("unavailableProducts"))||[];$("#quantity-notification").html(`${quantity} quantity added`);let qtyCustomMinusSVG="https://cdn.shopify.com/s/files/1/0557/4269/3571/files/minus.svg?v=1689682578";quantity==1&&(qtyCustomMinusSVG="https://cdn.shopify.com/s/files/1/0557/4269/3571/files/minus.svg?v=1689682578"),$(el).parent().html(`<button data-pre-order='${productTag=="undefined"?"":productTag}' class="qty-custom-minus test" aria-label=" reduce quantity by 1 for ${productName}" tabindex="0" data-prod-id="${ItemId}" data-prod-qty="${quantity}"><div class="expanded-qty-btn">
369                  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
370                     <path d="M3.33337 8H12.6667" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
371                  </svg>
372                </div></button>
373                <span class="custom-qty">${quantity}</span>
374                <div aria-live="polite" role="status" id="quantity-notification" class="visually-hidden"></div>
375                <button data-pre-order='${productTag=="undefined"?"":productTag}' data-product-handle="${productHandle}" class="qty-custom-plus" aria-label="increase quantity by 1 for ${productName}" tabindex="0"  data-prod-id="${ItemId}" data-prod-qty="${quantity}"><div class="expanded-qty-btn">
376                   <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
377                    <path d="M8 3.33301V12.6663" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
378                    <path d="M3.33331 8H12.6666" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
379                  </svg>
380                </div></button>`)}else{let elParent=$(el).parent(),parentElement=$(el).closest(".add-item-to-cart");$(elParent).html(` 
381                <button data-pre-order='${productTag=="undefined"?"":productTag}' data-product-handle="${productHandle}" class="qty-custom-add" data-prod-id="${ItemId}" data-product-name="${productName}" type="button" aria-label="add to cart for ${productName}" tabindex="0">  <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24" fill="none">
382                  <path d="M12.4004 5V19" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
383                  <path d="M5.40039 12H19.4004" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
384                  </svg>  <span>${productTag=="preorder"?"Pre Order ":"Add to Cart"}</span> </button>
385                  <div aria-live="polite" role="status" id="quantity-notification" class="visually-hidden"></div>
386                </div>`),(storeUrl=="mkt-hashi.myshopify.com"||storeUrl=="bok-hashi.myshopify.com")&&$(elParent).find("button.qty-custom-add").on("click",async function(){let preOrder=$(this).attr("data-pre-order")=="undefined"?"":$(this).attr("data-pre-order"),prodId=$(this).attr("data-prod-id"),prodQty=1;if(collectionPage&&!productPage||isSearch){var preorderInCart=isPreOrderInCart();let items2=(await theme.cart.getCart()).items;checkDateForAdventProduct()?preorderInCart?preOrder&&preorderInCart?($(this).addClass("disable-div"),(collectionPage&&!productPage||isSearch)&&addItem(this,prodId,1)):preOrderAlert():preOrder&&items2.length>0?preOrderAlert():($(this).addClass("disable-div"),(collectionPage&&!productPage||isSearch)&&addItem(this,prodId,1)):($(this).addClass("disable-div"),(collectionPage&&!productPage||isSearch)&&addItem(this,prodId,1))}})}let product=data;document.dispatchEvent(new CustomEvent("cart:build",{detail:{product}}))}}.bind(this))}let checkInterval=setInterval(checkForElement,500),checkIntervalISP=setInterval(checkForElementISP,500);function checkForElement(){($(".recently-viewed__section .grid-item").length>0||$(".vendor-products__section .grid-item").length>0)&&(addChangeCartItem(),clearInterval(checkInterval),$(".quick-product__btn").on("click",function(){if(console.log("quick add"),$("body").removeClass("modal-frozen-product"),$("body").addClass("modal-market-product"),$(this).attr("data-is-frozen")){var isFrozenValue=$(this).attr("data-is-frozen");console.log("Frozen: "+isFrozenValue),isFrozenValue==="true"&&($("body").addClass("modal-frozen-product"),$("body").removeClass("modal-market-product"))}}))}function checkForElementISP(){$(".isp_center_container .isp_grid_product").length>0&&(addChangeCartItem(),clearInterval(checkIntervalISP))}addChangeCartItem();function themeStyledAlert(msg){var overlay=document.getElementById("theme-styled-alert");if(!overlay){var style=document.createElement("style");style.textContent="#theme-styled-alert{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:999999;display:flex;align-items:center;justify-content:center;}#theme-styled-alert[hidden]{display:none;}.theme-styled-alert__box{background:#fff;border-radius:12px;padding:32px 36px;max-width:440px;width:90%;text-align:center;box-shadow:0 8px 30px rgba(0,0,0,.18);}.theme-styled-alert__msg{font-family:'Lato',sans-serif;font-size:16px;line-height:1.6;
386color:#1a1a1a;margin:0 0 24px;}.theme-styled-alert__close{font-family:'Montserrat',sans-serif;font-size:14px;font-weight:600;letter-spacing:3px;text-transform:uppercase;padding:12px 40px;border:none;background:var(--colorBtnPrimary,#243846);color:var(--colorBtnPrimaryText,#fff);border-radius:6px;cursor:pointer;transition:opacity .3s;}.theme-styled-alert__close:hover{opacity:.85;}",document.head.appendChild(style),overlay=document.createElement("div"),overlay.id="theme-styled-alert",overlay.hidden=!0,overlay.innerHTML='<div class="theme-styled-alert__box"><p class="theme-styled-alert__msg"></p><button type="button" class="theme-styled-alert__close">OK</button></div>',document.body.appendChild(overlay),overlay.addEventListener("click",function(e){e.target===overlay&&(overlay.hidden=!0)}),overlay.querySelector(".theme-styled-alert__close").addEventListener("click",function(){overlay.hidden=!0})}overlay.querySelector(".theme-styled-alert__msg").textContent=msg,overlay.hidden=!1}function showAlert(message,element){$(element).data("alert-shown")||(themeStyledAlert(message),$(element).data("alert-shown",!0),setTimeout(()=>{$(element).data("alert-shown",!1)},3e3))}function debounce(func,wait){let timeout;return function(...args){clearTimeout(timeout),timeout=setTimeout(()=>func.apply(this,args),wait)}}const debouncedShowAlert=debounce((message,element)=>showAlert(message,element),300);function addChangeCartItem(){$(".add-item-to-cart").off("click.addToCartCollection","button.qty-custom-add"),$(".add-item-to-cart").on("click.addToCartCollection","button.qty-custom-add",async function(){let prodId=$(this).attr("data-prod-id"),prodHandle=$(this).attr("data-product-handle"),preOrder=$(this).attr("data-pre-order")=="undefined"||$(this).attr("data-pre-order")==""?"":$(this).attr("data-pre-order"),productUrl=$(this).attr("data-product-url"),prodQty=1;if(theme.settings.localization)if(localStorage.getItem("zipcode")){let productInventory=await availableInventory(prodId);prodQty<=productInventory.availableQuantity&&productInventory.isInStock||prodHandle==="bokksu-digital-gift-card"?($(this).addClass("disable-div"),addItem(this,prodId,prodQty)):debouncedShowAlert(productInventory.availableQuantity?`We can ship a maximum of ${productInventory.availableQuantity} ${prodTitle} to your zip code.`:"Item is out of stock at your location",this)}else $(".zip-code-button").click();else{var preorderInCart=isPreOrderInCart();let items=(await theme.cart.getCart()).items;checkDateForAdventProduct()?preorderInCart?preOrder&&preorderInCart?($(this).addClass("disable-div"),addItem(this,prodId,prodQty)):showAlert(theme.settings.preorderMessage||"Pre-order items cannot be combined in your purchase with other items that can be shipped immediately. To pre-order, place a separate order with only the Advent Calendar in your cart and we'll notify you when it ships!",this):preOrder&&items.length>0?showAlert(theme.settings.preorderMessage||"Pre-order items cannot be combined in your purchase with other items that can be shipped immediately. To pre-order, place a separate order with only the Advent Calendar in your cart and we'll notify you when it ships!",this):($(this).addClass("disable-div"),addItem(this,prodId,prodQty)):($(this).addClass("disable-div"),addItem(this,prodId,prodQty))}$(".box-cart-main").addClass("hide-floating")}),$(".add-item-to-cart").off("click.addToCartCollection",".qty-custom-minus"),$(".add-item-to-cart").on("click.addToCartCollection",".qty-custom-minus",function(){let self2=this,prodId=$(this).attr("data-prod-id"),prodQty=parseInt($(this).attr("data-prod-qty")),flag=!0;theme.settings.localization?localStorage.getItem("zipcode")?($(".add-item-to-cart").addClass("disabled-span"),$(".qty-custom-add").addClass("disabled-span"),theme.cart.getCart().then(function(cart){cart.items.forEach(function(item){item.variant_id==prodId&&(flag=!1,changeItem(self2,prodId,item.quantity-1))}),$("#quantity-notification").html("decrease quantity 1"),flag&&changeItem(self2,prodId,prodQty-1)})):$(".zip-code-button").click():($(".add-item-to-cart").addClass("disabled-span"),$(".qty-custom-add").addClass("disabled-span"),theme.cart.getCart().then(function(cart){cart.items.forEac
386h(function(item){item.variant_id==prodId&&(flag=!1,changeItem(self2,prodId,item.quantity-1))}),$("#quantity-notification").html("decrease quantity 1"),flag&&changeItem(self2,prodId,prodQty-1)})),$(".box-cart-main").addClass("hide-floating"),setTimeout(()=>{$(".add-item-to-cart").removeClass("disabled-span"),$(".qty-custom-add").removeClass("disabled-span")},3e3)}),$(".add-item-to-cart").off("click.addToCartCollection",".qty-custom-plus"),$(".add-item-to-cart").on("click.addToCartCollection",".qty-custom-plus",async function(){let self2=this,prodId=$(this).attr("data-prod-id"),prodTitle2=$(this).attr("data-product-name"),prodQty=parseInt($(this).attr("data-prod-qty")),flag=!0;if(theme.settings.localization)if(localStorage.getItem("zipcode")){let productInventory=await availableInventory(prodId);prodQty+1<=productInventory.availableQuantity&&productInventory.isInStock?($(".add-item-to-cart").addClass("disabled-span"),$(".qty-custom-add").addClass("disabled-span"),theme.cart.getCart().then(function(cart){cart.items.forEach(function(item){item.variant_id==prodId&&(flag=!1,changeItem(self2,prodId,item.quantity+1))}),flag&&changeItem(self2,prodId,prodQty+1)})):(flag=!1,debouncedShowAlert(productInventory.availableQuantity?`We can ship a maximum of ${productInventory.availableQuantity} ${prodTitle2} to your zip code.`:"Item is out of stock at your location",this))}else $(".zip-code-button").click();else $(".add-item-to-cart").addClass("disabled-span"),$(".qty-custom-add").addClass("disabled-span"),theme.cart.getCart().then(function(cart){cart.items.forEach(function(item){item.variant_id==prodId&&(flag=!1,changeItem(self2,prodId,item.quantity+1))}),flag&&changeItem(self2,prodId,prodQty+1)});$(".box-cart-main").addClass("hide-floating"),setTimeout(()=>{$(".add-item-to-cart").removeClass("disabled-span"),$(".qty-custom-add").removeClass("disabled-span")},3e3)})}$(document).ready(function(){$(".market-open-cart, .cro-header-navigations #HeaderCartTrigger").on("click",function(){window.innerWidth<768&&$(".header-wrapper").hasClass("SGM")&&$("#chat-button").hide();const headerCart=document.getElementById("HeaderCart");theme.utils.prepareTransition(headerCart,function(){headerCart.classList.add("is-active"),headerCart.scrollTop=0}),document.documentElement.classList.add("cart-open"),window.screen.width<900})}),$(".market-goto-checkout").on("click",function(){window.location.href="/cart/checkout"}),$(".frozen-open-cart").on("click",function(){theme.sizeDrawer();const headerCart=document.getElementById("HeaderCart");theme.utils.prepareTransition(headerCart,function(){headerCart.classList.add("is-active"),headerCart.scrollTop=0}),document.documentElement.classList.add("cart-open"),window.screen.width<900}),$(".frozen-goto-checkout").on("click",function(){window.location.href="/cart/checkout"});function resetCheckout(element){return setTimeout(()=>{$(element).css("bottom","-300px")},3e3)}$(".js-close-header-cart").click(function(){const config={namespace:".cart-header"};$(".header-wrapper").hasClass("SGM")&&$("#chat-button").show();const headerCart=document.getElementById("HeaderCart");theme.utils.prepareTransition(headerCart,function(){headerCart.classList.remove("is-active")}),window.off("keyup"+config.namespace),window.off("click"+config.namespace),document.documentElement.classList.remove("cart-open"),config.cartOpen=!1}),$(".listing-empty-cart a").click(function(){$("#HeaderCart").hide(),$(".empty-cart-design-main").hide(),$(".customer-loved.customer-loved-v1").hide()}),$(document).ready(function(){checkWindowScroll(),setTimeout(()=>{$("#show-credit-balance").click(function(){$(".section__content .Rise-page").toggle()})},1900),$(".cart__item-title > div:not([class])").remove(),$(".quick-product__btn").on("click",function(){if($("body").removeClass("modal-frozen-product"),$("body").addClass("modal-market-product"),$(this).attr("data-is-frozen")){var isFrozenValue=$(this).attr("data-is-frozen");isFrozenValue==="true"&&($("body").addClass("modal-frozen-product"),$("body").removeClass("modal-market-product"))}})});function openCart(){if(window.screen.width>767){theme.sizeDrawer();const headerCart=document.getElementById("HeaderCart");theme.utils.prepareTransition(headerCart,function(){headerCart.classList.add("is-active"),headerCart.scrollTop=0}),document.documentElement.classList.add("cart-open"),updateCartItems(null)}}const calculateTotal=items=>items.reduce((total,item)=>total+item.price*item.quantity,0);function atcAndQtyButtonSwitch(data,action){theme.cart.getCart().then(function(cart){let items=cart.items,matched=!1;items.find(function(item){item.discounts&&item.discounts.length>0&&item.discounts.some(function(discount){return discount.title==="Free Gift"&&discount.amount===item.original_price})&&item.variant_id==data.id&&(matched=!0,$(".cro-qty-wrapper").hide(),$(".pdp-atc").show(),$(".product_quantity").val(1)),action==="remove"&&item.variant_id==data&&($(".pdp-product-quantity").each(function(index){$(this).attr("data-id")==item.variant_id&&$(this).val(item.quantity)}),console.log(item,"item")),matched||($(".cro-qty-wrapper").show(),$(".pdp-atc").hide())})})}
386async function vendorInventories(prodIds){let productIds=prodIds,locationId=localStorage.getItem("locationId");return locationId!=="undefined"&&locationId!==""&&locationId!==null?await(await fetch(`https://inventory-location-1d178e8bce00.herokuapp.com/api/gridInventoryLevels?productId=${prodIds}&locationId=${locationId}&store=${storeUrl}`)).json():"Undefined Location Id"}const addItemToCart=(variant_id,quantity)=>{fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:[{id:variant_id,quantity}]})}).then(response=>{if(!response.ok)throw new Error("Network response was not ok.");return freeGiftCertificateWith4TiersFeatureOn&&add4TiersFreeGiftCertificate(),response.json()}).then(data2=>{}).catch(error=>{console.error("Error adding item to cart:",error)})},checkMinBundleInCart=()=>{checkCartAndUpdate()};function checkCartAndUpdate(){fetch("/cart.js").then(response=>response.json()).then(async cart=>{let rebuyCount=0,itemsToProcess=[];cart.items.forEach(item=>{item.properties&&item.properties._attribution==="Rebuy Dynamic Product Bundle"&&(rebuyCount++,itemsToProcess.push(item))}),rebuyCount>0&&rebuyCount<3&&(await removeCartItemProperties(itemsToProcess),window.location.reload())}).catch(error=>console.error("Error fetching cart:",error))}async function removeCartItemProperties(items){try{const promises=items.map(item=>fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:item.key,properties:{_attribution:null}})}).then(response=>response.json()).catch(error=>console.error("Error updating cart:",error)));await Promise.all(promises)}catch(error){console.error("Error removing cart item properties:",error)}}$(document).ready(function(){setTimeout(()=>{$(".footer__section").hasClass("SGM")&&$("#HeaderWrapper").addClass("SGM")},1e3)}),$(document).ready(function(){$("body").on("click",".swatch-button,.swatch-view-item",async function(){let currentUrl=window.location.href,value=$(this).data("value");currUrlArr=currentUrl.split("variant=");let selectedVariant=parseInt(currUrlArr[1]),url=new URL(currentUrl);if(!new URLSearchParams(url.search).has("variant")&&value=="$30")$(".add-to-cart").attr("data-variant-id","43651109421209");else{$(".add-to-cart").attr("data-variant-id",selectedVariant),$(".cro-pdp-updates button.pdp-qty").attr("data-variant-id",selectedVariant),$(".js-qty__num").attr("data-id",selectedVariant),$(".js-qty__adjust").attr("data-variant-id",selectedVariant);const cart=await theme.cart.getCart(),isInCart=cart.items.some(item=>item.variant_id===selectedVariant),getItemCount=cart.items.find(item=>item.variant_id===selectedVariant);$(".cro-pdp-updates input").val(getItemCount?.quantity||1),$(".product_quantity").val(getItemCount?.quantity||1),$(".pdp-product-quantity").val(getItemCount?.quantity||1),$(".cro-pdp-updates button.add-to-cart").show(),$(".cro-pdp-updates .js-qty__wrapper.qty-wrapper.cro-qty-wrapper").show()}});const productSku=$("#product-sku").html();productSku&&productSku.startsWith("FZ")?($("#marketShipping").hide(),$("#frozenShipping").show()):($("#marketShipping").show(),$("#frozenShipping").hide()),$(".sn-common.sn-style-big.sn-bottom-left.sn-bottom-to-top.sn-activated").css("z-index",1);let currentURL=window.location.href;currentURL.includes("collections")&&currentURL.includes("classic-bokksu-seasons-of-japan")&&$(".main-new-reviews-align").addClass("d-none"),currentURL.includes("collections")&&$(".main-new-reviews-align").addClass("d-none"),currentURL.includes("product")&&currentURL.includes("classic-bokksu-seasons-of-japan")&&$(".main-new-reviews-align").addClass("d-none"),currentURL.includes("product")&&currentURL.includes("classic-bokksu")&&$(".main-new-reviews-align").addClass("d-block"),currentURL.includes("product")&&!currentURL.includes("classic-bokksu")&&$(".main-new-reviews-align").addClass("d-none"),currentURL.includes("collections")&&currentURL.includes("product")&&!currentURL.includes("classic-bokksu-seasons-of-japan")&&$(".main-new-reviews-align").addClass("d-none")}),document.addEventListener("DOMContentLoaded",function(){var scrollableGrids=document.querySelectorAll(".scrollable-grid--small");
386scrollableGrids.forEach(function(grid){var productCount=grid.querySelectorAll(".grid-item").length;if(productCount===5){grid.classList.add("scrollable-grid--small-main");var gridItems=grid.querySelectorAll(".grid-item");gridItems.forEach(function(item){item.style.setProperty("max-width","unset","important")})}if(productCount<=4){var gridItems=grid.querySelectorAll(".grid-item");gridItems.forEach(function(item){item.classList.add("grid-item-main")})}})});function processCart(){let total_saving=0;document.querySelectorAll(".cart__item").forEach(item=>{const compareAtPrice=parseFloat(item.getAttribute("data-compare-at-price"))/100,price=parseFloat(item.getAttribute("data-price"))/100,quantity=parseInt(item.getAttribute("data-quantity"));if(compareAtPrice>price){let saving=(compareAtPrice-price)*quantity;total_saving+=saving}}),total_saving>0?(document.querySelector(".cart_savings").classList.remove("d-none"),document.querySelector(".cart_savings_amount").classList.remove("d-none"),document.querySelector(".cart_savings_amount").textContent=theme.Currency.formatMoney(total_saving*100,theme.settings.moneyFormat)):document.querySelector(".cart_savings").classList.add("d-none")}function updateCartItems(cart){cart==null?setTimeout(function(){theme.cart.getCart().then(function(cart2){cart2.items.forEach(item=>{const cartItemElement=document.querySelector(`.cart__item[data-key="${item.key}"]`);cartItemElement&&cartItemElement.setAttribute("data-quantity",item.quantity)})}),processCart(),typeof checkQtyButton=="function"&&checkQtyButton()},1e3):(cart.items.forEach(item=>{const cartItemElement=document.querySelector(`.cart__item[data-key="${item.key}"]`);cartItemElement&&cartItemElement.setAttribute("data-quantity",item.quantity)}),processCart(),typeof checkQtyButton=="function"&&checkQtyButton())}document.addEventListener("cart:build",function(){typeof checkQtyButton=="function"&&checkQtyButton()}),document.addEventListener("cart:updated",function(){typeof checkQtyButton=="function"&&checkQtyButton()}),document.querySelectorAll(".rca-add-to-cart-submit a").forEach(anchor=>{anchor.addEventListener("click",function(event){setTimeout(function(){document.dispatchEvent(new CustomEvent("cart:build"))},1300)})}),theme?.settings?.recommendationId&&postPurchaseRecommend(null,null);var recommendProducts=[];let isRefreshProducts=!1,backupRecommendProducts=[];function postPurchaseRecommend(isRefreshProducts2,index){var recommendation_id=theme.settings.recommendationId;let output2="";var RCM_STATUS=0,onRecommendationsLoaded=async function(data){if(data&&data.length>0){let item_ids=[],state=await theme.cart.getCart(),filteredProds=data.filter(item1=>!state.items.some(item2=>item1.PRODUCT_ID===item2.product_id));if(recommendProducts=filteredProds,!isRefreshProducts2)backupRecommendProducts=filteredProds.filter(obj=>obj.PRICE>0||!obj.TITLE.includes("Free Gift"));else for(j=0;j<backupRecommendProducts.length;j++)if(j==index){let checkId=filteredProds.filter(items=>!backupRecommendProducts.some(item2=>items.item_id===item2.item_id));backupRecommendProducts[j]=checkId[0];break}for(var i=0;i<backupRecommendProducts.length;i++){var product=backupRecommendProducts[i];item_ids.push(backupRecommendProducts[i].item_id),$(".past-purchase-section").addClass("exp-reco-product"),output2+=`<div class="main-loved-pro grid-product3" data-index=${i} data-product-id=${product.PRODUCT_ID}>
387                        <div class="loved-pro-img"><img src="${product.IMAGE_SRC}&width=99&quality=100" /></div>
388                        <div class="about-loved-pro">
389                          <div class="title-loved-pro"><p>${product.TITLE}</p></div>
390                          <div class="price-loved-pro"><p>$${product.PRICE} <span>${product.COMPARE_PRICE>product.PRICE?product.COMPARE_PRICE:""}</span></p></div>
391                        </div>
392                        <div class="plus-icon-loved shopify-reco-cart-add">
393                          <button type="button" class="text-link quick-add-btn js-quick-add-btn" title="Add to cart" tabindex="-1" 
394                            data-product-name="${product.TITLE}" data-product-handle="${product.HANDLE}"                   
395                            data-id="${product.VARIANT_ID}"
396                            data-variant-id="${product.VARIANT_ID}"
397                            data-index="${i}"
398                            data-frequency="" data-unit-type=""
399                            >
400                            <span class="btn btn--circle btn--icon">
401                              <svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-plus" viewBox="0 0 64 64"><path class="cls-1" d="M32 9v46m23-23H9"></path></svg>
402                              <span class="icon__fallback-text">Add to cart</span>
403                            </span>
404                          </button>
405                        </div>
406                      </div>`}document.querySelector(".past-purchase-section")&&(document.querySelector(".past-purchase-section").innerHTML=output2)}else document.querySelector(".past-purchase-section").innerHTML="Nothing could be recommended for you!";document.querySelectorAll(".js-quick-add-btn").forEach(function(item){item.addEventListener("click",async function(){let variantId=$(this).attr("data-variant-id"),index2=$(this).attr("data-index");if(checkDateForAdventProduct()){let productIds=(await theme.cart.getCart()).items.map(item2=>item2.variant_id);var preOrderExists=!1,PreOrderProductId=[],uniqueProductIds=[];$(".cart__item").each(function(i2,itemEl){var tags=$(itemEl).attr("data-tags");if(tags){var tagArr=tags.split(",");tagArr.includes("preorder")&&PreOrderProductId.push($(itemEl).attr("data-variant-id"));const productIdArray=PreOrderProductId.map(str=>parseInt(str));productIdArray.length>0&&(uniqueProductIds=productIds.filter(id=>!productIdArray.includes(id)));var isPreOrderInCart2=tagArr.filter(function(tag){return tag=="preorder"});isPreOrderInCart2.length>0?preOrderExists=!0:preOrderExists=!1}}),preOrderExists?preOrderAlert():uniqueProductIds.length>0?removeItems(uniqueProductIds):($('.quick-add-btn[data-id="'+variantId+'"]').addClass("cart-btn-disabled"),await addTocartRecommendation(variantId,isRefreshProducts2=!0,index2))}else $('.quick-add-btn[data-id="'+variantId+'"]').addClass("cart-btn-disabled"),await addTocartRecommendation(variantId,isRefreshProducts2=!0,index2)})})};let productsLength=document.querySelector(".post-order-swiper .swiper-wrapper")&&document.querySelector(".post-order-swiper .swiper-wrapper").getAttribute("data-section-length");var options={recommendationId:recommendation_id,size:productsLength>=10?25:15,fill_with_random:!0,callback:onRecommendationsLoaded}}async function addTocartRecommendation(variantId,isRefreshProducts2,index){if(variantId){let data={id:variantId,quantity:1};$.ajax({type:"POST",url:"/cart/add.js",data,dataType:"json",success:function(product){document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product}})),setTimeout(function(){$(".quick-add-btn").removeClass("cart-btn-disabled")},1200),postPurchaseRecommend(isRefreshProducts2,index&&index)},error:function(response){console.log(response),setTimeout(function(){$(".quick-add-btn").removeClass("cart-btn-disabled")},1200)}})}}theme.PastProducts=(function(){function PastProducts(container){container&&(this.container=container,this.sectionId=this.container.getAttribute("data-section-id"),this.currentProduct=this.container.getAttribute("data-product-id"),theme.initWhenVisible({element:this.container,callback:this.init.bind(this),threshold:600}))}return PastProducts.prototype=Object.assign({},PastProducts.prototype,{init:async function(){this.outputContainer=document.getElementById("PastProducts-"+this.sectionId);let ispdpSection=this.outputContainer.getAttribute("data-section-pdp"),productsLength=this.outputContainer.getAttribute("data-section-length");var maxProducts=ispdpSection=="pdp-widget"?4:productsLength;let recommendItems=[];var productId=[],url=theme.routes.search+"?view=recently-viewed&type=product&q=";setTimeout(()=>{recommendItems=recommendProducts,recommendItems.forEach(el=>{var id=el.PRODUCT_ID;productId+="id:"+id+" OR "}),url=url+encodeURIComponent(productId),url=url.replace("//","/"),console.log(url),fetch(url).then(async function(response){return response.text()}).then(async html=>{var count=0,products=[],modals=[],parser=new DOMParser,doc=parser.parseFromString(html,"text/html"),allProds=doc.querySelectorAll(".grid-product"),newDiv=[];allProds.forEach(el=>{var id=el.dataset.productId;if(count!=maxProducts&&id!==this.currentProduct){var modal=doc.querySelector('.modal[data-
406product-id="'+id+'"]');modal&&modals.push(modal),count++,newDiv[count]=document.createElement("div"),newDiv[count].className="swiper-slide checking-slider-main product-orders",newDiv[count].innerHTML=el.outerHTML,ispdpSection=="pdp-widget"?products.push(el):products.push(newDiv[count])}}),this.outputContainer.innerHTML="",products.length===0?this.container.classList.add("hide"):(this.outputContainer.classList.remove("hide"),$(".past-purhase-product").removeClass("d-none"),this.outputContainer.append(...products),modals.length&&(this.outputContainer.append(...modals),new theme.QuickShop(this.outputContainer)),setTimeout(()=>{addChangeCartItem()},2500),new theme.QuickAdd(this.outputContainer),yotpoWidgetsContainer.initWidgets())})},2e3)}}),PastProducts})(),$(".customize-add").click(function(event){return window.location=$(this).attr("data-product-url"),event.preventDefault(),!1});function checkDateForAdventProduct(){const currentDate=new Date,startDate=new Date(`${theme.settings.start_date}`),endDate=new Date(`${theme.settings.end_date}`);return currentDate>startDate&&currentDate<endDate}function isPreOrderInCart(){var preOrderExists=!1;return $(".cart__item").each(function(i,itemEl){var tags=$(itemEl).attr("data-tags");if(tags){var tagArr=tags.split(",");if(tagArr.includes("preorder"))return preOrderExists=!0,!1}}),preOrderExists}function removeItems(variants,evt){let items={};for(var i=0;i<variants.length;i++)items[variants[i]]=0;theme.cart._updateCart({url:"/cart/update.js",data:JSON.stringify({updates:items})}).then(function(cart){document.dispatchEvent(new CustomEvent("cart:build",{detail:{product:cart}})),showAlert(theme.settings.preorderMessage||"Pre-order items cannot be combined in your purchase with other items that can be shipped immediately. To pre-order, place a separate order with only the Advent Calendar in your cart and we'll notify you when it ships!",evt&&evt)})}async function addItemFromCollection(el,productFirstVraId,quantity=1){let preOrder=$(el).attr("data-pre-order")=="undefined"?"":$(el).attr("data-pre-order");var preorderInCart=isPreOrderInCart();let items=(await theme.cart.getCart()).items;checkDateForAdventProduct()?preorderInCart?preOrder&&preorderInCart?addItem(el,productFirstVraId,quantity):($(el).removeClass("disable-div"),preOrderAlert()):preOrder&&items.length>0?($(el).removeClass("disable-div"),preOrderAlert()):addItem(el,productFirstVraId,quantity):addItem(el,productFirstVraId,quantity)}function initializeSwiper(){document.querySelectorAll(".post-order-swiper").forEach(swiperContainer=>{const slideCount=swiperContainer.querySelectorAll(".swiper-slide.product-orders").length,slidesPerView=slideCount>5?5.3:slideCount,swiper2=new Swiper(swiperContainer,{slidesPerView:2,spaceBetween:10,pagination:{el:".swiper-pagination",clickable:!0},loop:!1,breakpoints:{450:{slidesPerView:2,loop:!1,spaceBetween:10},640:{slidesPerView:2.4,loop:!1,spaceBetween:10},768:{slidesPerView:3.2,loop:!1,spaceBetween:10},1250:{slidesPerView,spaceBetween:10}}})})}const observer=new MutationObserver(mutations=>{mutations.forEach(()=>{document.querySelectorAll(".swiper-slide.product-orders").length>0&&(initializeSwiper(),observer.disconnect())})}),postOrderSection=document.querySelectorAll(".post-order-swiper");postOrderSection.length>0&&theme.settings.recommendationId&&observer.observe(document.body,{childList:!0,subtree:!0});function preOrderAlert(){themeStyledAlert(theme.settings.preorderMessage||"Pre-order items cannot be combined in your purchase with other items that can be shipped immediately. To pre-order, place a separate order with only the Advent Calendar in your cart and we'll notify you when it ships!")}
406function updateSearchPlaceholder(){const placeholderText=$(".search-text-input").attr("data-placeholder-texts"),placeHolder=placeholderText.split("|"),typeWriterElement=$(".search-text-input");let placeholderValue=$(".search-text-input").attr("placeholder");function initialDelete(word,index){index>=0?(typeWriterElement.attr("placeholder",placeholderValue+word.substring(0,index)),setTimeout(()=>initialDelete(word,index-1),70+Math.random()*50)):StartWriter(1)}function delWriter(text,index,cb){index>=0?(typeWriterElement.attr("placeholder",placeholderValue+text.substring(0,index)),setTimeout(()=>delWriter(text,index-1,cb),70+Math.random()*100)):typeof cb=="function"&&setTimeout(cb,1e3)}function typeWriter(text,index,cb){index<=text.length?(typeWriterElement.attr("placeholder",placeholderValue+text.substring(0,index)),setTimeout(()=>typeWriter(text,index+1,cb,150),250-Math.random()*50)):setTimeout(()=>delWriter(text,index,cb),1e3)}function StartWriter(i){i>=placeHolder.length&&(i=0),typeWriter(placeHolder[i],0,()=>StartWriter(i+1))}const words=placeholderValue;let getlastWord=placeholderText.split("|");if(words.includes(getlastWord[0])){placeholderValue=words.replace(getlastWord[0],"");const lastWord=getlastWord[0];setTimeout(()=>initialDelete(lastWord,lastWord.length),3e3)}else setTimeout(()=>StartWriter(0),1e3)}if(storeUrl.includes("bokksu.com")||storeUrl.includes("bok-hashi.myshopify.com")||storeUrl.includes("btq-hashi.myshopify.com")){let currentlyOpenedSubmenu=null,currentlyOpenedIcon=null;$(".js-toggle-submenu").click(function(){let btn=this,nextSibling=btn.nextElementSibling,heroElement=nextSibling.querySelector(".hero__top-subtitle"),icon=btn.querySelector(".icon");heroElement&&(heroElement.style.display="none"),currentlyOpenedSubmenu&&currentlyOpenedSubmenu!==nextSibling&&currentlyOpenedSubmenu.classList.contains("is-active")&&(currentlyOpenedSubmenu.classList.remove("is-active"),heroElement=currentlyOpenedSubmenu.querySelector(".hero__top-subtitle"),heroElement.style.display="block",currentlyOpenedIcon&&currentlyOpenedIcon.classList.toggle("icon_rotate")),nextSibling.classList.contains("slide-nav__dropdown")&&(nextSibling.classList.toggle("is-active"),icon?.classList.toggle("icon_rotate"),currentlyOpenedSubmenu=nextSibling,currentlyOpenedIcon=icon)})}const checkExistRecentlyViewedSection=setInterval(()=>{let recentlyViewedSection=document.querySelector(".recently-viewed"),recentlyViewedSectionSlide=document.querySelector(".recently-viewed .swiper-slide.checking-slider-main");if(recentlyViewedSection&&recentlyViewedSectionSlide){const recentlyViewedSlide=recentlyViewedSection.querySelectorAll(".swiper-slide").length,swiper2=new Swiper(".recently-viewed",{slidesPerView:2,spaceBetween:10,pagination:{el:".swiper-pagination",clickable:!0},loop:!1,breakpoints:{450:{slidesPerView:2,spaceBetween:10,loop:!1},640:{slidesPerView:2.4,spaceBetween:10,loop:!1},768:{slidesPerView:3.2,loop:!1,spaceBetween:10},1250:{slidesPerView:recentlyViewedSlide>5?5.3:5,spaceBetween:10}}});clearInterval(checkExistRecentlyViewedSection)}},500);$(document).ready(function(){function isMobile(){return window.innerWidth<768}new MutationObserver(mutations=>{mutations.forEach(mutation=>{mutation.addedNodes.forEach(node=>{node.nodeType===1&&$(node).hasClass("Rise__widget")&&isMobile()&&$(".header-wrapper").hasClass("SGM")&&$(node).hide()})})}).observe(document.body,{childList:!0,subtree:!0}),isMobile()&&$(".Rise__widget").length&&$(".header-wrapper").hasClass("SGM")&&$(".Rise__widget").hide()}),document.addEventListener("ajaxProduct:added",function(evt){var cfg=theme.settings.maestraAtcPopup,added=evt.detail&&evt.detail.product;!cfg||!added||added.product_id!==Number(cfg.productId)||(function show(tries){if(window.PopMechanic)return window.PopMechanic.show(cfg.popupId);tries>0&&setTimeout(function(){show(tries-1)},500)})(20)});
407//# sourceMappingURL=/cdn/shop/t/3/assets/theme.js.map?v=132526422010737728721788431937

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.