{
  "version": 3,
  "sources": ["/cdn/shop/t/38/assets/cart-promotion-eligibility.js?nc=9987"],
  "sourcesContent": ["(function () {\n  // Only Shopify-confirmed codes unlock the display; input text is never used.\n  function isActive(cart, requiredCode) {\n    const normalize = value => String(value || '').trim().toLowerCase();\n    const required = normalize(requiredCode);\n    if (!required) return true;\n    if (Array.isArray(cart.discount_codes)) {\n      return cart.discount_codes.some(discount => normalize(discount.code) === required && discount.applicable === true);\n    }\n    // Liquid's initial cart JSON exposes applied allocations instead of the\n    // Ajax response's code applicability list. Ignore automatic discounts.\n    const applications = [\n      ...(cart.cart_level_discount_applications || []),\n      ...(cart.items || []).flatMap(item => (item.line_level_discount_allocations || []).map(allocation => allocation.discount_application))\n    ];\n    return applications.some(discount => discount?.type === 'discount_code' && normalize(discount.title) === required);\n  }\n  function activeTiers(cart, tiers, requiredCode) {\n    return isActive(cart, requiredCode) ? tiers : tiers.filter(tier => tier.type === 'gwp-tier-shipping');\n  }\n  const api = { isActive, activeTiers };\n  if (typeof module !== 'undefined' && module.exports) module.exports = api;\n  else window.artistCartPromotionEligibility = api;\n})();\n"],
  "mappings": "CAAC,UAAY,CAEX,SAAS,SAAS,KAAM,aAAc,CACpC,MAAM,UAAY,OAAS,OAAO,OAAS,EAAE,EAAE,KAAK,EAAE,YAAY,EAC5D,SAAW,UAAU,YAAY,EACvC,OAAK,SACD,MAAM,QAAQ,KAAK,cAAc,EAC5B,KAAK,eAAe,KAAK,UAAY,UAAU,SAAS,IAAI,IAAM,UAAY,SAAS,aAAe,EAAI,EAI9F,CACnB,GAAI,KAAK,kCAAoC,CAAC,EAC9C,IAAI,KAAK,OAAS,CAAC,GAAG,QAAQ,OAAS,KAAK,iCAAmC,CAAC,GAAG,IAAI,YAAc,WAAW,oBAAoB,CAAC,CACvI,EACoB,KAAK,UAAY,UAAU,OAAS,iBAAmB,UAAU,SAAS,KAAK,IAAM,QAAQ,EAV3F,EAWxB,CACA,SAAS,YAAY,KAAM,MAAO,aAAc,CAC9C,OAAO,SAAS,KAAM,YAAY,EAAI,MAAQ,MAAM,OAAO,MAAQ,KAAK,OAAS,mBAAmB,CACtG,CACA,MAAM,IAAM,CAAE,SAAU,WAAY,EAChC,OAAO,OAAW,KAAe,OAAO,QAAS,OAAO,QAAU,IACjE,OAAO,+BAAiC,GAC/C,GAAG",
  "names": []
}
