import { o, r as r5 } from "./chunk-6G6XHVK2.js"; import { t as t4 } from "./chunk-JFHGSU33.js"; import { v } from "./chunk-TWB5CT7V.js"; import "./chunk-H3QCF24A.js"; import { f as f3, u as u4 } from "./chunk-MNZXIBJ7.js"; import "./chunk-YJKEIUMW.js"; import "./chunk-JH3PLIM6.js"; import { c as c2, e as e5, t as t3 } from "./chunk-FCDUTNBY.js"; import { ee } from "./chunk-MWIFVNKP.js"; import "./chunk-LL6JU3GU.js"; import { t as t2 } from "./chunk-LSDW2622.js"; import "./chunk-ZIWBDWEW.js"; import "./chunk-IQNZZCQJ.js"; import "./chunk-Q4LKAPDF.js"; import "./chunk-TODU7HVH.js"; import { I as I2 } from "./chunk-23ONSYIH.js"; import { l as l4 } from "./chunk-Y4YDGLMZ.js"; import { I as I3, L } from "./chunk-VGSBB3MM.js"; import { a as a3, i, l as l3, n as n3, r as r3 } from "./chunk-3T4BXU2T.js"; import "./chunk-SRMDO2KR.js"; import "./chunk-PZKZIMMP.js"; import "./chunk-YLVXZ2PS.js"; import "./chunk-EE6TL7XD.js"; import { c, f as f2 } from "./chunk-GDB2KX4Y.js"; import { u as u2 } from "./chunk-546QCRS4.js"; import "./chunk-QXZVBSBH.js"; import "./chunk-773XI6MQ.js"; import "./chunk-WFSV2B2I.js"; import "./chunk-J525NRN3.js"; import { D as D2, F, G, I, O, P, R } from "./chunk-MI7HWWFL.js"; import { e as e6, r as r4 } from "./chunk-ZHRMTKME.js"; import { p } from "./chunk-CAYFEZCR.js"; import "./chunk-MFFE4I2S.js"; import "./chunk-XBH7TGC2.js"; import "./chunk-K3NA3LQS.js"; import "./chunk-LMCIAW5S.js"; import { h as h3 } from "./chunk-OTS3UE5B.js"; import { l as l2 } from "./chunk-6RAL4JPQ.js"; import "./chunk-EZZVK4K6.js"; import "./chunk-TRK7CKWP.js"; import "./chunk-EGVIPYN2.js"; import "./chunk-LGW7TID4.js"; import { u as u3 } from "./chunk-VEAEIBHK.js"; import "./chunk-6SASJ6IM.js"; import "./chunk-3OHML7FO.js"; import "./chunk-G5AI6ZNE.js"; import { a } from "./chunk-PK35UGFJ.js"; import { e as e3 } from "./chunk-FIYKFRB2.js"; import "./chunk-FYNVVMWY.js"; import "./chunk-Q52DVFYK.js"; import "./chunk-HBMVUVZX.js"; import { M, f, h as h2, r as r2 } from "./chunk-CRGVDJI6.js"; import "./chunk-6P6NA7JB.js"; import "./chunk-2SJEIKRW.js"; import "./chunk-PHRSJJ3U.js"; import { e as e4 } from "./chunk-FTI5VP6T.js"; import { g as g2 } from "./chunk-RZFGRBD7.js"; import "./chunk-PUSPZYFZ.js"; import "./chunk-EN7YGJWG.js"; import "./chunk-VBNMTM7L.js"; import "./chunk-3D3QEPRE.js"; import "./chunk-JFNNSBWL.js"; import { a as a2, m as m2 } from "./chunk-LY74KTXV.js"; import "./chunk-522WBHUO.js"; import "./chunk-WNCU6BFU.js"; import "./chunk-PIGRDDRG.js"; import "./chunk-XLV7RUSE.js"; import "./chunk-NTUXR253.js"; import "./chunk-C43UE3Z5.js"; import "./chunk-RMX2AZ4P.js"; import "./chunk-NE3ESGA6.js"; import { h, l } from "./chunk-YIS6BAC3.js"; import "./chunk-7XXXCK2A.js"; import "./chunk-7ZIDBK7B.js"; import "./chunk-65BYCSII.js"; import "./chunk-WZQZRKNH.js"; import "./chunk-LRDX4TO7.js"; import "./chunk-6A4U74YA.js"; import { S } from "./chunk-RBZL6SRZ.js"; import "./chunk-WJW5DUN6.js"; import "./chunk-PJ7ZQ4VD.js"; import "./chunk-WDLTDV2L.js"; import "./chunk-TERAW6FT.js"; import { u } from "./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-4NKD334K.js"; import "./chunk-65K7LC56.js"; import "./chunk-ATPLLI5W.js"; import "./chunk-MXB2XLKV.js"; import "./chunk-XH7RUGVZ.js"; import "./chunk-TBBTRX4O.js"; import "./chunk-YBSUITLL.js"; import "./chunk-ALDCDSPV.js"; import { n as n2 } from "./chunk-DT6EAZQ5.js"; import "./chunk-HNOZUNJ4.js"; import { U } from "./chunk-VNFRAYHO.js"; import "./chunk-R5IG2D6H.js"; import { Bt } from "./chunk-VBRY5KJM.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 { D, E, g } from "./chunk-ULGDPLM2.js"; import { s } from "./chunk-EMJ4ZSM2.js"; import { m } from "./chunk-IKP3YN53.js"; import { e as e2, r, t } from "./chunk-GZT4BVFP.js"; import "./chunk-A5ICIBVI.js"; // node_modules/@arcgis/core/views/2d/engine/vectorTiles/RectangleBinPack.js var e7 = class { constructor(e9, t10) { this._width = 0, this._height = 0, this._free = [], this._width = e9, this._height = t10, this._free.push(new t2(0, 0, e9, t10)); } get width() { return this._width; } get height() { return this._height; } allocate(e9, t10) { if (e9 > this._width || t10 > this._height) return new t2(); let i6 = null, s5 = -1; for (let h7 = 0; h7 < this._free.length; ++h7) { const w = this._free[h7]; e9 <= w.width && t10 <= w.height && (i6 === null || w.y <= i6.y && w.x <= i6.x) && (i6 = w, s5 = h7); } return i6 === null ? new t2() : (this._free.splice(s5, 1), i6.width < i6.height ? (i6.width > e9 && this._free.push(new t2(i6.x + e9, i6.y, i6.width - e9, t10)), i6.height > t10 && this._free.push(new t2(i6.x, i6.y + t10, i6.width, i6.height - t10))) : (i6.width > e9 && this._free.push(new t2(i6.x + e9, i6.y, i6.width - e9, i6.height)), i6.height > t10 && this._free.push(new t2(i6.x, i6.y + t10, e9, i6.height - t10))), new t2(i6.x, i6.y, e9, t10)); } release(h7) { for (let e9 = 0; e9 < this._free.length; ++e9) { const t10 = this._free[e9]; if (t10.y === h7.y && t10.height === h7.height && t10.x + t10.width === h7.x) t10.width += h7.width; else if (t10.x === h7.x && t10.width === h7.width && t10.y + t10.height === h7.y) t10.height += h7.height; else if (h7.y === t10.y && h7.height === t10.height && h7.x + h7.width === t10.x) t10.x = h7.x, t10.width += h7.width; else { if (h7.x !== t10.x || h7.width !== t10.width || h7.y + h7.height !== t10.y) continue; t10.y = h7.y, t10.height += h7.height; } this._free.splice(e9, 1), this.release(h7); } this._free.push(h7); } }; // node_modules/@arcgis/core/views/2d/engine/vectorTiles/GlyphMosaic.js var r6 = class { constructor(e9, i6, s5) { this.width = 0, this.height = 0, this._dirties = [], this._glyphData = [], this._currentPage = 0, this._glyphIndex = {}, this._textures = [], this._rangePromises = new Map(), this.width = e9, this.height = i6, this._glyphSource = s5, this._binPack = new e7(e9 - 4, i6 - 4), this._glyphData.push(new Uint8Array(e9 * i6)), this._dirties.push(true), this._textures.push(void 0); } getGlyphItems(i6, s5) { const h7 = [], r10 = this._glyphSource, n8 = new Set(), a8 = 1 / 256; for (const t10 of s5) { const e9 = Math.floor(t10 * a8); n8.add(e9); } const o6 = []; return n8.forEach((t10) => { if (t10 <= 256) { const e9 = i6 + t10; if (this._rangePromises.has(e9)) o6.push(this._rangePromises.get(e9)); else { const s6 = r10.getRange(i6, t10).then(() => { this._rangePromises.delete(e9); }, () => { this._rangePromises.delete(e9); }); this._rangePromises.set(e9, s6), o6.push(s6); } } }), Promise.all(o6).then(() => { let n9 = this._glyphIndex[i6]; n9 || (n9 = {}, this._glyphIndex[i6] = n9); for (const a9 of s5) { const s6 = n9[a9]; if (s6) { h7[a9] = { sdf: true, rect: s6.rect, metrics: s6.metrics, page: s6.page, code: a9 }; continue; } const o7 = r10.getGlyph(i6, a9); if (!o7 || !o7.metrics) continue; const l9 = o7.metrics; let c7; if (l9.width === 0) c7 = new t2(0, 0, 0, 0); else { const e9 = 3, i7 = l9.width + 2 * e9, s7 = l9.height + 2 * e9; let h8 = i7 % 4 ? 4 - i7 % 4 : 4, r11 = s7 % 4 ? 4 - s7 % 4 : 4; h8 === 1 && (h8 = 5), r11 === 1 && (r11 = 5), c7 = this._binPack.allocate(i7 + h8, s7 + r11), c7.isEmpty && (this._dirties[this._currentPage] || (this._glyphData[this._currentPage] = null), this._currentPage = this._glyphData.length, this._glyphData.push(new Uint8Array(this.width * this.height)), this._dirties.push(true), this._textures.push(void 0), this._binPack = new e7(this.width - 4, this.height - 4), c7 = this._binPack.allocate(i7 + h8, s7 + r11)); const n10 = this._glyphData[this._currentPage], a10 = o7.bitmap; let g3, _4; if (a10) for (let t10 = 0; t10 < s7; t10++) { g3 = i7 * t10, _4 = this.width * (c7.y + t10 + 1) + c7.x; for (let t11 = 0; t11 < i7; t11++) n10[_4 + t11 + 1] = a10[g3 + t11]; } } n9[a9] = { rect: c7, metrics: l9, tileIDs: null, page: this._currentPage }, h7[a9] = { sdf: true, rect: c7, metrics: l9, page: this._currentPage, code: a9 }, this._dirties[this._currentPage] = true; } return h7; }); } removeGlyphs(t10) { for (const e9 in this._glyphIndex) { const i6 = this._glyphIndex[e9]; if (!i6) continue; let s5; for (const e10 in i6) if (s5 = i6[e10], s5.tileIDs.delete(t10), s5.tileIDs.size === 0) { const t11 = this._glyphData[s5.page], h7 = s5.rect; let r10, n8; for (let e11 = 0; e11 < h7.height; e11++) for (r10 = this.width * (h7.y + e11) + h7.x, n8 = 0; n8 < h7.width; n8++) t11[r10 + n8] = 0; delete i6[e10], this._dirties[s5.page] = true; } } } bind(t10, e9, r10, n8 = 0) { this._textures[r10] || (this._textures[r10] = new u2(t10, { pixelFormat: P.ALPHA, dataType: G.UNSIGNED_BYTE, width: this.width, height: this.height }, new Uint8Array(this.width * this.height))); const a8 = this._textures[r10]; a8.setSamplingMode(e9), this._dirties[r10] && a8.setData(this._glyphData[r10]), t10.bindTexture(a8, n8), this._dirties[r10] = false; } dispose() { this._binPack = null; for (const t10 of this._textures) t10 && t10.dispose(); this._textures.length = 0; } }; // node_modules/@arcgis/core/views/2d/engine/vectorTiles/GlyphSource.js var s2 = class { constructor(e9) { if (this._metrics = [], this._bitmaps = [], e9) for (; e9.next(); ) switch (e9.tag()) { case 1: { const t10 = e9.getMessage(); for (; t10.next(); ) switch (t10.tag()) { case 3: { const e10 = t10.getMessage(); let s5, a8, r10, n8, i6, c7, g3; for (; e10.next(); ) switch (e10.tag()) { case 1: s5 = e10.getUInt32(); break; case 2: a8 = e10.getBytes(); break; case 3: r10 = e10.getUInt32(); break; case 4: n8 = e10.getUInt32(); break; case 5: i6 = e10.getSInt32(); break; case 6: c7 = e10.getSInt32(); break; case 7: g3 = e10.getUInt32(); break; default: e10.skip(); } e10.release(), s5 && (this._metrics[s5] = { width: r10, height: n8, left: i6, top: c7, advance: g3 }, this._bitmaps[s5] = a8); break; } default: t10.skip(); } t10.release(); break; } default: e9.skip(); } } getMetrics(e9) { return this._metrics[e9]; } getBitmap(e9) { return this._bitmaps[e9]; } }; var a4 = class { constructor() { this._ranges = []; } getRange(e9) { return this._ranges[e9]; } addRange(e9, t10) { this._ranges[e9] = t10; } }; var r7 = class { constructor(e9) { this._glyphInfo = {}, this._baseURL = e9; } getRange(a8, r10) { const n8 = this._getFontStack(a8); if (n8.getRange(r10)) return Promise.resolve(); const i6 = 256 * r10, c7 = i6 + 255; if (this._baseURL) { const g3 = this._baseURL.replace("{fontstack}", a8).replace("{range}", i6 + "-" + c7); return U(g3, { responseType: "array-buffer" }).then((e9) => { n8.addRange(r10, new s2(new a(new Uint8Array(e9.data), new DataView(e9.data)))); }).catch(() => { n8.addRange(r10, new s2()); }); } return n8.addRange(r10, new s2()), Promise.resolve(); } getGlyph(e9, t10) { const s5 = this._getFontStack(e9); if (!s5) return; const a8 = Math.floor(t10 / 256); if (a8 > 256) return; const r10 = s5.getRange(a8); return r10 ? { metrics: r10.getMetrics(t10), bitmap: r10.getBitmap(t10) } : void 0; } _getFontStack(e9) { let t10 = this._glyphInfo[e9]; return t10 || (t10 = this._glyphInfo[e9] = new a4()), t10; } }; // node_modules/@arcgis/core/views/2d/engine/vectorTiles/SpriteMosaic.js var o2 = "dasharray-"; var _ = class { constructor(t10, e9, s5 = 0) { this._size = [], this._mosaicsData = [], this._textures = [], this._dirties = [], this._maxItemSize = 0, this._currentPage = 0, this._pageWidth = 0, this._pageHeight = 0, this._mosaicRects = {}, this.pixelRatio = 1, (t10 <= 0 || e9 <= 0) && console.error("Sprites mosaic defaultWidth and defaultHeight must be greater than zero!"), this._pageWidth = t10, this._pageHeight = e9, s5 > 0 && (this._maxItemSize = s5), this._binPack = new e7(t10 - 4, e9 - 4); } dispose() { this._binPack = null, this._mosaicRects = {}; for (const t10 of this._textures) t10 && t10.dispose(); this._textures.length = 0; } getWidth(t10) { return t10 >= this._size.length ? -1 : this._size[t10][0]; } getHeight(t10) { return t10 >= this._size.length ? -1 : this._size[t10][1]; } getPageSize(t10) { return t10 >= this._size.length ? null : this._size[t10]; } setSpriteSource(t10) { if (this.dispose(), this.pixelRatio = t10.devicePixelRatio, this._mosaicsData.length === 0) { this._binPack = new e7(this._pageWidth - 4, this._pageHeight - 4); const t11 = Math.floor(this._pageWidth), e9 = Math.floor(this._pageHeight), s5 = new Uint32Array(t11 * e9); this._mosaicsData[0] = s5, this._dirties.push(true), this._size.push([this._pageWidth, this._pageHeight]), this._textures.push(void 0); } this._sprites = t10; } getSpriteItem(t10, i6 = false) { let e9, s5, h7 = this._mosaicRects[t10]; if (h7) return h7; if (!this._sprites || this._sprites.loadStatus !== "loaded") return null; if (t10 && t10.startsWith(o2) ? ([e9, s5] = this._rasterizeDash(t10), i6 = true) : e9 = this._sprites.getSpriteInfo(t10), !e9 || !e9.width || !e9.height || e9.width < 0 || e9.height < 0) return null; const a8 = e9.width, r10 = e9.height, [_4, n8, g3] = this._allocateImage(a8, r10); return _4.width <= 0 ? null : (this._copy(_4, e9, n8, g3, i6, s5), h7 = { rect: _4, width: a8, height: r10, sdf: e9.sdf, simplePattern: false, pixelRatio: e9.pixelRatio, page: n8 }, this._mosaicRects[t10] = h7, h7); } getSpriteItems(t10) { const i6 = {}; for (const e9 of t10) i6[e9.name] = this.getSpriteItem(e9.name, e9.repeat); return i6; } getMosaicItemPosition(t10, i6) { const e9 = this.getSpriteItem(t10, i6), s5 = e9 && e9.rect; if (!s5) return null; s5.width = e9.width, s5.height = e9.height; const h7 = e9.width, a8 = e9.height, r10 = 2; return { tl: [s5.x + r10, s5.y + r10], br: [s5.x + r10 + h7, s5.y + r10 + a8], page: e9.page }; } bind(t10, i6, e9 = 0, o6 = 0) { this._textures[e9] || (this._textures[e9] = new u2(t10, { pixelFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, wrapMode: D2.CLAMP_TO_EDGE, width: this._size[e9][0], height: this._size[e9][1] }, new Uint8Array(this._mosaicsData[e9].buffer))); const _4 = this._textures[e9]; _4.setSamplingMode(i6), this._dirties[e9] && _4.setData(new Uint8Array(this._mosaicsData[e9].buffer)), t10.bindTexture(_4, o6), this._dirties[e9] = false; } static _copyBits(t10, i6, e9, s5, h7, a8, r10, o6, _4, n8, g3) { let p2 = s5 * i6 + e9, c7 = o6 * a8 + r10; if (g3) { c7 -= a8; for (let r11 = -1; r11 <= n8; r11++, p2 = ((r11 + n8) % n8 + s5) * i6 + e9, c7 += a8) for (let i7 = -1; i7 <= _4; i7++) h7[c7 + i7] = t10[p2 + (i7 + _4) % _4]; } else for (let l9 = 0; l9 < n8; l9++) { for (let i7 = 0; i7 < _4; i7++) h7[c7 + i7] = t10[p2 + i7]; p2 += i6, c7 += a8; } } _copy(t10, i6, e9, s5, h7, a8) { if (!this._sprites || this._sprites.loadStatus !== "loaded" || e9 >= this._mosaicsData.length) return; const r10 = new Uint32Array(a8 ? a8.buffer : this._sprites.image.buffer), o6 = this._mosaicsData[e9]; o6 && r10 || console.error("Source or target images are uninitialized!"); const n8 = 2, g3 = a8 ? i6.width : this._sprites.width; _._copyBits(r10, g3, i6.x, i6.y, o6, s5[0], t10.x + n8, t10.y + n8, i6.width, i6.height, h7), this._dirties[e9] = true; } _allocateImage(t10, s5) { t10 += 2, s5 += 2; const h7 = Math.max(t10, s5); if (this._maxItemSize && this._maxItemSize < h7) { const i6 = new t2(0, 0, t10, s5); return this._mosaicsData.push(new Uint32Array(t10 * s5)), this._dirties.push(true), this._size.push([t10, s5]), this._textures.push(void 0), [i6, this._mosaicsData.length - 1, [t10, s5]]; } let a8 = t10 % 4 ? 4 - t10 % 4 : 4, r10 = s5 % 4 ? 4 - s5 % 4 : 4; a8 === 1 && (a8 = 5), r10 === 1 && (r10 = 5); const o6 = this._binPack.allocate(t10 + a8, s5 + r10); return o6.width <= 0 ? (this._dirties[this._currentPage] || (this._mosaicsData[this._currentPage] = null), this._currentPage = this._mosaicsData.length, this._mosaicsData.push(new Uint32Array(this._pageWidth * this._pageHeight)), this._dirties.push(true), this._size.push([this._pageWidth, this._pageHeight]), this._textures.push(void 0), this._binPack = new e7(this._pageWidth - 4, this._pageHeight - 4), this._allocateImage(t10, s5)) : [o6, this._currentPage, [this._pageWidth, this._pageHeight]]; } _rasterizeDash(i6) { const e9 = /\[(.*?)\]/, s5 = i6.match(e9); if (!s5) return null; const h7 = s5[1].split(",").map(Number), a8 = i6.slice(i6.lastIndexOf("-") + 1), [r10, o6, _4] = ee.rasterizeDash(h7, a8); return [{ x: 0, y: 0, width: o6, height: _4, sdf: true, pixelRatio: 1 }, new Uint8Array(r10.buffer)]; } }; // node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/debugging.js function t5(t10, e9, n8, o6, l9, i6) { t10.fillStyle = e9, t10.fillRect(n8, o6, l9, i6); } function e8(t10, e9, n8, o6, l9, i6) { t10.strokeStyle = e9, t10.strokeRect(n8, o6, l9, i6); } function o3(n8, o6) { const l9 = window.COLLISION_XRAY; for (let i6 = 0; i6 < o6.length; ++i6) { const r10 = !o6[i6].unique.show; if (l9 || !r10) for (const s5 of o6[i6].colliders) { if (!s5.enabled) continue; const d2 = !o6[i6].unique.parts[s5.partIndex].show; if (!l9 && d2) continue; const a8 = s5.xScreen, c7 = s5.yScreen, m5 = s5.dxScreen, h7 = s5.dyScreen; n8.globalAlpha = r10 || d2 ? 0.2 : 1, t5(n8, "green", a8 - 1, c7 - 1, 3, 3), e8(n8, "red", a8 + m5, c7 + h7, s5.width, s5.height), t5(n8, "blue", a8 + m5 - 1, c7 + h7 - 1, 3, 3), n8.globalAlpha = 1; } } } function l5(t10, e9, n8) { if (!window.PERFORMANCE_RECORDING_STORAGE) return; const o6 = window.PERFORMANCE_RECORDING_STORAGE; o6.perf = o6.perf || {}; const l9 = o6.perf; l9[t10] = l9[t10] || { start: null, time: 0, min: void 0, max: void 0, samples: [], unit: n8 }, l9[t10].time += e9, l9[t10].samples.push(e9), (l9[t10].min == null || e9 < l9[t10].min) && (l9[t10].min = e9), (l9[t10].max == null || e9 > l9[t10].max) && (l9[t10].max = e9); } // node_modules/@arcgis/core/views/2d/engine/vectorTiles/TileHandler.js var c3 = class { constructor(e9, t10, s5) { this._layer = e9, this._styleRepository = t10, this.devicePixelRatio = s5, this._spriteMosaic = null, this._glyphMosaic = null, this._connection = null; } destroy() { this._connection && (this._connection.close(), this._connection = null), this._styleRepository = null, this._layer = null, this._spriteMosaic && (this._spriteMosaic = null), this._glyphMosaic && (this._glyphMosaic = null); } get spriteMosaic() { return this._spriteSourcePromise.then(() => this._spriteMosaic); } get glyphMosaic() { return this._glyphMosaic; } async start(e9) { this._spriteSourcePromise = this._layer.loadSpriteSource(this.devicePixelRatio, e9), this._spriteSourcePromise.then((e10) => { this._spriteMosaic = new _(1024, 1024, 250), this._spriteMosaic.setSpriteSource(e10); }); const t10 = new r7(this._layer.currentStyleInfo.glyphsUrl ? Bt(this._layer.currentStyleInfo.glyphsUrl, { ...this._layer.customParameters, token: this._layer.apiKey }) : null); this._glyphMosaic = new r6(1024, 1024, t10), this._broadcastPromise = u3("WorkerTileHandler", { client: this, schedule: e9.schedule, signal: e9.signal }).then((t11) => { this._connection = t11, this._connection.broadcast("setStyle", this._layer.currentStyleInfo.style, e9); }); } async updateStyle(e9) { return await this._broadcastPromise, this._broadcastPromise = Promise.all(this._connection.broadcast("updateStyle", e9)), this._broadcastPromise; } setSpriteSource(e9) { const t10 = new _(1024, 1024, 250); return t10.setSpriteSource(e9), this._spriteMosaic = t10, this._spriteSourcePromise = Promise.resolve(e9), t10; } async setStyle(e9, t10) { await this._broadcastPromise, this._styleRepository = e9, this._spriteSourcePromise = this._layer.loadSpriteSource(this.devicePixelRatio, null), this._spriteSourcePromise.then((e10) => { this._spriteMosaic = new _(1024, 1024, 250), this._spriteMosaic.setSpriteSource(e10); }); const r10 = new r7(this._layer.currentStyleInfo.glyphsUrl ? Bt(this._layer.currentStyleInfo.glyphsUrl, { ...this._layer.customParameters, token: this._layer.apiKey }) : null); return this._glyphMosaic = new r6(1024, 1024, r10), this._broadcastPromise = Promise.all(this._connection.broadcast("setStyle", t10)), this._broadcastPromise; } fetchTileData(e9, t10) { return this._getRefKeys(e9, t10).then((e10) => { const s5 = this._layer.sourceNameToSource, r10 = []; for (const t11 in s5) r10.push(t11); return this._getSourcesData(r10, e10, t10); }); } parseTileData(e9, t10) { const s5 = e9 && e9.data; if (!s5) return Promise.resolve(null); const { sourceName2DataAndRefKey: r10, transferList: i6 } = s5; return Object.keys(r10).length === 0 ? Promise.resolve(null) : this._broadcastPromise.then(() => this._connection.invoke("createTileAndParse", { key: e9.key.id, sourceName2DataAndRefKey: r10, styleLayerUIDs: e9.styleLayerUIDs }, { ...t10, transferList: i6 })); } async getSprites(e9) { return await this._spriteSourcePromise, this._spriteMosaic.getSpriteItems(e9); } getGlyphs(e9) { return this._glyphMosaic.getGlyphItems(e9.font, e9.codePoints); } perfReport({ key: e9, milliseconds: t10 }) { l5(e9, t10, "ms"); } async _getTilePayload(t10, s5, r10) { const i6 = e3.pool.acquire(t10.id), o6 = this._layer.sourceNameToSource[s5], { level: l9, row: a8, col: c7 } = i6; e3.pool.release(i6); try { return { protobuff: await o6.requestTile(l9, a8, c7, r10), sourceName: s5 }; } catch (h7) { if (g(h7)) throw h7; return { protobuff: null, sourceName: s5 }; } } _getRefKeys(e9, s5) { const r10 = this._layer.sourceNameToSource, i6 = new Array(); for (const t10 in r10) { const o6 = r10[t10].getRefKey(e9, s5); i6.push(o6); } return E(i6); } _getSourcesData(e9, s5, r10) { const i6 = []; for (let t10 = 0; t10 < s5.length; t10++) if (s5[t10].value == null || e9[t10] == null) i6.push(null); else { const o6 = this._getTilePayload(s5[t10].value, e9[t10], r10); i6.push(o6); } return E(i6).then((e10) => { const t10 = {}, r11 = []; for (let i7 = 0; i7 < e10.length; i7++) if (e10[i7].value && e10[i7].value && e10[i7].value.protobuff && e10[i7].value.protobuff.byteLength > 0) { const o6 = s5[i7].value.id; t10[e10[i7].value.sourceName] = { refKey: o6, protobuff: e10[i7].value.protobuff }, r11.push(e10[i7].value.protobuff); } return { sourceName2DataAndRefKey: t10, transferList: r11 }; }); } }; // node_modules/@arcgis/core/views/2d/engine/vectorTiles/TileManager.js var r8 = 512; var o4 = 1e-6; var n4 = (e9, i6) => e9 + 1 / (1 << 2 * i6); var a5 = class { constructor(i6, t10) { this._tiles = new Map(), this._tileCache = new e4(40, (e9) => e9.dispose()), this._viewSize = [0, 0], this._visibleTiles = new Map(), this.acquireTile = i6.acquireTile, this.releaseTile = i6.releaseTile, this.tileInfoView = i6.tileInfoView, this._container = t10; } destroy() { for (const [e9, i6] of this._tiles) i6.dispose(); this._tiles = null, this._tileCache.clear(), this._tileCache = null; } update(e9) { this._updateCacheSize(e9); const i6 = this.tileInfoView, t10 = i6.getTileCoverage(e9.state, 0, "smallest"), { spans: r10, lodInfo: o6 } = t10, { level: n8 } = o6, a8 = this._tiles, c7 = new Set(), h7 = new Set(); for (const { row: s5, colFrom: _4, colTo: f5 } of r10) for (let e10 = _4; e10 <= f5; e10++) { const i7 = e3.getId(n8, s5, o6.normalizeCol(e10), o6.getWorldForColumn(e10)), t11 = this._getOrAcquireTile(i7); c7.add(i7), t11.processed() ? this._addToContainer(t11) : h7.add(new e3(i7)); } for (const [s5, l9] of a8) l9.isCoverage = c7.has(s5); for (const s5 of h7) this._findPlaceholdersForMissingTiles(s5, c7); let d2 = false; for (const [s5, l9] of a8) l9.neededForCoverage = c7.has(s5), l9.neededForCoverage || l9.isHoldingForFade && i6.intersects(t10, l9.key) && c7.add(s5), l9.isFading && (d2 = true); for (const [s5, l9] of this._tiles) c7.has(s5) || this._releaseTile(s5); return l2.pool.release(t10), !d2; } clear() { this._tiles.clear(), this._tileCache.clear(), this._visibleTiles.clear(); } clearCache() { this._tileCache.clear(); } _findPlaceholdersForMissingTiles(e9, i6) { const t10 = []; for (const [l9, r10] of this._tiles) this._addPlaceholderChild(t10, r10, e9, i6); const s5 = t10.reduce(n4, 0); Math.abs(1 - s5) < o4 || this._addPlaceholderParent(e9.id, i6); } _addPlaceholderChild(e9, i6, t10, s5) { i6.key.level <= t10.level || !i6.hasData() || h4(t10, i6.key) && (this._addToContainer(i6), s5.add(i6.id), e9.push(i6.key.level - t10.level)); } _addPlaceholderParent(e9, i6) { const t10 = this._tiles; let s5 = e9; for (; ; ) { if (s5 = c4(s5), !s5 || i6.has(s5)) return; const e10 = t10.get(s5); if (e10 && e10.hasData()) return this._addToContainer(e10), void i6.add(e10.id); } } _getOrAcquireTile(e9) { let i6 = this._tiles.get(e9); return i6 || (i6 = this._tileCache.pop(e9), i6 || (i6 = this.acquireTile(new e3(e9))), this._tiles.set(e9, i6), i6); } _releaseTile(e9) { const i6 = this._tiles.get(e9); this.releaseTile(i6), this._removeFromContainer(i6), this._tiles.delete(e9), i6.hasData() ? this._tileCache.put(e9, i6, 1) : i6.dispose(); } _addToContainer(e9) { let s5; const l9 = [], r10 = this._container; if (r10.contains(e9)) return; const o6 = this._visibleTiles; for (const [t10, n8] of o6) this._canConnectDirectly(e9, n8) && l9.push(n8), t(s5) && this._canConnectDirectly(n8, e9) && (s5 = n8); if (r(s5)) { for (const i6 of l9) s5.childrenTiles.delete(i6), e9.childrenTiles.add(i6), i6.parentTile = e9; s5.childrenTiles.add(e9), e9.parentTile = s5; } else for (const i6 of l9) e9.childrenTiles.add(i6), i6.parentTile = e9; o6.set(e9.id, e9), r10.addChild(e9); } _removeFromContainer(e9) { if (this._visibleTiles.delete(e9.id), this._container.removeChild(e9), r(e9.parentTile)) { e9.parentTile.childrenTiles.delete(e9); for (const i6 of e9.childrenTiles) r(e9.parentTile) && e9.parentTile.childrenTiles.add(i6); } for (const i6 of e9.childrenTiles) i6.parentTile = e9.parentTile; e9.parentTile = null, e9.childrenTiles.clear(); } _canConnectDirectly(e9, i6) { const t10 = e9.key; let { level: s5, row: l9, col: r10, world: o6 } = i6.key; const n8 = this._visibleTiles; for (; s5 > 0; ) { if (s5--, l9 >>= 1, r10 >>= 1, t10.level === s5 && t10.row === l9 && t10.col === r10 && t10.world === o6) return true; if (n8.has(`${s5}/${l9}/${r10}/${o6}`)) return false; } return false; } _updateCacheSize(e9) { const i6 = e9.state.size; if (i6[0] === this._viewSize[0] && i6[1] === this._viewSize[1]) return; const t10 = Math.ceil(i6[0] / r8) + 1, s5 = Math.ceil(i6[1] / r8) + 1; this._viewSize[0] = i6[0], this._viewSize[1] = i6[1], this._tileCache.maxSize = 5 * t10 * s5; } }; function c4(e9) { const [i6, t10, s5, l9] = e9.split("/"), r10 = parseInt(i6, 10); return r10 === 0 ? null : `${r10 - 1}/${parseInt(t10, 10) >> 1}/${parseInt(s5, 10) >> 1}/${parseInt(l9, 10)}`; } function h4(e9, i6) { const t10 = i6.level - e9.level; return e9.row === i6.row >> t10 && e9.col === i6.col >> t10 && e9.world === i6.world; } // node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/core.js var t6 = class { constructor(t10) { this.xTile = 0, this.yTile = 0, this.hash = 0, this.priority = 1, this.colliders = [], this.textVertexRanges = [], this.iconVertexRanges = [], this.tile = t10; } }; var s3 = class { constructor() { this.tileSymbols = [], this.parts = [{ startTime: 0, startOpacity: 0, targetOpacity: 0, show: false }, { startTime: 0, startOpacity: 0, targetOpacity: 0, show: false }], this.show = false; } }; // node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/util.js function o5(t10, e9, r10, s5, i6, l9) { const o6 = r10 - i6; if (o6 >= 0) return (e9 >> o6) + (s5 - (l9 << o6)) * (t10 >> o6); const n8 = -o6; return e9 - (l9 - (s5 << n8)) * (t10 >> n8) << n8; } var n5 = class { constructor(t10, e9, r10) { this._rows = Math.ceil(e9 / r10), this._columns = Math.ceil(t10 / r10), this._cellSize = r10, this.cells = new Array(this._rows); for (let s5 = 0; s5 < this._rows; s5++) { this.cells[s5] = new Array(this._columns); for (let t11 = 0; t11 < this._columns; t11++) this.cells[s5][t11] = []; } } getCell(t10, e9) { const r10 = Math.min(Math.max(Math.floor(e9 / this._cellSize), 0), this._rows - 1), s5 = Math.min(Math.max(Math.floor(t10 / this._cellSize), 0), this._columns - 1); return this.cells[r10] && this.cells[r10][s5] || null; } getCellSpan(t10, e9, r10, s5) { return [Math.min(Math.max(Math.floor(t10 / this._cellSize), 0), this.columns - 1), Math.min(Math.max(Math.floor(e9 / this._cellSize), 0), this.rows - 1), Math.min(Math.max(Math.floor(r10 / this._cellSize), 0), this.columns - 1), Math.min(Math.max(Math.floor(s5 / this._cellSize), 0), this.rows - 1)]; } get cellSize() { return this._cellSize; } get columns() { return this._columns; } get rows() { return this._rows; } }; function h5(t10, e9, s5, i6, l9, o6) { const n8 = e9[i6++]; for (let h7 = 0; h7 < n8; h7++) { const n9 = new t6(o6); n9.xTile = e9[i6++], n9.yTile = e9[i6++], n9.hash = e9[i6++], n9.priority = e9[i6++]; const h8 = e9[i6++]; for (let t11 = 0; t11 < h8; t11++) { const t12 = e9[i6++], r10 = e9[i6++], l10 = e9[i6++], o7 = e9[i6++], h9 = !!e9[i6++], a9 = e9[i6++], c8 = s5[i6++], d2 = s5[i6++], p2 = e9[i6++], u7 = e9[i6++]; n9.colliders.push({ xTile: t12, yTile: r10, dxPixels: l10, dyPixels: o7, hard: h9, partIndex: a9, width: p2, height: u7, minLod: c8, maxLod: d2 }); } const a8 = t10[i6++]; for (let e10 = 0; e10 < a8; e10++) n9.textVertexRanges.push([t10[i6++], t10[i6++]]); const c7 = t10[i6++]; for (let e10 = 0; e10 < c7; e10++) n9.iconVertexRanges.push([t10[i6++], t10[i6++]]); l9.push(n9); } return i6; } function a6(t10, e9, r10) { for (const [s5, i6] of t10.symbols) c5(t10, e9, r10, i6, s5); } function c5(t10, r10, s5, i6, l9) { const o6 = t10.layerData.get(l9); if (o6.type === I3.SYMBOL) { for (const e9 of i6) { const r11 = e9.unique; let i7; if (e9.selectedForRendering) { const e10 = r11.parts[0], l10 = e10.startOpacity, o7 = e10.targetOpacity; t10.allSymbolsFadingOut = t10.allSymbolsFadingOut && o7 === 0; const n8 = s5 ? Math.floor(127 * l10) | o7 << 7 : o7 ? 255 : 0; i7 = n8 << 24 | n8 << 16 | n8 << 8 | n8; } else i7 = 0; for (const [t11, s6] of e9.iconVertexRanges) for (let e10 = t11; e10 < t11 + s6; e10 += 4) o6.iconOpacity[e10 / 4] = i7; if (e9.selectedForRendering) { const e10 = r11.parts[1], l10 = e10.startOpacity, o7 = e10.targetOpacity; t10.allSymbolsFadingOut = t10.allSymbolsFadingOut && o7 === 0; const n8 = s5 ? Math.floor(127 * l10) | o7 << 7 : o7 ? 255 : 0; i7 = n8 << 24 | n8 << 16 | n8 << 8 | n8; } else i7 = 0; for (const [t11, s6] of e9.textVertexRanges) for (let e10 = t11; e10 < t11 + s6; e10 += 4) o6.textOpacity[e10 / 4] = i7; } o6.lastOpacityUpdate = r10, o6.opacityChanged = true; } } // node_modules/@arcgis/core/views/2d/engine/vectorTiles/RenderBucket.js var a7 = class { constructor(e9, t10) { this.layerUIDs = [], this.isDestroyed = false, this.data = e9, this.memoryUsed = e9.byteLength; let r10 = 1; const i6 = new Uint32Array(e9); this.layerUIDs = []; const s5 = i6[r10++]; for (let n8 = 0; n8 < s5; n8++) this.layerUIDs[n8] = i6[r10++]; this.bufferDataOffset = r10, t10 && (this.layer = t10.getStyleLayerByUID(this.layerUIDs[0])); } get isPreparedForRendering() { return t(this.data); } get offset() { return this.bufferDataOffset; } destroy() { this.isDestroyed || (this.doDestroy(), this.isDestroyed = true); } prepareForRendering(t10) { t(this.data) || (this.doPrepareForRendering(t10, this.data, this.bufferDataOffset), this.data = null); } }; var l6 = class extends a7 { constructor(e9, t10) { super(e9, t10), this.type = I3.LINE, this.lineIndexStart = 0, this.lineIndexCount = 0; const r10 = new Uint32Array(e9); let s5 = this.bufferDataOffset; this.lineIndexStart = r10[s5++], this.lineIndexCount = r10[s5++]; const n8 = r10[s5++]; if (n8 > 0) { const e10 = new Map(); for (let t11 = 0; t11 < n8; t11++) { const t12 = r10[s5++], i6 = r10[s5++], n9 = r10[s5++]; e10.set(t12, [i6, n9]); } this.patternMap = e10; } this.bufferDataOffset = s5; } hasData() { return this.lineIndexCount > 0; } triangleCount() { return this.lineIndexCount / 3; } doDestroy() { r(this.lineVertexArrayObject) && this.lineVertexArrayObject.dispose(), r(this.lineVertexBuffer) && this.lineVertexBuffer.dispose(), r(this.lineIndexBuffer) && this.lineIndexBuffer.dispose(), this.lineVertexArrayObject = null, this.lineVertexBuffer = null, this.lineIndexBuffer = null, this.memoryUsed = 0; } doPrepareForRendering(e9, t10, r10) { const i6 = new Uint32Array(t10), s5 = new Int32Array(i6.buffer), a8 = i6[r10++]; this.lineVertexBuffer = c.createVertex(e9, F.STATIC_DRAW, new Int32Array(s5.buffer, 4 * r10, a8)), r10 += a8; const l9 = i6[r10++]; this.lineIndexBuffer = c.createIndex(e9, F.STATIC_DRAW, new Uint32Array(i6.buffer, 4 * r10, l9)), r10 += l9; const u7 = this.layer.lineMaterial; this.lineVertexArrayObject = new f2(e9, u7.getAttributeLocations(), u7.getLayoutInfo(), { geometry: this.lineVertexBuffer }, this.lineIndexBuffer); } }; var u5 = class extends a7 { constructor(e9, t10) { super(e9, t10), this.type = I3.FILL, this.fillIndexStart = 0, this.fillIndexCount = 0, this.outlineIndexStart = 0, this.outlineIndexCount = 0; const r10 = new Uint32Array(e9); let s5 = this.bufferDataOffset; this.fillIndexStart = r10[s5++], this.fillIndexCount = r10[s5++], this.outlineIndexStart = r10[s5++], this.outlineIndexCount = r10[s5++]; const n8 = r10[s5++]; if (n8 > 0) { const e10 = new Map(); for (let t11 = 0; t11 < n8; t11++) { const t12 = r10[s5++], i6 = r10[s5++], n9 = r10[s5++]; e10.set(t12, [i6, n9]); } this.patternMap = e10; } this.bufferDataOffset = s5; } hasData() { return this.fillIndexCount > 0 || this.outlineIndexCount > 0; } triangleCount() { return (this.fillIndexCount + this.outlineIndexCount) / 3; } doDestroy() { r(this.fillVertexArrayObject) && this.fillVertexArrayObject.dispose(), r(this.fillVertexBuffer) && this.fillVertexBuffer.dispose(), r(this.fillIndexBuffer) && this.fillIndexBuffer.dispose(), this.fillVertexArrayObject = null, this.fillVertexBuffer = null, this.fillIndexBuffer = null, r(this.outlineVertexArrayObject) && this.outlineVertexArrayObject.dispose(), r(this.outlineVertexBuffer) && this.outlineVertexBuffer.dispose(), r(this.outlineIndexBuffer) && this.outlineIndexBuffer.dispose(), this.outlineVertexArrayObject = null, this.outlineVertexBuffer = null, this.outlineIndexBuffer = null, this.memoryUsed = 0; } doPrepareForRendering(e9, t10, r10) { const i6 = new Uint32Array(t10), s5 = new Int32Array(i6.buffer), a8 = i6[r10++]; this.fillVertexBuffer = c.createVertex(e9, F.STATIC_DRAW, new Int32Array(s5.buffer, 4 * r10, a8)), r10 += a8; const l9 = i6[r10++]; this.fillIndexBuffer = c.createIndex(e9, F.STATIC_DRAW, new Uint32Array(i6.buffer, 4 * r10, l9)), r10 += l9; const u7 = i6[r10++]; this.outlineVertexBuffer = c.createVertex(e9, F.STATIC_DRAW, new Int32Array(s5.buffer, 4 * r10, u7)), r10 += u7; const h7 = i6[r10++]; this.outlineIndexBuffer = c.createIndex(e9, F.STATIC_DRAW, new Uint32Array(i6.buffer, 4 * r10, h7)), r10 += h7; const c7 = this.layer, x = c7.fillMaterial, y = c7.outlineMaterial; this.fillVertexArrayObject = new f2(e9, x.getAttributeLocations(), x.getLayoutInfo(), { geometry: this.fillVertexBuffer }, this.fillIndexBuffer), this.outlineVertexArrayObject = new f2(e9, y.getAttributeLocations(), y.getLayoutInfo(), { geometry: this.outlineVertexBuffer }, this.outlineIndexBuffer); } }; var h6 = class extends a7 { constructor(e9, t10, r10) { super(e9, t10), this.type = I3.SYMBOL, this.iconPerPageElementsMap = new Map(), this.glyphPerPageElementsMap = new Map(), this.symbolInstances = [], this.isIconSDF = false, this.opacityChanged = false, this.lastOpacityUpdate = 0, this.symbols = []; const n8 = new Uint32Array(e9), f5 = new Int32Array(e9), o6 = new Float32Array(e9); let a8 = this.bufferDataOffset; this.isIconSDF = !!n8[a8++]; const l9 = n8[a8++]; for (let i6 = 0; i6 < l9; i6++) { const e10 = n8[a8++], t11 = n8[a8++], r11 = n8[a8++]; this.iconPerPageElementsMap.set(e10, [t11, r11]); } const u7 = n8[a8++]; for (let i6 = 0; i6 < u7; i6++) { const e10 = n8[a8++], t11 = n8[a8++], r11 = n8[a8++]; this.glyphPerPageElementsMap.set(e10, [t11, r11]); } const h7 = n8[a8++], c7 = n8[a8++]; this.iconOpacity = new Int32Array(h7), this.textOpacity = new Int32Array(c7), a8 = h5(n8, f5, o6, a8, this.symbols, r10), this.bufferDataOffset = a8; } hasData() { return this.iconPerPageElementsMap.size > 0 || this.glyphPerPageElementsMap.size > 0; } triangleCount() { let e9 = 0; for (const [t10, r10] of this.iconPerPageElementsMap) e9 += r10[1]; for (const [t10, r10] of this.glyphPerPageElementsMap) e9 += r10[1]; return e9 / 3; } doDestroy() { r(this.iconVertexArrayObject) && this.iconVertexArrayObject.dispose(), r(this.iconVertexBuffer) && this.iconVertexBuffer.dispose(), r(this.iconOpacityBuffer) && this.iconOpacityBuffer.dispose(), r(this.iconIndexBuffer) && this.iconIndexBuffer.dispose(), this.iconVertexArrayObject = null, this.iconVertexBuffer = null, this.iconOpacityBuffer = null, this.iconIndexBuffer = null, r(this.textVertexArrayObject) && this.textVertexArrayObject.dispose(), r(this.textVertexBuffer) && this.textVertexBuffer.dispose(), r(this.textOpacityBuffer) && this.textOpacityBuffer.dispose(), r(this.textIndexBuffer) && this.textIndexBuffer.dispose(), this.textVertexArrayObject = null, this.textVertexBuffer = null, this.textOpacityBuffer = null, this.textIndexBuffer = null, this.memoryUsed = 0; } updateOpacityInfo() { if (!this.opacityChanged) return; this.opacityChanged = false; const e9 = e2(this.iconOpacity), t10 = e2(this.iconOpacityBuffer); e9.length > 0 && e9.byteLength === t10.size && t10.setSubData(e9); const i6 = e2(this.textOpacity), s5 = e2(this.textOpacityBuffer); i6.length > 0 && i6.byteLength === s5.size && s5.setSubData(i6); } doPrepareForRendering(e9, t10, i6) { const s5 = new Uint32Array(t10), a8 = new Int32Array(s5.buffer), l9 = s5[i6++]; this.iconVertexBuffer = c.createVertex(e9, F.STATIC_DRAW, new Int32Array(a8.buffer, 4 * i6, l9)), i6 += l9; const u7 = s5[i6++]; this.iconIndexBuffer = c.createIndex(e9, F.STATIC_DRAW, new Uint32Array(s5.buffer, 4 * i6, u7)), i6 += u7; const h7 = s5[i6++]; this.textVertexBuffer = c.createVertex(e9, F.STATIC_DRAW, new Int32Array(a8.buffer, 4 * i6, h7)), i6 += h7; const c7 = s5[i6++]; this.textIndexBuffer = c.createIndex(e9, F.STATIC_DRAW, new Uint32Array(s5.buffer, 4 * i6, c7)), i6 += c7, this.iconOpacityBuffer = c.createVertex(e9, F.STATIC_DRAW, e2(this.iconOpacity).buffer), this.textOpacityBuffer = c.createVertex(e9, F.STATIC_DRAW, e2(this.textOpacity).buffer); const x = this.layer, y = x.iconMaterial, d2 = x.textMaterial; this.iconVertexArrayObject = new f2(e9, y.getAttributeLocations(), y.getLayoutInfo(), { geometry: this.iconVertexBuffer, opacity: this.iconOpacityBuffer }, this.iconIndexBuffer), this.textVertexArrayObject = new f2(e9, d2.getAttributeLocations(), d2.getLayoutInfo(), { geometry: this.textVertexBuffer, opacity: this.textOpacityBuffer }, this.textIndexBuffer); } }; var c6 = class extends a7 { constructor(e9, t10) { super(e9, t10), this.type = I3.CIRCLE, this.circleIndexStart = 0, this.circleIndexCount = 0; const r10 = new Uint32Array(e9); let s5 = this.bufferDataOffset; this.circleIndexStart = r10[s5++], this.circleIndexCount = r10[s5++], this.bufferDataOffset = s5; } hasData() { return this.circleIndexCount > 0; } triangleCount() { return this.circleIndexCount / 3; } doDestroy() { r(this.circleVertexArrayObject) && this.circleVertexArrayObject.dispose(), r(this.circleVertexBuffer) && this.circleVertexBuffer.dispose(), r(this.circleIndexBuffer) && this.circleIndexBuffer.dispose(), this.circleVertexArrayObject = null, this.circleVertexBuffer = null, this.circleIndexBuffer = null, this.memoryUsed = 0; } doPrepareForRendering(e9, t10, r10) { const i6 = new Uint32Array(t10), s5 = new Int32Array(i6.buffer), a8 = i6[r10++]; this.circleVertexBuffer = c.createVertex(e9, F.STATIC_DRAW, new Int32Array(s5.buffer, 4 * r10, a8)), r10 += a8; const l9 = i6[r10++]; this.circleIndexBuffer = c.createIndex(e9, F.STATIC_DRAW, new Uint32Array(i6.buffer, 4 * r10, l9)), r10 += l9; const u7 = this.layer.circleMaterial; this.circleVertexArrayObject = new f2(e9, u7.getAttributeLocations(), u7.getLayoutInfo(), { geometry: this.circleVertexBuffer }, this.circleIndexBuffer); } }; // node_modules/@arcgis/core/views/2d/engine/vectorTiles/VectorTile.js var m3 = class extends r5 { constructor(e9, t10, s5, a8, r10, i6, o6 = null) { super(e9, t10, s5, a8, r10, 4096, 4096), this._memCache = o6, this.type = "vector-tile", this._referenced = 0, this._hasSymbolBuckets = false, this._memoryUsedByLayerData = 0, this.layerData = new Map(), this.layerCount = 0, this.status = "loading", this.allSymbolsFadingOut = false, this.lastOpacityUpdate = 0, this.symbols = new Map(), this.isCoverage = false, this.neededForCoverage = false, this.decluttered = false, this.invalidating = false, this.parentTile = null, this.childrenTiles = new Set(), this._processed = false, this._referenced = 1, this.styleRepository = i6, this.id = e9.id; } get hasSymbolBuckets() { return this._hasSymbolBuckets; } get isFading() { return this._hasSymbolBuckets && performance.now() - this.lastOpacityUpdate < e5; } get isHoldingForFade() { return this._hasSymbolBuckets && (!this.allSymbolsFadingOut || performance.now() - this.lastOpacityUpdate < e5); } get wasRequested() { return this.status === "errored" || this.status === "loaded" || this.status === "reloading"; } setData(e9) { this.changeDataImpl(e9), this.requestRender(), this.ready(), this.invalidating = false, this._processed = true; } deleteLayerData(t10) { let s5 = false; for (const e9 of t10) if (this.layerData.has(e9)) { const t11 = this.layerData.get(e9); this._memoryUsedByLayerData -= t11.memoryUsed, t11.type === I3.SYMBOL && this.symbols.has(e9) && (this.symbols.delete(e9), s5 = true), t11.destroy(), this.layerData.delete(e9), this.layerCount--; } r(this._memCache) && this._memCache.updateSize(this.key.id, this, this._memoryUsedByLayerData), s5 && this.emit("symbols-changed"), this.requestRender(); } processed() { return this._processed; } hasData() { return this.layerCount > 0; } dispose() { this.status !== "unloaded" && (u6.delete(this), m3._destroyRenderBuckets(this.layerData), this.layerData = null, this.layerCount = 0, this._memoryUsedByLayerData = 0, this.destroy(), this.status = "unloaded"); } release() { return --this._referenced == 0 && (this.dispose(), this.stage = null, true); } retain() { ++this._referenced; } get referenced() { return this._referenced; } get memoryUsage() { return (this._memoryUsedByLayerData + 256) / (this._referenced || 1); } changeDataImpl(t10) { let s5 = false; if (t10) { const { bucketsWithData: a8, emptyBuckets: r10 } = t10, i6 = this._createRenderBuckets(a8); if (r10 && r10.byteLength > 0) { const e9 = new Uint32Array(r10); for (const t11 of e9) this._deleteLayerData(t11); } for (const [e9, t11] of i6) this._deleteLayerData(e9), t11.type === I3.SYMBOL && (this.symbols.set(e9, t11.symbols), s5 = true), this._memoryUsedByLayerData += t11.memoryUsed, this.layerData.set(e9, t11), this.layerCount++; r(this._memCache) && this._memCache.updateSize(this.key.id, this, this._memoryUsedByLayerData); } this._hasSymbolBuckets = false; for (const [e9, a8] of this.layerData) a8.type === I3.SYMBOL && (this._hasSymbolBuckets = true); s5 && this.emit("symbols-changed"); } attachWithContext(e9) { this.stage = { context: e9, trashDisplayObject(e10) { e10.processDetach(); }, untrashDisplayObject: () => false }; } setTransform(e9, i6) { super.setTransform(e9, i6); const o6 = i6 / (e9.resolution * e9.pixelRatio), h7 = this.width / this.rangeX * o6, n8 = this.height / this.rangeY * o6, l9 = [0, 0]; e9.toScreen(l9, [this.x, this.y]); const y = this.transforms.tileUnitsToPixels; r2(y), M(y, y, l9), h2(y, y, Math.PI * e9.rotation / 180), f(y, y, [h7, n8, 1]); } _createTransforms() { return { dvs: e6(), tileMat3: e6(), tileUnitsToPixels: e6() }; } static _destroyRenderBuckets(e9) { if (!e9) return; const t10 = new Set(); e9.forEach((e10) => { t10.has(e10) || (e10.destroy(), t10.add(e10)); }), e9.clear(); } _createRenderBuckets(e9) { const t10 = new Map(), s5 = new Map(); for (const a8 of e9) { const e10 = this._deserializeBucket(a8, s5); for (const s6 of e10.layerUIDs) t10.set(s6, e10); } return t10; } _deserializeBucket(e9, t10) { let s5 = t10.get(e9); if (s5) return s5; switch (new Uint32Array(e9)[0]) { case I3.FILL: s5 = new u5(e9, this.styleRepository); break; case I3.LINE: s5 = new l6(e9, this.styleRepository); break; case I3.SYMBOL: s5 = new h6(e9, this.styleRepository, this); break; case I3.CIRCLE: s5 = new c6(e9, this.styleRepository); } return t10.set(e9, s5), s5; } _deleteLayerData(e9) { if (!this.layerData.has(e9)) return; const t10 = this.layerData.get(e9); this._memoryUsedByLayerData -= t10.memoryUsed, t10.destroy(), this.layerData.delete(e9), this.layerCount--; } }; var u6 = new Map(); // node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/jobs.js function i2(e9, t10, n8, o6, i6, l9) { const { iconRotationAlignment: a8, textRotationAlignment: c7, iconTranslate: h7, iconTranslateAnchor: u7, textTranslate: d2, textTranslateAnchor: y } = o6; let x = 0; for (const g3 of e9.colliders) { const [e10, o7] = g3.partIndex === 0 ? h7 : d2, m5 = g3.partIndex === 0 ? u7 : y, f5 = g3.minLod <= l9 && l9 <= g3.maxLod; x += f5 ? 0 : 1, g3.enabled = f5, g3.xScreen = g3.xTile * i6[0] + g3.yTile * i6[3] + i6[6], g3.yScreen = g3.xTile * i6[1] + g3.yTile * i6[4] + i6[7], m5 === r3.MAP ? (g3.xScreen += n8 * e10 - t10 * o7, g3.yScreen += t10 * e10 + n8 * o7) : (g3.xScreen += e10, g3.yScreen += o7), l3.VIEWPORT === (g3.partIndex === 0 ? a8 : c7) ? (g3.dxScreen = g3.dxPixels, g3.dyScreen = g3.dyPixels) : (g3.dxScreen = n8 * (g3.dxPixels + g3.width / 2) - t10 * (g3.dyPixels + g3.height / 2) - g3.width / 2, g3.dyScreen = t10 * (g3.dxPixels + g3.width / 2) + n8 * (g3.dyPixels + g3.height / 2) - g3.height / 2); } e9.colliders.length > 0 && x === e9.colliders.length && (e9.unique.show = false); } var l7 = class { constructor(o6, r10, s5, i6, l9, a8) { this._symbols = o6, this._styleRepository = i6, this._zoom = l9, this._currentLayerCursor = 0, this._currentSymbolCursor = 0, this._styleProps = new Map(), this._allNeededMatrices = new Map(), this._gridIndex = new n5(r10, s5, t3), this._si = Math.sin(Math.PI * a8 / 180), this._co = Math.cos(Math.PI * a8 / 180); for (const t10 of o6) for (const n8 of t10.symbols) this._allNeededMatrices.has(n8.tile) || this._allNeededMatrices.set(n8.tile, r4(n8.tile.transforms.tileUnitsToPixels)); } work(e9) { const t10 = this._gridIndex; function n8(e10) { const n9 = e10.xScreen + e10.dxScreen, o7 = e10.yScreen + e10.dyScreen, r10 = n9 + e10.width, s5 = o7 + e10.height, [i6, l9, a8, c7] = t10.getCellSpan(n9, o7, r10, s5); for (let h7 = l9; h7 <= c7; h7++) for (let e11 = i6; e11 <= a8; e11++) { const i7 = t10.cells[h7][e11]; for (const e12 of i7) { const t11 = e12.xScreen + e12.dxScreen, i8 = e12.yScreen + e12.dyScreen, l10 = t11 + e12.width, a9 = i8 + e12.height; if (!(r10 < t11 || n9 > l10 || s5 < i8 || o7 > a9)) return true; } } return false; } const o6 = performance.now(); for (; this._currentLayerCursor < this._symbols.length; this._currentLayerCursor++, this._currentSymbolCursor = 0) { const t11 = this._symbols[this._currentLayerCursor], r10 = this._getProperties(t11.styleLayerUID); for (; this._currentSymbolCursor < t11.symbols.length; this._currentSymbolCursor++) { if (this._currentSymbolCursor % 100 == 99 && performance.now() - o6 > e9) return false; const s5 = t11.symbols[this._currentSymbolCursor]; if (!s5.unique.show) continue; i2(s5, this._si, this._co, r10, this._allNeededMatrices.get(s5.tile), this._zoom); const l9 = s5.unique; if (!l9.show) continue; const { iconAllowOverlap: a8, iconIgnorePlacement: c7, textAllowOverlap: h7, textIgnorePlacement: u7 } = r10; for (const e10 of s5.colliders) { if (!e10.enabled) continue; const t12 = l9.parts[e10.partIndex]; if (!t12.show) continue; !(e10.partIndex ? h7 : a8) && n8(e10) && (e10.hard ? l9.show = false : t12.show = false); } if (l9.show) for (const e10 of s5.colliders) { if (!e10.enabled) continue; if (e10.partIndex ? u7 : c7) continue; if (!l9.parts[e10.partIndex].show) continue; const t12 = e10.xScreen + e10.dxScreen, n9 = e10.yScreen + e10.dyScreen, o7 = t12 + e10.width, r11 = n9 + e10.height, [s6, i6, a9, h8] = this._gridIndex.getCellSpan(t12, n9, o7, r11); for (let l10 = i6; l10 <= h8; l10++) for (let t13 = s6; t13 <= a9; t13++) { this._gridIndex.cells[l10][t13].push(e10); } } } } return true; } _getProperties(e9) { const t10 = this._styleProps.get(e9); if (t10) return t10; const n8 = this._zoom, s5 = this._styleRepository.getStyleLayerByUID(e9), i6 = s5.getLayoutValue("symbol-placement", n8) !== n3.POINT; let l9 = s5.getLayoutValue("icon-rotation-alignment", n8); l9 === l3.AUTO && (l9 = i6 ? l3.MAP : l3.VIEWPORT); let a8 = s5.getLayoutValue("text-rotation-alignment", n8); a8 === l3.AUTO && (a8 = i6 ? l3.MAP : l3.VIEWPORT); const c7 = s5.getPaintValue("icon-translate", n8), h7 = s5.getPaintValue("icon-translate-anchor", n8), u7 = s5.getPaintValue("text-translate", n8), d2 = s5.getPaintValue("text-translate-anchor", n8), y = { iconAllowOverlap: s5.getLayoutValue("icon-allow-overlap", n8), iconIgnorePlacement: s5.getLayoutValue("icon-ignore-placement", n8), textAllowOverlap: s5.getLayoutValue("text-allow-overlap", n8), textIgnorePlacement: s5.getLayoutValue("text-ignore-placement", n8), iconRotationAlignment: l9, textRotationAlignment: a8, iconTranslateAnchor: h7, iconTranslate: c7, textTranslateAnchor: d2, textTranslate: u7 }; return this._styleProps.set(e9, y), y; } }; // node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js function t7(o6, e9) { if (o6.priority - e9.priority) return o6.priority - e9.priority; const t10 = o6.tile.key, i6 = e9.tile.key; return t10.world - i6.world ? t10.world - i6.world : t10.level - i6.level ? t10.level - i6.level : t10.row - i6.row ? t10.row - i6.row : t10.col - i6.col ? t10.col - i6.col : o6.xTile - e9.xTile ? o6.xTile - e9.xTile : o6.yTile - e9.yTile; } var i3 = class { constructor(o6, e9, t10, i6, s5, r10) { this._visibleTiles = o6, this._symbolRepository = e9, this._createCollisionJob = t10, this._assignTileSymbolsOpacity = i6, this._symbolLayerSorter = s5, this._isLayerVisible = r10, this._selectionJob = null, this._selectionJobCompleted = false, this._collisionJob = null, this._collisionJobCompleted = false, this._opacityJob = null, this._opacityJobCompleted = false, this._running = true; } get running() { return this._running; } setScreenSize(o6, e9) { this._screenWidth === o6 && this._screenHeight === e9 || this.restart(), this._screenWidth = o6, this._screenHeight = e9; } restart() { this._selectionJob = null, this._selectionJobCompleted = false, this._collisionJob = null, this._collisionJobCompleted = false, this._opacityJob = null, this._opacityJobCompleted = false, this._running = true; } continue(o6) { if (this._selectionJob || (this._selectionJob = this._createSelectionJob()), !this._selectionJobCompleted) { const e9 = performance.now(); if (!this._selectionJob.work(o6)) return false; if (this._selectionJobCompleted = true, (o6 = Math.max(0, o6 - (performance.now() - e9))) === 0) return false; } if (this._collisionJob || (this._collisionJob = this._createCollisionJob(this._selectionJob.sortedSymbols, this._screenWidth, this._screenHeight)), !this._collisionJobCompleted) { const e9 = performance.now(); if (!this._collisionJob.work(o6)) return false; if (this._collisionJobCompleted = true, (o6 = Math.max(0, o6 - (performance.now() - e9))) === 0) return false; } if (this._opacityJob || (this._opacityJob = this._createOpacityJob()), !this._opacityJobCompleted) { const e9 = performance.now(); if (!this._opacityJob.work(o6)) return false; if (this._opacityJobCompleted = true, (o6 = Math.max(0, o6 - (performance.now() - e9))) === 0) return false; } return this._running = false, true; } _createSelectionJob() { const o6 = this._symbolRepository.uniqueSymbols; for (let t10 = 0; t10 < o6.length; t10++) { const e10 = o6[t10]; for (let o7 = 0; o7 < e10.uniqueSymbols.length; o7++) { const t11 = e10.uniqueSymbols[o7]; for (const o8 of t11.tileSymbols) o8.selectedForRendering = false; } } const e9 = []; let i6 = 0, s5 = 0; const r10 = this._isLayerVisible; function n8(n9) { let l10; const c7 = performance.now(); for (; s5 < o6.length; s5++, i6 = 0) { const t10 = o6[s5], h7 = t10.styleLayerUID; if (!r10(h7)) { e9[s5] || (e9[s5] = { styleLayerUID: h7, symbols: [] }); continue; } e9[s5] = e9[s5] || { styleLayerUID: h7, symbols: [] }; const a8 = e9[s5]; for (; i6 < t10.uniqueSymbols.length; i6++) { if (l10 = t10.uniqueSymbols[i6], i6 % 100 == 99 && performance.now() - c7 > n9) return false; let o7 = null, e10 = false, s6 = false; for (const t11 of l10.tileSymbols) if (!s6 || !e10) { const i7 = t11.tile; (!o7 || i7.isCoverage || i7.neededForCoverage && !e10) && (o7 = t11, (i7.neededForCoverage || i7.isCoverage) && (s6 = true), i7.isCoverage && (e10 = true)); } if (o7.selectedForRendering = true, s6) { a8.symbols.push(o7), l10.show = true; for (const o8 of l10.parts) o8.show = true; } else l10.show = false; } } for (const o7 of e9) o7.symbols.sort(t7); return true; } const l9 = this._symbolLayerSorter; return { work: n8, get sortedSymbols() { return e9.sort(l9); } }; } _createOpacityJob() { const e9 = this._assignTileSymbolsOpacity, t10 = this._visibleTiles; let i6 = 0; function r10(o6, t11) { const i7 = o6.symbols; for (const [e10, r11] of i7) s4(r11, t11); e9(o6, t11); for (const e10 of o6.childrenTiles) r10(e10, t11); } return { work(e10) { const s5 = performance.now(); for (; i6 < t10.length; i6++) { if (performance.now() - s5 > e10) return false; const n8 = t10[i6]; if (r(n8.parentTile)) continue; r10(n8, performance.now()); } return true; } }; } }; function s4(o6, t10) { for (const i6 of o6) { const o7 = i6.unique; for (const i7 of o7.parts) { const s5 = i7.targetOpacity > 0.5 ? 1 : -1; i7.startOpacity += s5 * ((t10 - i7.startTime) / e5), i7.startOpacity = Math.min(Math.max(i7.startOpacity, 0), 1), i7.startTime = t10, i7.targetOpacity = o7.show && i7.show ? 1 : 0; } } } // node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js var l8 = 32; var i4 = 8; var n6 = 64; var r9 = class { constructor(e9, s5, o6) { this.tileCoordRange = e9, this._visibleTiles = s5, this._createUnique = o6, this._tiles = new Map(), this._uniqueSymbolsReferences = new Map(); } get uniqueSymbols() { return t(this._uniqueSymbolLayerArray) && (this._uniqueSymbolLayerArray = this._createUniqueSymbolLayerArray()), this._uniqueSymbolLayerArray; } add(e9, s5) { this._uniqueSymbolLayerArray = null; let t10 = this._tiles.get(e9.id); t10 || (t10 = { symbols: new Map() }, this._tiles.set(e9.id, t10)); const r10 = new Map(); if (s5) for (const o6 of s5) t10.symbols.has(o6) && (r10.set(o6, t10.symbols.get(o6)), t10.symbols.delete(o6)); else for (const [o6, l9] of e9.layerData) t10.symbols.has(o6) && (r10.set(o6, t10.symbols.get(o6)), t10.symbols.delete(o6)); this._removeSymbols(r10); const y = e9.symbols, a8 = new Map(); for (const [f5, c7] of y) { let e10 = c7.length; if (e10 >= l8) { let s6 = this.tileCoordRange; do { s6 /= 2, e10 /= 4; } while (e10 > i4 && s6 > n6); const l9 = new n5(this.tileCoordRange, this.tileCoordRange, s6); a8.set(f5, { flat: c7, index: l9 }), t10.symbols.set(f5, { flat: c7, index: l9 }); for (const e11 of c7) l9.getCell(e11.xTile, e11.yTile).push(e11); } else a8.set(f5, { flat: c7 }), t10.symbols.set(f5, { flat: c7 }); } this._addSymbols(e9.key, y); } deleteStyleLayers(e9) { this._uniqueSymbolLayerArray = null; for (const [s5, o6] of this._tiles) { const t10 = new Map(); for (const s6 of e9) o6.symbols.has(s6) && (t10.set(s6, o6.symbols.get(s6)), o6.symbols.delete(s6)); this._removeSymbols(t10), o6.symbols.size === 0 && this._tiles.delete(s5); } } removeTile(e9) { this._uniqueSymbolLayerArray = null; const s5 = this._tiles.get(e9.id); if (!s5) return; const o6 = new Map(); for (const [t10, l9] of e9.symbols) s5.symbols.has(t10) && (o6.set(t10, s5.symbols.get(t10)), s5.symbols.delete(t10)); this._removeSymbols(o6), s5.symbols.size === 0 && this._tiles.delete(e9.id); } _removeSymbols(e9) { for (const [s5, { flat: o6 }] of e9) for (const e10 of o6) { const o7 = e10.unique, t10 = o7.tileSymbols, l9 = t10.length - 1; for (let s6 = 0; s6 < l9; s6++) if (t10[s6] === e10) { t10[s6] = t10[l9]; break; } if (t10.length = l9, l9 === 0) { const e11 = this._uniqueSymbolsReferences.get(s5); e11.delete(o7), e11.size === 0 && this._uniqueSymbolsReferences.delete(s5); } e10.unique = null; } } _addSymbols(s5, o6) { if (o6.size === 0) return; const t10 = this._visibleTiles; for (const e9 of t10) e9.parentTile || e9.key.world !== s5.world || e9.key.level === s5.level && !e9.key.equals(s5) || this._matchSymbols(e9, s5, o6); for (const [l9, i6] of o6) for (const s6 of i6) if (t(s6.unique)) { const e9 = this._createUnique(); s6.unique = e9, e9.tileSymbols.push(s6); let o7 = this._uniqueSymbolsReferences.get(l9); o7 || (o7 = new Set(), this._uniqueSymbolsReferences.set(l9, o7)), o7.add(e9); } } _matchSymbols(e9, o6, l9) { if (e9.key.level > o6.level) { const s5 = e9.key.level - o6.level; if (e9.key.row >> s5 !== o6.row || e9.key.col >> s5 !== o6.col) return; } if (o6.level > e9.key.level) { const s5 = o6.level - e9.key.level; if (o6.row >> s5 !== e9.key.row || o6.col >> s5 !== e9.key.col) return; } if (o6.equals(e9.key)) { for (const s5 of e9.childrenTiles) this._matchSymbols(s5, o6, l9); return; } const i6 = new Map(); for (const [n8, r10] of l9) { const l10 = []; for (const s5 of r10) { const i7 = o5(this.tileCoordRange, s5.xTile, o6.level, o6.col, e9.key.level, e9.key.col), n9 = o5(this.tileCoordRange, s5.yTile, o6.level, o6.row, e9.key.level, e9.key.row); i7 >= 0 && i7 < this.tileCoordRange && n9 >= 0 && n9 < this.tileCoordRange && l10.push({ symbol: s5, xTransformed: i7, yTransformed: n9 }); } const y = [], a8 = e9.key.level < o6.level ? 1 : 1 << e9.key.level - o6.level, f5 = this._tiles.get(e9.id).symbols.get(n8); if (f5) { const e10 = f5.flat; for (const o7 of l10) { let t10, l11 = false; const i7 = o7.xTransformed, n9 = o7.yTransformed; t10 = r(f5.index) ? f5.index.getCell(i7, n9) : e10; const r11 = o7.symbol, c7 = r11.hash; for (const e11 of t10) if (c7 === e11.hash && Math.abs(i7 - e11.xTile) <= a8 && Math.abs(n9 - e11.yTile) <= a8) { const s5 = e11.unique; r11.unique = s5, s5.tileSymbols.push(r11), l11 = true; break; } l11 || y.push(r11); } } y.length > 0 && i6.set(n8, y); } for (const s5 of e9.childrenTiles) this._matchSymbols(s5, o6, i6); } _createUniqueSymbolLayerArray() { const e9 = this._uniqueSymbolsReferences, s5 = new Array(e9.size); let o6, t10 = 0; for (const [l9, i6] of e9) { const e10 = new Array(i6.size); o6 = 0; for (const s6 of i6) e10[o6++] = s6; s5[t10] = { styleLayerUID: l9, uniqueSymbols: e10 }, t10++; } return s5; } }; // node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/SymbolFader.js var n7 = 0.5; var _2 = 1e-6; var m4 = class extends n2 { constructor(t10, e9) { super(), this.styleRepository = t10, this._tileToHandle = new Map(), this._viewState = { scale: 0, rotation: 0, center: [0, 0], size: [0, 0] }, this._declutterViewState = { scale: 0, rotation: 0, center: [0, 0], size: [0, 0] }, this._completed = false, this._symbolRepository = new r9(4096, e9, () => new s3()), this._symbolDeclutterer = new i3(e9, this._symbolRepository, (t11, e10, i6) => new l7(t11, e10, i6, this.styleRepository, this._zoom, this._viewState.rotation), (t11, e10) => { t11.allSymbolsFadingOut = true, t11.lastOpacityUpdate = e10, a6(t11, e10, true), t11.decluttered = true, t11.requestRender(); }, (t11, e10) => this.styleRepository.getStyleLayerByUID(t11.styleLayerUID).z - this.styleRepository.getStyleLayerByUID(e10.styleLayerUID).z, (t11) => { const e10 = this.styleRepository.getStyleLayerByUID(t11); if (this._zoom + _2 < e10.minzoom || this._zoom - _2 >= e10.maxzoom) return false; const i6 = e10.getLayoutProperty("visibility"); return !i6 || i6.getValue() !== i.NONE; }); } addTile(t10) { t10.decluttered = false, this._tileToHandle.set(t10, t10.on("symbols-changed", () => { this._symbolRepository.add(t10), this.restartDeclutter(); })), this._symbolRepository.add(t10), this.restartDeclutter(); } removeTile(t10) { const e9 = this._tileToHandle.get(t10); e9 && (this._symbolRepository.removeTile(t10), this.restartDeclutter(), e9.remove(), this._tileToHandle.delete(t10)); } update(t10, e9) { return this._zoom = t10, this._viewState = { scale: e9.scale, rotation: e9.rotation, center: [e9.center[0], e9.center[1]], size: [e9.size[0], e9.size[1]] }, this._continueDeclutter(), this._completed; } restartDeclutter() { this._completed = false, this._symbolDeclutterer.restart(), this._notifyUnstable(); } clear() { this._completed = false, this._symbolRepository = null, this._symbolDeclutterer.restart(), this._tileToHandle.forEach((t10) => t10.remove()), this._tileToHandle.clear(); } get stale() { return this._zoom !== this._declutterZoom || this._viewState.size[0] !== this._declutterViewState.size[0] || this._viewState.size[1] !== this._declutterViewState.size[1] || this._viewState.scale !== this._declutterViewState.scale || this._viewState.rotation !== this._declutterViewState.rotation; } deleteStyleLayers(t10) { this._symbolRepository.deleteStyleLayers(t10); } _continueDeclutter() { this._completed && !this.stale || (this._symbolDeclutterer.running || (this._declutterZoom = this._zoom, this._declutterViewState.center[0] = this._viewState.center[0], this._declutterViewState.center[1] = this._viewState.center[1], this._declutterViewState.rotation = this._viewState.rotation, this._declutterViewState.scale = this._viewState.scale, this._declutterViewState.size[0] = this._viewState.size[0], this._declutterViewState.size[1] = this._viewState.size[1], this._symbolDeclutterer.restart()), this._symbolDeclutterer.setScreenSize(this._viewState.size[0], this._viewState.size[1]), this._completed = this._symbolDeclutterer.continue(c2), this._completed && this._scheduleNotifyStable()); } _scheduleNotifyStable() { r(this._stableNotificationHandle) && clearTimeout(this._stableNotificationHandle), this._stableNotificationHandle = setTimeout(() => { this._stableNotificationHandle = null, this.emit("fade-complete"); }, (1 + n7) * e5); } _notifyUnstable() { r(this._stableNotificationHandle) && (clearTimeout(this._stableNotificationHandle), this._stableNotificationHandle = null), this.emit("fade-start"); } }; // node_modules/@arcgis/core/views/2d/engine/webgl/RenderableTile.js var t8 = class extends r5 { _createTransforms() { return { dvs: e6(), tileMat3: e6() }; } }; // node_modules/@arcgis/core/views/2d/engine/vectorTiles/VectorTileContainer.js var _3 = 1e-6; function f4(e9, t10) { if (e9) { const s5 = e9.getLayoutProperty("visibility"); if (!s5 || s5.getValue() !== i.NONE && (e9.minzoom === void 0 || e9.minzoom < t10 + _3) && (e9.maxzoom === void 0 || e9.maxzoom >= t10 - _3)) return true; } return false; } var b = class extends o { constructor(e9) { super(e9), this._backgroundTiles = [], this._pointToCallbacks = new Map(); } destroy() { this.removeAllChildren(), this._spriteMosaic && (this._spriteMosaic.dispose(), this._spriteMosaic = null), this._glyphMosaic && (this._glyphMosaic.dispose(), this._glyphMosaic = null), r(this._symbolFader) && (this._symbolFader.clear(), this._symbolFader = null), this._styleRepository = null, this._backgroundTiles = [], this._pointToCallbacks.clear(); } setStyleResources(e9, r10, i6) { if (this._spriteMosaic = e9, this._glyphMosaic = r10, this._styleRepository = i6, t(this._symbolFader)) { const e10 = new m4(this._styleRepository, this.children); e10.on("fade-start", () => { this.emit("fade-start"), this.requestRender(); }), e10.on("fade-complete", () => { this.emit("fade-complete"), this.requestRender(); }), this._symbolFader = e10; } e2(this._symbolFader).styleRepository = i6; } setSpriteMosaic(e9) { this._spriteMosaic.dispose(), this._spriteMosaic = e9; } deleteStyleLayers(t10) { r(this._symbolFader) && this._symbolFader.deleteStyleLayers(t10); } async hitTest(e9) { const t10 = D(); return this._pointToCallbacks.set(e9, t10), this.requestRender(), t10.promise; } enterTileInvalidation() { for (const e9 of this.children) e9.invalidating = true; } createRenderParams(e9) { return { ...super.createRenderParams(e9), renderPass: null, styleLayer: null, styleLayerUID: -1, glyphMosaic: this._glyphMosaic, spriteMosaic: this._spriteMosaic, hasClipping: !!this._clippingInfos }; } doRender(e9) { !this.visible || e9.drawPhase !== I2.MAP && e9.drawPhase !== I2.DEBUG || this._spriteMosaic === void 0 || super.doRender(e9); } addChild(t10) { return super.addChild(t10), r(this._symbolFader) ? this._symbolFader.addTile(t10) : t10.decluttered = true, this.requestRender(), t10; } removeChild(t10) { return r(this._symbolFader) && this._symbolFader.removeTile(t10), this.requestRender(), super.removeChild(t10); } renderChildren(e9) { const { drawPhase: t10 } = e9; if (t10 !== I2.DEBUG) { if (this._doRender(e9), this._pointToCallbacks.size > 0) { e9.drawPhase = I2.HITTEST; const s5 = e9.painter.effects.hittestVTL; s5.bind(e9), this._doRender(e9), s5.draw(e9, this._pointToCallbacks), s5.unbind(e9), e9.drawPhase = t10; } } else super.renderChildren(e9); } removeAllChildren() { for (let t10 = 0; t10 < this.children.length; t10++) { const s5 = this.children[t10]; r(this._symbolFader) && this._symbolFader.removeTile(s5), s5.dispose(); } super.removeAllChildren(); } getStencilTarget() { return this.children.filter((e9) => e9.neededForCoverage && e9.hasData()); } restartDeclutter() { r(this._symbolFader) && this._symbolFader.restartDeclutter(); } _doRender(e9) { const { context: t10 } = e9, s5 = this._styleRepository; if (!s5) return; const r10 = s5.layers; let i6 = true; e9.drawPhase === I2.HITTEST && (i6 = false), s5.backgroundBucketIds.length > 0 && (e9.renderPass = "background", this._renderBackgroundLayers(e9, s5.backgroundBucketIds)), super.renderChildren(e9), e9.drawPhase === I2.MAP && this._fade(e9.displayLevel, e9.state); const o6 = this.children.filter((e10) => e10.visible && e10.hasData()); if (!o6 || o6.length === 0) return t10.bindVAO(), t10.setStencilTestEnabled(true), void t10.setBlendingEnabled(true); for (const l9 of o6) l9.triangleCount = 0; t10.setStencilWriteMask(0), t10.setColorMask(true, true, true, true), t10.setStencilOp(O.KEEP, O.KEEP, O.REPLACE), t10.setStencilTestEnabled(true), t10.setBlendingEnabled(false), t10.setDepthTestEnabled(true), t10.setDepthWriteEnabled(true), t10.setDepthFunction(I.LEQUAL), t10.setClearDepth(1), t10.clear(t10.gl.DEPTH_BUFFER_BIT), e9.renderPass = "opaque"; for (let l9 = r10.length - 1; l9 >= 0; l9--) this._renderStyleLayer(r10[l9], e9, o6); t10.setDepthWriteEnabled(false), t10.setBlendingEnabled(i6), t10.setBlendFunctionSeparate(R.ONE, R.ONE_MINUS_SRC_ALPHA, R.ONE, R.ONE_MINUS_SRC_ALPHA), e9.renderPass = "translucent"; for (let l9 = 0; l9 < r10.length; l9++) this._renderStyleLayer(r10[l9], e9, o6); t10.setDepthTestEnabled(false), e9.renderPass = "symbol"; for (let l9 = 0; l9 < r10.length; l9++) this._renderStyleLayer(r10[l9], e9, o6); t10.bindVAO(), t10.setStencilTestEnabled(true), t10.setBlendingEnabled(true); } _fade(t10, s5) { r(this._symbolFader) && (this._symbolFader.update(t10, s5) || this.requestRender()); } _renderStyleLayer(e9, t10, s5) { const { painter: r10, renderPass: i6 } = t10; if (e9 === void 0) return; const o6 = e9.getLayoutProperty("visibility"); if (o6 && o6.getValue() === i.NONE) return; let a8; switch (e9.type) { case a3.BACKGROUND: return; case a3.FILL: if (i6 !== "opaque" && t10.renderPass !== "translucent") return; a8 = "vtlFill"; break; case a3.LINE: if (i6 !== "translucent") return; a8 = "vtlLine"; break; case a3.CIRCLE: if (i6 !== "symbol") return; a8 = "vtlCircle"; break; case a3.SYMBOL: if (i6 !== "symbol") return; a8 = "vtlSymbol"; } if (s5 = e9.type === a3.SYMBOL ? s5.filter((e10) => e10.decluttered) : s5.filter((e10) => e10.neededForCoverage), a8 !== "vtlSymbol") { const r11 = t10.displayLevel; if (s5.length === 0 || e9.minzoom !== void 0 && e9.minzoom >= r11 + _3 || e9.maxzoom !== void 0 && e9.maxzoom < r11 - _3) return; } const d2 = e9.uid; t10.styleLayerUID = d2, t10.styleLayer = e9; for (const l9 of s5) if (l9.layerData.has(d2)) { r10.renderObjects(t10, s5, a8); break; } } _renderBackgroundLayers(t10, s5) { const { context: r10, displayLevel: o6, painter: l9, state: h7 } = t10, u7 = this._styleRepository; let _4 = false; for (const e9 of s5) { if (u7.getLayerById(e9).type === a3.BACKGROUND && f4(u7.getLayerById(e9), o6)) { _4 = true; break; } } if (!_4) return; const b3 = this._tileInfoView.getTileCoverage(t10.state, 0, "smallest"), { spans: g3, lodInfo: T } = b3, { level: E3 } = T, C = u(), L3 = []; if (this._renderPasses) { const s6 = this._renderPasses[0]; r(this._clippingInfos) && (s6.brushes[0].prepareState(t10, this._clippingInfos[0]), s6.brushes[0].drawMany(t10, this._clippingInfos)); } const v2 = this._backgroundTiles; let S2, P2 = 0; for (const { row: e9, colFrom: n8, colTo: a8 } of g3) for (let t11 = n8; t11 <= a8; t11++) { if (P2 < v2.length) S2 = v2[P2], S2.key.set(E3, e9, T.normalizeCol(t11), T.getWorldForColumn(t11)), this._tileInfoView.getTileBounds(C, S2.key, false), S2.x = C[0], S2.y = C[3]; else { const s6 = new e3(E3, e9, T.normalizeCol(t11), T.getWorldForColumn(t11)), r11 = this._tileInfoView.getTileBounds(u(), s6); S2 = new t8(s6, r11[0], r11[3], 512, 512, 4096, 4096), v2.push(S2); } S2.setTransform(h7, this._tileInfoView.getTileResolution(S2.key)), L3.push(S2), P2++; } r10.setStencilWriteMask(0), r10.setColorMask(true, true, true, true), r10.setStencilOp(O.KEEP, O.KEEP, O.REPLACE), r10.setStencilFunction(I.EQUAL, 0, 255); let R2 = true; t10.drawPhase === I2.HITTEST && (R2 = false), r10.setStencilTestEnabled(R2); for (const e9 of s5) { const s6 = u7.getLayerById(e9); s6.type === a3.BACKGROUND && f4(s6, o6) && (t10.styleLayerUID = s6.uid, t10.styleLayer = s6, l9.renderObjects(t10, L3, "vtlBackground")); } l2.pool.release(b3); } }; // node_modules/@arcgis/core/views/2d/layers/support/Display.js var i5 = class extends t4 { constructor(e9) { super(), this.requestRender = this.requestRender.bind(this), this._layerView = e9, this._canvas = document.createElement("canvas"), this._context = this._canvas.getContext("2d"), this._bitmap = new v(null, "standard", false), this.addChild(this._bitmap); } doRender(t10) { const e9 = t10.state, i6 = this._createCustomRenderParams(t10), a8 = this._canvas, s5 = this._bitmap, n8 = window.devicePixelRatio; a8.width = e9.size[0] * n8, a8.height = e9.size[1] * n8, s5.resolution = e9.resolution; const o6 = e9.clone(); o6.pixelRatio = n8, s5.pixelRatio = n8, i6.state = o6, s5.x = e9.viewpoint.targetGeometry.x - Math.abs(e9.extent.xmax - e9.extent.xmin) / 2, s5.y = e9.viewpoint.targetGeometry.y + Math.abs(e9.extent.ymax - e9.extent.ymin) / 2, this._layerView.render(i6), s5.source = a8, s5.rotation = e9.rotation, super.doRender({ ...t10, state: o6 }); } _createCustomRenderParams(t10) { return { globalOpacity: t10.globalOpacity, state: t10.state, stationary: t10.stationary, pixelRatio: window.devicePixelRatio, context: this._context }; } }; // node_modules/@arcgis/core/views/2d/tiling/TileInfoViewPOT.js var t9 = class extends h3 { constructor() { super(...arguments), this._fullCacheLodInfos = null, this._levelByScale = {}; } getTileParentId(e9) { const l9 = e3.pool.acquire(e9), t10 = l9.level === 0 ? null : e3.getId(l9.level - 1, l9.row >> 1, l9.col >> 1, l9.world); return e3.pool.release(l9), t10; } getTileCoverage(e9, l9, s5) { const t10 = super.getTileCoverage(e9, l9, s5); if (!t10) return t10; const o6 = 1 << t10.lodInfo.level; return t10.spans = t10.spans.filter((e10) => e10.row >= 0 && e10.row < o6), t10; } scaleToLevel(e9) { if (this._fullCacheLodInfos || this._initializeFullCacheLODs(this._lodInfos), this._levelByScale[e9]) return this._levelByScale[e9]; { const l9 = this._fullCacheLodInfos; if (e9 > l9[0].scale) return l9[0].level; let s5, t10; for (let o6 = 0; o6 < l9.length - 1; o6++) if (t10 = l9[o6 + 1], e9 > t10.scale) return s5 = l9[o6], s5.level + (s5.scale - e9) / (s5.scale - t10.scale); return l9[l9.length - 1].level; } } _initializeFullCacheLODs(l9) { let s5; if (l9[0].level === 0) s5 = l9.map((e9) => ({ level: e9.level, resolution: e9.resolution, scale: e9.scale })); else { const l10 = this.tileInfo.size[0], t10 = this.tileInfo.spatialReference; s5 = S.create({ size: l10, spatialReference: t10 }).lods.map((e9) => ({ level: e9.level, resolution: e9.resolution, scale: e9.scale })); } for (let e9 = 0; e9 < s5.length; e9++) this._levelByScale[s5[e9].scale] = s5[e9].level; this._fullCacheLodInfos = s5; } }; // node_modules/@arcgis/core/views/2d/layers/VectorTileLayerView2D.js var Q = s.getLogger("esri.views.2d.layers.VectorTileLayerView2D"); var L2 = class extends f3(u4) { constructor() { super(...arguments), this._styleChanges = [], this._fetchQueue = null, this._parseQueue = null, this._isTileHandlerReady = false, this.fading = false; } async hitTest(e9, i6) { if (!this._tileHandlerPromise) return null; await this._tileHandlerPromise; const s5 = await this._vectorTileContainer.hitTest(i6); if (!s5 || s5.length === 0) return null; const r10 = s5[0] - 1, a8 = this._styleRepository, l9 = a8.getStyleLayerByUID(r10); if (!l9) return null; const n8 = a8.getStyleLayerIndex(l9.id); return [{ type: "graphic", mapPoint: e9, layer: this.layer, graphic: new g2({ attributes: { layerId: n8, layerName: l9.id, layerUID: r10 }, layer: this.layer, sourceLayer: this.layer }) }]; } update(e9) { if (this._tileHandlerPromise && this._isTileHandlerReady) return e9.pixelRatio !== this._tileHandler.devicePixelRatio ? (this._start(), void (this._tileHandler.devicePixelRatio = e9.pixelRatio)) : void (this._styleChanges.length > 0 ? this._tileHandlerPromise = this._applyStyleChanges() : (this._fetchQueue.pause(), this._parseQueue.pause(), this._fetchQueue.state = e9.state, this._parseQueue.state = e9.state, this._tileManager.update(e9) || this.requestUpdate(), this._parseQueue.resume(), this._fetchQueue.resume())); } attach() { const { style: e9 } = this.layer.currentStyleInfo; this._styleRepository = new l4(e9), this._tileInfoView = new t9(this.layer.tileInfo, this.layer.fullExtent), this._vectorTileContainer = new b(this._tileInfoView), this._tileHandler = new c3(this.layer, this._styleRepository, window.devicePixelRatio || 1), this.container.addChild(this._vectorTileContainer), this._start(), this.handles.add([this._vectorTileContainer.on("fade-start", () => { this.fading = true, this.notifyChange("updating"), this.requestUpdate(); }), this._vectorTileContainer.on("fade-complete", () => { this._collisionBoxesDisplay?.requestRender(), this.fading = false, this.notifyChange("updating"), this.requestUpdate(); }), l(() => this.layer.symbolCollisionBoxesVisible, (e10) => { e10 ? (this._collisionBoxesDisplay = new i5({ render: (e11) => this._renderCollisionBoxes(e11.context) }), this.container.addChild(this._collisionBoxesDisplay)) : (this.container.removeChild(this._collisionBoxesDisplay), this._collisionBoxesDisplay = null); }, h), this.layer.on("paint-change", (e10) => { if (e10.isDataDriven) this._styleChanges.push({ type: L.PAINTER_CHANGED, data: e10 }), this.notifyChange("updating"), this.requestUpdate(); else { const t10 = this._styleRepository, i6 = t10.getLayerById(e10.layer); if (!i6) return; const s5 = i6.type === a3.SYMBOL; t10.setPaintProperties(e10.layer, e10.paint), s5 && this._vectorTileContainer.restartDeclutter(), this._vectorTileContainer.requestRender(); } }), this.layer.on("layout-change", (e10) => { const t10 = this._styleRepository, i6 = t10.getLayerById(e10.layer); if (!i6) return; const s5 = m2(i6.layout, e10.layout); if (!t(s5)) { if (a2(s5, "visibility") && b2(s5) === 1) return t10.setLayoutProperties(e10.layer, e10.layout), i6.type === a3.SYMBOL && this._vectorTileContainer.restartDeclutter(), void this._vectorTileContainer.requestRender(); this._styleChanges.push({ type: L.LAYOUT_CHANGED, data: e10 }), this.notifyChange("updating"), this.requestUpdate(); } }), this.layer.on("style-layer-visibility-change", (e10) => { const t10 = this._styleRepository, i6 = t10.getLayerById(e10.layer); i6 && (t10.setStyleLayerVisibility(e10.layer, e10.visibility), i6.type === a3.SYMBOL && this._vectorTileContainer.restartDeclutter(), this._vectorTileContainer.requestRender()); }), this.layer.on("style-layer-change", (e10) => { this._styleChanges.push({ type: L.LAYER_CHANGED, data: e10 }), this.notifyChange("updating"), this.requestUpdate(); }), this.layer.on("delete-style-layer", (e10) => { this._styleChanges.push({ type: L.LAYER_REMOVED, data: e10 }), this.notifyChange("updating"), this.requestUpdate(); }), this.layer.on("load-style", () => this._loadStyle()), this.layer.on("spriteSource-change", (e10) => { this._newSpriteSource = e10.spriteSource, this._styleChanges.push({ type: L.SPRITES_CHANGED, data: null }); const t10 = this._styleRepository.layers; for (const i6 of t10) switch (i6.type) { case a3.SYMBOL: i6.getLayoutProperty("icon-image") && this._styleChanges.push({ type: L.LAYOUT_CHANGED, data: { layer: i6.id, layout: i6.layout } }); break; case a3.LINE: i6.getPaintProperty("line-pattern") && this._styleChanges.push({ type: L.PAINTER_CHANGED, data: { layer: i6.id, paint: i6.paint, isDataDriven: i6.isPainterDataDriven() } }); break; case a3.FILL: i6.getLayoutProperty("fill-pattern") && this._styleChanges.push({ type: L.PAINTER_CHANGED, data: { layer: i6.id, paint: i6.paint, isDataDriven: i6.isPainterDataDriven() } }); } this.notifyChange("updating"), this.requestUpdate(); })], this.declaredClass); } detach() { this._stop(), this.container.removeAllChildren(), this._vectorTileContainer?.destroy(), this._vectorTileContainer = null, this._tileHandler?.destroy(), this._tileHandler = null, this.handles.remove(this.declaredClass); } moveStart() { this.requestUpdate(); } viewChange() { this.requestUpdate(); } moveEnd() { this._collisionBoxesDisplay && this._vectorTileContainer.restartDeclutter(), this.requestUpdate(); } supportsSpatialReference(e9) { return E2(this.layer.tileInfo?.spatialReference, e9); } canResume() { let e9 = super.canResume(); const { currentStyleInfo: t10 } = this.layer; if (e9 && t10?.layerDefinition) { const i6 = this.view.scale, { minScale: s5, maxScale: r10 } = t10.layerDefinition; t10 && t10.layerDefinition && (s5 && s5 < i6 && (e9 = false), r10 && r10 > i6 && (e9 = false)); } return e9; } isUpdating() { const e9 = this._vectorTileContainer.children; return !this._isTileHandlerReady || !this._fetchQueue || !this._parseQueue || this._fetchQueue.updating || this._parseQueue.updating || e9.length > 0 && e9.some((e10) => e10.invalidating) || this.fading; } acquireTile(e9) { const t10 = this._createVectorTile(e9); return this._tileHandlerPromise.then(() => { this._fetchQueue.push(t10.key).then((e10) => this._parseQueue.push({ key: t10.key, data: e10 })).then((e10) => { t10.once("attach", () => this.requestUpdate()), t10.setData(e10), this.requestUpdate(), this.notifyChange("updating"); }).catch((e10) => { this.notifyChange("updating"), g(e10) || Q.error(e10); }); }), t10; } releaseTile(e9) { const t10 = e9.key.id; this._fetchQueue.abort(t10), this._parseQueue.abort(t10), this.requestUpdate(); } _start() { if (this._stop(), this._tileManager = new a5({ acquireTile: (e10) => this.acquireTile(e10), releaseTile: (e10) => this.releaseTile(e10), tileInfoView: this._tileInfoView }, this._vectorTileContainer), !this.layer.currentStyleInfo) return; const e9 = new AbortController(), t10 = this._tileHandler.start({ signal: e9.signal }).then(() => { this._fetchQueue = new p({ tileInfoView: this._tileInfoView, process: (e10, t11) => this._getTileData(e10, t11), concurrency: 15 }), this._parseQueue = new p({ tileInfoView: this._tileInfoView, process: (e10, t11) => this._parseTileData(e10, t11), concurrency: 8 }), this.requestUpdate(), this._isTileHandlerReady = true; }); this._tileHandler.spriteMosaic.then((e10) => { this._vectorTileContainer.setStyleResources(e10, this._tileHandler.glyphMosaic, this._styleRepository), this.requestUpdate(); }), this._tileHandlerAbortController = e9, this._tileHandlerPromise = t10; } _stop() { if (!this._tileHandlerAbortController || !this._vectorTileContainer) return; const e9 = this._tileHandlerAbortController; e9 && e9.abort(), this._tileHandlerPromise = null, this._isTileHandlerReady = false, this._fetchQueue && (this._fetchQueue.destroy(), this._fetchQueue = null), this._parseQueue && (this._parseQueue.destroy(), this._parseQueue = null), this._tileManager && (this._tileManager.destroy(), this._tileManager = null), this._vectorTileContainer.removeAllChildren(); } async _getTileData(e9, t10) { const i6 = await this._tileHandler.fetchTileData(e9, t10); return this.notifyChange("updating"), i6; } async _parseTileData(e9, t10) { return this._tileHandler.parseTileData(e9, t10); } async _applyStyleChanges() { this._isTileHandlerReady = false, this._fetchQueue.pause(), this._parseQueue.pause(), this._fetchQueue.clear(), this._parseQueue.clear(), this._tileManager.clearCache(); const e9 = this._styleChanges; try { await this._tileHandler.updateStyle(e9); } catch (l9) { Q.error("error applying vector-tiles style update", l9.message), this._fetchQueue.resume(), this._parseQueue.resume(), this._isTileHandlerReady = true; } const t10 = this._styleRepository, i6 = []; e9.forEach((e10) => { if (e10.type !== L.LAYER_REMOVED) return; const s6 = e10.data, r11 = t10.getLayerById(s6.layer); r11 && i6.push(r11.uid); }); const s5 = []; let r10; e9.forEach((e10) => { const i7 = e10.type, a9 = e10.data; switch (i7) { case L.PAINTER_CHANGED: t10.setPaintProperties(a9.layer, a9.paint), r10 = a9.layer; break; case L.LAYOUT_CHANGED: t10.setLayoutProperties(a9.layer, a9.layout), r10 = a9.layer; break; case L.LAYER_REMOVED: return void t10.deleteStyleLayer(a9.layer); case L.LAYER_CHANGED: t10.setStyleLayer(a9.layer, a9.index), r10 = a9.layer.id; break; case L.SPRITES_CHANGED: this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(this._newSpriteSource)), this._newSpriteSource = null, r10 = null; } const l9 = t10.getLayerById(r10); l9 && s5.push(l9.uid); }); const a8 = this._vectorTileContainer.children; if (i6.length > 0) { this._vectorTileContainer.deleteStyleLayers(i6); for (const e10 of a8) e10.deleteLayerData(i6); } if (this._fetchQueue.resume(), this._parseQueue.resume(), s5.length > 0) { const e10 = []; for (const t11 of a8) { const i7 = this._fetchQueue.push(t11.key).then((e11) => this._parseQueue.push({ key: t11.key, data: e11, styleLayerUIDs: s5 })).then((e11) => t11.setData(e11)); e10.push(i7); } await Promise.all(e10); } this._styleChanges = [], this._isTileHandlerReady = true, this.notifyChange("updating"), this.requestUpdate(); } async _loadStyle() { const { style: e9 } = this.layer.currentStyleInfo, t10 = m(e9); this._isTileHandlerReady = false, this._fetchQueue.pause(), this._parseQueue.pause(), this._fetchQueue.clear(), this._parseQueue.clear(), this.notifyChange("updating"), this._styleRepository = new l4(t10), this._vectorTileContainer.destroy(), this._tileManager.clear(), this._tileHandlerAbortController.abort(), this._tileHandlerAbortController = new AbortController(); const { signal: s5 } = this._tileHandlerAbortController; try { this._tileHandlerPromise = this._tileHandler.setStyle(this._styleRepository, t10), await this._tileHandlerPromise; } catch (l9) { if (!g(l9)) throw l9; } if (s5.aborted) return this._fetchQueue.resume(), this._parseQueue.resume(), this._isTileHandlerReady = true, this.notifyChange("updating"), void this.requestUpdate(); const r10 = await this._tileHandler.spriteMosaic; this._vectorTileContainer.setStyleResources(r10, this._tileHandler.glyphMosaic, this._styleRepository), this._fetchQueue.resume(), this._parseQueue.resume(), this._isTileHandlerReady = true, this.notifyChange("updating"), this.requestUpdate(); } _createVectorTile(e9) { const t10 = this._tileInfoView.getTileBounds(u(), e9); return new m3(e9, t10[0], t10[3], 512, 512, this._styleRepository); } _renderCollisionBoxes(e9) { for (const t10 of this._vectorTileContainer.children) if (t10.symbols) { const i6 = []; for (const [e10, s5] of t10.symbols) i6.push(...s5); o3(e9, i6); } } }; function b2(e9) { if (t(e9)) return 0; switch (e9.type) { case "partial": return Object.keys(e9.diff).length; case "complete": return Math.max(Object.keys(e9.oldValue).length, Object.keys(e9.newValue).length); case "collection": return Object.keys(e9.added).length + Object.keys(e9.changed).length + Object.keys(e9.removed).length; } } e([d()], L2.prototype, "_fetchQueue", void 0), e([d()], L2.prototype, "_parseQueue", void 0), e([d()], L2.prototype, "_isTileHandlerReady", void 0), e([d()], L2.prototype, "fading", void 0), L2 = e([n("esri.views.2d.layers.VectorTileLayerView2D")], L2); var I4 = L2; export { I4 as default }; //# sourceMappingURL=VectorTileLayerView2D-ZRZJKYDW.js.map