{
  "version": 3,
  "sources": ["/cdn/shop/t/97/assets/custom.js?enable_js_minification=1"],
  "sourcesContent": ["/*\n* Pipeline Theme\n*\n* Use this file to add custom Javascript to Pipeline.  Keeping your custom\n* Javascript in this fill will make it easier to update Pipeline. In order\n* to use this file you will need to open layout/theme.liquid and uncomment\n* the custom.js script import line near the bottom of the file.\n*\n*/\n\n\n(function() {\n\n  // Below are example event listeners.  They listen for theme events that Pipeline\n  // fires in order to make it easier for you to add customizations.\n\n  // Keep your scripts inside this IIFE function call to avoid leaking your\n  // variables into the global scope.\n\n\n  document.addEventListener('theme:variant:change', function(event) {\n    // You might use something like this to write a pre-order feature or a\n    // custom swatch feature.\n    return;\n    var variant = event.detail.variant;\n    var container = event.target;\n    if (variant) {\n      console.log('Container \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 \u2193');\n      console.log(container);\n      console.log('Variant \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 \u2193');\n      console.log(variant);\n      // ... update some element on the page\n    }\n  });\n\n  document.addEventListener('theme:cart:change', function(event) {\n    var cart = event.detail.cart;\n    if (cart) {\n      // console.log('Cart \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 \u2193');\n      // console.log(cart);\n      // ... update an app or a custom shipping caluclator\n      //document.dispatchEvent(new CustomEvent(\"zapiet:start\"));\n    } else {\n      console.warn('theme:cart:change fired withotu cart object.  This is probably a bug.');\n    }\n  });\n  // Fired when page loads to update header values\n  document.addEventListener('theme:cart:init', (e) => {\n    return;\n    console.log('theme:cart:init');\n    console.log(e);\n  });\n\n  // Debounced scroll listeners.  Up and down only fire on direction changes\n  // These events are useful for creating sticky elements and popups.\n  /*document.addEventListener('theme:scroll', e => { console.log(e); });\n  document.addEventListener('theme:scroll:up', e => { console.log(e); });\n  document.addEventListener('theme:scroll:down', e => { console.log(e); });*/\n\n  // Debounced resize listener to bundle changes that trigger document reflow\n  document.addEventListener('theme:resize', e => {\n    return;\n    console.log(e);\n  });\n\n  // Locks and unlocks page scroll for modals and drawers\n  // These are commented out because firing them will lock the page scroll\n  // the lock event must set `detail` to the modal or drawer body so the\n  // scroll locking code knows what element should maintain scoll.\n  // document.dispatchEvent(new CustomEvent('theme:scroll:lock', {bubbles: true, detail: scrollableInnerElement}));\n  // document.dispatchEvent(new CustomEvent('theme:scroll:unlock', {bubbles: true}));\n\n\n  /* Customization to enlarge CO2 exchange refills on variant change */\n  const co2_refill_template = document.querySelector('.temaplte__co2');\n  if ( co2_refill_template ) {\n    function setActiveLabelContainers() {\n      $('.radio__fieldset .radio__button input:checked ~ label').each(function(){\n        $(this).closest('.radio__button').addClass('active');\n      });\n    }\n    $(document).ready(function() {\n      const $button_containers = $('.form__selectors .radio__button');\n      $button_containers.each(function(){\n        const $label_container = $(this);\n        $label_container.get(0).style.setProperty(\"--base-width\", $label_container.outerWidth());\n        $label_container.get(0).style.setProperty(\"--base-height\", $label_container.outerHeight());\n\n        const $label = $label_container.find('label');\n        $label.get(0).style.setProperty(\"--base-width\", $label.outerWidth());\n        $label.get(0).style.setProperty(\"--base-height\", $label.outerHeight());\n      });\n\n      setActiveLabelContainers();\n      document.addEventListener('theme:variant:change', function() {\n        $button_containers.removeClass('active');\n        setActiveLabelContainers();\n      });\n    });\n  }\n\n  /* jQueryUI Tooltips for desktop header icons */\n  $(function(){\n    $('.header__desktop__buttons').tooltip({\n      position: { my: \"center center\", at: \"center bottom\" }\n    });\n  });\n\n  /* Duplicate scroll to anchor target to fix scrolling on desktop for https://sodastream.sg/pages/contact#contact-us */\n  window.addEventListener('load', function(e) {\n    setTimeout(function() {\n      if(window.location.hash.length > 0) {\n        const anchor = document.querySelector(window.location.hash);\n        if (anchor) {\n          anchor.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start'});\n        }\n      }\n    }, 0);\n  });\n\n  /* Header v2 Cart Counter Integration */\n  // Update cart counter on cart change\n  document.addEventListener('theme:cart:change', function(event) {\n    var cart = event.detail.cart;\n    if (cart) {\n      updateHeaderV2CartCounter(cart);\n    }\n  });\n\n  // Update on page load\n  document.addEventListener('theme:cart:init', function() {\n    fetch('/cart.js')\n      .then(function(response) { return response.json(); })\n      .then(function(cart) {\n        updateHeaderV2CartCounter(cart);\n      })\n      .catch(function(error) {\n        console.error('Failed to fetch cart for header-v2:', error);\n      });\n  });\n\n  function updateHeaderV2CartCounter(cart) {\n    var counters = document.querySelectorAll('.v2-cart-counter');\n    counters.forEach(function(counter) {\n      if (cart.item_count > 0) {\n        counter.textContent = cart.item_count;\n        counter.style.display = 'flex';\n      } else {\n        counter.style.display = 'none';\n      }\n    });\n  }\n\n  // ^^ Keep your scripts inside this IIFE function call to avoid leaking your\n  // variables into the global scope.\n})();\n"],
  "mappings": "CAWC,UAAW,CAgEV,GAvDA,SAAS,iBAAiB,uBAAwB,SAAS,MAAO,CAGhE,OACA,IAAI,QACA,SAQN,CAAC,EAED,SAAS,iBAAiB,oBAAqB,SAAS,MAAO,CAC7D,IAAI,KAAO,MAAM,OAAO,KACpB,MAMF,QAAQ,KAAK,uEAAuE,CAExF,CAAC,EAED,SAAS,iBAAiB,kBAAoB,GAAM,CAIpD,CAAC,EASD,SAAS,iBAAiB,eAAgB,GAAK,CAG/C,CAAC,EAW2B,SAAS,cAAc,gBAAgB,EACxC,CACzB,IAASA,0BAAT,UAAoC,CAClC,EAAE,uDAAuD,EAAE,KAAK,UAAU,CACxE,EAAE,IAAI,EAAE,QAAQ,gBAAgB,EAAE,SAAS,QAAQ,CACrD,CAAC,CACH,EAJS,6BAAAA,0BAKT,EAAE,QAAQ,EAAE,MAAM,UAAW,CAC3B,MAAM,mBAAqB,EAAE,iCAAiC,EAC9D,mBAAmB,KAAK,UAAU,CAChC,MAAM,iBAAmB,EAAE,IAAI,EAC/B,iBAAiB,IAAI,CAAC,EAAE,MAAM,YAAY,eAAgB,iBAAiB,WAAW,CAAC,EACvF,iBAAiB,IAAI,CAAC,EAAE,MAAM,YAAY,gBAAiB,iBAAiB,Y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