{
  "version": 3,
  "sources": ["map_3d_test.js"],
  "sourcesContent": ["// @ts-check\n/*\n * static/js/map_3d_test.js \u2014 \"Test 3D on this device\" on /map/ (SNOW-1456).\n *\n * Loaded after map_view_3d.js, for a signed-in reader in the map_3d flag\n * (public/map.html). It runs the frame-time probe that /map/3d/\n * carried (SNOW-1448) on the reader's own map, as it is \u2014 their basemap's\n * overlays and switches \u2014 and tells them, in one line, how well this\n * device draws 3D (docs/decisions/a-3d-map-is-maplibre-terrain.md).\n *\n * ASKED FOR by snowdesk:map-3d-test-requested: the \"?\" menu's \"Test 3D on\n * this device\" (map_help_menu.js), the \"Test this device\" link on the\n * why-slow line (map_view_3d.js) and Test again. `/map/?probe=1` starts it\n * on load with Details open, and for that run only turns on Steep terrain\n * and SAC tours, the layers the SNOW-1448 budget was measured with,\n * turning them off again after. Conditions holds both off the map, so a\n * probe run in Conditions switches to Terrain and back again after.\n *\n * THE RUN. window.pwaMapView.canTest() says whether it may run at all\n * (offline, a device the gate keeps out, a lost WebGL context, a route\n * being drawn each get their own line, and nothing runs). beginTest()\n * saves the camera and the view and enters 3D, even when the watchdog has\n * laid it flat for the visit, with the watchdog resting. Then, as the\n * probe did: wait for the map to go idle, and for each of\n * map_3d_core.PROBE_PASSES jump to it over Saas-Fee, wait for its tiles\n * (nextIdle, capped) and turn the camera through a quarter circle at a\n * steady rate (timeTurn, `essential` so reduced motion does not skip it),\n * recording the interval between animation frames and, per interval,\n * whether either of its frames saw tiles loading (!map.areTilesLoaded(),\n * SNOW-1463). map_3d_core.testVerdict judges the passes by the watchdog's\n * own rule, loading intervals skipped as the watchdog skips them \u2014 smooth,\n * stutter, slow or unmeasured \u2014 and endTest({verdict}) puts the camera\n * and the view back; a smooth or stutter verdict lifts the watchdog's\n * latch. Details' figures are over the timed intervals, and each pass says\n * how much of it was skipped for tiles loading.\n *\n * ENDED EARLY by the panel's \u00D7 (\"Stop the test\"), Escape, a hidden tab, a\n * lost WebGL context or the map leaving 3D (snowdesk:map-view-changed to\n * flat: the 2D switch, offline, out of Switzerland), which would time the\n * rest flat: the turn stops, endTest({}) restores the camera and the view,\n * and there is no verdict and nothing to send. A throw mid-run ends it the\n * same way and shows \"could not time\". The pixel ratio and canvas size are\n * read before endTest, while the 3D cap still holds.\n *\n * THE RESULT. The panel (public/partials/_map_3d_test_panel.html, a form\n * panel on includes/_overlay_sheet.html) shows the verdict, each pass as\n * keeps up or falls behind, and Details: frameStats' figures per pass, the\n * GPU and the screen. \"Send anonymously\" is opt-in: it POSTs the result to\n * /api/map-3d-test/ with the page's CSRF token; a 204 is \"Sent to\n * Snowdesk, anonymously.\", anything else \"Could not send the result\", with\n * Send left to try again. An unmeasured run says so, offers Test again and\n * cannot be sent. The \"\u2026\" menu holds Share (the full JSON on a probe run,\n * as /map/3d/'s probe shared it; a few readable lines otherwise) and Test\n * again; Test again starts after its click is done, so MapSheet's\n * click-outside never sees the replaced button as a tap outside. The\n * result records the layers-menu switches that were on and drawn (not\n * held off by the mode, pwaMapModeState), from the keys the panel lists\n * (apps/map/models.py MAP_3D_TEST_OVERLAYS).\n *\n * Every word is in the panel's markup or its strings <template>\n * (#map-3d-test-strings-template), read through window.pwaStrings.\n */\n(function map3dTestInit() {\n  'use strict';\n\n  const sheetEl = document.getElementById('map-3d-test-sheet');\n  const template = document.getElementById('map-3d-test-template');\n  const core = self.pwaMap3dCore;\n  const mapState = window.snowdeskMapState;\n  const map = mapState ? mapState.map : null;\n  const win = /** @type {any} */ (window);\n  if (!sheetEl || !(template instanceof HTMLTemplateElement) || !core || !map || !win.MapSheet) return;\n  const body = template.content.querySelector('[data-map-3d-test]');\n  if (!(body instanceof HTMLElement)) return;\n\n  /** Where Send posts. */\n  const SEND_URL = body.dataset.url || '';\n  /** The switches a result may record as on, in the server's order. */\n  const OVERLAY_KEYS = (body.dataset.overlayKeys || '').split(' ').filter(Boolean);\n  /** How long to wait for the map to go idle at the start, and per pass. */\n  const FIRST_IDLE_CAP_MS = 60000;\n  const SETTLE_CAP_MS = 30000;\n\n  const STRINGS = self.pwaStrings.read('map-3d-test-strings-template', {\n    'seconds-left': '%(s)s s left',\n    'figure-median': 'median %(ms)s ms',\n    'figure-fps': '%(fps)s fps',\n    'figure-p95': 'p95 %(ms)s ms',\n    'figure-over': '%(pct)s over %(budget)s ms',\n    'figure-windows': '%(slow)s of %(windows)s windows slow',\n    'figure-settle': 'tiles in %(s)s s',\n    'figure-skipped': '%(s)s s skipped while tiles loaded',\n    'figure-gpu': 'GPU \u00B7 %(gpu)s',\n    'gpu-unknown': 'not given',\n    'figure-screen': 'screen \u00B7 %(width)s \u00D7 %(height)s at %(dpr)s\u00D7, drawn at %(ratio)s\u00D7',\n    'figure-rule': 'rule \u00B7 median \u2265 %(budget)s ms in %(n)s windows of %(s)s s in a row',\n    'keeps-up': 'keeps up',\n    'falls-behind': 'falls behind',\n    'pass-0': 'Close up, over Saas-Fee',\n    'pass-1': 'Zoomed out, over Valais',\n    'verdict-smooth': '3D runs smoothly on this phone',\n    'verdict-stutter': '3D may stutter when zoomed out',\n    'verdict-slow': '3D is too slow on this phone',\n    'share-line': '%(label)s: %(status)s, median %(median)s ms',\n    'share-title': 'Snowdesk 3D test',\n    copied: 'Result copied',\n    'copy-failed': 'Could not copy the result',\n  });\n  const fill = self.pwaStrings.interpolate;\n\n  /**\n   * @typedef {Object} Run\n   * @property {boolean} cancelled\n   * @property {Array<() => void>} stops What ends each wait the run is in.\n   * @property {() => void} restoreLayers Turns off what a probe run turned on.\n   */\n\n  /** @type {?Run} The run now going, if one is. */\n  let run = null;\n  /** @type {?Record<string, any>} The result on show, what Send posts. */\n  let result = null;\n  /** @type {?Record<string, any>} The full report a probe run's Share sends. */\n  let report = null;\n  /** Whether the result on show came from `?probe=1`. */\n  let probeRun = false;\n  let sending = false;\n\n  const sheet = win.MapSheet.attach(sheetEl, {\n    // What opens it is not a click outside it.\n    triggerSelector: '[data-map-3d-test-open], [data-help-menu=\"test-3d\"]',\n    onTeardown: () => {\n      cancel();\n      result = null;\n      report = null;\n    },\n  });\n\n  // ---- The panel ----------------------------------------------------------\n\n  /** @returns {?HTMLElement} The open panel's body. */\n  const root = () => /** @type {?HTMLElement} */ (sheetEl.querySelector('[data-map-3d-test]'));\n\n  /**\n   * @param {string} selector\n   * @returns {?HTMLElement}\n   */\n  const find = (selector) => {\n    const el = root();\n    return el ? /** @type {?HTMLElement} */ (el.querySelector(selector)) : null;\n  };\n\n  /** Show the panel with a fresh body: nothing of the last result is left. */\n  const openPanel = () => {\n    sheetEl.replaceChildren(template.content.cloneNode(true));\n    if (!sheet.isOpen()) sheet.open();\n  };\n\n  /**\n   * Show one of the body's states.\n   *\n   * @param {string} name\n   */\n  const show = (name) => {\n    const el = root();\n    if (!el) return;\n    el.dataset.testState = name;\n    for (const part of el.querySelectorAll('[data-test-show]')) {\n      /** @type {HTMLElement} */ (part).hidden = !(/** @type {HTMLElement} */ (part).dataset.testShow || '').split(' ').includes(name);\n    }\n  };\n\n  /**\n   * Mark the running step and the share of the test done.\n   *\n   * @param {string} current `load`, or a pass's index.\n   * @param {number} fraction 0 to 1.\n   */\n  const progress = (current, fraction) => {\n    const el = root();\n    if (!el) return;\n    const order = ['load', ...core.PROBE_PASSES.map((/** @type {any} */ _p, /** @type {number} */ i) => String(i))];\n    const at = order.indexOf(current);\n    for (const step of el.querySelectorAll('[data-test-step]')) {\n      const stepEl = /** @type {HTMLElement} */ (step);\n      const index = order.indexOf(stepEl.dataset.testStep || '');\n      stepEl.dataset.stepState = index < at ? 'done' : index === at ? 'current' : 'pending';\n      if (index !== at) {\n        const left = stepEl.querySelector('[data-test-left]');\n        if (left) left.textContent = '';\n      }\n    }\n    const pct = Math.round(Math.max(0, Math.min(1, fraction)) * 100);\n    const bar = find('[data-test-progress]');\n    if (bar) bar.setAttribute('aria-valuenow', String(pct));\n    const fillEl = find('[data-test-progress-bar]');\n    if (fillEl) fillEl.style.width = `${pct}%`;\n  };\n\n  /**\n   * The seconds left on a pass's turn.\n   *\n   * @param {number} index\n   * @param {number} seconds\n   */\n  const secondsLeft = (index, seconds) => {\n    const left = find(`[data-test-step=\"${index}\"] [data-test-left]`);\n    if (left) left.textContent = fill(STRINGS['seconds-left'], { s: seconds });\n  };\n\n  // ---- The run ------------------------------------------------------------\n\n  /**\n   * Resolve on the map's next idle (every tile in view loaded and drawn), or\n   * false after a cap or when the run ends.\n   *\n   * @param {number} capMs\n   * @param {Run} token\n   * @returns {Promise<boolean>}\n   */\n  const nextIdle = (capMs, token) => new Promise((resolve) => {\n    let done = false;\n    /** @param {boolean} value */\n    const finish = (value) => {\n      if (done) return;\n      done = true;\n      clearTimeout(timer);\n      resolve(value);\n    };\n    const timer = window.setTimeout(() => finish(false), capMs);\n    token.stops.push(() => finish(false));\n    map.once('idle', () => finish(true));\n    map.triggerRepaint();\n  });\n\n  /**\n   * Turn the camera at a steady rate and time every animation frame.\n   *\n   * @param {{turnDeg: number, durationMs: number}} pass\n   * @param {Run} token\n   * @param {(elapsedMs: number) => void} onFrame\n   * @returns {Promise<{intervals: number[], loading: boolean[]}>} The\n   *   intervals between frames, in ms, and per interval whether tiles were\n   *   loading at either of its frames.\n   */\n  const timeTurn = (pass, token, onFrame) => new Promise((resolve) => {\n    /** @type {number[]} */\n    const intervals = [];\n    /** @type {boolean[]} */\n    const loading = [];\n    let last = 0;\n    let lastLoading = false;\n    let started = 0;\n    let turning = true;\n    const end = () => {\n      if (!turning) return;\n      turning = false;\n      resolve({ intervals, loading });\n    };\n    /** @param {number} now */\n    const tick = (now) => {\n      if (!turning) return;\n      const nowLoading = typeof map.areTilesLoaded === 'function' && !map.areTilesLoaded();\n      if (last) {\n        intervals.push(now - last);\n        loading.push(lastLoading || nowLoading);\n      } else started = now;\n      last = now;\n      lastLoading = nowLoading;\n      onFrame(now - started);\n      window.requestAnimationFrame(tick);\n    };\n    map.once('moveend', end);\n    token.stops.push(end);\n    window.requestAnimationFrame(tick);\n    // essential: MapLibre skips the animation under prefers-reduced-motion\n    // otherwise, and the pass would end before a frame was timed. The\n    // reader asked for this run.\n    map.rotateTo(map.getBearing() + pass.turnDeg, {\n      duration: pass.durationMs,\n      easing: (/** @type {number} */ t) => t,\n      essential: true,\n    });\n  });\n\n  /** @returns {string} The GPU's name, where the browser gives it. */\n  const gpuName = () => {\n    try {\n      const gl = /** @type {any} */ (map).painter.context.gl;\n      const ext = gl.getExtension('WEBGL_debug_renderer_info');\n      return String(gl.getParameter(ext ? ext.UNMASKED_RENDERER_WEBGL : gl.RENDERER));\n    } catch (_err) {\n      return '';\n    }\n  };\n\n  /** A result's overlay key \u2192 map.js's overlayState key, where they differ. */\n  /** @type {Record<string, string>} */\n  const MODE_KEYS = { terrain: 'terrain_filter' };\n\n  /** The budget's two layers' switches, as map.js publishes them. */\n  const budgetLayers = () => [\n    { key: 'terrain', bridge: win.pwaTerrainFilter },\n    { key: 'ski_tours', bridge: win.pwaSkiRoutes ? win.pwaSkiRoutes.tours : null },\n  ];\n\n  /**\n   * Turn on Steep terrain and SAC tours for a probe run.\n   *\n   * @returns {() => void} Turns off again what this turned on.\n   */\n  const switchOnBudgetLayers = () => {\n    /** @type {Array<() => void>} */\n    const undo = [];\n    // Conditions holds both off the map whatever their switches say\n    // (map_mode_core.ONLY_IN), so the probe runs in Terrain and puts the\n    // reader's mode back after.\n    const modes = win.pwaMapMode;\n    const before = modes ? modes.get() : '';\n    if (modes && !modes.isTerrain()) {\n      modes.set('terrain');\n      undo.push(() => modes.set(before));\n    }\n    for (const { bridge } of budgetLayers()) {\n      if (!bridge || typeof bridge.isEnabled !== 'function' || bridge.isEnabled()) continue;\n      bridge.show();\n      undo.push(() => bridge.hide());\n    }\n    return () => { for (const fn of undo.splice(0).reverse()) fn(); };\n  };\n\n  /**\n   * Whether the map mode holds an overlay off the map.\n   *\n   * @param {string} key An OVERLAY_KEYS key.\n   * @returns {boolean}\n   */\n  const heldOff = (key) => {\n    const state = win.pwaMapModeState;\n    if (!state || typeof state.isSuppressed !== 'function') return false;\n    return state.isSuppressed(MODE_KEYS[key] || key);\n  };\n\n  /** @returns {string[]} The known switches that are on, in the server's order. */\n  const readOverlays = () => {\n    const on = new Set();\n    for (const row of document.querySelectorAll('#basemap-menu [data-overlay-key][aria-checked=\"true\"]')) {\n      on.add(/** @type {HTMLElement} */ (row).dataset.overlayKey);\n    }\n    for (const { key, bridge } of budgetLayers()) {\n      if (bridge && typeof bridge.isEnabled === 'function' && bridge.isEnabled()) on.add(key);\n    }\n    // What is drawn, not what is switched on: a switch the mode holds off\n    // draws nothing.\n    return OVERLAY_KEYS.filter((key) => on.has(key) && !heldOff(key));\n  };\n\n  /** End the run now going, if one is: no verdict, nothing to send. */\n  const cancel = () => {\n    const token = run;\n    if (!token) return;\n    token.cancelled = true;\n    run = null;\n    for (const stop of token.stops.splice(0)) stop();\n    try {\n      map.stop();\n    } catch (_err) {\n      // Nothing was moving.\n    }\n    if (win.pwaMapView) win.pwaMapView.endTest({});\n    token.restoreLayers();\n  };\n\n  /**\n   * Run the test and show its result.\n   *\n   * @param {{probe?: boolean}} [options]\n   * @returns {Promise<void>}\n   */\n  const start = async (options = {}) => {\n    if (run) return;\n    const probe = !!options.probe;\n    openPanel();\n    result = null;\n    report = null;\n    probeRun = probe;\n    const view = win.pwaMapView;\n    const can = view && typeof view.canTest === 'function'\n      ? view.canTest()\n      : { ok: false, reason: 'device' };\n    if (!can.ok) {\n      show(can.reason === 'offline' || can.reason === 'editing' ? can.reason : 'unavailable');\n      return;\n    }\n    /** @type {Run} */\n    const token = { cancelled: false, stops: [], restoreLayers: () => {} };\n    run = token;\n    token.restoreLayers = probe ? switchOnBudgetLayers() : () => {};\n    const overlays = readOverlays();\n    if (!view.beginTest()) {\n      run = null;\n      token.restoreLayers();\n      show('unavailable');\n      return;\n    }\n    // Whatever goes wrong from here, the view and the layers come back and\n    // no run is left holding the watchdog off.\n    try {\n      await runPasses(token, overlays);\n    } finally {\n      if (run === token) {\n        cancel();\n        show('unmeasured');\n      }\n    }\n  };\n\n  /**\n   * Time each pass, then show the verdict.\n   *\n   * @param {Run} token\n   * @param {string[]} overlays\n   * @returns {Promise<void>}\n   */\n  const runPasses = async (token, overlays) => {\n    show('running');\n    progress('load', 0);\n    await nextIdle(FIRST_IDLE_CAP_MS, token);\n    if (token.cancelled) return;\n    const firstIdleMs = Math.round(performance.now());\n    const total = core.PROBE_PASSES.length;\n    /** @type {Array<{label: string, intervals: number[], loading: boolean[], settled: boolean, settleMs: number}>} */\n    const timed = [];\n    for (const [i, pass] of core.PROBE_PASSES.entries()) {\n      progress(String(i), i / total);\n      secondsLeft(i, Math.ceil(pass.durationMs / 1000));\n      map.jumpTo({\n        center: core.OPENING_CAMERA.center.slice(),\n        zoom: pass.zoom,\n        pitch: core.OPENING_CAMERA.pitch,\n        bearing: core.OPENING_CAMERA.bearing,\n      });\n      const settleFrom = performance.now();\n      const settled = await nextIdle(SETTLE_CAP_MS, token);\n      if (token.cancelled) return;\n      const settleMs = Math.round(performance.now() - settleFrom);\n      let shown = -1;\n      const { intervals, loading } = await timeTurn(pass, token, (elapsed) => {\n        const left = Math.max(0, Math.ceil((pass.durationMs - elapsed) / 1000));\n        if (left !== shown) {\n          shown = left;\n          secondsLeft(i, left);\n        }\n      });\n      if (token.cancelled) return;\n      timed.push({ label: pass.label, intervals, loading, settled, settleMs });\n    }\n    finish(token, timed, overlays, firstIdleMs);\n  };\n\n  /**\n   * Judge the passes, put the map back and show the verdict.\n   *\n   * @param {Run} token\n   * @param {Array<{label: string, intervals: number[], loading: boolean[], settled: boolean, settleMs: number}>} timed\n   * @param {string[]} overlays\n   * @param {number} firstIdleMs\n   */\n  const finish = (token, timed, overlays, firstIdleMs) => {\n    const verdict = core.testVerdict(timed.map((pass) => ({ intervals: pass.intervals, loading: pass.loading })));\n    // Read while still in 3D: leaving puts the uncapped pixel ratio back,\n    // and the canvas grows with it.\n    const canvasEl = map.getCanvas();\n    const screen = { width: canvasEl.width, height: canvasEl.height, ratio: map.getPixelRatio() };\n    const gpu = gpuName();\n    const passes = timed.map((pass) => {\n      // The figures are over what the rule timed: not the loading intervals.\n      const stats = core.frameStats(pass.intervals.filter((_ms, i) => !pass.loading[i]));\n      const judged = core.judgePass(pass.intervals, pass.loading);\n      return { pass, stats, judged };\n    });\n    run = null;\n    win.pwaMapView.endTest({ verdict });\n    token.restoreLayers();\n    progress(String(core.PROBE_PASSES.length), 1);\n    if (verdict === 'unmeasured') {\n      show('unmeasured');\n      return;\n    }\n    result = {\n      verdict,\n      gpu,\n      device_pixel_ratio: window.devicePixelRatio || 1,\n      pixel_ratio: screen.ratio,\n      canvas_width: screen.width,\n      canvas_height: screen.height,\n      user_agent: navigator.userAgent,\n      client_version: clientVersion(),\n      probe: probeRun,\n      overlays,\n      passes: passes.map(({ pass, stats, judged }) => ({\n        label: pass.label,\n        frames: stats ? stats.frames : 0,\n        median_ms: stats ? stats.medianMs : 0,\n        p95_ms: stats ? stats.p95Ms : 0,\n        worst_ms: stats ? stats.worstMs : 0,\n        over_budget: stats ? stats.overBudget : 0,\n        slow_windows: judged.slowWindows,\n        settle_ms: pass.settleMs,\n      })),\n    };\n    report = {\n      probe: 'map_3d SNOW-1456',\n      at: new Date().toISOString(),\n      budgetMs: core.FRAME_BUDGET_MS,\n      firstIdleMs,\n      ...result,\n      passes: passes.map(({ pass, stats, judged }) => ({\n        label: pass.label,\n        settled: pass.settled,\n        settleMs: pass.settleMs,\n        keptUp: judged.keptUp,\n        windows: judged.windows,\n        slowWindows: judged.slowWindows,\n        skippedMs: judged.skippedMs,\n        ...stats,\n      })),\n    };\n    show(verdict);\n    paintResult(passes, gpu, screen);\n    const details = /** @type {?HTMLDetailsElement} */ (find('[data-test-details]'));\n    if (details && probeRun) details.open = true;\n  };\n\n  /**\n   * Each pass's line and figures, and the device's.\n   *\n   * @param {Array<{pass: any, stats: any, judged: any}>} passes\n   * @param {string} gpu\n   * @param {{width: number, height: number, ratio: number}} screen The\n   *   canvas and pixel ratio the passes were drawn at, read in 3D.\n   */\n  const paintResult = (passes, gpu, screen) => {\n    passes.forEach(({ stats, judged }, i) => {\n      const row = find(`[data-test-pass=\"${i}\"]`);\n      if (row) {\n        for (const status of row.querySelectorAll('[data-pass-status]')) {\n          const keeps = /** @type {HTMLElement} */ (status).dataset.passStatus === 'keeps';\n          /** @type {HTMLElement} */ (status).hidden = keeps !== judged.keptUp;\n        }\n      }\n      const figures = find(`[data-test-figures=\"${i}\"]`);\n      if (!figures || !stats) return;\n      /** @type {Record<string, string>} */\n      const lines = {\n        median: fill(STRINGS['figure-median'], { ms: stats.medianMs.toFixed(1) }),\n        fps: fill(STRINGS['figure-fps'], { fps: stats.fps }),\n        p95: fill(STRINGS['figure-p95'], { ms: stats.p95Ms.toFixed(1) }),\n        over: fill(STRINGS['figure-over'], { pct: `${Math.round(stats.overBudget * 100)}%`, budget: core.FRAME_BUDGET_MS }),\n        windows: fill(STRINGS['figure-windows'], { slow: judged.slowWindows, windows: judged.windows }),\n        settle: fill(STRINGS['figure-settle'], { s: (passes[i].pass.settleMs / 1000).toFixed(1) }),\n        skipped: fill(STRINGS['figure-skipped'], { s: (judged.skippedMs / 1000).toFixed(1) }),\n      };\n      for (const [key, text] of Object.entries(lines)) {\n        const cell = figures.querySelector(`[data-figure=\"${key}\"]`);\n        if (cell) cell.textContent = text;\n      }\n    });\n    const gpuEl = find('[data-test-gpu]');\n    if (gpuEl) gpuEl.textContent = fill(STRINGS['figure-gpu'], { gpu: gpu || STRINGS['gpu-unknown'] });\n    const screenEl = find('[data-test-screen]');\n    if (screenEl) {\n      const { ratio } = screen;\n      screenEl.textContent = fill(STRINGS['figure-screen'], {\n        width: Math.round(screen.width / ratio),\n        height: Math.round(screen.height / ratio),\n        dpr: Number((window.devicePixelRatio || 1).toFixed(2)),\n        ratio: Number(ratio.toFixed(2)),\n      });\n    }\n    const ruleEl = find('[data-test-rule]');\n    if (ruleEl) {\n      ruleEl.textContent = fill(STRINGS['figure-rule'], {\n        budget: core.FRAME_BUDGET_MS,\n        n: core.FRAME_WINDOWS_TO_TRIP,\n        s: core.FRAME_WINDOW_MS / 1000,\n      });\n    }\n  };\n\n  // ---- Send and Share -----------------------------------------------------\n\n  /** @returns {string} The page's build, as pwa_client_version.js reads it. */\n  const clientVersion = () => {\n    const meta = document.querySelector('meta[name=\"pwa-app-version\"]');\n    return meta ? (meta.getAttribute('content') || '').trim() : '';\n  };\n\n  /** @returns {string} The page's CSRF token. */\n  const csrfToken = () => {\n    const cookie = self.pwaCsrf.token();\n    if (cookie) return cookie;\n    const input = document.querySelector('input[name=\"csrfmiddlewaretoken\"]');\n    return input instanceof HTMLInputElement ? input.value : '';\n  };\n\n  /** Post the result once; 204 is sent, anything else is not. */\n  const send = async () => {\n    if (!result || sending || !SEND_URL) return;\n    sending = true;\n    const payload = result;\n    const failed = find('[data-test-send-failed]');\n    if (failed) failed.hidden = true;\n    let ok = false;\n    try {\n      const response = await fetch(SEND_URL, {\n        method: 'POST',\n        credentials: 'same-origin',\n        headers: { 'Content-Type': 'application/json', 'X-CSRFToken': csrfToken() },\n        body: JSON.stringify(payload),\n      });\n      ok = response.status === 204;\n    } catch (_err) {\n      ok = false;\n    }\n    sending = false;\n    // The panel closed, or the test ran again, while the post was out.\n    if (result !== payload) return;\n    if (ok) {\n      result = null;\n      const box = find('[data-test-send-box]');\n      if (box) box.hidden = true;\n      const sentEl = find('[data-test-sent]');\n      if (sentEl) sentEl.hidden = false;\n      return;\n    }\n    const failedNow = find('[data-test-send-failed]');\n    if (failedNow) failedNow.hidden = false;\n  };\n\n  /** Share the result: the full JSON on a probe run, a few lines otherwise. */\n  const share = async () => {\n    if (!report) return;\n    const text = probeRun\n      ? JSON.stringify(report, null, 1)\n      : [\n        STRINGS[`verdict-${report.verdict}`],\n        ...report.passes.map((/** @type {any} */ pass, /** @type {number} */ i) => fill(STRINGS['share-line'], {\n          label: STRINGS[`pass-${i}`] || pass.label,\n          status: pass.keptUp ? STRINGS['keeps-up'] : STRINGS['falls-behind'],\n          median: Number(pass.medianMs).toFixed(1),\n        })),\n        fill(STRINGS['figure-gpu'], { gpu: report.gpu || STRINGS['gpu-unknown'] }),\n      ].join('\\n');\n    const sharer = win.pwaShare;\n    const outcome = sharer ? await sharer.shareOrCopy(text, STRINGS['share-title'], 'text') : 'failed';\n    const status = find('[data-test-share-status]');\n    if (!status) return;\n    if (outcome === 'copied') status.textContent = STRINGS.copied;\n    else if (outcome === 'failed') status.textContent = STRINGS['copy-failed'];\n  };\n\n  sheetEl.addEventListener('click', (event) => {\n    const target = event.target instanceof Element ? event.target : null;\n    if (!target) return;\n    if (target.closest('[data-action=\"map-3d-test-send\"]')) send();\n    else if (target.closest('[data-test-share]')) share();\n    else if (target.closest('[data-test-again], [data-action=\"map-3d-test-again\"]')) {\n      // After this click is done: start() replaces the panel's body, and the\n      // detached button would read as a tap outside to MapSheet's own\n      // click-outside, which would close the panel and end the new run.\n      const probe = probeRun;\n      setTimeout(() => { start({ probe }); }, 0);\n    }\n  });\n\n  // ---- What asks for it, and what ends it -------------------------------\n\n  document.addEventListener('snowdesk:map-3d-test-requested', () => { start(); });\n\n  // A hidden tab draws nothing, and its gap is not a slow frame.\n  document.addEventListener('visibilitychange', () => {\n    if (!document.hidden || !run) return;\n    cancel();\n    sheet.close();\n  });\n\n  // Leaving 3D mid-run (the 2D switch, going offline, panning out) would\n  // time the rest of the run flat, so the run ends with no verdict.\n  document.addEventListener('snowdesk:map-view-changed', (event) => {\n    const detail = /** @type {CustomEvent} */ (event).detail;\n    if (!run || !detail || detail.view === '3d') return;\n    cancel();\n    sheet.close();\n  });\n\n  map.on('webglcontextlost', () => {\n    if (!run) return;\n    cancel();\n    sheet.close();\n  });\n\n  if (new URLSearchParams(location.search).get('probe') === '1') {\n    const loaded = typeof map.loaded !== 'function' || map.loaded();\n    if (loaded) start({ probe: true });\n    else map.once('load', () => { start({ probe: true }); });\n  }\n})();\n"],
  "mappings": "CA8DC,UAAyB,CACxB,aAEA,MAAMA,EAAU,SAAS,eAAe,mBAAmB,EACrDC,EAAW,SAAS,eAAe,sBAAsB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BAAgB,SAAS,MAAM,EAAE,IAAI,OAAO,IAAM,MACzC,OAAOd,EAAI,QAAW,YAAcA,EAAI,OAAO,EAClDgF,EAAM,CAAE,MAAO,EAAK,CAAC,EAC5BhF,EAAI,KAAK,OAAQ,IAAM,CAAEgF,EAAM,CAAE,MAAO,EAAK,CAAC,CAAG,CAAC,EAE3D,GAAG",
  "names": ["sheetEl", "template", "core", "mapState", "map", "win", "body", "SEND_URL", "OVERLAY_KEYS", "FIRST_IDLE_CAP_MS", "SETTLE_CAP_MS", "STRINGS", "fill", "run", "result", "report", "probeRun", "sending", "sheet", "cancel", "root", "find", "selector", "el", "openPanel", "show", "name", "part", "progress", "current", "fraction", "order", "_p", "i", "at", "step", "stepEl", "index", "left", "pct", "bar", "fillEl", "secondsLeft", "seconds", "nextIdle", "capMs", "token", "resolve", "done", "finish", "value", "timer", "timeTurn", "pass", "onFrame", "intervals", "loading", "last", "lastLoading", "started", "turning", "end", "tick", "now", "nowLoading", "t", "gpuName", "gl", "ext", "MODE_KEYS", "budgetLayers", "switchOnBudgetLayers", "undo", "modes", "before", "bridge", "fn", "heldOff", "key", "state", "readOverlays", "on", "row", "stop", "start", "options", "probe", "view", "can", "overlays", "runPasses", "firstIdleMs", "total", "timed", "settleFrom", "settled", "settleMs", "shown", "elapsed", "verdict", "canvasEl", "screen", "gpu", "passes", "stats", "_ms", "judged", "clientVersion", "paintResult", "details", "status", "keeps", "figures", "lines", "text", "cell", "gpuEl", "screenEl", "ratio", "ruleEl", "meta", "csrfToken", "cookie", "input", "send", "payload", "failed", "ok", "box", "sentEl", "failedNow", "share", "sharer", "outcome", "event", "target", "detail"]
}
