var oe=Object.defineProperty;var _t=b=>{throw TypeError(b)};var re=(b,t,e)=>t in b?oe(b,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):b[t]=e;var Ot=(b,t,e)=>re(b,typeof t!="symbol"?t+"":t,e),rt=(b,t,e)=>t.has(b)||_t("Cannot "+e);var i=(b,t,e)=>(rt(b,t,"read from private field"),e?e.call(b):t.get(b)),p=(b,t,e)=>t.has(b)?_t("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(b):t.set(b,e),f=(b,t,e,s)=>(rt(b,t,"write to private field"),s?s.call(b,e):t.set(b,e),e),h=(b,t,e)=>(rt(b,t,"access private method"),e);var H,S,G,Y,U,Q,q,Tt,$t,Pt,Wt,lt;class le{constructor(t){p(this,q);p(this,H);p(this,S);p(this,G);p(this,Y);p(this,U);p(this,Q);f(this,S,t),console.log(i(this,S)),f(this,H,i(this,S).querySelectorAll("[data-tab]")),f(this,G,i(this,S).querySelector("[data-fluent-cart-product-item-price]")),f(this,Y,i(this,S).querySelector("[data-fluent-cart-product-payment-type]")),f(this,U,i(this,S).querySelector("[data-fluent-cart-product-quantity-container]")),f(this,Q,i(this,S).querySelector("[data-fluent-cart-add-to-cart-button]"))}init(){h(this,q,Tt).call(this),h(this,q,$t).call(this)}handleVariationChange(t){t.closest("[data-tab-content]")}}H=new WeakMap,S=new WeakMap,G=new WeakMap,Y=new WeakMap,U=new WeakMap,Q=new WeakMap,q=new WeakSet,Tt=function(){i(this,H).forEach(t=>{t.addEventListener("click",()=>{h(this,q,Pt).call(this,t)})})},$t=function(){const t=Array.from(i(this,H)).find(e=>e.classList.contains("active"));t&&h(this,q,lt).call(this,t)},Pt=function(t,e=!1){i(this,G)&&i(this,G).classList.add("is-hidden"),i(this,Y)&&i(this,Y).classList.add("is-hidden"),i(this,U)&&i(this,U).classList.add("is-hidden"),i(this,Q)&&i(this,Q).classList.add("is-hidden"),i(this,H).forEach(c=>c.classList.remove("active")),i(this,S).querySelectorAll("[data-tab-content]").forEach(c=>{c.classList.remove("active"),c.style.display="none"}),t.classList.add("active");const o=t.dataset.tab,n=i(this,S).querySelector(`#${o}`);n&&(n.classList.add("active"),h(this,q,Wt).call(this,n,400)),h(this,q,lt).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()},Wt=function(t,e){t.style.opacity="0",t.style.display="block";const s=performance.now(),o=n=>{const r=n-s,c=Math.min(r/e,1);t.style.opacity=c,c<1&&requestAnimationFrame(o)};requestAnimationFrame(o)},lt=function(t){const e=i(this,S).querySelector("[data-tab-active-bar]");if(!e)return;const s=t.getBoundingClientRect(),o=t.parentElement.getBoundingClientRect();e.style.left=`${s.left-o.left}px`,e.style.width=`${s.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 K=class K{constructor(t={},e=[]){this.album=e,this.currentImageIndex=void 0,this.init(),this.options=K.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 s in e)e.hasOwnProperty(s)&&(t[s]=e[s])}fadeIn(t,e,s){t.style.opacity=0,t.style.display="flex";let o=null;const n=r=>{o||(o=r);const c=(r-o)/e;t.style.opacity=Math.min(c,1),c<1?requestAnimationFrame(n):s&&s()};requestAnimationFrame(n)}fadeOut(t,e,s){let o=null;const n=r=>{o||(o=r);const c=(r-o)/e;t.style.opacity=Math.max(1-c,0),c<1?requestAnimationFrame(n):(t.style.display="none",s&&s())};requestAnimationFrame(n)}animate(t,e,s,o){const n={},r={};for(const m in e){const L=getComputedStyle(t);n[m]=parseFloat(L[m])||0,r[m]=parseFloat(e[m])}let c=null;const u=m=>{c||(c=m);const L=Math.min((m-c)/s,1),O=.5-Math.cos(L*Math.PI)/2;for(const I in e){const k=n[I]+(r[I]-n[I])*O;t.style[I]=k+"px"}L<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 K.isBuiltOnce===!1?(K.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 s=getComputedStyle(this.image);this.imageBorderWidth={top:parseInt(s.borderTopWidth,10),right:parseInt(s.borderRightWidth,10),bottom:parseInt(s.borderBottomWidth,10),left:parseInt(s.borderLeftWidth,10)},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 s=window.pageYOffset+this.options.positionFromTop,o=window.pageXOffset;this.lightbox.style.top=s+"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,s=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(m=>m.style.display="none"),this.outerContainer.classList.add("animating");const u=new Image;u.onload=()=>{setTimeout(()=>{this.onImageLoaded(u,t,s,o,n)},300)},u.src=this.album[t].link,this.currentImageIndex=t}onImageLoaded(t,e,s,o,n){let r,c,u,m,L,O;const I=this.lightbox.querySelector(`.${this.classList.lbImage}`);I.setAttribute("alt",s.album[e].alt),I.setAttribute("src",o),I.style.width=t.width+"px",I.style.height=t.height+"px";const k=t.width/t.height;O=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,L=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;const T=this.options.maxHeightPercentage||80,R=L*T/100;if(m=O-s.containerPadding.left-s.containerPadding.right-s.imageBorderWidth.left-s.imageBorderWidth.right-20,u=Math.min(R-s.containerPadding.top-s.containerPadding.bottom-s.imageBorderWidth.top-s.imageBorderWidth.bottom,L-s.containerPadding.top-s.containerPadding.bottom-s.imageBorderWidth.top-s.imageBorderWidth.bottom-s.options.positionFromTop-70),n==="svg"?(k>=1?(c=m,r=parseInt(m/k,10)):(c=parseInt(u/k,10),r=u),r>u&&(r=u,c=parseInt(u*k,10)),I.style.width=c+"px",I.style.height=r+"px"):(s.options.fitImagesInViewport?(s.options.maxWidth&&s.options.maxWidth<m&&(m=s.options.maxWidth),s.options.maxHeight&&s.options.maxHeight<u&&(u=s.options.maxHeight)):(m=s.options.maxWidth||t.width||m,u=s.options.maxHeight||t.height||u),(t.width>m||t.height>u)&&(t.width/m>t.height/u?(c=m,r=parseInt(t.height/(t.width/c),10),r>u&&(r=u,c=parseInt(t.width/(t.height/r),10))):(r=u,c=parseInt(t.width/(t.height/r),10),c>m&&(c=m,r=parseInt(t.height/(t.width/c),10))),I.style.width=c+"px",I.style.height=r+"px")),r+s.containerPadding.top+s.containerPadding.bottom+s.imageBorderWidth.top+s.imageBorderWidth.bottom+s.options.positionFromTop+70>L){const $=L-s.containerPadding.top-s.containerPadding.bottom-s.imageBorderWidth.top-s.imageBorderWidth.bottom-s.options.positionFromTop-70,N=$/r;r=$,c=Math.floor(c*N),I.style.width=c+"px",I.style.height=r+"px"}s.sizeContainer(parseInt(I.style.width),parseInt(I.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 s=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,c=()=>{this.lightbox.querySelector(`.${this.classList.lbDataContainer}`).style.width=n+"px";const u=this.lightbox.querySelector(`.${this.classList.lbPrevLink}`),m=this.lightbox.querySelector(`.${this.classList.lbNextLink}`);u&&(u.style.height=r+"px"),m&&(m.style.height=r+"px"),this.overlay.focus(),this.showImage()};s!==n||o!==r?this.animate(this.outerContainer,{width:n,height:r},this.options.resizeDuration,c):c()}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.options.fadeDuration)}};Ot(K,"isBuiltOnce",!1);let dt=K;window.addEventListener("fluent_cart_app_loaded",function(b){document.querySelectorAll("[data-fluent-cart-product-gallery-wrapper]").forEach((t,e)=>{new window.FluentCartImageGallery().init(t)})});window.addEventListener("fluentCartSingleProductModalOpened",function(b){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,s)=>{new window.FluentCartImageGallery().init(e,t)})});var _,V,D,A,E,X,W,M,J,Z,y,Bt,Dt,Nt,ht,zt,Ft,Ht,ct,he,Mt,Rt,Kt,Gt,ut;class de{constructor(){p(this,y);p(this,_);p(this,V);p(this,D);p(this,A);p(this,E,0);p(this,X);p(this,W);p(this,M);p(this,J);p(this,Z,"all")}init(t,e=!0){this.container=t,f(this,J,this.container.getAttribute("data-product-id")),f(this,Z,this.container.getAttribute("data-thumbnail-mode")||"all"),f(this,X,e),f(this,W,this.findInContainer("[data-fluent-cart-thumb-control-button]")),f(this,M,this.findOneInContainer("[data-fluent-cart-single-product-page-product-thumbnail-controls]")),f(this,_,this.findOneInContainer("[data-fluent-cart-single-product-page-product-thumbnail]")),h(this,y,Bt).call(this),h(this,y,Dt).call(this),h(this,y,Ht).call(this),h(this,y,Nt).call(this),h(this,y,Mt).call(this),h(this,y,Kt).call(this)}updateGalleryByVariation(t=0){if(i(this,Z)==="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)}}_=new WeakMap,V=new WeakMap,D=new WeakMap,A=new WeakMap,E=new WeakMap,X=new WeakMap,W=new WeakMap,M=new WeakMap,J=new WeakMap,Z=new WeakMap,y=new WeakSet,Bt=function(){window.addEventListener("fluentCartSingleProductVariationChanged",t=>{var o;if(t.detail.productId!=i(this,J))return;f(this,E,t.detail.variationId),this.updateGalleryByVariation(i(this,E));let s=(o=i(this,M))==null?void 0:o.querySelectorAll(`[data-fluent-cart-thumb-control-button][data-variation-id="${i(this,E)}"]`);h(this,y,Rt).call(this,s)})},Dt=function(){var s,o,n,r;const t=(s=i(this,M))==null?void 0:s.querySelectorAll("[data-fluent-cart-thumb-control-button]:not(.is-hidden)"),e=(o=i(this,M))==null?void 0:o.querySelector(".active[data-fluent-cart-thumb-control-button]:not(.is-hidden)");e?f(this,E,e.dataset.variationId):f(this,E,((r=(n=t==null?void 0:t[0])==null?void 0:n.dataset)==null?void 0:r.variationId)||0),this.updateGalleryByVariation(i(this,E))},Nt=function(){i(this,_)&&i(this,_).removeEventListener("click",h(this,y,ht).bind(this)),f(this,V,new dt({},[])),i(this,_)&&i(this,_).addEventListener("click",h(this,y,ht).bind(this))},ht=function(t){const e=i(this,_).parentElement,s=e.style.position,o=!s||s==="",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,D)&&i(this,D).closezoom&&i(this,D).closezoom(),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),o&&(e.style.position="")},1e3);const c=t.target;let u=h(this,y,zt).call(this);const m=h(this,y,ct).call(this,u,c.getAttribute("src"));m>-1&&(i(this,V).setAlbum(u),i(this,V).start(m,()=>{}))},zt=function(){if(i(this,Z)==="all")return h(this,y,Ft).call(this);{let t=i(this,A)[i(this,E)],e=i(this,A)[0];return t&&e&&(t=[...t,...e]),(!t||t.length===0)&&(t=i(this,A)[0]),t}},Ft=function(){const t=[],e=new Set,s=o=>{Array.isArray(o)&&o.forEach(n=>{e.has(n.link)||(t.push(n),e.add(n.link))})};return i(this,E)&&i(this,A)[i(this,E)]&&s(i(this,A)[i(this,E)]),i(this,A)[0]&&s(i(this,A)[0]),Object.keys(i(this,A)).forEach(o=>{o!=i(this,E)&&o!=0&&s(i(this,A)[o])}),t.length>0?t:i(this,A)[0]||[]},Ht=function(){window.fluentcart_single_product_vars.enable_image_zoom==="yes"&&i(this,X)&&i(this,D)==null&&i(this,_)&&(window.onload=function(){},f(this,D,xZoom(i(this,_),{tint:!1,Yoffset:120,zoomWidth:500,zoomHeight:400,position:"inside",lensSize:300})))},ct=function(t,e){return Array.isArray(t)?t.findIndex(s=>s.link===e):-1},he=function(){return window.matchMedia("(hover: hover) and (pointer: fine)").matches},Mt=function(){const t={};i(this,W).length>0&&i(this,W).forEach((e,s)=>{const o=e.dataset.variationId.toString(),n=e.querySelector("[data-fluent-cart-single-product-page-product-thumbnail-controls-thumb]");n&&(t.hasOwnProperty(o)||(t[o]=[]),h(this,y,ct).call(this,t[o],n.src)===-1&&t[o].push({alt:n.alt,link:n.src,title:n.alt}))}),f(this,A,t)},Rt=function(t){if(i(this,W).forEach(e=>e.classList.remove("active")),t&&t.length>0){const e=t[0];e.click(),e.classList.add("active"),h(this,y,ut).call(this,e)}},Kt=function(){i(this,W).forEach(t=>{t.addEventListener("click",e=>{h(this,y,Gt).call(this,t)})})},Gt=function(t){i(this,W).forEach(s=>s.classList.remove("active")),t.classList.add("active");const e=t.dataset.variationId;e!==void 0&&f(this,E,e),h(this,y,ut).call(this,t)},ut=function(t){const e=this.findOneInContainer("[data-fluent-cart-single-product-page-product-thumbnail]");if(!e)return;let s=t.dataset.url;s===void 0&&(s=e.dataset.defaultImageUrl),e.setAttribute("src",s)};window.FluentCartImageGallery=de;document.addEventListener("DOMContentLoaded",()=>{var t,e,s,o,n,r,c,u,m,L,O,I,k,T,R,$,N,j,d,Yt,mt,ce,Ut,Qt,st,Vt,Zt,jt,Xt,gt,nt,Jt,te,ee,ft,ie,ae,se,ue,me,ne,pt;const tt=class tt{constructor(){p(this,d);p(this,e);p(this,s);p(this,o);p(this,n);p(this,r);p(this,c);p(this,u);p(this,m);p(this,L);p(this,O);p(this,I);p(this,k);p(this,T,0);p(this,R);p(this,$);p(this,N);p(this,j)}toTitleCase(a){return a.replace(/\w\S*/g,function(l){return l.charAt(0).toUpperCase()+l.substr(1).toLowerCase()})}$t(a){return window.fluentcart_single_product_vars.trans[a]||a}findInContainer(a){return i(this,e).querySelectorAll(a)}findOneInContainer(a){return i(this,e).querySelector(a)}init(a,l){return f(this,k,l),f(this,e,a),f(this,s,this.findInContainer("[data-fluent-cart-product-variant]")),f(this,N,i(this,e).getAttribute("data-product-id")),f(this,r,this.findOneInContainer("[data-fluent-cart-product-qty-increase-button]")),f(this,c,this.findOneInContainer("[data-fluent-cart-product-qty-decrease-button]")),f(this,o,this.findOneInContainer("[data-fluent-cart-single-product-page-product-quantity-input]")),f(this,n,this.findOneInContainer("[data-fluent-cart-product-quantity-container]")),f(this,u,this.findInContainer("[data-fluent-cart-add-to-cart-button]")),f(this,m,this.findInContainer("[data-fluent-cart-direct-checkout-button]")),f(this,L,this.findInContainer("[data-fluent-cart-thumb-control-button]")),f(this,O,this.findOneInContainer("[data-fluent-cart-single-product-page-product-thumbnail-controls]")),f(this,R,this.findOneInContainer("[data-fluent-cart-product-item-price]")),f(this,$,this.findOneInContainer("[data-fluent-cart-product-payment-type]")),f(this,j,this.findOneInContainer("[data-fluent-cart-product-pricing-section]")),h(this,d,Jt).call(this),h(this,d,te).call(this),h(this,d,ee).call(this),h(this,d,ie).call(this),h(this,d,jt).call(this),h(this,d,Qt).call(this),h(this,d,Ut).call(this),h(this,d,mt).call(this),h(this,d,Yt).call(this),f(tt,t,this),this}updateGalleryByVariation(a=0){const l=document.querySelectorAll(`[data-fluent-cart-thumb-control-button][data-variation-id="${a}"]`);l.length>0?(document.querySelectorAll(`[data-fluent-cart-thumb-control-button][data-variation-id]:not([data-variation-id="${a}"])`).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,s=new WeakMap,o=new WeakMap,n=new WeakMap,r=new WeakMap,c=new WeakMap,u=new WeakMap,m=new WeakMap,L=new WeakMap,O=new WeakMap,I=new WeakMap,k=new WeakMap,T=new WeakMap,R=new WeakMap,$=new WeakMap,N=new WeakMap,j=new WeakMap,d=new WeakSet,Yt=function(){window.addEventListener("resize",a=>{h(this,d,mt).call(this)})},mt=function(){const a=document.querySelector(".fluent-cart-single-product-page");a&&(a.offsetWidth<=815?a.classList.add("is-mobile"):a.classList.remove("is-mobile"))},ce=function(a,l){return Array.isArray(a)?a.findIndex(g=>g.link===l):-1},Ut=function(){this.findOneInContainer("[data-fluent-cart-product-tab]")&&(f(this,I,new le(i(this,e))),i(this,I).init())},Qt=function(){var w,yt,vt,It,xt,wt,Lt,Et,Ct,At,St,qt,kt;const a=this.findOneInContainer(".selected[data-fluent-cart-product-variant]"),l=a==null?void 0:a.dataset.cartId;a==null||a.dataset.itemPrice,a==null||a.dataset.subscriptionTerms;const g=a==null?void 0:a.dataset.paymentType;let v=(w=window.fluentcart_single_product_vars)==null?void 0:w.in_stock_status,x=a==null?void 0:a.dataset.stockManagement,C=v;if(x==="yes"&&(C=a==null?void 0:a.dataset.itemStock),l!==void 0&&(i(this,u).forEach(F=>{F.setAttribute("data-cart-id",l)}),h(this,d,st).call(this,l,C)),l===void 0&&i(this,s).length===0){const F=(yt=i(this,m)[0])==null?void 0:yt.dataset.cartId,at=(vt=i(this,m)[0])==null?void 0:vt.dataset.stockAvailability;h(this,d,st).call(this,F,at)}const B=(It=i(this,O))==null?void 0:It.querySelectorAll("[data-fluent-cart-thumb-control-button]:not(.is-hidden)"),P=(xt=i(this,j))==null?void 0:xt.querySelector("[data-fluent-cart-product-variant].selected");P?f(this,T,((wt=P==null?void 0:P.dataset)==null?void 0:wt.cartId)||0):f(this,T,((Lt=B==null?void 0:B.dataset)==null?void 0:Lt.variationId)||0),h(this,d,Xt).call(this,B);const z=new URL(window.location.href).searchParams;if(z.has("selected")){const F=z.get("selected"),at=this.findOneInContainer(`[data-fluent-cart-product-variant][data-cart-id="${F}"]`);at&&h(this,d,gt).call(this,at)}h(this,d,se).call(this),h(this,d,ae).call(this);const et=((Et=i(this,s)[0])==null?void 0:Et.dataset.paymentType)||((Ct=i(this,n))==null?void 0:Ct.dataset.paymentType),it=((At=i(this,m)[0])==null?void 0:At.dataset.variationType)||((St=i(this,n))==null?void 0:St.dataset.variationType);et==="subscription"&&it==="simple"&&((qt=i(this,$))==null||qt.classList.remove("is-hidden")),g==="subscription"&&((kt=i(this,$))==null||kt.classList.remove("is-hidden")),(a==null?void 0:a.dataset.cartId)===(a==null?void 0:a.dataset.defaultVariationId)&&i(this,L).forEach(F=>{F.classList.remove("is-hidden")}),h(this,d,nt).call(this,C)},st=function(a,l){var v;const g=(((v=window.fluentcart_single_product_vars)==null?void 0:v.out_of_stock_status)||"").toString();i(this,m).forEach(x=>{if(l!==g){const C=x.dataset.quantity;let B=x.getAttribute("data-url")+a+"&quantity="+C;x.setAttribute("href",B),x.setAttribute("data-cart-id",a),x.classList.remove("is-hidden"),x.classList.remove("disabled"),x.removeAttribute("disabled")}else x.removeAttribute("href"),x.classList.add("is-hidden"),x.setAttribute("disabled","disabled")})},Vt=function(a){i(this,m).forEach(l=>{l.setAttribute("data-quantity",a);const g=l.getAttribute("data-cart-id");if(g){let v=l.getAttribute("data-url")+g+"&quantity="+a;l.setAttribute("href",v)}})},Zt=function(a){i(this,u).forEach(l=>{l.setAttribute("data-quantity",a)})},jt=function(){i(this,s).forEach(a=>{a.addEventListener("click",l=>{h(this,d,gt).call(this,a)})})},Xt=function(a){if(a&&a.length>0){const l=a[0];l.classList.add("active"),h(this,d,pt).call(this,l)}},gt=function(a){var it;i(this,s).forEach(w=>w.classList.remove("selected")),h(this,d,ft).call(this);const l=a.dataset.cartId,g=a.closest("[data-fluent-cart-product-pricing-section]");g.querySelectorAll("[data-fluent-cart-product-payment-type]"),g.querySelectorAll("[data-fluent-cart-product-item-price]");const v=g.querySelectorAll(".fluent-cart-product-variation-content[data-variation-id]");v&&v.forEach(w=>w.classList.add("is-hidden"));const x=g.querySelectorAll(`.fluent-cart-product-variation-content[data-variation-id="${l}"]`);x&&x.forEach(w=>w.classList.remove("is-hidden")),f(this,T,l);let C=(it=window.fluentcart_single_product_vars)==null?void 0:it.in_stock_status,B=a==null?void 0:a.dataset.stockManagement,P=C;B==="yes"&&(P=a==null?void 0:a.dataset.itemStock),l!==void 0&&(i(this,L).forEach(w=>w.classList.remove("active")),i(this,u).forEach(w=>{w.setAttribute("data-cart-id",l)}),h(this,d,st).call(this,l,P),a.dataset.paymentType==="subscription"?i(this,u).forEach(w=>w.classList.add("is-hidden")):i(this,u).forEach(w=>{w.classList.remove("is-hidden"),w.setAttribute("data-cart-id",l)})),P!==void 0&&h(this,d,nt).call(this,P),a.classList.add("selected");const ot=this.findInContainer("[data-fluent-cart-single-product-page-product-variant-price-info]");ot&&ot.forEach(w=>w.classList.remove("selected"));const z=this.findOneInContainer(`[data-fluent-cart-single-product-page-product-variant-price-info][data-cart-id="${l}"]`);z&&(z==null||z.classList.add("selected"));const et=this.findInContainer(`[data-fluent-cart-single-product-page-product-quantity][data-cart-id="${l}"]`);et&&et.forEach(w=>w.classList.add("selected")),window.dispatchEvent(new CustomEvent("fluentCartSingleProductVariationChanged",{detail:{productId:i(this,N),variationId:l}}))},nt=function(a){if(!a)return;const l=this.findOneInContainer("[data-fluent-cart-product-stock]");l&&(l.innerHTML=this.$t(this.toTitleCase(a.replaceAll("-"," ")))),a===window.fluentcart_single_product_vars.out_of_stock_status?(i(this,u).forEach(g=>{const v=g.querySelector(".text");v&&(v.textContent=window.fluentcart_single_product_vars.out_of_stock_button_text),g.setAttribute("disabled","disabled"),g.classList.add("out-of-stock")}),i(this,m).forEach(g=>g.classList.add("is-hidden"))):(i(this,u).forEach(g=>{const v=g.querySelector(".text");v&&(v.textContent=window.fluentcart_single_product_vars.cart_button_text),g.classList.remove("out-of-stock"),g.removeAttribute("disabled")}),i(this,m).forEach(g=>g.classList.remove("is-hidden")))},Jt=function(){i(this,r)&&i(this,r).addEventListener("click",async a=>{a.preventDefault();const l=document.querySelector(`[data-fluent-cart-product-variant][data-cart-id="${i(this,T)}"]`),g=l==null?void 0:l.dataset.availableStock;let v=parseInt(i(this,o).value,10)||1,x=i(this,o).getAttribute("max"),C=x?parseInt(x,10):1e4;if(v>=C){window.Toastify&&new Toastify({text:`You can only purchase a maximum of ${C} item${C>1?"s":""}.`,className:"warning",duration:3e3,gravity:"top",position:"right",slideFrom:"right",type:"warning"}).showToast();return}if(v++,g!=="unlimited"&&v>parseInt(g)){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"))})},te=function(){i(this,c)&&i(this,c).addEventListener("click",a=>{a.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"))})},ee=function(){i(this,o)&&i(this,o).addEventListener("input",()=>{let a=parseInt(i(this,o).value,10);isNaN(a)||a<1?a=1:a>1e4&&(a=1e4),i(this,o).value=a,h(this,d,Vt).call(this,a),h(this,d,Zt).call(this,a)})},ft=function(){i(this,o)&&(i(this,o).value=1,i(this,o).dispatchEvent(new Event("input")))},ie=function(){const a="single_product_page_cart_updated_"+i(this,k);i(this,u).forEach(l=>{l.setAttribute("data-action-name",a),l.setAttribute("data-error-action-name",a)}),document.addEventListener(a,()=>{h(this,d,ft).call(this)})},ae=function(){var l;((l=i(this,s)[0])==null?void 0:l.dataset.paymentType)==="subscription"&&i(this,u).forEach(g=>{g.setAttribute("data-cart-id","")})},se=function(){var v,x,C;let a=(v=window.fluentcart_single_product_vars)==null?void 0:v.in_stock_status,l=(x=i(this,s)[0])==null?void 0:x.dataset.stockManagement,g=a;l==="yes"&&(g=(C=i(this,s)[0])==null?void 0:C.dataset.itemStock),g===window.fluentcart_single_product_vars.out_of_stock_status&&h(this,d,nt).call(this,g)},ue=function(){i(this,u).forEach(a=>{a.setAttribute("data-cart-id","")})},me=function(){i(this,L).forEach(a=>{a.addEventListener("click",l=>{h(this,d,ne).call(this,a)})})},ne=function(a){i(this,L).forEach(l=>l.classList.remove("active")),a.classList.add("active"),h(this,d,pt).call(this,a)},pt=function(a){const l=this.findOneInContainer("[data-fluent-cart-single-product-page-product-thumbnail]");if(!l)return;let g=a.dataset.url;g===void 0&&(g=l.dataset.defaultImageUrl),l.setAttribute("src",g)},p(tt,t,null);let b=tt;document.querySelectorAll("[data-fluent-cart-product-pricing-section]").forEach((bt,a)=>{new b().init(bt,a)}),window.addEventListener("fluentCartSingleProductModalOpened",function(bt){document.querySelectorAll("[data-fluent-cart-product-pricing-section]").forEach((a,l)=>{})}),window.FluentCartSingleProduct=b});
