{
  "version": 3,
  "sources": ["/cdn/shop/t/33/assets/video-fallback.js?cb=rm1"],
  "sourcesContent": ["// assets/video-fallback.js\n// Background videos (muted + looping) that the browser refused to start, for\n// example on an iPhone in Low Power Mode, get another try as soon as the visitor\n// touches, clicks or scrolls the page. Nothing else is touched: videos with\n// sound, videos with controls, and videos that are not visible are left alone.\n// No network requests, no output, and every step is wrapped so it can never\n// break the page.\n\n(function () {\n  var lastTry = 0;\n\n  function isBackgroundVideo(video) {\n    return video && video.tagName === 'VIDEO' && video.muted && video.loop && !video.controls;\n  }\n\n  function isOnScreen(video) {\n    var box = video.getBoundingClientRect();\n    return (\n      box.width > 0 &&\n      box.height > 0 &&\n      box.bottom > 0 &&\n      box.top < (window.innerHeight || document.documentElement.clientHeight) &&\n      box.right > 0 &&\n      box.left < (window.innerWidth || document.documentElement.clientWidth)\n    );\n  }\n\n  function start(video) {\n    try {\n      if (!isBackgroundVideo(video) || !video.paused || document.hidden || !isOnScreen(video)) return;\n      var attempt = video.play();\n      if (attempt && attempt.catch) attempt.catch(function () {});\n    } catch (error) {}\n  }\n\n  function startAll() {\n    try {\n      var now = Date.now();\n      if (now - lastTry < 400) return;\n      lastTry = now;\n      var videos = document.getElementsByTagName('video');\n      for (var i = 0; i < videos.length; i++) start(videos[i]);\n    } catch (error) {}\n  }\n\n  // A video that has just become playable: try once if it is already on screen.\n  // Media events do not bubble, so listen in the capture phase on the document.\n  function onReady(event) {\n    start(event.target);\n  }\n  document.addEventListener('loadeddata', onReady, true);\n  document.addEventListener('canplay', onReady, true);\n\n  // The visitor's first touch, click, key press or scroll counts as the gesture\n  // that browsers in power-saving mode require before they allow playback.\n  ['touchstart', 'pointerdown', 'click', 'keydown'].forEach(function (name) {\n    window.addEventListener(name, startAll, { passive: true });\n  });\n  window.addEventListener('scroll', startAll, { passive: true });\n\n  document.addEventListener('visibilitychange', function () {\n    if (!document.hidden) startAll();\n  });\n})();\n"],
  "mappings": "CAQC,UAAY,CACX,IAAI,QAAU,E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