{
  "version": 3,
  "sources": ["/cdn/shop/t/22/assets/an-cart-cross.js?t=1781891604717"],
  "sourcesContent": ["/* \"Pairs well with\" categorisation for the cart drawer.\n *\n * The rail used to show the first 3 algorithmic \"related\" products, which for a\n * shirt are almost always more shirts. Adam wants a deliberate mix: one apparel\n * piece, one accessory, and one ancillary pin/postcard (incl. pin bundles and\n * Naro Pinosa cards). This module buckets products by type and picks one of each;\n * an-cart.js fills empty buckets from the matching category collection.\n *\n * Kept separate so the bucketing is unit-testable in Node\n * (04-technical/scripts/tests/an-cart-cross.test.cjs).\n */\n(function (root) {\n  // Map a Shopify product type to one of three buckets.\n  function bucketOf(type) {\n    var t = (type || '').toLowerCase();\n    if (/t-?shirt|tank|tee|hoodie|sweatshirt|v-?neck|vee|long sleeve|crew/.test(t)) return 'apparel';\n    if (/pin|patch|postcard|sticker|greeting card|playing card|magnet/.test(t)) return 'pins';\n    return 'accessory'; // hat, beanie, bandana, belt, jewelry, socks, tote, etc.\n  }\n\n  // In stock: product-level flag (recommendations API) or any purchasable variant (collection JSON).\n  function isAvailable(p) {\n    if (p.available === true) return true;\n    if (p.available === false) return false;\n    if (!p.variants || !p.variants.length) return true; // no stock data at all: the store decides at add-to-cart\n    return p.variants.some(function (v) { return v && v.available; });\n  }\n\n  // First product in `products` belonging to `bucket` that isn't already in the\n  // cart or picked. inCart/picked are id->true maps.\n  function firstOf(products, bucket, inCart, picked) {\n    for (var i = 0; i < (products || []).length; i++) {\n      var p = products[i]; if (!p) continue;\n      if ((inCart && inCart[p.id]) || (picked && picked[p.id])) continue;\n      if (!isAvailable(p)) continue; // RULE: in stock only (Daniel 2026-10-01)\n      if (bucketOf(p.type || p.product_type) === bucket) return p;\n    }\n    return null;\n  }\n\n  // Normalise a product from either /recommendations/products.json (price in\n  // cents, featured_image string) or /collections/x/products.json (variant price\n  // as a \"12.00\" string, image under images[]) into one shape for rendering.\n  function normalize(p) {\n    var vs = p.variants || [], v = null;\n    for (var i = 0; i < vs.length; i++) { if (vs[i] && vs[i].available !== false) { v = vs[i]; break; } }\n    if (!v) v = vs[0] || {};\n    var cents;\n    if (typeof p.price === 'number') cents = p.price;\n    else if (v.price != null) cents = (typeof v.price === 'string') ? Math.round(parseFloat(v.price) * 100) : v.price;\n    else cents = 0;\n    var img = '';\n    if (typeof p.featured_image === 'string') img = p.featured_image;\n    else if (p.featured_image && p.featured_image.src) img = p.featured_image.src;\n    else if (p.images && p.images[0]) img = (typeof p.images[0] === 'string') ? p.images[0] : (p.images[0].src || '');\n    return {\n      id: p.id,\n      title: p.title || '',\n      url: p.url || ('/products/' + (p.handle || '')),\n      priceCents: cents,\n      img: img,\n      variantId: v.id || null\n    };\n  }\n\n  // In-bag Pin Pack offer (2026-10-01; replaces the pre-checkout detour page, which added a whole\n  // page between the bag and checkout). Show it only when the bag has something in it, holds no pin,\n  // and doesn't already contain the pack. offerVariantId is blank whenever the pack can't be bought\n  // (drafted / sold out), so the offer simply never appears.\n  function shouldOfferPin(items, offerVariantId) {\n    if (!offerVariantId || !items || !items.length) return false;\n    var off = String(offerVariantId);\n    return !items.some(function (i) {\n      return (i.product_type || '').trim().toLowerCase() === 'pin' || String(i.variant_id) === off;\n    });\n  }\n\n  var api = { bucketOf: bucketOf, firstOf: firstOf, normalize: normalize, isAvailable: isAvailable, shouldOfferPin: shouldOfferPin };\n  if (typeof module !== 'undefined' && module.exports) module.exports = api;\n  if (root) root.ANCartCross = api;\n})(typeof window !== 'undefined' ? window : this);\n"],
  "mappings": "CAWC,SAAU,KAAM,CAEf,SAAS,SAAS,KAAM,CACtB,IAAI,GAAK,MAAQ,IAAI,YAAY,EACjC,MAAI,mEAAmE,KAAK,CAAC,EAAU,UACnF,+DAA+D,KAAK,CAAC,EAAU,OAC5E,WACT,CAGA,SAAS,YAAY,EAAG,CACtB,OAAI,EAAE,YAAc,GAAa,GAC7B,EAAE,YAAc,GAAc,GAC9B,CAAC,EAAE,UAAY,CAAC,EAAE,SAAS,OAAe,GACvC,EAAE,SAAS,K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