var Ee=Object.defineProperty;var Vt=I=>{throw TypeError(I)};var Le=(I,t,e)=>t in I?Ee(I,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):I[t]=e;var Gt=(I,t,e)=>Le(I,typeof t!="symbol"?t+"":t,e),yt=(I,t,e)=>t.has(I)||Vt("Cannot "+e);var i=(I,t,e)=>(yt(I,t,"read from private field"),e?e.call(I):t.get(I)),y=(I,t,e)=>t.has(I)?Vt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(I):t.set(I,e),g=(I,t,e,a)=>(yt(I,t,"write to private field"),a?a.call(I,e):t.set(I,e),e),c=(I,t,e)=>(yt(I,t,"access private method"),e);var M,$,Z,X,tt,et,q,Yt,Jt,ht,Qt,vt;class Ce{constructor(t){y(this,q);y(this,M);y(this,$);y(this,Z);y(this,X);y(this,tt);y(this,et);g(this,$,t),g(this,M,i(this,$).querySelectorAll("[data-tab]")),g(this,Z,i(this,$).querySelector("[data-fluent-cart-product-item-price]")),g(this,X,i(this,$).querySelector("[data-fluent-cart-product-payment-type]")),g(this,tt,i(this,$).querySelector("[data-fluent-cart-product-quantity-container]")),g(this,et,i(this,$).querySelector("[data-fluent-cart-add-to-cart-button]"))}init(){c(this,q,Yt).call(this),c(this,q,Jt).call(this)}handleVariationChange(t){t.closest("[data-tab-content]")}}M=new WeakMap,$=new WeakMap,Z=new WeakMap,X=new WeakMap,tt=new WeakMap,et=new WeakMap,q=new WeakSet,Yt=function(){i(this,M).forEach(t=>{t.addEventListener("click",()=>{c(this,q,ht).call(this,t)}),t.addEventListener("keydown",e=>{const a=Array.from(i(this,M)),n=a.indexOf(t);let r=-1;switch(e.key){case"Enter":case" ":e.preventDefault(),c(this,q,ht).call(this,t);return;case"ArrowRight":e.preventDefault(),r=(n+1)%a.length;break;case"ArrowLeft":e.preventDefault(),r=(n-1+a.length)%a.length;break;case"Home":e.preventDefault(),r=0;break;case"End":e.preventDefault(),r=a.length-1;break;default:return}r>=0&&(a[r].focus(),c(this,q,ht).call(this,a[r]))})})},Jt=function(){const t=Array.from(i(this,M)).find(e=>e.classList.contains("active"));t&&c(this,q,vt).call(this,t)},ht=function(t,e=!1){i(this,Z)&&i(this,Z).classList.add("is-hidden"),i(this,X)&&i(this,X).classList.add("is-hidden"),i(this,tt)&&i(this,tt).classList.add("is-hidden"),i(this,et)&&i(this,et).classList.add("is-hidden"),i(this,M).forEach(l=>{l.classList.remove("active"),l.setAttribute("aria-selected","false"),l.setAttribute("tabindex","-1")}),i(this,$).querySelectorAll("[data-tab-content]").forEach(l=>{l.classList.remove("active"),l.style.display="none"}),t.classList.add("active"),t.setAttribute("aria-selected","true"),t.setAttribute("tabindex","0");const n=t.dataset.tab,r=i(this,$).querySelector(`#${n}`);r&&(r.classList.add("active"),c(this,q,Qt).call(this,r,400)),c(this,q,vt).call(this,t);let o=r==null?void 0:r.querySelector('[data-fluent-cart-product-variant][data-item-stock="in-stock"]');o||(o=r==null?void 0:r.querySelector("[data-fluent-cart-product-variant]")),o&&o.click()},Qt=function(t,e){t.style.opacity="0",t.style.display="block";const a=performance.now(),n=r=>{const o=r-a,l=Math.min(o/e,1);t.style.opacity=l,l<1&&requestAnimationFrame(n)};requestAnimationFrame(n)},vt=function(t){const e=i(this,$).querySelector("[data-tab-active-bar]");if(!e)return;const a=t.getBoundingClientRect(),n=t.parentElement.getBoundingClientRect();e.style.left=`${a.left-n.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 j=class j{constructor(t={},e=[]){this.album=e,this.currentImageIndex=void 0,this.init(),this.options=j.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 n=null;const r=o=>{n||(n=o);const l=(o-n)/e;t.style.opacity=Math.min(l,1),l<1?requestAnimationFrame(r):a&&a()};requestAnimationFrame(r)}fadeOut(t,e,a){let n=null;const r=o=>{n||(n=o);const l=(o-n)/e;t.style.opacity=Math.max(1-l,0),l<1?requestAnimationFrame(r):(t.style.display="none",a&&a())};requestAnimationFrame(r)}animate(t,e,a,n){const r={},o={};for(const u in e){const A=getComputedStyle(t);r[u]=parseFloat(A[u])||0,o[u]=parseFloat(e[u])}let l=null;const h=u=>{l||(l=u);const A=Math.min((u-l)/a,1),L=.5-Math.cos(A*Math.PI)/2;for(const E in e){const T=r[E]+(o[E]-r[E])*L;t.style[E]=T+"px"}A<1?requestAnimationFrame(h):n&&n()};requestAnimationFrame(h)}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 j.isBuiltOnce===!1?(j.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",r=>{r.target.id===t.lightbox&&this.end()}),this.outerContainer.addEventListener("click",r=>{r.target.id===t.lightbox&&this.end()}),this.lightbox.querySelector(`.${t.lbPrev}`).addEventListener("click",r=>{r.preventDefault(),this.currentImageIndex===0?this.changeImage(this.album.length-1):this.changeImage(this.currentImageIndex-1)}),this.lightbox.querySelector(`.${t.lbNext}`).addEventListener("click",r=>{r.preventDefault(),this.currentImageIndex===this.album.length-1?this.changeImage(0):this.changeImage(this.currentImageIndex+1)}),this.nav.addEventListener("mousedown",r=>{if(r.which===3){this.nav.style.pointerEvents="none";const o=()=>{setTimeout(()=>{this.nav.style.pointerEvents="auto"},0),this.lightbox.removeEventListener("contextmenu",o)};this.lightbox.addEventListener("contextmenu",o)}}),this.lightbox.querySelectorAll(`.${t.lbLoader}, .${t.lbClose}`).forEach(r=>{r.addEventListener("click",o=>(this.end(),!1)),r.addEventListener("keyup",o=>{if(o.which===13||o.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,n=window.pageXOffset;this.lightbox.style.top=a+"px",this.lightbox.style.left=n+"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,n=this.album[t].link,r=n.split(".").slice(-1)[0];this.disableKeyboardNav(),this.fadeIn(this.overlay,this.options.fadeDuration);const o=this.lightbox.querySelector(`.${e.lbLoader}`);this.fadeIn(o,500),this.lightbox.querySelectorAll(`.${e.lbImage}, .${e.lbNav}, .${e.lbPrev}, .${e.lbNext}, .${e.lbDataContainer}, .${e.lbNumbers}, .${e.lbCaption}`).forEach(u=>u.style.display="none"),this.outerContainer.classList.add("animating");const h=new Image;h.onload=()=>{setTimeout(()=>{this.onImageLoaded(h,t,a,n,r)},300)},h.src=this.album[t].link,this.currentImageIndex=t}onImageLoaded(t,e,a,n,r){let o,l,h,u,A,L;const E=this.lightbox.querySelector(`.${this.classList.lbImage}`);E.setAttribute("alt",a.album[e].alt),E.setAttribute("src",n),E.style.width=t.width+"px",E.style.height=t.height+"px";const T=t.width/t.height;L=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,A=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;const O=this.options.maxHeightPercentage||80,J=A*O/100;if(u=L-a.containerPadding.left-a.containerPadding.right-a.imageBorderWidth.left-a.imageBorderWidth.right-20,h=Math.min(J-a.containerPadding.top-a.containerPadding.bottom-a.imageBorderWidth.top-a.imageBorderWidth.bottom,A-a.containerPadding.top-a.containerPadding.bottom-a.imageBorderWidth.top-a.imageBorderWidth.bottom-a.options.positionFromTop-70),r==="svg"?(T>=1?(l=u,o=parseInt(u/T,10)):(l=parseInt(h/T,10),o=h),o>h&&(o=h,l=parseInt(h*T,10)),E.style.width=l+"px",E.style.height=o+"px"):(a.options.fitImagesInViewport?(a.options.maxWidth&&a.options.maxWidth<u&&(u=a.options.maxWidth),a.options.maxHeight&&a.options.maxHeight<h&&(h=a.options.maxHeight)):(u=a.options.maxWidth||t.width||u,h=a.options.maxHeight||t.height||h),(t.width>u||t.height>h)&&(t.width/u>t.height/h?(l=u,o=parseInt(t.height/(t.width/l),10),o>h&&(o=h,l=parseInt(t.width/(t.height/o),10))):(o=h,l=parseInt(t.width/(t.height/o),10),l>u&&(l=u,o=parseInt(t.height/(t.width/l),10))),E.style.width=l+"px",E.style.height=o+"px")),o+a.containerPadding.top+a.containerPadding.bottom+a.imageBorderWidth.top+a.imageBorderWidth.bottom+a.options.positionFromTop+70>A){const z=A-a.containerPadding.top-a.containerPadding.bottom-a.imageBorderWidth.top-a.imageBorderWidth.bottom-a.options.positionFromTop-70,K=z/o;o=z,l=Math.floor(l*K),E.style.width=l+"px",E.style.height=o+"px"}a.sizeContainer(parseInt(E.style.width),parseInt(E.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,n=this.outerContainer.offsetHeight,r=t+this.containerPadding.left+this.containerPadding.right+this.imageBorderWidth.left+this.imageBorderWidth.right,o=e+this.containerPadding.top+this.containerPadding.bottom+this.imageBorderWidth.top+this.imageBorderWidth.bottom,l=()=>{this.lightbox.querySelector(`.${this.classList.lbDataContainer}`).style.width=r+"px";const h=this.lightbox.querySelector(`.${this.classList.lbPrevLink}`),u=this.lightbox.querySelector(`.${this.classList.lbNextLink}`);h&&(h.style.height=o+"px"),u&&(u.style.height=o+"px"),this.overlay.focus(),this.showImage()};a!==r||n!==o?this.animate(this.outerContainer,{width:r,height:o},this.options.resizeDuration,l):l()}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 r=t.keyCode;r===27?(t.stopPropagation(),this.end()):r===37?this.currentImageIndex!==0?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1):r===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)}};Gt(j,"isBuiltOnce",!1);let It=j;const Ut=new WeakMap;window.addEventListener("fluent_cart_app_loaded",function(I){document.querySelectorAll("[data-fluent-cart-product-gallery-wrapper]").forEach((t,e)=>{new window.FluentCartImageGallery().init(t)})});window.addEventListener("fluentCartSingleProductModalOpened",function(I){let t=!1;window.fluentcart_single_product_vars&&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 P,F,H,C,S,ot,W,k,it,at,B,N,Y,R,f,jt,wt,ut,Zt,Xt,te,ee,xt,ie,At,ae,Et,ke,se,ne,re,ft,oe,U,Lt,le,de;class Se{constructor(){y(this,f);y(this,P);y(this,F);y(this,H);y(this,C);y(this,S,0);y(this,ot);y(this,W);y(this,k);y(this,it);y(this,at,"all");y(this,B,null);y(this,N,null);y(this,Y,null);y(this,R,0)}init(t,e=!0){var a,n;(a=Ut.get(t))==null||a.abort(),(n=i(this,B))==null||n.abort(),g(this,B,new AbortController),Ut.set(t,i(this,B)),this.container=t,g(this,it,this.container.getAttribute("data-product-id")),g(this,at,this.container.getAttribute("data-thumbnail-mode")||"all"),g(this,ot,e),g(this,W,this.findInContainer("[data-fluent-cart-thumb-control-button]")),g(this,k,this.findOneInContainer("[data-fluent-cart-single-product-page-product-thumbnail-controls]")),g(this,P,this.findOneInContainer("[data-fluent-cart-single-product-page-product-thumbnail]")),c(this,f,Xt).call(this),c(this,f,jt).call(this),c(this,f,te).call(this),c(this,f,ae).call(this),c(this,f,ee).call(this),c(this,f,se).call(this),c(this,f,re).call(this),c(this,f,le).call(this),c(this,f,de).call(this)}updateGalleryByVariation(t=0){if(i(this,at)==="all"){if(i(this,N))return;this.findInContainer("[data-fluent-cart-thumb-control-button]").forEach(r=>r.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(r=>r.classList.add("is-hidden")),e.forEach(r=>r.classList.remove("is-hidden"))),this.findInContainer('[data-fluent-cart-thumb-control-button][data-variation-id="0"]').forEach(n=>n.classList.remove("is-hidden"))}findInContainer(t){return this.container.querySelectorAll(t)}findOneInContainer(t){return this.container.querySelector(t)}}P=new WeakMap,F=new WeakMap,H=new WeakMap,C=new WeakMap,S=new WeakMap,ot=new WeakMap,W=new WeakMap,k=new WeakMap,it=new WeakMap,at=new WeakMap,B=new WeakMap,N=new WeakMap,Y=new WeakMap,R=new WeakMap,f=new WeakSet,jt=function(){const a=(this.container.closest("[data-fluent-cart-single-product-page]")||document).querySelector("[data-primary-group-id]");if(!a)return;const n=parseInt(a.getAttribute("data-primary-group-id")||"0",10);if(!n)return;let r={},o={};try{r=JSON.parse(a.getAttribute("data-attribute-config")||"{}"),o=JSON.parse(a.getAttribute("data-variation-map")||"{}")}catch{return}const l=(r[String(n)]||[]).map(Number);if(!l.length)return;const h={};l.forEach(L=>{h[L]=[]}),Object.entries(o).forEach(([L,E])=>{const T=L.split("_").map(Number);l.forEach(O=>{T.includes(O)&&h[O].push(Number(E))})}),g(this,N,h);try{const L=i(this,k)?i(this,k).getAttribute("data-variant-first-media-map"):null;L&&g(this,Y,JSON.parse(L))}catch{g(this,Y,null)}let u=0;const A=a.querySelector(`.fct-swatch-item[data-group-id="${n}"].selected, .fct-swatch-item[data-group-id="${n}"][aria-checked="true"]`);if(A&&(u=parseInt(A.getAttribute("data-term-id")||"0",10)),!u){const L=a.querySelector(`[data-attribute-group="${n}"] [data-fct-select-option][aria-selected="true"]`);L&&(u=parseInt(L.getAttribute("data-value")||"0",10))}u&&c(this,f,wt).call(this,u)},wt=function(t){if(!i(this,N))return;g(this,R,Number(t));const e=c(this,f,ft).call(this);if(!e.length)return;if(!i(this,R)){c(this,f,U).call(this,e[0]);return}const a=new Set((i(this,N)[i(this,R)]||[]).map(String)),n=a.size?e.find(r=>a.has(r.getAttribute("data-variation-id")||"")):null;n?c(this,f,U).call(this,n):c(this,f,ut).call(this)},ut=function(){const t=this.findOneInContainer("[data-fluent-cart-single-product-page-product-thumbnail]");if(!t)return;const e=t.dataset.defaultImageUrl;e&&(t.setAttribute("src",e),i(this,W).forEach(a=>{a.classList.remove("active"),a.setAttribute("aria-pressed","false"),a.setAttribute("tabindex","-1")}))},Zt=function(t){var r,o;const e=c(this,f,ft).call(this);if(!e.length)return;if(i(this,Y)){const l=i(this,Y)[String(t)];if(!l){c(this,f,ut).call(this);return}let h=null;l.id>0&&(h=e.find(u=>u.getAttribute("data-media-id")===String(l.id))),h||(h=e.find(u=>u.getAttribute("data-url")===l.url)),h?c(this,f,U).call(this,h):c(this,f,ut).call(this);return}const a=(r=i(this,C))==null?void 0:r[String(t)],n=((o=a==null?void 0:a[0])==null?void 0:o.link)??null;if(n){const l=e.find(h=>h.getAttribute("data-url")===n);l&&c(this,f,U).call(this,l)}},Xt=function(){const t=i(this,B).signal;let e=null,a=null,n=!1;const r=()=>{n=!1,a!==null?c(this,f,Zt).call(this,a):e!==null&&c(this,f,wt).call(this,e),e=null,a=null};window.addEventListener("fluentCartSingleProductVariationChanged",o=>{var u;if(o.detail.productId!=i(this,it))return;if(g(this,S,o.detail.variationId),i(this,N)){a=i(this,S),e=null,n||(n=!0,requestAnimationFrame(r));return}this.updateGalleryByVariation(i(this,S));const h=(u=i(this,k))==null?void 0:u.querySelectorAll(`[data-fluent-cart-thumb-control-button][data-variation-id="${i(this,S)}"]`);c(this,f,ne).call(this,h)},{signal:t}),window.addEventListener("fluentCartAdvVariationImageChanged",o=>{if(o.detail.productId!=i(this,it))return;if(i(this,N)){e=o.detail.termId,a=null,n||(n=!0,requestAnimationFrame(r));return}const l=this.findOneInContainer("[data-fluent-cart-single-product-page-product-thumbnail]");l&&l.setAttribute("src",o.detail.url)},{signal:t})},te=function(){var a,n,r,o;const t=(a=i(this,k))==null?void 0:a.querySelectorAll("[data-fluent-cart-thumb-control-button]:not(.is-hidden)"),e=(n=i(this,k))==null?void 0:n.querySelector(".active[data-fluent-cart-thumb-control-button]:not(.is-hidden)");e?g(this,S,e.dataset.variationId):g(this,S,((o=(r=t==null?void 0:t[0])==null?void 0:r.dataset)==null?void 0:o.variationId)||0),this.updateGalleryByVariation(i(this,S))},ee=function(){i(this,P)&&i(this,P).removeEventListener("click",c(this,f,xt).bind(this)),g(this,F,new It({},[])),i(this,P)&&i(this,P).addEventListener("click",c(this,f,xt).bind(this))},xt=function(t){const e=i(this,P).parentElement,a=e.style.position,n=!a||a==="",r=document.querySelector("[data-fluent-cart-shop-app-single-product-modal]");r&&window.FluentCartSingleProductModal.closeModal(r),n&&(e.style.position="relative");const o=document.createElement("div");o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.right="0",o.style.bottom="0",o.style.zIndex="99999",document.body.appendChild(o),i(this,H)&&i(this,H).closezoom&&i(this,H).closezoom(),setTimeout(()=>{o.parentNode&&o.parentNode.removeChild(o),n&&(e.style.position="")},1e3);const l=t.target;let h=c(this,f,ie).call(this);const u=c(this,f,Et).call(this,h,l.getAttribute("src"));u>-1&&(i(this,F).setAlbum(h),i(this,F).start(u,()=>{}))},ie=function(){if(i(this,at)==="all"){if(i(this,R)&&i(this,N)){const t=new Set((i(this,N)[i(this,R)]||[]).map(String));if(t.size){const e=new Set,a=[];if(Object.entries(i(this,C)).forEach(([n,r])=>{(t.has(n)||n==="0")&&r.forEach(o=>{e.has(o.link)||(e.add(o.link),a.push(o))})}),a.length>0)return a}}return c(this,f,At).call(this)}else{let t=i(this,C)[i(this,S)],e=i(this,C)[0];return t&&e&&(t=[...t,...e]),(!t||t.length===0)&&(t=i(this,C)[0]),t}},At=function(){const t=[],e=new Set,a=(n,r)=>{const o=String(n);e.has(o)||(e.add(o),Array.isArray(r)&&r.forEach(l=>t.push(l)))};return i(this,S)&&i(this,C)[i(this,S)]&&a(i(this,S),i(this,C)[i(this,S)]),i(this,C)[0]&&a("0",i(this,C)[0]),Object.keys(i(this,C)).forEach(n=>{a(n,i(this,C)[n])}),t.length>0?t:i(this,C)[0]||[]},ae=function(){window.fluentcart_single_product_vars.enable_image_zoom==="yes"&&i(this,ot)&&i(this,H)==null&&i(this,P)&&(window.onload=function(){},g(this,H,xZoom(i(this,P),{tint:!1,Yoffset:120,zoomWidth:500,zoomHeight:400,position:"inside",lensSize:300})))},Et=function(t,e){return Array.isArray(t)?t.findIndex(a=>a.link===e):-1},ke=function(){return window.matchMedia("(hover: hover) and (pointer: fine)").matches},se=function(){var a;const t={},e=(a=i(this,k))==null?void 0:a.getAttribute("data-all-gallery-images");if(e)try{const n=JSON.parse(e);if(n.length>i(this,W).length){n.forEach(r=>{const o=r.variation_id!=null&&r.variation_id!==""?String(r.variation_id):"0";t.hasOwnProperty(o)||(t[o]=[]),t[o].push({alt:r.title||"",link:r.url,title:r.title||""})}),g(this,C,t);return}}catch{}i(this,W).length>0&&i(this,W).forEach((n,r)=>{const o=n.dataset.variationId.toString(),l=n.querySelector("[data-fluent-cart-single-product-page-product-thumbnail-controls-thumb]");l&&(t.hasOwnProperty(o)||(t[o]=[]),c(this,f,Et).call(this,t[o],l.src)===-1&&t[o].push({alt:l.alt,link:l.src,title:l.alt}))}),g(this,C,t)},ne=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"),c(this,f,Lt).call(this,e)}},re=function(){this.findInContainer("[data-fluent-cart-thumb-control-button]").forEach(t=>{t.addEventListener("click",()=>{c(this,f,U).call(this,t)})}),i(this,k)&&i(this,k).addEventListener("keydown",t=>{c(this,f,oe).call(this,t)})},ft=function(){var t;return Array.from(((t=i(this,k))==null?void 0:t.querySelectorAll("[data-fluent-cart-thumb-control-button]:not(.is-hidden)"))||[])},oe=function(t){const e=this.container.classList.contains("thumb-pos-left")||this.container.classList.contains("thumb-pos-right"),a=e?["ArrowDown"]:["ArrowRight"],n=e?["ArrowUp"]:["ArrowLeft"],r=a.includes(t.key)||!e&&t.key==="ArrowDown",o=n.includes(t.key)||!e&&t.key==="ArrowUp";if(!r&&!o)return;t.preventDefault();const l=c(this,f,ft).call(this);if(l.length===0)return;const h=l.indexOf(document.activeElement);let u;r?u=h<l.length-1?h+1:0:u=h>0?h-1:l.length-1;const A=l[u];A.focus(),c(this,f,U).call(this,A)},U=function(t){i(this,W).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&&g(this,S,e),c(this,f,Lt).call(this,t)},Lt=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)},le=function(){if(!(this.container.getAttribute("data-scrollable-thumbs")==="yes")||!i(this,k)||!(this.container.classList.contains("thumb-pos-left")||this.container.classList.contains("thumb-pos-right")))return;const a=()=>{const r=this.findOneInContainer(".fct-product-gallery-thumb");r&&i(this,k)&&(i(this,k).style.maxHeight=r.offsetHeight+"px")},n=i(this,P);n&&n.tagName==="IMG"&&(n.complete?a():n.addEventListener("load",a,{once:!0,signal:i(this,B).signal})),window.addEventListener("resize",a,{signal:i(this,B).signal})},de=function(){const t=this.findOneInContainer("[data-fluent-cart-gallery-see-more]");t&&t.addEventListener("click",()=>{const e=c(this,f,At).call(this);if(!e||e.length===0)return;const a=this.findInContainer("[data-fluent-cart-thumb-control-button]:not(.is-hidden)").length,n=Math.min(a,e.length-1);i(this,F).setAlbum(e),i(this,F).start(n,()=>{})},{signal:i(this,B).signal})};window.FluentCartImageGallery=Se;document.addEventListener("DOMContentLoaded",()=>{var t,e,a,n,r,o,l,h,u,A,L,E,T,O,J,z,K,Q,st,m,ce,Ct,_e,he,ue,mt,fe,me,pe,ge,rt,St,pt,be,ye,ve,kt,Ie,we,xe,qe,Te,Ae,_t;const lt=class lt{constructor(){y(this,m);y(this,e);y(this,a);y(this,n);y(this,r);y(this,o);y(this,l);y(this,h);y(this,u);y(this,A);y(this,L);y(this,E);y(this,T);y(this,O,0);y(this,J);y(this,z);y(this,K);y(this,Q);y(this,st)}toTitleCase(s){return s.replace(/\w\S*/g,function(d){return d.charAt(0).toUpperCase()+d.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,d){g(this,T,d),g(this,e,s),g(this,a,this.findInContainer("[data-fluent-cart-product-variant]")),g(this,K,i(this,e).getAttribute("data-product-id")),g(this,o,this.findOneInContainer("[data-fluent-cart-product-qty-increase-button]")),g(this,l,this.findOneInContainer("[data-fluent-cart-product-qty-decrease-button]")),g(this,n,this.findOneInContainer("[data-fluent-cart-single-product-page-product-quantity-input]")),g(this,r,this.findOneInContainer("[data-fluent-cart-product-quantity-container]")),g(this,h,this.findInContainer("[data-fluent-cart-add-to-cart-button]")),g(this,u,this.findInContainer("[data-fluent-cart-direct-checkout-button]")),g(this,A,this.findInContainer("[data-fluent-cart-thumb-control-button]")),g(this,L,this.findOneInContainer("[data-fluent-cart-single-product-page-product-thumbnail-controls]")),g(this,J,this.findOneInContainer("[data-fluent-cart-product-item-price]")),g(this,z,this.findOneInContainer("[data-fluent-cart-product-payment-type]")),g(this,Q,this.findOneInContainer("[data-fluent-cart-product-pricing-section]")),c(this,m,be).call(this),c(this,m,ye).call(this),c(this,m,ve).call(this),c(this,m,Ie).call(this),g(lt,t,this),window.fluentCartSingleProduct=this;const b=this.findOneInContainer(".fct-advanced-variation-wrap"),p=(window.FluentCartVariationControllers||{}).advanced||null;return b&&p?(g(this,st,new p),i(this,st).init(b)):c(this,m,pe).call(this),c(this,m,ue).call(this),c(this,m,he).call(this),c(this,m,Ct).call(this),c(this,m,ce).call(this),this}selectVariation(s){const b=i(this,e).closest(".fct-product-summary")||i(this,e).closest(".product-info-block-wrapper")||i(this,e).parentElement||i(this,Q);b.querySelectorAll(".fluent-cart-product-variation-content[data-variation-id]").forEach(p=>p.classList.add("is-hidden")),b.querySelectorAll(`.fluent-cart-product-variation-content[data-variation-id="${s}"]`).forEach(p=>p.classList.remove("is-hidden")),window.dispatchEvent(new CustomEvent("fluentCartSingleProductVariationChanged",{detail:{productId:i(this,K),variationId:s}}))}updateGalleryByVariation(s=0){const d=document.querySelectorAll(`[data-fluent-cart-thumb-control-button][data-variation-id="${s}"]`);d.length>0?(document.querySelectorAll(`[data-fluent-cart-thumb-control-button][data-variation-id]:not([data-variation-id="${s}"])`).forEach(p=>p.classList.add("is-hidden")),d.forEach(p=>p.classList.remove("is-hidden"))):document.querySelectorAll('[data-fluent-cart-thumb-control-button][data-variation-id="0"]').forEach(p=>p.classList.remove("is-hidden"))}};t=new WeakMap,e=new WeakMap,a=new WeakMap,n=new WeakMap,r=new WeakMap,o=new WeakMap,l=new WeakMap,h=new WeakMap,u=new WeakMap,A=new WeakMap,L=new WeakMap,E=new WeakMap,T=new WeakMap,O=new WeakMap,J=new WeakMap,z=new WeakMap,K=new WeakMap,Q=new WeakMap,st=new WeakMap,m=new WeakSet,ce=function(){window.addEventListener("resize",s=>{c(this,m,Ct).call(this)})},Ct=function(){const s=document.querySelector(".fluent-cart-single-product-page");s&&(s.offsetWidth<=815?s.classList.add("is-mobile"):s.classList.remove("is-mobile"))},_e=function(s,d){return Array.isArray(s)?s.findIndex(b=>b.link===d):-1},he=function(){this.findOneInContainer("[data-fluent-cart-product-tab]")&&(g(this,E,new Ce(i(this,e))),i(this,E).init())},ue=function(){var qt,Tt,Ot,$t,Pt,Dt,Nt,Wt,Bt,zt,Mt,Ft,Ht,Rt,Kt;const s=this.findOneInContainer(".selected[data-fluent-cart-product-variant]"),d=s==null?void 0:s.dataset.cartId;s==null||s.dataset.itemPrice,s==null||s.dataset.subscriptionTerms;const b=s==null?void 0:s.dataset.paymentType;let p=(qt=window.fluentcart_single_product_vars)==null?void 0:qt.in_stock_status,w=s==null?void 0:s.dataset.stockManagement,v=p;w==="yes"&&(v=s==null?void 0:s.dataset.itemStock);const _=(Tt=i(this,u)[0])==null?void 0:Tt.dataset.stockAvailability;if(_===((Ot=window.fluentcart_single_product_vars)==null?void 0:Ot.out_of_stock_status)&&(v=_),d!==void 0&&(i(this,h).forEach(G=>{G.setAttribute("data-cart-id",d)}),c(this,m,mt).call(this,d,v)),d===void 0&&i(this,a).length===0){const G=($t=i(this,u)[0])==null?void 0:$t.dataset.cartId,ct=(Pt=i(this,u)[0])==null?void 0:Pt.dataset.stockAvailability;c(this,m,mt).call(this,G,ct)}const D=(Dt=i(this,L))==null?void 0:Dt.querySelectorAll("[data-fluent-cart-thumb-control-button]:not(.is-hidden)"),V=(Nt=i(this,Q))==null?void 0:Nt.querySelector("[data-fluent-cart-product-variant].selected");V?g(this,O,((Wt=V==null?void 0:V.dataset)==null?void 0:Wt.cartId)||0):g(this,O,((Bt=D==null?void 0:D.dataset)==null?void 0:Bt.variationId)||0),c(this,m,ge).call(this,D);const x=new URL(window.location.href).searchParams;if(x.has("selected")){const G=x.get("selected"),ct=this.findOneInContainer(`[data-fluent-cart-product-variant][data-cart-id="${G}"]`);ct&&c(this,m,rt).call(this,ct)}c(this,m,xe).call(this),c(this,m,we).call(this);const dt=((zt=i(this,a)[0])==null?void 0:zt.dataset.paymentType)||((Mt=i(this,r))==null?void 0:Mt.dataset.paymentType),bt=((Ft=i(this,u)[0])==null?void 0:Ft.dataset.variationType)||((Ht=i(this,r))==null?void 0:Ht.dataset.variationType);dt==="subscription"&&bt==="simple"&&((Rt=i(this,z))==null||Rt.classList.remove("is-hidden")),b==="subscription"&&((Kt=i(this,z))==null||Kt.classList.remove("is-hidden")),(s==null?void 0:s.dataset.cartId)===(s==null?void 0:s.dataset.defaultVariationId)&&i(this,A).forEach(G=>{G.classList.remove("is-hidden")}),c(this,m,pt).call(this,v)},mt=function(s,d){var p;const b=(((p=window.fluentcart_single_product_vars)==null?void 0:p.out_of_stock_status)||"").toString();i(this,u).forEach(w=>{if(d!==b){const v=w.dataset.quantity;let _=w.getAttribute("data-url")+s+"&quantity="+v;w.setAttribute("href",_),w.setAttribute("data-cart-id",s),w.classList.remove("is-hidden")}else w.removeAttribute("href"),w.classList.add("is-hidden")})},fe=function(s){i(this,u).forEach(d=>{d.setAttribute("data-quantity",s);const b=d.getAttribute("data-cart-id");if(b){let p=d.getAttribute("data-url")+b+"&quantity="+s;d.setAttribute("href",p)}})},me=function(s){i(this,h).forEach(d=>{d.setAttribute("data-quantity",s)})},pe=function(){i(this,a).forEach(s=>{s.addEventListener("click",d=>{c(this,m,rt).call(this,s)}),s.addEventListener("keydown",d=>{const b=s.closest('[role="radiogroup"]');if(!b)return;const p=Array.from(b.querySelectorAll('[role="radio"]')),w=p.indexOf(s);let v=-1;switch(d.key){case"Enter":case" ":d.preventDefault(),c(this,m,rt).call(this,s);return;case"ArrowDown":case"ArrowRight":d.preventDefault(),v=(w+1)%p.length;break;case"ArrowUp":case"ArrowLeft":d.preventDefault(),v=(w-1+p.length)%p.length;break;case"Home":d.preventDefault(),v=0;break;case"End":d.preventDefault(),v=p.length-1;break;default:return}v>=0&&(p[v].focus(),c(this,m,rt).call(this,p[v]))})})},ge=function(s){if(s&&s.length>0){const d=s[0];d.classList.add("active"),c(this,m,_t).call(this,d)}},rt=function(s){var V,gt;i(this,a).forEach(x=>{x.classList.remove("selected"),x.setAttribute("aria-checked","false"),x.setAttribute("tabindex","-1")}),s.setAttribute("aria-checked","true"),s.setAttribute("tabindex","0"),s.classList.add("selected");const d=s.dataset.cartId;i(this,A).forEach(x=>x.classList.remove("active")),this.selectVariation(d),c(this,m,kt).call(this),g(this,O,d);const b=i(this,e).closest(".fct-product-summary")||i(this,e).closest(".product-info-block-wrapper")||i(this,e).parentElement;let p=(V=window.fluentcart_single_product_vars)==null?void 0:V.in_stock_status;s.dataset.stockManagement==="yes"&&(p=s.dataset.itemStock),d!==void 0&&(i(this,h).forEach(x=>x.setAttribute("data-cart-id",d)),c(this,m,mt).call(this,d,p),s.dataset.paymentType!=="subscription"&&i(this,h).forEach(x=>{x.classList.remove("is-hidden"),x.setAttribute("data-cart-id",d)})),p!==void 0&&c(this,m,pt).call(this,p);const w=window.fluentcart_single_product_vars.out_of_stock_status;s.dataset.paymentType==="subscription"&&p!==w&&i(this,h).forEach(x=>x.classList.add("is-hidden"));const v=s.dataset.sku||"",_=b==null?void 0:b.querySelector("[data-fluent-cart-product-sku]");if(_){_.textContent=v;const x=_.closest(".fct-product-sku");x&&(x.style.display=v?"":"none")}const D=s.getAttribute("aria-label")||"";D&&(i(this,u).forEach(x=>{x.setAttribute("aria-label",x.textContent.trim()+" - "+D)}),i(this,h).forEach(x=>{const dt=x.querySelector(".text"),bt=dt?dt.textContent.trim():x.textContent.trim();x.setAttribute("aria-label",bt+" - "+D)})),this.findInContainer("[data-fluent-cart-single-product-page-product-variant-price-info]").forEach(x=>x.classList.remove("selected")),(gt=this.findOneInContainer(`[data-fluent-cart-single-product-page-product-variant-price-info][data-cart-id="${d}"]`))==null||gt.classList.add("selected"),this.findInContainer(`[data-fluent-cart-single-product-page-product-quantity][data-cart-id="${d}"]`).forEach(x=>x.classList.add("selected"))},St=function(s,d){if(s.getAttribute("data-icon-only")==="true")return;const b=s.querySelector(".text");if(!b)return;let p=b.querySelector("span");p?p.textContent=d:b.textContent=d},pt=function(s){if(!s)return;const d=window.fluentcart_single_product_vars.out_of_stock_status,b=s===d,p=i(this,e).closest(".fct-product-summary")||i(this,e).closest(".product-info-block-wrapper")||i(this,e).parentElement,w=p==null?void 0:p.querySelector("[data-fluent-cart-product-stock]");if(w){const v=b?w.getAttribute("data-out-of-stock-text"):w.getAttribute("data-in-stock-text");v?w.textContent=v: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 _=w.closest(".fct-product-stock");_&&(_.classList.remove("in-stock","out-of-stock"),_.classList.add(s))}b?(i(this,h).forEach(v=>{c(this,m,St).call(this,v,window.fluentcart_single_product_vars.out_of_stock_button_text),v.setAttribute("disabled","disabled"),v.classList.add("out-of-stock"),v.classList.remove("is-hidden")}),i(this,u).forEach(v=>{v.classList.add("is-hidden"),v.removeAttribute("href")})):(i(this,h).forEach(v=>{c(this,m,St).call(this,v,window.fluentcart_single_product_vars.cart_button_text),v.classList.remove("out-of-stock"),v.removeAttribute("disabled")}),i(this,u).forEach(v=>{v.classList.remove("is-hidden")}))},be=function(){i(this,o)&&i(this,o).addEventListener("click",async s=>{s.preventDefault();const d=document.querySelector(`[data-fluent-cart-product-variant][data-cart-id="${i(this,O)}"]`),b=d==null?void 0:d.dataset.availableStock;let p=parseInt(i(this,n).value,10)||1,w=i(this,n).getAttribute("max"),v=w?parseInt(w,10):1e4;if(p>=v){window.Toastify&&new Toastify({text:`You can only purchase a maximum of ${v} item${v>1?"s":""}.`,className:"warning",duration:3e3,gravity:"top",position:"right",slideFrom:"right",type:"warning"}).showToast();return}if(p++,b!=="unlimited"&&p>parseInt(b)){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,n).value=p,i(this,n).dispatchEvent(new Event("input"))})},ye=function(){i(this,l)&&i(this,l).addEventListener("click",s=>{s.preventDefault();let d=parseInt(i(this,n).value,10)||1;d>1&&d--,i(this,n).value=d,i(this,n).dispatchEvent(new Event("input"))})},ve=function(){i(this,n)&&i(this,n).addEventListener("input",()=>{let s=parseInt(i(this,n).value,10);isNaN(s)||s<1?s=1:s>1e4&&(s=1e4),i(this,n).value=s,c(this,m,fe).call(this,s),c(this,m,me).call(this,s)})},kt=function(){i(this,n)&&(i(this,n).value=1,i(this,n).dispatchEvent(new Event("input")))},Ie=function(){const s="single_product_page_cart_updated_"+i(this,T);i(this,h).forEach(d=>{d.setAttribute("data-action-name",s),d.setAttribute("data-error-action-name",s)}),document.addEventListener(s,()=>{c(this,m,kt).call(this)})},we=function(){var d;((d=i(this,a)[0])==null?void 0:d.dataset.paymentType)==="subscription"&&i(this,h).forEach(b=>{b.setAttribute("data-cart-id","")})},xe=function(){var w,v,_,D;let s=(w=window.fluentcart_single_product_vars)==null?void 0:w.in_stock_status,d=(v=i(this,a)[0])==null?void 0:v.dataset.stockManagement,b=s;d==="yes"&&(b=(_=i(this,a)[0])==null?void 0:_.dataset.itemStock);const p=(D=i(this,u)[0])==null?void 0:D.dataset.stockAvailability;p===window.fluentcart_single_product_vars.out_of_stock_status&&(b=p),b===window.fluentcart_single_product_vars.out_of_stock_status&&c(this,m,pt).call(this,b)},qe=function(){i(this,h).forEach(s=>{s.setAttribute("data-cart-id","")})},Te=function(){i(this,A).forEach(s=>{s.addEventListener("click",d=>{c(this,m,Ae).call(this,s)})})},Ae=function(s){i(this,A).forEach(d=>{d.classList.remove("active"),d.setAttribute("aria-pressed","false")}),s.classList.add("active"),s.setAttribute("aria-pressed","true"),c(this,m,_t).call(this,s)},_t=function(s){const d=this.findOneInContainer("[data-fluent-cart-single-product-page-product-thumbnail]");if(!d)return;let b=s.dataset.url;b===void 0&&(b=d.dataset.defaultImageUrl),d.setAttribute("src",b)},y(lt,t,null);let I=lt;I.init=function(nt){(nt||document).querySelectorAll("[data-fluent-cart-product-pricing-section]:not([data-fluent-cart-single-product-initialized])").forEach(s=>{s.setAttribute("data-fluent-cart-single-product-initialized","1");const d=document.querySelectorAll("[data-fluent-cart-product-pricing-section][data-fluent-cart-single-product-initialized]").length-1;new I().init(s,d)})},I.reinit=function(nt,s){nt&&(nt.querySelectorAll("[data-fluent-cart-product-pricing-section][data-fluent-cart-single-product-initialized]").forEach(d=>d.removeAttribute("data-fluent-cart-single-product-initialized")),I.init(nt),window.dispatchEvent(new CustomEvent("fluentCartSingleProductModalOpened",{detail:{source:s||"external"}})))},I.init(document),window.FluentCartSingleProduct=I});
