1class StickyHeader extends window.BAO.CustomElement(){connectedCallback(){super.connectedCallback(),this.isTicking=!1,this.lastKnownY=window.scrollY,this.offsetTrackedY=0,this.scrollOffset=50,this.safeZone=250,this.scrollDirection=""}setupListeners(){super.setupListeners(),this.requestTick=this.requestTick.bind(this),this.updateEl=this.updateEl.bind(this),this.onScroll=this.onScroll.bind(this),window.addEventListener("scroll",this.onScroll,{passive:!0})}onScroll(){const previouslyKnown=this.lastKnownY,previousDirection=this.scrollDirection;this.lastKnownY=window.scrollY,this.scrollDirection=previouslyKnown<this.lastKnownY?"down":"up",previousDirection!==this.scrollDirection&&(this.offsetTrackedY=this.lastKnownY),this.requestTick()}requestTick(){this.isTicking||requestAnimationFrame(this.updateEl),this.isTicking=!0}updateEl(){this.isTicking=!1,this.setSticky(),this.setVisibility()}setSticky(){this.bodyElement.classList.toggle(this.dataset.classSticky,this.shouldBeSticky)}setVisibility(){this.bodyElement.classList.toggle(this.dataset.classVisible,this.shouldBeVisible)}get bodyElement(){return document.body}get shouldBeSticky(){return this.lastKnownY>=this.safeZone}get shouldBeVisible(){if(this.lastKnownY<this.safeZone*3)return!1;if(this.scrollDirection==="down")return!this.isOverOffset;if(this.scrollDirection==="up")return this.isOverOffset}get isOverOffset(){if(this.scrollDirection==="down")return this.lastKnownY>=this.offsetTrackedY+this.scrollOffset;if(this.scrollDirection==="up")return this.lastKnownY<=this.offsetTrackedY-this.scrollOffset}}customElements.get("sticky-header")||customElements.define("sticky-header",StickyHeader); 2//# sourceMappingURL=/cdn/shop/t/914/assets/sticky-header.js.map?v=25180792228538614091787650581
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.