1(function(){function esc(s){return s==null?"":String(s).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var BKF_STAR_PATH="M18.9652 0L23.4423 13.7792L37.9304 13.7792L26.2093 22.2951L30.6863 36.0742L18.9652 27.5583L7.24407 36.0742L11.7211 22.2951L0 13.7792L14.4881 13.7792L18.9652 0Z",BKF_STAR_VB="0 0 37.9304 36.0742",BKF_STAR_CLIP_W=18.9652,BKF_STAR_CLIP_H=36.0742,starClipIdSeed=0;function renderRatingStars(ratingX10){var normalizedRating=Number(ratingX10);isFinite(normalizedRating)||(normalizedRating=0),normalizedRating<0&&(normalizedRating=0),normalizedRating>50&&(normalizedRating=50);for(var stars="",clipPrefix="bkf-col-carousel-star-"+(starClipIdSeed+=1),i=1;i<=5;i+=1){var fullThreshold=i*10,halfThreshold=fullThreshold-5;if(normalizedRating>=fullThreshold)stars+='<svg class="w-8 h-8 md:w-7 md:h-7" viewBox="'+BKF_STAR_VB+'" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><path d="'+BKF_STAR_PATH+'" fill="currentColor"/></svg>';else if(normalizedRating>=halfThreshold){var clipId=clipPrefix+"-"+i;stars+='<svg class="w-8 h-8 md:w-7 md:h-7" viewBox="'+BKF_STAR_VB+'" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><defs><clipPath id="'+clipId+'"><rect x="0" y="0" width="'+BKF_STAR_CLIP_W+'" height="'+BKF_STAR_CLIP_H+'"/></clipPath></defs><path d="'+BKF_STAR_PATH+'" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"/><path d="'+BKF_STAR_PATH+'" fill="currentColor" clip-path="url(#'+clipId+')"/></svg>'}else stars+='<svg class="w-8 h-8 md:w-7 md:h-7" fill="none" viewBox="'+BKF_STAR_VB+'" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><path d="'+BKF_STAR_PATH+'" stroke="currentColor" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"/></svg>'}return stars}function createProductHTML(product){var imageHtml=product.image?'<img src="'+esc(product.image)+'" alt="'+esc(product.title)+'" class="bkf-col-carousel__slide-image" loading="lazy" />':'<div class="bkf-col-carousel__placeholder"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 525.5 525.5" class="w-full h-full fill-gray-300" aria-hidden="true"><path d="M324.5 212.7H203c-1.6 0-2.8 1.3-2.8 2.8V308c0 1.6 1.3 2.8 2.8 2.8h121.6c1.6 0 2.8-1.3 2.8-2.8v-92.5c0-1.6-1.3-2.8-2.9-2.8zm1.1 95.3c0 .6-.5 1.1-1.1 1.1H203c-.6 0-1.1-.5-1.1-1.1v-92.5c0-.6.5-1.1 1.1-1.1h121.6c.6 0 1.1.5 1.1 1.1v92.5z"/><path d="M210.4 299.5H240v.1s.1 0 .2-.1h21.6s0 .1.1.1h21.4v-57.8h-72.9v57.7zm2.2-55.6h68.4v42.2l-23.5-22.1c-.6-.5-1.5-.6-2.1-.1l-21.7 18.2-7.3-6.4c-.6-.5-1.5-.6-2.1-.1l-11.7 10v-41.7z"/><path d="M261.9 261.3c2.9 0 5.3-2.4 5.3-5.3s-2.4-5.3-5.3-5.3-5.3 2.4-5.3 5.3 2.4 5.3 5.3 5.3zm0-8.9c2 0 3.6 1.6 3.6 3.6s-1.6 3.6-3.6 3.6-3.6-1.6-3.6-3.6 1.6-3.6 3.6-3.6z"/></svg></div>';return'<div class="bkf-col-carousel__item carousel-item absolute top-1/2 cursor-pointer max-w-[140px] md:max-w-[243px] w-full" style="left: 50%; transform: translate(-50%, -50%); opacity: 0; pointer-events: none;"><div class="w-full relative flex flex-col items-center justify-center"><a class="bkf-col-carousel__media-link block w-full" data-bkf-carousel-product-link href="'+esc(product.url||"#")+'" aria-label="View '+esc(product.title||"product")+'" tabindex="-1">'+imageHtml+"</a></div></div>"}function prefersReducedMotion(){return window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function getByIdInRoot(root,id){var doc=root.ownerDocument||document,el=doc.getElementById(id);return el&&root.contains(el)?el:null}function mount(root,config){var sectionId=config.sectionId,products=config.products||[],track=getByIdInRoot(root,"track-"+sectionId),titleEl=getByIdInRoot(root,"productTitle-"+sectionId),container=getByIdInRoot(root,"reviewContainer-"+sectionId)||root.querySelector("[data-bkf-col-carousel-reviews]"),shopNowBtn=getByIdInRoot(root,"shopNowBtn-"+sectionId),prevBtn=getByIdInRoot(root,"prevBtn-"+sectionId),nextBtn=getByIdInRoot(root,"nextBtn-"+sectionId);if(!track||!titleEl||!shopNowBtn||products.length===0)return;var currentIndex=0,prevOffsets=[],startX=0,isDragging=!1;function updateCarousel(){var itemEls2=track.querySelectorAll(".bkf-col-carousel__item"),isMobile=window.innerWidth<768,numItems=products.length;itemEls2.forEach(function(el,index){var offset=((index-currentIndex)%numItems+numItems)%numItems,product=products[index];offset>Math.floor(numItems/2)&&(offset-=numItems);var style={left:"50%",scale:.5,z:0,op:0};offset===0?style={left:"50%",scale:isMobile?1.15:1.35,z:30,op:1}:offset===-1?style={left:isMobile?"25%":"33.4%",scale:isMobile?.9:1,z:20,op:isMobile?.65:1}:offset===1?style={left:isMobile?"75%":"66.6%",scale:isMobile?.9:1,z:20,op:isMobile?.65:1}:offset===-2?style={left:isMobile?"-25%":"16.5%",scale:isMobile?.6:1,z:10,op:isMobile?0:1}:offset===2?style={left:isMobile?"125%":"83.5%",scale:isMobile?.6:1,z:10,op:isMobile?0:1}:offset<-2?style={left:isMobile?"-50%":"0%",scale:isMobile?.5:1,z:0,op:0}:offset>2&&(style={left:isMobile?"150%":"100%",scale:isMobile?.5:1,z:0,op:0});var prevOffset=prevOffsets[index];prevOffset!==void 0&&(prevOffset>=2&&offset<=-2||prevOffset<=-2&&offset>=2)&&(el.style.transition="none",el.style.left=style.left,el.style.transform="translate(-50%, -50%) scale("+style.scale+")",el.style.zIndex=String(style.z),el.style.opacity=String(style.op),el.offsetWidth,el.style.transition=""),el.style.left=style.left,el.style.transform="translate(-50%, -50%) scale("+style.scale+")",el.style.zIndex=String(style.z),el.style.opacity=String(style.op),el.style.pointerEvents=style.op>0?"auto":"none";
1var mediaLink=el.querySelector("[data-bkf-carousel-product-link]"),isActiveProduct=offset===0&&style.op>0;mediaLink&&(mediaLink.href=product&&product.url||"#",mediaLink.setAttribute("aria-label","View "+(product&&product.title||"product")),mediaLink.tabIndex=isActiveProduct&&product&&product.url?0:-1,mediaLink.style.pointerEvents=isActiveProduct?"auto":"none",product&&product.url?mediaLink.removeAttribute("aria-disabled"):mediaLink.setAttribute("aria-disabled","true")),el.onclick=function(){offset!==0&&!isDragging&&(currentIndex=(currentIndex+offset+numItems)%numItems,updateCarousel(),updateProductInfo(!0))},prevOffsets[index]=offset})}function updateProductInfo(animate){animate===void 0&&(animate=!0);var product=products[currentIndex];if(!product)return;function applyProductCopy(){var starsTarget=container?container.querySelector(".bkf-col-carousel__stars")||container.querySelector("[data-bkf-rating-stars]"):null,reviewTextTarget=container?container.querySelector(".bkf-col-carousel__review-text")||container.querySelector(".bkf-col-carousel__review-label"):null;titleEl.textContent=product.title,shopNowBtn.href=product.url||"#",container&&container.setAttribute("aria-label",product.ratingLabel||"0 out of 5 stars, 0 REVIEWS"),starsTarget&&(starsTarget.innerHTML=renderRatingStars(product.ratingX10)),reviewTextTarget&&(reviewTextTarget.textContent=product.reviewText||"0 REVIEWS")}animate&&!prefersReducedMotion()?(titleEl.style.opacity="0",container&&(container.style.opacity="0"),setTimeout(function(){applyProductCopy(),titleEl.style.opacity="1",container&&(container.style.opacity="1")},300)):applyProductCopy()}function moveNext(){currentIndex=(currentIndex+1)%products.length,updateCarousel(),updateProductInfo(!0)}function movePrev(){currentIndex=(currentIndex-1+products.length)%products.length,updateCarousel(),updateProductInfo(!0)}function handleSwipe(diff){var threshold=50;Math.abs(diff)>threshold&&(diff>0?moveNext():movePrev())}function setupEventListeners(){nextBtn&&nextBtn.addEventListener("click",moveNext),prevBtn&&prevBtn.addEventListener("click",movePrev),track.querySelectorAll("[data-bkf-carousel-product-link]").forEach(function(link){link.addEventListener("click",function(e){link.getAttribute("href")==="#"&&e.preventDefault()})}),window.addEventListener("resize",function(){updateCarousel()}),track.addEventListener("touchstart",function(e){startX=e.touches[0].clientX,isDragging=!1},{passive:!0}),track.addEventListener("touchmove",function(){isDragging=!0},{passive:!0}),track.addEventListener("touchend",function(e){if(isDragging){var diff=startX-e.changedTouches[0].clientX;handleSwipe(diff),setTimeout(function(){isDragging=!1},50)}}),track.addEventListener("mousedown",function(e){startX=e.clientX,isDragging=!1}),track.addEventListener("mousemove",function(e){e.buttons===1&&(isDragging=!0)}),track.addEventListener("mouseup",function(e){if(isDragging){var diff=startX-e.clientX;handleSwipe(diff),setTimeout(function(){isDragging=!1},50)}}),track.addEventListener("mouseleave",function(){isDragging=!1})}track.innerHTML=products.map(createProductHTML).join("");var itemEls=track.querySelectorAll(".bkf-col-carousel__item");itemEls.forEach(function(el){el.style.transition="none"}),updateCarousel(),updateProductInfo(!1),setTimeout(function(){itemEls.forEach(function(el){el.style.transition=""})},50),setupEventListeners(),shopNowBtn.addEventListener("click",function(e){shopNowBtn.getAttribute("href")==="#"&&e.preventDefault()})}function mountAll(){document.querySelectorAll("[data-bkf-collection-carousel]:not([data-bkf-carousel-mounted])").forEach(function(root){var cfgEl=root.querySelector('script.bkf-collection-carousel__config[type="application/json"]');if(cfgEl)try{var config=JSON.parse(cfgEl.textContent);root.setAttribute("data-bkf-carousel-mounted",""),mount(root,config)}catch(e){console.warn("BKF Collection Product Carousel: invalid config",e)}})}function run(){mountAll()}if(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",run):run(),document.addEventListener("shopify:section:load",function(){mountAll()}),typeof MutationObserver!="undefined"){var addedNodesMayHaveCarousel2=function(mutations){for(var i=0;i<mutations.length;i++)for(var m=mutations[i],j=0;j<m.addedNodes.length;j++){var n=m.addedNodes[j];if(n.nodeType===1&&(n.matches&&n.matches("[data-bkf-collection-carousel]")||n.querySelector&&n.querySelector("[data-bkf-collection-carousel]")))return!0}return!1},addedNodesMayHaveCarousel=addedNodesMayHaveCarousel2,debounceTimer,mo=new MutationObserver(function(mutations){addedNodesMayHaveCarousel2(mutations)&&(clearTimeout(debounceTimer),debounceTimer=setTimeout(function(){mountAll()},50))});mo.observe(document.documentElement,{childList:!0,subtree:!0})}})();
2//# sourceMappingURL=/cdn/shop/t/11/assets/bkf-collection-product-carousel.js.map?v=78573385046447142891788191370
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.