1class OverlapNavigation extends HTMLElement{constructor(){super(),this._mounted=!1,this._inited=!1,this.firstSec=null,this.header=null,this.footer=null,this.invertedElements=null,this.sidebars=null,this.announcementBar=null,this.announcementBarHeight=0,this.headerGroup=null,this.headerGroupSections=null,this.headerHeight=0,this.headerGroupHeight=0,this.currentScrollPos=0,this.lastScrollPos=0,this.scrollDelta=!1,this.themeContentEl=null,this._scrollRaf=0,this._handleChangesRaf=0,this._onScrollBound=this._onScrollRaf.bind(this),this._onMobileScrollBound=this._onMobileScrollRaf.bind(this),this._onResizeBound=this._onResize.bind(this),this._sidebarScrollHandlers=new WeakMap,this._io=null,this._firstIntent=null,this._initScheduled=!1,this._didFirstInvertPass=!1,this._invertHeaderTimer=0,Shopify.designMode&&["shopify:section:load","shopify:section:reorder","shopify:section:unload","shopify:section:select","shopify:section:deselect"].forEach(eventName=>{document.addEventListener(eventName,()=>this._scheduleHandleSectionChanges())}),document.addEventListener("collapsible-menu:opened",()=>{setTimeout(()=>{this._inited?this._scheduleHandleSectionChanges():this._scheduleInitSoon("menu")},350)})}connectedCallback(){this._mounted||(this._mounted=!0,this._armLazyInit(),this._lastWidth=window.innerWidth,window.addEventListener("resize",this._onResizeBound,{passive:!0}))}disconnectedCallback(){this._mounted=!1,this._disarmLazyInit(),this._scrollRaf&&cancelAnimationFrame(this._scrollRaf),this._scrollRaf=0,this._handleChangesRaf&&cancelAnimationFrame(this._handleChangesRaf),this._handleChangesRaf=0,this._invertHeaderTimer&&clearTimeout(this._invertHeaderTimer),this._invertHeaderTimer=0,window.removeEventListener("resize",this._onResizeBound),document.removeEventListener("scroll",this._onScrollBound),document.removeEventListener("scroll",this._onMobileScrollBound),this.sidebars?.length&&this.sidebars.forEach(sidebar=>{const fn=this._sidebarScrollHandlers.get(sidebar);fn&&sidebar.removeEventListener("scroll",fn)}),this._sidebarScrollHandlers=new WeakMap,this._inited=!1,this._initScheduled=!1,this._didFirstInvertPass=!1}_armLazyInit(){this._io||this._firstIntent||(this._firstIntent=()=>this._scheduleInitSoon("intent"),this.addEventListener("pointerenter",this._firstIntent,{once:!0,passive:!0}),this.addEventListener("pointerdown",this._firstIntent,{once:!0,passive:!0}),this.addEventListener("focusin",this._firstIntent,{once:!0}),"IntersectionObserver"in window?(this._io=new IntersectionObserver(entries=>{const e=entries&&entries[0];e&&e.isIntersecting&&this._scheduleInitSoon("viewport")},{root:null,rootMargin:"400px 0px",threshold:.01}),this._io.observe(this)):window.addEventListener("load",()=>this._scheduleInitSoon("fallback"),{once:!0}))}_disarmLazyInit(){this._firstIntent&&(this.removeEventListener("pointerenter",this._firstIntent),this.removeEventListener("pointerdown",this._firstIntent),this.removeEventListener("focusin",this._firstIntent),this._firstIntent=null),this._io&&(this._io.disconnect(),this._io=null)}_scheduleInitSoon(reason){if(this._inited||this._initScheduled)return;this._initScheduled=!0,this._disarmLazyInit();const run=()=>{this._initScheduled=!1,this._initHard()};requestAnimationFrame(()=>{"requestIdleCallback"in window?requestIdleCallback(run,{timeout:1500}):setTimeout(run,0)})}_initHard(){this._inited||(this._inited=!0,this.init(),this._bindScrollMode(),this._updateSectionStyles(),this._updateHeaderStyles(),this.classList.add("loaded"),this._scheduleFirstInvertPass())}_scheduleFirstInvertPass(){if(this._didFirstInvertPass)return;const run=()=>{this._didFirstInvertPass||(this._didFirstInvertPass=!0,this._initInvertedElements())};requestAnimationFrame(()=>{"requestIdleCallback"in window?requestIdleCallback(run,{timeout:2e3}):setTimeout(run,0)})}_onResize(){const currentWidth=window.innerWidth;currentWidth!==this._lastWidth&&(this._lastWidth=currentWidth,this._inited&&(this._bindScrollMode(),this._scheduleHandleSectionChanges()))}_scheduleHandleSectionChanges(){this._inited&&(this._handleChangesRaf||(this._handleChangesRaf=requestAnimationFrame(()=>{this._handleChangesRaf=0,this._invertHeaderTimer&&(clearTimeout(this._invertHeaderTimer),this._invertHeaderTimer=0),this.init(),this._updateSectionStyles(),this._updateHeaderStyles(),this.classList.add("loaded"),this._didFirstInvertPass=!1,this._scheduleFirstInvertPass(),window.innerWidth>920&&this._rebindSidebarScroll()})))}_bindScrollMode(){document.removeEventListener("scroll",this._onScrollBound),document.removeEventListener("scroll",this._onMobileScrollBound),this._rebindSidebarScroll(!0),window.innerWidth>920?(document.addEventListener("scroll",this._onScrollBound,{passive:!0}),this._rebindSidebarScroll(!1)):document.addEventListener("scroll",this._onMobileScrollBound,{passive:!0})}_rebindSidebarScroll(removeOnly=!1){this.sidebars?.length&&this.sidebars.forEac
1h(sidebar=>{const fn=this._sidebarScrollHandlers.get(sidebar);fn&&sidebar.removeEventListener("scroll",fn)}),!removeOnly&&this.sidebars?.length&&this.sidebars.forEach(sidebar=>{const fn=()=>this._onScrollRaf();this._sidebarScrollHandlers.set(sidebar,fn),sidebar.addEventListener("scroll",fn,{passive:!0})})}init(){this.firstSec=this.querySelector("main .shopify-section:first-child:has(.overlapping-section)"),this.header=this.querySelector(".transparent-header"),this.footer=this.querySelector(".shopify-section-footer"),this.invertedElements=this.querySelectorAll(".scroll-color"),this.sidebars=this.querySelectorAll(".transparent-sidebar"),this.announcementBar=this.querySelector(".announcement-bar-section"),this.themeContentEl=this.querySelector(".theme-content"),this.announcementBarHeight=0,this.announcementBar&&(this.announcementBarHeight=this.announcementBar.offsetHeight),this.headerGroup=this.querySelector(".header-group"),this.headerGroupSections=this.headerGroup?this.headerGroup.querySelectorAll(".shopify-section-group-more-header-sections"):[],this.currentScrollPos=0,this.lastScrollPos=0,this.scrollDelta=!1,window.innerWidth<920&&(this.header=this.querySelector(".mobile-header-section.transparent-header"))}_onScrollRaf(){this._scrollRaf||(this._scrollRaf=requestAnimationFrame(()=>{this._scrollRaf=0,this._onScroll()}))}_onMobileScrollRaf(){this._scrollRaf||(this._scrollRaf=requestAnimationFrame(()=>{this._scrollRaf=0,this._onMobileScroll()}))}_onScroll(){this._didFirstInvertPass||this._scheduleFirstInvertPass(),this.header&&!this.header.classList.contains("header--disable-sticky")&&(this.sidebars.length===0?this.invertHeader():this.invertHeaderBetweenSidebars()),this.invertElementsOnScroll()}_onMobileScroll(){this._didFirstInvertPass||this._scheduleFirstInvertPass(),this.header&&!this.header.classList.contains("header--disable-sticky")&&this.invertHeader()}_initInvertedElements(){const themeContent=this.themeContentEl||this.querySelector(".theme-content");if(!themeContent)return;const themeTop=themeContent.getBoundingClientRect().top,footerRect=this.footer?this.footer.getBoundingClientRect():null,sectionRect=this.firstSec?this.firstSec.getBoundingClientRect():null,m={y0:window.scrollY===0,scrollDelta:this.scrollDelta,themeTop,footerTop:footerRect?footerRect.top:null,sectionBottom:sectionRect?sectionRect.bottom:null};this.invertedElements.forEach(el=>{const r=el.getBoundingClientRect();this._invertNavigationColorFast(el,r,m)})}invertElementsOnScroll(){if(window.innerWidth<920)return;this.currentScrollPos=window.scrollY,this.scrollDelta=this.lastScrollPos<=this.currentScrollPos,this.lastScrollPos=this.currentScrollPos;const themeContent=this.themeContentEl||this.querySelector(".theme-content");if(!themeContent)return;const themeTop=themeContent.getBoundingClientRect().top,footerRect=this.footer?this.footer.getBoundingClientRect():null,sectionRect=this.firstSec?this.firstSec.getBoundingClientRect():null,m={y0:window.scrollY===0,scrollDelta:this.scrollDelta,themeTop,footerTop:footerRect?footerRect.top:null,sectionBottom:sectionRect?sectionRect.bottom:null};for(let i=0;i<this.invertedElements.length;i++){const el=this.invertedElements[i],r=el.getBoundingClientRect();if(r.bottom<-300||r.top>window.innerHeight+300){el.classList.remove("section-color","footer-color");continue}this._invertNavigationColorFast(el,r,m)}}_invertNavigationColorFast(el,r,m){el.classList.remove("section-color","footer-color");const hasFooter=m.footerTop!==null,hasSection=m.sectionBottom!==null;if(m.y0){hasSection&&r.top>m.themeTop&&r.bottom<m.sectionBottom&&el.classList.add("section-color"),hasFooter&&r.bottom>m.footerTop&&el.classList.add("footer-color");return}m.scrollDelta?hasFooter&&hasSection?r.top>m.themeTop&&r.top<m.footerTop&&r.bottom<m.sectionBottom?el.classList.add("section-color"):r.bottom>m.footerTop&&el.classList.add("footer-color"):!hasFooter&&hasSection?r.top>m.themeTop&&r.bottom<m.sectionBottom&&el.classList.add("section-color"):hasFooter&&!hasSection&&r.bottom>m.footerTop&&el.classList.add("footer-color"):hasFooter&&hasSection?r.top>m.themeTop&&r.top<m.footerTop&&r.top<m.sectionBottom?el.classList.add("section-color"):r.top>m.footerTop&&el.classList.add("footer-color"):!hasFooter&&hasSection?r.top>m.themeTop&&r.top<m.sectionBottom&&el.classList.add("section-color"):hasFooter&&!hasSection&&r.top>m.footerTop&&el.classList.add("footer-color")}_updateHeaderStyles(){this.header&&(this.firstSec&&this.header.classList.contains("secondary-header-section")&&this.header.classList.remove("colored"),this.firstSec?(this.header.classList.remove("colored"),this.header.classList.add("transparent")):(this.header.classList.remove("transparent"),this.header.classList.add("colored")),this.header.classList.contains("header--disable-sticky")||(this.sidebars.length>0?this.invertHeaderBetweenSidebars():this.invertHeader()))}_updateSectionStyles(){if(!this.firstSec)return;(this.announcementBar&&this.firstSec.querySelector(".full-height--desktop")||this.announcementBar&&this.firstSec.querySelector(".full-height--mobile"))&&this.firstSec.setAttribute("style",`--announcement-height: ${this.announcementBarHeight}px;`);let headerSection;window.innerWidth<920?headerSection=this.querySelector(".mobile-header-section"):headerSection=this.querySelector(".header-section"),this.headerHeight=this.header&&headerSection?headerSection.offsetHeight:0,this.headerGroupHeight=this.headerGroupSections?.length>0&&this.headerGroup&&this.headerGroup.querySelector(".header-group__sections")?.offsetHeight||0,this.headerGroupSections?.length>0&&this.headerGroup&&(this.headerGroup.setAttribute("style",`top: ${this.headerHeight}px; z-index: 4;`),window.innerWidth<920&&!this.headerGroup.classList.contains("header-group--mobile-overlap-enabled")?this.headerGroupSections.forEach(s=>s.classList.remove("transparent")):this.headerGroupSections.forEach(s=>s.classList.add("transparent"))),this.firstSec.querySelectorAll(".overlapping-section .overlapping-content-js").forEach(content=>{content.style.marginTop=this.headerGroupHeight+this.headerHeight+"px",content.setAttribute("style",`margin-top: ${this.headerGroupHeight+this.headerHeight}px; --overlap-margin-top: ${this.headerGroupHeight+this.headerHeight}px;`),content.nextElementSibling?.classList.contains("section-selected-indicator")&&content.nextElementSibling.setAttribute("style",`--overlap-margin-top: ${this.headerGroupHeight+this.headerHeight}px;`)})}invertHeader(){!this.firstSec||!this.header||(this.header.querySelector(".header--sticky")&&this.header.getBoundingClientRect().top<0&&this.header.classList.replace("transparent","colored"),(this.header.closest(".shopify-section-header-sticky")||this.header.closest(".shopify-section-mobile-header-sticky"))&&this.header.classList.replace("transparent","colored"),this._invertHeaderTimer&&clearTimeout(this._invertHeaderTimer),this._invertHeaderTimer=setTimeout(()=>
1{this._invertHeaderTimer=0,!(!this.firstSec||!this.header)&&(this.header.querySelector(".header--sticky")&&this.header.getBoundingClientRect().top>=0&&this.header.classList.replace("colored","transparent"),(this.header.closest(".shopify-section-header:not(.shopify-section-header-sticky)")||this.header.closest(".shopify-section-mobile-header:not(.shopify-section-mobile-header-sticky)"))&&!this.header.querySelector(".header--sticky")&&this.header.classList.replace("colored","transparent"))},10))}invertHeaderBetweenSidebars(){if(!this.header||!this.footer||this.header.querySelector(".header--disable-sticky"))return;const headerContainer=this.header.closest(".shopify-section-header");if(!headerContainer)return;headerContainer.classList.remove("header--static");let sectionRect;this.firstSec&&(sectionRect=this.firstSec.getBoundingClientRect());const footerHeight=this.querySelector(".shopify-section-footer")?.getBoundingClientRect().height||0,footerTop=document.documentElement.offsetHeight-footerHeight;sectionRect&§ionRect.bottom+500>0||footerTop<window.pageYOffset+500?headerContainer.classList.add("header--static"):headerContainer.classList.remove("header--static"),headerContainer.classList.contains("header--static")?headerContainer.classList.remove("sticky"):headerContainer.classList.add("sticky"),sectionRect&&!this.header.classList.contains("transparent")&&this.header.classList.replace("colored","transparent"),!(sectionRect&§ionRect.bottom>window.pageYOffset||sectionRect&§ionRect.top==window.pageYOffset-500)&&(this.header.querySelector(".header--sticky")&&this.header.getBoundingClientRect().top<0&&this.header.classList.replace("transparent","colored"),this.header.closest(".shopify-section-header-sticky")&&this.header.classList.replace("transparent","colored"),this.firstSec&&this.header.querySelector(".header--sticky")&&this.header.getBoundingClientRect().top>=0&&this.header.classList.replace("colored","transparent"),this.firstSec||this.header.classList.replace("transparent","colored"))}}customElements.define("overlap-navigation",OverlapNavigation); 2//# sourceMappingURL=/cdn/shop/t/69/assets/overlap-navigation.js.map?v=121087620109570237641783114882
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.