${v}
`,w=rfUtils.createDomEl("div","rf-lightbox-content",y,{id:`rfvideo${c}`});t.appendChild(w);const S=w.querySelector(".rf-lightbox-wrapper");let b,x;if("products"!==i.interaction&&"quiz"!==i.interaction||(b=rfUtils.createDomEl("div","rf-lightbox-info rf-lightbox-info-lg",'
'),x=b.querySelector(".rf-lightbox-info-inner")),"products"===i.interaction)i.products?.length>0&&(S.appendChild(b),i.products?.length>1&&b.insertAdjacentHTML("afterbegin",rfUtils.popup_header(rfUtils.getCurrentLange("products_seen"),rfUtils.getCurrentLange("back"))),rfGalleryProductRender(i.products,S,x,e,t));else if("button"===i.interaction&&i.button){const t=i.button,e=`\n \n ${t.buttonLink&&t.buttonText?`
\n ${t.buttonText}\n `:""}`,s=rfUtils.createDomEl("div","rf-lightbox-button",e);S.appendChild(s)}else if("quiz"===i.interaction&&i.quiz){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");S.appendChild(b);const e=i.quiz,s=`\n \n \n ${e.answers&&e.answers.length?`\n
\n ${e.answers.map(((e,i)=>{const s="page_url"===e.destination?`data-link="${e.page_url}" data-target="${e.target}"`:"product"===e.destination?`data-products='${JSON.stringify(e.products)}'`:"";return`\n
\n ${t[i]}\n ${e.answer_text}\n
\n `})).join("")}\n
\n `:""}\n `,n=rfUtils.createDomEl("div","video-quiz__wrapper",s);x.appendChild(n)}rfUtils.documentEvent("reelfyGalleryItem",{itemElement:g,galleryElement:t,galleryData:e,position:h})})),"pops"==r){if(!document.getElementById("rfPopsContainer")){const e=`\n
${rfUtils.playIcons.solid}
\n
${rfUtils.closeSvg}\n `,i=rfUtils.createDomEl("div",`reelfy-pops-${h.shape} reelfy-pops-${h.position}`,e,{id:"rfPopsContainer"},{"--rf_pops_x_offset":`${h.x_offset}px`,"--rf_pops_y_offset":`${h.y_offset}px`,"--rf_pops_width":`${h.width_desktop}px`,"--rf_pops_width_mobile":`${h.width_mobile}px`,"--rf_pops_radius":`${h.radius}px`});t.appendChild(i)}}}function rfGaleryCustom(t,e){if(!rfCustom){const{pbatc:t,variant:i}=e.popup;window.rfShop={setup:{redirect:t,variant:i}},rfCustom=!0,window.rfThemeInfo=rfUtils.themeDetector(),window.rfCustomCss&&rfUtils.add_custom_css(window.rfCustomCss),window.rfSettingCss&&rfUtils.add_custom_css(window.rfSettingCss),window.rfCustomJs&&rfUtils.add_custom_js(window.rfCustomJs),rfUtils.body.classList.add(`rf-theme-${window.rfThemeInfo.themeName}`),rfUtils.getClientIP()}}function rfFetchProductDetail(t,e=()=>{},i=()=>{}){fetch(t).then((e=>{if(404==e.status)throw console.log("Product Not Found -- "+rfUtils.rfShopUrl+t),i&&i(e),new Error("Product_Not_Found");return e.json()})).then((t=>{window.rfProducts=window.rfProducts||{},window.rfProducts[t.id]=t,window.rfProductOptions=window.rfProductOptions||{},window.rfProductOptions[t.id]=t.options,e&&e(t)})).catch((function(t){console.log("Fetch Error : ",t)}))}function rfGaleryEvent(t,e){const i={galleryData:e,galleryElement:t,row:t.querySelector(".rf-gallery-main")},s=e.type;rfUtils.documentEvent("reelfyGallery",i),rfUtils.documentEvent("reelfyGallery"+s,i),"carousel"!=s&&"stacked"!=s||rfUtils.documentEvent("reelfyGalleryCarouselLayout",i),t.classList.remove("lf-loading");["reelfyLoaded","reelfyCreated","reelfyCreated"+s,"reelfyGallery","reelfyGallery"+s].forEach((t=>rfUtils.documentEvent(t,i))),rfUtils.is_masonry(s)&&rfUtils.documentEvent("reelfyGalleryMasonryLayout",i)}function rfLayoutMasonry(t){const e=t.querySelectorAll(".rf-grid__item"),i=t.offsetWidth,s=window.innerWidth,n=s<768||rfUtils.mobileCheck()?parseInt(t.dataset.guttermobile):parseInt(t.dataset.gutter);let r;r=s<768||rfUtils.mobileCheck()?parseInt(t.dataset.sm):s<1024?parseInt(t.dataset.md):parseInt(t.dataset.lg);const o=Math.floor(i/r-n*(r-1)/r);e.forEach((t=>{const e=parseInt(t.dataset.column),r=parseInt(t.dataset.row);let a=o*e+n*(e-1),l=o*r+n*(r-1);a>i&&(a=i,l=i*r/e,l
!s.has(t)));if(!i)return void t.style.setProperty("display","none","important");const n=rfUtils.getLinkLang(i);rfFetchProductDetail(`${n}.js`,(s=>{t.dataset.handle=i,t.classList.add("active");const r=t.querySelector("img");if(r){const t=parseInt(r.getAttribute("width")),n=s.featured_image||(i!==e[0]?rfUtils.placeholder:"");n&&r.setAttribute("src",n+(t?`${n.includes("?")?"&":"?"}width=${t}`:"")),r.setAttribute("alt",s.title)}t.querySelector(".reelfy_card_product__title").innerHTML=`${s.title}`,t.querySelector(".reelfy_card_product__prices").innerHTML=rfUtils.render_price(s),rfUtils.documentEvent("reelfyFetchProduct",{product:s,productAjax:t})}),(()=>{rfHideMissingProduct(i),rfFillProductCard(t,e)}))}function openProductInfo(t,e,i,s){const{id:n,handle:r,device:o}=t,a=`${rfUtils.productDesc(i.popup.accordions.desc)}
`;let l,h;if("desktop"===o){const t=e.querySelector(".rf-lightbox-single-product"),i=e.querySelector(".rf-product-list-large"),s=e.querySelector(".rf-list-wrap"),o=e.querySelector(".rf-video-desc");o?.classList.add("rfHidden"),i.classList.add("rfHidden"),t.classList.add("active"),s?.classList.add("active"),h=`\n \n
\n ${rfUtils.productBody()} ${rfUtils.productVariants} ${rfUtils.productForm}\n
\n ${a}\n
`,t.innerHTML=h,t.dataset.handle=r,t.dataset.id=n,l=t}else{const t=document.getElementById("rf-mobile-product"),e=t.querySelector(".rf-mext-main");t.classList.add("active"),h=`\n `,e.innerHTML=h;const s=e.querySelector(".rf-product-close");s?.addEventListener("click",(()=>{t.classList.remove("active")})),l=t}window.rfProducts&&window.rfProducts[n]?rfRenderProductInfo(i,s,window.rfProducts[n],l,null):fetchLightboxDetail(i,s,r,l,null)}document.addEventListener("reelfyGallery",(t=>{const{galleryData:e,galleryElement:s}=t.detail,n={gallery:s,children:"a.rf-video-lightbox",pswpModule:RfPhotoSwipe,padding:{top:20,bottom:20,left:20,right:20},closeOnVerticalDrag:!1},r=new RfPhotoSwipeLightbox(n);rfUtils.documentEvent("reelfyGalleryLightbox",{lightbox:r,lightboxConfig:n,galleryElement:s,galleryData:e}),r.on("afterInit",(()=>{const{pswp:t}=r;if(document.body.classList.add("reelfy-active"),document.querySelector(".pswp_rf").addEventListener("wheel",(t=>{["scrollable"].forEach((e=>{(t.target.classList.contains(e)||t.target.closest(`.${e}`))&&t.stopPropagation()}))}),{capture:!0,passive:!0}),t.element.classList.add(`shopify-section-${e.section}`,`info_button-${e.popup.ibutton}`),!s.classList.contains("video-active")){s.classList.add("video-active");s.querySelectorAll(".rf-video-item").forEach((n=>{n.classList.add("rf-video-enabled");const r=n.querySelector(".rf-video-lightbox"),o=document.querySelector(rfUtils.getId(r.getAttribute("href"))).querySelector(".rf-lightbox-video"),a=o.querySelector("video");if(a){a.setAttribute("src",r.dataset.video);const n=new i;rf_player_video(o,{play:!1,muted:!!s.classList.contains("rf-gallery-epopup")||n.getItem("rfVideoMuted",!1)},e,t)}}))}})),r.on("close",(()=>{document.body.classList.remove("reelfy-active")})),r.on("change",(()=>{const{pswp:t}=r,i=t.container.querySelectorAll(".pswp_rf__item");i.forEach(((t,e)=>{const i=t.querySelector("video");i&&(i.muted=!0)})),setTimeout((function(){i.forEach(((i,n)=>{rfUtils.documentEvent("reelfyVideoChange",{galleryData:e,galleryElement:s,pswp:t,slide:i,position:n})}))}),1e3)})),r.addFilter("itemData",((t,e)=>{const{element:i}=t;return t.htmlContentId=rfUtils.getId(i.getAttribute("href")),t.videoId=i.dataset.id||null,t.video=i.dataset.video||null,t.poster=i.dataset.poster||null,t})),r.on("contentLoad",(t=>{const{content:e}=t,{data:i}=e;if(i.htmlContentId){e.lightboxElement=document.querySelector(rfUtils.getId(i.htmlContentId));const t=document.createElement("div");t.className="pswp__reelfy-container",e.element=t}})),r.on("contentAppend",(t=>{const{content:i}=t;i.element.appendChild(i.lightboxElement),rfUtils.documentEvent("reelfyVideoLoad",{galleryData:e,galleryElement:s,contentElement:i.element,data:i.data})})),r.on("contentRemove",(t=>{const{content:e}=t,{lightboxElement:i}=e;e.data.element.closest(".rf-gallery-main").appendChild(i);const s=i.querySelector("video");s?.pause()})),r.on("close",(()=>{const{pswp:t}=r,e=t.container.querySelectorAll(".rf-lightbox-content"),i=t.hi.element.closest(".rf-gallery-main"),s=document.getElementById("rfPlayerPops");s&&s.play(),e.forEach(((t,e)=>{i.appendChild(t);const s=t.querySelector("video");s?.pause()}))})),r.init()})),document.addEventListener("reelfyGallery",(({detail:t})=>{const{galleryElement:e,galleryData:i}=t;e.querySelectorAll(".video-quiz__answer").forEach((t=>{t.addEventListener("click",(function(){const{destination:s,link:n,target:r,products:o}=this.dataset;switch(s){case"page_url":if(n){"true"===r||"_blank"===r?window.open(n,"_blank"):window.location.href=n}break;case"product":const s=JSON.parse(o||"[]"),a=t.closest(".video-quiz__wrapper"),l=t.closest(".rf-lightbox-wrapper");a.classList.add("rfHidden"),1===s.length&&l.classList.add("quiz-single-active"),rfGalleryProductRender(s,l,t.closest(".rf-lightbox-info-inner"),i,e),[...l.querySelectorAll(".rf-product-open"),...l.querySelectorAll(".rf-product-mopen")].forEach((t=>{t.addEventListener("click",(s=>{s.preventDefault();const n=t.closest(".rf-product-item");openProductInfo({id:n.dataset.id,handle:n.dataset.handle,device:n.dataset.device},l,i,e)}))}));const h=l.querySelectorAll(".rf-product-item"),d=l.querySelector(".rf-product-list-large");h.forEach(((t,s)=>{const n=t.dataset.id,r=t.dataset.handle;void 0===window.rfProducts||void 0===window.rfProducts[n]?fetchLightboxDetail(i,e,r,t,null,s,d):rfRenderProductInfo(i,e,window.rfProducts[n],t,null,s,d)}))}}))}))})),document.addEventListener("reelfyGalleryItem",(({detail:t})=>{const{itemElement:e,galleryData:i}=t,s=e.querySelector("video"),n=s?.querySelector("source"),r=()=>{!n.src&&n.dataset.src&&(n.src=n.dataset.src,s.load())};if(s)if(s.controls=!1,s.closest(".reelfy_card_hover")){const t=()=>{r(),s.play().catch((()=>{}))},i=()=>s.pause();e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",i),e.addEventListener("touchstart",t),e.addEventListener("touchend",i)}else if(s.closest(".reelfy_card_autoplay")){const t=parseFloat(s.dataset.time)||6,e=()=>{s.currentTime>=t&&(s.currentTime=0,s.play().catch((()=>{})))},n=t=>{console.warn("๐ Reloading video due to network error",t),s.load(),s.play().catch((()=>{}))};new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting?(r(),s.muted=!0,s.play().catch((()=>{})),"stories"==i.type&&s.addEventListener("timeupdate",e),s.addEventListener("error",n)):(s.pause(),s.removeEventListener("error",n),"stories"==i.type&&s.removeEventListener("timeupdate",e))}))}),{rootMargin:"100px 0px",threshold:.25}).observe(s)}const o=e.querySelector(".card_product_ajax");if(o){const t=e.querySelector("a.reelfy_link_main")?.getAttribute("href")||"",i=t.startsWith("#")?document.getElementById(t.slice(1)):null,s=i?i.querySelectorAll(".rf-product-item[data-handle]"):[];rfFillProductCard(o,[...new Set([o.dataset.handle,...[...s].map((t=>t.dataset.handle))])].filter(Boolean))}})),document.addEventListener("reelfyVideoLoad",(t=>{const{galleryData:e,galleryElement:i,contentElement:s,data:n}=t.detail;let r=(window.innerHeight-100)*(9/16)*2;const o=.45*window.innerWidth;r=Math.max(r,o);const a=s.querySelector(".rf-lightbox-wrapper");a&&(a.style.maxWidth=`${r}px`);const l=s.querySelector(".rf-lightbox-single-product"),h=s.querySelector(".rf-carousel-wrap"),d=s.querySelector(".rf-product-list-large"),c=s.querySelector(".rf-list-wrap"),u=s.querySelector(".rf-video-desc");let p=[];const f=["popup","atc"].includes(e.popup.cardAction);if(h){h.querySelectorAll(".rf-product-item").forEach(((t,s)=>{const n=t.dataset.id,r=t.dataset.handle;void 0===window.rfProducts||void 0===window.rfProducts[n]?fetchLightboxDetail(e,i,r,t,null,s,d):rfRenderProductInfo(e,i,window.rfProducts[n],t,null,s,d)}));const t=h.querySelectorAll(".rf-product-mopen");t.length>0&&f&&(p=[...p,...t])}if(d&&f){const t=d.querySelectorAll(".rf-product-open");p=[...p,...t]}p.forEach((t=>{t.addEventListener("click",(t=>{t.preventDefault();const s=t.target.closest(".rf-product-item");openProductInfo({id:s.dataset.id,handle:s.dataset.handle,device:s.dataset.device},s.closest(".rf-lightbox-content"),e,i)}))}));const m=a.querySelector(".rf-list-back a");if(m&&m.addEventListener("click",(function(t){t.preventDefault(),c.classList.remove("active"),l.classList.remove("active"),d.classList.remove("rfHidden"),u.classList.remove("rfHidden")})),l&&l.classList.contains("active")){const t=l.dataset.id,s=l.dataset.handle,n=`${rfUtils.productDesc(e.popup.accordions.desc)}
`;l.innerHTML=`\n \n
\n ${rfUtils.productBody()} ${rfUtils.productVariants} ${rfUtils.productForm} \n
\n ${n}\n
`,void 0===window.rfProducts||void 0===window.rfProducts[t]?fetchLightboxDetail(e,i,s,l):rfRenderProductInfo(e,i,window.rfProducts[t],l)}})),document.addEventListener("reelfyVideoChange",(t=>{const{pswp:e,slide:s,position:n}=t.detail,r=new i,o=s.querySelector(".rf-lightbox-video");if(o){const t=o.querySelector(".play-icon"),i=o.querySelector(".pause-icon"),s=o.querySelector("video"),a=o.querySelector(".mute-icon"),l=o.querySelector(".unmute-icon");if(console.log("Playing video for slide index:",n),o.dataset.id==e.currSlide.data.videoId){o.closest(".reelfy-gallery.rf-gallery-epopup");s?.play().then((()=>{t?.classList.remove("active"),i?.classList.add("active")})).catch((e=>{t?.classList.add("active"),i?.classList.remove("active"),console.error("Error attempting to play video:",e)}));const e=r.getItem("rfVideoMuted",!1);s&&(s.muted=e),s?.muted?(a?.classList.remove("active"),l?.classList.add("active")):(a?.classList.add("active"),l?.classList.remove("active"))}else s?.pause(),t?.classList.add("active"),i?.classList.remove("active")}})),document.addEventListener("reelfyProductForm",(t=>{const{galleryElement:e,galleryData:i,productElement:s,product:n,sectionId:r,variants:o}=t.detail;if(!t.detail.form)return;const a=t.detail.form.querySelector(".rf-addtocart-form"),l=a.querySelector(".rf-button-atc"),h=l.querySelector(".rf-loading-overlay__check"),d=(a.dataset.product,a.querySelector("form")),c=window.rfProductOptions?.[n.id]||n.options;if(l&&(l.addEventListener("click",(function(t){t.preventDefault();var s=t.target.closest(".rf-lightbox-wrapper"),n=0;if(!s){const t=document.querySelector('.pswp_rf .pswp_rf__item[aria-hidden="false"]');t&&(s=t.querySelector(".rf-lightbox-wrapper"))}s&&(n=s.dataset.id);if(localStorage.setItem("rf_atc_video",n),!l.classList.contains("disabled")&&!l.classList.contains("loading")){var r=a.querySelector(".rfProduct__error-message-wrapper");l.classList.add("loading"),l.querySelector(".rf-loading-overlay__spinner").classList.remove("rfHidden"),r.classList.add("rfHidden");const t={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/javascript"}};t.headers["X-Requested-With"]="XMLHttpRequest",delete t.headers["Content-Type"];const s=new FormData(d);s.append("sections_url",window.location.pathname);const n=rfUtils.cart_formData(window.rfThemeInfo.themeName);n&&s.append("sections",n),t.body=s,fetch(`${rfUtils.cartAdd}?reelfy-cart-call`,t).then((t=>t.json())).then((t=>{if(l.classList.add("added"),h.classList.remove("rfHidden"),setTimeout((function(){l.classList.remove("rfHidden","added"),h.classList.add("rfHidden")}),2e3),t.status)r.classList.remove("rfHidden"),r.querySelector(".rf-error-message").innerHTML=t.description;else{const s={galleryElement:e,galleryData:i,cartDetail:t,form:d};rfUtils.documentEvent("reelfyCartAdded",s),rfUtils.documentEvent("reelfyCartAdded_"+window.rfThemeInfo.themeName,s)}})).catch((t=>{console.error("reelfyCartError",t),document.dispatchEvent(new CustomEvent("reelfyCartError",{detail:{error:t}}))})).finally((()=>{l.classList.remove("loading"),l.querySelector(".rf-loading-overlay__spinner").classList.add("rfHidden"),document.dispatchEvent(new CustomEvent("reelfyCartFinally",{}))}))}})),o)){const t=o.querySelectorAll(".variant-radio");if(t.length){f(o);for(var u=0;u{var i=o.querySelectorAll('[name="'+t.name+'"]');if(!i.length){const e=`template--${r}-${t.position}`;i=o.querySelectorAll('[name="'+e+'"]')}for(var s of i)s.checked&&e.push(s.value)})),2==e.length?e.push(null):1==e.length&&(e.push(null),e.push(null)),n.variants.map(((t,s)=>{t.option1==e[0]&&t.option2==e[1]&&t.option3==e[2]&&(i=t.id)})),d.querySelector("[name=id]").value=i,f(o)}function f(t){var o,a=null,h=null,u=null,p=[],f=[],m=[],g=[],v=!0,y=d.querySelector("[name=id]").value;if(y){n.variants.map(((t,e)=>{y==t.id&&(a=t.option1,h=t.option2,u=t.option3,v=t.available,o=t),p.push(t.available),f.push(t.option1),m.push(t.option2),g.push(t.option3)})),c.map(((e,i)=>{e.values.map(((s,n)=>{var o=a,l=!0;1==i?o=h:2==i&&(o=u),f.forEach(((t,i)=>{1==e.position?f[i]==s&&p[i]&&(l=!1):2==e.position?t==a&&m[i]==s&&p[i]&&(l=!1):t==a&&m[i]==h&&g[i]==s&&p[i]&&(l=!1)}));var d=t.querySelector(`#template--${r}-${e.position}-${n}`);d&&(l?d.classList.add("disabled"):d.classList.remove("disabled"),d.checked=o==s)}))})),v?l.classList.remove("disabled"):l.classList.add("disabled");const d=s.querySelector(".rf-product-prices");d&&(d.innerHTML=rfUtils.render_price(o));const w=s.querySelector(".rf-product-img"),S=w.querySelector("img"),b=o?.featured_image?.src?o.featured_image.src:w.dataset.img;S.src=rfUtils.getSizedImageUrl(b,w.dataset.width+"x"),rfUtils.documentEvent("reelfyGalleryVariantsSelected",{galleryElement:e,galleryData:i,productElement:s,product:n})}}}));const n=(t,e)=>{t.childNodes.forEach((t=>t.style.pointerEvents=e))};function getReelfyTargetFromHash(){const t=window.location.hash.match(/^#rfgallery-(\d+)-video-(\d+)$/);return t?{galleryId:Number(t[1]),videoId:Number(t[2])}:null}function injectReelfyGallery({galleryId:t,videoId:e}){const i=`.reelfy-gallery[data-id="${t}"]`;let s=document.querySelector(i);s||(s=document.createElement("div"),s.className="reelfy-gallery reelfy-gallery-notlazy",s.dataset.id=t,s.dataset.video=e,document.body.appendChild(s));const n=`.rf-video-item.video-${e} a.rf-video-lightbox`,r=Date.now(),o=()=>{const t=s.querySelector(n);return!!t&&(s.classList.add("rfHidden","rf-gallery-epopup"),t.click(),!0)};if(o())return;const a=new MutationObserver((()=>{o()?a.disconnect():Date.now()-r>1e4&&(a.disconnect(),console.warn(`[Reelfy] Video ${e} not found in gallery ${t} after 10000ms`))}));a.observe(s,{childList:!0,subtree:!0})}function rfGetSectionInnerHTML(t,e=".shopify-section"){return(new DOMParser).parseFromString(t,"text/html").querySelector(e).innerHTML}document.addEventListener("reelfyGallerypops",(({detail:{galleryData:t,galleryElement:e}})=>{const s=`rfPopsCloseTime${t.id}`,n=document.getElementById("rfPopsContainer"),r=document.getElementById("rfPlayerPops"),o=document.getElementById("rfPopsClose"),a=document.getElementById("rfPopsOpen"),l=new i;if(![n,r,o,a].every(Boolean))return void console.warn("Missing required elements.");document.body.appendChild(n);const h=[...e.querySelectorAll(".rf-video-lightbox")].map((t=>t.dataset.section));let d=0;const c=t=>{t>=0&&t{d=(d+1)%h.length,c(d)}));const u=l.getItem(s);!u||Date.now()-u>=rfUtils.stringToDate(t.popup.closed)?(n.style.display="block",c(d)):n.style.display="none",o.addEventListener("click",(t=>{t.preventDefault(),r.pause(),n.style.display="none",l.setItem(s,Date.now())})),a.addEventListener("click",(t=>{t.preventDefault(),r.pause(),e.querySelectorAll(".rf-video-lightbox")?.[d]?.click()}))})),document.addEventListener("reelfyGalleryMasonryLayout",(t=>{const{row:e,galleryElement:i,galleryData:s}=t.detail;var n={itemSelector:".rf-grid__item:not(.lfHidden)",gutter:".rf-gutter-sizer"};const r=rfUtils.createDomEl("div","rf-gutter-sizer");e.appendChild(r),imagesLoaded(e,(function(){var t=new Masonry(e,n);e.querySelectorAll("video").forEach((e=>{e.readyState>=1?t.layout():e.addEventListener("loadedmetadata",(()=>{t.layout()}),{once:!0})})),"grid"==s.type&&window.addEventListener("resize",rfUtils.rfDebounce((function(e){rfLayoutMasonry(i),t.layout()}))),e.classList.add("masonry-enabled"),rfUtils.documentEvent("reelfyGalleryMasonryEnd",{msnry:t,msnry_object:n,galleryMain:e,galleryElement:i,galleryData:s,rfLayoutMasonry:rfLayoutMasonry})}))})),document.addEventListener("reelfyGallerystories",(({detail:{galleryData:t,galleryElement:e}})=>{const i=e.querySelector(".rf-gallery-main");if(!i.hasChildNodes())return;const s=new flickityrf(i,{draggable:!0,freeScroll:!0,pageDots:!1,prevNextButtons:!1,resize:!1,wrapAround:!1,contain:!0,cellAlign:t.story?.align||"left"});s.on("dragStart",(()=>n(s.slider,"none"))),s.on("dragEnd",(()=>n(s.slider,"all")))})),document.addEventListener("reelfyGalleryCarouselLayout",(({detail:{galleryData:t,galleryElement:e}})=>{const i=e.querySelector(".rf-gallery-main"),s=e.querySelectorAll(".rf-video-item");if(!s?.length)return e.classList.add("rfHidden"),void(rfUtils.isAdmin()||e.closest(".shopify-block")?.classList.add("rfHidden"));const r=window.rfCarousel||rfUtils.get_carousel(JSON.parse(i.getAttribute("data-carousel"))),o=()=>{const e=window.innerWidth,i="carousel"===t.type?"carousel_":"stacked"===t.type?"stacked_":"row_",s=e<768?"mobile":e<1024?"tablet":"desktop";return t.sectionc[`${i}${s}_column`]||1},a=()=>{const t=o();e.classList.toggle("rf-disable-nav",s.lengthn(l.slider,"none"))),l.on("dragEnd",(()=>n(l.slider,"all"))),l.on("change",(function(t){rfUtils.documentEvent("reelfyGallerycarouselChange",{rlkty:l,index:t,galleryElement:e,carouselConfig:r})}));const h=e.querySelector(".flickityrf-viewport"),d=e.querySelector(".rf-video-item"),c=e.querySelector(".card_type-product_card .reelfy_card_product"),u=()=>{const e=window.innerWidth;a();const i=window.rfStackedHeight||768;if("stacked"===t.type&&e{cancelAnimationFrame(p),p=requestAnimationFrame(u)};window.addEventListener("resize",f),window.addEventListener("orientationchange",f),rfUtils.documentEvent("reelfyGallerycarouselEnd",{rlkty:l,galleryElement:e,carouselConfig:r})})),document.addEventListener("reelfyGalleryproductw",(({detail:{galleryData:t,galleryElement:e}})=>{const i=e.querySelector(".rf-gallery-main"),s=e.querySelectorAll(".rf-video-item");if(s?.length>0){const s=window.rfCarousel||rfUtils.get_carousel(JSON.parse(i.getAttribute("data-carousel"))),r=new flickityrf(i,{...s,cellAlign:window.ProductwcellAlign||"left"});r.on("dragStart",(()=>n(r.slider,"none"))),r.on("dragEnd",(()=>n(r.slider,"all"))),rfUtils.documentEvent("reelfyGalleryproductwEnd",{rlkty:r,galleryData:t,galleryElement:e,carouselConfig:s})}})),document.addEventListener("reelfyGallery",(({detail:{galleryData:t,galleryElement:e}})=>{if(!t.permissions?.analytic)return;const i={...t,href:window.location.href};e.querySelectorAll("a.rf-video-lightbox").forEach((t=>{t.addEventListener("click",(({target:t})=>{const e=t.closest("a")?.getAttribute("href");e&&rfUtils.sendPixel("rf_click",{...i,link:e})}))}))})),document.addEventListener("reelfyCartAdded",(({detail:{cartDetail:t,galleryData:e}})=>{e.permissions?.analytic&&rfUtils.sendPixel("rf_add_to_cart",{id:e.id,cartDetail:t,href:window.location.href,video:localStorage.getItem("rf_atc_video")}),rfUtils.showToast(rfUtils.getCurrentLange("added_to_cart")),"cart"==rfShop.setup.redirect?window.location.href="/cart":"checkout"==rfShop.setup.redirect&&(window.location.href="/checkout")})),document.addEventListener("DOMContentLoaded",(()=>{const t=getReelfyTargetFromHash();t&&injectReelfyGallery(t)})),document.addEventListener("reelfyCartFinally",(()=>{if("dawn"!==window.rfThemeInfo.themeName)return;const t=document.querySelector("cart-notification, cart-drawer");t?.classList.remove("is-empty")})),document.addEventListener("reelfyCartAdded",(()=>{window?.SLIDECART_UPDATE?.(),window?.STICKY_CART_UPDATE?.(),window?.upcartRefreshCart?.(),window?.opusOpen?.()})),document.addEventListener("reelfyCartAdded_dawn",(t=>{const e=document.querySelector("cart-notification")||document.querySelector("cart-drawer");if(e)if(t.detail.products&&document.querySelector("cart-notification")){document.getElementById("cart-icon-bubble").innerHTML=rfGetSectionInnerHTML(t.detail.cartDetail.sections["cart-icon-bubble"])}else e.renderContents(t.detail.cartDetail),setTimeout((()=>{const t=document.querySelector(".drawer__close");t&&t.click();const e=document.querySelector(".cart-notification__close");e&&e.click()}),1e3)})),document.addEventListener("reelfyCartAdded_reformation",(()=>{document.dispatchEvent(new CustomEvent("cart:refresh")),document.querySelector("#cart-drawer-toggle")?.click()})),document.addEventListener("reelfyCartAdded_hongo",(({detail:{cartDetail:t}})=>{const e=rfUtils.select("cart-notification");if(e){const{sections:i}=t||{};e.updateContent(i),e.open(),rfUtils.getJson("/cart.js",(t=>{rfUtils.selectAll("span[data-cart-count]").forEach((e=>{e.innerText=t.item_count}))}))}})),document.addEventListener("reelfyCartAdded_symmetry",(({detail:{cartDetail:t}})=>{rfUtils.select("cart-drawer")&&(["page-header","cart-drawer"].map((t=>rfUtils.select(t))).filter((t=>t)).forEach((e=>{e.updateFromCartChange(t.sections[e.dataset.sectionId])})),rfUtils.select(".js-cart-drawer").open())})),document.addEventListener("reelfyCartAdded_posetheme",(()=>{theme.miniCart.generateCart(),theme.miniCart.updateElements(),document.querySelector(".pswp_rf__button--close")?.click()})),document.addEventListener("reelfyCartAdded_combine",(()=>{window.refreshCart(),setTimeout((()=>{document.querySelector("#site-cart-sidebar .sidebar__close").click()}),1e3)})),document.addEventListener("reelfyCartAdded_broadcast",(()=>{window.cart?.updateCart()})),document.addEventListener("reelfyCartAdded_prestige",(async()=>{document.dispatchEvent(new CustomEvent("cart:refresh")),document.querySelector("[aria-controls='cart-drawer']")?.click()})),document.addEventListener("reelfyCartAdded_prestige",(()=>{document.dispatchEvent(new CustomEvent("cart:refresh")),document.querySelector("#cart-drawer-toggle")?.click()})),document.addEventListener("reelfyCartAdded_woodstock",(async({detail:{cartDetail:t}})=>{const e=document.querySelector("cart-drawer");e&&(e.renderContents(t),e.classList.remove("is-empty"))})),document.addEventListener("reelfyCartAdded_stiletto",(()=>{document.querySelector(".quick-cart")&&document.dispatchEvent(new CustomEvent("apps:product-added-to-cart"))})),document.addEventListener("reelfyCartAdded_debutify",(()=>{window.ajaxCart&&window.ajaxCart.load&&ajaxCart.load()})),document.addEventListener("reelfyCartAdded_glozin",(async t=>{const{cartDetail:e}=t.detail,i=document.querySelector("cart-notification");fetch("/cart.json").then((t=>t.json())).then((t=>{if(null!=t.item_count){document.querySelectorAll(".cart-count").forEach((e=>{e.classList.contains("cart-count-drawer")?e.innerHTML=`(${t.item_count})`:e.innerHTML=t.item_count>100?"~":t.item_count})),document.querySelector("header-total-price")&&document.querySelector("header-total-price").updateTotal(t);const e=document.querySelector("free-ship-progress-bar");e&&e.init(t.items_subtotal_price)}})).catch((t=>{throw t})),i.getSectionsToRender().forEach((t=>{const i=document.getElementById(t.id),s=(new DOMParser).parseFromString(e.sections[t.id],"text/html");i.innerHTML=s.querySelector("#minicart-form").innerHTML})),i.open()})),document.addEventListener("reelfyCartAdded_sleek",(()=>{document.dispatchEvent(new CustomEvent("cart:refresh",{detail:{open:!0}})),fetch("/cart.json").then((t=>t.json())).then((t=>{if(null!=t.item_count){document.querySelectorAll("cart-count").forEach((e=>{e.onCartUpdate({cart:{item_count:t.item_count}})}))}})).catch((t=>{throw t}))})),document.addEventListener("reelfyCartAdded_horizon",(({detail:{cartDetail:t}})=>{rfUtils.select("cart-drawer-component")&&(document.dispatchEvent(new CustomEvent("cart:update",{detail:{source:"cart-items-component",data:t}})),rfUtils.select("cart-drawer-component")?.open())})),document.addEventListener("reelfyCartAdded_the4",(({detail:{cartDetail:t}})=>{window.T4SThemeSP.Cart.renderContents(t.sections),window.T4SThemeSP.Drawer&&window.T4SThemeSP.Drawer.opend($("#t4s-mini_cart"))})),document.addEventListener("reelfyCartAdded_minimog",(()=>{const t=rfUtils.select("m-cart-drawer");t&&(t.onCartDrawerUpdate(),t.open(),rfUtils.select("foxkit-cart-goal")?.updateProgress())})),document.addEventListener("reelfyCartAdded_impulse",(()=>{if("drawer"==theme.settings.cartType){(new theme.CartDrawer).open()}})),document.addEventListener("reelfyCartAdded_beyours",(({detail:{cartDetail:t}})=>{document.querySelector("mini-cart")?.renderContents(t)})),document.addEventListener("reelfyCartAdded_enterprise",(()=>{const t=document.querySelector("cart-drawer");t?.refresh().then((()=>t.open()))})),document.addEventListener("reelfyCartAdded_concept",(({detail:{cartDetail:t}})=>{const e=rfUtils.select("cart-drawer");if(e){const i=rfGetSectionInnerHTML(t.sections[e.dataset.sectionId],"cart-count");t.item_count=i,rfUtils.selectAll("cart-count").forEach((e=>e.onCartUpdate({cart:t}))),e.onCartRefresh({detail:{open:!0}})}})),document.addEventListener("reelfyCartAdded_shella",(()=>{rfUtils.getJson("/cart.js",(t=>{const e=window.theme.Cart;e?.updateCartPopupContent().then((()=>{e.updateCartPageContent().then((()=>{const i=t.item_count;e.$counterDesktop.attr("data-js-cart-count-desktop",i).html(theme.strings.header.cart_count_desktop.replace("{{ count }}",i)),e.$counterMobile.attr("data-js-cart-count-mobile",i).html(i)}))})),e?.updateHeaderCount(t),e?.updateValues(t),e?.updateFreeShipping(t),rfUtils.select(".header__btn-cart")?.click()}))})),document.addEventListener("reelfyCartAdded_sahara",(({detail:{cartDetail:t}})=>{const e=rfUtils.select("cart-drawer");e&&e.renderContents(t)})),document.addEventListener("reelfyCartAdded_focal",(({detail:{cartDetail:t}})=>{const e=rfUtils.select("cart-drawer");e&&rfUtils.getJson("/cart.js",(({item_count:i})=>{e._rerenderCart({detail:{cart:{...e,sections:t.sections}}}),e.setAttribute("open",""),document.querySelectorAll("cart-count").forEach((t=>{t.textContent=i}))}))})),document.addEventListener("reelfyCartAdded_motion",(()=>{document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{},bubbles:!0}))})),document.addEventListener("reelfyCartAdded_tinker",(({detail:{cartDetail:t}})=>{document.dispatchEvent(new CustomEvent("cart:update",{detail:{data:{sections:t.sections}}}))})),document.addEventListener("reelfyCartAdded_ella",(()=>{fetch("/cart.js").then((t=>t.json())).then((t=>{window.sharedFunctions.updateSidebarCart(t)}))}));const r=new IntersectionObserver(((t,e)=>{t.forEach((t=>{if(t.isIntersecting){const i=t.target;if(!i.classList.contains("rf-active"))try{i.classList.add("rf-loading"),rfGallery(i),i.classList.add("rf-active"),i.classList.remove("rf-loading")}catch(t){console.error("Error initializing gallery:",t),i.classList.remove("rf-loading"),i.classList.add("rf-error")}e.unobserve(i)}}))}),{root:null,rootMargin:"200px 0px",threshold:.01}),o=()=>{document.querySelectorAll(".reelfy-gallery").forEach((t=>{if(t.classList.contains("rf-active"))return;if(["rf-gallery-site","reelfy-gallery-notlazy"].some((e=>t.classList.contains(e))))try{rfGallery(t),t.classList.add("rf-active")}catch(e){console.error("Error initializing immediate gallery:",e),t.classList.add("rf-error")}else r.observe(t)})),document.addEventListener("DOMContentLoaded",(e=>{new t(document,".flickityrf-slider").init()}))};o();new MutationObserver((t=>{let e=!1;for(const i of t)if("childList"===i.type){if(e=Array.from(i.addedNodes).some((t=>t.nodeType===Node.ELEMENT_NODE&&(t.classList?.contains("reelfy-gallery")||t.querySelector?.(".reelfy-gallery")))),e)break}e&&o()})).observe(document.body,{childList:!0,subtree:!0})}