1import{ThemeEvents}from"@theme/events";class ProductPrice extends HTMLElement{connectedCallback(){this.closestSection=this.closest(".accessory-product, .shopify-section, dialog"),this.closestSection&&this.closestSection.addEventListener(ThemeEvents.variantUpdate,this.updatePrice)}disconnectedCallback(){this.closestSection&&this.closestSection.removeEventListener(ThemeEvents.variantUpdate,this.updatePrice)}updatePrice=event=>{const source=event.detail.data.html,productId=event.detail.data.productId;if(event.detail.data.newProduct)this.dataset.productId=event.detail.data.newProduct.id;else if(event.target instanceof HTMLElement&&event.target.dataset.productId!==this.dataset.productId)return;const newPrice=source.querySelector(`product-price[data-product-id="${productId}"]`)?.innerHTML;let currentPrice=this.innerHTML;if(!newPrice||!currentPrice)return;currentPrice!==newPrice&&(this.innerHTML=newPrice);const newSaveAmount=event.detail.data.html.querySelector("product-price .save-amount-wrapper"),currentSaveAmount=this.querySelector(".save-amount-wrapper");newSaveAmount?currentSaveAmount?currentSaveAmount.innerHTML!==newSaveAmount.innerHTML&¤tSaveAmount.replaceWith(newSaveAmount):this.appendChild(newSaveAmount):currentSaveAmount&¤tSaveAmount.remove()}}customElements.get("product-price")||customElements.define("product-price",ProductPrice); 2//# sourceMappingURL=/cdn/shop/t/2/assets/product-price.js.map?v=3329802236249623641771602362
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.