import { n as n2, o, r as r3 } from "./chunk-22J3OQXH.js"; import { a, s as s3 } from "./chunk-RZPC4VQ3.js"; import "./chunk-W4JJD2VH.js"; import "./chunk-6G6XHVK2.js"; import "./chunk-TWB5CT7V.js"; import "./chunk-H3QCF24A.js"; import { i } from "./chunk-EAUVYZHD.js"; import { f, u } from "./chunk-MNZXIBJ7.js"; import "./chunk-YJKEIUMW.js"; import "./chunk-JH3PLIM6.js"; import "./chunk-FCDUTNBY.js"; import "./chunk-LL6JU3GU.js"; import "./chunk-ZIWBDWEW.js"; import "./chunk-IQNZZCQJ.js"; import "./chunk-Q4LKAPDF.js"; import "./chunk-TODU7HVH.js"; import "./chunk-23ONSYIH.js"; import "./chunk-3T4BXU2T.js"; import "./chunk-YLVXZ2PS.js"; import "./chunk-EE6TL7XD.js"; import "./chunk-GDB2KX4Y.js"; import "./chunk-546QCRS4.js"; import "./chunk-QXZVBSBH.js"; import "./chunk-773XI6MQ.js"; import "./chunk-WFSV2B2I.js"; import "./chunk-J525NRN3.js"; import "./chunk-MI7HWWFL.js"; import "./chunk-ZHRMTKME.js"; import { r as r2 } from "./chunk-PCGDLSZ4.js"; import { p } from "./chunk-CAYFEZCR.js"; import "./chunk-MFFE4I2S.js"; import "./chunk-LMCIAW5S.js"; import { h } from "./chunk-OTS3UE5B.js"; import "./chunk-6RAL4JPQ.js"; import "./chunk-LGW7TID4.js"; import "./chunk-3OHML7FO.js"; import "./chunk-G5AI6ZNE.js"; import { e as e2 } from "./chunk-FIYKFRB2.js"; import "./chunk-FYNVVMWY.js"; import "./chunk-Q52DVFYK.js"; import "./chunk-HBMVUVZX.js"; import "./chunk-CRGVDJI6.js"; import "./chunk-6P6NA7JB.js"; import "./chunk-XLV7RUSE.js"; import "./chunk-NTUXR253.js"; import "./chunk-RMX2AZ4P.js"; import "./chunk-NE3ESGA6.js"; import { l } from "./chunk-YIS6BAC3.js"; import "./chunk-7XXXCK2A.js"; import "./chunk-WJW5DUN6.js"; import "./chunk-PJ7ZQ4VD.js"; import "./chunk-WDLTDV2L.js"; import "./chunk-TERAW6FT.js"; import "./chunk-N2663GRX.js"; import "./chunk-O4FY3ITT.js"; import "./chunk-WEMIK25H.js"; import "./chunk-7N4X6GF3.js"; import "./chunk-JXW4QTJA.js"; import "./chunk-UXF37FQ4.js"; import "./chunk-ZOEK6QHJ.js"; import "./chunk-XNLG7T2T.js"; import "./chunk-IR4PV7VK.js"; import "./chunk-2Z6LERTI.js"; import "./chunk-OWVBLVP3.js"; import "./chunk-AFZ7XSEW.js"; import "./chunk-YBSUITLL.js"; import "./chunk-ALDCDSPV.js"; import "./chunk-DT6EAZQ5.js"; import "./chunk-HNOZUNJ4.js"; import "./chunk-PDKDCAAD.js"; import "./chunk-ECW2QABR.js"; import "./chunk-GCDJLKH4.js"; import { E as E2 } from "./chunk-MRJEICT6.js"; import { d, e, n2 as n } from "./chunk-Y3WMVFTW.js"; import "./chunk-SAS7RONY.js"; import "./chunk-WSRBH7BF.js"; import "./chunk-IHXECKQQ.js"; import { E, g } from "./chunk-ULGDPLM2.js"; import { s, s3 as s2 } from "./chunk-EMJ4ZSM2.js"; import "./chunk-IKP3YN53.js"; import { r } from "./chunk-GZT4BVFP.js"; import "./chunk-A5ICIBVI.js"; // node_modules/@arcgis/core/views/layers/TileLayerView.js var i2 = (i3) => { let c = class extends i3 { async fetchPopupFeatures(e3, s4) { const { layer: a2 } = this; if (!e3) throw new s2("tilelayerview:fetchPopupFeatures", "Nothing to fetch without area", { layer: a2 }); if (a2.type !== "tile") throw new s2("tilelayerview:fetchPopupFeatures", "Layer type should be 'tile'", { type: a2.type }); const i4 = this.get("view.scale"), c2 = a2.allSublayers.toArray().filter((e4) => { const r4 = e4.minScale === 0 || i4 <= e4.minScale, t = e4.maxScale === 0 || i4 >= e4.maxScale; return e4.popupTemplate && e4.popupEnabled && e4.visible && r4 && t; }); return E(c2.map(async (r4) => { const o2 = r4.createQuery(), a3 = r(s4) ? s4.event : null, i5 = s3({ renderer: r4.renderer, event: a3 }); o2.geometry = this.createFetchPopupFeaturesQueryGeometry(e3, i5), o2.outFields = await r4.popupTemplate.getRequiredFields(); return (await r4.queryFeatures(o2)).features; })).then((e4) => [].concat(...e4.map((e5) => e5.value).filter(Boolean))); } }; return e([d()], c.prototype, "layer", void 0), c = e([n("esri.layers.mixins.TileLayerView")], c), c; }; // node_modules/@arcgis/core/views/2d/layers/TileLayerView2D.js var _ = [0, 0]; var I = class extends i2(i(r3(f(u)))) { constructor() { super(...arguments), this._tileStrategy = null, this._fetchQueue = null, this.layer = null; } get resampling() { return !("resampling" in this.layer) || this.layer.resampling !== false; } update(e3) { this._fetchQueue.pause(), this._fetchQueue.state = e3.state, this._tileStrategy.update(e3), this._fetchQueue.resume(); } attach() { const e3 = "tileServers" in this.layer ? this.layer.tileServers : null; this._tileInfoView = new h(this.layer.tileInfo, this.layer.fullExtent), this._fetchQueue = new p({ tileInfoView: this._tileInfoView, concurrency: e3 && 10 * e3.length || 10, process: (e4, t) => this.fetchTile(e4, t) }), this._tileStrategy = new r2({ cachePolicy: "keep", resampling: this.resampling, acquireTile: (e4) => this.acquireTile(e4), releaseTile: (e4) => this.releaseTile(e4), tileInfoView: this._tileInfoView }), this.requestUpdate(), this.handles.add(l(() => this.resampling, () => { this.doRefresh(); })), super.attach(); } detach() { super.detach(), this._tileStrategy.destroy(), this._fetchQueue.clear(), this.container.removeAllChildren(), this._fetchQueue = this._tileStrategy = this._tileInfoView = null; } moveStart() { this.requestUpdate(); } viewChange() { this.requestUpdate(); } moveEnd() { this.requestUpdate(); } supportsSpatialReference(e3) { return E2(this.layer.tileInfo?.spatialReference, e3); } createFetchPopupFeaturesQueryGeometry(e3, t) { return a(e3, t, this.view); } async doRefresh() { this.updateRequested || this.suspended || (this._fetchQueue.reset(), this._tileStrategy.tiles.forEach((e3) => this._enqueueTileFetch(e3))); } isUpdating() { return this._fetchQueue?.updating ?? false; } acquireTile(e3) { const t = this._bitmapView.createTile(e3), i3 = t.bitmap; return [i3.x, i3.y] = this._tileInfoView.getTileCoords(_, t.key), i3.resolution = this._tileInfoView.getTileResolution(t.key), [i3.width, i3.height] = this._tileInfoView.tileInfo.size, this._enqueueTileFetch(t), this._bitmapView.addChild(t), this.requestUpdate(), t; } releaseTile(e3) { this._fetchQueue.abort(e3.key.id), this._bitmapView.removeChild(e3), e3.once("detach", () => e3.destroy()), this.requestUpdate(); } async fetchTile(e3, t = {}) { const s4 = "tilemapCache" in this.layer ? this.layer.tilemapCache : null, { signal: r4, resamplingLevel: l2 = 0 } = t; if (!s4) try { return await this._fetchImage(e3, r4); } catch (h2) { if (!g(h2) && !this.resampling) return o(this._tileInfoView.tileInfo.size); if (l2 < 3) { const i3 = this._tileInfoView.getTileParentId(e3.id); if (i3) { const s5 = new e2(i3), r5 = await this.fetchTile(s5, { ...t, resamplingLevel: l2 + 1 }); return n2(this._tileInfoView, r5, s5, e3); } } throw h2; } const a2 = new e2(0, 0, 0, 0); let o2; try { if (await s4.fetchAvailabilityUpsample(e3.level, e3.row, e3.col, a2, { signal: r4 }), a2.level !== e3.level && !this.resampling) return o(this._tileInfoView.tileInfo.size); o2 = await this._fetchImage(a2, r4); } catch (h2) { if (g(h2)) throw h2; o2 = await this._fetchImage(e3, r4); } return this.resampling ? n2(this._tileInfoView, o2, a2, e3) : o2; } async _enqueueTileFetch(e3) { if (!this._fetchQueue.has(e3.key.id)) { try { const t = await this._fetchQueue.push(e3.key); e3.bitmap.source = t, e3.bitmap.width = this._tileInfoView.tileInfo.size[0], e3.bitmap.height = this._tileInfoView.tileInfo.size[1], e3.once("attach", () => this.requestUpdate()); } catch (s4) { g(s4) || s.getLogger(this.declaredClass).error(s4); } this.requestUpdate(); } } async _fetchImage(e3, t) { return this.layer.fetchTile(e3.level, e3.row, e3.col, { signal: t }); } }; e([d()], I.prototype, "_fetchQueue", void 0), e([d()], I.prototype, "resampling", null), I = e([n("esri.views.2d.layers.TileLayerView2D")], I); var V = I; export { V as default }; //# sourceMappingURL=TileLayerView2D-ORYKMEJR.js.map