{
  "version": 3,
  "sources": ["/cdn/shop/t/20/assets/pvl-custom-card-loop.js?cb=28247"],
  "sourcesContent": ["// Custom Colors card loop (Oct 16, 2026, Oliver). Drives the .custom-loop\n// cards rendered by snippets/pvl-custom-card-loop.liquid: each card cycles\n// a 6x4 sprite of side views on one shared clock (every card on the page\n// shows the same palette at the same moment), and hovering a card pauses\n// it and fades in the sole view in exactly that palette. An animated image\n// cannot report its current frame, which is why this is script-driven.\n(() => {\n  if (window.pvlCustomCardLoop) return\n  window.pvlCustomCardLoop = true\n\n  const reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\")\n  const live = new Set()\n\n  const setFrame = (el, i) => {\n    const cols = +el.dataset.cols, rows = +el.dataset.rows\n    el.style.setProperty(\"--fx\", (i % cols) / (cols - 1) * 100 + \"%\")\n    el.style.setProperty(\"--fy\", Math.floor(i / cols) / (rows - 1) * 100 + \"%\")\n  }\n  const frameNow = el => reduce.matches ? 0 : Math.floor(Date.now() / +el.dataset.ms) % +el.dataset.frames\n\n  // The side sprite loads only when the card nears the viewport; until it\n  // decodes, the still poster <img> underneath shows the first palette.\n  const io = new IntersectionObserver(entries => {\n    for (const entry of entries) {\n      if (!entry.isIntersecting) continue\n      const el = entry.target\n      io.unobserve(el)\n      const sprite = new Image()\n      sprite.onload = () => {\n        el.style.setProperty(\"--side\", `url(\"${el.dataset.side}\")`)\n        setFrame(el, frameNow(el))\n        el.classList.add(\"is-live\")\n        live.add(el)\n      }\n      sprite.src = el.dataset.side\n    }\n  }, { rootMargin: \"300px\" })\n\n  const hover = (el, on) => {\n    if (on) {\n      if (!el.dataset.soleSet) {\n        el.dataset.soleSet = \"1\"\n        el.style.setProperty(\"--sole\", `url(\"${el.dataset.sole}\")`)\n      }\n      // Freeze on the palette showing right now; the sole layer shares\n      // --fx/--fy, so it shows that same palette.\n      if (!el.classList.contains(\"is-live\")) setFrame(el, 0)\n      el.dataset.paused = \"1\"\n      el.classList.add(\"show-sole\")\n    } else {\n      delete el.dataset.paused\n      el.classList.remove(\"show-sole\")\n      if (el.classList.contains(\"is-live\")) setFrame(el, frameNow(el))\n    }\n  }\n\n  const scan = () => {\n    for (const el of document.querySelectorAll(\".custom-loop[data-side]:not([data-bound])\")) {\n      el.dataset.bound = \"1\"\n      io.observe(el)\n      const card = el.closest(\".ante-product-card\") || el\n      card.addEventListener(\"pointerenter\", e => { if (e.pointerType === \"mouse\") hover(el, true) })\n      card.addEventListener(\"pointerleave\", () => hover(el, false))\n    }\n  }\n\n  const tick = () => {\n    for (const el of live) {\n      if (!el.isConnected) { live.delete(el); continue }\n      if (!el.dataset.paused) setFrame(el, frameNow(el))\n    }\n    const ms = 1200\n    setTimeout(tick, ms - (Date.now() % ms) + 10)\n  }\n\n  const start = () => {\n    scan()\n    // Carousels clone slides and filters re-render cards after load.\n    let queued = false\n    new MutationObserver(() => {\n      if (queued) return\n      queued = true\n      requestAnimationFrame(() => { queued = false; scan() })\n    }).observe(document.body, { childList: true, subtree: true })\n    tick()\n  }\n  if (document.readyState === \"loading\") document.addEventListener(\"DOMContentLoaded\", start)\n  else start()\n})()\n"],
  "mappings": "CAMC,IAAM,CACL,GAAI,OAAO,kBAAmB,OAC9B,OAAO,kBAAoB,GAE3B,MAAM,OAAS,OAAO,WAAW,kCAAkC,EAC7D,KAAO,IAAI,IAEX,SAAW,CAAC,GAAI,IAAM,CAC1B,MAAM,KAAO,CAAC,GAAG,QAAQ,KAAM,KAAO,CAAC,GAAG,QAAQ,KAClD,GAAG,MAAM,YAAY,OAAS,EAAI,MAAS,KAAO,GAAK,IAAM,GAAG,EAChE,GAAG,MAAM,YAAY,OAAQ,KAAK,MAAM,EAAI,IAAI,GAAK,KAAO,GAAK,IAAM,GAAG,CAC5E,EACM,SAAW,IAAM,OAAO,QAAU,EAAI,KAAK,MAAM,KAAK,IAAI,EAAI,CAAC,GAAG,QAAQ,EAAE,EAAI,CAAC,GAAG,QAAQ,OAI5F,GAAK,IAAI,qBAAqB,SAAW,CAC7C,UAAW,SA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