1if(!customElements.get("product-bundle-info")){class ProductBundleInfo extends HTMLElement{constructor(){super(),this.bundleItems=this.querySelectorAll(".bundle-item"),this.firstItems=this.querySelectorAll(".bundle-first"),this.handleItemClick=this.handleItemClick.bind(this),this.handleItemKeydown=this.handleItemKeydown.bind(this)}connectedCallback(){this.initEventListeners()}disconnectedCallback(){this.removeEventListeners()}initEventListeners(){this.firstItems.forEach(item=>{item.addEventListener("click",this.handleItemClick),item.addEventListener("keydown",this.handleItemKeydown)})}handleItemKeydown(e){(e.key==="Enter"||e.key==="NumpadEnter"||e.key===" ")&&(e.preventDefault(),this.handleItemClick(e))}removeEventListeners(){this.firstItems.forEach(item=>{item.removeEventListener("click",this.handleItemClick),item.removeEventListener("keydown",this.handleItemKeydown)})}getItemInfo(item){const itemPriceEl=item.querySelector(".bundle-on-sale"),itemPrice=itemPriceEl?Number(itemPriceEl.getAttribute("data-content")):0,comparePriceEl=item.querySelector(".bundle-compare-at"),comparePrice=comparePriceEl?Number(comparePriceEl.getAttribute("data-content")):itemPrice,id=item.getAttribute("data-id"),bundleType=item.getAttribute("data-bundle-type")||"",bundleIds=(item.getAttribute("data-bundle-ids")||"").split(",").map(id2=>id2.trim()).filter(Boolean),rawColor=item.getAttribute("data-color")||item.querySelector(".bundle-color")?.textContent?.trim()||"";return{itemPrice,comparePrice,id,color:bundleType==="bundle_discount"||rawColor==="Default Title"?"":rawColor||"",bundleType,bundleIds}}handleItemClick(e){const clickedItem=e.currentTarget,bundleItem=clickedItem.closest(".bundle-item");bundleItem&&(this.bundleItems.forEach((item,index)=>{if(item===bundleItem){if(item.classList.contains("active"))return;if(item.classList.add("active"),index==0)clickedItem.closest(".product-template-container").classList.remove("hide-multi-attributes");else{const container=clickedItem.closest(".product-template-container");container.classList.add("hide-multi-attributes"),container.querySelectorAll(".header-case-content .js-case__adjust[data-qty='-1']").forEach(btn=>{const input=btn.closest(".case-item-container")?.querySelector(".js-case-qty__num");let maxLoops=100;for(;input&&parseInt(input.value)>0&&maxLoops>0;)btn.click(),maxLoops--})}}else item.classList.remove("active")}),this.dispatchBundleInfoChange(this.getItemInfo(bundleItem)))}dispatchBundleInfoChange({itemPrice,comparePrice,id,color,bundleType,bundleIds}){this.dispatchEvent(new CustomEvent("bundle:InfoChange",{bubbles:!0,cancelable:!0,detail:{itemPrice,comparePrice,id,color,bundleType,bundleIds}}
1))}}customElements.define("product-bundle-info",ProductBundleInfo)} 2//# sourceMappingURL=/cdn/shop/t/361/assets/snippets-product-bundle-info.js.map?v=83041709490866835931782787801
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.