{
  "version": 3,
  "sources": ["mutation_queue.js"],
  "sourcesContent": ["/*\n * static/js/mutation_queue.js \u2014 Client mutation-queue surface (SNOW-376).\n *\n * Fills in the real queue behind the frozen ``window.pwaMutationQueue``\n * surface stubbed in SNOW-384 \u2014 no call-site changes required for any\n * existing adopter. Writes to the ``queue:mutations`` IndexedDB store\n * (SNOW-375, ``static/js/db.js``) and replays it with exponential backoff,\n * an ``Idempotency-Key`` header identical across every retry (server\n * contract: ``core/idempotency.py``), and Background Sync registration so\n * a queued mutation can still flush after the tab has closed (Android\n * Chromium; feature-detected \u2014 a no-op on browsers without\n * ``SyncManager``, e.g. iOS Safari).\n *\n * Ships ONLY the machinery. Scope decision (ticket comment): the existing\n * HTMX (``hx-post``) subscription/push call sites are NOT converted to JS\n * calls in this ticket \u2014 the real consumer is future field-observation\n * submission (SNOW-330).\n *\n * Row shape (``queue:mutations``, see docs/mutation-queue.md):\n *\n *   { id, idempotency_key, method, url, headers, body, created_at,\n *     attempts, status, next_attempt_at, principal }\n *\n *   status \u2208 'queued' | 'retry-scheduled' | 'failed'\n *   next_attempt_at \u2014 epoch ms; the row is eligible for replay once\n *   ``Date.now() >= next_attempt_at``.\n *   principal \u2014 the ``<meta name=\"pwa-user-id\">`` value (or ``null`` for\n *   anonymous) at ENQUEUE time (SNOW-462). Stamped so a mutation queued\n *   by one account can never replay under a different one on the same\n *   browser \u2014 see \"Account-change partitioning\" below.\n *\n * Classification / backoff (static/js/mutation_queue_core.js):\n *\n *   - 2xx                              \u2192 success: delete the row.\n *   - {408, 429}, 5xx, network error    \u2192 retry: attempts += 1,\n *     next_attempt_at = now + backoffDelayMs(attempts)\n *     (2/4/8/\u2026/256s, then capped at 300s from attempt 9).\n *     attempts >= MAX_ATTEMPTS (20) without a 2xx \u2192 'failed', no\n *     further retry.\n *   - any other 4xx                     \u2192 'failed' on the FIRST attempt,\n *     no further retry \u2014 the request itself is wrong, not the connection.\n *\n * A permanently failed row (either branch above) emits the critical\n * ``pwa.mutation.failed_permanent`` event, reveals the full-width\n * ``#mutation-queue-toast`` banner (``templates/includes/_toast_banner.html``),\n * and refreshes the nav sync badge into its error colouring.\n *\n * Drain triggers (mirrors static/js/telemetry.js's ``_wireLifecycle``):\n * ``online``, ``visibilitychange`` \u2192 visible, a periodic timer,\n * ``pagehide``, and immediately after ``enqueue`` when the app is using the\n * network. All of them funnel through one in-flight guard\n * (``_drainInFlight``) so concurrent triggers never double-POST the same\n * row, and through one connectivity guard in ``drain()`` so an offline\n * trigger cannot spend a row's retry budget on a POST that can only fail.\n *\n * SNOW-748: that guard asks ``_networkInUse()``, not ``navigator.onLine``.\n * The interface being up is only half the question \u2014 a mode the user forced\n * from the network menu's \"Offline mode\" row leaves ``onLine`` true, and\n * replaying a queued\n * mutation over a connection they asked the app not to spend is the same\n * defect as downloading tiles under it. A forced mode leaves the row\n * queued, which is the state the queue is built around.\n *\n * Public API \u2014 attached to ``window.pwaMutationQueue``:\n *\n *   enqueue(operation)            Persist one mutation to the queue,\n *                                  mint its Idempotency-Key, stamp the\n *                                  enqueue-time principal, emit\n *                                  ``pwa.mutation.enqueued``, drain\n *                                  immediately if online, and\n *                                  feature-detect a Background Sync\n *                                  registration.\n *   drain()                       Replay every eligible row. Emits\n *                                  ``pwa.mutation.drained`` with the\n *                                  REAL count of rows removed by a 2xx.\n *   markFailed(operation, reason) Caller-driven permanent-failure report\n *                                  (for a mutation attempted outside the\n *                                  queue). Emits\n *                                  ``pwa.mutation.failed_permanent`` and\n *                                  reveals the same toast + badge state\n *                                  as an internally-failed row.\n *   clear()                       Empty the entire ``queue:mutations``\n *                                  store and refresh the nav badge\n *                                  (SNOW-462) \u2014 used internally by the\n *                                  account-change reconcile below, and\n *                                  available to any other caller that\n *                                  needs to discard the whole queue.\n *\n * SNOW-1262 added four, without changing any of the above (the surface is\n * frozen \u2014 additive changes only):\n *\n *   list({kind})                  The current principal's rows, optionally\n *                                  of one ``kind``, as plain copies (no\n *                                  headers): ``{idempotency_key, kind,\n *                                  status, created_at, body, attempts,\n *                                  last_status, last_error}``.\n *   acknowledged(key)             The acknowledgement a successful replay\n *                                  of the row with this Idempotency-Key\n *                                  left (``{kind, uuid, at}``), or null.\n *   discard(key)                  Delete the current principal's row with\n *                                  this Idempotency-Key, refresh the badge.\n *   principal()                   The current principal, as stamped on a\n *                                  row (``null`` for anonymous).\n *\n * and ``enqueue`` takes two optional fields and resolves to the key:\n * ``idempotencyKey`` (the caller's own key, used instead of a minted one,\n * so a caller can tag its own state with it BEFORE the row exists) and\n * ``kind`` (a short name \u2014 ``'route-create'`` \u2014 a reader filters on, and\n * which makes a successful replay leave an acknowledgement in ``meta:app``;\n * see docs/mutation-queue.md). Every change to the set of rows \u2014 enqueue,\n * a drain pass, discard, clear \u2014 dispatches ``pwa:mutation-queue-changed``\n * on ``document``, so a surface listing rows can re-read them.\n *\n * ``operation`` is caller-supplied metadata describing the mutation (e.g.\n * ``{method: 'POST', url: '/account/', headers: {...}, body: '...'}``).\n * Callers must not include any of the PII keys the server-side telemetry\n * receiver blocks (``email``, ``ip``, ``token``, ``credential_id``) \u2014 the\n * same rule as every other ``window.pwaTelemetry.emit`` call site.\n *\n * Account-change partitioning (SNOW-462)\n * ---------------------------------------\n * Offline mutations carry no principal binding by default, so a browser\n * shared across a sign-out/sign-in \u2014 user A queues offline, signs out,\n * user B signs in before reconnect \u2014 could otherwise replay A's mutation\n * attributed to B. Defence in depth, two layers:\n *\n *   1. **Reconcile on load** \u2014 ``_reconcilePrincipal()`` runs first thing\n *      in ``_wireLifecycle()`` (fire-and-forget). It compares the current\n *      ``<meta name=\"pwa-user-id\">`` principal against the last-seen one\n *      persisted in ``meta:app`` under the key ``mutations.principal``.\n *      On a mismatch it clears the ENTIRE queue (emitting\n *      ``pwa.mutation.discarded`` \u2014 ``reason: 'account_change'`` when a\n *      previous principal was recorded and genuinely differs, or\n *      ``reason: 'principal_uninitialised'`` when no ``mutations.principal``\n *      row existed yet \u2014 when at least one row was present) and persists\n *      the new principal.\n *   2. **Drain-guard** \u2014 ``_processRow()`` re-checks each row's stamped\n *      ``principal`` against the CURRENT principal immediately before\n *      replay; a mismatch deletes the row without a network request and\n *      emits ``pwa.mutation.discarded`` with ``reason:\n *      'principal_mismatch'``. This is the race backstop for the window\n *      between an account change and the next reconcile (e.g. a\n *      Background-Sync firing from the service worker \u2014 see\n *      ``static/js/sw.js``'s best-effort ``storedPrincipal`` guard, which\n *      discards silently and does NOT emit telemetry: it only runs with\n *      no tab open, so ``_postTelemetry``'s ``clients.matchAll`` is a\n *      guaranteed no-op there).\n *\n * Every method is defensive \u2014 wrapped in try/catch, optional chaining on\n * ``window.pwaTelemetry?.emit`` and guarded ``window.pwaDb`` access \u2014 so a\n * missing IndexedDB / telemetry module (this file loads on admin pages\n * too) or ``pwaDb.isResetRequired()`` can never break the caller's\n * mutation flow; the operation is simply not queued.\n */\n\n(function () {\n  'use strict';\n\n  var STORE = 'queue:mutations';\n\n  // Batch cap per drain pass \u2014 mirrors telemetry.js's BATCH_SIZE\n  // convention so one drain trigger can't process an unbounded backlog in\n  // a single synchronous run.\n  var BATCH_SIZE = 50;\n\n  // Periodic drain cadence \u2014 same 30s cadence as telemetry.js's flush\n  // timer, only while the tab is visible (browsers throttle background\n  // timers hard, same rationale as telemetry.js).\n  var DRAIN_INTERVAL_MS = 30 * 1000;\n\n  // Auto-dismiss the failure toast after 10s (ticket-resolved design\n  // decision) \u2014 the \"\u00D7\" button and a fresh failure both also dismiss/\n  // re-arm it.\n  var TOAST_AUTO_DISMISS_MS = 10 * 1000;\n\n  var TOAST_ID = 'mutation-queue-toast';\n  // The event every change to the set of rows raises (SNOW-1262).\n  var CHANGED_EVENT = 'pwa:mutation-queue-changed';\n  var BADGE_SELECTOR = '[data-sync-badge]';\n\n  // Matches _toast_banner.html's `duration-300` Tailwind class. The\n  // `transitionend` listener is the primary signal that the slide-up has\n  // finished; this is only the fallback for browsers/states where it\n  // doesn't fire (e.g. the element was already mid-transition, or\n  // `prefers-reduced-motion` short-circuits the animation).\n  var TOAST_TRANSITION_MS = 300;\n\n  // Drain-in-progress guard \u2014 mirrors telemetry.js's _flushInFlight so\n  // overlapping triggers (online + visibilitychange + timer all firing\n  // close together) can't double-POST the same row.\n  var _drainInFlight = null;\n\n  // Handle for the toast's auto-dismiss timer so a second failure while\n  // the first toast is still showing resets the 10s window instead of\n  // stacking timers.\n  var _toastDismissTimer = null;\n\n  // Handles for the in-progress dismiss transition, so a second dismiss\n  // (or a fresh reveal) while one is already playing cancels the stale\n  // listener/timer rather than piling up duplicates.\n  var _toastHideFallbackTimer = null;\n  var _toastHideTransitionEndHandler = null;\n\n  /**\n   * Best-effort telemetry emit \u2014 never throws.\n   * @param {string} event\n   * @param {object} [properties]\n   */\n  function emitTelemetry(event, properties) {\n    try {\n      window.pwaTelemetry?.emit(event, properties || {});\n    } catch (_err) {\n      // Ignore \u2014 telemetry must never break a mutation call site.\n    }\n  }\n\n  /**\n   * SNOW-748: true when the app is actually using the network \u2014 the interface\n   * is up AND no offline mode is in force.\n   *\n   * ``pwa_offline.js`` owns the answer; ``navigator.onLine`` stays the\n   * fallback for a page where that module has not run (this file loads on\n   * admin pages too).\n   *\n   * @returns {boolean}\n   */\n  function _networkInUse() {\n    var connectivity = window.pwaConnectivity;\n    return connectivity ? connectivity.isOnline() : navigator.onLine !== false;\n  }\n\n  /**\n   * The current principal \u2014 the ``<meta name=\"pwa-user-id\">`` value read\n   * via ``window.pwaDb.context().user_id``, normalised so an empty\n   * string / ``undefined`` reads as ``null`` (anonymous), matching the\n   * value a signed-out session stamps on a queued row. Guarded end to\n   * end: returns ``null`` on any throw, or when ``window.pwaDb`` isn't\n   * available at all (this file loads on admin pages too).\n   * @returns {string|null}\n   */\n  function _currentPrincipal() {\n    try {\n      if (typeof window.pwaDb !== 'object') return null;\n      var userId = window.pwaDb.context().user_id;\n      return userId === undefined || userId === '' ? null : userId;\n    } catch (_e) {\n      return null;\n    }\n  }\n\n  /**\n   * Generate an idempotency key. ``crypto.randomUUID`` is available on\n   * every browser this queue targets; the hex fallback mirrors\n   * ``db.js``'s ``_randomHex`` for the rare runtime without it.\n   * @returns {string}\n   */\n  function _mintIdempotencyKey() {\n    try {\n      if (typeof crypto !== 'undefined' && crypto.randomUUID) {\n        return crypto.randomUUID();\n      }\n      var bytes = new Uint8Array(16);\n      crypto.getRandomValues(bytes);\n      var out = '';\n      for (var i = 0; i < bytes.length; i++) {\n        out += bytes[i].toString(16).padStart(2, '0');\n      }\n      return out;\n    } catch (_e) {\n      // No crypto at all \u2014 fall back to a low-entropy but still-unique-\n      // enough value so the queue keeps working rather than throwing.\n      return 'mut-' + Date.now().toString(16) + '-' + Math.floor(Math.random() * 1e9).toString(16);\n    }\n  }\n\n  /**\n   * SNOW-1262: whether a caller-supplied key is one the server will take \u2014\n   * a non-empty string no longer than core/idempotency.py's\n   * ``MAX_KEY_LENGTH`` (128). Anything else is ignored and a key minted.\n   * @param {*} key\n   * @returns {boolean}\n   */\n  function _isUsableKey(key) {\n    return typeof key === 'string' && key.length > 0 && key.length <= 128;\n  }\n\n  /**\n   * SNOW-1262: tell any surface listing rows that the set has changed.\n   * Queue-neutral, like the drain's own announcements: the reader filters.\n   */\n  function _announceChanged() {\n    try {\n      document.dispatchEvent(new CustomEvent(CHANGED_EVENT));\n    } catch (_e) {\n      // Non-fatal.\n    }\n  }\n\n  // The toast's English copy (SNOW-1262): the fallback for the strings\n  // ``<template>`` ``includes/_toast_banner.html`` renders, and the copy\n  // itself on a page that loads no ``i18n_strings.js``.\n  var TOAST_FALLBACKS = {\n    failed: \"Some changes couldn't be saved and won't be retried.\",\n    'route-discarded': 'A route drawn offline under another account was discarded.',\n  };\n\n  /**\n   * The toast's translated copy, read on use rather than at load \u2014\n   * ``i18n_strings.js`` is a deferred script like this one.\n   * @returns {{failed: string, 'route-discarded': string}}\n   */\n  function _strings() {\n    try {\n      if (self.pwaStrings) {\n        return self.pwaStrings.read('mutation-queue-strings-template', TOAST_FALLBACKS);\n      }\n    } catch (_e) {\n      // Fall through to the English copy.\n    }\n    return TOAST_FALLBACKS;\n  }\n\n  // -------------------------------------------------------------------\n  // Toast (full-width, top-of-page \u2014 templates/includes/_toast_banner.html)\n  // -------------------------------------------------------------------\n\n  function _toastEl() {\n    try {\n      return document.getElementById(TOAST_ID);\n    } catch (_e) {\n      return null;\n    }\n  }\n\n  /**\n   * Cancel any in-progress dismiss transition \u2014 its `transitionend`\n   * listener and fallback timer \u2014 without touching the element's classes.\n   * Called before both a fresh reveal and a fresh hide so repeated calls\n   * never leave stale listeners/timers behind.\n   */\n  function _cancelToastHideTransition(el) {\n    if (_toastHideFallbackTimer) {\n      clearTimeout(_toastHideFallbackTimer);\n      _toastHideFallbackTimer = null;\n    }\n    if (_toastHideTransitionEndHandler) {\n      try {\n        el?.removeEventListener('transitionend', _toastHideTransitionEndHandler);\n      } catch (_e) {\n        // Non-fatal.\n      }\n      _toastHideTransitionEndHandler = null;\n    }\n  }\n\n  /**\n   * Reveal the permanent-failure toast and (re)arm its 10s auto-dismiss\n   * timer. Uses a Tailwind class toggle (not custom CSS) for the\n   * slide-down reveal: remove ``hidden`` first, force a layout flush so\n   * the browser doesn't collapse the ``hidden``-removal and the\n   * transform/opacity flip into the same frame (which would skip the\n   * transition entirely), then flip the transform/opacity classes.\n   *\n   * SNOW-1262: the same banner carries a second message \u2014 a route drawn\n   * offline under another account was discarded \u2014 so the body is written\n   * on every reveal, the failure line by default.\n   *\n   * @param {string} [message] The line to show; the failure line if omitted.\n   */\n  function _revealToast(message) {\n    try {\n      var el = _toastEl();\n      if (!el) return;\n      var body = el.querySelector('[data-toast-body]');\n      if (body) body.textContent = message || _strings().failed;\n      // A reveal always wins over an in-progress dismiss.\n      _cancelToastHideTransition(el);\n      el.classList.remove('hidden');\n      el.offsetWidth; // force layout \u2014 see comment above.\n      el.classList.remove('-translate-y-full', 'opacity-0');\n      el.classList.add('translate-y-0', 'opacity-100');\n      if (_toastDismissTimer) clearTimeout(_toastDismissTimer);\n      _toastDismissTimer = setTimeout(_hideToast, TOAST_AUTO_DISMISS_MS);\n    } catch (_e) {\n      // Non-fatal \u2014 a broken toast must never break the mutation flow.\n    }\n  }\n\n  /**\n   * Dismiss the toast \u2014 played from both the \"\u00D7\" button and the 10s\n   * auto-dismiss timer. The reveal and dismiss are symmetric: this plays\n   * the slide-up/fade-out transition FIRST, and only adds ``hidden``\n   * (display:none) once that transition has actually finished \u2014 via a\n   * ``transitionend`` listener, with a ``setTimeout`` fallback matching\n   * the template's ``duration-300`` in case ``transitionend`` never fires\n   * (browser quirk, or the element was already mid-transition). Flipping\n   * both class changes in the same tick \u2014 as an earlier version of this\n   * function did \u2014 collapses the animation to nothing; ``hidden`` sets\n   * ``display: none`` immediately, so the browser never gets a frame in\n   * which to render the transform/opacity in flight.\n   */\n  function _hideToast() {\n    try {\n      var el = _toastEl();\n      if (_toastDismissTimer) {\n        clearTimeout(_toastDismissTimer);\n        _toastDismissTimer = null;\n      }\n      if (!el || el.classList.contains('hidden')) return;\n      _cancelToastHideTransition(el);\n\n      el.classList.remove('translate-y-0', 'opacity-100');\n      el.classList.add('-translate-y-full', 'opacity-0');\n\n      var finish = function () {\n        _cancelToastHideTransition(el);\n        el.classList.add('hidden');\n      };\n      _toastHideTransitionEndHandler = finish;\n      el.addEventListener('transitionend', finish);\n      _toastHideFallbackTimer = setTimeout(finish, TOAST_TRANSITION_MS + 50);\n    } catch (_e) {\n      // Non-fatal.\n    }\n  }\n\n  function _wireToast() {\n    try {\n      var el = _toastEl();\n      if (!el) return;\n      el.querySelector('[data-action=\"dismiss\"]')?.addEventListener('click', _hideToast);\n    } catch (_e) {\n      // Non-fatal \u2014 markup may be absent on pages that don't include the\n      // partial (e.g. admin).\n    }\n  }\n\n  // -------------------------------------------------------------------\n  // Nav sync badge (templates/includes/nav.html [data-sync-badge])\n  // -------------------------------------------------------------------\n\n  /**\n   * Refresh the nav badge from the live ``queue:mutations`` depth: text\n   * shows the non-``failed`` count (singular/plural), hidden entirely\n   * when that count is zero, coloured into the status-error tokens when\n   * any row in the store has failed.\n   * @returns {Promise<void>}\n   */\n  async function _updateBadge() {\n    try {\n      var el = document.querySelector(BADGE_SELECTOR);\n      if (!el) return;\n      if (typeof window.pwaDb !== 'object' || window.pwaDb.isResetRequired()) {\n        el.classList.add('hidden');\n        el.classList.remove('inline-flex');\n        return;\n      }\n      var rows = (await window.pwaDb.getAll(STORE)) || [];\n      var pending = rows.filter(function (r) {\n        return r.status !== 'failed';\n      });\n      var anyFailed = rows.some(function (r) {\n        return r.status === 'failed';\n      });\n      if (pending.length === 0) {\n        el.classList.add('hidden');\n        el.classList.remove('inline-flex');\n        return;\n      }\n      // i18n: English-only pre-launch (docs/i18n.md) \u2014 plain JS string,\n      // not wrapped, matching every other dynamically-generated JS\n      // string in the PWA layer today.\n      el.textContent =\n        pending.length === 1 ? '1 change queued' : pending.length + ' changes queued';\n      // SNOW-445: swap `hidden` for `inline-flex` so the two display utilities\n      // are never both present (which would otherwise leak an empty pill).\n      el.classList.remove('hidden');\n      el.classList.add('inline-flex');\n      if (anyFailed) {\n        el.classList.remove('bg-tag', 'text-text-3', 'border-border');\n        el.classList.add('bg-status-error-bg', 'text-status-error-text', 'border-status-error-text');\n      } else {\n        el.classList.remove('bg-status-error-bg', 'text-status-error-text', 'border-status-error-text');\n        el.classList.add('bg-tag', 'text-text-3', 'border-border');\n      }\n    } catch (_e) {\n      // Non-fatal \u2014 a badge refresh failure must never break the queue.\n    }\n  }\n\n  // -------------------------------------------------------------------\n  // Background Sync registration (feature-detected)\n  // -------------------------------------------------------------------\n\n  /**\n   * Register the shared Background Sync tag so Android Chromium can\n   * replay the queue even after every tab has closed. Wrapped end-to-end\n   * in a promise chain that swallows every rejection \u2014 browsers without\n   * ``SyncManager`` (notably iOS Safari) simply skip this with no error,\n   * relying entirely on the page-lifecycle drain triggers instead.\n   */\n  function _registerBackgroundSync() {\n    try {\n      if (!('serviceWorker' in navigator)) return;\n      var tag = window.pwaMutationQueueCore ? window.pwaMutationQueueCore.SYNC_TAG : 'mutation-queue';\n      navigator.serviceWorker.ready\n        .then(function (registration) {\n          if ('sync' in registration) {\n            return registration.sync.register(tag);\n          }\n          return undefined;\n        })\n        .catch(function () {\n          // Feature not supported, or registration failed transiently \u2014\n          // the lifecycle drain triggers are the fallback path either way.\n        });\n    } catch (_e) {\n      // Non-fatal.\n    }\n  }\n\n  // -------------------------------------------------------------------\n  // Row processing\n  // -------------------------------------------------------------------\n\n  /**\n   * Mark a row (and, separately, any caller-supplied operation metadata)\n   * as permanently failed: persist ``status: 'failed'``, emit the\n   * critical telemetry event, reveal the toast, and refresh the badge.\n   *\n   * @param {object} row The stored queue row.\n   * @param {string} reason Short machine-identifier for the failure.\n   */\n  async function _markRowFailed(row, reason) {\n    // `status: 'failed'` is stamped by core's `nextRowState` for the drain\n    // path; re-asserted here because `markFailed()` (the caller-driven\n    // report for a mutation attempted outside the queue) does not go\n    // through it.\n    var updated = Object.assign({}, row, { status: 'failed' });\n    try {\n      // SNOW-1262: not if the other drain has already landed it \u2014 then\n      // there is no failure to report.\n      if (!(await _writeBack(updated))) return false;\n    } catch (_e) {\n      // Non-fatal \u2014 still surface the failure below even if the write\n      // itself couldn't be persisted.\n    }\n    emitTelemetry('pwa.mutation.failed_permanent', {\n      method: row.method,\n      url: row.url,\n      idempotency_key: row.idempotency_key,\n      attempts: updated.attempts,\n      reason: reason,\n    });\n    // Generic DOM signal so a consumer can undo its optimistic UI for the\n    // failed mutation (SNOW-479: favourites.js drops the pending pin when a\n    // queued create is permanently rejected, e.g. the 409 at the favourites\n    // cap). Kept queue-neutral \u2014 the payload names the row, consumers filter.\n    try {\n      document.dispatchEvent(\n        new CustomEvent('pwa:mutation-failed-permanent', {\n          // SNOW-1262 added the row's kind, key and what the server said.\n          detail: {\n            method: row.method,\n            url: row.url,\n            reason: reason,\n            kind: row.kind || null,\n            idempotency_key: row.idempotency_key,\n            status: updated.last_status === undefined ? null : updated.last_status,\n            error: updated.last_error === undefined ? null : updated.last_error,\n          },\n        }),\n      );\n    } catch (_e) {\n      // Non-fatal \u2014 the toast + badge below are the primary user signal.\n    }\n    _revealToast();\n    _updateBadge().catch(function () {});\n    return true;\n  }\n\n  /**\n   * Write a replayed row back \u2014 rescheduled or failed \u2014 unless it has gone\n   * meanwhile (SNOW-1262).\n   *\n   * Two drains can hold the same row: this page's and the service worker's\n   * (or another tab's). A ``put`` is an upsert by id, so a drain that read\n   * the row, lost the race and wrote its stale answer back RE-CREATED a row\n   * the winner had already replayed and deleted \u2014 a ghost \"failed\" or\n   * \"waiting\" route the server already has. So the acknowledgement is\n   * checked first (the winner writes it before deleting), and then the row\n   * is re-read and written in ONE readwrite transaction (``readModifyWrite``),\n   * which the browser serialises against every other connection: absent\n   * means gone, and nothing is written.\n   *\n   * @param {object} row The row to write.\n   * @returns {Promise<boolean>} Whether it was written.\n   */\n  async function _writeBack(row) {\n    if (row.idempotency_key && (await acknowledged(row.idempotency_key))) return false;\n    var written = false;\n    await window.pwaDb.readModifyWrite(STORE, row.id, function (current) {\n      if (current === undefined) return undefined;\n      written = true;\n      return row;\n    });\n    return written;\n  }\n\n  /**\n   * Replay one eligible row. Returns\n   * ``'success' | 'failed' | 'retry' | 'discarded' | 'gone'`` describing the\n   * outcome so ``drain()`` can count real successes \u2014 a ``'discarded'``\n   * row never left this device, so it must not count as either.\n   *\n   * ``'gone'`` (SNOW-1262): another drain replayed and deleted the row\n   * while this one was waiting on its answer; nothing was written back.\n   *\n   * @param {object} row\n   * @returns {Promise<'success'|'failed'|'retry'|'discarded'|'gone'>}\n   */\n  async function _processRow(row) {\n    // SNOW-462 drain-guard: the row's enqueue-time principal must still\n    // match the current one \u2014 the race backstop for the window between\n    // an account change and the next reconcile (see _reconcilePrincipal\n    // and the module header's \"Account-change partitioning\" section).\n    if (row.principal !== _currentPrincipal()) {\n      try {\n        await window.pwaDb.delete(STORE, row.id);\n      } catch (_e) {\n        // Non-fatal \u2014 still report the discard below even if the delete\n        // itself couldn't be persisted.\n      }\n      emitTelemetry('pwa.mutation.discarded', {\n        method: row.method,\n        url: row.url,\n        idempotency_key: row.idempotency_key,\n        reason: 'principal_mismatch',\n      });\n      // SNOW-1262: a discarded route is work the user believes they did.\n      _tellDiscarded([row]);\n      return 'discarded';\n    }\n\n    var core = window.pwaMutationQueueCore;\n    if (!core) {\n      // The shared helper script didn't load \u2014 treat as a transient\n      // condition rather than guessing at classification logic here.\n      return 'retry';\n    }\n\n    var headers = Object.assign({}, row.headers || {}, {\n      // Identical value across every replay of this row \u2014 the server-side\n      // contract (core/idempotency.py) relies on that to deduplicate.\n      'Idempotency-Key': row.idempotency_key,\n    });\n\n    var outcome;\n    var status = null;\n    var body = null;\n    try {\n      var response = await fetch(row.url, {\n        method: row.method,\n        headers: headers,\n        body: row.body != null ? row.body : undefined,\n      });\n      status = response.status;\n      // SNOW-1262: read for three things \u2014 a created route's uuid (the\n      // acknowledgement below), a refusal's ``error`` (kept on the row),\n      // and the idempotency middleware's in-flight 409, which is a retry.\n      body = await response.json().catch(function () {\n        return null;\n      });\n      outcome = core.classifyStatus(\n        response.status,\n        row.done_statuses,\n        body && typeof body.error === 'string' ? body.error : null,\n      );\n    } catch (_networkErr) {\n      outcome = 'retry';\n    }\n\n    // SNOW-617: the transition itself is core's, not this file's \u2014 see\n    // `nextRowState`. This function keeps only the IO around it.\n    // SNOW-1262: with the response's status and error recorded on the row.\n    var now = Date.now();\n    var transition = core.nextRowState(\n      row,\n      outcome,\n      now,\n      core.failureDetail ? core.failureDetail(status, body) : undefined,\n    );\n\n    if (transition.action === 'delete') {\n      // SNOW-1262: acknowledge BEFORE deleting, so no reader ever finds\n      // neither the row nor its acknowledgement \u2014 \"never sent\" \u2014 for a\n      // mutation that landed. The worker's drain does the same.\n      var ack = core.ackRecord ? core.ackRecord(row, body, now) : null;\n      if (ack) {\n        try {\n          await window.pwaDb.put('meta:app', ack);\n        } catch (_e) {\n          // Non-fatal: the reader falls back to \"keep the draft and its\n          // key\", and the server's 24 h replay window covers a re-save.\n        }\n      }\n      await window.pwaDb.delete(STORE, row.id);\n      return 'success';\n    }\n    if (transition.action === 'fail') {\n      // SNOW-1262: a row the other drain landed meanwhile is neither.\n      return (await _markRowFailed(transition.row, transition.reason)) ? 'failed' : 'gone';\n    }\n    return (await _writeBack(transition.row)) ? 'retry' : 'gone';\n  }\n\n  // -------------------------------------------------------------------\n  // Public surface\n  // -------------------------------------------------------------------\n\n  /**\n   * Enqueue one mutation. Mints a fresh Idempotency-Key, persists the row,\n   * drains immediately when online, and feature-detects a Background\n   * Sync registration for the offline/tab-closed case.\n   *\n   * @param {object} [operation] Caller-supplied mutation descriptor:\n   *   ``{method, url, headers, body, doneStatuses, idempotencyKey, kind}``.\n   *   ``method`` defaults to ``'POST'``. SNOW-1132: ``doneStatuses`` is an\n   *   optional list of response codes that mean the mutation is already\n   *   applied (a 404 on a delete); the drain treats them as success.\n   *   SNOW-1262: ``idempotencyKey`` is the caller's own key (minted here\n   *   when absent or unusable); a row with that key already queued is not\n   *   queued twice. ``kind`` names what the row is for a reader of\n   *   ``list()``, and makes a successful replay leave an acknowledgement.\n   * @returns {Promise<?string>} The row's Idempotency-Key, or null when\n   *   nothing was queued (no IndexedDB, or Reset Required). Callers from\n   *   before SNOW-1262 ignore it.\n   */\n  async function enqueue(operation) {\n    var op = operation || {};\n    // SNOW-1262: the body and headers stay out of the event. A drawn\n    // route's body runs to thousands of points \u2014 past the telemetry\n    // receiver's 32 KiB batch cap \u2014 and the headers carry a CSRF token.\n    emitTelemetry('pwa.mutation.enqueued', _telemetryProps(op));\n    try {\n      if (typeof window.pwaDb !== 'object' || window.pwaDb.isResetRequired()) {\n        return null;\n      }\n      var key = _isUsableKey(op.idempotencyKey) ? op.idempotencyKey : _mintIdempotencyKey();\n      if (_isUsableKey(op.idempotencyKey)) {\n        var existing = (await window.pwaDb.getAll(STORE)) || [];\n        var already = existing.some(function (r) {\n          return r.idempotency_key === key;\n        });\n        if (already) return key;\n      }\n      var row = {\n        idempotency_key: key,\n        method: (op.method || 'POST').toUpperCase(),\n        url: op.url,\n        headers: op.headers || {},\n        body: op.body !== undefined ? op.body : null,\n        created_at: new Date().toISOString(),\n        attempts: 0,\n        status: 'queued',\n        next_attempt_at: Date.now(),\n        principal: _currentPrincipal(),\n        done_statuses: Array.isArray(op.doneStatuses) ? op.doneStatuses.slice() : [],\n        kind: typeof op.kind === 'string' && op.kind ? op.kind : null,\n      };\n      await window.pwaDb.put(STORE, row);\n      await _updateBadge();\n      _announceChanged();\n      if (_networkInUse()) {\n        drain().catch(function () {});\n      }\n      _registerBackgroundSync();\n      return key;\n    } catch (_e) {\n      // Non-fatal \u2014 enqueue must never throw for the caller.\n      return null;\n    }\n  }\n\n  /**\n   * The enqueue event's properties: the operation minus its body, headers\n   * and key (SNOW-1262 \u2014 see ``enqueue``).\n   * @param {object} op\n   * @returns {object}\n   */\n  function _telemetryProps(op) {\n    var props = {};\n    Object.keys(op).forEach(function (name) {\n      if (name === 'body' || name === 'headers' || name === 'idempotencyKey') return;\n      props[name] = op[name];\n    });\n    return props;\n  }\n\n  /**\n   * Drain every eligible row, replaying it with its identical\n   * Idempotency-Key. Serialised \u2014 a call while one is already in flight\n   * returns the same promise so concurrent triggers can't double-POST.\n   *\n   * @returns {Promise<void>}\n   */\n  function drain() {\n    // Offline-integrity: don't replay to the network while offline \u2014 the\n    // POST can only fail, and each failure classifies as 'retry', spends one\n    // of the row's MAX_ATTEMPTS and lengthens its backoff. Rows stay queued;\n    // the ``online`` lifecycle trigger drains them on reconnect. Mirrors\n    // telemetry.js's flush() guard and the connectivity check enqueue()\n    // already makes before its own drain.\n    if (!_networkInUse()) {\n      return Promise.resolve();\n    }\n    if (_drainInFlight) return _drainInFlight;\n    _drainInFlight = (async () => {\n      var drained = 0;\n      var touched = 0;\n      var routesLanded = false;\n      try {\n        if (typeof window.pwaDb !== 'object' || window.pwaDb.isResetRequired()) {\n          return;\n        }\n        var core = window.pwaMutationQueueCore;\n        // SNOW-617: read every row and let core pick the batch, rather\n        // than reading the oldest BATCH_SIZE and filtering those. A\n        // permanently-failed row is never deleted \u2014 the nav badge's error\n        // state is defined on its presence (docs/mutation-queue.md) \u2014 so\n        // under the old order BATCH_SIZE failed rows at the head of the\n        // store occupied every slot in every pass, and each eligible row\n        // behind them starved indefinitely, with no error and no telemetry\n        // to say why. Unbounded read matches `_updateBadge`, which already\n        // does one.\n        var rows = (await window.pwaDb.getAll(STORE)) || [];\n        var now = Date.now();\n        var eligible = core\n          ? core.selectDrainBatch(rows, now, BATCH_SIZE)\n          : rows.filter(function (row) {\n              return row.status !== 'failed';\n            }).slice(0, BATCH_SIZE);\n        for (const row of eligible) {\n          // Sequential, not parallel \u2014 keeps replay order stable and\n          // avoids concurrent writes to the same store racing each other.\n          var result = await _processRow(row);\n          touched += 1;\n          if (result === 'success') {\n            drained += 1;\n            if (row.kind === 'route-create') routesLanded = true;\n          }\n        }\n      } catch (_e) {\n        // Non-fatal \u2014 a drain failure must never break the caller.\n      } finally {\n        emitTelemetry('pwa.mutation.drained', { count: drained });\n        // SNOW-479: once \u22651 row synced we are online and server state has\n        // moved, so tell the map to refetch the overlays that draw it. The\n        // favourites announcement is what replaces an offline-created pin's\n        // synthetic \"pending\" marker with the authoritative server pin; the\n        // reports one is what puts a filed field observation onto the\n        // community-reports layer, which nothing else did \u2014 an accepted\n        // report was listed in its panel and absent from the map until the\n        // page was reloaded.\n        //\n        // Both are deliberately fired for ANY successful drain rather than\n        // being matched to what actually replayed: this queue carries no\n        // per-operation kind, and map.js's listeners are gated on their own\n        // overlay being loaded and eligible, so the wrong-kind case costs one\n        // cheap refetch and never a wrong picture. Matching would mean\n        // teaching the queue what its rows mean, which is the coupling the\n        // queue exists to avoid.\n        //\n        // SNOW-1262: and the routes one, so a route drawn offline turns from\n        // the panel's \"Waiting to sync\" row and the map's plain line into\n        // the route itself. Fired, like the other two, for any successful\n        // drain; flagged as an upload only when a route-create row landed,\n        // because that is the one write map.js re-reads later for its\n        // terrain (see routes.js's announceRoutesChanged).\n        if (drained > 0) {\n          for (const name of [\n            'snowdesk:favourites-changed',\n            'snowdesk:reports-changed',\n            'snowdesk:routes-changed',\n          ]) {\n            try {\n              var detail = name === 'snowdesk:routes-changed' && routesLanded ? { uploaded: true } : null;\n              document.dispatchEvent(new CustomEvent(name, { detail: detail }));\n            } catch (_e2) {\n              // Non-fatal \u2014 the drain itself already succeeded.\n            }\n          }\n        }\n        _drainInFlight = null;\n        _updateBadge().catch(function () {});\n        if (touched > 0) _announceChanged();\n      }\n    })();\n    return _drainInFlight;\n  }\n\n  /**\n   * Caller-driven permanent-failure report for a mutation attempted\n   * outside the queue. Emits the critical ``pwa.mutation.failed_permanent``\n   * event and surfaces the same toast + badge state as an internally\n   * failed row.\n   *\n   * @param {object} [operation] Caller-supplied mutation descriptor.\n   * @param {string} [reason] Short machine-identifier for the failure.\n   * @returns {Promise<void>}\n   */\n  async function markFailed(operation, reason) {\n    emitTelemetry('pwa.mutation.failed_permanent', {\n      ...(operation || {}),\n      reason: reason || 'unknown',\n    });\n    _revealToast();\n    await _updateBadge().catch(function () {});\n  }\n\n  /**\n   * Empty the entire ``queue:mutations`` store and refresh the nav\n   * badge. Guarded/non-fatal \u2014 used internally by\n   * ``_reconcilePrincipal()`` on an account change, and available to any\n   * other caller that needs to discard the whole queue outright.\n   *\n   * @returns {Promise<void>}\n   */\n  async function clear() {\n    try {\n      if (typeof window.pwaDb !== 'object' || window.pwaDb.isResetRequired()) {\n        return;\n      }\n      await window.pwaDb.clear(STORE);\n      await _updateBadge();\n      _announceChanged();\n    } catch (_e) {\n      // Non-fatal \u2014 clear() must never throw for the caller.\n    }\n  }\n\n  // -------------------------------------------------------------------\n  // SNOW-1262: reading the queue, and the acknowledgements it leaves.\n  // -------------------------------------------------------------------\n\n  /**\n   * The current principal's rows, optionally of one kind, as plain copies\n   * without their headers (which carry a CSRF token no reader needs).\n   * Principal-scoped like every other read of user data on the device: a\n   * row another account queued is never listed, even in the moment before\n   * the reconcile discards it.\n   *\n   * @param {{kind?: string}} [filter]\n   * @returns {Promise<Array<object>>} Oldest first; empty on any failure.\n   */\n  async function list(filter) {\n    try {\n      if (typeof window.pwaDb !== 'object' || window.pwaDb.isResetRequired()) return [];\n      var kind = filter && filter.kind;\n      var principal = _currentPrincipal();\n      var rows = (await window.pwaDb.getAll(STORE)) || [];\n      return rows\n        .filter(function (r) {\n          return r.principal === principal && (!kind || r.kind === kind);\n        })\n        .map(function (r) {\n          return {\n            idempotency_key: r.idempotency_key,\n            kind: r.kind || null,\n            status: r.status,\n            created_at: r.created_at,\n            body: r.body,\n            attempts: r.attempts,\n            last_status: r.last_status === undefined ? null : r.last_status,\n            last_error: r.last_error === undefined ? null : r.last_error,\n          };\n        });\n    } catch (_e) {\n      return [];\n    }\n  }\n\n  /**\n   * The acknowledgement the successful replay of ``key``'s row left, or\n   * null \u2014 never replayed, not a ``kind`` row, pruned, or unreadable.\n   *\n   * @param {string} key An Idempotency-Key.\n   * @returns {Promise<?{kind: string, uuid: ?string, at: number}>}\n   */\n  async function acknowledged(key) {\n    try {\n      if (!key || typeof window.pwaDb !== 'object' || window.pwaDb.isResetRequired()) return null;\n      var prefix = window.pwaMutationQueueCore ? window.pwaMutationQueueCore.ACK_KEY_PREFIX : 'mutations.ack:';\n      var record = await window.pwaDb.get('meta:app', prefix + key);\n      return record && record.value ? record.value : null;\n    } catch (_e) {\n      return null;\n    }\n  }\n\n  /**\n   * Delete the current principal's row with this key \u2014 the user throwing\n   * away a mutation that failed for good \u2014 and refresh the badge.\n   *\n   * @param {string} key An Idempotency-Key.\n   * @returns {Promise<boolean>} Whether a row was deleted.\n   */\n  async function discard(key) {\n    try {\n      if (!key || typeof window.pwaDb !== 'object' || window.pwaDb.isResetRequired()) return false;\n      var principal = _currentPrincipal();\n      var rows = (await window.pwaDb.getAll(STORE)) || [];\n      var gone = false;\n      for (const r of rows) {\n        if (r.idempotency_key !== key || r.principal !== principal) continue;\n        await window.pwaDb.delete(STORE, r.id);\n        gone = true;\n      }\n      if (gone) {\n        await _updateBadge();\n        _announceChanged();\n      }\n      return gone;\n    } catch (_e) {\n      return false;\n    }\n  }\n\n  /**\n   * Tell the user that rows they were waiting on were discarded because\n   * the account changed (SNOW-1262). Only a route drawn offline has a line\n   * of its own today; any other kind is the queue's business alone.\n   *\n   * @param {Array<object>} rows The discarded rows (or ``{kind}`` stubs).\n   */\n  function _tellDiscarded(rows) {\n    var routes = rows.some(function (r) {\n      return r && r.kind === 'route-create';\n    });\n    if (routes) _revealToast(_strings()['route-discarded']);\n  }\n\n  /**\n   * Show, then delete, the notice the worker's drain guard leaves when it\n   * discards a ``kind`` row with no page open (SNOW-1262), and prune every\n   * acknowledgement past its week.\n   *\n   * @returns {Promise<void>}\n   */\n  async function _readNoticesAndPrune() {\n    var core = window.pwaMutationQueueCore;\n    if (!core) return;\n    var records = (await window.pwaDb.getAll('meta:app')) || [];\n    var now = Date.now();\n    for (const record of records) {\n      if (record.key === core.DISCARD_NOTICE_KEY) {\n        var kinds = (record.value && record.value.kinds) || [];\n        _tellDiscarded(\n          kinds.map(function (k) {\n            return { kind: k };\n          }),\n        );\n        await window.pwaDb.delete('meta:app', record.key);\n      } else if (core.ackExpired(record, now)) {\n        await window.pwaDb.delete('meta:app', record.key);\n      }\n    }\n  }\n\n  // -------------------------------------------------------------------\n  // Account-change reconcile (SNOW-462) \u2014 see the module header's\n  // \"Account-change partitioning\" section.\n  // -------------------------------------------------------------------\n\n  /**\n   * Compare the current principal against the last-seen one persisted in\n   * ``meta:app`` (key ``mutations.principal``). On a mismatch \u2014 the\n   * browser signed in as someone else since the last page load \u2014 clear\n   * the whole queue (so nothing queued under the previous principal can\n   * ever replay) and persist the new principal. Run first thing in\n   * ``_wireLifecycle()``, fire-and-forget: the drain-guard in\n   * ``_processRow()`` is the race backstop, so this must not block\n   * wiring the rest of the lifecycle.\n   *\n   * The ``pwa.mutation.discarded`` ``reason`` distinguishes two mismatch\n   * causes so the logs can tell them apart: ``'account_change'``\n   * when a ``mutations.principal`` row already existed and genuinely\n   * differs from the current principal, versus\n   * ``'principal_uninitialised'`` when no such row existed yet (first\n   * load after this ticket shipped, or a fresh DB) \u2014 any pre-existing,\n   * principal-less row is untrustworthy and cleared on general\n   * principle, not because an actual account change was observed.\n   *\n   * Entirely guarded/non-fatal \u2014 a failure here leaves the drain-guard\n   * as the sole (still airtight, if less proactive) protection.\n   *\n   * @returns {Promise<void>}\n   */\n  async function _reconcilePrincipal() {\n    try {\n      if (typeof window.pwaDb !== 'object' || window.pwaDb.isResetRequired()) {\n        return;\n      }\n      // SNOW-1262: the worker's discard notice and the week-old\n      // acknowledgements first \u2014 independent of whether the principal\n      // moved, and best effort.\n      await _readNoticesAndPrune().catch(function () {});\n      var current = _currentPrincipal();\n      var stored = await window.pwaDb.get('meta:app', 'mutations.principal');\n      var wasUninitialised = stored === undefined;\n      var storedValue = wasUninitialised ? undefined : stored.value;\n      if (!wasUninitialised && storedValue === current) {\n        return;\n      }\n      var rows = (await window.pwaDb.getAll(STORE)) || [];\n      if (rows.length > 0) {\n        await clear();\n        emitTelemetry('pwa.mutation.discarded', {\n          count: rows.length,\n          reason: wasUninitialised ? 'principal_uninitialised' : 'account_change',\n        });\n        // SNOW-1262: an account change always involves a page load, so this\n        // is where the user hears that a route they drew offline went.\n        _tellDiscarded(rows);\n      }\n      await window.pwaDb.put('meta:app', { key: 'mutations.principal', value: current });\n    } catch (_e) {\n      // Non-fatal \u2014 see the docstring above.\n    }\n  }\n\n  // -------------------------------------------------------------------\n  // Lifecycle triggers \u2014 mirrors telemetry.js's _wireLifecycle, plus the\n  // load drain at the end, which telemetry.js has no equivalent of (a\n  // buffered event costs nothing by waiting; a queued mutation is work the\n  // user believes they have done).\n  // -------------------------------------------------------------------\n\n  function _wireLifecycle() {\n    // SNOW-462: fire-and-forget \u2014 must not block wiring the rest of the\n    // lifecycle. The drain-guard in _processRow is the race backstop.\n    // SNOW-860 keeps the handle so the load drain below can wait for it.\n    var reconciled = _reconcilePrincipal().catch(() => {});\n    try {\n      window.addEventListener('online', () => {\n        drain().catch(() => {});\n      });\n    } catch (_e) {\n      // Non-fatal.\n    }\n    try {\n      document.addEventListener('visibilitychange', () => {\n        if (document.visibilityState === 'visible') {\n          drain().catch(() => {});\n        }\n      });\n    } catch (_e) {\n      // Non-fatal.\n    }\n    try {\n      setInterval(() => {\n        if (document.visibilityState === 'visible') {\n          drain().catch(() => {});\n        }\n      }, DRAIN_INTERVAL_MS);\n    } catch (_e) {\n      // Non-fatal.\n    }\n    try {\n      // Best-effort drain as the tab tears down, and the only trigger that\n      // runs regardless of visibility. Unlike telemetry.js's mirror of this\n      // trigger there is no ``keepalive`` counterpart: a replay carries a\n      // body and an Idempotency-Key, so a fetch cut short by the teardown\n      // leaves the row queued for the next load or for the Background Sync\n      // registration made at enqueue time, and the server deduplicates a\n      // replay that did reach it.\n      window.addEventListener('pagehide', () => {\n        drain().catch(() => {});\n      });\n    } catch (_e) {\n      // Non-fatal.\n    }\n    _wireToast();\n    // Reflect any rows left over from a previous session/tab close.\n    _updateBadge().catch(() => {});\n\n    // SNOW-860: and TRY TO SEND THEM. Load was not a drain trigger, so a\n    // row left over from a previous session was painted onto the badge\n    // and then sat there: `online` fires only on an offline\u2192online\n    // transition and never for a tab that opened online, and\n    // `visibilitychange` needs a tab switch, which left the 30s timer as\n    // the first real attempt \u2014 a timer created fresh on every load, so\n    // refreshing repeatedly restarted the only clock that would have\n    // sent the row. The badge read \"1 change queued\" indefinitely while\n    // nothing was ever tried.\n    //\n    // Chained onto the reconcile rather than fired beside it: a mismatched\n    // principal clears the whole queue, and there is no point replaying\n    // rows that are about to be discarded. `_processRow`'s drain-guard\n    // would catch them anyway; this just avoids the pointless work.\n    //\n    // Safe to call unconditionally \u2014 `drain()` returns an already-resolved\n    // promise when offline, when `window.pwaDb` is absent (this file loads\n    // on admin pages too) or when a reset is required, and `_drainInFlight`\n    // serialises it against every other trigger.\n    reconciled.then(() => drain()).catch(() => {});\n  }\n\n  Object.defineProperty(window, 'pwaMutationQueue', {\n    value: Object.freeze({\n      enqueue,\n      drain,\n      markFailed,\n      clear,\n      // SNOW-1262 \u2014 additive.\n      list,\n      acknowledged,\n      discard,\n      principal: _currentPrincipal,\n    }),\n    writable: false,\n    configurable: false,\n  });\n\n  if (document.readyState === 'loading') {\n    document.addEventListener('DOMContentLoaded', _wireLifecycle);\n  } else {\n    _wireLifecycle();\n  }\n})();\n"],
  "mappings": "CA2JC,UAAY,CACX,aAEA,IAAIA,EAAQ,kBAKRC,EAAa,GAKbC,EAAoB,GAAK,IAKzBC,EAAwB,GAAK,IAE7BC,EAAW,uBAEXC,EAAgB,6BAChBC,EAAiB,oBAOjBC,EAAsB,IAKtBC,EAAiB,KAKjBC,EAAqB,KAKrBC,EAA0B,KAC1BC,EAAiC,KAOrC,SAASC,EAAcC,EAAOC,EAAY,CACxC,GAAI,CACF,OAAO,cAAc,KAAKD,EAAOC,GAAc,CAAC,CAAC,CACnD,MAAe,CAEf,CACF,CAYA,SAASC,GAAgB,CACvB,IAAIC,EAAe,OAAO,gBAC1B,OAAOA,EAAeA,EAAa,SAAS,EAAI,UAAU,SAAW,EACvE,CAWA,SAASC,GAAoB,CAC3B,GAAI,CACF,GAAI,OAAO,OAAO,OAAU,SAAU,OAAO,KAC7C,IAAIC,EAAS,OAAO,MAAM,QAAQ,EAAE,QACpC,OAAOA,IAAW,QAAaA,IAAW,GAAK,KAAOA,CACxD,MAAa,CACX,OAAO,IACT,CACF,CAQA,SAASC,GAAsB,CAC7B,GAAI,CACF,GAAI,OAAO,OAAW,KAAe,OAAO,WAC1C,OAAO,OAAO,WAAW,EAE3B,IAAIC,EAAQ,IAAI,WAAW,EAAE,EAC7B,OAAO,gBAAgBA,CAAK,EAE5B,QADIC,EAAM,GACDC,EAAI,EAAGA,EAAIF,EAAM,OAAQE,IAChCD,GAAOD,EAAME,CAAC,EAAE,SAAS,EAAE,EAAE,SAAS,EAAG,GAAG,EAE9C,OAAOD,CACT,MAAa,CAGX,MAAO,OAAS,K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oB,IAAM,CAC9C,SAAS,kBAAoB,WAC/BA,EAAM,EAAE,MAAM,IAAM,CAAC,CAAC,CAE1B,CAAC,CACH,MAAa,CAEb,CACA,GAAI,CACF,YAAY,IAAM,CACZ,SAAS,kBAAoB,WAC/BA,EAAM,EAAE,MAAM,IAAM,CAAC,CAAC,CAE1B,EAAGnE,CAAiB,CACtB,MAAa,CAEb,CACA,GAAI,CAQF,OAAO,iBAAiB,WAAY,IAAM,CACxCmE,EAAM,EAAE,MAAM,IAAM,CAAC,CAAC,CACxB,CAAC,CACH,MAAa,CAEb,CACAjC,EAAW,EAEXC,EAAa,EAAE,MAAM,IAAM,CAAC,CAAC,EAqB7B6D,EAAW,KAAK,IAAM7B,EAAM,CAAC,EAAE,MAAM,IAAM,CAAC,CAAC,CAC/C,CAEA,OAAO,eAAe,OAAQ,mBAAoB,CAChD,MAAO,OAAO,OAAO,CACnB,QAAAN,EACA,MAAAM,EACA,WAAAS,EACA,MAAAC,EAEA,KAAAC,EACA,aAAA9B,EACA,QAAAoC,EACA,UAAWrE,CACb,CAAC,EACD,SAAU,GACV,aAAc,EAChB,CAAC,EAEG,SAAS,aAAe,UAC1B,SAAS,iBAAiB,mBAAoBgF,CAAc,EAE5DA,EAAe,CAEnB,GAAG",
  "names": ["STORE", "BATCH_SIZE", "DRAIN_INTERVAL_MS", "TOAST_AUTO_DISMISS_MS", "TOAST_ID", "CHANGED_EVENT", "BADGE_SELECTOR", "TOAST_TRANSITION_MS", "_drainInFlight", "_toastDismissTimer", "_toastHideFallbackTimer", "_toastHideTransitionEndHandler", "emitTelemetry", "event", "properties", "_networkInUse", "connectivity", "_currentPrincipal", "userId", "_mintIdempotencyKey", "bytes", "out", "i", "_isUsableKey", "key", "_announceChanged", "TOAST_FALLBACKS", "_strings", "_toastEl", "_cancelToastHideTransition", "el", "_revealToast", "message", "body", "_hideToast", "finish", "_wireToast", "_updateBadge", "rows", "pending", "r", "anyFailed", "_registerBackgroundSync", "tag", "registration", "_markRowFailed", "row", "reason", "updated", "_writeBack", "acknowledged", "written", "current", "_processRow", "_tellDiscarded", "core", "headers", "outcome", "status", "response", "now", "transition", "ack", "enqueue", "operation", "op", "_telemetryProps", "existing", "already", "drain", "props", "name", "drained", "touched", "routesLanded", "eligible", "result", "detail", "markFailed", "clear", "list", "filter", "kind", "principal", "prefix", "record", "discard", "gone", "routes", "_readNoticesAndPrune", "records", "kinds", "k", "_reconcilePrincipal", "stored", "wasUninitialised", "storedValue", "_wireLifecycle", "reconciled"]
}
