{"version":3,"sources":["node_modules/@arcgis/core/layers/support/TileInfoTilemapCache.js"],"sourcesContent":["/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.31/esri/copyright.txt for details.\n*/\nimport l from \"../../core/Error.js\";\nimport { waitTick as t, isAbortError as i } from \"../../core/promiseUtils.js\";\nclass e {\n constructor(l, t = 0, i = l.lods[l.lods.length - 1].level) {\n this.tileInfo = l, this.minLOD = t, this.maxLOD = i, l.lodAt(t) || (this.minLOD = l.lods[0].level), l.lodAt(i) || (this.maxLOD = l.lods[l.lods.length - 1].level);\n }\n get effectiveMinLOD() {\n return this.minLOD ?? this.tileInfo.lods[0].level;\n }\n get effectiveMaxLOD() {\n return this.maxLOD ?? this.tileInfo.lods[this.tileInfo.lods.length - 1].level;\n }\n getAvailability(l, t, i) {\n const e = this.tileInfo?.lodAt(l);\n return !e || l < this.minLOD || l > this.maxLOD ? \"unavailable\" : e.cols && e.rows ? i >= e.cols[0] && i <= e.cols[1] && t >= e.rows[0] && t <= e.rows[1] ? \"unknown\" : \"unavailable\" : \"unknown\";\n }\n async fetchAvailability(i, e, o, s) {\n await t(s);\n const a = this.getAvailability(i, e, o);\n if (\"unavailable\" === a) throw new l(\"tile-map:tile-unavailable\", \"Tile is not available\", {\n level: i,\n row: e,\n col: o\n });\n return a;\n }\n async fetchAvailabilityUpsample(l, e, o, s, a) {\n await t(a), s.level = l, s.row = e, s.col = o;\n const n = this.tileInfo;\n return n.updateTileInfo(s), this.fetchAvailability(l, e, o, a).catch(l => {\n if (i(l)) throw l;\n if (n.upsampleTile(s)) return this.fetchAvailabilityUpsample(s.level, s.row, s.col, s, a);\n throw l;\n });\n }\n}\nexport { e as default };"],"mappings":"+HAMA,IAAMA,EAAN,KAAQ,CACN,YAAYC,EAAGC,EAAI,EAAGC,EAAIF,EAAE,KAAKA,EAAE,KAAK,OAAS,CAAC,EAAE,MAAO,CACzD,KAAK,SAAWA,EAAG,KAAK,OAASC,EAAG,K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