1customElements.get("sticky-atc-bar-minimalist")||customElements.define("sticky-atc-bar-minimalist",class extends HTMLElement{constructor(){super(),this.classes={isOpen:"sticky-atc-bar--show"},this.submitEl.addEventListener("click",this.onClick.bind(this))}get submitEl(){return this._submitEl=this._submitEl||this.querySelector('[type="submit"]')}connectedCallback(){this.productFormActions=document.querySelector(".main-product-form"),this.mainProductInfo=document.querySelector("product-info"),this.init(),this.cartErrorUnsubscriber=FoxTheme.pubsub.subscribe(FoxTheme.pubsub.PUB_SUB_EVENTS.cartError,()=>{this.resetButtonLoading(),this.scrollToTop(this.productFormActions)}),this.cartUpdateUnsubscriber=FoxTheme.pubsub.subscribe(FoxTheme.pubsub.PUB_SUB_EVENTS.cartUpdate,()=>{this.resetButtonLoading()})}disconnectedCallback(){this.cartErrorUnsubscriber&&this.cartErrorUnsubscriber(),this.cartUpdateUnsubscriber&&this.cartUpdateUnsubscriber()}init(){if(!this.productFormActions){this.classList.remove(this.classes.isOpen);return}const rootMargin=`${this.productFormActions.offsetHeight}px 0px 0px 0px`;this.observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{const isAboveViewport=!entry.isIntersecting&&entry.boundingClientRect.top<0;this.classList.toggle(this.classes.isOpen,isAboveViewport)})},{threshold:1,rootMargin}),this.observer.observe(this.productFormActions),this.syncWithMainProductForm()}onClick(){this.submitEl.setAttribute("aria-disabled","true"),this.submitEl.classList.add("btn--loading")}resetButtonLoading(){this.submitEl.removeAttribute("aria-disabled"),this.submitEl.classList.remove("btn--loading")}scrollToTop(target,offset=200){((selector,offset2)=>{window.scrollTo({behavior:"smooth",top:selector.getBoundingClientRect().top-document.body.getBoundingClientRect().top-offset2})})(target,offset)}updateButton(disable=!0,text,modifyClass=!0){const addButton=this.querySelector('[name="add"]');if(!addButton)return;const addButtonText=addButton.querySelector("span");disable?(addButton.setAttribute("disabled","disabled"),text&&(addButtonText.textContent=text)):(addButton.removeAttribute("disabled"),addButtonText.textContent=FoxTheme.variantStrings.addToCartShort)}updatePrice(variant){const classes={onSale:"f-price--on-sale",soldOut:"f-price--sold-out"},selectors={priceWrapper:".f-price",salePrice:".f-price-item--sale",compareAtPrice:[".f-price-item--regular"],unitPriceWrapper:".f-price__unit-wrapper"},moneyFormat=FoxTheme.settings.moneyFormat,{priceWrapper,salePrice,unitPriceWrapper,compareAtPrice}=FoxTheme.utils.queryDomNodes(selectors,this),unitPrice=unitPriceWrapper.querySelector(".f-price__unit"),{compare_at_price,price,unit_price_measurement}=variant;if(compare_at_price&&compare_at_price>price?priceWrapper.classList.add(classes.onSale):priceWrapper.classList.remove(classes.onSale),variant.available?priceWrapper.classList.remove(classes.soldOut):priceWrapper.classList.add(classes.soldOut),salePrice&&(salePrice.innerHTML=FoxTheme.Currency.formatMoney(price,moneyFormat)),compareAtPrice&&compareAtPrice.length&&compare_at_price>price?compareAtPrice.forEach(item=>item.innerHTML=`<s>${FoxTheme.Currency.formatMoney(compare_at_price,moneyFormat)}</s>`):compareAtPrice.forEach(item=>item.innerHTML=FoxTheme.Currency.formatMoney(price,moneyFormat)),unit_price_measurement&&unitPrice){unitPriceWrapper.classList.remove("hidden");const unitPriceContent=`<span>${FoxTheme.Currency.formatMoney(variant.unit_price,moneyFormat)}</span>/<span data-unit-price-base-unit>${this._getBaseUnit()}</span>`;unitPrice.innerHTML=unitPriceContent}else unitPriceWrapper.classList.add("hidden")}syncWithMainProductForm(){FoxTheme.pubsub.subscribe(FoxTheme.pubsub.PUB_SUB_EVENTS.variantChange,event=>{if(!(event.data.sectionId===this.mainProductInfo.dataset.section))return;const variant=event.data.variant;this.updatePrice(variant),this.updateButton(!0,"",!1),variant?this.updateButton(!variant.available,FoxTheme.variantStrings.soldOut):this.updateButton(!0,"",!0)})}}); 2//# sourceMappingURL=/cdn/shop/t/331/assets/sticky-atc-bar-minimalist.js.map?v=153790416039452713381790000731
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.