{
  "version": 3,
  "sources": ["/cdn/shop/t/4/assets/sacred-motion.js?nocache=1792694746687"],
  "sourcesContent": ["/*\n * Sacred Place motion layer\n * Watches successful /cart/add requests (product page, quick add, bundles)\n * and plays the add-to-cart feedback: button confirmation, a gold dot flying\n * to the cart icon, a cart-icon bounce and staggered cart drawer items.\n */\n(() => {\n  const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n  const addedLabel = document.documentElement.lang && document.documentElement.lang.startsWith('es') ? 'Agregado' : 'Added';\n  let lastButton = null;\n\n  // Remember which add-to-cart button started the request\n  document.addEventListener('click', (event) => {\n    const button = event.target.closest('button[type=\"submit\"], [name=\"add\"], .add-to-cart, .js-add-to-cart');\n    if (button) lastButton = button;\n  }, true);\n\n  const visibleCartIcon = () =>\n    [...document.querySelectorAll('.header__icon--cart')].find((icon) => icon.getBoundingClientRect().width > 0);\n\n  const confirmButton = (button) => {\n    if (!button) return;\n    button.dataset.spAdded = addedLabel;\n    button.classList.remove('sp-added');\n    void button.offsetWidth;\n    button.classList.add('sp-added');\n    setTimeout(() => button.classList.remove('sp-added'), 1700);\n  };\n\n  const flyToCart = (button, icon) => {\n    if (reduceMotion || !button || !icon || !button.animate) return;\n    const from = button.getBoundingClientRect();\n    const to = icon.getBoundingClientRect();\n    if (!from.width || !to.width) return;\n\n    const dot = document.createElement('span');\n    dot.className = 'sp-fly-dot';\n    dot.style.left = `${from.left + from.width / 2}px`;\n    dot.style.top = `${from.top + from.height / 2}px`;\n    document.body.appendChild(dot);\n\n    const dx = to.left + to.width / 2 - (from.left + from.width / 2);\n    const dy = to.top + to.height / 2 - (from.top + from.height / 2);\n    let landed = false;\n    const land = () => {\n      if (landed) return;\n      landed = true;\n      dot.remove();\n      bumpCart();\n    };\n\n    dot.animate([\n      { transform: 'translate(0, 0) scale(1)', opacity: 1 },\n      { transform: `translate(${dx * 0.5}px, ${dy * 0.5 - 80}px) scale(1.3)`, opacity: 1, offset: 0.5 },\n      { transform: `translate(${dx}px, ${dy}px) scale(0.4)`, opacity: 0.2 }\n    ], { duration: 750, easing: 'cubic-bezier(0.5, 0, 0.3, 1)' }).onfinish = land;\n    // Background tabs can pause animations; never leave the dot behind\n    setTimeout(land, 900);\n  };\n\n  // The header re-renders after an add, so always look the icon up again\n  const bumpCart = () => {\n    const icon = visibleCartIcon();\n    if (!icon) return;\n    icon.classList.remove('sp-bump');\n    void icon.offsetWidth;\n    icon.classList.add('sp-bump');\n    setTimeout(() => icon.classList.remove('sp-bump'), 800);\n  };\n\n  const animateCartItems = () => {\n    if (reduceMotion) return;\n    document.querySelectorAll('.cart-item').forEach((item, index) => {\n      if (item.getBoundingClientRect().width === 0) return;\n      item.style.setProperty('--sp-i', index);\n      item.classList.remove('sp-enter');\n      void item.offsetWidth;\n      item.classList.add('sp-enter');\n    });\n  };\n\n  const onAdded = () => {\n    const button = lastButton;\n    const icon = visibleCartIcon();\n    confirmButton(button);\n    if (reduceMotion) {\n      bumpCart();\n    } else {\n      flyToCart(button, icon);\n    }\n    // The drawer re-renders its items after the request; animate them once they are in\n    setTimeout(animateCartItems, 350);\n  };\n\n  const isCartAdd = (url) => /\\/cart\\/add(\\.js)?(\\?|$)/.test(String(url));\n\n  const originalFetch = window.fetch;\n  window.fetch = function (input, init) {\n    const url = typeof input === 'string' ? input : input && input.url;\n    const request = originalFetch.apply(this, arguments);\n    if (isCartAdd(url)) {\n      request.then((response) => { if (response.ok) onAdded(); }).catch(() => {});\n    }\n    return request;\n  };\n})();\n\n/*\n * Brand videos (hero, grid tiles, \"What is a decant?\")\n * Phones in low-power / data-saver mode block autoplay and show a play button.\n * Keep trying to play: on load, when the video scrolls into view, and on the\n * first touch, scroll or key press anywhere (which browsers count as a gesture).\n * Videos pause off-screen to save battery and data.\n * \"Pause animations\" buttons (snippet sp-motion-toggle) stop all of them and the\n * choice is remembered; visitors who prefer reduced motion start paused.\n */\n(() => {\n  const videos = [...document.querySelectorAll('.sp-hero video, .sp-brand-video video, video.sp-media-video')];\n  if (!videos.length) return;\n\n  const STORAGE_KEY = 'sp-motion';\n  const stored = (() => { try { return localStorage.getItem(STORAGE_KEY); } catch (e) { return null; } })();\n  let paused = stored ? stored === 'paused' : window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n\n  const toggles = [...document.querySelectorAll('.js-sp-motion-toggle')];\n  const render = () => {\n    document.documentElement.classList.toggle('sp-motion-paused', paused);\n    toggles.forEach((button) => {\n      button.setAttribute('aria-pressed', String(paused));\n      button.querySelector('.sp-motion-toggle__label').textContent = paused ? 'Play animations' : 'Pause animations';\n    });\n  };\n\n  const tryPlay = (video) => {\n    if (paused) return;\n    video.muted = true;\n    video.playsInline = true;\n    const attempt = video.play();\n    if (attempt && attempt.catch) attempt.catch(() => {});\n  };\n\n  // Measured directly so a gesture always starts what is on screen,\n  // even if the observer below has not reported yet.\n  const onScreen = (video) => {\n    const rect = video.getBoundingClientRect();\n    return rect.width > 0 && rect.bottom > 0 && rect.top < window.innerHeight;\n  };\n  const playVisible = () => videos.filter(onScreen).forEach(tryPlay);\n\n  const observer = new IntersectionObserver((entries) => {\n    entries.forEach(({ target, isIntersecting }) => {\n      if (isIntersecting) {\n        tryPlay(target);\n      } else {\n        target.pause();\n      }\n    });\n  }, { threshold: 0.15 });\n  videos.forEach((video) => observer.observe(video));\n  playVisible();\n  ['touchstart', 'pointerdown', 'scroll', 'keydown'].forEach((type) => {\n    window.addEventListener(type, playVisible, { passive: true });\n  });\n  document.addEventListener('visibilitychange', () => {\n    if (!document.hidden) playVisible();\n  });\n\n  toggles.forEach((button) => button.addEventListener('click', () => {\n    paused = !paused;\n    try { localStorage.setItem(STORAGE_KEY, paused ? 'paused' : 'playing'); } catch (e) {}\n    render();\n    if (paused) videos.forEach((video) => video.pause());\n    else playVisible();\n  }));\n  render();\n  if (paused) videos.forEach((video) => video.pause());\n})();\n"],
  "mappings": "CAMC,IAAM,CACL,MAAM,aAAe,OAAO,WAAW,kCAAkC,EAAE,QACrE,WAAa,SAAS,gBAAgB,M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