1import{ThemeEvents}from"@theme/events";class ProductPrice extends HTMLElement{connectedCallback(){const closestSection=this.closest(".shopify-section, dialog");closestSection&&closestSection.addEventListener(ThemeEvents.variantUpdate,this.updatePrice)}disconnectedCallback(){const closestSection=this.closest(".shopify-section, dialog");closestSection&&closestSection.removeEventListener(ThemeEvents.variantUpdate,this.updatePrice)}updatePrice=event=>{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 newProductPrice=event.detail.data.html.querySelector(`product-price[data-block-id="${this.dataset.blockId}"]`);if(!newProductPrice)return;const newPrice=newProductPrice.querySelector('[ref="priceContainer"]'),currentPrice=this.querySelector('[ref="priceContainer"]');newPrice&¤tPrice&¤tPrice.replaceWith(newPrice);const priceContainer=this.querySelector('[ref="priceContainer"]'),currentMsrp=this.querySelector(".msrp"),newMsrp=newProductPrice.querySelector(".msrp");newMsrp?currentMsrp?currentMsrp.replaceWith(newMsrp):priceContainer?.insertAdjacentElement("afterend",newMsrp.cloneNode(!0)):currentMsrp?.remove();const currentPromo=this.querySelector(".price-promo-messaging"),newPromo=newProductPrice.querySelector(".price-promo-messaging"),promoInsertAnchor=this.querySelector(".msrp")??priceContainer;newPromo?currentPromo?currentPromo.replaceWith(newPromo):promoInsertAnchor?.insertAdjacentElement("afterend",newPromo.cloneNode(!0)):currentPromo?.remove();const currentNote=this.querySelector(".volume-pricing-note"),newNote=newProductPrice.querySelector(".volume-pricing-note"),noteInsertAnchor=this.querySelector(".price-promo-messaging")??this.querySelector(".msrp")??priceContainer;newNote?currentNote?currentNote.replaceWith(newNote):noteInsertAnchor?.insertAdjacentElement("afterend",newNote.cloneNode(!0)):currentNote?.remove()}}customElements.get("product-price")||customElements.define("product-price",ProductPrice); 2//# sourceMappingURL=/cdn/shop/t/348/assets/product-price.js.map?v=179403154504484413751789843621
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.