1(function(){"use strict";var mq=function(q){return window.matchMedia?window.matchMedia(q):{matches:!1}},SDA=!!(window.CSS&&CSS.supports&&CSS.supports("animation-timeline","view()")),reduced=mq("(prefers-reduced-motion: reduce)"),fine=mq("(hover: hover) and (pointer: fine)"),raf=window.requestAnimationFrame||function(f){return setTimeout(f,16)};function num(el,name,fallback){var v=parseFloat(getComputedStyle(el).getPropertyValue(name));return isNaN(v)?fallback:v}function clamp(v,a,b){return v<a?a:v>b?b:v}function Showcase(root){this.root=root,this.rail=root.querySelector("[data-jhx-rail]"),this.rail&&(this.all=Array.prototype.slice.call(this.rail.querySelectorAll("[data-jhx-item]")),this.all.length&&(this.items=this.all.slice(),this.prevBtn=root.querySelector("[data-jhx-prev]"),this.nextBtn=root.querySelector("[data-jhx-next]"),this.track=root.querySelector("[data-jhx-track]"),this.thumb=root.querySelector("[data-jhx-thumb]"),this.cur=root.querySelector("[data-jhx-cur]"),this.total=root.querySelector("[data-jhx-total]"),this.playBtn=root.querySelector("[data-jhx-play]"),this.sortSel=root.querySelector("[data-jhx-sort]"),this.chipsBox=root.querySelector("[data-jhx-chips]"),this.curve=root.dataset.curve!=="false",this.jsCurve=this.curve&&!SDA,this.playing=root.dataset.autoplay==="true"&&!reduced.matches,this.ms=Math.max(1500,parseInt(root.dataset.ms,10)||3250),this.group="*",this.mode="o",this.idx=-1,this.inView=!1,this.hover=!1,this.focus=!1,this.dragging=!1,this.holdUntil=0,this.offs=[],!this.playing&&this.playBtn&&root.classList.add("is-paused"),this.buildChips(),this.measure(),this.jumpTo(this.startIndex(),!1),this.update(!0),this.settle(),this.bind(),this.observe(),this.schedule(),root.classList.add("is-ready")))}var P=Showcase.prototype;P.on=function(el,type,fn,opts){el.addEventListener(type,fn,opts||!1),this.offs.push(function(){el.removeEventListener(type,fn,opts||!1)})},P.destroy=function(){clearTimeout(this.timer),clearTimeout(this.settleT),this.io&&this.io.disconnect(),this.ro&&this.ro.disconnect(),this.offs.forEach(function(f){f()}),this.offs=[]},P.measure=function(){var r=this.rail,it=this.items,root=this.root;if(this.viewW=r.clientWidth||1,it.length>1?this.step=it[1].offsetLeft-it[0].offsetLeft:it.length===1&&(this.step=it[0].offsetWidth+num(root,"--jhx-gap",20)),(!this.step||this.step<20)&&(this.step=300),this.base=it.length?it[0].offsetLeft+it[0].offsetWidth/2-this.viewW/2:0,this.perView=Math.max(1,Math.floor(this.viewW/this.step)),this.fx=this.step*num(root,"--jhx-fx-steps",2.3),this.rot=num(root,"--jhx-rot",22),this.min=num(root,"--jhx-min",.84),this.pull=num(root,"--jhx-pull",7),this.fade=num(root,"--jhx-fade",.9),this.track&&this.thumb){this.trackW=this.track.clientWidth;var frac=it.length?clamp(this.viewW/this.step/it.length,0,1):1;this.thumbW=Math.max(28,Math.round(this.trackW*frac)),this.thumb.style.width=this.thumbW+"px"}},P.startIndex=function(){var n=this.items.length;if(!n)return 0;var cap=this.perView>=6?3:2;return Math.min(n-1,this.perView>=3?Math.min(cap,Math.floor(this.perView/2)):0)},P.posAt=function(i){return this.base+i*this.step},P.jumpTo=function(i,smooth){var n=this.items.length;if(n){i=clamp(i,0,n-1);var left=Math.round(this.posAt(i));smooth&&!reduced.matches&&this.rail.scrollTo?this.rail.scrollTo({left:left,behavior:"smooth"}):this.rail.scrollLeft=left}},P.go=function(i){this.jumpTo(i,!0)},P.request=function(){var self=this;this.pending||(this.pending=!0,raf(function(){self.pending=!1,self.update(!1)}))},P.update=function(force){var r=this.rail,n=this.items.length;if(n){var sl=r.scrollLeft,pos=(sl-this.base)/this.step,i=clamp(Math.round(pos),0,n-1);if((i!==this.idx||force)&&(this.idx=i,this.cur&&(this.cur.textContent=String(i+1)),this.prevBtn&&(this.prevBtn.disabled=i<=0),this.nextBtn&&(this.nextBtn.disabled=i>=n-1)),this.thumb){var max=Math.max(1,r.scrollWidth-r.clientWidth),x=clamp(sl/max,0,1)*Math.max(0,this.trackW-this.thumbW);this.thumb.style.transform="translate3d("+x.toFixed(1)+"px,0,0)"}this.jsCurve&&this.curveJs(pos)}},P.curveJs=function(pos){for(var it=this.items,n=it.length,from=Math.max(0,Math.floor(pos)-5),to=Math.min(n-1,Math.ceil(pos)+5
1),k=from;k<=to;k++){var t=clamp((k-pos)*this.step/this.fx,-1,1),a=Math.abs(t),st=it[k].style;st.transform="perspective(1100px) translateX("+(-t*this.pull).toFixed(2)+"%) rotateY("+(-t*this.rot).toFixed(2)+"deg) scale("+(1-a*(1-this.min)).toFixed(4)+")",st.opacity=(1-a*(1-this.fade)).toFixed(3)}},P.settle=function(){var c=this.items[this.idx];!c||c===this.center||(this.center&&this.center.classList.remove("is-center","is-land"),this.center=c,c.classList.add("is-center"),!reduced.matches&&!this.dealing&&(c.classList.remove("is-land"),c.offsetWidth,c.classList.add("is-land")))},P.schedule=function(){var self=this;clearTimeout(this.timer),this.playing&&(this.timer=setTimeout(function(){self.tick()},this.ms))},P.canAdvance=function(){return this.playing&&this.inView&&!this.hover&&!this.focus&&!this.dragging&&!document.hidden&&Date.now()>=this.holdUntil&&this.items.length>1},P.tick=function(){if(this.canAdvance()){var n=this.items.length;this.go(this.idx>=n-1?0:this.idx+1)}this.schedule()},P.hold=function(ms){this.holdUntil=Date.now()+(ms||7e3),this.schedule()},P.setPlaying=function(on){this.playing=!!on,this.root.classList.toggle("is-paused",!this.playing),this.playBtn&&this.playBtn.setAttribute("aria-label",this.playing?this.playBtn.dataset.lPause:this.playBtn.dataset.lPlay),this.playing&&(this.holdUntil=0),this.schedule()},P.buildChips=function(){var box=this.chipsBox;if(box){var counts={},labels={},order=[];if(this.all.forEach(function(li){var g=li.dataset.g||"other";counts[g]||(counts[g]=0,labels[g]=li.dataset.gl||g,order.push(g)),counts[g]++}),!(order.length<2)){var frag=document.createDocumentFragment(),make=function(key,label,count,pressed){var b=document.createElement("button");b.type="button",b.className="jhx__chip",b.dataset.g=key,b.setAttribute("aria-pressed",pressed?"true":"false");var a=document.createElement("span");a.textContent=label;var c=document.createElement("small");return c.textContent=count,b.appendChild(a),b.appendChild(c),b};frag.appendChild(make("*",this.root.dataset.all||"All",this.all.length,!0)),order.forEach(function(g){frag.appendChild(make(g,labels[g],counts[g],!1))}),box.appendChild(frag),box.hidden=!1,this.chipsFade()}}},P.chipsFade=function(){var box=this.chipsBox;if(!(!box||box.hidden)){var more=box.scrollWidth-box.clientWidth-box.scrollLeft>4;box.classList.toggle("is-overflowing",more)}},P.apply=function(){var g=this.group,mode=this.mode,rail=this.rail,keyFn={o:function(li){return+li.dataset.o},pa:function(li){return+li.dataset.p},pd:function(li){return-li.dataset.p},n:function(li){return-li.dataset.c}}[mode]||function(li){return+li.dataset.o},list=this.all.slice().sort(function(a,b){return keyFn(a)-keyFn(b)||+a.dataset.o-+b.dataset.o}),vis=[],frag=document.createDocumentFragment();list.forEach(function(li){var show=g==="*"||li.dataset.g===g;li.hidden=!show,li.classList.remove("is-center","is-land"),show&&vis.push(li),frag.appendChild(li)}),rail.appendChild(frag),this.items=vis,this.center=null,this.total&&(this.total.textContent=String(vis.length)),this.jsCurve&&this.all.forEach(function(li){li.style.transform="",li.style.opacity=""}),this.measure(),this.idx=-1,this.jumpTo(this.startIndex(),!1),this.update(!0),this.settle(),this.hold(9e3)},P.bind=function(){var self=this,r=this.rail,root=this.root;if(this.on(r,"scroll",function(){self.request(),clearTimeout(self.settleT),self.settleT=setTimeout(function(){self.settle()},140)},{passive:!0}),"onscrollend"in window&&this.on(r,"scrollend",function(){clearTimeout(self.settleT),self.update(!1),self.settle()}),window.ResizeObserver){var lastW=r.clientWidth;this.ro=new ResizeObserver(function(){if(r.clientWidth!==lastW){lastW=r.clientWidth;var keep=self.idx<0?self.startIndex():self.idx;self.measure(),self.jumpTo(keep,!1),self.update(!0),self.chipsFade()}}),this.ro.observe(r)}this.chipsBox&&this.on(this.chipsBox,"scroll",function(){self.chipsFade()},{passive:!0});var jump=function(){return self.perView>=3?self.perView-1:1};this.prevBtn&&this.on(this.prevBtn,"click",function(){self.hold(9e3),self.go(self.idx-jump())}),this.nextBtn&&this.on(this.nextBtn,"click",function(){self.hold(9e3),self.go(self.idx+jump())}),this.playBtn&&this.on(this.playBtn,"click",function(){self.setPlaying(!self.playing)}),this.sortSel&&this.on(this.sortSel,"change",function(){self.mode=self.sortSel.value,self.apply()}),this.chipsBox&&this.on(this.chipsBox,"click",function(e){var b=e.target.closest?e.target.closest(".
1jhx__chip"):null;!b||b.getAttribute("aria-pressed")==="true"||(Array.prototype.forEach.call(self.chipsBox.querySelectorAll(".jhx__chip"),function(c){c.setAttribute("aria-pressed",c===b?"true":"false")}),self.group=b.dataset.g,self.apply())});var stage=root.querySelector(".jhx__stage")||r;this.on(stage,"mouseenter",function(){self.hover=!0}),this.on(stage,"mouseleave",function(){self.hover=!1,self.schedule()}),this.on(r,"focusin",function(){self.focus=!0}),this.on(r,"focusout",function(e){r.contains(e.relatedTarget)||(self.focus=!1,self.schedule())}),this.on(r,"touchstart",function(){self.hold(8e3)},{passive:!0}),this.on(r,"wheel",function(){self.hold(8e3)},{passive:!0}),this.on(document,"visibilitychange",function(){self.schedule()}),this.bindDrag(),this.bindTrack(),this.bindTilt()},P.unsnapLater=function(){var self=this,r=this.rail,done=!1,finish=function(){done||(done=!0,r.removeEventListener("scrollend",finish),self.root.classList.remove("is-dragging","is-scrubbing"),self.update(!0),self.settle())};"onscrollend"in window&&r.addEventListener("scrollend",finish),setTimeout(finish,650)},P.bindDrag=function(){var self=this,r=this.rail,down=!1,moved=!1,sx=0,ss=0,lastX=0,lastT=0,v=0,pid=null;this.on(r,"pointerdown",function(e){e.pointerType!=="mouse"||e.button!==0||(down=!0,moved=!1,sx=lastX=e.clientX,ss=r.scrollLeft,lastT=performance.now(),v=0,pid=e.pointerId)}),this.on(window,"pointermove",function(e){if(!(!down||e.pointerId!==pid)){var dx=e.clientX-sx;if(!moved){if(Math.abs(dx)<6)return;moved=!0,self.dragging=!0,self.root.classList.add("is-dragging"),self.clearTilt&&self.clearTilt()}var now=performance.now(),dt=now-lastT;dt>0&&(v=.75*v+.25*((e.clientX-lastX)/dt)),lastX=e.clientX,lastT=now,r.scrollLeft=ss-dx}});var end=function(e){if(!(!down||e&&e.pointerId!==pid)&&(down=!1,!!moved)){self.dragging=!1;var target=(r.scrollLeft-v*220-self.base)/self.step;
1self.jumpTo(Math.round(target),!0),self.unsnapLater(),self.hold(7e3);var swallow=function(ev){ev.preventDefault(),ev.stopPropagation()};r.addEventListener("click",swallow,!0),setTimeout(function(){r.removeEventListener("click",swallow,!0)},0)}};this.on(window,"pointerup",end),this.on(window,"pointercancel",end),this.on(r,"dragstart",function(e){e.preventDefault()})},P.bindTrack=function(){var self=this,t=this.track,r=this.rail;t&&this.on(t,"pointerdown",function(e){if(e.button===0){e.preventDefault(),self.hold(9e3);var rect=t.getBoundingClientRect(),onThumb=e.target===self.thumb,grab=onThumb?e.clientX-self.thumb.getBoundingClientRect().left:self.thumbW/2,max=r.scrollWidth-r.clientWidth,toScroll=function(x){return clamp((x-rect.left-grab)/Math.max(1,rect.width-self.thumbW),0,1)*max};self.dragging=!0,self.root.classList.add("is-dragging","is-scrubbing");try{t.setPointerCapture(e.pointerId)}catch(err){}onThumb||(r.scrollLeft=toScroll(e.clientX));var move=function(ev){r.scrollLeft=toScroll(ev.clientX)},up=function(){t.removeEventListener("pointermove",move),t.removeEventListener("pointerup",up),t.removeEventListener("pointercancel",up),self.dragging=!1,self.jumpTo(Math.round((r.scrollLeft-self.base)/self.step),!0),self.unsnapLater()};t.addEventListener("pointermove",move),t.addEventListener("pointerup",up),t.addEventListener("pointercancel",up)}})},P.bindTilt=function(){if(!(this.root.dataset.tilt==="false"||!fine.matches||reduced.matches)){var self=this,r=this.rail,card=null,last=null,queued=!1,reset=function(c){c.classList.remove("is-hover"),["--rx","--ry","--gx","--gy"].forEach(function(p){c.style.removeProperty(p)})},apply=function(){if(queued=!1,!(!card||!last)){var b=card.getBoundingClientRect(),x=clamp((last.clientX-b.left)/b.width,0,1),y=clamp((last.clientY-b.top)/b.height,0,1),st=card.style;st.setProperty("--rx",((.5-y)*14).toFixed(2)+"deg"),st.setProperty("--ry",((x-.5)*16).toFixed(2)+"deg"),st.setProperty("--gx",(x*100).toFixed(1)+"%"),st.setProperty("--gy",(y*100).toFixed(1)+"%")}};this.on(r,"pointermove",function(e){if(!(e.pointerType!=="mouse"||self.dragging)){var c=e.target.closest?e.target.closest(".jhx__card"):null;c!==card&&(card&&reset(card),card=c,card&&card.classList.add("is-hover")),last=e,card&&!queued&&(queued=!0,raf(apply))}}),this.on(r,"pointerleave",function(){card&&reset(card),card=null}),this.clearTilt=function(){card&&reset(card),card=null}}},P.observe=function(){var self=this,target=this.root.querySelector(".jhx__stage")||this.rail;if(!("IntersectionObserver"in window)){this.inView=!0;return}var canDeal=!reduced.matches&&target.getBoundingClientRect().top>window.innerHeight;canDeal&&this.prepareDeal(),this.io=new IntersectionObserver(function(entries){entries.forEach(function(en){self.inView=en.isIntersecting,self.inView&&self.dealReady&&self.deal(),self.inView&&self.schedule()})},{threshold:.35}),this.io.observe(target)},P.prepareDeal=function(){for(var from=Math.max(0,this.idx-3),to=Math.min(this.items.length-1,this.idx+3),k=from,d=0;k<=to;k++,d++)this.items[k].classList.add("is-deal"),this.items[k].style.setProperty("--d",d);this.root.classList.add("is-predeal"),this.dealReady=!0},P.deal=function(){var self=this,root=this.root;this.dealReady=!1,this.dealing=!0,root.classList.add("is-dealing"),root.classList.remove("is-predeal"),this.holdUntil=Date.now()+1800,setTimeout(function(){if(root.classList.remove("is-dealing"),self.all.forEach(function(li){li.classList.remove("is-deal"),li.style.removeProperty("--d")}),self.dealing=!1,self.center){var c=self.center;self.center=null,c.classList.remove("is-center")}self.settle(),self.schedule()},1300)};function initAll(scope){var list=(scope||document).querySelectorAll("[data-jhx]");Array.prototype.forEach.call(list,function(el){el.__jhx||(el.__jhx=new Showcase(el))})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){initAll()}):initAll(),document.addEventListener("shopify:section:load",function(e){initAll(e.target)}),document.addEventListener("shopify:section:unload",function(e){var el=e.target&&e.target.querySelector?e.target.querySelector("[data-jhx]"):null;el&&el.__jhx&&(el.__jhx.destroy(),el.__jhx=null)})})(); 2//# sourceMappingURL=/cdn/shop/t/29/assets/jh-psa-showcase.js.map?v=105689300766647267211791390090
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.