var me=Object.defineProperty;var Nt=x=>{throw TypeError(x)};var pe=(x,t,e)=>t in x?me(x,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):x[t]=e;var Bt=(x,t,e)=>pe(x,typeof t!="symbol"?t+"":t,e),Lt=(x,t,e)=>t.has(x)||Nt("Cannot "+e);var i=(x,t,e)=>(Lt(x,t,"read from private field"),e?e.call(x):t.get(x)),y=(x,t,e)=>t.has(x)?Nt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(x):t.set(x,e),p=(x,t,e,a)=>(Lt(x,t,"write to private field"),a?a.call(x,e):t.set(x,e),e),c=(x,t,e)=>(Lt(x,t,"access private method"),e);var K,$,st,at,nt,ot,S,Ht,zt,xt,Mt,Ct;class ge{constructor(t){y(this,S);y(this,K);y(this,$);y(this,st);y(this,at);y(this,nt);y(this,ot);p(this,$,t),p(this,K,i(this,$).querySelectorAll("[data-tab]")),p(this,st,i(this,$).querySelector("[data-fluent-cart-product-item-price]")),p(this,at,i(this,$).querySelector("[data-fluent-cart-product-payment-type]")),p(this,nt,i(this,$).querySelector("[data-fluent-cart-product-quantity-container]")),p(this,ot,i(this,$).querySelector("[data-fluent-cart-add-to-cart-button]"))}init(){c(this,S,Ht).call(this),c(this,S,zt).call(this)}handleVariationChange(t){t.closest("[data-tab-content]")}}K=new WeakMap,$=new WeakMap,st=new WeakMap,at=new WeakMap,nt=new WeakMap,ot=new WeakMap,S=new WeakSet,Ht=function(){i(this,K).forEach(t=>{t.addEventListener("click",()=>{c(this,S,xt).call(this,t)}),t.addEventListener("keydown",e=>{const a=Array.from(i(this,K)),o=a.indexOf(t);let n=-1;switch(e.key){case"Enter":case" ":e.preventDefault(),c(this,S,xt).call(this,t);return;case"ArrowRight":e.preventDefault(),n=(o+1)%a.length;break;case"ArrowLeft":e.preventDefault(),n=(o-1+a.length)%a.length;break;case"Home":e.preventDefault(),n=0;break;case"End":e.preventDefault(),n=a.length-1;break;default:return}n>=0&&(a[n].focus(),c(this,S,xt).call(this,a[n]))})})},zt=function(){const t=Array.from(i(this,K)).find(e=>e.classList.contains("active"));t&&c(this,S,Ct).call(this,t)},xt=function(t,e=!1){i(this,st)&&i(this,st).classList.add("is-hidden"),i(this,at)&&i(this,at).classList.add("is-hidden"),i(this,nt)&&i(this,nt).classList.add("is-hidden"),i(this,ot)&&i(this,ot).classList.add("is-hidden"),i(this,K).forEach(d=>{d.classList.remove("active"),d.setAttribute("aria-selected","false"),d.setAttribute("tabindex","-1")}),i(this,$).querySelectorAll("[data-tab-content]").forEach(d=>{d.classList.remove("active"),d.style.display="none"}),t.classList.add("active"),t.setAttribute("aria-selected","true"),t.setAttribute("tabindex","0");const o=t.dataset.tab,n=i(this,$).querySelector(`#${o}`);n&&(n.classList.add("active"),c(this,S,Mt).call(this,n,400)),c(this,S,Ct).call(this,t);let r=n==null?void 0:n.querySelector('[data-fluent-cart-product-variant][data-item-stock="in-stock"]');r||(r=n==null?void 0:n.querySelector("[data-fluent-cart-product-variant]")),r&&r.click()},Mt=function(t,e){t.style.opacity="0",t.style.display="block";const a=performance.now(),o=n=>{const r=n-a,d=Math.min(r/e,1);t.style.opacity=d,d<1&&requestAnimationFrame(o)};requestAnimationFrame(o)},Ct=function(t){const e=i(this,$).querySelector("[data-tab-active-bar]");if(!e)return;const a=t.getBoundingClientRect(),o=t.parentElement.getBoundingClientRect();e.style.left=`${a.left-o.left}px`,e.style.width=`${a.width}px`};/*!
 * Lightbox Modified for fluentcart from v2.11.5 - Vanilla JS Version
 * Author: Lokesh Dhakar
 *
 * More info:
 * http://lokeshdhakar.com/projects/lightbox2/
 *
 * Copyright Lokesh Dhakar
 * Released under the MIT license
 * https://github.com/lokesh/lightbox2/blob/master/LICENSE
 *
 * @preserve
 */const it=class it{constructor(t={},e=[]){this.album=e,this.currentImageIndex=void 0,this.init(),this.options=it.defaults,this.option(t),this.boundSizeOverlay=this.sizeOverlay.bind(this),this.boundKeyboardAction=this.keyboardAction.bind(this)}setAlbum(t=[]){this.album=t,this.currentImageIndex=0}static get defaults(){return{albumLabel:"Image %1 of %2",alwaysShowNavOnTouchDevices:!1,fadeDuration:600,fitImagesInViewport:!0,imageFadeDuration:600,positionFromTop:50,resizeDuration:700,showImageNumberLabel:!0,wrapAround:!1,disableScrolling:!1,sanitizeTitle:!1,maxHeightPercentage:80}}get classList(){return{lightboxOverlay:"fct-lightboxOverlay",lightbox:"fct-lightbox",lbOuterContainer:"lb-outerContainer",lbContainer:"lb-container",lbImage:"lb-image",lbNav:"lb-nav",lbPrev:"lb-prev",lbPrevLink:"lb-prevLink",lbNext:"lb-next",lbNextLink:"lb-nextLink",lbLoader:"lb-loader",lbCancel:"lb-cancel",lbDataContainer:"lb-dataContainer",lbData:"lb-data",lbDetails:"lb-details",lbCaption:"lb-caption",lbNumber:"lb-number",lbNumbers:"lb-numbers",lbCloseContainer:"lb-closeContainer",lbClose:"lb-close",lbDisableScrolling:"lb-disable-scrolling"}}extend(t,e){for(const a in e)e.hasOwnProperty(a)&&(t[a]=e[a])}fadeIn(t,e,a){t.style.opacity=0,t.style.display="flex";let o=null;const n=r=>{o||(o=r);const d=(r-o)/e;t.style.opacity=Math.min(d,1),d<1?requestAnimationFrame(n):a&&a()};requestAnimationFrame(n)}fadeOut(t,e,a){let o=null;const n=r=>{o||(o=r);const d=(r-o)/e;t.style.opacity=Math.max(1-d,0),d<1?requestAnimationFrame(n):(t.style.display="none",a&&a())};requestAnimationFrame(n)}animate(t,e,a,o){const n={},r={};for(const f in e){const E=getComputedStyle(t);n[f]=parseFloat(E[f])||0,r[f]=parseFloat(e[f])}let d=null;const u=f=>{d||(d=f);const E=Math.min((f-d)/a,1),P=.5-Math.cos(E*Math.PI)/2;for(const A in e){const O=n[A]+(r[A]-n[A])*P;t.style[A]=O+"px"}E<1?requestAnimationFrame(u):o&&o()};requestAnimationFrame(u)}option(t){this.extend(this.options,t)}imageCountLabel(t,e){return this.options.albumLabel.replace(/%1/g,t).replace(/%2/g,e)}init(){}shouldBuild(){return it.isBuiltOnce===!1?(it.isBuiltOnce=!0,!0):!1}ensureTemplateExist(){const t=this.classList;if(this.shouldBuild()){const e=`<div id="${t.lightboxOverlay}" tabindex="-1" class="${t.lightboxOverlay}"></div>
                <div id="${t.lightbox}" tabindex="-1" class="${t.lightbox}">
                   <div class="${t.lbOuterContainer}">
                      <div class="${t.lbContainer}">
                         <img class="${t.lbImage}" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt=""/>
                         <div class="${t.lbNav}">
                             <div class="${t.lbCloseContainer}">
                               <a class="${t.lbClose}" role="button" tabindex="0">
                                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"></path></svg>
                                </a>
                            </div>
                            <a class="${t.lbPrev}" role="button" tabindex="0" aria-label="Previous image" href="" ></a>
                            <a class="${t.lbNext}" role="button" tabindex="0" aria-label="Next image" href="" ></a>
                         </div>
                         <div class="${t.lbLoader}">
                            <a class="${t.lbCancel}" role="button" tabindex="0">
                                <span class="lb-spinner"></span>
                            </a>
                         </div>
                      </div>
                   </div>
                   <div class="${t.lbDataContainer}">
                      <div class="${t.lbData}">
                         <div class="${t.lbDetails}">
                            <span class="${t.lbCaption}"></span>
                            <span class="${t.lbNumber}"></span>
                         </div>
                      </div>
                   </div>
                </div>`;document.body.insertAdjacentHTML("beforeend",e)}}build(){this.ensureTemplateExist();const t=this.classList;this.lightbox=document.getElementById(t.lightbox),this.overlay=document.getElementById(t.lightboxOverlay),this.outerContainer=this.lightbox.querySelector(`.${t.lbOuterContainer}`),this.container=this.lightbox.querySelector(`.${t.lbContainer}`),this.image=this.lightbox.querySelector(`.${t.lbImage}`),this.nav=this.lightbox.querySelector(`.${t.lbNav}`);const e=getComputedStyle(this.container);this.containerPadding={top:parseInt(e.paddingTop,10),right:parseInt(e.paddingRight,10),bottom:parseInt(e.paddingBottom,10),left:parseInt(e.paddingLeft,10)};const a=getComputedStyle(this.image);if(this.imageBorderWidth={top:parseInt(a.borderTopWidth,10),right:parseInt(a.borderRightWidth,10),bottom:parseInt(a.borderBottomWidth,10),left:parseInt(a.borderLeftWidth,10)},this._eventsAttached)return;this._eventsAttached=!0,this.overlay.style.display="none",this.overlay.addEventListener("click",()=>{this.end()}),this.lightbox.style.display="none",this.lightbox.addEventListener("click",n=>{n.target.id===t.lightbox&&this.end()}),this.outerContainer.addEventListener("click",n=>{n.target.id===t.lightbox&&this.end()}),this.lightbox.querySelector(`.${t.lbPrev}`).addEventListener("click",n=>{n.preventDefault(),this.currentImageIndex===0?this.changeImage(this.album.length-1):this.changeImage(this.currentImageIndex-1)}),this.lightbox.querySelector(`.${t.lbNext}`).addEventListener("click",n=>{n.preventDefault(),this.currentImageIndex===this.album.length-1?this.changeImage(0):this.changeImage(this.currentImageIndex+1)}),this.nav.addEventListener("mousedown",n=>{if(n.which===3){this.nav.style.pointerEvents="none";const r=()=>{setTimeout(()=>{this.nav.style.pointerEvents="auto"},0),this.lightbox.removeEventListener("contextmenu",r)};this.lightbox.addEventListener("contextmenu",r)}}),this.lightbox.querySelectorAll(`.${t.lbLoader}, .${t.lbClose}`).forEach(n=>{n.addEventListener("click",r=>(this.end(),!1)),n.addEventListener("keyup",r=>{if(r.which===13||r.which===32)return this.end(),!1})})}start(t=0,e=null){this.build(),window.addEventListener("resize",this.boundSizeOverlay),this.sizeOverlay();const a=window.pageYOffset+this.options.positionFromTop,o=window.pageXOffset;this.lightbox.style.top=a+"px",this.lightbox.style.left=o+"px",this.fadeIn(this.lightbox,this.options.fadeDuration),document.body.style.overflow="hidden",this.options.disableScrolling&&document.body.classList.add(this.classList.lbDisableScrolling),this.changeImage(t),typeof e=="function"&&e()}changeImage(t){const e=this.classList,a=this,o=this.album[t].link,n=o.split(".").slice(-1)[0];this.disableKeyboardNav(),this.fadeIn(this.overlay,this.options.fadeDuration);const r=this.lightbox.querySelector(`.${e.lbLoader}`);this.fadeIn(r,500),this.lightbox.querySelectorAll(`.${e.lbImage}, .${e.lbNav}, .${e.lbPrev}, .${e.lbNext}, .${e.lbDataContainer}, .${e.lbNumbers}, .${e.lbCaption}`).forEach(f=>f.style.display="none"),this.outerContainer.classList.add("animating");const u=new Image;u.onload=()=>{setTimeout(()=>{this.onImageLoaded(u,t,a,o,n)},300)},u.src=this.album[t].link,this.currentImageIndex=t}onImageLoaded(t,e,a,o,n){let r,d,u,f,E,P;const A=this.lightbox.querySelector(`.${this.classList.lbImage}`);A.setAttribute("alt",a.album[e].alt),A.setAttribute("src",o),A.style.width=t.width+"px",A.style.height=t.height+"px";const O=t.width/t.height;P=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,E=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;const B=this.options.maxHeightPercentage||80,Z=E*B/100;if(f=P-a.containerPadding.left-a.containerPadding.right-a.imageBorderWidth.left-a.imageBorderWidth.right-20,u=Math.min(Z-a.containerPadding.top-a.containerPadding.bottom-a.imageBorderWidth.top-a.imageBorderWidth.bottom,E-a.containerPadding.top-a.containerPadding.bottom-a.imageBorderWidth.top-a.imageBorderWidth.bottom-a.options.positionFromTop-70),n==="svg"?(O>=1?(d=f,r=parseInt(f/O,10)):(d=parseInt(u/O,10),r=u),r>u&&(r=u,d=parseInt(u*O,10)),A.style.width=d+"px",A.style.height=r+"px"):(a.options.fitImagesInViewport?(a.options.maxWidth&&a.options.maxWidth<f&&(f=a.options.maxWidth),a.options.maxHeight&&a.options.maxHeight<u&&(u=a.options.maxHeight)):(f=a.options.maxWidth||t.width||f,u=a.options.maxHeight||t.height||u),(t.width>f||t.height>u)&&(t.width/f>t.height/u?(d=f,r=parseInt(t.height/(t.width/d),10),r>u&&(r=u,d=parseInt(t.width/(t.height/r),10))):(r=u,d=parseInt(t.width/(t.height/r),10),d>f&&(d=f,r=parseInt(t.height/(t.width/d),10))),A.style.width=d+"px",A.style.height=r+"px")),r+a.containerPadding.top+a.containerPadding.bottom+a.imageBorderWidth.top+a.imageBorderWidth.bottom+a.options.positionFromTop+70>E){const H=E-a.containerPadding.top-a.containerPadding.bottom-a.imageBorderWidth.top-a.imageBorderWidth.bottom-a.options.positionFromTop-70,Y=H/r;r=H,d=Math.floor(d*Y),A.style.width=d+"px",A.style.height=r+"px"}a.sizeContainer(parseInt(A.style.width),parseInt(A.style.height))}sizeOverlay(){setTimeout(()=>{this.overlay.style.width=Math.max(document.body.scrollWidth,document.body.offsetWidth,document.documentElement.clientWidth,document.documentElement.scrollWidth,document.documentElement.offsetWidth)+"px",this.overlay.style.height=window.innerHeight+"px"},0)}sizeContainer(t,e){const a=this.outerContainer.offsetWidth,o=this.outerContainer.offsetHeight,n=t+this.containerPadding.left+this.containerPadding.right+this.imageBorderWidth.left+this.imageBorderWidth.right,r=e+this.containerPadding.top+this.containerPadding.bottom+this.imageBorderWidth.top+this.imageBorderWidth.bottom,d=()=>{this.lightbox.querySelector(`.${this.classList.lbDataContainer}`).style.width=n+"px";const u=this.lightbox.querySelector(`.${this.classList.lbPrevLink}`),f=this.lightbox.querySelector(`.${this.classList.lbNextLink}`);u&&(u.style.height=r+"px"),f&&(f.style.height=r+"px"),this.overlay.focus(),this.showImage()};a!==n||o!==r?this.animate(this.outerContainer,{width:n,height:r},this.options.resizeDuration,d):d()}showImage(){const t=this.lightbox.querySelector(`.${this.classList.lbLoader}`);t.style.display="none",this.fadeIn(this.lightbox.querySelector(`.${this.classList.lbImage}`),this.options.imageFadeDuration),this.updateNav(),this.updateDetails(),this.preloadNeighboringImages(),this.enableKeyboardNav()}updateNav(){let t=!1;try{document.createEvent("TouchEvent"),t=!!this.options.alwaysShowNavOnTouchDevices}catch{}if(this.lightbox.querySelector(`.${this.classList.lbNav}`).style.display="block",this.album.length>1)if(this.options.wrapAround)t&&(this.lightbox.querySelector(`.${this.classList.lbPrev}`).style.opacity="1"),this.lightbox.querySelector(`.${this.classList.lbPrev}`).style.display="block",this.lightbox.querySelector(`.${this.classList.lbNext}`).style.display="block";else{if(this.currentImageIndex>0){const e=this.lightbox.querySelector(`.${this.classList.lbPrev}`);e.style.display="block",t&&(e.style.opacity="1")}if(this.currentImageIndex<this.album.length-1){const e=this.lightbox.querySelector(`.${this.classList.lbNext}`);e.style.display="block",t&&(e.style.opacity="1")}}}updateDetails(){if(typeof this.album[this.currentImageIndex].title<"u"&&this.album[this.currentImageIndex].title!==""){const t=this.lightbox.querySelector(".lb-caption");this.options.sanitizeTitle?t.textContent=this.album[this.currentImageIndex].title:t.innerHTML=this.album[this.currentImageIndex].title,this.fadeIn(t,300)}if(this.album.length>1&&this.options.showImageNumberLabel){const t=this.imageCountLabel(this.currentImageIndex+1,this.album.length),e=this.lightbox.querySelector(`.${this.classList.lbNumber}`);e.textContent=t,this.fadeIn(e,300)}else this.lightbox.querySelector(`.${this.classList.lbNumber}`).style.display="none";this.outerContainer.classList.remove("animating"),this.fadeIn(this.lightbox.querySelector(`.${this.classList.lbDataContainer}`),this.options.resizeDuration,()=>this.sizeOverlay())}preloadNeighboringImages(){if(this.album.length>this.currentImageIndex+1){const t=new Image;t.src=this.album[this.currentImageIndex+1].link}if(this.currentImageIndex>0){const t=new Image;t.src=this.album[this.currentImageIndex-1].link}}enableKeyboardNav(){document.addEventListener("keyup",this.boundKeyboardAction),this.lightbox.addEventListener("keyup",this.boundKeyboardAction),this.overlay.addEventListener("keyup",this.boundKeyboardAction)}disableKeyboardNav(){document.removeEventListener("keyup",this.boundKeyboardAction),this.lightbox.removeEventListener("keyup",this.boundKeyboardAction),this.overlay.removeEventListener("keyup",this.boundKeyboardAction)}keyboardAction(t){const n=t.keyCode;n===27?(t.stopPropagation(),this.end()):n===37?this.currentImageIndex!==0?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1):n===39&&(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0))}end(){this.disableKeyboardNav(),window.removeEventListener("resize",this.boundSizeOverlay),this.fadeOut(this.lightbox,this.options.fadeDuration),this.fadeOut(this.overlay,this.options.fadeDuration),document.body.style.overflow="inherit",this.options.disableScrolling&&document.body.classList.remove(this.classList.lbDisableScrolling),setTimeout(()=>{const t=document.getElementById("lightbox"),e=document.getElementById("lightboxOverlay");t&&t.remove(),e&&e.remove(),this._eventsAttached=!1},this.options.fadeDuration)}};Bt(it,"isBuiltOnce",!1);let kt=it;window.addEventListener("fluent_cart_app_loaded",function(x){document.querySelectorAll("[data-fluent-cart-product-gallery-wrapper]").forEach((t,e)=>{new window.FluentCartImageGallery().init(t)})});window.addEventListener("fluentCartSingleProductModalOpened",function(x){let t=!1;window.fluentcart_single_product_vars.enable_image_zoom_in_modal==="yes"&&(t=!0),document.querySelectorAll("[data-fluent-cart-product-gallery-wrapper]").forEach((e,a)=>{new window.FluentCartImageGallery().init(e,t)})});var D,G,U,C,k,pt,N,_,gt,rt,R,g,Ft,Rt,Kt,St,Gt,_t,Ut,qt,ye,Yt,Vt,Qt,Jt,Zt,Ot,Tt,jt,Xt;class be{constructor(){y(this,g);y(this,D);y(this,G);y(this,U);y(this,C);y(this,k,0);y(this,pt);y(this,N);y(this,_);y(this,gt);y(this,rt,"all");y(this,R,null)}init(t,e=!0){i(this,R)&&i(this,R).abort(),p(this,R,new AbortController),this.container=t,p(this,gt,this.container.getAttribute("data-product-id")),p(this,rt,this.container.getAttribute("data-thumbnail-mode")||"all"),p(this,pt,e),p(this,N,this.findInContainer("[data-fluent-cart-thumb-control-button]")),p(this,_,this.findOneInContainer("[data-fluent-cart-single-product-page-product-thumbnail-controls]")),p(this,D,this.findOneInContainer("[data-fluent-cart-single-product-page-product-thumbnail]")),c(this,g,Ft).call(this),c(this,g,Rt).call(this),c(this,g,Ut).call(this),c(this,g,Kt).call(this),c(this,g,Yt).call(this),c(this,g,Qt).call(this),c(this,g,jt).call(this),c(this,g,Xt).call(this)}updateGalleryByVariation(t=0){if(i(this,rt)==="all"){this.findInContainer("[data-fluent-cart-thumb-control-button]").forEach(n=>n.classList.remove("is-hidden"));return}const e=this.findInContainer(`[data-fluent-cart-thumb-control-button][data-variation-id="${t}"]`);e.length>0&&(this.findInContainer(`[data-fluent-cart-thumb-control-button][data-variation-id]:not([data-variation-id="${t}"])`).forEach(n=>n.classList.add("is-hidden")),e.forEach(n=>n.classList.remove("is-hidden"))),this.findInContainer('[data-fluent-cart-thumb-control-button][data-variation-id="0"]').forEach(o=>o.classList.remove("is-hidden"))}findInContainer(t){return this.container.querySelectorAll(t)}findOneInContainer(t){return this.container.querySelector(t)}}D=new WeakMap,G=new WeakMap,U=new WeakMap,C=new WeakMap,k=new WeakMap,pt=new WeakMap,N=new WeakMap,_=new WeakMap,gt=new WeakMap,rt=new WeakMap,R=new WeakMap,g=new WeakSet,Ft=function(){window.addEventListener("fluentCartSingleProductVariationChanged",t=>{var o;if(t.detail.productId!=i(this,gt))return;p(this,k,t.detail.variationId),this.updateGalleryByVariation(i(this,k));let a=(o=i(this,_))==null?void 0:o.querySelectorAll(`[data-fluent-cart-thumb-control-button][data-variation-id="${i(this,k)}"]`);c(this,g,Vt).call(this,a)})},Rt=function(){var a,o,n,r;const t=(a=i(this,_))==null?void 0:a.querySelectorAll("[data-fluent-cart-thumb-control-button]:not(.is-hidden)"),e=(o=i(this,_))==null?void 0:o.querySelector(".active[data-fluent-cart-thumb-control-button]:not(.is-hidden)");e?p(this,k,e.dataset.variationId):p(this,k,((r=(n=t==null?void 0:t[0])==null?void 0:n.dataset)==null?void 0:r.variationId)||0),this.updateGalleryByVariation(i(this,k))},Kt=function(){i(this,D)&&i(this,D).removeEventListener("click",c(this,g,St).bind(this)),p(this,G,new kt({},[])),i(this,D)&&i(this,D).addEventListener("click",c(this,g,St).bind(this))},St=function(t){const e=i(this,D).parentElement,a=e.style.position,o=!a||a==="",n=document.querySelector("[data-fluent-cart-shop-app-single-product-modal]");n&&window.FluentCartSingleProductModal.closeModal(n),o&&(e.style.position="relative");const r=document.createElement("div");r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.right="0",r.style.bottom="0",r.style.zIndex="99999",document.body.appendChild(r),i(this,U)&&i(this,U).closezoom&&i(this,U).closezoom(),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),o&&(e.style.position="")},1e3);const d=t.target;let u=c(this,g,Gt).call(this);const f=c(this,g,qt).call(this,u,d.getAttribute("src"));f>-1&&(i(this,G).setAlbum(u),i(this,G).start(f,()=>{}))},Gt=function(){if(i(this,rt)==="all")return c(this,g,_t).call(this);{let t=i(this,C)[i(this,k)],e=i(this,C)[0];return t&&e&&(t=[...t,...e]),(!t||t.length===0)&&(t=i(this,C)[0]),t}},_t=function(){const t=[],e=new Set,a=(o,n)=>{const r=String(o);e.has(r)||(e.add(r),Array.isArray(n)&&n.forEach(d=>t.push(d)))};return i(this,k)&&i(this,C)[i(this,k)]&&a(i(this,k),i(this,C)[i(this,k)]),i(this,C)[0]&&a("0",i(this,C)[0]),Object.keys(i(this,C)).forEach(o=>{a(o,i(this,C)[o])}),t.length>0?t:i(this,C)[0]||[]},Ut=function(){window.fluentcart_single_product_vars.enable_image_zoom==="yes"&&i(this,pt)&&i(this,U)==null&&i(this,D)&&(window.onload=function(){},p(this,U,xZoom(i(this,D),{tint:!1,Yoffset:120,zoomWidth:500,zoomHeight:400,position:"inside",lensSize:300})))},qt=function(t,e){return Array.isArray(t)?t.findIndex(a=>a.link===e):-1},ye=function(){return window.matchMedia("(hover: hover) and (pointer: fine)").matches},Yt=function(){var a;const t={},e=(a=i(this,_))==null?void 0:a.getAttribute("data-all-gallery-images");if(e)try{const o=JSON.parse(e);if(o.length>i(this,N).length){o.forEach(n=>{const r=n.variation_id!=null&&n.variation_id!==""?String(n.variation_id):"0";t.hasOwnProperty(r)||(t[r]=[]),t[r].push({alt:n.title||"",link:n.url,title:n.title||""})}),p(this,C,t);return}}catch{}i(this,N).length>0&&i(this,N).forEach((o,n)=>{const r=o.dataset.variationId.toString(),d=o.querySelector("[data-fluent-cart-single-product-page-product-thumbnail-controls-thumb]");d&&(t.hasOwnProperty(r)||(t[r]=[]),c(this,g,qt).call(this,t[r],d.src)===-1&&t[r].push({alt:d.alt,link:d.src,title:d.alt}))}),p(this,C,t)},Vt=function(t){if(i(this,N).forEach(e=>e.classList.remove("active")),t&&t.length>0){const e=t[0];e.click(),e.classList.add("active"),c(this,g,Tt).call(this,e)}},Qt=function(){i(this,N).forEach(t=>{t.addEventListener("click",e=>{c(this,g,Ot).call(this,t)})}),i(this,_)&&i(this,_).addEventListener("keydown",t=>{c(this,g,Zt).call(this,t)})},Jt=function(){var t;return Array.from(((t=i(this,_))==null?void 0:t.querySelectorAll("[data-fluent-cart-thumb-control-button]:not(.is-hidden)"))||[])},Zt=function(t){const e=this.container.classList.contains("thumb-pos-left")||this.container.classList.contains("thumb-pos-right"),a=e?["ArrowDown"]:["ArrowRight"],o=e?["ArrowUp"]:["ArrowLeft"],n=a.includes(t.key)||!e&&t.key==="ArrowDown",r=o.includes(t.key)||!e&&t.key==="ArrowUp";if(!n&&!r)return;t.preventDefault();const d=c(this,g,Jt).call(this);if(d.length===0)return;const u=d.indexOf(document.activeElement);let f;n?f=u<d.length-1?u+1:0:f=u>0?u-1:d.length-1;const E=d[f];E.focus(),c(this,g,Ot).call(this,E)},Ot=function(t){i(this,N).forEach(a=>{a.classList.remove("active"),a.setAttribute("aria-pressed","false"),a.setAttribute("tabindex","-1")}),t.classList.add("active"),t.setAttribute("aria-pressed","true"),t.setAttribute("tabindex","0");const e=t.dataset.variationId;e!==void 0&&p(this,k,e),c(this,g,Tt).call(this,t)},Tt=function(t){const e=this.findOneInContainer("[data-fluent-cart-single-product-page-product-thumbnail]");if(!e)return;let a=t.dataset.url;a===void 0&&(a=e.dataset.defaultImageUrl),e.setAttribute("src",a)},jt=function(){if(!(this.container.getAttribute("data-scrollable-thumbs")==="yes")||!i(this,_)||!(this.container.classList.contains("thumb-pos-left")||this.container.classList.contains("thumb-pos-right")))return;const a=()=>{const n=this.findOneInContainer(".fct-product-gallery-thumb");n&&i(this,_)&&(i(this,_).style.maxHeight=n.offsetHeight+"px")},o=i(this,D);o&&o.tagName==="IMG"&&(o.complete?a():o.addEventListener("load",a,{once:!0,signal:i(this,R).signal})),window.addEventListener("resize",a,{signal:i(this,R).signal})},Xt=function(){const t=this.findOneInContainer("[data-fluent-cart-gallery-see-more]");t&&t.addEventListener("click",()=>{const e=c(this,g,_t).call(this);if(!e||e.length===0)return;const a=this.findInContainer("[data-fluent-cart-thumb-control-button]:not(.is-hidden)").length,o=Math.min(a,e.length-1);i(this,G).setAlbum(e),i(this,G).start(o,()=>{})},{signal:i(this,R).signal})};window.FluentCartImageGallery=be;document.addEventListener("DOMContentLoaded",()=>{var t,e,a,o,n,r,d,u,f,E,P,A,O,B,Z,H,Y,lt,h,te,$t,ve,ee,ie,wt,se,ae,ne,oe,mt,At,re,le,de,Dt,ce,he,ue,Ie,xe,fe,Pt;const bt=class bt{constructor(){y(this,h);y(this,e);y(this,a);y(this,o);y(this,n);y(this,r);y(this,d);y(this,u);y(this,f);y(this,E);y(this,P);y(this,A);y(this,O);y(this,B,0);y(this,Z);y(this,H);y(this,Y);y(this,lt)}toTitleCase(s){return s.replace(/\w\S*/g,function(l){return l.charAt(0).toUpperCase()+l.substr(1).toLowerCase()})}$t(s){return window.fluentcart_single_product_vars.trans[s]||s}findInContainer(s){return i(this,e).querySelectorAll(s)}findOneInContainer(s){return i(this,e).querySelector(s)}init(s,l){return p(this,O,l),p(this,e,s),p(this,a,this.findInContainer("[data-fluent-cart-product-variant]")),p(this,Y,i(this,e).getAttribute("data-product-id")),p(this,r,this.findOneInContainer("[data-fluent-cart-product-qty-increase-button]")),p(this,d,this.findOneInContainer("[data-fluent-cart-product-qty-decrease-button]")),p(this,o,this.findOneInContainer("[data-fluent-cart-single-product-page-product-quantity-input]")),p(this,n,this.findOneInContainer("[data-fluent-cart-product-quantity-container]")),p(this,u,this.findInContainer("[data-fluent-cart-add-to-cart-button]")),p(this,f,this.findInContainer("[data-fluent-cart-direct-checkout-button]")),p(this,E,this.findInContainer("[data-fluent-cart-thumb-control-button]")),p(this,P,this.findOneInContainer("[data-fluent-cart-single-product-page-product-thumbnail-controls]")),p(this,Z,this.findOneInContainer("[data-fluent-cart-product-item-price]")),p(this,H,this.findOneInContainer("[data-fluent-cart-product-payment-type]")),p(this,lt,this.findOneInContainer("[data-fluent-cart-product-pricing-section]")),c(this,h,re).call(this),c(this,h,le).call(this),c(this,h,de).call(this),c(this,h,ce).call(this),c(this,h,ne).call(this),c(this,h,ie).call(this),c(this,h,ee).call(this),c(this,h,$t).call(this),c(this,h,te).call(this),p(bt,t,this),this}updateGalleryByVariation(s=0){const l=document.querySelectorAll(`[data-fluent-cart-thumb-control-button][data-variation-id="${s}"]`);l.length>0?(document.querySelectorAll(`[data-fluent-cart-thumb-control-button][data-variation-id]:not([data-variation-id="${s}"])`).forEach(v=>v.classList.add("is-hidden")),l.forEach(v=>v.classList.remove("is-hidden"))):document.querySelectorAll('[data-fluent-cart-thumb-control-button][data-variation-id="0"]').forEach(v=>v.classList.remove("is-hidden"))}};t=new WeakMap,e=new WeakMap,a=new WeakMap,o=new WeakMap,n=new WeakMap,r=new WeakMap,d=new WeakMap,u=new WeakMap,f=new WeakMap,E=new WeakMap,P=new WeakMap,A=new WeakMap,O=new WeakMap,B=new WeakMap,Z=new WeakMap,H=new WeakMap,Y=new WeakMap,lt=new WeakMap,h=new WeakSet,te=function(){window.addEventListener("resize",s=>{c(this,h,$t).call(this)})},$t=function(){const s=document.querySelector(".fluent-cart-single-product-page");s&&(s.offsetWidth<=815?s.classList.add("is-mobile"):s.classList.remove("is-mobile"))},ve=function(s,l){return Array.isArray(s)?s.findIndex(I=>I.link===l):-1},ee=function(){this.findOneInContainer("[data-fluent-cart-product-tab]")&&(p(this,A,new ge(i(this,e))),i(this,A).init())},ie=function(){var M,X,ct,V,ht,ut,ft,m,T,F,tt,Q,vt,It,et;const s=this.findOneInContainer(".selected[data-fluent-cart-product-variant]"),l=s==null?void 0:s.dataset.cartId;s==null||s.dataset.itemPrice,s==null||s.dataset.subscriptionTerms;const I=s==null?void 0:s.dataset.paymentType;let v=(M=window.fluentcart_single_product_vars)==null?void 0:M.in_stock_status,w=s==null?void 0:s.dataset.stockManagement,b=v;w==="yes"&&(b=s==null?void 0:s.dataset.itemStock);const L=(X=i(this,f)[0])==null?void 0:X.dataset.stockAvailability;if(L===((ct=window.fluentcart_single_product_vars)==null?void 0:ct.out_of_stock_status)&&(b=L),l!==void 0&&(i(this,u).forEach(W=>{W.setAttribute("data-cart-id",l)}),c(this,h,wt).call(this,l,b)),l===void 0&&i(this,a).length===0){const W=(V=i(this,f)[0])==null?void 0:V.dataset.cartId,J=(ht=i(this,f)[0])==null?void 0:ht.dataset.stockAvailability;c(this,h,wt).call(this,W,J)}const q=(ut=i(this,P))==null?void 0:ut.querySelectorAll("[data-fluent-cart-thumb-control-button]:not(.is-hidden)"),j=(ft=i(this,lt))==null?void 0:ft.querySelector("[data-fluent-cart-product-variant].selected");j?p(this,B,((m=j==null?void 0:j.dataset)==null?void 0:m.cartId)||0):p(this,B,((T=q==null?void 0:q.dataset)==null?void 0:T.variationId)||0),c(this,h,oe).call(this,q);const z=new URL(window.location.href).searchParams;if(z.has("selected")){const W=z.get("selected"),J=this.findOneInContainer(`[data-fluent-cart-product-variant][data-cart-id="${W}"]`);J&&c(this,h,mt).call(this,J)}c(this,h,ue).call(this),c(this,h,he).call(this);const dt=((F=i(this,a)[0])==null?void 0:F.dataset.paymentType)||((tt=i(this,n))==null?void 0:tt.dataset.paymentType),yt=((Q=i(this,f)[0])==null?void 0:Q.dataset.variationType)||((vt=i(this,n))==null?void 0:vt.dataset.variationType);dt==="subscription"&&yt==="simple"&&((It=i(this,H))==null||It.classList.remove("is-hidden")),I==="subscription"&&((et=i(this,H))==null||et.classList.remove("is-hidden")),(s==null?void 0:s.dataset.cartId)===(s==null?void 0:s.dataset.defaultVariationId)&&i(this,E).forEach(W=>{W.classList.remove("is-hidden")}),c(this,h,At).call(this,b)},wt=function(s,l){var v;const I=(((v=window.fluentcart_single_product_vars)==null?void 0:v.out_of_stock_status)||"").toString();i(this,f).forEach(w=>{if(l!==I){const b=w.dataset.quantity;let L=w.getAttribute("data-url")+s+"&quantity="+b;w.setAttribute("href",L),w.setAttribute("data-cart-id",s),w.classList.remove("is-hidden")}else w.removeAttribute("href"),w.classList.add("is-hidden")})},se=function(s){i(this,f).forEach(l=>{l.setAttribute("data-quantity",s);const I=l.getAttribute("data-cart-id");if(I){let v=l.getAttribute("data-url")+I+"&quantity="+s;l.setAttribute("href",v)}})},ae=function(s){i(this,u).forEach(l=>{l.setAttribute("data-quantity",s)})},ne=function(){i(this,a).forEach(s=>{s.addEventListener("click",l=>{c(this,h,mt).call(this,s)}),s.addEventListener("keydown",l=>{const I=s.closest('[role="radiogroup"]');if(!I)return;const v=Array.from(I.querySelectorAll('[role="radio"]')),w=v.indexOf(s);let b=-1;switch(l.key){case"Enter":case" ":l.preventDefault(),c(this,h,mt).call(this,s);return;case"ArrowDown":case"ArrowRight":l.preventDefault(),b=(w+1)%v.length;break;case"ArrowUp":case"ArrowLeft":l.preventDefault(),b=(w-1+v.length)%v.length;break;case"Home":l.preventDefault(),b=0;break;case"End":l.preventDefault(),b=v.length-1;break;default:return}b>=0&&(v[b].focus(),c(this,h,mt).call(this,v[b]))})})},oe=function(s){if(s&&s.length>0){const l=s[0];l.classList.add("active"),c(this,h,Pt).call(this,l)}},mt=function(s){var ut,ft;i(this,a).forEach(m=>{m.classList.remove("selected"),m.setAttribute("aria-checked","false"),m.setAttribute("tabindex","-1")}),s.setAttribute("aria-checked","true"),s.setAttribute("tabindex","0"),c(this,h,Dt).call(this);const l=s.dataset.cartId,I=s.closest("[data-fluent-cart-product-pricing-section]");I.querySelectorAll("[data-fluent-cart-product-payment-type]"),I.querySelectorAll("[data-fluent-cart-product-item-price]");const v=I.querySelectorAll(".fluent-cart-product-variation-content[data-variation-id]");v&&v.forEach(m=>m.classList.add("is-hidden"));const w=I.querySelectorAll(`.fluent-cart-product-variation-content[data-variation-id="${l}"]`);w&&w.forEach(m=>m.classList.remove("is-hidden")),p(this,B,l);let b=(ut=window.fluentcart_single_product_vars)==null?void 0:ut.in_stock_status,L=s==null?void 0:s.dataset.stockManagement,q=b;L==="yes"&&(q=s==null?void 0:s.dataset.itemStock),l!==void 0&&(i(this,E).forEach(m=>m.classList.remove("active")),i(this,u).forEach(m=>{m.setAttribute("data-cart-id",l)}),c(this,h,wt).call(this,l,q),s.dataset.paymentType!=="subscription"&&i(this,u).forEach(m=>{m.classList.remove("is-hidden"),m.setAttribute("data-cart-id",l)})),q!==void 0&&c(this,h,At).call(this,q);const j=window.fluentcart_single_product_vars.out_of_stock_status;s.dataset.paymentType==="subscription"&&q!==j&&i(this,u).forEach(m=>m.classList.add("is-hidden"));const Et=s.dataset.sku||"",z=i(this,e).closest(".fct-product-summary")||i(this,e).closest(".product-info-block-wrapper")||i(this,e).parentElement,dt=z==null?void 0:z.querySelector("[data-fluent-cart-product-sku]");if(dt){dt.textContent=Et;const m=dt.closest(".fct-product-sku");m&&(m.style.display=Et?"":"none")}const yt=s.dataset.packageInfo||"",M=z==null?void 0:z.querySelector("[data-fluent-cart-package-description]");if(M)if(yt)try{const m=JSON.parse(yt),T=((ft=window.fluentcart_single_product_vars)==null?void 0:ft.trans)||{},F=document.createElement("table");F.className="fct-package-description__table",F.setAttribute("role","presentation");const tt=document.createElement("tbody"),Q=(vt,It)=>{const et=document.createElement("tr"),W=document.createElement("th"),J=document.createElement("td");W.textContent=vt,J.textContent=It,et.appendChild(W),et.appendChild(J),tt.appendChild(et)};m.name&&Q(T.Package||"Package",m.name),m.dimensions&&Q(T.Dimensions||"Dimensions",m.dimensions),m.product_weight&&Q(T.Weight||"Weight",m.product_weight),m.shipping_weight&&Q(T["Shipping Weight"]||"Shipping Weight",m.shipping_weight),tt.childElementCount?(F.appendChild(tt),M.replaceChildren(F),M.style.display=""):M.style.display="none"}catch{M.style.display="none"}else M.style.display="none";s.classList.add("selected");const X=s.getAttribute("aria-label")||"";X&&(i(this,f).forEach(m=>{const T=m.textContent.trim();m.setAttribute("aria-label",T+" - "+X)}),i(this,u).forEach(m=>{const T=m.querySelector(".text"),F=T?T.textContent.trim():m.textContent.trim();m.setAttribute("aria-label",F+" - "+X)}));const ct=this.findInContainer("[data-fluent-cart-single-product-page-product-variant-price-info]");ct&&ct.forEach(m=>m.classList.remove("selected"));const V=this.findOneInContainer(`[data-fluent-cart-single-product-page-product-variant-price-info][data-cart-id="${l}"]`);V&&(V==null||V.classList.add("selected"));const ht=this.findInContainer(`[data-fluent-cart-single-product-page-product-quantity][data-cart-id="${l}"]`);ht&&ht.forEach(m=>m.classList.add("selected")),window.dispatchEvent(new CustomEvent("fluentCartSingleProductVariationChanged",{detail:{productId:i(this,Y),variationId:l}}))},At=function(s){if(!s)return;const l=window.fluentcart_single_product_vars.out_of_stock_status,I=s===l,v=i(this,e).closest(".fct-product-summary")||i(this,e).closest(".product-info-block-wrapper")||i(this,e).parentElement,w=v==null?void 0:v.querySelector("[data-fluent-cart-product-stock]");if(w){w.innerHTML=this.$t(this.toTitleCase(s.replaceAll("-"," "))),w.className=w.className.replace(/fct_status_badge_[\w-]+/g,""),w.classList.add("fct_status_badge_"+s);const b=w.closest(".fct-product-stock");b&&(b.classList.remove("in-stock","out-of-stock"),b.classList.add(s))}I?(i(this,u).forEach(b=>{const L=b.querySelector(".text");L&&(L.textContent=window.fluentcart_single_product_vars.out_of_stock_button_text),b.setAttribute("disabled","disabled"),b.classList.add("out-of-stock"),b.classList.remove("is-hidden")}),i(this,f).forEach(b=>{b.classList.add("is-hidden"),b.removeAttribute("href")})):(i(this,u).forEach(b=>{const L=b.querySelector(".text");L&&(L.textContent=window.fluentcart_single_product_vars.cart_button_text),b.classList.remove("out-of-stock"),b.removeAttribute("disabled")}),i(this,f).forEach(b=>{b.classList.remove("is-hidden")}))},re=function(){i(this,r)&&i(this,r).addEventListener("click",async s=>{s.preventDefault();const l=document.querySelector(`[data-fluent-cart-product-variant][data-cart-id="${i(this,B)}"]`),I=l==null?void 0:l.dataset.availableStock;let v=parseInt(i(this,o).value,10)||1,w=i(this,o).getAttribute("max"),b=w?parseInt(w,10):1e4;if(v>=b){window.Toastify&&new Toastify({text:`You can only purchase a maximum of ${b} item${b>1?"s":""}.`,className:"warning",duration:3e3,gravity:"top",position:"right",slideFrom:"right",type:"warning"}).showToast();return}if(v++,I!=="unlimited"&&v>parseInt(I)){window.Toastify&&new Toastify({text:"You have reached the maximum quantity.",className:"warning",duration:3e3,gravity:"top",position:"right",slideFrom:"right",type:"warning"}).showToast();return}i(this,o).value=v,i(this,o).dispatchEvent(new Event("input"))})},le=function(){i(this,d)&&i(this,d).addEventListener("click",s=>{s.preventDefault();let l=parseInt(i(this,o).value,10)||1;l>1&&l--,i(this,o).value=l,i(this,o).dispatchEvent(new Event("input"))})},de=function(){i(this,o)&&i(this,o).addEventListener("input",()=>{let s=parseInt(i(this,o).value,10);isNaN(s)||s<1?s=1:s>1e4&&(s=1e4),i(this,o).value=s,c(this,h,se).call(this,s),c(this,h,ae).call(this,s)})},Dt=function(){i(this,o)&&(i(this,o).value=1,i(this,o).dispatchEvent(new Event("input")))},ce=function(){const s="single_product_page_cart_updated_"+i(this,O);i(this,u).forEach(l=>{l.setAttribute("data-action-name",s),l.setAttribute("data-error-action-name",s)}),document.addEventListener(s,()=>{c(this,h,Dt).call(this)})},he=function(){var l;((l=i(this,a)[0])==null?void 0:l.dataset.paymentType)==="subscription"&&i(this,u).forEach(I=>{I.setAttribute("data-cart-id","")})},ue=function(){var w,b,L,q;let s=(w=window.fluentcart_single_product_vars)==null?void 0:w.in_stock_status,l=(b=i(this,a)[0])==null?void 0:b.dataset.stockManagement,I=s;l==="yes"&&(I=(L=i(this,a)[0])==null?void 0:L.dataset.itemStock);const v=(q=i(this,f)[0])==null?void 0:q.dataset.stockAvailability;v===window.fluentcart_single_product_vars.out_of_stock_status&&(I=v),I===window.fluentcart_single_product_vars.out_of_stock_status&&c(this,h,At).call(this,I)},Ie=function(){i(this,u).forEach(s=>{s.setAttribute("data-cart-id","")})},xe=function(){i(this,E).forEach(s=>{s.addEventListener("click",l=>{c(this,h,fe).call(this,s)})})},fe=function(s){i(this,E).forEach(l=>{l.classList.remove("active"),l.setAttribute("aria-pressed","false")}),s.classList.add("active"),s.setAttribute("aria-pressed","true"),c(this,h,Pt).call(this,s)},Pt=function(s){const l=this.findOneInContainer("[data-fluent-cart-single-product-page-product-thumbnail]");if(!l)return;let I=s.dataset.url;I===void 0&&(I=l.dataset.defaultImageUrl),l.setAttribute("src",I)},y(bt,t,null);let x=bt;document.querySelectorAll("[data-fluent-cart-product-pricing-section]").forEach((Wt,s)=>{new x().init(Wt,s)}),window.addEventListener("fluentCartSingleProductModalOpened",function(Wt){document.querySelectorAll("[data-fluent-cart-product-pricing-section]").forEach((s,l)=>{})}),window.FluentCartSingleProduct=x});
