{
  "version": 3,
  "sources": ["/cdn/shop/t/157/assets/social-video-wall.js?cb=1794661003"],
  "sourcesContent": ["/*\n * social-video-wall.js\n * --------------------------------------------------------------------------\n * Drives the \"Social video wall\" section (sections/social-video-wall.liquid).\n *\n *  - ONE video plays at a time: the \"featured\" (enlarged/tall) tile. Every\n *    other tile holds on its poster with a play affordance.\n *  - Auto-cycle: when the featured video finishes it hands off to the NEXT\n *    tile (wrapping around) \u2014 that tile becomes featured and plays. On a\n *    horizontal (mobile) rail the new tile is scrolled into view.\n *  - When the wall scrolls into view the featured tile plays muted (unless\n *    autoplay is off or the user prefers reduced motion \u2014 then it waits on its\n *    poster and won't auto-cycle). After page load the featured video buffers\n *    when the wall is about a screen away, and the next one buffers while the\n *    current one plays.\n *    On a horizontal (mobile) rail the featured tile is centred at load if it\n *    would otherwise start out of view.\n *  - Click a tile  -> it becomes featured AND plays with sound.\n *  - Click the featured tile again -> toggles its sound. Sound state carries\n *    as the wall auto-cycles.\n *  - Playback pauses when the wall is scrolled out of view.\n *\n * `.is-featured` = the tall tile (size). `.is-playing` = the tile whose video\n * is showing frames (drives the poster, play and sound overlays via CSS).\n *\n * Plain browser script (no bundler / modules), matching the theme's convention.\n */\n(function () {\n  'use strict';\n\n  var prefersReduced =\n    window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n\n  function videoOf(tile) {\n    return tile.querySelector('video');\n  }\n\n  function safePlay(video) {\n    if (!video) return;\n    var p = video.play();\n    if (p && typeof p.catch === 'function') p.catch(function () {});\n  }\n\n  function warm(tile) {\n    var video = videoOf(tile);\n    if (!video || video.preload === 'auto') return;\n    video.preload = 'auto';\n    // A preload=\"none\" video that was never played has fetched nothing, so start it.\n    if (video.readyState === 0 && video.networkState !== video.NETWORK_LOADING) video.load();\n  }\n\n  function reflectSound(tile) {\n    var video = videoOf(tile);\n    var on = video && !video.muted;\n    tile.classList.toggle('is-unmuted', !!on);\n    var off = tile.querySelector('.svw-sound-off');\n    var onEl = tile.querySelector('.svw-sound-on');\n    if (off) off.classList.toggle('hidden', !!on);\n    if (onEl) onEl.classList.toggle('hidden', !on);\n  }\n\n  function initWall(root) {\n    if (!root || root.dataset.svwInit === '1') return;\n    root.dataset.svwInit = '1';\n\n    var autoplay = root.dataset.autoplay !== 'false';\n    var tiles = Array.prototype.slice.call(root.querySelectorAll('[data-svw-tile]'));\n    if (!tiles.length) return;\n\n    // Make `tile` the single active tile: tall, playing (optionally with sound);\n    // every other tile shrinks, pauses and mutes. `scrollIn` brings it into view\n    // on the horizontal (mobile) rail.\n    function activate(tile, withSound, scrollIn) {\n      tiles.forEach(function (t) {\n        var video = videoOf(t);\n        var isTarget = t === tile;\n        t.classList.toggle('is-featured', isTarget);\n        t.setAttribute('aria-pressed', isTarget ? 'true' : 'false');\n        if (!video) return;\n        if (isTarget) {\n          video.muted = !withSound;\n          if (video.currentTime > 0) { try { video.currentTime = 0; } catch (e) {} }\n          safePlay(video);\n        } else {\n          video.pause();\n          video.muted = true;\n        }\n        reflectSound(t);\n      });\n      if (scrollIn && tile.scrollIntoView) {\n        tile.scrollIntoView({ behavior: 'smooth', inline: 'center', block: 'nearest' });\n      }\n    }\n\n    function currentIndex() {\n      for (var i = 0; i < tiles.length; i++) {\n        if (tiles[i].classList.contains('is-featured')) return i;\n      }\n      return 0;\n    }\n\n    // Advance to the next tile, carrying the current sound state, scrolling it in.\n    function advance() {\n      if (!autoplay || prefersReduced || tiles.length < 2) return;\n      var cur = currentIndex();\n      var curVideo = videoOf(tiles[cur]);\n      var withSound = curVideo ? !curVideo.muted : false;\n      var next = (cur + 1) % tiles.length;\n      activate(tiles[next], withSound, true);\n    }\n\n    // Buffer the next reel once the featured one is playing and can play through, so the hand-off starts at once.\n    function warmNext(tile) {\n      var video = videoOf(tile);\n      if (!autoplay || prefersReduced || tiles.length < 2) return;\n      if (!tile.classList.contains('is-featured') || video.paused || video.readyState < 4) return;\n      warm(tiles[(tiles.indexOf(tile) + 1) % tiles.length]);\n    }\n\n    tiles.forEach(function (tile) {\n      var video = videoOf(tile);\n      if (video) {\n        video.muted = true;\n        video.loop = false; // let it end so the wall can auto-cycle\n        video.playsInline = true;\n        // Not `play`: that fires before any frame exists, so hiding the poster then shows black on iPhone.\n        video.addEventListener('playing', function () {\n          tile.classList.add('is-playing');\n          warmNext(tile);\n        });\n        video.addEventListener('canplaythrough', function () { warmNext(tile); });\n        video.addEventListener('pause', function () { tile.classList.remove('is-playing'); });\n        video.addEventListener('ended', function () {\n          if (tile.classList.contains('is-featured')) advance();\n        });\n      }\n      reflectSound(tile);\n\n      tile.addEventListener('click', function () {\n        if (tile.classList.contains('is-featured')) {\n          if (video) {\n            video.muted = !video.muted;\n            if (!video.muted) safePlay(video);\n            reflectSound(tile);\n          }\n        } else {\n          activate(tile, true, false);\n        }\n      });\n    });\n\n    // On load, only the featured (tall) tile plays \u2014 muted \u2014 if autoplay is on.\n    // If the configured featured position is out of range (e.g. a single reel with\n    // the default position of 2), promote the fallback tile so it enlarges and\n    // reports the right state instead of playing while looking inactive.\n    var featured = root.querySelector('[data-svw-tile].is-featured') || tiles[0];\n    if (featured && !featured.classList.contains('is-featured')) {\n      featured.classList.add('is-featured');\n      featured.setAttribute('aria-pressed', 'true');\n    }\n\n    // On a narrow horizontal rail the featured tile can start mostly outside the\n    // rail's visible area (featured position 3+, or even 2 on a small phone), where\n    // the visibility observer below would never start it. Centre it in the rail\n    // now \u2014 the wall is usually still off-screen at this point, so the move isn't\n    // seen. Tiles already at least 25% visible (the observer's threshold) stay put.\n    var track = root.querySelector('[data-svw-track]');\n    if (featured && track && track.scrollWidth > track.clientWidth) {\n      var tr = track.getBoundingClientRect();\n      var fr = featured.getBoundingClientRect();\n      var shown = Math.min(fr.right, tr.right) - Math.max(fr.left, tr.left);\n      if (fr.width && shown / fr.width < 0.25) {\n        track.scrollLeft += fr.left + fr.width / 2 - (tr.left + tr.width / 2);\n      }\n    }\n\n    // Don't play() at load: that starts the full 1080p MP4 downloading even when\n    // the wall is far below the fold (the browser keeps buffering after the\n    // observer pauses it), competing with the hero image on slow connections.\n    // The observer below starts the featured tile once it's on screen; browsers\n    // without IntersectionObserver fall back to playing on load.\n    var canObserve = 'IntersectionObserver' in window;\n    if (featured && autoplay && !prefersReduced && !canObserve) safePlay(videoOf(featured));\n\n    // Play the featured tile while it's in view; pause anything scrolled out of view.\n    if (canObserve) {\n      var io = new IntersectionObserver(\n        function (entries) {\n          entries.forEach(function (entry) {\n            var tile = entry.target;\n            var video = videoOf(tile);\n            if (!video) return;\n            if (!entry.isIntersecting) {\n              video.pause();\n            } else if (tile.classList.contains('is-featured') && autoplay && !prefersReduced) {\n              safePlay(video);\n            }\n          });\n        },\n        { threshold: 0.25 }\n      );\n      tiles.forEach(function (tile) {\n        io.observe(tile);\n      });\n\n      // After the load event so it never competes with the hero image (see above).\n      if (autoplay && !prefersReduced) {\n        var warmWhenNear = function () {\n          var near = new IntersectionObserver(\n            function (entries) {\n              if (!entries[0].isIntersecting) return;\n              near.disconnect();\n              warm(tiles[currentIndex()]);\n            },\n            { rootMargin: '100% 0px' }\n          );\n          near.observe(root);\n        };\n        // A wall added or redrawn in the theme editor initialises after load has already fired.\n        if (document.readyState === 'complete') warmWhenNear();\n        else window.addEventListener('load', warmWhenNear);\n      }\n    }\n  }\n\n  function initAll(scope) {\n    var root = scope || document;\n    var walls = root.querySelectorAll('[data-social-video-wall]');\n    Array.prototype.forEach.call(walls, initWall);\n  }\n\n  if (document.readyState !== 'loading') {\n    initAll();\n  } else {\n    document.addEventListener('DOMContentLoaded', function () {\n      initAll();\n    });\n  }\n\n  // Shopify theme editor: (re)initialise when a section is added / redrawn.\n  document.addEventListener('shopify:section:load', function (event) {\n    var el = event.target.querySelector\n      ? event.target.querySelector('[data-social-video-wall]')\n      : null;\n    if (el) initWall(el);\n  });\n})();\n"],
  "mappings": "CA2BC,UAAY,CACX,aAEA,IAAI,eACF,OAAO,YAAc,OAAO,WAAW,kCAAkC,EAAE,QAE7E,SAAS,QAAQ,KAAM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