class Confetti{confettiInterval=null;containerEl=null;confettiColors=["#EF2964","#00C09D","#2D87B0","#48485E","#EFFF1D"];confettiAnimations=["slow","medium","fast"];timeRun=0;constructor(t){t&&(this.container=t,this.setupElement(),this.render())}setupElement=()=>{if(!this.container)return;const t=document.createElement("div"),e=this.container.style.position;"relative"===e&&"absolute"===e||(this.container.style.position="relative"),t&&t.classList.add("confetti-container"),this.container.appendChild(t),this.containerEl=t};stopConfetti=()=>{clearInterval(this.confettiInterval),setTimeout((()=>this.containerEl.remove()),1500)};render=()=>{this.confettiInterval=setInterval((()=>{this.timeRun+=1,this.timeRun>=160&&this.stopConfetti();const t=document.createElement("div"),e=Math.floor(3*Math.random())+7+"px",s=this.confettiColors[Math.floor(Math.random()*this.confettiColors.length)],i=Math.floor(Math.random()*this.container.offsetWidth)+"px",o=this.confettiAnimations[Math.floor(Math.random()*this.confettiAnimations.length)];t.classList.add("confetti","confetti--animation-"+o),t.style.left=i,t.style.width=e,t.style.height=e,t.style.backgroundColor=s,t.removeTimeout=setTimeout((function(){t.parentNode.removeChild(t)}),3e3),this.containerEl.appendChild(t)}),20)}}customElements.define("foxkit-cart-goal",class extends HTMLElement{constructor(){super(),this.selectors={cartContainer:".scd__content, cart-items",cartFooter:"#main-cart-footer, .cart-footer, .cart__footer, .sf-cart__summary",cartSubtotal:"[data-cart-subtotal], .cart__footer .totals, #main-cart-footer .totals",shippingNote:"[data-shipping-note], .tax-note",title:".foxkit-cartgoal__title",progressBar:"[data-progress]",goalLeft:"[data-goal-left]",icon:".foxkit-cartgoal__icon"},this.classes={hidden:"!foxkit-hidden",hasGoal:"scd--has-cartgoal",done:"foxkit-cartgoal--done"},this.defaultIcon='',this.doneIcon='',this.progress=0,this.goalDone=!1,this.enabled=!0,this.settings=window.FoxKitPlugins.CartGoal,this.goal=Number(this.settings.goal_amount)*Number(window.Shopify.currency.rate||1)||0,this.reached_message=window.__i18n.transPlugin({configs:this.settings,key:"message_reached"}),this.message=window.__i18n.transPlugin({configs:this.settings,key:"message"})}connectedCallback(){if(!window.FoxKitThemeHelperEnabled)return;this.dataset.plugin="CartGoal",this.classList.add("foxkit-cartgoal","!foxkit-hidden"),this.domNodes=window.FoxKitV2.Utils.queryDomNodes(this.selectors,this);const t=this.closest(this.selectors.cartContainer),e=document.querySelector(this.selectors.cartFooter);t&&t.classList.add(this.classes.hasGoal),e&&(this.shippingNote=e.querySelector(this.selectors.shippingNote),this.cartSubtotal=e.querySelector(this.selectors.cartSubtotal)),this.confettiShow=this.goalDone,this.cacheShowKey="_foxKit_reachedGoal",this.triggerEvent=!1,this.renderShippingBadge(),this.updateProgress(),window.FoxkitEvents.subscribe("ON_FOXKIT_CART_UPDATE",(t=>this.handleChange(t))),this.querySelector(this.selectors.progressBar)||this.renderTemplate()}disconnectedCallback(){window.FoxkitEvents.unSubscribe("ON_FOXKIT_CART_UPDATE",(t=>this.handleChange(t)))}renderTemplate(){this.innerHTML=`