(function(){var __sections__={};(function(){for(var i=0,s=document.getElementById("sections-script").getAttribute("data-sections").split(",");ithis.preventReveal=!0,this.addEventListener("preventHeaderReveal",this.hideHeaderOnScrollUp),window.addEventListener("scroll",this.onScrollHandler,!1),this.createObserver()}setHeaderHeight(){this.header&&document.documentElement.style.setProperty("--header-height",`${this.header.offsetHeight}px`)}disconnectedCallback(){this.removeEventListener("preventHeaderReveal",this.hideHeaderOnScrollUp),window.removeEventListener("scroll",this.onScrollHandler)}createObserver(){new IntersectionObserver((entries,observer2)=>{this.headerBounds=entries[0].intersectionRect,observer2.disconnect()}).observe(this.header)}onScroll(){const scrollTop=window.pageYOffset||document.documentElement.scrollTop;if(!(this.predictiveSearch&&this.predictiveSearch.isOpen)){if(scrollTop>this.currentScrollTop&&scrollTop>this.headerBounds.bottom){if(this.header.classList.add("scrolled-past-header"),this.preventHide)return;requestAnimationFrame(this.hide.bind(this))}else scrollTopthis.headerBounds.bottom?(this.header.classList.add("scrolled-past-header"),this.preventReveal?(window.clearTimeout(this.isScrolling),this.isScrolling=setTimeout(()=>{this.preventReveal=!1},66),requestAnimationFrame(this.hide.bind(this))):requestAnimationFrame(this.reveal.bind(this))):scrollTop<=this.headerBounds.top&&(this.header.classList.remove("scrolled-past-header"),requestAnimationFrame(this.reset.bind(this)));this.currentScrollTop=scrollTop}}hide(){this.headerIsAlwaysSticky||(this.header.classList.add("shopify-section-header-hidden","shopify-section-header-sticky"),this.closeMenuDisclosure(),this.closeSearchModal())}reveal(){this.headerIsAlwaysSticky||(this.header.classList.add("shopify-section-header-sticky","animate"),this.header.classList.remove("shopify-section-header-hidden"))}reset(){this.headerIsAlwaysSticky||this.header.classList.remove("shopify-section-header-hidden","shopify-section-header-sticky","animate")}closeMenuDisclosure(){this.disclosures=this.disclosures||this.header.querySelectorAll("header-menu"),this.disclosures.forEach(disclosure=>disclosure.close())}closeSearchModal(){this.searchModal=this.searchModal||this.header.querySelector("details-modal"),this.searchModal.close(!1)}}customElements.define("sticky-header",StickyHeader)}catch(e){console.error(e)}})(),(function(){if(__sections__.header)try{class StickyHeader extends HTMLElement{constructor(){super()}connectedCallback(){this.header=document.querySelector(".section-header"),this.headerIsAlwaysSticky=this.getAttribute("data-sticky-type")==="always"||this.getAttribute("data-sticky-type")==="reduce-logo-size",this.headerBounds={},this.setHeaderHeight(),window.matchMedia("(max-width: 990px)").addEventListener("change",this.setHeaderHeight.bind(this)),this.headerIsAlwaysSticky&&this.header.classList.add("shopify-section-header-sticky"),this.currentScrollTop=0,this.preventReveal=!1,this.predictiveSearch=this.querySelector("predictive-search"),this.onScrollHandler=this.onScroll.bind(this),this.hideHeaderOnScrollUp=()=>this.preventReveal=!0,this.addEventListener("preventHeaderReveal",this.hideHeaderOnScrollUp),window.addEventListener("scroll",this.onScrollHandler,!1),this.createObserver()}setHeaderHeight(){document.documentElement.style.setProperty("--header-height",`${this.header.offsetHeight}px`)}disconnectedCallback(){this.removeEventListener("preventHeaderReveal",this.hideHeaderOnScrollUp),window.removeEventListener("scroll",this.onScrollHandler)}createObserver(){new IntersectionObserver((entries,observer2)=>{this.headerBounds=entries[0].intersectionRect,observer2.disconnect()}).observe(this.header)}onScroll(){const scrollTop=window.pageYOffset||document.documentElement.scrollTop;if(!(this.predictiveSearch&&this.predictiveSearch.isOpen)){if(scrollTop>this.currentScrollTop&&scrollTop>this.headerBounds.bottom){if(this.header.classList.add("scrolled-past-header"),this.preventHide)return;requestAnimationFrame(this.hide.bind(this))}else scrollTopthis.headerBounds.bottom?(this.header.classList.add("scrolled-past-header"),this.preventReveal?(window.clearTimeout(this.isScrolling),this.isScrolling=setTimeout(()=>{this.preventReveal=!1},66),requestAnimationFrame(this.hide.bind(this))):requestAnimationFrame(this.reveal.bind(this))):scrollTop<=this.headerBounds.top&&(this.header.classList.remove("scrolled-past-header"),requestAnimationFrame(this.reset.bind(this)));this.currentScrollTop=scrollTop}}hide(){this.headerIsAlwaysSticky||(this.header.classList.add("shopify-section-header-hidden","shopify-section-header-sticky"),this.closeMenuDisclosure(),this.closeSearchModal())}reveal(){this.headerIsAlwaysSticky||(this.header.classList.add("shopify-section-header-sticky","animate"),this.header.classList.remove("shopify-section-header-hidden"))}reset(){this.headerIsAlwaysSticky||this.header.classList.remove("shopify-section-header-hidden","shopify-section-header-sticky","animate")}closeMenuDisclosure(){this.disclosures=this.disclosures||this.header.querySelectorAll("header-menu"),this.disclosures.forEach(disclosure=>disclosure.close())}closeSearchModal(){this.searchModal=this.searchModal||this.header.querySelector("details-modal"),this.searchModal.close(!1)}}customElements.define("sticky-header",StickyHeader)}catch(e){console.error(e)}})(),(function(){if(!(!__sections__["product-page"]&&!Shopify.designMode))try{(function(){document.querySelectorAll(".pdp-section").forEach(function(root){var gallery=root.querySelector("[data-gallery]");if(gallery){let thumbStep2=function(){var first=thumbsTrack.querySelector(".gal__thumb");if(!first)return 80;var w=first.offsetWidth,gap=8;return w+gap},updateThumbsCarousel2=function(){if(!(!thumbsTrack||!thumbsViewport)){var trackWidth=thumbsTrack.scrollWidth,viewportWidth=thumbsViewport.offsetWidth,maxScroll=Math.max(0,trackWidth-viewportWidth);thumbScrollPos>maxScroll&&(thumbScrollPos=maxScroll),thumbScrollPos<0&&(thumbScrollPos=0),thumbsTrack.style.transform="translateX(-"+thumbScrollPos+"px)",thumbPrev&&(thumbPrev.disabled=thumbScrollPos<=0),thumbNext&&(thumbNext.disabled=thumbScrollPos>=maxScroll);var hasOverflow=trackWidth>viewportWidth;thumbPrev&&(thumbPrev.style.display=hasOverflow?"":"none"),thumbNext&&(thumbNext.style.display=hasOverflow?"":"none")}},activateSlide2=function(target){if(mainSlides.forEach(function(s){s.classList.toggle("is-active",s.dataset.slide===target)}),thumbs.forEach(function(t){t.classList.toggle("is-active",t.dataset.thumbTarget===target)}),target==="video"&&videoIframe){var key=(videoIframe.dataset.youtubeKey||"").trim(),currentSrc=videoIframe.getAttribute("src")||"";key&¤tSrc.indexOf("youtube.com/embed/")===-1&&videoIframe.setAttribute("src","https://www.youtube.com/embed/"+key+"?autoplay=1&rel=0&playsinline=1")}else if(videoIframe){var currentSrc2=videoIframe.getAttribute("src")||"";currentSrc2.indexOf("youtube.com/embed/")!==-1&&videoIframe.setAttribute("src","")}if(target==="model"&&modelViewer){var glbSrc=(modelViewer.dataset.glbSrc||"").trim(),currentGlb=modelViewer.getAttribute("src")||"";glbSrc&¤tGlb===""&&modelViewer.setAttribute("src",glbSrc)}};var thumbStep=thumbStep2,updateThumbsCarousel=updateThumbsCarousel2,activateSlide=activateSlide2,mainSlides=gallery.querySelectorAll("[data-slide]"),thumbs=gallery.querySelectorAll("[data-thumb-target]"),videoIframe=gallery.querySelector("[data-video-iframe]"),modelViewer=gallery.querySelector("[data-model-viewer]"),closeButtons=gallery.querySelectorAll("[data-close-overlay]"),zoomWraps=gallery.querySelectorAll("[data-zoom-wrap]");zoomWraps.forEach(function(wrap){var zoomImage=wrap.dataset.zoomImage;if(!zoomImage)return;var preloader=new Image;preloader.src=zoomImage,wrap.addEventListener("mouseenter",function(){wrap.style.backgroundImage="url('"+zoomImage+"')",wrap.classList.add("is-zooming")});function clearZoom(){wrap.classList.remove("is-zooming"),wrap.style.backgroundImage="",wrap.style.backgroundPosition="",wrap.style.backgroundColor=""}wrap.addEventListener("mouseleave",clearZoom),wrap.addEventListener("blur",clearZoom),wrap.addEventListener("mousemove",function(e){var rect=wrap.getBoundingClientRect(),x=(e.clientX-rect.left)/rect.width*100,y=(e.clientY-rect.top)/rect.height*100;x=Math.max(0,Math.min(100,x)),y=Math.max(0,Math.min(100,y)),wrap.style.backgroundPosition=x+"% "+y+"%"})});var thumbsTrack=gallery.querySelector("[data-thumbs-track]"),thumbsViewport=gallery.querySelector("[data-thumbs-viewport]"),thumbPrev=gallery.querySelector("[data-thumb-prev]"),thumbNext=gallery.querySelector("[data-thumb-next]"),thumbScrollPos=0;thumbPrev&&thumbPrev.addEventListener("click",function(){thumbScrollPos-=thumbStep2()*3,updateThumbsCarousel2()}),thumbNext&&thumbNext.addEventListener("click",function(){thumbScrollPos+=thumbStep2()*3,updateThumbsCarousel2()}),window.addEventListener("resize",updateThumbsCarousel2),setTimeout(updateThumbsCarousel2,50),thumbs.forEach(function(thumb){thumb.addEventListener("click",function(){activateSlide2(thumb.dataset.thumbTarget)})}),closeButtons.forEach(function(btn){btn.addEventListener("click",function(){activateSlide2("0")})})}var qtyInput=root.querySelector("[data-qty-input]"),qtyDec=root.querySelector("[data-qty-decrement]"),qtyInc=root.querySelector("[data-qty-increment]");function updateSubtotal(){var priceEl=root.querySelector("[data-product-price]"),subtotalEl=root.querySelector("[data-subtotal]");if(!(!priceEl||!subtotalEl||!qtyInput)){var qty=parseInt(qtyInput.value,10)||1,raw=priceEl.textContent.trim(),prefixMatch=raw.match(/^[^\d-]+/),prefix=prefixMatch?prefixMatch[0]:"$",suffixMatch=raw.match(/[^\d.,]+$/),suffix=suffixMatch?suffixMatch[0]:"",priceText=raw.replace(/[^0-9.,-]/g,"").replace(/,/g,""),price=parseFloat(priceText)||0,total=price*qty,totalStr=total.toFixed(2),parts=totalStr.split(".");parts[0]=parts[0].replace(/\B(?=(\d{3})+(?!\d))/g,",");var formatted=parts.join(".");subtotalEl.textContent=prefix+formatted+suffix}}qtyInput&&qtyDec&&qtyInc&&(qtyDec.addEventListener("click",function(){var val=parseInt(qtyInput.value,10)||1;val>1&&(qtyInput.value=val-1),updateSubtotal()}),qtyInc.addEventListener("click",function(){var val=parseInt(qtyInput.value,10)||1;qtyInput.value=val+1,updateSubtotal()}),qtyInput.addEventListener("change",updateSubtotal));var optionBtns=root.querySelectorAll("[data-option-position]");optionBtns.forEach(function(btn){btn.addEventListener("click",function(){var pos=btn.dataset.optionPosition,siblings=root.querySelectorAll('[data-option-position="'+pos+'"]');siblings.forEach(function(sib){sib.classList.toggle("is-selected",sib===btn)});var selectedSpan=root.querySelector('[data-option-selected="'+pos+'"]');selectedSpan&&(selectedSpan.textContent=btn.dataset.optionValue)})});var wishlistBtn=root.querySelector("[data-wishlist-btn]");wishlistBtn&&wishlistBtn.addEventListener("click",function(){wishlistBtn.classList.toggle("is-active")});var accContainer=root.querySelector("[data-pdp-accordion]");if(accContainer){var accTriggers=accContainer.querySelectorAll("[data-acc-trigger]"),keepMultipleOpen=accContainer.dataset.multiple==="true";accTriggers.forEach(function(trigger){trigger.addEventListener("click",function(){var item=trigger.closest(".pdp-acc__item"),isOpen=item.classList.contains("is-open");!keepMultipleOpen&&!isOpen&&accContainer.querySelectorAll(".pdp-acc__item.is-open").forEach(function(other){if(other!==item){other.classList.remove("is-open");var otherTrigger=other.querySelector("[data-acc-trigger]");otherTrigger&&otherTrigger.setAttribute("aria-expanded","false")}}),item.classList.toggle("is-open"),trigger.setAttribute("aria-expanded",item.classList.contains("is-open")?"true":"false")})})}});function openModal(modalId){var modal=document.querySelector('[data-modal="'+modalId+'"]');modal&&(modal.classList.add("is-open"),modal.setAttribute("aria-hidden","false"),document.body.style.overflow="hidden")}function closeAllModals(){document.querySelectorAll(".pdp-modal.is-open").forEach(function(m){m.classList.remove("is-open"),m.setAttribute("aria-hidden","true")}),document.body.style.overflow=""}document.querySelectorAll("[data-open-modal]").forEach(function(btn){btn.addEventListener("click",function(e){e.preventDefault(),openModal(btn.dataset.openModal)})}),document.querySelectorAll("[data-modal-close]").forEach(function(btn){btn.addEventListener("click",closeAllModals)}),document.addEventListener("keydown",function(e){e.key==="Escape"&&closeAllModals()})})()}catch(e){console.error(e)}})(),(function(){if(__sections__["swym-registry-manage"])try{const swymRegistry_pageWrapper=document.getElementsByClassName("swym-registry-wrapper")[0],swymRegistry_manageHeader=document.getElementsByClassName("swym-registry-manage-page-header")[0],swymRegistry_manageGridLists=document.getElementsByClassName("swym-registry-manage-page-grid-section")[0],swymRegistry_headerTotalRegistries=document.getElementById("swym-registry-manage-page-header-info-total-registries"),swymRegistry_gridLists=document.getElementById("swym-registry-manage-page-grid-lists");async function swymRegistryOnloadHandler(){if(!Shopify.designMode){document.querySelector("#swym-registry-share-mail-link")&&document.querySelector("#swym-registry-share-mail-link").addEventListener("click",()=>{_LTracker.push({eventInfo:"Share by mail button clicked - Manage",tag:"event"}),Shopify.analytics.publish("swym_registry_manage_view",{eventAction:"Share by mail button clicked",customerInfo:{name:"{{ customer.name }}",email:"{{ customer.email }}",id:"{{ customer.id }}"}})});async function swymRegistry_getRegistryByEmail(authData){const swymRegistry_customerEmail=swymRegistryCustomer.email,token=authData.swym_registry.jwt.token;return swymRegistry_getAllRegistries(swymRegistry_customerEmail,token).then(response=>response.json()).then(data=>{if(data.length)try{swymRegistry_headerTotalRegistries.innerText=data.length>1?data.length+" "+swymRegistryStrings.swym_registry_registries_label:data.length+" "+swymRegistryStrings.swym_registry_registry_label,swymRegistry_manageHeader.style.visibility="visible",swymRegistry_pageWrapper.style.visibility="visible",data.forEach(registry=>{let swymRegistry_fname=registry.address.firstName,swymRegistry_lname=registry.address.lastName,swymRegistry_initials;return swymRegistry_fname&&swymRegistry_lname?swymRegistry_initials=swymRegistry_fname.charAt(0)+swymRegistry_lname.charAt(0):swymRegistry_initials=registry.creatorName.charAt(0),swymRegistry_gridLists.innerHTML+=`
  • ${swymRegistry_initials}

    ${registry.registryName}

    • ${swymRegistryStrings.swym_registry_reg_id_label} : ${registry.Id}
    • ${swymRegistryStrings.swym_registry_event_date_label} : ${registry.expiryDate}
    • ${swymRegistryStrings.swym_registry_event_type_label} : ${registry.occasion}

    ${swymRegistryStrings.swym_registry_description_label}

    ${registry.description}

  • `,registry.description.length===0&&(document.querySelector(`#swym-registry-manage-page-grid-lists-registry-description-title-${registry.Id}`).style.display="none",document.querySelector(`#swym-registry-manage-page-grid-lists-registry-description-${registry.Id}`).style.display="none"),"success"})}catch(error){return console.error("Error in showing list of registries for user: ",error),"failed"}else try{const swymRegistry_emptyCardSection=document.getElementById("swym-registry-manage-page-empty-section");swymRegistry_headerTotalRegistries.innerText="0 "+swymRegistryStrings.swym_registry_registry_label,swymRegistry_manageHeader.style.visibility="visible",swymRegistry_pageWrapper.style.visibility="visible",swymRegistry_manageGridLists.style.display="none",swymRegistry_emptyCardSection.style.display="block",document.getElementById("swym-registry-manage-page-create-btn").addEventListener("click",function(e){e.preventDefault(),Shopify.analytics.publish("swym_registry_manage_view",{eventAction:"Create Registry button clicked",customerInfo:{name:"{{ customer.name }}",email:"{{ customer.email }}",id:"{{ customer.id }}"}}),window.location="/pages/swym-registry-form?mode=create"})}catch(error){console.log("Error in Showing 'No registries found card'",error)}}).catch(error=>{_LTracker.push({ErrorLocation:"Get all registries API call - Manage Template",ErrorInfo:{error:{msg:error.message,Reference_stack:error.stack}},MerchantInfo:{pid:authData.swym_registry.pid,shop:Shopify.shop,themeId:Shopify.theme.id,themeName:Shopify.theme.name},CustomerInfo:{customerId:authData.swym_registry.customerId,customerEmail:swymRegistryCustomer.email,userAgent:navigator.userAgent}})})}var swymRegistry_lsInit=JSON.parse(localStorage.getItem(swymRegistry_lsName));const swymRegistry_authData=await swymRegistry_refreshAuth(swymRegistryCustomer,swymRegistry_lsInit);swymRegistry_getRegistryByEmail(swymRegistry_authData),document.querySelector("#swym-registry-copy-text").value=window.location.href}}swymRegistryAddOnloadEvent(swymRegistryOnloadHandler)}catch(e){console.error(e)}})()})(); //# sourceMappingURL=/cdn/shop/t/2/compiled_assets/scripts.js.map?v=111484996553942815671786441501