1const DRAG_THRESHOLD=5,INTERACTIVE_SELECTOR="button, input, select, textarea, label, a",NAVIGATION_KEYS=["ArrowLeft","ArrowRight","Home","End"];class DragScrollController{static#instance=null;static init(){this.#instance||(this.#instance=new DragScrollController)}constructor(){document.addEventListener("keydown",this.#onKeyDown),document.addEventListener("click",this.#onClick),matchMedia("(hover: hover) and (pointer: fine)").matches&&document.addEventListener("mousedown",this.#onMouseDown)}#scrollBehavior(el){return getComputedStyle(el).scrollBehavior==="auto"?"auto":matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}#focusedScroller(el){const active=document.activeElement;return!(active instanceof HTMLElement)||active!==el||el.scrollWidth<=el.clientWidth?null:el}#scrollPage(el,direction,behavior){const pageWidth=el.clientWidth;if(pageWidth===0)return;const currentPage=Math.round(el.scrollLeft/pageWidth),maxPage=Math.max(0,Math.ceil(el.scrollWidth/pageWidth)-1),nextPage=Math.max(0,Math.min(currentPage+direction,maxPage));el.scrollTo({left:nextPage*pageWidth,behavior})}#onKeyDown=event=>{if(!NAVIGATION_KEYS.includes(event.key))return;const active=document.activeElement;if(!(active instanceof HTMLElement))return;const el=active.closest(".drag-scroll");if(!(el instanceof HTMLElement))return;const scroller=this.#focusedScroller(el);if(!scroller)return;const behavior=this.#scrollBehavior(scroller);switch(event.key){case"ArrowLeft":event.preventDefault(),this.#scrollPage(scroller,-1,behavior);break;case"ArrowRight":event.preventDefault(),this.#scrollPage(scroller,1,behavior);break;case"Home":event.preventDefault(),scroller.scrollTo({left:0,behavior});break;case"End":event.preventDefault(),scroller.scrollTo({left:scroller.scrollWidth-scroller.clientWidth,behavior});break}};#onClick=event=>{const el=event.target?.closest(".drag-scroll");el instanceof HTMLElement&&(el.scrollWidth<=el.clientWidth||event.target.closest(INTERACTIVE_SELECTOR)||document.activeElement!==el&&el.focus({preventScroll:!0}))};#onMouseDown=event=>{const el=event.target?.closest(".drag-scroll");if(!(el instanceof HTMLElement)||event.button!==0||el.scrollWidth<=el.clientWidth||event.target.closest(INTERACTIVE_SELECTOR))return;el.focus({preventScroll:!0}),event.preventDefault();const startX=event.pageX,startScroll=el.scrollLeft;let moved=!1;el.classList.add("is-dragging");const onMove=e=>{const delta=startX-e.pageX;Math.abs(delta)>5&&(moved=!0),el.scrollLeft=startScroll+delta},onUp=()=>{document.removeEventListener("mousemove",onMove),document.removeEventListener("mouseup",onUp),el.classList.remove("is-dragging"),moved&&el.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()},{once:!0,capture:!0})};document.addEventListener("mousemove",onMove),document.addEventListener("mouseup",onUp)}}DragScrollController.init(); 2//# sourceMappingURL=/cdn/shop/t/196/assets/drag-scroll.js.map?v=157077459915451039151784987626
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.