{
  "version": 3,
  "sources": ["/cdn/shop/t/180/assets/discount-form.js?validator_fix=20260715T0901"],
  "sourcesContent": ["document.addEventListener(\"DOMContentLoaded\", async function () {\n  var store_currency = $('body').attr('data-currency');\n  var market = $('body').attr('data-market');\n  // checkDiscountOnLoad();\n\n  $(document).one('click', '.cart-button-2', function () {\n    checkDiscountOnLoad();\n  });\n\n  const discountForm = document.getElementById(\"apply_discount\");\n  const discountInput = document.getElementById(\"discount-code\");\n  const discountMessage = document.getElementById(\"discount-message\");\n\n  \n  $(document).on('click','.cart_discount_add',function(){\n      $(this).addClass('hide');\n      var height_body = $('.discount_input_grid').height();\n      // $(this).addClass('hide');\n      $('.cart_discount_cancel').show();\n      $('.discount_inputs_body').css('height',height_body+25+\"px\");\n      $('.discount_inputs_body').addClass('active_input');\n      discountMessage.textContent = \"\";\n  })\n  $(document).on('click','.cart_discount_cancel', function(){\n      $(this).hide();\n      $('.cart_discount_add').removeClass('hide');\n      $('.discount_inputs_body').css('height', 0);\n      $('.discount_inputs_body').removeClass('active_input');\n      discountMessage.textContent = \"\";\n  })\n\n\n  /****************** Cart Recommendations ******************/\n  /* async function loadRecommendations(cart) {\n    const productId = cart.items[0]?.product_id;\n\n    if (!productId) {\n      return;\n    }\n\n    const response = await fetch(\n      `${window.Shopify.routes.root}recommendations/products.json?product_id=${productId}&limit=4&intent=related`\n    );\n\n    if (!response.ok) {\n      throw new Error(`Recommendations request failed: ${response.status}`);\n    }\n\n    const recommendations = await response.json();\n\n    renderRecommendations(recommendations.products);\n  } */\n\n  async function loadRecommendations(cart) {\n    const cartProductIds = new Set(\n      cart.items.map(item => Number(item.product_id))\n    );\n\n    let productHandles = [];\n   \n     if (market === 'uk') {\n      const hasSnuggleProduct =\n        cartProductIds.has(10297322864931) ||\n        cartProductIds.has(10297828573475);\n\n      const hasModularProduct = cartProductIds.has(10290461966627);\n\n      if (hasSnuggleProduct && hasModularProduct) {\n        // Both product families are in the cart: recommend both pads.\n        productHandles = [\n          'cushie-snuggle-sleeper-sofa-bed-airflow-pad-uk',\n          'cushie-modular-sleeper-sofa-airflow-pad-uk'\n        ];\n      } else if (hasModularProduct) {\n        productHandles = [\n          'cushie-modular-sleeper-sofa-airflow-pad-uk'\n        ];\n      } else if (hasSnuggleProduct) {\n        productHandles = [\n          'cushie-snuggle-sleeper-sofa-bed-airflow-pad-uk'\n        ];\n      } else {\n        // No matching UK product: show both pad families.\n        productHandles = [\n          'cushie-snuggle-sleeper-sofa-bed-airflow-pad-uk',\n          'cushie-modular-sleeper-sofa-airflow-pad-uk'\n        ];\n      }\n\n    } else if (market === 'us') {\n      if (\n        cartProductIds.has(10000042393891) ||\n        cartProductIds.has(10241004896547)\n      ) {\n        productHandles = [\n          'cushie-snuggle-sleeper-sofa-bed-airflow-pad',\n          'cushie-ottoman-sleeper',\n          'cushie-storage-ottoman',\n          'cushie-sleeper-chaise-bed'\n        ];\n      } else if (cartProductIds.has(9891748118819)) {\n        productHandles = [\n          'cushie-modular-sleeper-sofa-airflow-pad',\n          'cushie-ottoman-sleeper',\n          'cushie-storage-ottoman',\n          'cushie-sleeper-chaise-bed'\n        ];\n      } else {\n        productHandles = [\n          'cushie-snuggle-sleeper-sofa-bed-airflow-pad',\n          'cushie-modular-sleeper-sofa-airflow-pad',\n          'cushie-ottoman-sleeper',\n          'cushie-storage-ottoman',\n          'cushie-sleeper-chaise-bed'\n        ];\n      }\n\n    } else if (market === 'canada') {\n      if (\n        cartProductIds.has(10000042393891) ||\n        cartProductIds.has(10241004896547)\n      ) {\n        productHandles = [\n          'cushie-snuggle-sleeper-sofa-bed-airflow-pad',\n          'cushie-storage-ottoman',\n          'cushie-sleeper-chaise-bed'\n        ];\n      } else if (cartProductIds.has(9891748118819)) {\n        productHandles = [\n          'cushie-modular-sleeper-sofa-airflow-pad',\n          'cushie-storage-ottoman',\n          'cushie-sleeper-chaise-bed'\n        ];\n      } else {\n        productHandles = [\n          'cushie-snuggle-sleeper-sofa-bed-airflow-pad',\n          'cushie-modular-sleeper-sofa-airflow-pad',\n          'cushie-storage-ottoman',\n          'cushie-sleeper-chaise-bed'\n        ];\n      }\n\n    } else {\n      productHandles = [\n        'cushie-snuggle-sleeper-sofa-bed-airflow-pad',\n        'cushie-modular-sleeper-sofa-airflow-pad',\n        'cushie-ottoman-sleeper',\n        'cushie-storage-ottoman',\n        'cushie-sleeper-chaise-bed'\n      ];\n    }\n\n\n    try {\n      const results = await Promise.all(\n        productHandles.map(async (handle) => {\n          const response = await fetch(\n            `${window.Shopify.routes.root}products/${handle}.js`\n          );\n\n          if (!response.ok) {\n            console.error(`Failed to load product: ${handle}`, response.status);\n            return null;\n          }\n\n          return response.json();\n        })\n      );\n\n      const recommendations = results\n        .filter(Boolean)\n        .filter(product => !cartProductIds.has(Number(product.id)));\n\n      renderRecommendations(recommendations);\n    } catch (error) {\n      console.error('Error loading fixed recommendations:', error);\n      renderRecommendations([]);\n    }\n  }\n\n\n  function renderRecommendations(products) {\n\n    const recommendationsWrap = document.querySelector(\n      \".recommendations-wrapper\"\n    );\n\n    if (!recommendationsWrap) {\n      return;\n    }\n\n    recommendationsWrap.innerHTML = \"\";\n\n    let count = 0;\n\n    products.forEach((product) => {\n\n      // Don't show the configured upsell product.\n      // Replace this ID if you have the ID available in JS.\n      const upsellProductId = null;\n\n      if (upsellProductId && product.id == upsellProductId) {\n        return;\n      }\n\n      if (count >= 6) {\n        return;\n      }\n\n      count++;\n\n      const variant = product.variants?.[0];\n\n      if (!variant) {\n        return;\n      }\n\n      const productUrl = `/products/${product.handle}`;\n      const imageUrl = product.featured_image\n        ? `${product.featured_image}&width=200`\n        : \"\";\n\n      /* const price = Shopify.formatMoney(\n        product.price,\n        window.Shopify.money_format\n      );\n\n      const compareAtPrice =\n        product.compare_at_price &&\n        product.compare_at_price > product.price\n          ? Shopify.formatMoney(\n              product.compare_at_price,\n              window.Shopify.money_format\n            )\n          : \"\"; */\n\n      function formatPrice(priceInCents) {\n        return `${store_currency}${(priceInCents / 100).toLocaleString(\n          document.documentElement.lang || 'en-GB',\n          {\n            minimumFractionDigits: 2,\n            maximumFractionDigits: 2\n          }\n        )}`;\n      }\n\n      let price = '';\n      let compareAtPrice = '';\n\n      if ($('.recommendatiations-hidden-wrapper').length > 0) {\n        const currentWrapper = $(\n          '.recommendatiations-hidden-wrapper .recommendations-hidden-container[data-pid=\"' +\n            product.id +\n            '\"]'\n        );\n\n        if (currentWrapper.length > 0) {\n          const sprice = Number(currentWrapper.find('.recommendations-hidden-item').attr('data-price'));\n          const cprice = Number(currentWrapper.find('.recommendations-hidden-item').attr('data-comp-price'));\n\n          price = formatPrice(sprice);\n\n          compareAtPrice =\n            Number.isFinite(cprice) && cprice > sprice\n              ? formatPrice(cprice)\n              : '';\n        }\n      } else {\n        price = formatPrice(product.price);\n\n        compareAtPrice =\n          product.compare_at_price > product.price\n            ? formatPrice(product.compare_at_price)\n            : '';\n      }\n\n      const hasMultipleVariants =\n        product.variants && product.variants.length > 1;\n\n\n      const optionsHtml = (product.options || [])\n      .map((option, index) => {\n        const optionName =\n          typeof option === \"string\" ? option : option.name;\n\n        const optionValues = [\n          ...new Set(\n            (product.variants || [])\n              .map((variant) => variant.options?.[index])\n              .filter(Boolean)\n          ),\n        ];\n\n        if (!optionName || optionValues.length === 0) {\n          return \"\";\n        }\n\n        return `\n          <div class=\"rec-popup-group\" data-index=\"${index}\">\n            <label>${escapeHtml(optionName)}</label>\n            <select\n              name=\"options[${escapeHtml(optionName)}]\"\n              data-option-index=\"${index}\"\n            >\n              ${optionValues\n                .map(\n                (value) => `\n                  <option value=\"${escapeHtml(value)}\">${escapeHtml(value)}</option>`\n                )\n                .join(\"\")}\n            </select>\n          </div>\n        `;\n      })\n      .join(\"\");\n\n      const productHtml = `\n        <div class=\"cart-recommend-product\">\n          <div class=\"rec-content-wrapper\">\n            <a href=\"${productUrl}\" class=\"rec-img-block\">\n              ${\n                imageUrl\n                  ? `\n                    <img\n                      src=\"${imageUrl}\"\n                      alt=\"${escapeHtml(product.title)}\"\n                      width=\"200\"\n                      loading=\"lazy\"\n                    >\n                  `\n                  : \"\"\n              }\n            </a>\n\n            <div class=\"rec-info-block\">\n\n              <a href=\"${productUrl}\" class=\"rec-prd-title\">\n                ${escapeHtml(product.title)}\n              </a>\n\n              <div class=\"price\">\n                ${\n                  compareAtPrice\n                    ? `<s>${compareAtPrice}</s>`\n                    : \"\"\n                }\n\n                <span>${price}</span>\n              </div>\n\n            </div>\n          </div>\n\n          ${\n            hasMultipleVariants\n              ? `\n                <button\n                  type=\"button\"\n                  class=\"cart-recommend-product-atc has-popup\"\n                  data-product-id=\"${product.id}\"\n                >\n                  Choose Options\n                </button>\n\n                <div class=\"recommend-product-options\" style=\"display:none;\">\n                  <div class=\"rec-popup-head\">\n                    <img class=\"recPopupImg\" src=\"${imageUrl}\"\n                      alt=\"${escapeHtml(product.title)}\">\n                    <span class=\"rec-popup-title recPopupTitle\"> ${escapeHtml(product.title)}</span>\n                    <div class=\"rec-popup-price\">\n                    ${\n                      compareAtPrice\n                        ? `<span class=\"rec-popup-compare\"><s>${compareAtPrice}</s></span>`\n                        : \"\"\n                    }\n                    <span class=\"rec-popup-now recPopupPrice\">${price}</span>\n                    </div>\n                  </div>\n\n                  <div class=\"recOptions\">${optionsHtml}</div>\n                  \n                  <div class=\"rec-popup-footer\">\n                    <div class=\"rec-popup-qty\">\n                      <button type=\"button\" class=\"recQtyMinus\">&minus;</button>\n                      <span class=\"recQtyVal\" data-qty=\"1\">1</span>\n                      <button type=\"button\" class=\"recQtyPlus\">+</button>\n                    </div>\n                    <button type=\"button\" class=\"rec-popup-atc\">Add To Cart</button>\n                  </div>\n                </div>\n\n              `\n              : `\n                <product-form class=\"product-form\">\n\n                  <div\n                    class=\"product-form__error-message-wrapper\"\n                    role=\"alert\"\n                    hidden\n                  >\n                    <span class=\"product-form__error-message\"></span>\n                  </div>\n\n                  <form\n                    method=\"post\"\n                    action=\"${window.Shopify.routes.root}cart/add\"\n                    accept-charset=\"UTF-8\"\n                    class=\"form\"\n                    data-type=\"add-to-cart-form\"\n                  >\n\n                    <input\n                      type=\"hidden\"\n                      name=\"id\"\n                      value=\"${variant.id}\"\n                    >\n\n                    <div class=\"product-form__buttons\">\n\n                      <button\n                        type=\"submit\"\n                        name=\"add\"\n                        class=\"product-form__submit button button--full-width cart-drawer-product-atc\"\n                        ${\n                          variant.available\n                            ? \"\"\n                            : \"disabled\"\n                        }\n                      >\n\n                        <span>\n                          ${\n                            variant.available\n                              ? \"Add to cart\"\n                              : \"Sold out\"\n                          }\n                        </span>\n\n                      </button>\n\n                    </div>\n\n                  </form>\n\n                </product-form>\n              `\n          }\n\n        </div>\n      `;\n\n      recommendationsWrap.insertAdjacentHTML(\n        \"beforeend\",\n        productHtml\n      );\n    });\n  }\n\n\n\n  function escapeHtml(value) {\n    const div = document.createElement(\"div\");\n    div.textContent = value || \"\";\n    return div.innerHTML;\n  }\n\n  async function fetchCartRecommendations() {\n    try {\n      const cartResponse = await fetch(\n        `${window.Shopify.routes.root}cart.js`\n      );\n\n      const cart = await cartResponse.json();\n\n      await loadRecommendations(cart);\n\n    } catch (error) {\n      console.error(\n        \"Failed to fetch cart recommendations:\",\n        error\n      );\n    }\n  }\n\n\n  /* document.addEventListener('click', function (event) {\n    const plusButton = event.target.closest('.recQtyPlus');\n    const minusButton = event.target.closest('.recQtyMinus');\n\n    if (!plusButton && !minusButton) return;\n\n    const button = plusButton || minusButton;\n    const qtyContainer = button.closest('.rec-popup-qty');\n\n    if (!qtyContainer) return;\n\n    const qtyVal = qtyContainer.querySelector('.recQtyVal');\n\n    if (!qtyVal) return;\n\n    let currentQty = parseInt(qtyVal.dataset.qty, 10) || 1;\n\n    if (plusButton) {\n      currentQty++;\n    } else {\n      currentQty = Math.max(1, currentQty - 1);\n    }\n\n    qtyVal.dataset.qty = currentQty;\n    qtyVal.textContent = currentQty;\n  });\n\n\n\n  document.addEventListener('click', async function (event) {\n    const addToCartButton = event.target.closest(\n      '#recPopupOverlay .rec-popup-atc'\n    );\n\n    if (!addToCartButton) return;\n\n    event.preventDefault();\n\n    const popupBody = addToCartButton.closest('.rec-atc-popup-body');\n    if (!popupBody) {\n      console.error('Popup body not found');\n      return;\n    }\n\n    // Get quantity from this product's popup\n    const qtyElement = popupBody.querySelector('.recQtyVal');\n    const qty = Math.max(1, parseInt(qtyElement?.dataset.qty, 10) || 1);\n\n    // Get selected product options\n    const optionGroups = popupBody.querySelectorAll('.rec-popup-group select');\n    const selectedOptions = Array.from(optionGroups).map(\n      select => select.value\n    );\n\n    // Match the selected options to a variant\n    const selectedVariant = selectedOptions.join(' / ');\n\n    const variantElement = Array.from(\n      popupBody.querySelectorAll('.rec-product-variant')\n    ).find(variant => variant.dataset.vtitle === selectedVariant);\n\n    const variantId = variantElement?.dataset.vid;\n\n    if (!variantId) {\n      alert('Please select a valid product option.');\n      console.error('Variant not found:', selectedVariant);\n      return;\n    }\n\n    // Prevent duplicate clicks while adding to cart\n    if (addToCartButton.disabled) return;\n\n    addToCartButton.disabled = true;\n    const originalText = addToCartButton.textContent;\n    addToCartButton.textContent = 'Adding...';\n\n    try {\n      const response = await fetch(\n        `${window.Shopify?.routes?.root || '/'}cart/add.js`,\n        {\n          method: 'POST',\n          headers: {\n            'Content-Type': 'application/json',\n            'Accept': 'application/json'\n          },\n          body: JSON.stringify({\n            items: [\n              {\n                id: Number(variantId),\n                quantity: qty\n              }\n            ]\n          })\n        }\n      );\n\n      const result = await response.json();\n\n      if (!response.ok) {\n        throw new Error(result.description || result.message || 'Unable to add product to cart.');\n      }\n\n      console.log('Product added to cart:', result);\n\n      addToCartButton.textContent = 'Added!';\n\n      await updateCart();\n\n    } catch (error) {\n      console.error('Add to cart error:', error);\n      alert(error.message || 'Unable to add product to cart.');\n      addToCartButton.textContent = originalText;\n    } finally {\n      addToCartButton.disabled = false;\n\n      if (addToCartButton.textContent === 'Adding...') {\n        addToCartButton.textContent = originalText;\n      }\n    }\n  });\n\n\n  document.addEventListener('click', async function (event) {\n    const addToCartButton = event.target.closest(\n      '.cart-drawer-recommendations button.product-form__submit.cart-drawer-product-atc'\n    );\n\n    if (!addToCartButton) return;\n\n    event.preventDefault();\n\n    // Prevent duplicate clicks\n    if (addToCartButton.disabled) return;\n\n    const productForm = addToCartButton.closest('.product-form');\n    const variantId = productForm?.querySelector('input[name=\"id\"]')?.value;\n    const qty = 1;\n\n    if (!variantId) {\n      alert('Product is unavailable');\n      return;\n    }\n\n    addToCartButton.disabled = true;\n    const originalText = addToCartButton.textContent.trim();\n    addToCartButton.textContent = 'Adding...';\n\n    try {\n      const response = await fetch(\n        `${window.Shopify?.routes?.root || '/'}cart/add.js`,\n        {\n          method: 'POST',\n          headers: {\n            'Content-Type': 'application/json',\n            'Accept': 'application/json'\n          },\n          body: JSON.stringify({\n            items: [\n              {\n                id: Number(variantId),\n                quantity: qty\n              }\n            ]\n          })\n        }\n      );\n\n      const result = await response.json();\n\n      if (!response.ok) {\n        throw new Error(\n          result.description ||\n          result.message ||\n          'Unable to add product to cart.'\n        );\n      }\n\n      console.log('Product added to cart:', result);\n\n      addToCartButton.textContent = 'Added!';\n\n      if (typeof updateCart === 'function') {\n        await updateCart();\n      }\n\n    } catch (error) {\n      console.error('Add to cart error:', error);\n\n      alert(error.message || 'Unable to add product to cart.');\n      addToCartButton.textContent = originalText;\n\n    } finally {\n      addToCartButton.disabled = false;\n\n      if (addToCartButton.textContent === 'Adding...') {\n        addToCartButton.textContent = originalText;\n      }\n    }\n  }); */\n\n\n/********** End Cart Recommendations ************/\n  \n  \n  // Function to check discount and update cart on page load\n  async function checkDiscountOnLoad() {\n    try {\n      // Use cache: \"no-store\" only if necessary, default is fine for most cases\n      const response = await fetch(\"/cart.js\");\n      const cart = await response.json();\n  \n      if (cart.cart_level_discount_applications?.length > 0) {\n        const appliedDiscount = cart.cart_level_discount_applications[0].title;\n  \n        discountInput.value = appliedDiscount;\n        discountMessage.textContent = `Discount applied: ${appliedDiscount}`;\n        discountMessage.style.color = \"green\";\n        $('.discount_code').removeClass('hide');\n      }\n  \n      updateCart(cart); // Avoid doing unnecessary DOM or network work in this function\n    } catch (error) {\n      console.error(\"Error fetching cart data:\", error);\n    }\n  }\n\n\n  async function removeDiscountAjax(discountToRemove) {\n    try {\n\n      let loader = document.querySelector(\".cart-total-loader\");\n      let cartItemsParent = $('.w-commerce-commercecartformwrapper.cart_drawer_items_wrapper');\n\n      if(loader){\n        cartItemsParent.addClass('show-loader');\n        loader.classList.remove(\"hide\");\n      }\n\n      // 1) Get current cart\n      const res = await fetch('/cart.js');\n      const cart = await res.json();\n\n      // 2) Collect discount codes (only manual/discount_code type)\n      const codes = [];\n\n      if (Array.isArray(cart.cart_level_discount_applications)) {\n        for (const app of cart.cart_level_discount_applications) {\n          if (app?.type === 'discount_code' && app.title) codes.push(app.title);\n        }\n      }\n\n      for (const item of cart.items || []) {\n        for (const alloc of item.line_level_discount_allocations || []) {\n          const dapp = alloc.discount_application;\n          if (dapp?.type === 'discount_code' && dapp.title) codes.push(dapp.title);\n        }\n      }\n\n      // 3) Deduplicate and remove requested code\n      const uniqueCodes = [...new Set(codes.map(c => c.trim()))];\n      const remaining = uniqueCodes.filter(\n        c => c.toLowerCase() !== discountToRemove.toLowerCase()\n      );\n\n      // 4) Clear existing discounts\n      await fetch('/cart/update.js', {\n        method: 'POST',\n        headers: { 'Content-Type': 'application/json' },\n        body: JSON.stringify({ discount: '' })\n      });\n\n      // 5) Reapply remaining (if any)\n      if (remaining.length > 0) {\n        const discountCodes = remaining.map(c => encodeURIComponent(c)).join(',');\n        await fetch('/discount/' + discountCodes, {\n          method: 'GET',\n          credentials: 'same-origin',\n          redirect: 'follow'\n        });\n      }\n\n      const res1 = await fetch(\"/?section_id=cart-drawer-pdp\");\n      const text1 = await res1.text();\n      const html1 = document.createElement(\"div\");\n      html1.innerHTML = text1;\n      const newBox1 = html1.querySelector(\".cart-wrapper\").innerHTML;\n      document.querySelector(\".cart-wrapper\").innerHTML = newBox1;\n\n      /* updateCart(cart); // your existing UI update function\n      discountMessage.textContent = \"\";\n      discountInput.value = \"\"; */\n\n      if(loader){\n        cartItemsParent.removeClass('show-loader');\n        loader.classList.add(\"hide\");\n      }\n\n    } catch (err) {\n      console.error('Error removing discount:', err);\n      throw err;\n    }\n  }\n\n\n  $(document).on('click', '.add-to-cart-button', function () {\n    const $button = $(this); // store reference to 'this' button\n    const loading_text = $button.attr('data-loading-text');\n    const original_text = $button.attr('data-val');\n  \n    if (loading_text && loading_text !== 'undefined') {\n      $button.val(loading_text);\n    }\n\n    // checkDiscountOnLoad();\n  \n    setTimeout(function () {\n      if (original_text && original_text !== 'undefined') {\n        console.log(original_text);\n        $button.val(original_text); // use stored reference\n      }\n    }, 1000);\n  \n  });\n\n\n  $(document).on('click', '.apply_discount', async function (e) { \n    e.preventDefault(); \n\n    const discountRequirements = {\n      CSH100US: {\n        market: \"us\",\n        amount: 100,\n        currency: store_currency,\n        threshold: 750\n      },\n      CSH100CA: {\n        market: \"canada\",\n        amount: 100,\n        currency: store_currency,\n        threshold: 750\n      },\n      CSH60UK: {\n        market: \"uk\",\n        amount: 60,\n        currency: store_currency,\n        threshold: 500\n      }\n    };\n\n    const currentMarket = $('body').attr('data-market');\n\n    let discountvalue = document.getElementById(\"discount-code\").value.trim();\n    const inputCode = discountvalue.toLowerCase();\n    let  discountMessage = document.getElementById(\"discount-message\");\n    let loader = document.querySelector(\".cart-total-loader\");\n    let cartItemsParent = $('.w-commerce-commercecartformwrapper.cart_drawer_items_wrapper');\n\n    // const dibHeight = $('.discount_inputs_body').height();\n\n    if (discountvalue === \"\") {\n      discountMessage.textContent = \"Please enter a discount code.\";\n      discountMessage.style.color = \"red\";\n      if ($(window).width() <= 480) {\n        $('.discount_inputs_body').css('height','74px');\n      }\n      return;\n    }\n      \n    if(loader){\n      cartItemsParent.addClass('show-loader');\n      loader.classList.remove(\"hide\");\n    }\n  \n    try {\n\n      let applied_discounts = []; \n\n      $('.discountCodes .discountRow').each(function() {\n        let code = $(this).find('.discount_code-new').text().trim(); \n        if (code) { \n          code = code.toLowerCase(); \n          if (!applied_discounts.includes(code)) {\n            applied_discounts.push(code); \n          } \n        } \n      });\n\n      let appliedDiscounts = applied_discounts;\n\n      if (appliedDiscounts.includes(discountvalue.toLowerCase())) {\n        discountMessage.textContent = \"Already applied!\";\n        discountMessage.style.color = \"orange\";\n        // updateCart(cart);\n        if ($(window).width() <= 480) {\n          $('.discount_inputs_body').css('height','74px');\n        }\n        if(loader){\n          cartItemsParent.removeClass('show-loader');\n          loader.classList.add(\"hide\");\n        }\n        return;\n      }\n\n      const validationEndpoint = \"https://scripts.lifely.network/cloudflare/worker/cushie-discount-validator/validate?code=\" + encodeURIComponent(discountvalue);\n      const response = await fetch(validationEndpoint, { method: \"GET\" });\n      if (!response.ok) throw new Error(`Network error: ${response.status}`);\n      const data = await response.json();\n\n      if (!data.success || data.valid !== true) {\n        discountMessage.textContent = `${discountvalue} does not exist.`;\n        discountMessage.style.color = \"red\";\n        if(loader){\n          cartItemsParent.removeClass('show-loader');\n          loader.classList.add(\"hide\");\n        }\n        return;\n      }\n\n      // let appliedDiscounts = cart.cart_level_discount_applications.map(discount => discount.title.toLowerCase());\n\n      let discountResponse = await fetch(\"/discount/\" + encodeURIComponent(discountvalue), {\n        method: \"GET\",\n        headers: { \"Content-Type\": \"application/json\" },\n      });\n\n      if (!discountResponse.ok) {\n        throw new Error(\"Invalid discount code\");\n      }\n\n      let cartResponse = await fetch(\"/cart.js\");\n      let cart = await cartResponse.json();\n\n      let nowAppliedOrder = false;\n      let nowAppliedItem = false;\n\n      const displayedCodes = new Set();\n\n      // --- Insert cart-level discounts ---\n      if (cart.cart_level_discount_applications?.length) {\n        for (let allocation of cart.cart_level_discount_applications) {\n          const discount_code = allocation.title?.toLowerCase();\n          let amount = allocation.total_allocated_amount;\n\n          if(amount){\n            amount = parseFloat(amount/100);\n            amount = amount.toFixed(2);\n          }\n\n          if (!discount_code) continue;\n\n          // First check if it's the code we just applied\n          if (discount_code === inputCode) nowAppliedOrder = true;\n\n          if (!displayedCodes.has(discount_code)) {\n            displayedCodes.add(discount_code);\n          }\n\n        }\n      }\n\n      // --- Insert item-level discounts ---\n      if (cart.items?.length) {\n        for (let item of cart.items) {\n          if (item.line_level_discount_allocations?.length) {\n            for (let allocation of item.line_level_discount_allocations) {\n              const title = allocation.discount_application?.title?.toLowerCase();\n              let amount = allocation.discount_application?.total_allocated_amount;\n\n              if(amount){\n                amount = parseFloat(amount/100);\n                amount = amount.toFixed(2);\n              }\n\n              if (title && !displayedCodes.has(title)) {\n                displayedCodes.add(title);\n                if (title === inputCode) nowAppliedItem = true;\n\n              }\n            }\n          }\n        }\n      } \n\n      // --- Show discount messages ---\n      if (nowAppliedOrder || nowAppliedItem) {\n        discountMessage.textContent = `Discount applied`;\n        discountMessage.style.color = \"green\";\n\n        const res = await fetch(\"/?section_id=cart-drawer-pdp\");\n        const text = await res.text();\n        const html = document.createElement(\"div\");\n        html.innerHTML = text;\n        const newBox = html.querySelector(\".cart-wrapper\").innerHTML;\n        document.querySelector(\".cart-wrapper\").innerHTML = newBox;\n\n        if(loader){\n          cartItemsParent.removeClass('show-loader');\n          loader.classList.add(\"hide\");\n        }\n\n      } else {\n        const discountCode = discountvalue.toUpperCase();\n        const requirement = discountRequirements[discountCode];\n\n        if (requirement) {\n          // Custom logic only for our campaign discount codes\n\n          if (requirement.market !== currentMarket) {\n            discountMessage.textContent =\n              `${discountvalue} is not available in your market.`;\n            discountMessage.style.color = \"red\";\n\n          } else {\n            const cartResponse = await fetch(\"/cart.js\");\n            const cart = await cartResponse.json();\n\n            const cartSubtotal = cart.items_subtotal_price / 100;\n            const remainingAmount = requirement.threshold - cartSubtotal;\n\n            if (remainingAmount > 0) {\n              discountMessage.textContent =\n                `Spend ${requirement.currency}${Math.ceil(remainingAmount)} more to unlock this offer.`;\n            } else {\n              discountMessage.textContent =\n                `${discountvalue} couldn\u2019t be used with your existing discount.`;\n            }\n\n            discountMessage.style.color = \"red\";\n          }\n\n        } else {\n          // All other discount codes use the existing/default message\n          discountMessage.textContent =\n            `${discountvalue} couldn\u2019t be used with your existing discount.`;\n          discountMessage.style.color = \"red\";\n        }\n\n        if (loader) {\n          cartItemsParent.removeClass('show-loader');\n          loader.classList.add(\"hide\");\n        }\n\n        /* discountMessage.textContent = `${discountvalue} couldn\u2019t be used with your existing discount.`;\n        discountMessage.style.color = \"red\";\n        if(loader){\n          cartItemsParent.removeClass('show-loader');\n          loader.classList.add(\"hide\");\n        } */\n      }\n\n      fetchCartRecommendations();\n\n    }catch (error) {\n      discountMessage.textContent = \"Invalid discount code!\";\n      discountMessage.style.color = \"red\";\n      if(loader){\n        cartItemsParent.removeClass('show-loader');\n        loader.classList.add(\"hide\");\n      }\n    }\n  }); \n\n  $(document).on('click', '#discount-all-price .discountCodes .discountRow .discount_code-new .removeCoupon', async function (e) {\n    e.preventDefault();\n    var discount_code = $(this).closest('.discount_code-new').attr('data-discount');\n    removeDiscountAjax(discount_code);\n\n    fetchCartRecommendations();\n  })\n    \n  function updateCart(cart) { \n    // Cache DOM elements once\n    const subtotalDiv = document.querySelector(\".cart_sub_total_price\");\n    const totaldiscount = document.querySelector(\".total_discount_price\");\n    const totalDiv = document.getElementById(\"price-all-cart\");\n    const discountCodeEl = document.querySelector(\".discount_code\");\n    const discountAddEl = document.querySelector(\".cart_discount_add\");\n\n    \n    /* let subtotal = cart.items_subtotal_price / 100;\n    let total = cart.total_price / 100; */\n\n    let subtotal = cart.original_total_price /100;\n    let total = cart.items_subtotal_price / 100;\n\n    let discount = subtotal - total;\n    \n    const formatPrice = (price) => store_currency+`${price.toLocaleString(\"en-US\", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;\n    \n    if(cart.total_discount > 0)\n    {\n      var applydiscountcode = '';\n\n      if(totaldiscount){\n        totaldiscount.textContent = `-${formatPrice(discount)}`;\n      }\n      \n      if(cart.cart_level_discount_applications.size > 0){\n        \n        applydiscountcode = `${cart.cart_level_discount_applications[0].title}x`;\n\n      }else{\n        let codes = [];\n        let total_price_items = 0;\n\n        cart.items.forEach(item => {\n          item.line_level_discount_allocations.forEach(allocation => {\n            const code = allocation.discount_application.title;\n\n            // Add only if not already in codes\n            if (!codes.includes(code)) {\n              codes.push(code);\n            }\n\n            // Add original line price\n            total_price_items += item.original_line_price;\n          });\n        });\n\n        // Convert codes to comma-separated string (if needed)\n        let codesString = codes.join(',');\n\n        if(codesString){\n          if(codesString.includes('Prime Big Deal Days')){\n            applydiscountcode = `${codesString}`;\n          }else{\n            applydiscountcode = `${codesString}x`;\n          }\n          \n        }\n\n      }\n        \n      if(discountCodeEl){\n        discountCodeEl.textContent = applydiscountcode;\n      }\n      if(discountAddEl){\n        // discountAddEl.classList.add('hide');\n      }\n      if(totaldiscount){\n        totaldiscount.classList.remove('hide');\n      }\n      \n      if(discountCodeEl){\n        discountCodeEl.classList.remove('hide');\n      }\n    \n    }\n    else{\n      if(discountAddEl){\n        discountAddEl.classList.remove('hide');\n      }\n      if(totaldiscount){\n        totaldiscount.classList.add('hide');\n        totaldiscount.textContent = formatPrice(cart.total_discount);\n      }\n      \n      if(discountCodeEl){\n        discountCodeEl.textContent = \"\";\n        discountCodeEl.classList.add('hide');\n      }\n    }    \n    \n    subtotalDiv.textContent = formatPrice(subtotal);\n    // discountDiv.textContent = discount > 0 ? `-${formatPrice(discount)}` : `$0.00`;\n    totalDiv.textContent = formatPrice(total);\n  }\n\n  \n});\n"],
  "mappings": "AAAA,SAAS,iBAAiB,mBAAoB,gBAAkB,CAC9D,IAAI,eAAiB,EAAE,MAAM,EAAE,KAAK,eAAe,EAC/C,OAAS,EAAE,MAAM,EAAE,KAAK,aAAa,EAGzC,EAAE,QAAQ,EAAE,IAAI,QAAS,iBAAkB,UAAY,CACrD,oBAAoB,CACtB,CAAC,EAED,MAAM,aAAe,SAAS,eAAe,gBAAgB,EACvD,cAAgB,SAAS,eAAe,eAAe,EACvD,gBAAkB,SAAS,eAAe,kBAAkB,EAGlE,EAAE,QAAQ,EAAE,GAAG,QAAQ,qBAAqB,U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