{
  "version": 3,
  "sources": ["/cdn/shop/t/1064/assets/nt-marquee.js?auto=format%2Ccompress"],
  "sourcesContent": ["/* nt-marquee.js: an endless, slowly sliding row that a finger can also drag. ONE script for every such row (the owento\n * rule): the homepage hero's phone photo strip (Justin 11-24) and the homepage's phone review row (Justin 11-30 \"this\n * should scroll smoothly and slowly non stop\").\n *\n * Markup: a clipping viewport [data-nt-marquee=\"<media query>\"] holding the moving row [data-nt-marquee-row]. The row's\n * content is two identical passes, so the row is exactly two passes wide and its CSS slide (translateX 0 -> -50%,\n * linear, infinite) loops without a seam. The section's own CSS does the auto-moving (smooth from the first frame, off\n * the main thread); this script only adds the finger, and only while the media query matches:\n *   - touch-action pan-y on the viewport: up/down swipes still scroll the page, sideways swipes come here;\n *   - a touch freezes the slide where it is and the finger moves the SAME row by its transform, so the row never stops\n *     being one moving layer (Justin 11-30: handing it over to native scrolling made the photos flash and vanish on\n *     iPhone);\n *   - a flick coasts and slows down; 1.2 s after the row stops, the slide carries on from that spot (animation-delay).\n * Positions wrap by one pass, so it is endless both ways. Reduced motion: the section pauses its slide in CSS\n * (animation-play-state: paused, NOT animation: none, so the resume spot still holds), dragging still works.\n */\n(function () {\n  'use strict';\n  if (window.ntMarquee || !window.matchMedia) return;\n\n  function arm(view) {\n    var row = view && !view._ntMarquee && view.querySelector('[data-nt-marquee-row]');\n    if (!row) return;\n    view._ntMarquee = true;\n    var mq = window.matchMedia(view.getAttribute('data-nt-marquee') || 'all');\n    var held = false, x = 0, t = 0, raf = 0, dur = 30;\n    var sx = 0, sy = 0, x0 = 0, lx = 0, lt = 0, v = 0, axis = '';\n\n    function pass() { return row.getBoundingClientRect().width / 2; }   /* (the CSS slide's -50%) */\n    function mod(o, p) { if (!p) return o; o = o % p; return o < 0 ? o + p : o; }\n    function slideOffset() {\n      var m = getComputedStyle(row).transform, tx = 0, a;\n      if (m && m !== 'none' && (a = m.match(/matrix(3d)?\\(([^)]+)\\)/))) { var c = a[2].split(','); tx = parseFloat(a[1] ? c[12] : c[4]) || 0; }\n      return -tx;\n    }\n    /* the row's position: 0 up to one pass, so it wraps both ways */\n    function put(o) { x = mod(o, pass()); row.style.transform = 'translate3d(' + (-x).toFixed(2) + 'px,0,0)'; }\n    function hold() {\n      clearTimeout(t);\n      cancelAnimationFrame(raf);\n      if (held) return;\n      var o = slideOffset();\n      dur = parseFloat(getComputedStyle(row).animationDuration) || dur;\n      held = true;\n      row.style.animation = 'none';   /* and the same spot as a transform, in the same frame = no jump */\n      put(o);\n    }\n    function resume() {\n      var p = pass();\n      row.style.animation = '';\n      row.style.animationDelay = (p ? -(x / p) * dur : 0).toFixed(3) + 's';\n      row.style.transform = '';\n      held = false;\n    }\n    function later() { clearTimeout(t); t = setTimeout(resume, 1200); }\n    function coast() {\n      var prev = performance.now();\n      raf = requestAnimationFrame(function step(now) {\n        var dt = Math.min(Math.max(now - prev, 0), 50);\n        prev = now;\n        put(x + v * dt);\n        v *= Math.pow(0.997, dt);   /* friction: a flick halves about every 230 ms */\n        if (Math.abs(v) > 0.03) raf = requestAnimationFrame(step); else later();\n      });\n    }\n    /* the cards slide in from behind the clip, where a lazy image would only start loading as it shows (a pop-in):\n       once the page has loaded, the row's lazy images load ahead */\n    function warm() {\n      if (!mq.matches) return;\n      [].forEach.call(row.querySelectorAll('img[loading=\"lazy\"]'), function (i) { i.loading = 'eager'; });\n    }\n    function sync() { view.style.touchAction = mq.matches ? 'pan-y pinch-zoom' : ''; if (document.readyState === 'complete') warm(); }\n    if (document.readyState !== 'complete') window.addEventListener('load', warm, { once: true });\n\n    view.addEventListener('touchstart', function (e) {\n      if (!mq.matches || e.touches.length !== 1) return;\n      hold();\n      sx = lx = e.touches[0].clientX;\n      sy = e.touches[0].clientY;\n      lt = e.timeStamp;\n      x0 = x;\n      v = 0;\n      axis = '';\n    }, { passive: true });\n    view.addEventListener('touchmove', function (e) {\n      if (!held || axis === 'y' || e.touches.length !== 1) return;\n      var cx = e.touches[0].clientX, cy = e.touches[0].clientY;\n      if (!axis) {\n        var ax = Math.abs(cx - sx), ay = Math.abs(cy - sy);\n        if (ax < 6 && ay < 6) return;\n        axis = ax > ay ? 'x' : 'y';   /* an up/down swipe is the page's: the row just waits */\n        if (axis === 'y') return;\n      }\n      var dt = e.timeStamp - lt;\n      if (dt > 0) v = 0.8 * ((lx - cx) / dt) + 0.2 * v;\n      lx = cx;\n      lt = e.timeStamp;\n      put(x0 + (sx - cx));\n    }, { passive: true });\n    function up(e) {\n      if (!held || (e.touches && e.touches.length)) return;\n      if (axis === 'x' && e.timeStamp - lt < 80 && Math.abs(v) > 0.1) { v = Math.max(-4, Math.min(4, v)); coast(); }\n      else later();\n    }\n    view.addEventListener('touchend', up, { passive: true });\n    view.addEventListener('touchcancel', up, { passive: true });\n    sync();\n    if (mq.addEventListener) mq.addEventListener('change', sync); else if (mq.addListener) mq.addListener(sync);\n  }\n\n  function armAll() { [].forEach.call(document.querySelectorAll('[data-nt-marquee]'), arm); }\n  window.ntMarquee = { arm: arm };\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', armAll); else armAll();\n})();\n"],
  "mappings": "CAgBC,UAAY,CACX,aACA,GAAI,OAAO,WAAa,CAAC,OAAO,WAAY,OAE5C,SAAS,IAAI,KAAM,CACjB,IAAI,IAAM,MAAQ,CAAC,KAAK,YAAc,KAAK,cAAc,uBAAuB,EAChF,GAAI,CAAC,IAAK,OACV,KAAK,WAAa,GAClB,IAAI,GAAK,OAAO,WAAW,KAAK,aAAa,iBAAiB,GAAK,KAAK,EACpE,KAAO,GAAO,EAAI,EAAG,EAAI,EAAG,IAAM,EAAG,IAAM,GAC3C,GAAK,EAAG,GAAK,EAAG,GAAK,EAAG,GAAK,EAAG,GAAK,EAAG,EAAI,EAAG,KAAO,GAE1D,SAAS,MAAO,CAAE,OAAO,IAAI,sBAAsB,EAAE,MAAQ,CAAG,CAChE,SAAS,IAAI,EAAG,EAAG,CAAE,OAAK,GAAa,EAAI,EAAI,EAAU,EAAI,EAAI,EAAI,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