{
  "version": 3,
  "sources": ["basemap_downloaded_areas.js"],
  "sourcesContent": ["/*\n * static/js/basemap_downloaded_areas.js \u2014 the one reader of what this\n * device has downloaded (SNOW-860).\n *\n * Extracted from `static/js/map_basemap_downloads.js`, which is 2,500+\n * lines of map-page machinery: it reads `MAP`, `COUNTRY_STATE` and\n * `RATINGS_URL` as bare identifiers from a shared global lexical scope,\n * and carries a load-order contract with `map.js` (see its own header).\n * None of that can be loaded onto a page with no map \u2014 and such a page\n * is exactly what SNOW-860 needs the answer on, because `/offline/`'s\n * (SNOW-930; `/account/settings/`'s before it) \"Reset local data\" row now\n * states what the reset is about to delete.\n *\n * So the reader moved out and nothing else did. `basemapDownloadedAreas`,\n * `pinnedBucketAreaIds` and the two record reads behind them are here;\n * `map_basemap_downloads.js` delegates to this module rather than\n * keeping a second copy, because the whole point of the extraction is\n * that the Manage downloads sheet and the settings-page breakdown can\n * never disagree about what is on the device.\n *\n * Page-agnostic by construction: it reads nothing from another file's\n * lexical scope, touches no DOM, and every dependency it does have is\n * looked up on `self`/`window` at CALL time \u2014\n * `pwaBasemapDownloadCore` (area-id grammar and the pinned-cache\n * prefix), `pwaBasemapManageCore` (`reconcileAreas`), `pwaDb`,\n * `pwaDownloadsSync` (optional) and `pwaDebugLog` (optional). Load order\n * therefore does not matter for THIS file's own boot; it matters only in\n * that `map_basemap_downloads.js` calls into it, so it is loaded before\n * the map bundle on the map page.\n *\n * Best-effort throughout, and deliberately so: this sits on the map's\n * boot path (the download roundel probes it on every page load), so a\n * transient IndexedDB or Cache Storage failure must read as \"nothing\n * recorded\" rather than throw and take the surface down with it.\n *\n * Exports (frozen `window.pwaBasemapAreas`):\n *\n *   downloadedAreas(options)\n *     Every area this device has downloaded, normalised into the\n *     `[{id, name, bytes, savedAt, basemapKey, \u2026}]` shape\n *     `pwaBasemapManageCore.manageRows` and `planEviction` consume.\n *   measureBucketBytes(areaId)\n *     One pinned bucket's size by `Content-Length` \u2014 the measurement an\n *     orphaned bucket is sized by, on every surface (SNOW-1138).\n *   pinnedBucketAreaIds()\n *     Every area id with a pinned Cache Storage bucket present \u2014 the\n *     ground truth for what is actually stored.\n *   readBaseLayers()\n *     The `meta:app` `basemap.baseLayers` record (SNOW-856).\n *   readCustomAreas()\n *     The `meta:app` `basemap.customAreas` record, migrating the legacy\n *     single-row `basemap.customArea` into it on first read.\n *   withRun(record, run) / mergeRun(prior, run, options)\n *     SNOW-1583: a record's `outcome`, `parts`, `retryable` and `lastRun`\n *     from a first download's run, and one run laid over a stored record.\n *   CUSTOM_AREAS_KEY / LEGACY_CUSTOM_AREA_KEY / BASE_LAYERS_KEY\n *     The `meta:app` keys above, so the writers left behind in\n *     `map_basemap_downloads.js` name the same rows this reader does.\n */\n\n(function () {\n  'use strict';\n\n  // SNOW-635: the array-shaped record replacing the old single-row\n  // `basemap.customArea` \u2014 see `readCustomAreas`'s docstring for the lazy\n  // migration between the two.\n  var CUSTOM_AREAS_KEY = 'basemap.customAreas';\n  var LEGACY_CUSTOM_AREA_KEY = 'basemap.customArea';\n\n  // SNOW-856: the shared base layers, one entry per basemap that has\n  // one \u2014 `[{basemapKey, band, bbox, bytes, savedAt}]`. A sibling of the\n  // record above rather than an entry in it, because a base layer is not\n  // an area: no user chose it, no user can delete it, and it outlives\n  // every area that shares it.\n  var BASE_LAYERS_KEY = 'basemap.baseLayers';\n\n  // The English fallbacks for the two names this module fills in. The\n  // translated forms are passed in by the caller (`options.strings`),\n  // which is what keeps this module free of a template id: the map page\n  // reads them out of `map-strings-template` and `/offline/` out of\n  // its own panel's template, and neither has to know about the other's.\n  var FALLBACK_STRINGS = {\n    'default-custom-name': 'Custom area %(n)s',\n    'base-layer-name': 'Overview map',\n  };\n\n  /**\n   * Look one name up, preferring the caller's translated copy.\n   *\n   * @param {Object<string, string>} strings Caller-supplied strings.\n   * @param {string} key\n   * @returns {string}\n   */\n  function stringFor(strings, key) {\n    return (strings && strings[key]) || FALLBACK_STRINGS[key];\n  }\n\n  /**\n   * SNOW-1142: a record's `principal` stamp, passed through unchanged \u2014\n   * a string ('' for an anonymous download), or null for a LEGACY record\n   * that has no such field. The two absences are different facts and the\n   * claim rule reads them alike, but the reader keeps them apart.\n   *\n   * @param {Object} record A `basemap.regions` / `basemap.customAreas` entry.\n   * @returns {string|null}\n   */\n  function principalOf(record) {\n    return record && typeof record.principal === 'string' ? record.principal : null;\n  }\n\n  /**\n   * Every area id with a pinned bucket present in Cache Storage\n   * (SNOW-612).\n   *\n   * The bucket is the ground truth for what is actually stored; the\n   * `basemap.regions` / `basemap.customAreas` records are only what\n   * COMPLETED runs left behind. A download that failed partway leaves the\n   * former without the latter, which is exactly the stranded quota this\n   * reader exists to surface \u2014 see `downloadedAreas` below.\n   *\n   * Never throws: Cache Storage being unavailable reads as \"no buckets\",\n   * which degrades to the pre-SNOW-612 behaviour of trusting the records\n   * alone rather than blocking anything.\n   *\n   * @returns {Promise<string[]>}\n   */\n  async function pinnedBucketAreaIds() {\n    var core = self.pwaBasemapDownloadCore;\n    if (!core || typeof caches === 'undefined') return [];\n    var prefix = core.PINNED_CACHE_PREFIX;\n    try {\n      var names = await caches.keys();\n      return names\n        .filter(function (name) {\n          return name.startsWith(prefix);\n        })\n        .map(function (name) {\n          return name.slice(prefix.length);\n        })\n        .filter(Boolean);\n    } catch (_e) {\n      return [];\n    }\n  }\n\n  /**\n   * Measure one pinned bucket by summing its entries' `Content-Length`\n   * (SNOW-612; moved here from `map_basemap_downloads.js` by SNOW-1138).\n   *\n   * Only ever called for an ORPHANED bucket \u2014 one with no stored record to\n   * read a byte total off \u2014 and only for a name `pinnedBucketAreaIds`\n   * found, so `caches.open` never creates one. It lives in the shared\n   * reader so the Manage downloads sheet and `/offline/`'s Reset\n   * breakdown size an orphan by the one measurement and cannot disagree.\n   * Orphans are rare, so the walk is affordable on either page.\n   *\n   * `Content-Length` rather than the body: `cache.match()` hands back a\n   * Response without reading it, so a header sum is N cheap lookups where\n   * a `blob()` sum would be N decompressions. An entry with no such header\n   * contributes nothing \u2014 and in production a gzipped tile response\n   * carries none, so an orphan of real tiles can read ~0 here. That is\n   * the known limit of this measurement (see SNOW-612's decision doc), not\n   * something either surface papers over.\n   *\n   * @param {string} areaId\n   * @returns {Promise<number>} Bytes, or 0 if the bucket cannot be read.\n   */\n  async function measureBucketBytes(areaId) {\n    var core = self.pwaBasemapDownloadCore;\n    if (!core || typeof caches === 'undefined') return 0;\n    var total = 0;\n    try {\n      var cache = await caches.open(core.PINNED_CACHE_PREFIX + areaId);\n      var requests = await cache.keys();\n      for (var request of requests) {\n        var response = await cache.match(request);\n        var length = response && Number(response.headers.get('Content-Length'));\n        if (Number.isFinite(length) && length > 0) total += length;\n      }\n    } catch (_e) {\n      // A bucket that cannot be read is still worth listing at 0 bytes \u2014\n      // the user can delete it, which is the point.\n    }\n    return total;\n  }\n\n  /**\n   * SNOW-856: the `basemap.baseLayers` record. Best-effort \u2014 a failed\n   * read is \"no base layer recorded\", which makes the next download\n   * re-warm one it may already hold. That costs a `cache.keys()` walk and\n   * no bytes (`resolveBaseLayerPlan` fetches only what is genuinely\n   * missing), which is the right way round for a read that must never\n   * throw on the boot path.\n   *\n   * @returns {Promise<Array<Object>>}\n   */\n  async function readBaseLayers() {\n    if (!window.pwaDb) return [];\n    try {\n      var row = await window.pwaDb.get('meta:app', BASE_LAYERS_KEY);\n      return Array.isArray(row && row.value) ? row.value : [];\n    } catch (_e) {\n      return [];\n    }\n  }\n\n  /**\n   * SNOW-1417: the SAC tours box urls a record's last sync saved.\n   *\n   * @param {any} record\n   * @returns {string[]}\n   */\n  function tourBoxesOf(record) {\n    var boxes = record && record.items && record.items.tourBoxes;\n    return Array.isArray(boxes) ? boxes.map(String) : [];\n  }\n\n  /**\n   * SNOW-635: read `basemap.customAreas`, migrating the legacy single-row\n   * `basemap.customArea` into it on first read if the new key is absent.\n   *\n   * Lazy rather than a one-off migration command, because this runs inside\n   * `downloadedAreas()` \u2014 the boot-path probe the roundel calls on every\n   * page load (post-SNOW-634) \u2014 so every existing device reaches it\n   * without a separate step. Best-effort throughout, and this MUST degrade\n   * to \"read the legacy row as a one-entry list\" rather than throw: a\n   * device that cannot write here would otherwise take both the roundel\n   * and the manage sheet down with it, since both sit on this same\n   * boot-path read.\n   *\n   * The legacy area keeps id `CUSTOM_AREA_ID` ('custom') and ordinal `1` \u2014\n   * its existing `snowdesk-basemap-pinned-custom` Cache Storage bucket has\n   * no rename, so the id has to survive unchanged for that bucket to keep\n   * resolving (docs/decisions/per-area-pinned-basemap-caches.md).\n   *\n   * @returns {Promise<Array<Object>>} `[]` when nothing is stored and\n   *   there is no legacy row to migrate.\n   */\n  async function readCustomAreas() {\n    if (!window.pwaDb) return [];\n    var row;\n    try {\n      row = await window.pwaDb.get('meta:app', CUSTOM_AREAS_KEY);\n    } catch (_e) {\n      row = undefined;\n    }\n    // An empty array is a legitimate \"already migrated, nothing left\" \u2014\n    // return it as-is rather than falling through to the legacy read, or a\n    // device that deleted its last custom area would have it re-created\n    // from a legacy row that (by then) no longer exists anyway.\n    if (Array.isArray(row && row.value)) return row.value;\n\n    var legacyRow;\n    try {\n      legacyRow = await window.pwaDb.get('meta:app', LEGACY_CUSTOM_AREA_KEY);\n    } catch (_e) {\n      legacyRow = undefined;\n    }\n    var legacy = legacyRow && legacyRow.value;\n    if (!legacy || !Array.isArray(legacy.bbox)) return [];\n\n    var core = self.pwaBasemapDownloadCore;\n    var migrated = [\n      Object.assign({}, legacy, { id: core ? core.CUSTOM_AREA_ID : 'custom', ordinal: 1 }),\n    ];\n    try {\n      await window.pwaDb.put('meta:app', { key: CUSTOM_AREAS_KEY, value: migrated });\n      await window.pwaDb.delete('meta:app', LEGACY_CUSTOM_AREA_KEY);\n    } catch (_e) {\n      // Best-effort \u2014 see docstring above. The legacy row is untouched, so\n      // the next read tries the migration again; this call still returns\n      // the migrated shape for ITS OWN caller even though the write didn't\n      // land.\n    }\n    return migrated;\n  }\n\n  // SNOW-586: every area currently recorded as downloaded, normalised into\n  // planEviction's `[{id, name, bytes, savedAt}]` shape \u2014 the union of\n  // `basemap.regions` (mapDownloadControlInit's record, one entry per\n  // downloaded region) and (SNOW-635) `basemap.customAreas`\n  // (mapCustomDownloadControlInit's record, now an array \u2014 see\n  // `readCustomAreas`). `name` is always populated for a non-orphaned area\n  // \u2014 stored for a region, stored-or-defaulted-from-ordinal for a custom\n  // area (see the inline comment below) \u2014 so every downstream reader can\n  // treat it uniformly; only `reconcileAreas`' orphan entries (no record at\n  // all) ever leave it unset. Best-effort: a failed read contributes\n  // nothing rather than throwing \u2014 eviction planning degrades to \"nothing\n  // recorded, so nothing to evict\", never to blocking a download outright\n  // over a transient IndexedDB error.\n  //\n  // @param {{strings?: Object<string, string>,\n  //   measureBytes?: function(string): Promise<number>,\n  //   deviceOnly?: boolean}} [options]\n  //   SNOW-1453: `deviceOnly` leaves out the areas on the ACCOUNT, which\n  //   cost a request whenever the app is online. The 3D view reads this\n  //   list at every boot, connectivity change and downloads change, and\n  //   needs only what this device holds.\n  //   `strings` carries the two translated names this reader fills in\n  //   (see `FALLBACK_STRINGS`). `measureBytes` measures an ORPHANED\n  //   bucket \u2014 one with no record to read a byte total off. Both callers\n  //   pass `measureBucketBytes` above (the map page behind its own memo,\n  //   `measurePinnedBucketBytes`), so an orphan is the same size on the\n  //   Manage downloads sheet and on `/offline/` (SNOW-1138). Absent, an\n  //   orphan reads 0 bytes.\n  //\n  // @returns {Promise<Array<{id: string, name?: string, bytes: number,\n  //   savedAt: string, basemapKey: string|null}>>} `basemapKey` (SNOW-645)\n  //   is the basemap the area was fetched under, null for a record written\n  //   before that ticket or for a reconciled orphan \u2014 \"downloaded, basemap\n  //   unknown\". SNOW-722: named here because it is load-bearing outside the\n  //   eviction path now (map_layer_sync_status.js decides each basemap\n  //   row's dot on it), and the abbreviated shape above read as though it\n  //   were dropped.\n  async function downloadedAreas(options) {\n    var opts = options || {};\n    var strings = opts.strings || {};\n    var core = self.pwaBasemapDownloadCore;\n    var areas = [];\n    if (!core || !window.pwaDb) return areas;\n    try {\n      var row = await window.pwaDb.get('meta:app', 'basemap.regions');\n      var regions = Array.isArray(row && row.value) ? row.value : [];\n      for (var entry of regions) {\n        if (!entry || !entry.region_id) continue;\n        areas.push({\n          id: core.areaIdForRegion(entry.region_id),\n          name: entry.name || entry.region_id,\n          bytes: Number(entry.bytes) || 0,\n          savedAt: entry.savedAt,\n          // SNOW-645: absent on a record written before this ticket shipped\n          // \u2014 reads as \"downloaded, basemap unknown\" rather than a wrong one.\n          basemapKey: entry.basemapKey || null,\n          // SNOW-749: the region id, carried so `reconcileAreas` can compare\n          // and `downloads_sync.js` can describe this area to the account\n          // without re-parsing it back out of the bucket id \u2014 that format\n          // belongs to `areaIdForRegion` and is deliberately never\n          // reverse-engineered elsewhere.\n          regionId: entry.region_id,\n          // SNOW-844: the render dependencies the run recorded, so the\n          // Manage downloads sheet can check a row whose basemap is not the\n          // one on screen. Absent on every record written before that ticket\n          // \u2014 normalised to `[]` here, which the sheet reads as UNKNOWN\n          // rather than as \"nothing needed\".\n          deps: Array.isArray(entry.deps) ? entry.deps : [],\n          // SNOW-1478: every map the area holds, primary first, when its\n          // download wrote the list (`recordBasemaps` reads either shape).\n          ...(Array.isArray(entry.basemaps) ? { basemaps: entry.basemaps } : {}),\n          // SNOW-692: the run's own tile row spans, carried so the\n          // overlay tiles this area should hold \u2014 the terrain-class tiles\n          // since SNOW-1072, as SNOW-692's swisstopo slope tiles were \u2014\n          // can be DERIVED by the probe rather than recorded on it, all of\n          // it recomputable from this. Null on a record written before\n          // SNOW-583, which carried `bbox` and no `z` \u2014 the same absence\n          // the roundel's own tile probe already reads as \"no record\".\n          z: entry.z || null,\n          band: Array.isArray(entry.band) ? entry.band : null,\n          // SNOW-932: whether the run that fetched this area fell short of\n          // its CONTENT \u2014 the bulletins and weather inside its boundary.\n          // Carried to the Manage downloads sheet, which is where a custom\n          // area's only remedy lives (it has no roundel of its own once\n          // the framing overlay closes). Coerced here, so absence \u2014 every\n          // record written before the field existed \u2014 reads as fine rather\n          // than as unknown.\n          contentIncomplete: !!entry.contentIncomplete,\n          // SNOW-1139: when the run last fetched this area's content \u2014 the\n          // Manage downloads sheet dates a row whose bulletins are from an\n          // earlier day. '' on a record that never fetched any.\n          contentAt: entry.contentAt || '',\n          // SNOW-1072: whether this area includes terrain data. The class\n          // tiles it implies are derived from `z`/`bbox` above, never\n          // recorded; the flag is the choice, which nothing can derive.\n          terrain: !!entry.terrain,\n          // SNOW-1453: the template the area's elevation tiles were fetched\n          // under, '' when it holds none. The 3D view draws offline only\n          // inside an area stamped with today's (`elevationAreaBoxes`).\n          elevation: typeof entry.elevation === 'string' ? entry.elevation : '',\n          // SNOW-1142: the account the download was made under \u2014 '' for an\n          // anonymous one, null for a record written before the field\n          // existed. `downloads_sync.js`'s `ownership()` decides from this\n          // whether the signed-in account may record the area.\n          principal: principalOf(entry),\n          // SNOW-1417: the SAC tours boxes its last sync saved, which the\n          // tours layer reads offline. [] on a record that saved none.\n          tourBoxes: tourBoxesOf(entry),\n        });\n      }\n    } catch (_e) {\n      // Best-effort \u2014 see docstring.\n    }\n    try {\n      var customAreas = await readCustomAreas();\n      for (var custom of customAreas) {\n        if (!custom || !custom.id || !Array.isArray(custom.bbox)) continue;\n        areas.push({\n          id: custom.id,\n          // SNOW-635 (review): `name` is set by a rename\n          // (map_downloads_manager.js's Rename control) when present; an\n          // unrenamed area's default display name (\"Custom area N\") is\n          // filled in HERE, from `ordinal`, in memory only \u2014 never\n          // persisted, so it stays translatable rather than freezing in\n          // whatever language was active at download time. Filling it at\n          // THIS single normalising layer, rather than at every\n          // downstream reader, is what let the eviction confirm banner's\n          // fallback regress to a raw id: the banner (and the sheet, and\n          // the rename prompt's pre-fill) can all just read `area.name`\n          // uniformly now, with nothing left to distinguish \"stored\" from\n          // \"defaulted\".\n          name:\n            custom.name ||\n            (Number.isFinite(custom.ordinal)\n              ? self.pwaStrings.interpolate(stringFor(strings, 'default-custom-name'), {\n                  n: custom.ordinal,\n                })\n              : custom.id),\n          // SNOW-1133: the stored name alone, '' when the user never\n          // gave one. `name` above is for display; this is what the\n          // account sync posts, so the localised default never reaches it.\n          storedName: custom.name || '',\n          bytes: Number(custom.bytes) || 0,\n          savedAt: custom.savedAt,\n          // SNOW-645: see the region branch above for the \"unknown\" fallback.\n          basemapKey: custom.basemapKey || null,\n          // SNOW-867: which KIND of user-made area this is \u2014 a framed box\n          // ('custom') or a circle dropped on the user's own position\n          // ('dropzone'). The sheet names it in words on every row, and a\n          // record written before the field existed is what it was: a\n          // framed box.\n          type: custom.type === 'dropzone' ? 'dropzone' : 'custom',\n          // SNOW-749: a custom area IS its box \u2014 it is the only thing that\n          // lets another device (or this one after an eviction) fetch the\n          // same ground again, so it travels with the area.\n          bbox: custom.bbox,\n          // SNOW-844: see the region branch above.\n          deps: Array.isArray(custom.deps) ? custom.deps : [],\n          // SNOW-1478: every map the area holds, primary first, when its\n          // download wrote the list (`recordBasemaps` reads either shape).\n          ...(Array.isArray(custom.basemaps) ? { basemaps: custom.basemaps } : {}),\n          // SNOW-692: see the region branch above. A custom area has no\n          // `z` \u2014 its tiles were never server-computed \u2014 so the band it\n          // was fetched over travels beside `bbox`, and the probe rebuilds\n          // the blob from the pair through `buildBlob`, the same\n          // client-side twin that produced the tile set in the first place.\n          band: Array.isArray(custom.band) ? custom.band : null,\n          // SNOW-932: see the region branch above.\n          contentIncomplete: !!custom.contentIncomplete,\n          // SNOW-1139: see the region branch above.\n          contentAt: custom.contentAt || '',\n          // SNOW-1072: see the region branch above.\n          terrain: !!custom.terrain,\n          // SNOW-1453: see the region branch above.\n          elevation: typeof custom.elevation === 'string' ? custom.elevation : '',\n          // SNOW-1142: see the region branch above.\n          principal: principalOf(custom),\n          // SNOW-1417: see the region branch above.\n          tourBoxes: tourBoxesOf(custom),\n        });\n      }\n    } catch (_e) {\n      // Best-effort \u2014 see docstring.\n    }\n\n    // SNOW-856: and the shared base layers. They belong in this list for\n    // exactly one reason \u2014 they are real bytes on the device, and a total\n    // that counts what it does not list is worse than one that lists\n    // everything. Every consumer for which a base layer is NOT an area\n    // excludes it explicitly via `core.isBaseLayerAreaId`: `planEviction`\n    // (never a candidate), `manageRows` (SNOW-867 \u2014 not a row on the\n    // downloads panel and not in its budget either) and\n    // `map_layer_sync_status.js` (a basemap with only a base layer has no\n    // ground downloaded, so its dot must not go green) and\n    // `downloads_sync.js`'s `adopt` (SNOW-860 \u2014 a base layer is not one of\n    // the user's downloads, and `area_sync`'s `_AREA_ID_RE` rejects the\n    // `base-` prefix outright). That last one was MISSED when this list\n    // widened, and the cost is the shape to expect if another consumer is\n    // ever forgotten: the push 400d, the mutation queue classified it\n    // permanent, and every signed-in user with a download carried a dead\n    // queue row and a red sync badge. Adding an entry to this list means\n    // auditing every reader of it.\n    //\n    // SNOW-860's settings-page breakdown is the surface that DOES list it,\n    // which is the place the app's own storage is stated and cleared.\n    //\n    // SNOW-863: driven by the BUCKETS on disk, joined to the records for\n    // their sizes \u2014 not by the records alone, which is what shipped and was\n    // wrong. A base layer's record is written by the page once the service\n    // worker's warm resolves, and that warm is the tail of a download the\n    // roundel has already reported as finished; a reader who closes the tab\n    // in between (or reloads, or whose device sleeps) is left with a\n    // complete bucket and no record. Reported on staging as a row reading\n    // \"base-swisstopo_winter\" under \"Unknown basemap\", with a delete button\n    // \u2014 the reconciliation below had picked the bucket up as an orphan,\n    // because nothing in the record-driven pass could name it.\n    //\n    // The bucket names its own basemap now (`baseLayerBasemapKey`), so a\n    // missing record costs only the SIZE, which reads 0 until the next\n    // download's top-up writes one. An unsized row is a small lie; an\n    // unnamed deletable one was a trap.\n    try {\n      var byKey = new Map();\n      for (var layer of await readBaseLayers()) {\n        if (layer && layer.basemapKey) byKey.set(layer.basemapKey, layer);\n      }\n      for (var baseId of await pinnedBucketAreaIds()) {\n        if (!core.isBaseLayerAreaId(baseId)) continue;\n        var basemapKey = core.baseLayerBasemapKey(baseId);\n        if (!basemapKey) continue;\n        var record = byKey.get(basemapKey);\n        areas.push({\n          id: baseId,\n          name: stringFor(strings, 'base-layer-name'),\n          bytes: Number(record && record.bytes) || 0,\n          savedAt: (record && record.savedAt) || '',\n          basemapKey: basemapKey,\n          bbox: record && record.bbox,\n          // SNOW-929: the documents this base layer needs to DRAW \u2014 the\n          // style, each source's TileJSON, the sprite pair and the glyph\n          // ranges, fetched into this very bucket beside the band. This\n          // used to read `deps: []` under a comment asserting \"the tiles\n          // ARE the layer\", which was the bug: the tiles are not the\n          // layer, they are unreadable without those four, and they sat\n          // in an evictable passive cache instead.\n          //\n          // An empty list here now means a record written BEFORE\n          // SNOW-929, not a layer that needs nothing. The next warm of\n          // this basemap writes one; `areaState` (offline_audit_core.js)\n          // is the reader that has to keep telling those two apart.\n          deps: Array.isArray(record && record.deps) ? record.deps : [],\n        });\n      }\n    } catch (_e) {\n      // Best-effort \u2014 see docstring.\n    }\n\n    // SNOW-612: union in the pinned buckets actually on disk. A record is\n    // only written when a run COMPLETES, so a download that failed partway\n    // left a bucket the budget never counted and the manage sheet could not\n    // delete \u2014 quota that accumulated silently across failed attempts.\n    // Without the manage core there is no reconciliation to run, so this\n    // degrades to the records alone rather than to nothing.\n    var manage = self.pwaBasemapManageCore;\n    if (!manage || typeof manage.reconcileAreas !== 'function') return areas;\n    var storedIds = await pinnedBucketAreaIds();\n    var recordedIds = new Set(\n      areas.map(function (area) {\n        return area.id;\n      }),\n    );\n    var orphanIds = storedIds.filter(function (id) {\n      return !recordedIds.has(id);\n    });\n    // SNOW-812: the two halves of \"is this area downloaded\" side by side \u2014\n    // the records the page keeps in meta:app, and the pinned buckets\n    // actually on disk. `missing` is the one that matters for a blank map:\n    // an area the UI reports as downloaded with no bucket behind it. It is\n    // the same comparison sw.js's `pinned.buckets` line records from the\n    // other side, so the two can be read against each other.\n    window.pwaDebugLog?.record('cache', 'areas.reconcile', {\n      recorded: [...recordedIds],\n      onDisk: storedIds,\n      orphans: orphanIds,\n      missing: [...recordedIds].filter(function (id) {\n        return !storedIds.includes(id);\n      }),\n    });\n    // Measured one bucket at a time rather than in parallel: an orphan is\n    // rare, and a concurrent walk of several thousand cache entries each is\n    // the kind of burst that makes a slow device feel broken.\n    var bytesById = {};\n    for (var orphanId of orphanIds) {\n      bytesById[orphanId] =\n        typeof opts.measureBytes === 'function' ? await opts.measureBytes(orphanId) : 0;\n    }\n    // SNOW-749: and union in the areas on the ACCOUNT, in this same one\n    // normalising layer \u2014 exactly where SNOW-612's orphans already join,\n    // and for the same reason: a second reader somewhere else would be free\n    // to disagree with this one about what exists.\n    //\n    // `accountAreas()` resolves `[]` for an anonymous visitor, a flag-off\n    // page, an offline device and any failure alike, so this never waits on\n    // a network it cannot reach and never turns a read of local storage\n    // into a rejection. With `[]` the reconciliation output is what it was\n    // before this ticket, which is the path every existing caller takes.\n    var accountAreas =\n      window.pwaDownloadsSync && !opts.deviceOnly\n        ? await window.pwaDownloadsSync.accountAreas()\n        : [];\n    return manage.reconcileAreas(areas, storedIds, bytesById, accountAreas);\n  }\n\n  /**\n   * SNOW-1583: the parts a record stands on before a run is laid over it.\n   * A record written before `parts` existed was only ever written for a\n   * download whose map landed whole, so it stands on a whole map \u2014 unless\n   * what it does say (`recordOutcome`) is that the map is short.\n   *\n   * @param {Object} record\n   * @returns {Object<string, {ok: number, failed: number}>}\n   */\n  function partsOf(record) {\n    if (record && record.parts && typeof record.parts === 'object') return record.parts;\n    var core = self.pwaBasemapDownloadCore;\n    var legacy = core && typeof core.recordOutcome === 'function' ? core.recordOutcome(record) : null;\n    return { map: legacy === 'unusable' ? { ok: 0, failed: 1 } : { ok: 1, failed: 0 } };\n  }\n\n  /**\n   * SNOW-1583: a record with one run's outcome on it \u2014 the record a first\n   * download writes, however it ended. `outcome` is the run's\n   * (`areaOutcome`), `parts` its counts, and `retryable` whether a retry\n   * can mend what failed, which is what a background sync selects on.\n   * A first download that failed writes one too (`outcome: 'unusable'`),\n   * in place of the orphaned pinned bucket it used to leave.\n   *\n   * @param {Object} record The record the caller built.\n   * @param {{parts?: Object, retryable?: boolean, gone?: string[]}|null|undefined} run\n   * @returns {Object}\n   */\n  function withRun(record, run) {\n    var core = self.pwaBasemapDownloadCore;\n    var parts = (run && run.parts) || {};\n    var outcome = core ? core.areaOutcome(parts) : 'unusable';\n    var out = Object.assign({}, record, {\n      outcome: outcome,\n      parts: parts,\n      retryable: outcome !== 'complete' && !!(run && run.retryable),\n    });\n    delete out.lastRun;\n    var gone = goneOf(run);\n    if (gone.length > 0) out.gone = gone;\n    else delete out.gone;\n    return out;\n  }\n\n  /** SNOW-1583 review: how many urls a record keeps in `gone`. */\n  var GONE_CAP = 200;\n\n  /**\n   * SNOW-1583 review: the urls a run says failed for good (403, 404,\n   * 410), which a background sync leaves alone. Strings only, capped.\n   *\n   * @param {any} run A run, or a record.\n   * @returns {string[]}\n   */\n  function goneOf(run) {\n    return absoluteUrls(run && run.gone).slice(0, GONE_CAP);\n  }\n\n  /**\n   * SNOW-1583 review: urls made absolute against the page, once each, so\n   * a worker's failure and a plan's url compare alike.\n   *\n   * @param {any} list\n   * @returns {string[]}\n   */\n  function absoluteUrls(list) {\n    var out = [];\n    (Array.isArray(list) ? list : []).forEach(function (url) {\n      if (typeof url !== 'string' || !url) return;\n      var href = url;\n      try {\n        href = new URL(url, self.location.origin).href;\n      } catch (_e) {\n        // Kept as given.\n      }\n      if (out.indexOf(href) === -1) out.push(href);\n    });\n    return out;\n  }\n\n  /**\n   * SNOW-1583: one run laid over a record already on the device \u2014 a sync,\n   * or a re-download that did not land whole.\n   *\n   * The record's geometry, basemap and every part this run did not fetch\n   * survive. Each part the run fetched takes its `failed` from the run and\n   * adds its `ok` (`mergeParts`), and `outcome` is recomputed. `retryable`\n   * is the run's, or the record's where a part the run did not fetch still\n   * has failures.\n   *\n   * A failed REPLACEMENT \u2014 a re-download under a different basemap\n   * (`replaced`) \u2014 keeps the old record whole, and `lastRun` holds the\n   * failed run's outcome and parts: the copy the user had still draws.\n   *\n   * @param {Object} prior The stored record.\n   * @param {{parts?: Object, retryable?: boolean, gone?: string[], goneReplaces?: boolean,\n   *   tried?: string[]}} run\n   * @param {{replaced?: boolean, at?: string}} [options]\n   * @returns {Object}\n   */\n  function mergeRun(prior, run, options) {\n    var opts = options || {};\n    var core = self.pwaBasemapDownloadCore;\n    var runParts = (run && run.parts) || {};\n    if (!core) return prior;\n    if (opts.replaced) {\n      return Object.assign({}, prior, {\n        lastRun: {\n          outcome: core.areaOutcome(runParts),\n          parts: runParts,\n          at: opts.at || new Date().toISOString(),\n        },\n      });\n    }\n    var before = partsOf(prior);\n    var parts = core.mergeParts(before, runParts);\n    var outcome = core.areaOutcome(parts);\n    var untouchedFailed = Object.keys(before).some(function (key) {\n      return !(key in runParts) && Number(before[key] && before[key].failed) > 0;\n    });\n    var out = Object.assign({}, prior, {\n      outcome: outcome,\n      parts: parts,\n      retryable:\n        outcome !== 'complete' && (!!(run && run.retryable) || (!!prior.retryable && untouchedFailed)),\n    });\n    delete out.lastRun;\n    // SNOW-1583 review: what failed for good. A download says it afresh\n    // (`goneReplaces`); a sync or refresh keeps the record's list but for\n    // the urls it tried again (`tried`), and adds its own. A background\n    // sync never tries them, so they stay.\n    var tried = absoluteUrls(run && run.tried);\n    var kept =\n      run && run.goneReplaces\n        ? []\n        : goneOf(prior).filter(function (url) {\n            return tried.indexOf(url) === -1;\n          });\n    var gone = goneOf({ gone: kept.concat(goneOf(run)) });\n    if (gone.length > 0) out.gone = gone;\n    else delete out.gone;\n    return out;\n  }\n\n  window.pwaBasemapAreas = Object.freeze({\n    // SNOW-1583: a record's outcome, parts and retry flag, and the merge.\n    withRun: withRun,\n    mergeRun: mergeRun,\n    CUSTOM_AREAS_KEY: CUSTOM_AREAS_KEY,\n    LEGACY_CUSTOM_AREA_KEY: LEGACY_CUSTOM_AREA_KEY,\n    BASE_LAYERS_KEY: BASE_LAYERS_KEY,\n    downloadedAreas: downloadedAreas,\n    measureBucketBytes: measureBucketBytes,\n    pinnedBucketAreaIds: pinnedBucketAreaIds,\n    readBaseLayers: readBaseLayers,\n    readCustomAreas: read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K,EAChCc,EAAkB,OAAO,KAAKD,CAAM,EAAE,KAAK,SAAU7D,EAAK,CAC5D,MAAO,EAAEA,KAAO4D,IAAa,OAAOC,EAAO7D,CAAG,GAAK6D,EAAO7D,CAAG,EAAE,MAAM,EAAI,CAC3E,CAAC,EACGkD,EAAM,OAAO,OAAO,CAAC,EAAGS,EAAO,CACjC,QAASV,EACT,MAAOD,EACP,UACEC,IAAY,aAAe,CAAC,EAAEF,GAAOA,EAAI,YAAe,CAAC,CAACY,EAAM,WAAaG,EACjF,CAAC,EACD,OAAOZ,EAAI,QAKX,IAAIa,EAAQT,EAAaP,GAAOA,EAAI,KAAK,EACrCiB,EACFjB,GAAOA,EAAI,aACP,CAAC,EACDK,EAAOO,CAAK,EAAE,OAAO,SAAUH,EAAK,CAClC,OAAOO,EAAM,QAAQP,CAAG,IAAM,EAChC,CAAC,EACHL,EAAOC,EAAO,CAAE,KAAMY,EAAK,OAAOZ,EAAOL,CAAG,CAAC,CAAE,CAAC,EACpD,OAAII,EAAK,OAAS,EAAGD,EAAI,KAAOC,EAC3B,OAAOD,EAAI,KACTA,CACT,CAEA,OAAO,gBAAkB,OAAO,OAAO,CAErC,QAASJ,EACT,SAAUY,EACV,iBAAkBhE,EAClB,uBAAwBC,EACxB,gBAAiBC,EACjB,gBAAiB4B,EACjB,mBAAoBhB,EACpB,oBAAqBL,EACrB,eAAgBa,EAChB,gBAAiBI,CACnB,CAAC,CACH,GAAG",
  "names": ["CUSTOM_AREAS_KEY", "LEGACY_CUSTOM_AREA_KEY", "BASE_LAYERS_KEY", "FALLBACK_STRINGS", "stringFor", "strings", "key", "principalOf", "record", "pinnedBucketAreaIds", "core", "prefix", "names", "name", "measureBucketBytes", "areaId", "total", "cache", "requests", "request", "response", "length", "readBaseLayers", "row", "tourBoxesOf", "boxes", "readCustomAreas", "legacyRow", "legacy", "migrated", "downloadedAreas", "options", "opts", "areas", "regions", "entry", "customAreas", "custom", "byKey", "layer", "baseId", "basemapKey", "manage", "storedIds", "recordedIds", "area", "orphanIds", "id", "bytesById", "orphanId", "accountAreas", "partsOf", "withRun", "run", "parts", "outcome", "out", "gone", "goneOf", "GONE_CAP", "absoluteUrls", "list", "url", "href", "mergeRun", "prior", "runParts", "before", "untouchedFailed", "tried", "kept"]
}
