1window.onSubmitAtcFormGiftBox=async form=>{console.log("onSubmitAtcFormGiftBox");const giftBoxToggle=document.querySelector("#gift-box-toggle .cyg-toggle"),giftBandToggle=document.querySelector("#gift-band-toggle .cyg-toggle"),giftBandSelect=document.querySelector("#product-option-gift-band"),quantityInput=form.querySelector('input[name="quantity"]'),quantity=quantityInput&&parseInt(quantityInput.value,10)||1,uuid=crypto.randomUUID(),items=[],selectedGiftBoxName=giftBandSelect?.options[giftBandSelect.selectedIndex]?.text||"Default Gift Box Name",parentProductTitle=giftBandSelect?.dataset?.parentProduct||"",giftBoxProperties={};if(giftBoxToggle&&giftBoxToggle.checked&&giftBandToggle&&giftBandToggle.checked?(giftBoxProperties._bundleId=uuid,giftBoxProperties._GiftBandMessage=selectedGiftBoxName):giftBandToggle&&giftBandToggle.checked&&(giftBoxProperties._GiftBandMessage=selectedGiftBoxName),giftBoxToggle&&giftBoxToggle.checked)if(giftBandToggle&&giftBandToggle.checked){const giftBoxProperties2={_bundle_id:uuid,_bundleId:uuid,_bundle_parent:!0};items.push({id:Number(giftBoxToggle.value),quantity,properties:giftBoxProperties2})}else items.push({id:Number(giftBoxToggle.value),quantity});if(giftBandToggle&&giftBandToggle.checked){const giftBandVariantId=giftBandSelect.options[giftBandSelect.selectedIndex]?.value;if(giftBandVariantId){const giftBandProperties={Box:parentProductTitle,_bundle_id:uuid,_bundleParentId:uuid};items.push({id:Number(giftBandVariantId),quantity,properties:giftBandProperties})}}const btn=form.querySelector(".btn-atc"),savedBtnInnerHtml=btn.innerHTML;btn.innerHTML=` 2 <div class="spinner-border spinner-border-sm" role="status"> 3 <span class="visually-hidden">Loading...</span> 4 </div> 5 `,form.classList.add("loading"),console.log(items);const response=await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items})});form.classList.remove("loading"),btn.innerHTML=savedBtnInnerHtml,window.refreshCartContents(response),document.querySelector("#offcanvas-cart")&&bootstrap.Offcanvas.getOrCreateInstance("#offcanvas-cart").show(),document.querySelectorAll(".quick-view-modal").forEach(modalElement=>{const modalInstance=bootstrap.Modal.getInstance(modalElement);modalInstance&&modalInstance.hide()})},window.onSubmitAtcForm=async(form,event)=>{event.preventDefault();
5const giftBoxToggle=document.querySelector("#gift-box-toggle .cyg-toggle");if(giftBoxToggle&&giftBoxToggle.checked)return onSubmitAtcFormGiftBox(form);let formData=new FormData(form);const btn=form.querySelector(".btn-atc"),savedBtnInnerHtml=btn.innerHTML;btn.innerHTML=` 6 <div class="spinner-border spinner-border-sm" role="status"> 7 <span class="visually-hidden">Loading...</span> 8 </div> 9 `,form.classList.add("loading");const response=await fetch("/cart/add.js",{method:"POST",body:formData});form.classList.remove("loading"),btn.innerHTML=savedBtnInnerHtml,window.refreshCartContents(response),document.querySelector("#offcanvas-cart")&&bootstrap.Offcanvas.getOrCreateInstance("#offcanvas-cart").show(),document.querySelectorAll(".quick-view-modal").forEach(modalElement=>{const modalInstance=bootstrap.Modal.getInstance(modalElement);modalInstance&&modalInstance.hide()})},window.onClickAtcFormVariant=async(btn,event)=>{const form=btn.closest("form");form.querySelector('[name="id"]').value=btn.dataset.variantId,window.onSubmitAtcForm(form,event)};let currentPriceFetch=null;window.onChangeProductOption=async input=>{const selectedOptions=[];input.closest("form").querySelectorAll(".product-option").forEach(elem=>{elem.type==="radio"?elem.checked&&selectedOptions.push(elem.value):selectedOptions.push(elem.value)});const selectedVariant=window.productVariants.find(variant=>JSON.stringify(variant.options)===JSON.stringify(selectedOptions)),btn=input.closest("form").querySelector(".btn-atc");if(selectedVariant){input.closest("form").querySelector('[name="id"]').value=selectedVariant.id,selectedVariant.available?(btn.disabled=!1,btn.innerHTML=window.theme.product.addToCart):(btn.disabled=!0,btn.innerHTML=window.theme.product.soldOut),currentPriceFetch&¤tPriceFetch.abort&¤tPriceFetch.abort();const controller=new AbortController;currentPriceFetch=controller;const priceElement=input.closest(".product-content").querySelector(".product-price");priceElement.style.position="relative",priceElement.insertAdjacentHTML("beforeend",` 10 <svg style=" 11 width: 24px; 12 height: 24px; 13 animation: spin 1s linear infinite; 14"> 15<style> 16 @keyframes spin { 17 from { transform: rotate(0deg); } 18 to { transform: rotate(360deg); } 19 } 20</style> xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"> 21 <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> 22 <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> 23 </svg> 24 </div> 25 `);try{const url=new URL(window.location);url.searchParams.set("variant",selectedVariant.id);const text=await(await fetch(url.toString(),{signal:controller.signal})).text(),newDocument=new DOMParser().parseFromString(text,"text/html"),priceElement2=input.closest(".product-content").querySelector(".product-price"),existingSpinner=priceElement2.querySelector(".price-loading-spinner");existingSpinner&&existingSpinner.remove();const newProductPrice=newDocument.querySelector(".product-price");newProductPrice&&priceElement2&&priceElement2.replaceWith(newProductPrice.cloneNode(!0))}catch(error){error.name!=="AbortError"&&console.error("Error fetching updated price:",error)}const purchaseOptionsWrapper=document.querySelector("#product-purchase-options");purchaseOptionsWrapper&&(purchaseOptionsWrapper.querySelector("input#purchase-options-one-time + label [data-price]").textContent=Shopify.formatMoney(selectedVariant.price),purchaseOptionsWrapper.querySelector("input#purchase-options-subscription + label [data-price]").textContent=Shopify.formatMoney(selectedVariant.selling_plan_allocations[0].price));const skuWrapper=input.closest(".product-content").querySelector(".current-variant-sku");if(skuWrapper&&(selectedVariant.sku.length?(skuWrapper.textContent=selectedVariant.sku,skuWrapper.removeAttribute("hidden")):skuWrapper.setAttribute("hidden","hidden")),input.closest("#product-template")){const url=new URL(window.location);url.searchParams.set("variant",selectedVariant.id),window.history.replaceState({},"",url)}
25const customEvent=new CustomEvent("variantChange.ecomify.product",{detail:selectedVariant});window.dispatchEvent(customEvent)}else btn.disabled=!0,btn.innerHTML=window.theme.product.unavailable;input.closest(".color-swatches")&&(input.closest(".product-option-wrapper").querySelector(".color-swatches-title span").textContent=input.value),input.closest(".size-buttons")&&(input.closest(".product-option-wrapper").querySelector(".size-buttons-title span").textContent=input.value)},window.addEventListener("variantChange.ecomify.product",async event=>{const inventoryBar=document.querySelector("#inventory-bar");inventoryBar&&(inventoryBar.style.opacity=".25");const text=await(await fetch(window.location.href)).text(),newDocument=new DOMParser().parseFromString(text,"text/html");document.querySelector("#inventory-bar")?.replaceWith(newDocument.querySelector("#inventory-bar")),document.querySelector("#product-qty-breaks")?.replaceWith(newDocument.querySelector("#product-qty-breaks")),document.querySelector("#product-store-availability-wrapper")?.replaceWith(newDocument.querySelector("#product-store-availability-wrapper")),initInventoryBar(),initQtyBreaks()});const initPurchaseOptions=()=>{const wrapper=document.querySelector("#product-purchase-options");wrapper&&wrapper.querySelectorAll('[name="purchase_option"]').forEach(input=>{input.addEventListener("change",()=>{input.id==="purchase-options-one-time"?(wrapper.querySelector("#purchase-delivery-options").setAttribute("hidden","hidden"),wrapper.querySelector('[name="selling_plan"]').disabled=!0):(wrapper.querySelector("#purchase-delivery-options").removeAttribute("hidden"),wrapper.querySelector('[name="selling_plan"]').disabled=!1)})})};initPurchaseOptions(),window.onChangeProductItemVariant=(select,event)=>{select.options[select.selectedIndex].dataset.variantImage?.length&&(select.closest(".product-item").querySelector(".product-item-img").src=select.options[select.selectedIndex].dataset.variantImage);const compareAtPrice=select.options[select.selectedIndex].dataset.compareAtPrice,price=select.options[select.selectedIndex].dataset.price;compareAtPrice.length?select.closest(".product-item").querySelector(".product-item-price").innerHTML=` 26 <span class="product-item-price-compare text-muted me-1"> 27 ${Shopify.formatMoney(compareAtPrice)} 28 </span> 29 <span class="product-item-price-final"> 30 ${Shopify.formatMoney(price)} 31 </span> 32 `:select.closest(".product-item").querySelector(".product-item-price").innerHTML=` 33 <span class="product-item-price-final"> 34 ${Shopify.formatMoney(price)} 35 </span> 36 `},window.onClickBuyBtn=btn=>{btn.innerHTML=` 37 <div class="spinner-border spinner-border-sm" role="status"> 38 <span class="visually-hidden">Loading...</span> 39 </div> 40 `;const form=btn.closest("form"),variantId=form.querySelector('[name="id"]').value,qty=Number(form.querySelector('input[name="quantity"]')?.value||1);window.location.href=`/cart/${variantId}:${qty}`};const initProductGallery=()=>{document.querySelectorAll(".product-gallery:not(.init)").forEach(gallery=>{gallery.classList.add("init");const main=new Splide(gallery.querySelector(".main-splide"),{start:Number(gallery.dataset.start),rewind:!0,arrows:!1,rewindByDrag:!0,pagination:!1,noDrag:"model-viewer",mediaQuery:"min",breakpoints:{0:{padding:0,pagination:!0},992:{padding:0,pagination:!1}}}),totalSlides=gallery.querySelectorAll(".main-splide .splide__slide").length,thumbs=new Splide(gallery.querySelector(".thumbs-splide"),{start:Number(gallery.dataset.start),gap:".5rem",rewind:!0,rewindByDrag:!0,pagination:!1,isNavigation:!0,focus:totalSlides>5?"center":0,mediaQuery:"min",breakpoints:{0:{perPage:4,arrows:!0},576:{perPage:5,arrows:!0},768:{perPage:5,arrows:!0},992:{perPage:5,arrows:!0},1200:{perPage:5,arrows:!0},1400:{perPage:5,arrows:!0}}});main.on("move",(newIndex,prevIndex)=>{const iframe=gallery.querySelector(`.splide__slide:nth-child(${prevIndex+1}) iframe`),video=gallery.querySelector(`.splide__slide:nth-child(${prevIndex+1}) video`);iframe&&(iframe.src=iframe.src),video&&video.pause()}),window.addEventListener("variantChange.ecomify.product",event=>{const selectedVariant=event.detail;selectedVariant.featured_media&&main.go(selectedVariant.featured_media.position-1)}
40,!1),main.sync(thumbs),main.mount(),thumbs.mount(),window.GLightbox&&GLightbox({selector:`[data-gallery="product-gallery-${gallery.dataset.productId}"]`,videosWidth:"1290px",loop:!0}).on("slide_changed",({prev,current})=>{main.go(current.index)});const modelViewer=gallery.querySelector("model-viewer");if(modelViewer){const increaseBtn=gallery.querySelector("[data-model-3d-increase-zoom]"),decreaseBtn=gallery.querySelector("[data-model-3d-decrease-zoom]"),fullscreenBtn=gallery.querySelector("[data-model-3d-fullscreen]");increaseBtn.addEventListener("click",()=>{modelViewer.zoom(1)}),decreaseBtn.addEventListener("click",()=>{modelViewer.zoom(-1)}),fullscreenBtn.addEventListener("click",()=>{document.fullscreenElement?(document.exitFullscreen(),fullscreenBtn.querySelector(".bi-fullscreen").removeAttribute("hidden"),fullscreenBtn.querySelector(".bi-fullscreen-exit").setAttribute("hidden","hidden")):(modelViewer.closest(".product-gallery-model-3d").requestFullscreen(),fullscreenBtn.querySelector(".bi-fullscreen").setAttribute("hidden","hidden"),fullscreenBtn.querySelector(".bi-fullscreen-exit").removeAttribute("hidden"))})}})};initProductGallery(),document.addEventListener("shopify:section:load",e=>{e.target.querySelector(".product-gallery")&&initProductGallery()}),window.addEventListener("updated.ecomify.collection",initProductGallery);const initInventoryBar=()=>{const wrapper=document.querySelector("#inventory-bar");if(!wrapper)return;const progressBar=wrapper.querySelector(".progress-bar");setTimeout(()=>{progressBar.style.width=progressBar.dataset.width},250)};initInventoryBar(),document.addEventListener("shopify:section:load",e=>{e.target.querySelector("#inventory-bar")&&initInventoryBar()});const initUpsellModal=()=>{const modal=document.querySelector("#product-upsell-modal");if(!modal)return;const form=document.querySelector('#product-content form[onsubmit*="onSubmitAtcForm"]');form&&(form.setAttribute("data-ecomify-upsell-modal","true"),form.addEventListener("submit",e=>{bootstrap.Modal.getOrCreateInstance("#product-upsell-modal").show()}),document.querySelectorAll("#product-upsell-modal .btn-atc").forEach(btn=>{btn.addEventListener("click",()=>{const footerBtn=document.querySelector("#product-upsell-modal .modal-footer .btn");footerBtn.classList.remove(footerBtn.dataset.defaultClass),footerBtn.classList.add(footerBtn.dataset.activeClass)})}),modal.addEventListener("hidden.bs.modal",()=>{bootstrap.Offcanvas.getOrCreateInstance("#offcanvas-cart").show()}))};initUpsellModal(),document.addEventListener("shopify:section:load",e=>{e.target.querySelector("#product-upsell-modal")&&initUpsellModal()});const initBoughtTogether=()=>{if(!document.querySelector("#product-bought-together"))return;const setTotalPrice=()=>{let totalCompareAtPrice=0,totalPrice=0;document.querySelectorAll("#product-bought-together .product-item-price").forEach(elem=>{elem.closest(".product-item").querySelector(".bought-together-check:checked")&&(totalCompareAtPrice+=elem.dataset.compareAtPrice.length?Number(elem.dataset.compareAtPrice):Number(elem.dataset.price),totalPrice+=Number(elem.dataset.price))});const totalElem=document.querySelector("#bought-together-total");totalCompareAtPrice>totalPrice?totalElem.innerHTML=` 41 ${totalElem.dataset.textTotalPrice}: 42 <span class="bought-together-total-compare-price text-muted me-2"> 43 <span class="visually-hidden"> 44 ${window.theme.product.priceFrom} 45 </span> 46 <s> 47 ${Shopify.formatMoney(totalCompareAtPrice)} 48 </s> 49 </span> 50 <span class="bought-together-total-price text-success"> 51 <span class="visually-hidden"> 52 ${window.theme.product.priceSale} 53 </span> 54 ${Shopify.formatMoney(totalPrice)} 55 </span> 56 `:totalElem.innerHTML=` 57 ${totalElem.dataset.textTotalPrice}: 58 <span class="bought-together-total-price"> 59 ${Shopify.formatMoney(totalPrice)} 60 </span> 61 `};document.querySelectorAll(".bought-together-check").forEach(checkbox=>{checkbox.addEventListener("change",()=>{checkbox.checked?checkbox.closest(".product-item").style.opacity="1":checkbox.closest(".product-item").style.opacity=".5",document.querySelector(".bought-together-check:checked")?document.querySelector("#bought-together-atc").disabled=!1:document.querySelector("#bought-together-atc").disabled=!0,setTotalPrice()})}),document.querySelectorAll('#product-bought-together select[name="id"]').forEach(select=>{select.addEventListener("change",()=>{const compareAtPrice=select.options[select.selectedIndex].dataset.compareAtPrice,price=select.options[select.selectedIndex].dataset.price;select.closest(".product-item").querySelector(".product-item-price").setAttribute("data-compare-at-price",compareAtPrice),select.closest(".product-item").querySelector(".product-item-price").setAttribute("data-price",price),setTotalPrice()})}),document.querySelector("#bought-together-atc").addEventListener("click",async e=>{const btn=e.target;btn.style.width=btn.clientWidth+4+"px",btn.innerHTML=` 62 <div class="spinner-border spinner-border-sm" role="status">
63 <span class="visually-hidden">Loading...</span> 64 </div> 65 `;const items=[];document.querySelectorAll("#product-bought-together .product-item").forEach(elem=>{elem.querySelector(".bought-together-check:checked")&&items.push({id:Number(elem.querySelector('[name="id"]').value),quantity:1})});const response=await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items})});btn.innerHTML=window.theme.product.addedToCart,setTimeout(()=>{btn.innerHTML=btn.dataset.textAddToCart},2e3),window.refreshCartContents(response),bootstrap.Offcanvas.getOrCreateInstance("#offcanvas-cart").show()})};initBoughtTogether();const initQtyBreaks=()=>{document.querySelectorAll('[name="product-qty-breaks"]').forEach(radio=>{radio.addEventListener("change",()=>{const qty=Number(radio.dataset.qty),qtyField=radio.closest("form").querySelector('[name="quantity"]'),btn=radio.closest("form").querySelector('button[name="add"]');qtyField&&(qtyField.value=qty,setTimeout(()=>{btn.classList.add("animate__animated","animate__shakeX")},250),setTimeout(()=>{btn.classList.remove("animate__animated","animate__shakeX")},1500))})})};initQtyBreaks();const initPrevNextButtons=async()=>{const wrapper=document.querySelector("#product-prev-next");if(!wrapper||!window.matchMedia("(max-width: 1599px)").matches)return;await new Promise(resolve=>setTimeout(resolve,1e3));const threshold=document.querySelector(".product-content .form-wrapper").getBoundingClientRect().bottom+window.scrollY;window.addEventListener("scroll",()=>{window.scrollY>threshold?wrapper.classList.add("show"):wrapper.classList.remove("show")})};initPrevNextButtons();const initGiftPersonalization=()=>{const noteCollapse=document.querySelector("#gift-personalization-note-collapse");if(!noteCollapse)return;const noteCollapseBtn=document.querySelector("#gift-personalization-note-collapse-btn");noteCollapse.addEventListener("show.bs.collapse",event=>{noteCollapseBtn.querySelector(".form-check-input").checked=!0}),noteCollapse.addEventListener("hide.bs.collapse",event=>{noteCollapseBtn.querySelector(".form-check-input").checked=!1})};initGiftPersonalization();const initLimitedOffer=()=>{const block=document.querySelector("#product-limited-offer");if(!block)return;const icon=block.querySelector(".block-icon");setInterval(()=>{icon.classList.add("animate__animated","animate__tada"),setTimeout(()=>{icon.classList.remove("animate__animated","animate__tada")},1500)},3e3)};initLimitedOffer(),document.querySelectorAll(".product-delivery-info").forEach(elem=>{const firstSpan=elem.querySelector(".description span:first-child"),secondSpan=elem.querySelector(".description span:last-child");firstSpan&&(firstSpan.textContent=dayjs().add(Number(firstSpan.textContent.replace("days","")),"day").format("MMM DD")),secondSpan&&(secondSpan.textContent=dayjs().add(Number(secondSpan.textContent.replace("days","")),"day").format("MMM DD"))});const initQuickViewReadMore=()=>{document.querySelectorAll(".quick-view-product-description").forEach(elem=>{elem.querySelectorAll("p").forEach((p,index)=>{index===0?(p.style.textOverflow="ellipsis",p.insertAdjacentHTML("beforeend",` 66 <a 67 href="javascript:void(0)" 68 class="view-more-toggle-btn" 69 role="button"> 70 Read all... 71 </a> 72 `),p.querySelector(".view-more-toggle-btn").addEventListener("click",()=>{elem.querySelectorAll("p").forEach(p2=>{p2.style.display="block"}),p.querySelector(".view-more-toggle-btn").remove()})):p.style.display="none"})})};initQuickViewReadMore(),document.querySelectorAll("button.btn-toggler-gift-box").forEach(btn=>{btn.addEventListener("click",event=>{if(event.preventDefault(),btn.classList.contains("active")){btn.classList.remove("active"),btn.innerHTML="Add A Gift Box",btn.closest("form").querySelector('[name="id"]').setAttribute("value",btn.dataset.withoutGiftBoxVariantId);let priceElement=btn.closest("form").parentNode.nextElementSibling,currencyValue=(parseInt(btn.dataset.withoutGiftBoxPrice,10)/100).toLocaleStr
72ing("en-US",{style:"currency",currency:"USD"});console.log(priceElement),console.log(currencyValue),priceElement.innerHTML=`${priceElement.innerText.split("|")[0].trim()} | ${currencyValue}`}else{btn.classList.add("active"),btn.innerHTML="Gift Box Included",btn.closest("form").querySelector('[name="id"]').setAttribute("value",btn.dataset.withGiftBoxVariantId);let priceElement=btn.closest("form").parentNode.nextElementSibling,currencyValue=(parseInt(btn.dataset.withGiftBoxPrice,10)/100).toLocaleString("en-US",{style:"currency",currency:"USD"});console.log(priceElement),console.log(currencyValue),priceElement.innerHTML=`${priceElement.innerText.split("|")[0].trim()} | ${currencyValue}`}})}); 73//# sourceMappingURL=/cdn/shop/t/331/assets/product.js.map?v=109783867329662159001781208179
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.