1(function(){var __sections__={};(function(){for(var i=0,s=document.getElementById("sections-script").getAttribute("data-sections").split(",");i<s.length;i++)__sections__[s[i]]=!0})(),(function(){if(!(!__sections__["Rabbi-scrolling-testimonials"]&&!Shopify.designMode))try{class RabbiScrollingTestimonials{constructor(sectionElement){this.section=sectionElement,this.section&&(this.columns=[],this.isMobile=!1,this.globalAnimationId=null,this.lastTimestamp=0,this.baseSpeed=parseFloat(this.section.dataset.baseSpeed)||15,this.pixelSpeed=60/(this.baseSpeed*60),this.columnWrappers=this.section.querySelectorAll(".rabbi-testimonial-column-wrapper"),this.columnWrappers.forEach((wrapper,index)=>{const element=wrapper.querySelector(".rabbi-testimonial-column"),delay=parseFloat(this.section.dataset[`col${index+1}Delay`]||0)*1e3;this.columns.push({wrapper,element,index,startTime:Date.now()+delay,currentPos:0,isHovered:!1,isInteracting:!1,resumeTimeout:null,dragStartX:0,dragStartY:0,startScrollX:0,touchAxis:null,touching:!1})}),this.modal=this.section.querySelector(`#RabbiVideoModal-${this.section.dataset.sectionId}`),this.playerContainer=this.section.querySelector(`#RabbiVideoPlayer-${this.section.dataset.sectionId}`),this.closeButton=this.modal.querySelector(".rabbi-video-modal-close"),this.backdrop=this.modal.querySelector(".rabbi-video-modal-backdrop"),this.cards=this.section.querySelectorAll(".rabbi-testimonial-card"),this.onResize=this.onResize.bind(this),this.update=this.update.bind(this),this.init())}init(){this.onResize(),this.setInitialPositions(),this.initModal(),this.initAnimation(),window.addEventListener("resize",this.onResize)}setInitialPositions(){const firstCard=this.columns[0].element.querySelector(".rabbi-testimonial-card");if(!firstCard)return;const singleItemSize=(this.isMobile?firstCard.offsetWidth:firstCard.offsetHeight)+24;this.columns.forEach(col=>{let offset=0;switch(col.index){case 0:offset=.1;break;case 1:offset=1;break;case 2:offset=2.4;break}col.currentPos=-singleItemSize*offset,this.checkBoundaries(col),this.applyTransform(col)})}initModal(){this.cards.forEach(card=>{let isDragging=!1;card.addEventListener("mousedown",()=>isDragging=!1),card.addEventListener("mousemove",()=>isDragging=!0),card.addEventListener("mouseup",e=>{isDragging||this.openModal(card.dataset.youtubeId)}),card.addEventListener("touchstart",()=>isDragging=!1),card.addEventListener("touchmove",()=>isDragging=!0),card.addEventListener("touchend",e=>{isDragging||this.openModal(card.dataset.youtubeId)}),card.dataset.autoFetchName==="true"&&this.fetchChannelName(card)}),this.closeButton.addEventListener("click",()=>this.closeModal()),this.backdrop.addEventListener("click",()=>this.closeModal())}initAnimation(){this.columns.forEach(col=>{col.wrapper.addEventListener("mouseenter",()=>col.isHovered=!0),col.wrapper.addEventListener("mouseleave",()=>col.isHovered=!1),col.wrapper.addEventListener("wheel",this.onWheel.bind(this,col),{passive:!1}),col.wrapper.addEventListener("touchstart",this.onTouchStart.bind(this,col),{passive:!0}),col.wrapper.addEventListener("touchmove",this.onTouchMove.bind(this,col),{passive:!1}),col.wrapper.addEventListener("touchend",this.onTouchEnd.bind(this,col)),col.wrapper.addEventListener("touchcancel",this.onTouchEnd.bind(this,col))}),document.addEventListener("shopify:block:select",()=>this.pauseAll()),document.addEventListener("shopify:block:deselect",()=>this.resumeAll()),this.lastTimestamp=performance.now(),this.globalAnimationId=requestAnimationFrame(this.update)}onResize(){this.isMobile=window.innerWidth<768,this.columns.forEach(col=>{col.currentPos=0,col.element.style.transform="translate(0, 0)"}),this.setInitialPositions()}update(timestamp){const delta=(timestamp-this.lastTimestamp)*.06;this.lastTimestamp=timestamp,this.columns.forEach(col=>{Date.now()<col.startTime||(!col.isHovered&&!col.isInteracting&&(col.currentPos-=this.pixelSpeed*delta),this.checkBoundaries(col),this.applyTransform(col))}),this.globalAnimationId=requestAnimationFrame(this.update)}checkBoundaries(col){const halfSize=this.isMobile?col.element.scrollWidth/2:col.element.scrollHeight/2;col.currentPos<-halfSize&&(col.currentPos+=halfSize),col.currentPos>0&&(col.currentPos-=halfSize)}applyTransform(col){this.isMobile?col.element.style.transform=`translateX(${col.currentPos}px)`:col.element.style.transform=`translateY(${col.currentPos}px)`}onWheel(col,e){e.preventDefault(),col.isHovered&&(col.isInteracting=!0,col.currentPos-=e.deltaY,clearTimeout(col.resumeTimeout),col.resumeTimeout=setTimeout(()=>{col.isInteracting=!1},300))}onTouchStart(col,e){col.dragStartX=e.touches[0].clientX,col.dragStartY=e.touches[0].clientY,col.startScrollX=col.currentPos,col.touchAxis=null,col.touching=!0,clearTimeout(col.resumeTimeout)}onTouchMove(col,e){if(!col.touching)return;const deltaX=e.touches[0].clientX-col.dragStartX,deltaY=e.touches[0].clientY-col.dragStartY;if(col.touchAxis===null){if(Math.abs(deltaX)<8&&Math.abs(deltaY)<8)return;col.touchAxis=Math.abs(deltaX)>Math.abs(deltaY)?"h":"v",col.touchAxis==="h"&&(col.isInteracting=!0)}col.touchAxis!=="v"&&(e.cancelable&&e.preventDefault(),col.currentPos=col.startScrollX+deltaX)}onTouchEnd(col,e){col.touching=!1,col.touchAxis=null,clearTimeout(col.resumeTimeout),col.resumeTimeout=setTimeout(()=>{col.isInteracting=!1},2e3)}pauseAll(){this.globalAnimationId&&(cancelAnimationFrame(this.globalAnimationId),this.globalAnimationId=null)}resumeAll(){this.globalAnimationId||(this.lastTimestamp=performance.now(),this.globalAnimationId=requestAnimationFrame(this.update))}async fetchChannelName(card){const youtubeId=card.dataset.youtubeId,nameTarget=card.querySelector("[data-rabbi-name-target]");if(!(!youtubeId||!nameTarget))try{const response=await fetch(`https://noembed.com/embed?url=https://www.youtube.com/watch?v=${youtubeId}`);if(!response.ok)throw new Error("Network response was not ok");const data=await response.json();data.author_name&&(nameTarget.textContent=data.author_name)}catch(error){console.warn(`Rabbi: Could not fetch channel name for video ${youtubeId}:`,error)}}
1openModal(youtubeId){if(!youtubeId)return;this.pauseAll();const iframe=document.createElement("iframe");iframe.src=`https://www.youtube.com/embed/${youtubeId}?autoplay=1&rel=0`,iframe.setAttribute("frameborder","0"),iframe.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"),iframe.setAttribute("allowfullscreen",""),this.playerContainer.appendChild(iframe),this.modal.classList.add("rabbi-is-open")}closeModal(){this.modal.classList.remove("rabbi-is-open"),this.playerContainer.innerHTML="",this.resumeAll()}}document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".rabbi-scroll-testimonials-wrapper").forEach(section=>{section.dataset.rabbiInitialized||(new RabbiScrollingTestimonials(section),section.dataset.rabbiInitialized=!0)})}),document.addEventListener("shopify:section:load",event=>{const section=event.target.querySelector(".rabbi-scroll-testimonials-wrapper");section&&!section.dataset.rabbiInitialized&&(new RabbiScrollingTestimonials(section),section.dataset.rabbiInitialized=!0)}),document.addEventListener("shopify:section:reorder",event=>{const section=event.target.querySelector(".rabbi-scroll-testimonials-wrapper");section&&(section.dataset.rabbiInitialized=!1,new RabbiScrollingTestimonials(section),section.dataset.rabbiInitialized=!0)})}catch(e){console.error(e)}})()})(); 2//# sourceMappingURL=/cdn/shop/t/46/compiled_assets/scripts.js.map?v=116162303496687476401788936255
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.