https://www.kasaustralia.com/cdn/shop/t/1183/assets/wishlist-cart-…?v=166397737869224955091774258324
1(function(){"use strict";document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initWishlistCartIntegration):initWishlistCartIntegration();function initWishlistCartIntegration(){document.addEventListener("click",handleWishlistAddToCart,!0),interceptCartAddRequests()}function handleWishlistAddToCart(event){if(!event.target.closest('.wishlists-drawer__inner, .atw-drawer_inner, .atw-drawer__inner, wishlists-drawer, [class*="wishlist-drawer"]'))return;const addToCartBtn=event.target.closest('button.fish-wishlist-button--primary, .fish-wishlist-button--primary, button[class*="add-to-cart"], [class*="atc-button"]'),buttonText=event.target.closest("button")?.textContent?.toLowerCase()||"",isAddToCartText=buttonText.includes("add to cart")||buttonText.includes("add to");(addToCartBtn||isAddToCartText)&&setTimeout(()=>{refreshCartDrawer()},600)}function interceptCartAddRequests(){const originalFetch=window.fetch;let wishlistAddInProgress=!1;new MutationObserver(()=>{wishlistAddInProgress=!!document.querySelector('.wishlists-drawer__inner:not([style*="display: none"]), .atw-drawer_inner:not([style*="display: none"]), .atw-drawer__inner:not([style*="display: none"]), wishlists-drawer:not([hidden])')}).observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","hidden","class"]}),window.fetch=function(...args){const url=args[0];if(typeof url=="string"&&(url.includes("/cart/add.js")||url.includes("/cart/add"))){const wasFromWishlist=wishlistAddInProgress,fetchPromise=originalFetch.apply(this,args);return wasFromWishlist&&fetchPromise.then(response=>(response.ok&&setTimeout(()=>{refreshCartDrawer()},400),response)).catch(error=>(console.error("[Wishlist Cart Integration] Error adding to cart:",error),Promise.reject(error))),fetchPromise}return originalFetch.apply(this,args)}}function refreshCartDrawer(){const cartAddedEvent=new CustomEvent("theme:cart:added",{bubbles:!0,cancelable:!0});document.dispatchEvent(cartAddedEvent);const cartUpdatedEvent=new CustomEvent("cart:updated",{bubbles:!0,cancelable:!0});document.dispatchEvent(cartUpdatedEvent);const cartElement=document.querySelector("cart-element[data-cart-drawer], [data-cart-drawer]");cartElement&&typeof cartElement.getCart=="function"?cartElement.getCart():fetchCartAndUpdate()}function fetchCartAndUpdate(){const cartUrl=`${window.Shopify?.routes?.root||"/"}cart.js`;fetch(cartUrl,{headers:{Accept:"application/json","Content-Type":"application/json"}}).then(response=>response.json()).then(cart=>{const cartUpdateEvent=new CustomEvent("theme:cart:update",{bubbles:!0,detail:{cart}});document.dispatchEvent(cartUpdateEvent);const cartElement=document.querySelector("cart-element, [data-cart-drawer]");cartElement&&typeof cartElement.getCart=="function"&&cartElement.getCart()}).catch(error=>{console.error("[Wishlist Cart Integration] Error fetching cart:",error)})}})(); 2//# sourceMappingURL=/cdn/shop/t/1183/assets/wishlist-cart-integration.js.map?v=166397737869224955091774258324
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.