{
  "version": 3,
  "sources": ["explorer.js"],
  "sourcesContent": ["/*\n * static/js/explorer.js \u2014 the GPX Explorer's page (SNOW-1540, SNOW-1545).\n *\n * Wires templates/explorer/landing.html: the drop zone, the htmx upload,\n * and, on each result htmx swaps in, the map and the profile. The\n * arithmetic and the profile-to-map glue are explorer_core.js's, tested\n * there; this file owns the MapLibre canvas and the htmx events, which\n * jsdom cannot hold.\n *\n * ## The drop zone\n *\n * A <label> round a file input, so a click opens the picker with no\n * script. Here, a file dragged over it lights it, and a dropped file is put\n * on the input and announced as a `change`, which the form's\n * `hx-trigger=\"change\"` posts. The label reads its state\n * (`pwaExplorerCore.nextDropState`).\n *\n * ## The upload's failures swap too\n *\n * Every failure answers with the error fragment at a 4xx status, and htmx\n * swaps no 4xx by default, so `htmx:beforeSwap` lets the upload's own\n * statuses through (`SWAPPED_ERROR_STATUSES`).\n *\n * ## The map\n *\n * The trip page's pattern (trip_map.js): Snowdesk's default basemap\n * (`basemap_style_core.js`, from the page's `#trip-basemaps` catalogue),\n * no layers, the camera fitted to the track, cooperative gestures so the\n * page still scrolls past it, and +/\u2212. It is held to the supported area\n * (`maxBoundsFor`). The route is the shared drawing, in its legs at every\n * zoom (`installRoute`). A new upload removes the previous map first.\n * Past the Swiss border the winter style is extended as on /map/\n * (`map_beyond_switzerland.js`'s attach, with the page's\n * `[data-explorer]` carrying the same data-* URLs as /map/'s #map).\n *\n * ## The backdrop\n *\n * Before any file is drawn, the landing's card sits over the same\n * basemap, still and blurred, at Verbier (`backdropOptions`). The first\n * drawn result removes it and sets `data-explorer-state=\"result\"` on the\n * page, which lays the result out above the card instead.\n *\n * ## 3D and the compass (SNOW-1543)\n *\n * The result renders /map/'s 3D | 2D switch and compass hidden; each map\n * takes them as a control under its +/\u2212 (`attachControls`), and\n * `pwaExplorer3d.attach` (explorer_3d.js) and `pwaMapCompass.attach`\n * (map_compass.js) bind them to it. Both detaches go on `teardown`, so the\n * next upload starts clean.\n *\n * ## A leg, selected (Hugo's mockup, 23 Nov 2026)\n *\n * `route_profile.js` draws the lane with the day's lifts, and no stops. A\n * tap on the lane, or on the map within `MAP_PICK_TOLERANCE_PX` of the\n * line, selects the leg there (`pwaExplorerCore.legAtSegment`,\n * `legAtLineSegment`); a tap on it again, or on its card's \u00D7, clears it. The\n * selection is highlighted on the map and the profile (`highlightRow`) and\n * its card shown under the profile (`showLegCard`). The camera never moves.\n * From the keyboard, the profile takes focus and the arrow keys step\n * through the legs (`bindProfileKeys`).\n *\n * ## The timeline and Play (Hugo, 23 Nov 2026)\n *\n * A recorded day's payload carries `timeline`: its legs and stops as\n * blocks, by the clock. They are drawn under the profile\n * (`drawTimeline`), with hour ticks (`timelineTicks`). A tap on a leg's\n * block selects the leg; a tap on a stop's selects the stop, whose card\n * shows, with a dot on the map and the profile's cursor at its place.\n * Play runs the day in `PLAY_MS` (`createPlayback`): a dot moves along the\n * map and the profile, the card follows the leg or stop it is on, and the\n * readout beside Play is the time since the start.\n *\n * ## Skip stops (Hugo, 24 Nov 2026)\n *\n * The toggle at the right of the Play row squeezes the timeline's stops\n * to slivers, the legs widening to fill the bar, with a short animation\n * (`animateSqueeze`), so the day without its stops shows before Play.\n * Play then runs the legs back to back and the readout counts moving\n * time. The ticks and the leader band follow the squeezed bar. A stop's\n * sliver can still be tapped. The toggle is off at first and kept across\n * results (`skipStops`).\n *\n * ## Download GPX\n *\n * Saves the file the drop zone's input still holds (`saveFile`). Nothing\n * is sent.\n *\n * ## The leg strip (Hugo, 24 Nov 2026)\n *\n * The selected leg or stop sits on one line between the map and the\n * profile, in a strip of fixed height, so Play moves nothing under it. On\n * a phone its chevron opens it to two lines and it stays so, from leg to\n * leg and result to result (`setLegsOpen`); there is no \u00D7 there, so a tap\n * on the map away from the route clears the selection.\n *\n * ## Trimming legs, and Undo (SNOW-1560; Hugo, 24 Nov 2026)\n *\n * A recorded day's leg cards carry their edits in a \u22EF menu: the first or\n * last leg's \"Delete this leg\" and \"Delete all other legs\", a middle\n * leg's \"Delete previous legs\" and \"Delete subsequent legs\"; the day\n * header, once trimmed, carries Undo. Each works out the next state\n * (`pwaExplorerCore.trimKeep`, `keepWindow`, `createTrim`), writes it to\n * the drop zone form's hidden `trim_*` fields and posts the file again,\n * the camera held as the staff \"Smallest leg\" step holds it\n * (`holdCamera`). A file chosen afresh starts untrimmed (`bindFreshFile`).\n * Once trimmed, Download is a submit to /download/, rendered so by the\n * server.\n *\n * ## On a trip's page (SNOW-1571)\n *\n * A trip with a timed line renders the same review with its page\n * (templates/explorer/partials/_review.html, read-only: no Start again and\n * no trim), inside a `[data-explorer-review]` wrapper that carries\n * `data-explorer` and `data-default-basemap-key`. `init` draws it at once;\n * the drop-zone binders find nothing to bind. When the wrapper carries\n * `data-meeting-point` (lon, lat and label, as JSON), the map pins it with\n * the trip map's own marker (`pwaTripMapCore.installMeetingMarker`).\n *\n * ## Start again\n *\n * The day header's button asks first, in the browser's own dialog, as\n * the file on the page goes with it (Hugo, 24 Nov 2026). Confirmed, it\n * clears the result, the file, the trim and the\n * page's result state, and draws the blurred backdrop again, so the empty\n * page and its drop zone are back.\n */\n\n(function () {\n  'use strict';\n\n  var core = self.pwaExplorerCore;\n\n  /** Padding, in pixels, around the fitted track. */\n  var FIT_PADDING = 40;\n\n  /** SNOW-1571: the meeting marker's source and layer, on a trip's review. */\n  var MEETING_SOURCE = 'explorer-meeting-point';\n\n  // Server-translated copy (templates/explorer/_strings.html); the\n  // literals are the English fallback.\n  var STRINGS = self.pwaStrings.read('explorer-strings-template', {\n    'drop-idle': 'Drop a GPX file here',\n    'drop-over': 'Drop it to see it on the map',\n    'drop-busy': 'Reading your file\u2026',\n    'map-failed': \"The map couldn't be loaded. The profile below is unaffected.\",\n    'legs-keys': 'Elevation profile. Use the arrow keys to move from leg to leg.',\n    play: 'Play',\n    pause: 'Pause',\n    'start-again-confirm': 'Start again? This removes your GPX file from the page, along with any legs you have trimmed. The file on your device is not affected.',\n  });\n\n  var PROFILE_STRINGS = self.pwaStrings.read('route-profile-strings-template', {\n    'unit-m': '%(value)s m',\n    'unit-km': '%(value)s km',\n    'lane-label': 'Elevation profile of %(name)s',\n  });\n\n  /** The map the last result drew, removed when the next one arrives. */\n  var currentMap = null;\n  /** The last result's listeners, removed when the next one arrives. */\n  var teardown = [];\n  /**\n   * The view to keep when the staff \"Smallest leg\" control re-splits the\n   * same file, or null.\n   * @type {?{center: Object, zoom: number, bearing: number, pitch: number}}\n   */\n  var heldCamera = null;\n  /** Whether the map being replaced was in 3D, so the next one is too. */\n  var held3d = false;\n  /** Whether the current map is still loading on its way back into 3D. */\n  var resuming3d = false;\n  /** The drawn profile's segment count, which places the leader band's top. */\n  var profileSamples = 0;\n  /** The landing's blurred backdrop map, until a result replaces it. */\n  var backdropMap = null;\n  /** A phone's leg strip opened to two lines, kept across results. */\n  var legsOpen = false;\n  /** Skip stops (Hugo, 24 Nov 2026): on or off, kept across results. */\n  var skipStops = false;\n  /** How long the timeline takes to squeeze its stops or let them out. */\n  var SQUEEZE_MS = 320;\n\n  /** SNOW-1560: the trim, kept across results in the form's hidden fields. */\n  var trim = core.createTrim({\n    from: /** @type {HTMLInputElement|null} */ (document.querySelector('[data-explorer-trim-input=\"from\"]')),\n    to: /** @type {HTMLInputElement|null} */ (document.querySelector('[data-explorer-trim-input=\"to\"]')),\n    startLegs: /** @type {HTMLInputElement|null} */ (document.querySelector('[data-explorer-trim-input=\"startLegs\"]')),\n    endLegs: /** @type {HTMLInputElement|null} */ (document.querySelector('[data-explorer-trim-input=\"endLegs\"]')),\n  });\n  /**\n   * Posts the file the drop zone holds again, without clearing the trim;\n   * set once the input is bound.\n   * @type {function(): void}\n   */\n  var repost = function () {};\n\n  /**\n   * Bind the drop zone's drag-and-drop and its label.\n   *\n   * @param {HTMLFormElement} form\n   */\n  function bindDropZone(form) {\n    var zone = form.querySelector('[data-explorer-drop]');\n    var input = /** @type {HTMLInputElement|null} */ (form.querySelector('[data-explorer-input]'));\n    var label = form.querySelector('[data-explorer-drop-label]');\n    if (!zone || !input) return;\n    var state = 'idle';\n    // SNOW-1560: a file the visitor chooses starts untrimmed; the page's\n    // own re-posts keep the trim.\n    repost = core.bindFreshFile(input, function () { trim.clear(); }).repost;\n\n    function step(event) {\n      state = core.nextDropState(state, event);\n      zone.setAttribute('data-state', state);\n      if (label) label.textContent = core.dropLabel(state, STRINGS);\n    }\n\n    ['dragenter', 'dragover'].forEach(function (type) {\n      zone.addEventListener(type, function (event) {\n        event.preventDefault();\n        if (type === 'dragenter' || state === 'idle') step('dragenter');\n      });\n    });\n    zone.addEventListener('dragleave', function (event) {\n      if (!zone.contains(/** @type {Node|null} */ (event.relatedTarget))) step('dragleave');\n    });\n    zone.addEventListener('drop', function (event) {\n      event.preventDefault();\n      var files = event.dataTransfer && event.dataTransfer.files;\n      if (!files || !files.length) {\n        step('settle');\n        return;\n      }\n      input.files = files;\n      input.dispatchEvent(new Event('change', { bubbles: true }));\n    });\n    // The page is at work for the whole request: the drop zone on the\n    // landing card, or a staff re-split's fade and bar on the result.\n    var root = document.querySelector('[data-explorer]');\n    form.addEventListener('htmx:beforeRequest', function () {\n      step('request');\n      if (root) root.setAttribute('data-explorer-busy', '');\n    });\n    form.addEventListener('htmx:afterRequest', function (event) {\n      step('settle');\n      if (root) root.removeAttribute('data-explorer-busy');\n      // SNOW-1542: a drawn result's \"Open this route in Snowdesk\" submits\n      // this form, so a drawn result keeps the file. After a failure the\n      // same file chosen again must still post, so it is cleared.\n      var detail = /** @type {CustomEvent} */ (event).detail || {};\n      if (!core.keepsFile(detail.xhr && detail.xhr.status)) input.value = '';\n    });\n  }\n\n  /**\n   * Let the upload's error fragment swap in. htmx fires `htmx:beforeSwap`\n   * on the swap's target, so this is bound to the result area.\n   *\n   * @param {Event} event\n   */\n  function allowErrorSwap(event) {\n    var detail = event.detail || {};\n    var status = detail.xhr && detail.xhr.status;\n    if (core.SWAPPED_ERROR_STATUSES.indexOf(status) !== -1) {\n      detail.shouldSwap = true;\n      detail.isError = false;\n    }\n  }\n\n  /** Remove the previous result's map and listeners. */\n  function clearResult() {\n    teardown.forEach(function (fn) { fn(); });\n    teardown = [];\n    if (currentMap) {\n      currentMap.remove();\n      currentMap = null;\n    }\n  }\n\n  /**\n   * Draw the profile, with the day's lifts, and return the view.\n   *\n   * @param {Element} root The `[data-explorer-profile]` element.\n   * @param {Object} feature The payload's route Feature.\n   * @param {string} name The route's name, for the lane's label.\n   * @returns {?Object} The profile view, or null.\n   */\n  function drawProfile(root, feature, name) {\n    if (!self.pwaRouteProfile) return null;\n    var view = self.pwaRouteProfile.mount(root, PROFILE_STRINGS);\n    if (!view) return null;\n    var read = self.pwaRouteProfile.read(feature);\n    profileSamples = read.sampleCount;\n    view.draw(read.profile, read.legs, read.sampleCount, read.spanM, name, read.lifts, []);\n    return view;\n  }\n\n  /**\n   * Wire the selection, a leg or a stop: the profile, the map, the\n   * timeline, the cards and their \u00D7, and Play.\n   *\n   * @param {Object} payload The upload's payload.\n   * @param {?Object} view The profile view, or null.\n   * @returns {?Object} The leg selection, for the map's tap.\n   */\n  function bindLegs(payload, view) {\n    var rows = Array.isArray(payload.breakdown) ? payload.breakdown : [];\n    var cards = document.querySelector('[data-explorer-legs]');\n    if (!rows.length) return null;\n    var line = (payload.route.geometry && payload.route.geometry.coordinates) || [];\n    var tl = payload.timeline && Array.isArray(payload.timeline.blocks) ? payload.timeline : null;\n    var blocks = tl ? tl.blocks : [];\n    var rects = [];\n    /** The selected stop's block index, or null. */\n    var stop = null;\n    /** Where Play is, while it runs: a block index and a position. */\n    var playhead = null;\n\n    function setMark(point) {\n      var source = currentMap && currentMap.getSource(core.MARK_SOURCE);\n      if (source) source.setData(core.markData(point));\n    }\n\n    function render() {\n      var row = selection.current();\n      var leg = row ? rows.indexOf(row) : null;\n      core.highlightRow(currentMap, view, payload.route, row);\n      // A stop has time but no stretch: every leg fades while it is on.\n      if (view && view.lane && stop !== null) view.lane.setAttribute('data-highlighting', '');\n      if (cards) core.showCard(cards, row ? { leg: leg } : stop !== null ? { stop: stop } : null);\n      rects.forEach(function (rect, i) {\n        var on = (row && blocks[i].leg === leg) || stop === i;\n        if ((row || stop !== null) && !on) rect.setAttribute('data-dim', '');\n        else rect.removeAttribute('data-dim');\n        rect.toggleAttribute('data-on', !!on);\n      });\n      drawLeader(row, leg);\n      if (playhead) {\n        setMark(core.pointOnLine(line, playhead.vertex));\n        if (view) view.cursor(Math.round(playhead.segment));\n      } else if (stop !== null) {\n        setMark(core.pointOnLine(line, blocks[stop].point_from));\n        if (view) view.cursor(blocks[stop].from);\n      } else {\n        setMark(null);\n        if (view) view.cursor(null);\n      }\n    }\n\n    var leader = document.querySelector('[data-explorer-leader-band]');\n    /** Where a second of the day sits on the bar, 0 to 1, as it is laid out. */\n    var barAt = null;\n\n    /**\n     * Draw the band from the selected leg on the profile to its blocks on\n     * the timeline, or hide it with no leg selected.\n     *\n     * @param {?Object} row The selected leg.\n     * @param {?number} leg Its index in the breakdown.\n     */\n    function drawLeader(row, leg) {\n      if (!leader) return;\n      var band = tl && leg !== null\n        ? core.leaderBand(row, leg, blocks, profileSamples, tl.total_s, barAt)\n        : null;\n      if (!band) {\n        leader.setAttribute('visibility', 'hidden');\n        return;\n      }\n      var x = band.top.concat(band.bottom).map(function (f) { return (f * 1000).toFixed(1); });\n      leader.setAttribute('data-kind', row.kind);\n      var paths = core.leaderPaths(x, 44);\n      var outline = leader.querySelector('.explorer-leader-band');\n      if (outline) outline.setAttribute('d', paths.band);\n      leader.querySelectorAll('.explorer-leader-edge').forEach(function (edge, i) {\n        if (paths.edges[i]) edge.setAttribute('d', paths.edges[i]);\n      });\n      leader.setAttribute('visibility', 'visible');\n    }\n\n    var selection = core.createLegSelection(function (row) {\n      if (row) stop = null;\n      render();\n    });\n\n    /** Select a stop, or clear it on a second tap. */\n    function selectStop(i, toggle) {\n      stop = toggle && stop === i ? null : i;\n      if (selection.current()) selection.clear();\n      else render();\n    }\n\n    /** Put the selection on whatever the playhead is over, without toggling. */\n    function follow(i) {\n      var block = blocks[i];\n      if (block.leg === null) {\n        if (stop !== i) selectStop(i, false);\n        return;\n      }\n      var row = rows[block.leg];\n      if (selection.current() !== row) selection.select(row);\n    }\n\n    if (view) {\n      teardown.push(core.bindProfilePick(view, view.lane, function (index) {\n        var row = core.legAtSegment(rows, index);\n        if (row) selection.select(row);\n      }));\n      teardown.push(core.bindProfileKeys(view.lane, rows, selection, STRINGS['legs-keys']));\n      // The focus ring shows for the keyboard only (Tab or the arrows): a\n      // tap or a click leaves none, and nor does a shortcut such as a\n      // screenshot's (Hugo, 24 Nov 2026).\n      var lane = view.lane;\n      var onKey = function (event) {\n        if (core.movesFocus(event)) lane.setAttribute('data-keyed', '');\n      };\n      var onPointer = function () { lane.removeAttribute('data-keyed'); };\n      document.addEventListener('keydown', onKey, true);\n      document.addEventListener('pointerdown', onPointer, true);\n      teardown.push(function () {\n        document.removeEventListener('keydown', onKey, true);\n        document.removeEventListener('pointerdown', onPointer, true);\n      });\n    }\n    /** Clear the leg or the stop, and pause Play. */\n    function clearAll() {\n      if (playback) playback.pause();\n      playhead = null;\n      stop = null;\n      if (selection.current()) selection.clear();\n      else render();\n    }\n    if (cards) {\n      // A phone's strip keeps its two lines from one result to the next\n      // (Hugo, 24 Nov 2026): a trim re-renders it.\n      setLegsOpen(cards, legsOpen);\n      var onClear = function (event) {\n        var target = /** @type {Element} */ (event.target);\n        if (!target.closest) return;\n        if (target.closest('[data-action=\"clear-leg\"]')) clearAll();\n        else if (target.closest('[data-action=\"expand-legs\"]')) setLegsOpen(cards, !legsOpen);\n      };\n      cards.addEventListener('click', onClear);\n      teardown.push(function () { cards.removeEventListener('click', onClear); });\n    }\n\n    var playback = tl ? bindTimeline(tl, {\n      onRects: function (drawn) { rects = drawn; },\n      onLayout: function (at) {\n        barAt = at;\n        var row = selection.current();\n        drawLeader(row, row ? rows.indexOf(row) : null);\n      },\n      onPick: function (i) {\n        playback.pause();\n        playhead = null;\n        var block = blocks[i];\n        if (block.leg === null) selectStop(i, true);\n        else selection.select(rows[block.leg]);\n      },\n      onFrame: function (t) {\n        var i = core.blockAt(blocks, t);\n        playhead = core.positionAt(blocks[i], t);\n        follow(i);\n        render();\n      },\n    }) : null;\n    return { select: selection.select, current: selection.current, clear: clearAll };\n  }\n\n  /**\n   * Open or close a phone's leg strip to two lines (Hugo, 24 Nov 2026),\n   * and remember it for the next result.\n   *\n   * @param {Element} strip The `[data-explorer-legs]` strip.\n   * @param {boolean} open Two lines, or one.\n   */\n  function setLegsOpen(strip, open) {\n    legsOpen = open;\n    strip.toggleAttribute('data-open', open);\n    strip.querySelectorAll('[data-action=\"expand-legs\"]').forEach(function (button) {\n      button.setAttribute('aria-expanded', String(open));\n    });\n  }\n\n  /**\n   * Draw the timeline and bind its taps, its ticks and Play.\n   *\n   * @param {{clock_s: number, total_s: number, blocks: Array<Object>}} tl The payload's timeline.\n   * @param {{onRects: function(Array<Element>): void, onLayout: function(function(number): number): void,\n   *   onPick: function(number): void, onFrame: function(number): void}} hooks\n   * @returns {?Object} The playback, or null with no timeline on the page.\n   */\n  function bindTimeline(tl, hooks) {\n    var root = document.querySelector('[data-explorer-timeline]');\n    var svg = root && root.querySelector('[data-explorer-timeline-bar]');\n    if (!root || !svg) return null;\n    var head = svg.querySelector('[data-explorer-timeline-head]');\n    var button = root.querySelector('[data-action=\"play\"]');\n    var readout = root.querySelector('[data-explorer-elapsed]');\n    var skip = root.querySelector('[data-action=\"skip-stops\"]');\n    var blocks = tl.blocks;\n    var barPx = svg.getBoundingClientRect().width;\n    var byClock = core.timelineLayout(blocks, tl.total_s, null);\n    var squeezed = core.timelineLayout(blocks, tl.total_s, core.squeezedStopWidth(barPx));\n    var movingS = core.movingSeconds(blocks, tl.total_s);\n    var lastLegEnd = core.lastLegEnd(blocks);\n    var squeeze = skipStops ? 1 : 0;\n    var layout = core.mixLayout(byClock, squeezed, squeeze);\n    var rects = core.drawTimeline(svg, blocks, tl.total_s, layout);\n    if (head) svg.appendChild(head);\n    hooks.onRects(rects);\n\n    /** @param {number} t @returns {number} Where `t` sits on the bar, 0 to 1. */\n    var barAt = function (t) { return core.timelineX(layout, blocks, t) / 1000; };\n    /** @param {number} t @returns {string} The readout at `t`. */\n    var label = function (t) {\n      return skipStops\n        ? core.elapsedLabel(core.movingSeconds(blocks, t)) + ' / ' + core.elapsedLabel(movingS)\n        : core.elapsedLabel(t) + ' / ' + core.elapsedLabel(tl.total_s);\n    };\n\n    var ticks = root.querySelector('[data-explorer-timeline-ticks]');\n    var narrow = barPx < 600;\n    function drawTicks() {\n      if (!ticks) return;\n      ticks.textContent = '';\n      core.timelineTicks(tl.clock_s, tl.total_s, narrow ? 2 : 1, barAt).forEach(function (tick) {\n        var span = document.createElement('span');\n        span.className = 'absolute';\n        span.style.left = (tick.at * 100) + '%';\n        span.style.transform = tick.at === 0 ? 'none' : tick.at === 1 ? 'translateX(-100%)' : 'translateX(-50%)';\n        span.textContent = tick.label;\n        ticks.appendChild(span);\n      });\n    }\n\n    /** @param {number} t Put the head and the readout at `t`. */\n    function showAt(t) {\n      if (head) {\n        var x = String(barAt(t) * 1000);\n        head.setAttribute('x1', x);\n        head.setAttribute('x2', x);\n        head.setAttribute('visibility', 'visible');\n      }\n      if (readout) readout.textContent = label(t);\n    }\n\n    /** Lay the bar out at the squeeze, 0 by the clock to 1 squeezed. */\n    function place() {\n      layout = core.mixLayout(byClock, squeezed, squeeze);\n      core.placeTimeline(rects, layout);\n      drawTicks();\n      if (head && head.getAttribute('visibility') === 'visible') showAt(playback.time());\n      hooks.onLayout(barAt);\n    }\n\n    var frameId = 0;\n    /** Squeeze the stops, or let them out, over SQUEEZE_MS. */\n    function animateSqueeze(target) {\n      cancelAnimationFrame(frameId);\n      var from = squeeze;\n      var reduced = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n      if (reduced) {\n        squeeze = target;\n        place();\n        return;\n      }\n      var started = null;\n      var step = function (now) {\n        if (started === null) started = now;\n        var f = Math.min((now - started) / SQUEEZE_MS, 1);\n        var eased = f < 0.5 ? 2 * f * f : 1 - Math.pow(-2 * f + 2, 2) / 2;\n        squeeze = from + (target - from) * eased;\n        place();\n        if (f < 1) frameId = requestAnimationFrame(step);\n      };\n      frameId = requestAnimationFrame(step);\n    }\n\n    var onClick = function (event) {\n      var target = /** @type {Element} */ (event.target);\n      var rect = target.closest && target.closest('[data-timeline-block]');\n      if (rect) hooks.onPick(Number(rect.getAttribute('data-timeline-block')));\n    };\n    svg.addEventListener('click', onClick);\n\n    var playback = core.createPlayback({\n      totalS: tl.total_s,\n      // The head crosses the bar in PLAY_MS either way: skipping, the\n      // legs' seconds fill it and each stop is jumped.\n      step: function (t, ms) {\n        if (!skipStops) return t + (ms * tl.total_s) / core.PLAY_MS;\n        // By moving time, so a frame that crosses a stop keeps its share.\n        var at = core.clockAtMoving(blocks, core.movingSeconds(blocks, t) + (ms * movingS) / core.PLAY_MS);\n        return at === null ? tl.total_s : at;\n      },\n      onFrame: function (t) {\n        showAt(t);\n        // A day that ends in a stop ends, skipping, on its last leg.\n        hooks.onFrame(skipStops ? Math.min(t, lastLegEnd) : t);\n      },\n      onState: function (playing) {\n        if (button) button.textContent = playing ? STRINGS.pause : STRINGS.play;\n      },\n    });\n    var onPlay = function () { playback.toggle(); };\n    if (button) button.addEventListener('click', onPlay);\n\n    /** Show the toggle's state: pressed, and the bar marked for the CSS. */\n    function showSkip() {\n      if (skip) skip.setAttribute('aria-pressed', String(skipStops));\n      svg.toggleAttribute('data-skip-stops', skipStops);\n    }\n    var onSkip = function () {\n      skipStops = !skipStops;\n      showSkip();\n      if (skipStops) {\n        var t = playback.time();\n        var next = core.skipStop(blocks, t);\n        // Paused in a stop, or Play on one: on to the next leg.\n        if (next !== t) {\n          playback.seek(next);\n          if (head && head.getAttribute('visibility') === 'visible') hooks.onFrame(Math.min(next, lastLegEnd));\n        }\n      }\n      if (head && head.getAttribute('visibility') === 'visible') showAt(playback.time());\n      else if (readout) readout.textContent = label(0);\n      animateSqueeze(skipStops ? 1 : 0);\n    };\n    if (skip) skip.addEventListener('click', onSkip);\n    showSkip();\n    drawTicks();\n    if (readout) readout.textContent = label(0);\n    hooks.onLayout(barAt);\n\n    teardown.push(function () {\n      playback.pause();\n      cancelAnimationFrame(frameId);\n      svg.removeEventListener('click', onClick);\n      if (button) button.removeEventListener('click', onPlay);\n      if (skip) skip.removeEventListener('click', onSkip);\n    });\n    return playback;\n  }\n\n  /** Clear the result and show the empty page, with its drop zone, again. */\n  function startAgain() {\n    clearResult();\n    var result = document.querySelector('[data-explorer-result]');\n    if (result) result.innerHTML = '';\n    var input = /** @type {HTMLInputElement|null} */ (document.querySelector('[data-explorer-input]'));\n    if (input) input.value = '';\n    var minLeg = /** @type {HTMLInputElement|null} */ (document.querySelector('[data-explorer-min-leg-input]'));\n    if (minLeg) minLeg.value = '';\n    trim.clear();\n    heldCamera = null;\n    held3d = false;\n    var root = document.querySelector('[data-explorer]');\n    if (root) root.removeAttribute('data-explorer-state');\n    var backdrop = document.querySelector('[data-explorer-backdrop]');\n    if (backdrop && !backdropMap) drawBackdrop(/** @type {HTMLElement} */ (backdrop));\n    (document.scrollingElement || document.documentElement).scrollTop = 0;\n  }\n\n  /**\n   * Bind the staff \"Smallest leg\" control (Hugo, 23 Nov 2026). A step\n   * posts the file the drop zone still holds again, with the new height,\n   * and the camera is kept for the redraw.\n   */\n  function bindMinLeg() {\n    var control = document.querySelector('[data-explorer-min-leg]');\n    var field = /** @type {HTMLInputElement|null} */ (document.querySelector('[data-explorer-min-leg-input]'));\n    var input = /** @type {HTMLInputElement|null} */ (document.querySelector('[data-explorer-input]'));\n    if (!control || !field || !input || !input.files || !input.files.length) return;\n    /** @param {Event} event */\n    function onClick(event) {\n      var button = /** @type {Element} */ (event.target).closest('[data-action=\"min-leg-step\"]');\n      if (!button || !control || !field || !input) return;\n      var current = Number(control.getAttribute('data-explorer-min-leg'));\n      var next = core.nextMinLeg(current, Number(button.getAttribute('data-step')));\n      if (next === current) return;\n      field.value = String(next);\n      // One re-split at a time: the swap brings a fresh, enabled stepper,\n      // so a click while this one is in flight cannot be lost.\n      control.querySelectorAll('[data-action=\"min-leg-step\"]').forEach(function (step) {\n        /** @type {HTMLButtonElement} */ (step).disabled = true;\n      });\n      control.setAttribute('aria-busy', 'true');\n      holdCamera();\n      repost();\n    }\n    control.addEventListener('click', onClick);\n    teardown.push(function () { control.removeEventListener('click', onClick); });\n  }\n\n  /** Keep the map's view, and its 3D, for the redraw a re-post brings. */\n  function holdCamera() {\n    // Still 3D if an earlier step's map is on its way back into it.\n    held3d = held3d || resuming3d || document.documentElement.dataset.mapView === '3d';\n    if (currentMap) {\n      heldCamera = {\n        center: currentMap.getCenter(),\n        zoom: currentMap.getZoom(),\n        bearing: currentMap.getBearing(),\n        pitch: currentMap.getPitch(),\n      };\n    }\n  }\n\n  /**\n   * Bind the leg menu's edits and Undo (SNOW-1560; Hugo, 24 Nov 2026).\n   * Each writes the trim's next state to the form's hidden fields and\n   * posts the file again, the camera held.\n   *\n   * @param {Object} payload The upload's payload.\n   */\n  function bindTrim(payload) {\n    var layout = document.querySelector('[data-explorer-layout]');\n    var input = /** @type {HTMLInputElement|null} */ (document.querySelector('[data-explorer-input]'));\n    if (!layout || !input || !input.files || !input.files.length) return;\n    var blocks = payload.timeline && Array.isArray(payload.timeline.blocks) ? payload.timeline.blocks : [];\n    /** @param {Event} event */\n    function onClick(event) {\n      var target = /** @type {Element} */ (event.target);\n      var button = target.closest && target.closest('[data-action=\"trim-legs\"], [data-action=\"undo-trim\"]');\n      if (!button) return;\n      var changed;\n      if (button.getAttribute('data-action') === 'undo-trim') {\n        changed = trim.undo();\n      } else {\n        var rows = payload.breakdown || [];\n        var keep = core.trimKeep(\n          button.getAttribute('data-trim') || '',\n          Number(button.getAttribute('data-leg')),\n          rows.length,\n        );\n        changed = !!keep && trim.cut(\n          core.keepWindow(rows, blocks, payload.started_at, trim.state(), keep.from, keep.to),\n          keep.from,\n          rows.length - 1 - keep.to,\n        );\n      }\n      if (!changed) return;\n      // One re-post at a time: the swap brings fresh, enabled buttons.\n      /** @type {HTMLButtonElement} */ (button).disabled = true;\n      holdCamera();\n      repost();\n    }\n    layout.addEventListener('click', onClick);\n    teardown.push(function () { layout.removeEventListener('click', onClick); });\n  }\n\n  /**\n   * Bind the day header's Start again: beside the title from `sm` up, and\n   * in the phone's fold.\n   */\n  function bindStartAgain() {\n    function onClick() {\n      if (core.confirmStartAgain(STRINGS['start-again-confirm'])) startAgain();\n    }\n    document.querySelectorAll('[data-action=\"start-again\"]').forEach(function (button) {\n      button.addEventListener('click', onClick);\n      teardown.push(function () { button.removeEventListener('click', onClick); });\n    });\n  }\n\n  /** Bind the phone's day fold: its chevron opens the key and Start again. */\n  function bindDayToggle() {\n    var day = document.querySelector('[data-explorer-day]');\n    var button = day && day.querySelector('[data-action=\"toggle-day\"]');\n    if (!day || !button) return;\n    function onClick() {\n      var open = !day.hasAttribute('data-open');\n      day.toggleAttribute('data-open', open);\n      /** @type {Element} */ (button).setAttribute('aria-expanded', String(open));\n    }\n    button.addEventListener('click', onClick);\n    teardown.push(function () { button.removeEventListener('click', onClick); });\n  }\n\n  /**\n   * Select the leg nearest a tap on the map, if the tap is on the line.\n   *\n   * @param {Object} map The MapLibre map.\n   * @param {Object} payload The upload's payload.\n   * @param {Object} selection The page's leg selection.\n   * @param {{x: number, y: number}} point The tap, in the map's pixels.\n   */\n  function pickOnMap(map, payload, selection, point) {\n    var coordinates = (payload.route.geometry && payload.route.geometry.coordinates) || [];\n    var projected = coordinates.map(function (c) { return map.project([c[0], c[1]]); });\n    var segment = core.nearestSegment(projected, point, core.MAP_PICK_TOLERANCE_PX);\n    var row = core.legAtLineSegment(payload.breakdown || [], segment);\n    // A tap away from the route clears the selection: a phone's strip has\n    // no \u00D7 (Hugo, 24 Nov 2026).\n    if (row) selection.select(row);\n    else selection.clear();\n  }\n\n  /** Bind Download GPX to the file the drop zone still holds. */\n  function bindDownload() {\n    var button = document.querySelector('[data-action=\"download-gpx\"]');\n    var input = /** @type {HTMLInputElement|null} */ (document.querySelector('[data-explorer-input]'));\n    if (!button || !input) return;\n    var onClick = function () {\n      core.saveFile(input.files && input.files[0], document);\n    };\n    button.addEventListener('click', onClick);\n    teardown.push(function () { button.removeEventListener('click', onClick); });\n  }\n\n  /**\n   * Resolve Snowdesk's default basemap's style, from the page's catalogue.\n   *\n   * @param {?Element} root The page's `[data-explorer]` element.\n   * @returns {Promise<string|Object>} The style, or its URL, or ''.\n   */\n  async function resolveStyle(root) {\n    var styleCore = self.pwaBasemapStyleCore;\n    var basemap = styleCore && styleCore.resolveBasemap(\n      null,\n      core.readPayload(document, 'trip-basemaps'),\n      (root && root.getAttribute('data-default-basemap-key')) || '',\n    );\n    if (!basemap) return '';\n    try {\n      return await styleCore.resolveStyle(basemap.key, basemap.url);\n    } catch (_err) {\n      return basemap.url;\n    }\n  }\n\n  /**\n   * Draw the landing's still, blurred map behind the card. Without\n   * MapLibre or a style the backdrop stays the page's plain background.\n   *\n   * @param {HTMLElement} container The `[data-explorer-backdrop]` element.\n   */\n  async function drawBackdrop(container) {\n    if (typeof maplibregl === 'undefined') return;\n    var style = await resolveStyle(document.querySelector('[data-explorer]'));\n    if (!style || document.querySelector('[data-explorer][data-explorer-state=\"result\"]')) return;\n    backdropMap = new maplibregl.Map(core.backdropOptions(container, style));\n    core.collapseAttribution(backdropMap);\n  }\n\n  /** Lay the page out for a drawn result, dropping the backdrop. */\n  function showResultLayout() {\n    var root = document.querySelector('[data-explorer]');\n    if (root) root.setAttribute('data-explorer-state', 'result');\n    if (backdropMap) {\n      backdropMap.remove();\n      backdropMap = null;\n    }\n  }\n\n  /**\n   * Draw the map, once its style resolves.\n   *\n   * @param {HTMLElement} container The `[data-explorer-map]` element.\n   * @param {Object} payload The upload's payload.\n   * @param {?Object} selection The page's leg selection, or null.\n   */\n  async function drawMap(container, payload, selection) {\n    if (typeof maplibregl === 'undefined') {\n      container.textContent = STRINGS['map-failed'];\n      return;\n    }\n    var root = document.querySelector('[data-explorer]');\n    var style = await resolveStyle(root);\n    var feature = payload.route;\n    var map = new maplibregl.Map({\n      container: container,\n      style: style,\n      bounds: core.fitBoundsFor(payload.bounds) || undefined,\n      fitBoundsOptions: { padding: FIT_PADDING },\n      maxBounds: core.maxBoundsFor(payload.max_bounds, payload.bounds) || undefined,\n      attributionControl: { compact: true },\n      cooperativeGestures: true,\n    });\n    currentMap = map;\n    core.collapseAttribution(map);\n    // A staff re-split keeps the view the last map had. In 3D the camera\n    // goes back once the relief is on (below), past the flat pitch ceiling.\n    var camera = heldCamera;\n    var resume3d = held3d;\n    heldCamera = null;\n    held3d = false;\n    resuming3d = resume3d;\n    if (camera && !resume3d) map.jumpTo(camera);\n    // The winter style past the Swiss border, as on /map/: without it a\n    // track in Chamonix or St Anton sits on a blank map. Off the flag, or\n    // with the script absent, the map is the winter style alone.\n    if (typeof self.pwaBeyondSwitzerlandAttach === 'function') {\n      self.pwaBeyondSwitzerlandAttach(map, /** @type {HTMLElement} */ (root));\n    }\n    map.addControl(new maplibregl.NavigationControl({ showCompass: false }), 'top-right');\n    attachControls(map, resume3d);\n    if (resume3d) {\n      map.once('style.load', function () {\n        resuming3d = false;\n        if (camera) map.jumpTo(camera);\n      });\n    }\n    var meeting = meetingPointOf(root);\n    map.on('style.load', function () {\n      core.installRoute(map, feature);\n      // SNOW-1571: on a trip's page, the meeting point, with the trip\n      // map's own marker, over the line.\n      if (meeting && self.pwaTripMapCore) {\n        self.pwaTripMapCore.installMeetingMarker(map, MEETING_SOURCE, MEETING_SOURCE, meeting);\n      }\n    });\n    if (selection) {\n      map.on('click', function (event) {\n        pickOnMap(map, payload, selection, event.point);\n      });\n    }\n  }\n\n  /**\n   * Hand the result's 3D switch and compass to the map, under its +/\u2212, and\n   * bind them to it. Either is skipped when its script is absent.\n   *\n   * @param {Object} map The MapLibre map.\n   * @param {boolean} resume3d Open it in 3D: the map it replaces was.\n   */\n  function attachControls(map, resume3d) {\n    var controls = /** @type {HTMLElement|null} */ (document.querySelector('[data-explorer-map-controls]'));\n    if (!controls) return;\n    map.addControl({\n      onAdd: function () {\n        controls.hidden = false;\n        return controls;\n      },\n      onRemove: function () {\n        controls.remove();\n      },\n    }, 'top-right');\n    var toggle = /** @type {HTMLElement|null} */ (controls.querySelector('#map-view-toggle'));\n    var compass = /** @type {HTMLElement|null} */ (controls.querySelector('#map-compass'));\n    if (toggle && self.pwaExplorer3d) {\n      teardown.push(self.pwaExplorer3d.attach(map, {\n        toggle: toggle,\n        toast: document.getElementById('explorer-3d-toast'),\n        maplibre: maplibregl,\n        routePrefix: core.ROUTE_PREFIX,\n        resume3d: resume3d,\n      }));\n    }\n    if (compass && self.pwaMapCompass) teardown.push(self.pwaMapCompass.attach(map, compass));\n  }\n\n  /**\n   * Read the meeting point a trip's review carries (SNOW-1571).\n   *\n   * @param {?Element} root The page's `[data-explorer]` element.\n   * @returns {?{type: string, features: Array<Object>}} A one-Point\n   *   FeatureCollection, or null with no usable `data-meeting-point`.\n   */\n  function meetingPointOf(root) {\n    var raw = root && root.getAttribute('data-meeting-point');\n    if (!raw) return null;\n    var point;\n    try {\n      point = JSON.parse(raw);\n    } catch (_err) {\n      return null;\n    }\n    if (!point || typeof point.lon !== 'number' || typeof point.lat !== 'number') return null;\n    return {\n      type: 'FeatureCollection',\n      features: [{\n        type: 'Feature',\n        geometry: { type: 'Point', coordinates: [point.lon, point.lat] },\n        properties: { label: typeof point.label === 'string' ? point.label : '' },\n      }],\n    };\n  }\n\n  /** Draw whatever the last swap put in the result area. */\n  function drawResult() {\n    clearResult();\n    var payload = core.readPayload(document, 'explorer-payload');\n    if (!payload || !payload.route) return;\n    showResultLayout();\n    var profile = document.querySelector('[data-explorer-profile]');\n    var name = document.querySelector('[data-testid=\"explorer-route-name\"]');\n    var view = profile\n      ? drawProfile(profile, payload.route, name ? name.textContent.trim() : '')\n      : null;\n    var selection = bindLegs(payload, view);\n    var container = document.querySelector('[data-explorer-map]');\n    if (container) drawMap(/** @type {HTMLElement} */ (container), payload, selection);\n    bindDownload();\n    bindStartAgain();\n    bindDayToggle();\n    bindMinLeg();\n    bindTrim(payload);\n  }\n\n  /** Bind the page, once. */\n  function init() {\n    var form = document.querySelector('[data-explorer-form]');\n    if (form) bindDropZone(/** @type {HTMLFormElement} */ (form));\n    var backdrop = document.querySelector('[data-explorer-backdrop]');\n    if (backdrop) drawBackdrop(/** @type {HTMLElement} */ (backdrop));\n    var result = document.querySelector('[data-explorer-result]');\n    if (result) {\n      result.addEventListener('htmx:beforeSwap', allowErrorSwap);\n      result.addEventListener('htmx:afterSettle', drawResult);\n    }\n    // SNOW-1571: a trip's page renders its review with the page, so there\n    // is no swap to wait for.\n    if (document.querySelector('[data-explorer-review]')) drawResult();\n  }\n\n  if (document.readyState === 'loading') {\n    document.addEventListener('DOMContentLoaded', init);\n  } else {\n    init();\n  }\n})();\n"],
  "mappings": "CA+HC,UAAY,CACX,aAEA,IAAIA,EAAO,KAAK,gBAGZC,GAAc,GAGdC,EAAiB,yBAIjBC,EAAU,KAAK,WAAW,KAAK,4BAA6B,CAC9D,YAAa,uBACb,YAAa,+BACb,YAAa,0BACb,aAAc,+DACd,YAAa,iEACb,KAAM,OACN,MAAO,QACP,sBAAuB,uIACzB,CAAC,EAEGC,GAAkB,KAAK,WAAW,KAAK,iCAAkC,CAC3E,SAAU,cACV,UAAW,eACX,aAAc,+BAChB,CAAC,EAGGC,EAAa,KAEbC,EAAW,CAAC,EAMZC,EAAa,KAEbC,EAAS,GAETC,EAAa,GAEbC,EAAiB,EAEjBC,EAAc,KAEdC,EAAW,GAEXC,EAAY,GAEZC,GAAa,IAGbC,EAAOf,EAAK,WAAW,CACzB,KAA4C,SAAS,cAAc,mCAAmC,EACtG,GAA0C,SAAS,cAAc,iCAAiC,EAClG,UAAiD,SAAS,cAAc,wCAAwC,EAChH,QAA+C,SAAS,cAAc,sCAAsC,CAC9G,CAAC,EAMGgB,EAAS,UAAY,CAAC,EAO1B,SAASC,GAAaC,EAAM,CAC1B,IAAIC,EAAOD,EAAK,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ACuC,GAAW,CAACA,EAAQ,OACzB,CAAA6G,GAAiB,EACjB,IAAIW,EAAU,SAAS,cAAc,yBAAyB,EAC1D5H,EAAO,SAAS,cAAc,qCAAqC,EACnEC,EAAO2H,EACP9H,GAAY8H,EAASxH,EAAQ,MAAOJ,EAAOA,EAAK,YAAY,KAAK,EAAI,EAAE,EACvE,KACAkB,EAAYf,GAASC,EAASH,CAAI,EAClC8G,EAAY,SAAS,cAAc,qBAAqB,EACxDA,GAAWG,GAAoCH,EAAY3G,EAASc,CAAS,EACjFyF,GAAa,EACbT,GAAe,EACfC,GAAc,EACdT,GAAW,EACXK,GAAS3F,CAAO,EAClB,CAGA,SAASyH,IAAO,CACd,IAAI9I,EAAO,SAAS,cAAc,sBAAsB,EACpDA,GAAMD,GAA6CC,CAAK,EAC5D,IAAIyG,EAAW,SAAS,cAAc,0BAA0B,EAC5DA,GAAUC,GAAyCD,CAAS,EAChE,IAAIF,EAAS,SAAS,cAAc,wBAAwB,EACxDA,IACFA,EAAO,iBAAiB,kBAAmB5F,EAAc,EACzD4F,EAAO,iBAAiB,mBAAoBqC,EAAU,GAIpD,SAAS,cAAc,wBAAwB,GAAGA,GAAW,CACnE,CAEI,SAAS,aAAe,UAC1B,SAAS,iBAAiB,mBAAoBE,EAAI,EAElDA,GAAK,CAET,GAAG",
  "names": ["core", "FIT_PADDING", "MEETING_SOURCE", "STRINGS", "PROFILE_STRINGS", "currentMap", "teardown", "heldCamera", "held3d", "resuming3d", "profileSamples", "backdropMap", "legsOpen", "skipStops", "SQUEEZE_MS", "trim", "repost", "bindDropZone", "form", "zone", "input", "label", "state", "step", "event", "type", "files", "root", "detail", "allowErrorSwap", "status", "clearResult", "fn", "drawProfile", "feature", "name", "view", "read", "bindLegs", "payload", "rows", "cards", "line", "tl", "blocks", "rects", "stop", "playhead", "setMark", "point", "source", "render", "row", "selection", "leg", "rect", "i", "on", "drawLeader", "leader", "barAt", "band", "f", "paths", "outline", "edge", "selectStop", "toggle", "follow", "block", "index", "lane", "onKey", "onPointer", "clearAll", "playback", "setLegsOpen", "onClear", "target", "bindTimeline", "drawn", "at", "t", "strip", "open", "button", "hooks", "svg", "head", "readout", "skip", "barPx", "byClock", "squeezed", "movingS", "lastLegEnd", "squeeze", "layout", "ticks", "narrow", "drawTicks", "tick", "span", "showAt", "x", "place", "frameId", "animateSqueeze", "from", "reduced", "started", "now", "eased", "onClick", "ms", "playing", "onPlay", "showSkip", "onSkip", "next", "startAgain", "result", "minLeg", "backdrop", "drawBackdrop", "bindMinLeg", "control", "field", "current", "holdCamera", "bindTrim", "changed", "keep", "bindStartAgain", "bindDayToggle", "day", "pickOnMap", "map", "coordinates", "projected", "c", "segment", "bindDownload", "resolveStyle", "styleCore", "basemap", "container", "style", "showResultLayout", "drawMap", "camera", "resume3d", "attachControls", "meeting", "meetingPointOf", "controls", "compass", "raw", "drawResult", "profile", "init"]
}
