VectorTileLayerView2D-ZRZJKYDW.js 92 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137
  1. import {
  2. o,
  3. r as r5
  4. } from "./chunk-6G6XHVK2.js";
  5. import {
  6. t as t4
  7. } from "./chunk-JFHGSU33.js";
  8. import {
  9. v
  10. } from "./chunk-TWB5CT7V.js";
  11. import "./chunk-H3QCF24A.js";
  12. import {
  13. f as f3,
  14. u as u4
  15. } from "./chunk-MNZXIBJ7.js";
  16. import "./chunk-YJKEIUMW.js";
  17. import "./chunk-JH3PLIM6.js";
  18. import {
  19. c as c2,
  20. e as e5,
  21. t as t3
  22. } from "./chunk-FCDUTNBY.js";
  23. import {
  24. ee
  25. } from "./chunk-MWIFVNKP.js";
  26. import "./chunk-LL6JU3GU.js";
  27. import {
  28. t as t2
  29. } from "./chunk-LSDW2622.js";
  30. import "./chunk-ZIWBDWEW.js";
  31. import "./chunk-IQNZZCQJ.js";
  32. import "./chunk-Q4LKAPDF.js";
  33. import "./chunk-TODU7HVH.js";
  34. import {
  35. I as I2
  36. } from "./chunk-23ONSYIH.js";
  37. import {
  38. l as l4
  39. } from "./chunk-Y4YDGLMZ.js";
  40. import {
  41. I as I3,
  42. L
  43. } from "./chunk-VGSBB3MM.js";
  44. import {
  45. a as a3,
  46. i,
  47. l as l3,
  48. n as n3,
  49. r as r3
  50. } from "./chunk-3T4BXU2T.js";
  51. import "./chunk-SRMDO2KR.js";
  52. import "./chunk-PZKZIMMP.js";
  53. import "./chunk-YLVXZ2PS.js";
  54. import "./chunk-EE6TL7XD.js";
  55. import {
  56. c,
  57. f as f2
  58. } from "./chunk-GDB2KX4Y.js";
  59. import {
  60. u as u2
  61. } from "./chunk-546QCRS4.js";
  62. import "./chunk-QXZVBSBH.js";
  63. import "./chunk-773XI6MQ.js";
  64. import "./chunk-WFSV2B2I.js";
  65. import "./chunk-J525NRN3.js";
  66. import {
  67. D as D2,
  68. F,
  69. G,
  70. I,
  71. O,
  72. P,
  73. R
  74. } from "./chunk-MI7HWWFL.js";
  75. import {
  76. e as e6,
  77. r as r4
  78. } from "./chunk-ZHRMTKME.js";
  79. import {
  80. p
  81. } from "./chunk-CAYFEZCR.js";
  82. import "./chunk-MFFE4I2S.js";
  83. import "./chunk-XBH7TGC2.js";
  84. import "./chunk-K3NA3LQS.js";
  85. import "./chunk-LMCIAW5S.js";
  86. import {
  87. h as h3
  88. } from "./chunk-OTS3UE5B.js";
  89. import {
  90. l as l2
  91. } from "./chunk-6RAL4JPQ.js";
  92. import "./chunk-EZZVK4K6.js";
  93. import "./chunk-TRK7CKWP.js";
  94. import "./chunk-EGVIPYN2.js";
  95. import "./chunk-LGW7TID4.js";
  96. import {
  97. u as u3
  98. } from "./chunk-VEAEIBHK.js";
  99. import "./chunk-6SASJ6IM.js";
  100. import "./chunk-3OHML7FO.js";
  101. import "./chunk-G5AI6ZNE.js";
  102. import {
  103. a
  104. } from "./chunk-PK35UGFJ.js";
  105. import {
  106. e as e3
  107. } from "./chunk-FIYKFRB2.js";
  108. import "./chunk-FYNVVMWY.js";
  109. import "./chunk-Q52DVFYK.js";
  110. import "./chunk-HBMVUVZX.js";
  111. import {
  112. M,
  113. f,
  114. h as h2,
  115. r as r2
  116. } from "./chunk-CRGVDJI6.js";
  117. import "./chunk-6P6NA7JB.js";
  118. import "./chunk-2SJEIKRW.js";
  119. import "./chunk-PHRSJJ3U.js";
  120. import {
  121. e as e4
  122. } from "./chunk-FTI5VP6T.js";
  123. import {
  124. g as g2
  125. } from "./chunk-RZFGRBD7.js";
  126. import "./chunk-PUSPZYFZ.js";
  127. import "./chunk-EN7YGJWG.js";
  128. import "./chunk-VBNMTM7L.js";
  129. import "./chunk-3D3QEPRE.js";
  130. import "./chunk-JFNNSBWL.js";
  131. import {
  132. a as a2,
  133. m as m2
  134. } from "./chunk-LY74KTXV.js";
  135. import "./chunk-522WBHUO.js";
  136. import "./chunk-WNCU6BFU.js";
  137. import "./chunk-PIGRDDRG.js";
  138. import "./chunk-XLV7RUSE.js";
  139. import "./chunk-NTUXR253.js";
  140. import "./chunk-C43UE3Z5.js";
  141. import "./chunk-RMX2AZ4P.js";
  142. import "./chunk-NE3ESGA6.js";
  143. import {
  144. h,
  145. l
  146. } from "./chunk-YIS6BAC3.js";
  147. import "./chunk-7XXXCK2A.js";
  148. import "./chunk-7ZIDBK7B.js";
  149. import "./chunk-65BYCSII.js";
  150. import "./chunk-WZQZRKNH.js";
  151. import "./chunk-LRDX4TO7.js";
  152. import "./chunk-6A4U74YA.js";
  153. import {
  154. S
  155. } from "./chunk-RBZL6SRZ.js";
  156. import "./chunk-WJW5DUN6.js";
  157. import "./chunk-PJ7ZQ4VD.js";
  158. import "./chunk-WDLTDV2L.js";
  159. import "./chunk-TERAW6FT.js";
  160. import {
  161. u
  162. } from "./chunk-N2663GRX.js";
  163. import "./chunk-O4FY3ITT.js";
  164. import "./chunk-WEMIK25H.js";
  165. import "./chunk-7N4X6GF3.js";
  166. import "./chunk-JXW4QTJA.js";
  167. import "./chunk-UXF37FQ4.js";
  168. import "./chunk-ZOEK6QHJ.js";
  169. import "./chunk-XNLG7T2T.js";
  170. import "./chunk-IR4PV7VK.js";
  171. import "./chunk-2Z6LERTI.js";
  172. import "./chunk-OWVBLVP3.js";
  173. import "./chunk-AFZ7XSEW.js";
  174. import "./chunk-4NKD334K.js";
  175. import "./chunk-65K7LC56.js";
  176. import "./chunk-ATPLLI5W.js";
  177. import "./chunk-MXB2XLKV.js";
  178. import "./chunk-XH7RUGVZ.js";
  179. import "./chunk-TBBTRX4O.js";
  180. import "./chunk-YBSUITLL.js";
  181. import "./chunk-ALDCDSPV.js";
  182. import {
  183. n as n2
  184. } from "./chunk-DT6EAZQ5.js";
  185. import "./chunk-HNOZUNJ4.js";
  186. import {
  187. U
  188. } from "./chunk-VNFRAYHO.js";
  189. import "./chunk-R5IG2D6H.js";
  190. import {
  191. Bt
  192. } from "./chunk-VBRY5KJM.js";
  193. import "./chunk-PDKDCAAD.js";
  194. import "./chunk-ECW2QABR.js";
  195. import "./chunk-GCDJLKH4.js";
  196. import {
  197. E as E2
  198. } from "./chunk-MRJEICT6.js";
  199. import {
  200. d,
  201. e,
  202. n2 as n
  203. } from "./chunk-Y3WMVFTW.js";
  204. import "./chunk-SAS7RONY.js";
  205. import "./chunk-WSRBH7BF.js";
  206. import "./chunk-IHXECKQQ.js";
  207. import {
  208. D,
  209. E,
  210. g
  211. } from "./chunk-ULGDPLM2.js";
  212. import {
  213. s
  214. } from "./chunk-EMJ4ZSM2.js";
  215. import {
  216. m
  217. } from "./chunk-IKP3YN53.js";
  218. import {
  219. e as e2,
  220. r,
  221. t
  222. } from "./chunk-GZT4BVFP.js";
  223. import "./chunk-A5ICIBVI.js";
  224. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/RectangleBinPack.js
  225. var e7 = class {
  226. constructor(e9, t10) {
  227. this._width = 0, this._height = 0, this._free = [], this._width = e9, this._height = t10, this._free.push(new t2(0, 0, e9, t10));
  228. }
  229. get width() {
  230. return this._width;
  231. }
  232. get height() {
  233. return this._height;
  234. }
  235. allocate(e9, t10) {
  236. if (e9 > this._width || t10 > this._height)
  237. return new t2();
  238. let i6 = null, s5 = -1;
  239. for (let h7 = 0; h7 < this._free.length; ++h7) {
  240. const w = this._free[h7];
  241. e9 <= w.width && t10 <= w.height && (i6 === null || w.y <= i6.y && w.x <= i6.x) && (i6 = w, s5 = h7);
  242. }
  243. 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));
  244. }
  245. release(h7) {
  246. for (let e9 = 0; e9 < this._free.length; ++e9) {
  247. const t10 = this._free[e9];
  248. if (t10.y === h7.y && t10.height === h7.height && t10.x + t10.width === h7.x)
  249. t10.width += h7.width;
  250. else if (t10.x === h7.x && t10.width === h7.width && t10.y + t10.height === h7.y)
  251. t10.height += h7.height;
  252. else if (h7.y === t10.y && h7.height === t10.height && h7.x + h7.width === t10.x)
  253. t10.x = h7.x, t10.width += h7.width;
  254. else {
  255. if (h7.x !== t10.x || h7.width !== t10.width || h7.y + h7.height !== t10.y)
  256. continue;
  257. t10.y = h7.y, t10.height += h7.height;
  258. }
  259. this._free.splice(e9, 1), this.release(h7);
  260. }
  261. this._free.push(h7);
  262. }
  263. };
  264. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/GlyphMosaic.js
  265. var r6 = class {
  266. constructor(e9, i6, s5) {
  267. 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);
  268. }
  269. getGlyphItems(i6, s5) {
  270. const h7 = [], r10 = this._glyphSource, n8 = new Set(), a8 = 1 / 256;
  271. for (const t10 of s5) {
  272. const e9 = Math.floor(t10 * a8);
  273. n8.add(e9);
  274. }
  275. const o6 = [];
  276. return n8.forEach((t10) => {
  277. if (t10 <= 256) {
  278. const e9 = i6 + t10;
  279. if (this._rangePromises.has(e9))
  280. o6.push(this._rangePromises.get(e9));
  281. else {
  282. const s6 = r10.getRange(i6, t10).then(() => {
  283. this._rangePromises.delete(e9);
  284. }, () => {
  285. this._rangePromises.delete(e9);
  286. });
  287. this._rangePromises.set(e9, s6), o6.push(s6);
  288. }
  289. }
  290. }), Promise.all(o6).then(() => {
  291. let n9 = this._glyphIndex[i6];
  292. n9 || (n9 = {}, this._glyphIndex[i6] = n9);
  293. for (const a9 of s5) {
  294. const s6 = n9[a9];
  295. if (s6) {
  296. h7[a9] = { sdf: true, rect: s6.rect, metrics: s6.metrics, page: s6.page, code: a9 };
  297. continue;
  298. }
  299. const o7 = r10.getGlyph(i6, a9);
  300. if (!o7 || !o7.metrics)
  301. continue;
  302. const l9 = o7.metrics;
  303. let c7;
  304. if (l9.width === 0)
  305. c7 = new t2(0, 0, 0, 0);
  306. else {
  307. const e9 = 3, i7 = l9.width + 2 * e9, s7 = l9.height + 2 * e9;
  308. let h8 = i7 % 4 ? 4 - i7 % 4 : 4, r11 = s7 % 4 ? 4 - s7 % 4 : 4;
  309. 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));
  310. const n10 = this._glyphData[this._currentPage], a10 = o7.bitmap;
  311. let g3, _4;
  312. if (a10)
  313. for (let t10 = 0; t10 < s7; t10++) {
  314. g3 = i7 * t10, _4 = this.width * (c7.y + t10 + 1) + c7.x;
  315. for (let t11 = 0; t11 < i7; t11++)
  316. n10[_4 + t11 + 1] = a10[g3 + t11];
  317. }
  318. }
  319. 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;
  320. }
  321. return h7;
  322. });
  323. }
  324. removeGlyphs(t10) {
  325. for (const e9 in this._glyphIndex) {
  326. const i6 = this._glyphIndex[e9];
  327. if (!i6)
  328. continue;
  329. let s5;
  330. for (const e10 in i6)
  331. if (s5 = i6[e10], s5.tileIDs.delete(t10), s5.tileIDs.size === 0) {
  332. const t11 = this._glyphData[s5.page], h7 = s5.rect;
  333. let r10, n8;
  334. for (let e11 = 0; e11 < h7.height; e11++)
  335. for (r10 = this.width * (h7.y + e11) + h7.x, n8 = 0; n8 < h7.width; n8++)
  336. t11[r10 + n8] = 0;
  337. delete i6[e10], this._dirties[s5.page] = true;
  338. }
  339. }
  340. }
  341. bind(t10, e9, r10, n8 = 0) {
  342. 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)));
  343. const a8 = this._textures[r10];
  344. a8.setSamplingMode(e9), this._dirties[r10] && a8.setData(this._glyphData[r10]), t10.bindTexture(a8, n8), this._dirties[r10] = false;
  345. }
  346. dispose() {
  347. this._binPack = null;
  348. for (const t10 of this._textures)
  349. t10 && t10.dispose();
  350. this._textures.length = 0;
  351. }
  352. };
  353. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/GlyphSource.js
  354. var s2 = class {
  355. constructor(e9) {
  356. if (this._metrics = [], this._bitmaps = [], e9)
  357. for (; e9.next(); )
  358. switch (e9.tag()) {
  359. case 1: {
  360. const t10 = e9.getMessage();
  361. for (; t10.next(); )
  362. switch (t10.tag()) {
  363. case 3: {
  364. const e10 = t10.getMessage();
  365. let s5, a8, r10, n8, i6, c7, g3;
  366. for (; e10.next(); )
  367. switch (e10.tag()) {
  368. case 1:
  369. s5 = e10.getUInt32();
  370. break;
  371. case 2:
  372. a8 = e10.getBytes();
  373. break;
  374. case 3:
  375. r10 = e10.getUInt32();
  376. break;
  377. case 4:
  378. n8 = e10.getUInt32();
  379. break;
  380. case 5:
  381. i6 = e10.getSInt32();
  382. break;
  383. case 6:
  384. c7 = e10.getSInt32();
  385. break;
  386. case 7:
  387. g3 = e10.getUInt32();
  388. break;
  389. default:
  390. e10.skip();
  391. }
  392. e10.release(), s5 && (this._metrics[s5] = { width: r10, height: n8, left: i6, top: c7, advance: g3 }, this._bitmaps[s5] = a8);
  393. break;
  394. }
  395. default:
  396. t10.skip();
  397. }
  398. t10.release();
  399. break;
  400. }
  401. default:
  402. e9.skip();
  403. }
  404. }
  405. getMetrics(e9) {
  406. return this._metrics[e9];
  407. }
  408. getBitmap(e9) {
  409. return this._bitmaps[e9];
  410. }
  411. };
  412. var a4 = class {
  413. constructor() {
  414. this._ranges = [];
  415. }
  416. getRange(e9) {
  417. return this._ranges[e9];
  418. }
  419. addRange(e9, t10) {
  420. this._ranges[e9] = t10;
  421. }
  422. };
  423. var r7 = class {
  424. constructor(e9) {
  425. this._glyphInfo = {}, this._baseURL = e9;
  426. }
  427. getRange(a8, r10) {
  428. const n8 = this._getFontStack(a8);
  429. if (n8.getRange(r10))
  430. return Promise.resolve();
  431. const i6 = 256 * r10, c7 = i6 + 255;
  432. if (this._baseURL) {
  433. const g3 = this._baseURL.replace("{fontstack}", a8).replace("{range}", i6 + "-" + c7);
  434. return U(g3, { responseType: "array-buffer" }).then((e9) => {
  435. n8.addRange(r10, new s2(new a(new Uint8Array(e9.data), new DataView(e9.data))));
  436. }).catch(() => {
  437. n8.addRange(r10, new s2());
  438. });
  439. }
  440. return n8.addRange(r10, new s2()), Promise.resolve();
  441. }
  442. getGlyph(e9, t10) {
  443. const s5 = this._getFontStack(e9);
  444. if (!s5)
  445. return;
  446. const a8 = Math.floor(t10 / 256);
  447. if (a8 > 256)
  448. return;
  449. const r10 = s5.getRange(a8);
  450. return r10 ? { metrics: r10.getMetrics(t10), bitmap: r10.getBitmap(t10) } : void 0;
  451. }
  452. _getFontStack(e9) {
  453. let t10 = this._glyphInfo[e9];
  454. return t10 || (t10 = this._glyphInfo[e9] = new a4()), t10;
  455. }
  456. };
  457. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/SpriteMosaic.js
  458. var o2 = "dasharray-";
  459. var _ = class {
  460. constructor(t10, e9, s5 = 0) {
  461. 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);
  462. }
  463. dispose() {
  464. this._binPack = null, this._mosaicRects = {};
  465. for (const t10 of this._textures)
  466. t10 && t10.dispose();
  467. this._textures.length = 0;
  468. }
  469. getWidth(t10) {
  470. return t10 >= this._size.length ? -1 : this._size[t10][0];
  471. }
  472. getHeight(t10) {
  473. return t10 >= this._size.length ? -1 : this._size[t10][1];
  474. }
  475. getPageSize(t10) {
  476. return t10 >= this._size.length ? null : this._size[t10];
  477. }
  478. setSpriteSource(t10) {
  479. if (this.dispose(), this.pixelRatio = t10.devicePixelRatio, this._mosaicsData.length === 0) {
  480. this._binPack = new e7(this._pageWidth - 4, this._pageHeight - 4);
  481. const t11 = Math.floor(this._pageWidth), e9 = Math.floor(this._pageHeight), s5 = new Uint32Array(t11 * e9);
  482. this._mosaicsData[0] = s5, this._dirties.push(true), this._size.push([this._pageWidth, this._pageHeight]), this._textures.push(void 0);
  483. }
  484. this._sprites = t10;
  485. }
  486. getSpriteItem(t10, i6 = false) {
  487. let e9, s5, h7 = this._mosaicRects[t10];
  488. if (h7)
  489. return h7;
  490. if (!this._sprites || this._sprites.loadStatus !== "loaded")
  491. return null;
  492. 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)
  493. return null;
  494. const a8 = e9.width, r10 = e9.height, [_4, n8, g3] = this._allocateImage(a8, r10);
  495. 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);
  496. }
  497. getSpriteItems(t10) {
  498. const i6 = {};
  499. for (const e9 of t10)
  500. i6[e9.name] = this.getSpriteItem(e9.name, e9.repeat);
  501. return i6;
  502. }
  503. getMosaicItemPosition(t10, i6) {
  504. const e9 = this.getSpriteItem(t10, i6), s5 = e9 && e9.rect;
  505. if (!s5)
  506. return null;
  507. s5.width = e9.width, s5.height = e9.height;
  508. const h7 = e9.width, a8 = e9.height, r10 = 2;
  509. return { tl: [s5.x + r10, s5.y + r10], br: [s5.x + r10 + h7, s5.y + r10 + a8], page: e9.page };
  510. }
  511. bind(t10, i6, e9 = 0, o6 = 0) {
  512. 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)));
  513. const _4 = this._textures[e9];
  514. _4.setSamplingMode(i6), this._dirties[e9] && _4.setData(new Uint8Array(this._mosaicsData[e9].buffer)), t10.bindTexture(_4, o6), this._dirties[e9] = false;
  515. }
  516. static _copyBits(t10, i6, e9, s5, h7, a8, r10, o6, _4, n8, g3) {
  517. let p2 = s5 * i6 + e9, c7 = o6 * a8 + r10;
  518. if (g3) {
  519. c7 -= a8;
  520. for (let r11 = -1; r11 <= n8; r11++, p2 = ((r11 + n8) % n8 + s5) * i6 + e9, c7 += a8)
  521. for (let i7 = -1; i7 <= _4; i7++)
  522. h7[c7 + i7] = t10[p2 + (i7 + _4) % _4];
  523. } else
  524. for (let l9 = 0; l9 < n8; l9++) {
  525. for (let i7 = 0; i7 < _4; i7++)
  526. h7[c7 + i7] = t10[p2 + i7];
  527. p2 += i6, c7 += a8;
  528. }
  529. }
  530. _copy(t10, i6, e9, s5, h7, a8) {
  531. if (!this._sprites || this._sprites.loadStatus !== "loaded" || e9 >= this._mosaicsData.length)
  532. return;
  533. const r10 = new Uint32Array(a8 ? a8.buffer : this._sprites.image.buffer), o6 = this._mosaicsData[e9];
  534. o6 && r10 || console.error("Source or target images are uninitialized!");
  535. const n8 = 2, g3 = a8 ? i6.width : this._sprites.width;
  536. _._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;
  537. }
  538. _allocateImage(t10, s5) {
  539. t10 += 2, s5 += 2;
  540. const h7 = Math.max(t10, s5);
  541. if (this._maxItemSize && this._maxItemSize < h7) {
  542. const i6 = new t2(0, 0, t10, s5);
  543. 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]];
  544. }
  545. let a8 = t10 % 4 ? 4 - t10 % 4 : 4, r10 = s5 % 4 ? 4 - s5 % 4 : 4;
  546. a8 === 1 && (a8 = 5), r10 === 1 && (r10 = 5);
  547. const o6 = this._binPack.allocate(t10 + a8, s5 + r10);
  548. 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]];
  549. }
  550. _rasterizeDash(i6) {
  551. const e9 = /\[(.*?)\]/, s5 = i6.match(e9);
  552. if (!s5)
  553. return null;
  554. const h7 = s5[1].split(",").map(Number), a8 = i6.slice(i6.lastIndexOf("-") + 1), [r10, o6, _4] = ee.rasterizeDash(h7, a8);
  555. return [{ x: 0, y: 0, width: o6, height: _4, sdf: true, pixelRatio: 1 }, new Uint8Array(r10.buffer)];
  556. }
  557. };
  558. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/debugging.js
  559. function t5(t10, e9, n8, o6, l9, i6) {
  560. t10.fillStyle = e9, t10.fillRect(n8, o6, l9, i6);
  561. }
  562. function e8(t10, e9, n8, o6, l9, i6) {
  563. t10.strokeStyle = e9, t10.strokeRect(n8, o6, l9, i6);
  564. }
  565. function o3(n8, o6) {
  566. const l9 = window.COLLISION_XRAY;
  567. for (let i6 = 0; i6 < o6.length; ++i6) {
  568. const r10 = !o6[i6].unique.show;
  569. if (l9 || !r10)
  570. for (const s5 of o6[i6].colliders) {
  571. if (!s5.enabled)
  572. continue;
  573. const d2 = !o6[i6].unique.parts[s5.partIndex].show;
  574. if (!l9 && d2)
  575. continue;
  576. const a8 = s5.xScreen, c7 = s5.yScreen, m5 = s5.dxScreen, h7 = s5.dyScreen;
  577. 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;
  578. }
  579. }
  580. }
  581. function l5(t10, e9, n8) {
  582. if (!window.PERFORMANCE_RECORDING_STORAGE)
  583. return;
  584. const o6 = window.PERFORMANCE_RECORDING_STORAGE;
  585. o6.perf = o6.perf || {};
  586. const l9 = o6.perf;
  587. 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);
  588. }
  589. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/TileHandler.js
  590. var c3 = class {
  591. constructor(e9, t10, s5) {
  592. this._layer = e9, this._styleRepository = t10, this.devicePixelRatio = s5, this._spriteMosaic = null, this._glyphMosaic = null, this._connection = null;
  593. }
  594. destroy() {
  595. this._connection && (this._connection.close(), this._connection = null), this._styleRepository = null, this._layer = null, this._spriteMosaic && (this._spriteMosaic = null), this._glyphMosaic && (this._glyphMosaic = null);
  596. }
  597. get spriteMosaic() {
  598. return this._spriteSourcePromise.then(() => this._spriteMosaic);
  599. }
  600. get glyphMosaic() {
  601. return this._glyphMosaic;
  602. }
  603. async start(e9) {
  604. this._spriteSourcePromise = this._layer.loadSpriteSource(this.devicePixelRatio, e9), this._spriteSourcePromise.then((e10) => {
  605. this._spriteMosaic = new _(1024, 1024, 250), this._spriteMosaic.setSpriteSource(e10);
  606. });
  607. const t10 = new r7(this._layer.currentStyleInfo.glyphsUrl ? Bt(this._layer.currentStyleInfo.glyphsUrl, { ...this._layer.customParameters, token: this._layer.apiKey }) : null);
  608. this._glyphMosaic = new r6(1024, 1024, t10), this._broadcastPromise = u3("WorkerTileHandler", { client: this, schedule: e9.schedule, signal: e9.signal }).then((t11) => {
  609. this._connection = t11, this._connection.broadcast("setStyle", this._layer.currentStyleInfo.style, e9);
  610. });
  611. }
  612. async updateStyle(e9) {
  613. return await this._broadcastPromise, this._broadcastPromise = Promise.all(this._connection.broadcast("updateStyle", e9)), this._broadcastPromise;
  614. }
  615. setSpriteSource(e9) {
  616. const t10 = new _(1024, 1024, 250);
  617. return t10.setSpriteSource(e9), this._spriteMosaic = t10, this._spriteSourcePromise = Promise.resolve(e9), t10;
  618. }
  619. async setStyle(e9, t10) {
  620. await this._broadcastPromise, this._styleRepository = e9, this._spriteSourcePromise = this._layer.loadSpriteSource(this.devicePixelRatio, null), this._spriteSourcePromise.then((e10) => {
  621. this._spriteMosaic = new _(1024, 1024, 250), this._spriteMosaic.setSpriteSource(e10);
  622. });
  623. const r10 = new r7(this._layer.currentStyleInfo.glyphsUrl ? Bt(this._layer.currentStyleInfo.glyphsUrl, { ...this._layer.customParameters, token: this._layer.apiKey }) : null);
  624. return this._glyphMosaic = new r6(1024, 1024, r10), this._broadcastPromise = Promise.all(this._connection.broadcast("setStyle", t10)), this._broadcastPromise;
  625. }
  626. fetchTileData(e9, t10) {
  627. return this._getRefKeys(e9, t10).then((e10) => {
  628. const s5 = this._layer.sourceNameToSource, r10 = [];
  629. for (const t11 in s5)
  630. r10.push(t11);
  631. return this._getSourcesData(r10, e10, t10);
  632. });
  633. }
  634. parseTileData(e9, t10) {
  635. const s5 = e9 && e9.data;
  636. if (!s5)
  637. return Promise.resolve(null);
  638. const { sourceName2DataAndRefKey: r10, transferList: i6 } = s5;
  639. 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 }));
  640. }
  641. async getSprites(e9) {
  642. return await this._spriteSourcePromise, this._spriteMosaic.getSpriteItems(e9);
  643. }
  644. getGlyphs(e9) {
  645. return this._glyphMosaic.getGlyphItems(e9.font, e9.codePoints);
  646. }
  647. perfReport({ key: e9, milliseconds: t10 }) {
  648. l5(e9, t10, "ms");
  649. }
  650. async _getTilePayload(t10, s5, r10) {
  651. const i6 = e3.pool.acquire(t10.id), o6 = this._layer.sourceNameToSource[s5], { level: l9, row: a8, col: c7 } = i6;
  652. e3.pool.release(i6);
  653. try {
  654. return { protobuff: await o6.requestTile(l9, a8, c7, r10), sourceName: s5 };
  655. } catch (h7) {
  656. if (g(h7))
  657. throw h7;
  658. return { protobuff: null, sourceName: s5 };
  659. }
  660. }
  661. _getRefKeys(e9, s5) {
  662. const r10 = this._layer.sourceNameToSource, i6 = new Array();
  663. for (const t10 in r10) {
  664. const o6 = r10[t10].getRefKey(e9, s5);
  665. i6.push(o6);
  666. }
  667. return E(i6);
  668. }
  669. _getSourcesData(e9, s5, r10) {
  670. const i6 = [];
  671. for (let t10 = 0; t10 < s5.length; t10++)
  672. if (s5[t10].value == null || e9[t10] == null)
  673. i6.push(null);
  674. else {
  675. const o6 = this._getTilePayload(s5[t10].value, e9[t10], r10);
  676. i6.push(o6);
  677. }
  678. return E(i6).then((e10) => {
  679. const t10 = {}, r11 = [];
  680. for (let i7 = 0; i7 < e10.length; i7++)
  681. if (e10[i7].value && e10[i7].value && e10[i7].value.protobuff && e10[i7].value.protobuff.byteLength > 0) {
  682. const o6 = s5[i7].value.id;
  683. t10[e10[i7].value.sourceName] = { refKey: o6, protobuff: e10[i7].value.protobuff }, r11.push(e10[i7].value.protobuff);
  684. }
  685. return { sourceName2DataAndRefKey: t10, transferList: r11 };
  686. });
  687. }
  688. };
  689. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/TileManager.js
  690. var r8 = 512;
  691. var o4 = 1e-6;
  692. var n4 = (e9, i6) => e9 + 1 / (1 << 2 * i6);
  693. var a5 = class {
  694. constructor(i6, t10) {
  695. 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;
  696. }
  697. destroy() {
  698. for (const [e9, i6] of this._tiles)
  699. i6.dispose();
  700. this._tiles = null, this._tileCache.clear(), this._tileCache = null;
  701. }
  702. update(e9) {
  703. this._updateCacheSize(e9);
  704. 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();
  705. for (const { row: s5, colFrom: _4, colTo: f5 } of r10)
  706. for (let e10 = _4; e10 <= f5; e10++) {
  707. const i7 = e3.getId(n8, s5, o6.normalizeCol(e10), o6.getWorldForColumn(e10)), t11 = this._getOrAcquireTile(i7);
  708. c7.add(i7), t11.processed() ? this._addToContainer(t11) : h7.add(new e3(i7));
  709. }
  710. for (const [s5, l9] of a8)
  711. l9.isCoverage = c7.has(s5);
  712. for (const s5 of h7)
  713. this._findPlaceholdersForMissingTiles(s5, c7);
  714. let d2 = false;
  715. for (const [s5, l9] of a8)
  716. l9.neededForCoverage = c7.has(s5), l9.neededForCoverage || l9.isHoldingForFade && i6.intersects(t10, l9.key) && c7.add(s5), l9.isFading && (d2 = true);
  717. for (const [s5, l9] of this._tiles)
  718. c7.has(s5) || this._releaseTile(s5);
  719. return l2.pool.release(t10), !d2;
  720. }
  721. clear() {
  722. this._tiles.clear(), this._tileCache.clear(), this._visibleTiles.clear();
  723. }
  724. clearCache() {
  725. this._tileCache.clear();
  726. }
  727. _findPlaceholdersForMissingTiles(e9, i6) {
  728. const t10 = [];
  729. for (const [l9, r10] of this._tiles)
  730. this._addPlaceholderChild(t10, r10, e9, i6);
  731. const s5 = t10.reduce(n4, 0);
  732. Math.abs(1 - s5) < o4 || this._addPlaceholderParent(e9.id, i6);
  733. }
  734. _addPlaceholderChild(e9, i6, t10, s5) {
  735. 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));
  736. }
  737. _addPlaceholderParent(e9, i6) {
  738. const t10 = this._tiles;
  739. let s5 = e9;
  740. for (; ; ) {
  741. if (s5 = c4(s5), !s5 || i6.has(s5))
  742. return;
  743. const e10 = t10.get(s5);
  744. if (e10 && e10.hasData())
  745. return this._addToContainer(e10), void i6.add(e10.id);
  746. }
  747. }
  748. _getOrAcquireTile(e9) {
  749. let i6 = this._tiles.get(e9);
  750. return i6 || (i6 = this._tileCache.pop(e9), i6 || (i6 = this.acquireTile(new e3(e9))), this._tiles.set(e9, i6), i6);
  751. }
  752. _releaseTile(e9) {
  753. const i6 = this._tiles.get(e9);
  754. this.releaseTile(i6), this._removeFromContainer(i6), this._tiles.delete(e9), i6.hasData() ? this._tileCache.put(e9, i6, 1) : i6.dispose();
  755. }
  756. _addToContainer(e9) {
  757. let s5;
  758. const l9 = [], r10 = this._container;
  759. if (r10.contains(e9))
  760. return;
  761. const o6 = this._visibleTiles;
  762. for (const [t10, n8] of o6)
  763. this._canConnectDirectly(e9, n8) && l9.push(n8), t(s5) && this._canConnectDirectly(n8, e9) && (s5 = n8);
  764. if (r(s5)) {
  765. for (const i6 of l9)
  766. s5.childrenTiles.delete(i6), e9.childrenTiles.add(i6), i6.parentTile = e9;
  767. s5.childrenTiles.add(e9), e9.parentTile = s5;
  768. } else
  769. for (const i6 of l9)
  770. e9.childrenTiles.add(i6), i6.parentTile = e9;
  771. o6.set(e9.id, e9), r10.addChild(e9);
  772. }
  773. _removeFromContainer(e9) {
  774. if (this._visibleTiles.delete(e9.id), this._container.removeChild(e9), r(e9.parentTile)) {
  775. e9.parentTile.childrenTiles.delete(e9);
  776. for (const i6 of e9.childrenTiles)
  777. r(e9.parentTile) && e9.parentTile.childrenTiles.add(i6);
  778. }
  779. for (const i6 of e9.childrenTiles)
  780. i6.parentTile = e9.parentTile;
  781. e9.parentTile = null, e9.childrenTiles.clear();
  782. }
  783. _canConnectDirectly(e9, i6) {
  784. const t10 = e9.key;
  785. let { level: s5, row: l9, col: r10, world: o6 } = i6.key;
  786. const n8 = this._visibleTiles;
  787. for (; s5 > 0; ) {
  788. if (s5--, l9 >>= 1, r10 >>= 1, t10.level === s5 && t10.row === l9 && t10.col === r10 && t10.world === o6)
  789. return true;
  790. if (n8.has(`${s5}/${l9}/${r10}/${o6}`))
  791. return false;
  792. }
  793. return false;
  794. }
  795. _updateCacheSize(e9) {
  796. const i6 = e9.state.size;
  797. if (i6[0] === this._viewSize[0] && i6[1] === this._viewSize[1])
  798. return;
  799. const t10 = Math.ceil(i6[0] / r8) + 1, s5 = Math.ceil(i6[1] / r8) + 1;
  800. this._viewSize[0] = i6[0], this._viewSize[1] = i6[1], this._tileCache.maxSize = 5 * t10 * s5;
  801. }
  802. };
  803. function c4(e9) {
  804. const [i6, t10, s5, l9] = e9.split("/"), r10 = parseInt(i6, 10);
  805. return r10 === 0 ? null : `${r10 - 1}/${parseInt(t10, 10) >> 1}/${parseInt(s5, 10) >> 1}/${parseInt(l9, 10)}`;
  806. }
  807. function h4(e9, i6) {
  808. const t10 = i6.level - e9.level;
  809. return e9.row === i6.row >> t10 && e9.col === i6.col >> t10 && e9.world === i6.world;
  810. }
  811. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/core.js
  812. var t6 = class {
  813. constructor(t10) {
  814. this.xTile = 0, this.yTile = 0, this.hash = 0, this.priority = 1, this.colliders = [], this.textVertexRanges = [], this.iconVertexRanges = [], this.tile = t10;
  815. }
  816. };
  817. var s3 = class {
  818. constructor() {
  819. this.tileSymbols = [], this.parts = [{ startTime: 0, startOpacity: 0, targetOpacity: 0, show: false }, { startTime: 0, startOpacity: 0, targetOpacity: 0, show: false }], this.show = false;
  820. }
  821. };
  822. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/util.js
  823. function o5(t10, e9, r10, s5, i6, l9) {
  824. const o6 = r10 - i6;
  825. if (o6 >= 0)
  826. return (e9 >> o6) + (s5 - (l9 << o6)) * (t10 >> o6);
  827. const n8 = -o6;
  828. return e9 - (l9 - (s5 << n8)) * (t10 >> n8) << n8;
  829. }
  830. var n5 = class {
  831. constructor(t10, e9, r10) {
  832. this._rows = Math.ceil(e9 / r10), this._columns = Math.ceil(t10 / r10), this._cellSize = r10, this.cells = new Array(this._rows);
  833. for (let s5 = 0; s5 < this._rows; s5++) {
  834. this.cells[s5] = new Array(this._columns);
  835. for (let t11 = 0; t11 < this._columns; t11++)
  836. this.cells[s5][t11] = [];
  837. }
  838. }
  839. getCell(t10, e9) {
  840. 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);
  841. return this.cells[r10] && this.cells[r10][s5] || null;
  842. }
  843. getCellSpan(t10, e9, r10, s5) {
  844. 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)];
  845. }
  846. get cellSize() {
  847. return this._cellSize;
  848. }
  849. get columns() {
  850. return this._columns;
  851. }
  852. get rows() {
  853. return this._rows;
  854. }
  855. };
  856. function h5(t10, e9, s5, i6, l9, o6) {
  857. const n8 = e9[i6++];
  858. for (let h7 = 0; h7 < n8; h7++) {
  859. const n9 = new t6(o6);
  860. n9.xTile = e9[i6++], n9.yTile = e9[i6++], n9.hash = e9[i6++], n9.priority = e9[i6++];
  861. const h8 = e9[i6++];
  862. for (let t11 = 0; t11 < h8; t11++) {
  863. 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++];
  864. n9.colliders.push({ xTile: t12, yTile: r10, dxPixels: l10, dyPixels: o7, hard: h9, partIndex: a9, width: p2, height: u7, minLod: c8, maxLod: d2 });
  865. }
  866. const a8 = t10[i6++];
  867. for (let e10 = 0; e10 < a8; e10++)
  868. n9.textVertexRanges.push([t10[i6++], t10[i6++]]);
  869. const c7 = t10[i6++];
  870. for (let e10 = 0; e10 < c7; e10++)
  871. n9.iconVertexRanges.push([t10[i6++], t10[i6++]]);
  872. l9.push(n9);
  873. }
  874. return i6;
  875. }
  876. function a6(t10, e9, r10) {
  877. for (const [s5, i6] of t10.symbols)
  878. c5(t10, e9, r10, i6, s5);
  879. }
  880. function c5(t10, r10, s5, i6, l9) {
  881. const o6 = t10.layerData.get(l9);
  882. if (o6.type === I3.SYMBOL) {
  883. for (const e9 of i6) {
  884. const r11 = e9.unique;
  885. let i7;
  886. if (e9.selectedForRendering) {
  887. const e10 = r11.parts[0], l10 = e10.startOpacity, o7 = e10.targetOpacity;
  888. t10.allSymbolsFadingOut = t10.allSymbolsFadingOut && o7 === 0;
  889. const n8 = s5 ? Math.floor(127 * l10) | o7 << 7 : o7 ? 255 : 0;
  890. i7 = n8 << 24 | n8 << 16 | n8 << 8 | n8;
  891. } else
  892. i7 = 0;
  893. for (const [t11, s6] of e9.iconVertexRanges)
  894. for (let e10 = t11; e10 < t11 + s6; e10 += 4)
  895. o6.iconOpacity[e10 / 4] = i7;
  896. if (e9.selectedForRendering) {
  897. const e10 = r11.parts[1], l10 = e10.startOpacity, o7 = e10.targetOpacity;
  898. t10.allSymbolsFadingOut = t10.allSymbolsFadingOut && o7 === 0;
  899. const n8 = s5 ? Math.floor(127 * l10) | o7 << 7 : o7 ? 255 : 0;
  900. i7 = n8 << 24 | n8 << 16 | n8 << 8 | n8;
  901. } else
  902. i7 = 0;
  903. for (const [t11, s6] of e9.textVertexRanges)
  904. for (let e10 = t11; e10 < t11 + s6; e10 += 4)
  905. o6.textOpacity[e10 / 4] = i7;
  906. }
  907. o6.lastOpacityUpdate = r10, o6.opacityChanged = true;
  908. }
  909. }
  910. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/RenderBucket.js
  911. var a7 = class {
  912. constructor(e9, t10) {
  913. this.layerUIDs = [], this.isDestroyed = false, this.data = e9, this.memoryUsed = e9.byteLength;
  914. let r10 = 1;
  915. const i6 = new Uint32Array(e9);
  916. this.layerUIDs = [];
  917. const s5 = i6[r10++];
  918. for (let n8 = 0; n8 < s5; n8++)
  919. this.layerUIDs[n8] = i6[r10++];
  920. this.bufferDataOffset = r10, t10 && (this.layer = t10.getStyleLayerByUID(this.layerUIDs[0]));
  921. }
  922. get isPreparedForRendering() {
  923. return t(this.data);
  924. }
  925. get offset() {
  926. return this.bufferDataOffset;
  927. }
  928. destroy() {
  929. this.isDestroyed || (this.doDestroy(), this.isDestroyed = true);
  930. }
  931. prepareForRendering(t10) {
  932. t(this.data) || (this.doPrepareForRendering(t10, this.data, this.bufferDataOffset), this.data = null);
  933. }
  934. };
  935. var l6 = class extends a7 {
  936. constructor(e9, t10) {
  937. super(e9, t10), this.type = I3.LINE, this.lineIndexStart = 0, this.lineIndexCount = 0;
  938. const r10 = new Uint32Array(e9);
  939. let s5 = this.bufferDataOffset;
  940. this.lineIndexStart = r10[s5++], this.lineIndexCount = r10[s5++];
  941. const n8 = r10[s5++];
  942. if (n8 > 0) {
  943. const e10 = new Map();
  944. for (let t11 = 0; t11 < n8; t11++) {
  945. const t12 = r10[s5++], i6 = r10[s5++], n9 = r10[s5++];
  946. e10.set(t12, [i6, n9]);
  947. }
  948. this.patternMap = e10;
  949. }
  950. this.bufferDataOffset = s5;
  951. }
  952. hasData() {
  953. return this.lineIndexCount > 0;
  954. }
  955. triangleCount() {
  956. return this.lineIndexCount / 3;
  957. }
  958. doDestroy() {
  959. 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;
  960. }
  961. doPrepareForRendering(e9, t10, r10) {
  962. const i6 = new Uint32Array(t10), s5 = new Int32Array(i6.buffer), a8 = i6[r10++];
  963. this.lineVertexBuffer = c.createVertex(e9, F.STATIC_DRAW, new Int32Array(s5.buffer, 4 * r10, a8)), r10 += a8;
  964. const l9 = i6[r10++];
  965. this.lineIndexBuffer = c.createIndex(e9, F.STATIC_DRAW, new Uint32Array(i6.buffer, 4 * r10, l9)), r10 += l9;
  966. const u7 = this.layer.lineMaterial;
  967. this.lineVertexArrayObject = new f2(e9, u7.getAttributeLocations(), u7.getLayoutInfo(), { geometry: this.lineVertexBuffer }, this.lineIndexBuffer);
  968. }
  969. };
  970. var u5 = class extends a7 {
  971. constructor(e9, t10) {
  972. super(e9, t10), this.type = I3.FILL, this.fillIndexStart = 0, this.fillIndexCount = 0, this.outlineIndexStart = 0, this.outlineIndexCount = 0;
  973. const r10 = new Uint32Array(e9);
  974. let s5 = this.bufferDataOffset;
  975. this.fillIndexStart = r10[s5++], this.fillIndexCount = r10[s5++], this.outlineIndexStart = r10[s5++], this.outlineIndexCount = r10[s5++];
  976. const n8 = r10[s5++];
  977. if (n8 > 0) {
  978. const e10 = new Map();
  979. for (let t11 = 0; t11 < n8; t11++) {
  980. const t12 = r10[s5++], i6 = r10[s5++], n9 = r10[s5++];
  981. e10.set(t12, [i6, n9]);
  982. }
  983. this.patternMap = e10;
  984. }
  985. this.bufferDataOffset = s5;
  986. }
  987. hasData() {
  988. return this.fillIndexCount > 0 || this.outlineIndexCount > 0;
  989. }
  990. triangleCount() {
  991. return (this.fillIndexCount + this.outlineIndexCount) / 3;
  992. }
  993. doDestroy() {
  994. 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;
  995. }
  996. doPrepareForRendering(e9, t10, r10) {
  997. const i6 = new Uint32Array(t10), s5 = new Int32Array(i6.buffer), a8 = i6[r10++];
  998. this.fillVertexBuffer = c.createVertex(e9, F.STATIC_DRAW, new Int32Array(s5.buffer, 4 * r10, a8)), r10 += a8;
  999. const l9 = i6[r10++];
  1000. this.fillIndexBuffer = c.createIndex(e9, F.STATIC_DRAW, new Uint32Array(i6.buffer, 4 * r10, l9)), r10 += l9;
  1001. const u7 = i6[r10++];
  1002. this.outlineVertexBuffer = c.createVertex(e9, F.STATIC_DRAW, new Int32Array(s5.buffer, 4 * r10, u7)), r10 += u7;
  1003. const h7 = i6[r10++];
  1004. this.outlineIndexBuffer = c.createIndex(e9, F.STATIC_DRAW, new Uint32Array(i6.buffer, 4 * r10, h7)), r10 += h7;
  1005. const c7 = this.layer, x = c7.fillMaterial, y = c7.outlineMaterial;
  1006. 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);
  1007. }
  1008. };
  1009. var h6 = class extends a7 {
  1010. constructor(e9, t10, r10) {
  1011. 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 = [];
  1012. const n8 = new Uint32Array(e9), f5 = new Int32Array(e9), o6 = new Float32Array(e9);
  1013. let a8 = this.bufferDataOffset;
  1014. this.isIconSDF = !!n8[a8++];
  1015. const l9 = n8[a8++];
  1016. for (let i6 = 0; i6 < l9; i6++) {
  1017. const e10 = n8[a8++], t11 = n8[a8++], r11 = n8[a8++];
  1018. this.iconPerPageElementsMap.set(e10, [t11, r11]);
  1019. }
  1020. const u7 = n8[a8++];
  1021. for (let i6 = 0; i6 < u7; i6++) {
  1022. const e10 = n8[a8++], t11 = n8[a8++], r11 = n8[a8++];
  1023. this.glyphPerPageElementsMap.set(e10, [t11, r11]);
  1024. }
  1025. const h7 = n8[a8++], c7 = n8[a8++];
  1026. this.iconOpacity = new Int32Array(h7), this.textOpacity = new Int32Array(c7), a8 = h5(n8, f5, o6, a8, this.symbols, r10), this.bufferDataOffset = a8;
  1027. }
  1028. hasData() {
  1029. return this.iconPerPageElementsMap.size > 0 || this.glyphPerPageElementsMap.size > 0;
  1030. }
  1031. triangleCount() {
  1032. let e9 = 0;
  1033. for (const [t10, r10] of this.iconPerPageElementsMap)
  1034. e9 += r10[1];
  1035. for (const [t10, r10] of this.glyphPerPageElementsMap)
  1036. e9 += r10[1];
  1037. return e9 / 3;
  1038. }
  1039. doDestroy() {
  1040. 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;
  1041. }
  1042. updateOpacityInfo() {
  1043. if (!this.opacityChanged)
  1044. return;
  1045. this.opacityChanged = false;
  1046. const e9 = e2(this.iconOpacity), t10 = e2(this.iconOpacityBuffer);
  1047. e9.length > 0 && e9.byteLength === t10.size && t10.setSubData(e9);
  1048. const i6 = e2(this.textOpacity), s5 = e2(this.textOpacityBuffer);
  1049. i6.length > 0 && i6.byteLength === s5.size && s5.setSubData(i6);
  1050. }
  1051. doPrepareForRendering(e9, t10, i6) {
  1052. const s5 = new Uint32Array(t10), a8 = new Int32Array(s5.buffer), l9 = s5[i6++];
  1053. this.iconVertexBuffer = c.createVertex(e9, F.STATIC_DRAW, new Int32Array(a8.buffer, 4 * i6, l9)), i6 += l9;
  1054. const u7 = s5[i6++];
  1055. this.iconIndexBuffer = c.createIndex(e9, F.STATIC_DRAW, new Uint32Array(s5.buffer, 4 * i6, u7)), i6 += u7;
  1056. const h7 = s5[i6++];
  1057. this.textVertexBuffer = c.createVertex(e9, F.STATIC_DRAW, new Int32Array(a8.buffer, 4 * i6, h7)), i6 += h7;
  1058. const c7 = s5[i6++];
  1059. 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);
  1060. const x = this.layer, y = x.iconMaterial, d2 = x.textMaterial;
  1061. 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);
  1062. }
  1063. };
  1064. var c6 = class extends a7 {
  1065. constructor(e9, t10) {
  1066. super(e9, t10), this.type = I3.CIRCLE, this.circleIndexStart = 0, this.circleIndexCount = 0;
  1067. const r10 = new Uint32Array(e9);
  1068. let s5 = this.bufferDataOffset;
  1069. this.circleIndexStart = r10[s5++], this.circleIndexCount = r10[s5++], this.bufferDataOffset = s5;
  1070. }
  1071. hasData() {
  1072. return this.circleIndexCount > 0;
  1073. }
  1074. triangleCount() {
  1075. return this.circleIndexCount / 3;
  1076. }
  1077. doDestroy() {
  1078. 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;
  1079. }
  1080. doPrepareForRendering(e9, t10, r10) {
  1081. const i6 = new Uint32Array(t10), s5 = new Int32Array(i6.buffer), a8 = i6[r10++];
  1082. this.circleVertexBuffer = c.createVertex(e9, F.STATIC_DRAW, new Int32Array(s5.buffer, 4 * r10, a8)), r10 += a8;
  1083. const l9 = i6[r10++];
  1084. this.circleIndexBuffer = c.createIndex(e9, F.STATIC_DRAW, new Uint32Array(i6.buffer, 4 * r10, l9)), r10 += l9;
  1085. const u7 = this.layer.circleMaterial;
  1086. this.circleVertexArrayObject = new f2(e9, u7.getAttributeLocations(), u7.getLayoutInfo(), { geometry: this.circleVertexBuffer }, this.circleIndexBuffer);
  1087. }
  1088. };
  1089. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/VectorTile.js
  1090. var m3 = class extends r5 {
  1091. constructor(e9, t10, s5, a8, r10, i6, o6 = null) {
  1092. 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;
  1093. }
  1094. get hasSymbolBuckets() {
  1095. return this._hasSymbolBuckets;
  1096. }
  1097. get isFading() {
  1098. return this._hasSymbolBuckets && performance.now() - this.lastOpacityUpdate < e5;
  1099. }
  1100. get isHoldingForFade() {
  1101. return this._hasSymbolBuckets && (!this.allSymbolsFadingOut || performance.now() - this.lastOpacityUpdate < e5);
  1102. }
  1103. get wasRequested() {
  1104. return this.status === "errored" || this.status === "loaded" || this.status === "reloading";
  1105. }
  1106. setData(e9) {
  1107. this.changeDataImpl(e9), this.requestRender(), this.ready(), this.invalidating = false, this._processed = true;
  1108. }
  1109. deleteLayerData(t10) {
  1110. let s5 = false;
  1111. for (const e9 of t10)
  1112. if (this.layerData.has(e9)) {
  1113. const t11 = this.layerData.get(e9);
  1114. 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--;
  1115. }
  1116. r(this._memCache) && this._memCache.updateSize(this.key.id, this, this._memoryUsedByLayerData), s5 && this.emit("symbols-changed"), this.requestRender();
  1117. }
  1118. processed() {
  1119. return this._processed;
  1120. }
  1121. hasData() {
  1122. return this.layerCount > 0;
  1123. }
  1124. dispose() {
  1125. this.status !== "unloaded" && (u6.delete(this), m3._destroyRenderBuckets(this.layerData), this.layerData = null, this.layerCount = 0, this._memoryUsedByLayerData = 0, this.destroy(), this.status = "unloaded");
  1126. }
  1127. release() {
  1128. return --this._referenced == 0 && (this.dispose(), this.stage = null, true);
  1129. }
  1130. retain() {
  1131. ++this._referenced;
  1132. }
  1133. get referenced() {
  1134. return this._referenced;
  1135. }
  1136. get memoryUsage() {
  1137. return (this._memoryUsedByLayerData + 256) / (this._referenced || 1);
  1138. }
  1139. changeDataImpl(t10) {
  1140. let s5 = false;
  1141. if (t10) {
  1142. const { bucketsWithData: a8, emptyBuckets: r10 } = t10, i6 = this._createRenderBuckets(a8);
  1143. if (r10 && r10.byteLength > 0) {
  1144. const e9 = new Uint32Array(r10);
  1145. for (const t11 of e9)
  1146. this._deleteLayerData(t11);
  1147. }
  1148. for (const [e9, t11] of i6)
  1149. 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++;
  1150. r(this._memCache) && this._memCache.updateSize(this.key.id, this, this._memoryUsedByLayerData);
  1151. }
  1152. this._hasSymbolBuckets = false;
  1153. for (const [e9, a8] of this.layerData)
  1154. a8.type === I3.SYMBOL && (this._hasSymbolBuckets = true);
  1155. s5 && this.emit("symbols-changed");
  1156. }
  1157. attachWithContext(e9) {
  1158. this.stage = { context: e9, trashDisplayObject(e10) {
  1159. e10.processDetach();
  1160. }, untrashDisplayObject: () => false };
  1161. }
  1162. setTransform(e9, i6) {
  1163. super.setTransform(e9, i6);
  1164. const o6 = i6 / (e9.resolution * e9.pixelRatio), h7 = this.width / this.rangeX * o6, n8 = this.height / this.rangeY * o6, l9 = [0, 0];
  1165. e9.toScreen(l9, [this.x, this.y]);
  1166. const y = this.transforms.tileUnitsToPixels;
  1167. r2(y), M(y, y, l9), h2(y, y, Math.PI * e9.rotation / 180), f(y, y, [h7, n8, 1]);
  1168. }
  1169. _createTransforms() {
  1170. return { dvs: e6(), tileMat3: e6(), tileUnitsToPixels: e6() };
  1171. }
  1172. static _destroyRenderBuckets(e9) {
  1173. if (!e9)
  1174. return;
  1175. const t10 = new Set();
  1176. e9.forEach((e10) => {
  1177. t10.has(e10) || (e10.destroy(), t10.add(e10));
  1178. }), e9.clear();
  1179. }
  1180. _createRenderBuckets(e9) {
  1181. const t10 = new Map(), s5 = new Map();
  1182. for (const a8 of e9) {
  1183. const e10 = this._deserializeBucket(a8, s5);
  1184. for (const s6 of e10.layerUIDs)
  1185. t10.set(s6, e10);
  1186. }
  1187. return t10;
  1188. }
  1189. _deserializeBucket(e9, t10) {
  1190. let s5 = t10.get(e9);
  1191. if (s5)
  1192. return s5;
  1193. switch (new Uint32Array(e9)[0]) {
  1194. case I3.FILL:
  1195. s5 = new u5(e9, this.styleRepository);
  1196. break;
  1197. case I3.LINE:
  1198. s5 = new l6(e9, this.styleRepository);
  1199. break;
  1200. case I3.SYMBOL:
  1201. s5 = new h6(e9, this.styleRepository, this);
  1202. break;
  1203. case I3.CIRCLE:
  1204. s5 = new c6(e9, this.styleRepository);
  1205. }
  1206. return t10.set(e9, s5), s5;
  1207. }
  1208. _deleteLayerData(e9) {
  1209. if (!this.layerData.has(e9))
  1210. return;
  1211. const t10 = this.layerData.get(e9);
  1212. this._memoryUsedByLayerData -= t10.memoryUsed, t10.destroy(), this.layerData.delete(e9), this.layerCount--;
  1213. }
  1214. };
  1215. var u6 = new Map();
  1216. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/jobs.js
  1217. function i2(e9, t10, n8, o6, i6, l9) {
  1218. const { iconRotationAlignment: a8, textRotationAlignment: c7, iconTranslate: h7, iconTranslateAnchor: u7, textTranslate: d2, textTranslateAnchor: y } = o6;
  1219. let x = 0;
  1220. for (const g3 of e9.colliders) {
  1221. const [e10, o7] = g3.partIndex === 0 ? h7 : d2, m5 = g3.partIndex === 0 ? u7 : y, f5 = g3.minLod <= l9 && l9 <= g3.maxLod;
  1222. 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);
  1223. }
  1224. e9.colliders.length > 0 && x === e9.colliders.length && (e9.unique.show = false);
  1225. }
  1226. var l7 = class {
  1227. constructor(o6, r10, s5, i6, l9, a8) {
  1228. 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);
  1229. for (const t10 of o6)
  1230. for (const n8 of t10.symbols)
  1231. this._allNeededMatrices.has(n8.tile) || this._allNeededMatrices.set(n8.tile, r4(n8.tile.transforms.tileUnitsToPixels));
  1232. }
  1233. work(e9) {
  1234. const t10 = this._gridIndex;
  1235. function n8(e10) {
  1236. 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);
  1237. for (let h7 = l9; h7 <= c7; h7++)
  1238. for (let e11 = i6; e11 <= a8; e11++) {
  1239. const i7 = t10.cells[h7][e11];
  1240. for (const e12 of i7) {
  1241. const t11 = e12.xScreen + e12.dxScreen, i8 = e12.yScreen + e12.dyScreen, l10 = t11 + e12.width, a9 = i8 + e12.height;
  1242. if (!(r10 < t11 || n9 > l10 || s5 < i8 || o7 > a9))
  1243. return true;
  1244. }
  1245. }
  1246. return false;
  1247. }
  1248. const o6 = performance.now();
  1249. for (; this._currentLayerCursor < this._symbols.length; this._currentLayerCursor++, this._currentSymbolCursor = 0) {
  1250. const t11 = this._symbols[this._currentLayerCursor], r10 = this._getProperties(t11.styleLayerUID);
  1251. for (; this._currentSymbolCursor < t11.symbols.length; this._currentSymbolCursor++) {
  1252. if (this._currentSymbolCursor % 100 == 99 && performance.now() - o6 > e9)
  1253. return false;
  1254. const s5 = t11.symbols[this._currentSymbolCursor];
  1255. if (!s5.unique.show)
  1256. continue;
  1257. i2(s5, this._si, this._co, r10, this._allNeededMatrices.get(s5.tile), this._zoom);
  1258. const l9 = s5.unique;
  1259. if (!l9.show)
  1260. continue;
  1261. const { iconAllowOverlap: a8, iconIgnorePlacement: c7, textAllowOverlap: h7, textIgnorePlacement: u7 } = r10;
  1262. for (const e10 of s5.colliders) {
  1263. if (!e10.enabled)
  1264. continue;
  1265. const t12 = l9.parts[e10.partIndex];
  1266. if (!t12.show)
  1267. continue;
  1268. !(e10.partIndex ? h7 : a8) && n8(e10) && (e10.hard ? l9.show = false : t12.show = false);
  1269. }
  1270. if (l9.show)
  1271. for (const e10 of s5.colliders) {
  1272. if (!e10.enabled)
  1273. continue;
  1274. if (e10.partIndex ? u7 : c7)
  1275. continue;
  1276. if (!l9.parts[e10.partIndex].show)
  1277. continue;
  1278. 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);
  1279. for (let l10 = i6; l10 <= h8; l10++)
  1280. for (let t13 = s6; t13 <= a9; t13++) {
  1281. this._gridIndex.cells[l10][t13].push(e10);
  1282. }
  1283. }
  1284. }
  1285. }
  1286. return true;
  1287. }
  1288. _getProperties(e9) {
  1289. const t10 = this._styleProps.get(e9);
  1290. if (t10)
  1291. return t10;
  1292. const n8 = this._zoom, s5 = this._styleRepository.getStyleLayerByUID(e9), i6 = s5.getLayoutValue("symbol-placement", n8) !== n3.POINT;
  1293. let l9 = s5.getLayoutValue("icon-rotation-alignment", n8);
  1294. l9 === l3.AUTO && (l9 = i6 ? l3.MAP : l3.VIEWPORT);
  1295. let a8 = s5.getLayoutValue("text-rotation-alignment", n8);
  1296. a8 === l3.AUTO && (a8 = i6 ? l3.MAP : l3.VIEWPORT);
  1297. 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 };
  1298. return this._styleProps.set(e9, y), y;
  1299. }
  1300. };
  1301. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js
  1302. function t7(o6, e9) {
  1303. if (o6.priority - e9.priority)
  1304. return o6.priority - e9.priority;
  1305. const t10 = o6.tile.key, i6 = e9.tile.key;
  1306. 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;
  1307. }
  1308. var i3 = class {
  1309. constructor(o6, e9, t10, i6, s5, r10) {
  1310. 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;
  1311. }
  1312. get running() {
  1313. return this._running;
  1314. }
  1315. setScreenSize(o6, e9) {
  1316. this._screenWidth === o6 && this._screenHeight === e9 || this.restart(), this._screenWidth = o6, this._screenHeight = e9;
  1317. }
  1318. restart() {
  1319. this._selectionJob = null, this._selectionJobCompleted = false, this._collisionJob = null, this._collisionJobCompleted = false, this._opacityJob = null, this._opacityJobCompleted = false, this._running = true;
  1320. }
  1321. continue(o6) {
  1322. if (this._selectionJob || (this._selectionJob = this._createSelectionJob()), !this._selectionJobCompleted) {
  1323. const e9 = performance.now();
  1324. if (!this._selectionJob.work(o6))
  1325. return false;
  1326. if (this._selectionJobCompleted = true, (o6 = Math.max(0, o6 - (performance.now() - e9))) === 0)
  1327. return false;
  1328. }
  1329. if (this._collisionJob || (this._collisionJob = this._createCollisionJob(this._selectionJob.sortedSymbols, this._screenWidth, this._screenHeight)), !this._collisionJobCompleted) {
  1330. const e9 = performance.now();
  1331. if (!this._collisionJob.work(o6))
  1332. return false;
  1333. if (this._collisionJobCompleted = true, (o6 = Math.max(0, o6 - (performance.now() - e9))) === 0)
  1334. return false;
  1335. }
  1336. if (this._opacityJob || (this._opacityJob = this._createOpacityJob()), !this._opacityJobCompleted) {
  1337. const e9 = performance.now();
  1338. if (!this._opacityJob.work(o6))
  1339. return false;
  1340. if (this._opacityJobCompleted = true, (o6 = Math.max(0, o6 - (performance.now() - e9))) === 0)
  1341. return false;
  1342. }
  1343. return this._running = false, true;
  1344. }
  1345. _createSelectionJob() {
  1346. const o6 = this._symbolRepository.uniqueSymbols;
  1347. for (let t10 = 0; t10 < o6.length; t10++) {
  1348. const e10 = o6[t10];
  1349. for (let o7 = 0; o7 < e10.uniqueSymbols.length; o7++) {
  1350. const t11 = e10.uniqueSymbols[o7];
  1351. for (const o8 of t11.tileSymbols)
  1352. o8.selectedForRendering = false;
  1353. }
  1354. }
  1355. const e9 = [];
  1356. let i6 = 0, s5 = 0;
  1357. const r10 = this._isLayerVisible;
  1358. function n8(n9) {
  1359. let l10;
  1360. const c7 = performance.now();
  1361. for (; s5 < o6.length; s5++, i6 = 0) {
  1362. const t10 = o6[s5], h7 = t10.styleLayerUID;
  1363. if (!r10(h7)) {
  1364. e9[s5] || (e9[s5] = { styleLayerUID: h7, symbols: [] });
  1365. continue;
  1366. }
  1367. e9[s5] = e9[s5] || { styleLayerUID: h7, symbols: [] };
  1368. const a8 = e9[s5];
  1369. for (; i6 < t10.uniqueSymbols.length; i6++) {
  1370. if (l10 = t10.uniqueSymbols[i6], i6 % 100 == 99 && performance.now() - c7 > n9)
  1371. return false;
  1372. let o7 = null, e10 = false, s6 = false;
  1373. for (const t11 of l10.tileSymbols)
  1374. if (!s6 || !e10) {
  1375. const i7 = t11.tile;
  1376. (!o7 || i7.isCoverage || i7.neededForCoverage && !e10) && (o7 = t11, (i7.neededForCoverage || i7.isCoverage) && (s6 = true), i7.isCoverage && (e10 = true));
  1377. }
  1378. if (o7.selectedForRendering = true, s6) {
  1379. a8.symbols.push(o7), l10.show = true;
  1380. for (const o8 of l10.parts)
  1381. o8.show = true;
  1382. } else
  1383. l10.show = false;
  1384. }
  1385. }
  1386. for (const o7 of e9)
  1387. o7.symbols.sort(t7);
  1388. return true;
  1389. }
  1390. const l9 = this._symbolLayerSorter;
  1391. return { work: n8, get sortedSymbols() {
  1392. return e9.sort(l9);
  1393. } };
  1394. }
  1395. _createOpacityJob() {
  1396. const e9 = this._assignTileSymbolsOpacity, t10 = this._visibleTiles;
  1397. let i6 = 0;
  1398. function r10(o6, t11) {
  1399. const i7 = o6.symbols;
  1400. for (const [e10, r11] of i7)
  1401. s4(r11, t11);
  1402. e9(o6, t11);
  1403. for (const e10 of o6.childrenTiles)
  1404. r10(e10, t11);
  1405. }
  1406. return { work(e10) {
  1407. const s5 = performance.now();
  1408. for (; i6 < t10.length; i6++) {
  1409. if (performance.now() - s5 > e10)
  1410. return false;
  1411. const n8 = t10[i6];
  1412. if (r(n8.parentTile))
  1413. continue;
  1414. r10(n8, performance.now());
  1415. }
  1416. return true;
  1417. } };
  1418. }
  1419. };
  1420. function s4(o6, t10) {
  1421. for (const i6 of o6) {
  1422. const o7 = i6.unique;
  1423. for (const i7 of o7.parts) {
  1424. const s5 = i7.targetOpacity > 0.5 ? 1 : -1;
  1425. 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;
  1426. }
  1427. }
  1428. }
  1429. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js
  1430. var l8 = 32;
  1431. var i4 = 8;
  1432. var n6 = 64;
  1433. var r9 = class {
  1434. constructor(e9, s5, o6) {
  1435. this.tileCoordRange = e9, this._visibleTiles = s5, this._createUnique = o6, this._tiles = new Map(), this._uniqueSymbolsReferences = new Map();
  1436. }
  1437. get uniqueSymbols() {
  1438. return t(this._uniqueSymbolLayerArray) && (this._uniqueSymbolLayerArray = this._createUniqueSymbolLayerArray()), this._uniqueSymbolLayerArray;
  1439. }
  1440. add(e9, s5) {
  1441. this._uniqueSymbolLayerArray = null;
  1442. let t10 = this._tiles.get(e9.id);
  1443. t10 || (t10 = { symbols: new Map() }, this._tiles.set(e9.id, t10));
  1444. const r10 = new Map();
  1445. if (s5)
  1446. for (const o6 of s5)
  1447. t10.symbols.has(o6) && (r10.set(o6, t10.symbols.get(o6)), t10.symbols.delete(o6));
  1448. else
  1449. for (const [o6, l9] of e9.layerData)
  1450. t10.symbols.has(o6) && (r10.set(o6, t10.symbols.get(o6)), t10.symbols.delete(o6));
  1451. this._removeSymbols(r10);
  1452. const y = e9.symbols, a8 = new Map();
  1453. for (const [f5, c7] of y) {
  1454. let e10 = c7.length;
  1455. if (e10 >= l8) {
  1456. let s6 = this.tileCoordRange;
  1457. do {
  1458. s6 /= 2, e10 /= 4;
  1459. } while (e10 > i4 && s6 > n6);
  1460. const l9 = new n5(this.tileCoordRange, this.tileCoordRange, s6);
  1461. a8.set(f5, { flat: c7, index: l9 }), t10.symbols.set(f5, { flat: c7, index: l9 });
  1462. for (const e11 of c7)
  1463. l9.getCell(e11.xTile, e11.yTile).push(e11);
  1464. } else
  1465. a8.set(f5, { flat: c7 }), t10.symbols.set(f5, { flat: c7 });
  1466. }
  1467. this._addSymbols(e9.key, y);
  1468. }
  1469. deleteStyleLayers(e9) {
  1470. this._uniqueSymbolLayerArray = null;
  1471. for (const [s5, o6] of this._tiles) {
  1472. const t10 = new Map();
  1473. for (const s6 of e9)
  1474. o6.symbols.has(s6) && (t10.set(s6, o6.symbols.get(s6)), o6.symbols.delete(s6));
  1475. this._removeSymbols(t10), o6.symbols.size === 0 && this._tiles.delete(s5);
  1476. }
  1477. }
  1478. removeTile(e9) {
  1479. this._uniqueSymbolLayerArray = null;
  1480. const s5 = this._tiles.get(e9.id);
  1481. if (!s5)
  1482. return;
  1483. const o6 = new Map();
  1484. for (const [t10, l9] of e9.symbols)
  1485. s5.symbols.has(t10) && (o6.set(t10, s5.symbols.get(t10)), s5.symbols.delete(t10));
  1486. this._removeSymbols(o6), s5.symbols.size === 0 && this._tiles.delete(e9.id);
  1487. }
  1488. _removeSymbols(e9) {
  1489. for (const [s5, { flat: o6 }] of e9)
  1490. for (const e10 of o6) {
  1491. const o7 = e10.unique, t10 = o7.tileSymbols, l9 = t10.length - 1;
  1492. for (let s6 = 0; s6 < l9; s6++)
  1493. if (t10[s6] === e10) {
  1494. t10[s6] = t10[l9];
  1495. break;
  1496. }
  1497. if (t10.length = l9, l9 === 0) {
  1498. const e11 = this._uniqueSymbolsReferences.get(s5);
  1499. e11.delete(o7), e11.size === 0 && this._uniqueSymbolsReferences.delete(s5);
  1500. }
  1501. e10.unique = null;
  1502. }
  1503. }
  1504. _addSymbols(s5, o6) {
  1505. if (o6.size === 0)
  1506. return;
  1507. const t10 = this._visibleTiles;
  1508. for (const e9 of t10)
  1509. e9.parentTile || e9.key.world !== s5.world || e9.key.level === s5.level && !e9.key.equals(s5) || this._matchSymbols(e9, s5, o6);
  1510. for (const [l9, i6] of o6)
  1511. for (const s6 of i6)
  1512. if (t(s6.unique)) {
  1513. const e9 = this._createUnique();
  1514. s6.unique = e9, e9.tileSymbols.push(s6);
  1515. let o7 = this._uniqueSymbolsReferences.get(l9);
  1516. o7 || (o7 = new Set(), this._uniqueSymbolsReferences.set(l9, o7)), o7.add(e9);
  1517. }
  1518. }
  1519. _matchSymbols(e9, o6, l9) {
  1520. if (e9.key.level > o6.level) {
  1521. const s5 = e9.key.level - o6.level;
  1522. if (e9.key.row >> s5 !== o6.row || e9.key.col >> s5 !== o6.col)
  1523. return;
  1524. }
  1525. if (o6.level > e9.key.level) {
  1526. const s5 = o6.level - e9.key.level;
  1527. if (o6.row >> s5 !== e9.key.row || o6.col >> s5 !== e9.key.col)
  1528. return;
  1529. }
  1530. if (o6.equals(e9.key)) {
  1531. for (const s5 of e9.childrenTiles)
  1532. this._matchSymbols(s5, o6, l9);
  1533. return;
  1534. }
  1535. const i6 = new Map();
  1536. for (const [n8, r10] of l9) {
  1537. const l10 = [];
  1538. for (const s5 of r10) {
  1539. 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);
  1540. i7 >= 0 && i7 < this.tileCoordRange && n9 >= 0 && n9 < this.tileCoordRange && l10.push({ symbol: s5, xTransformed: i7, yTransformed: n9 });
  1541. }
  1542. const y = [], a8 = e9.key.level < o6.level ? 1 : 1 << e9.key.level - o6.level, f5 = this._tiles.get(e9.id).symbols.get(n8);
  1543. if (f5) {
  1544. const e10 = f5.flat;
  1545. for (const o7 of l10) {
  1546. let t10, l11 = false;
  1547. const i7 = o7.xTransformed, n9 = o7.yTransformed;
  1548. t10 = r(f5.index) ? f5.index.getCell(i7, n9) : e10;
  1549. const r11 = o7.symbol, c7 = r11.hash;
  1550. for (const e11 of t10)
  1551. if (c7 === e11.hash && Math.abs(i7 - e11.xTile) <= a8 && Math.abs(n9 - e11.yTile) <= a8) {
  1552. const s5 = e11.unique;
  1553. r11.unique = s5, s5.tileSymbols.push(r11), l11 = true;
  1554. break;
  1555. }
  1556. l11 || y.push(r11);
  1557. }
  1558. }
  1559. y.length > 0 && i6.set(n8, y);
  1560. }
  1561. for (const s5 of e9.childrenTiles)
  1562. this._matchSymbols(s5, o6, i6);
  1563. }
  1564. _createUniqueSymbolLayerArray() {
  1565. const e9 = this._uniqueSymbolsReferences, s5 = new Array(e9.size);
  1566. let o6, t10 = 0;
  1567. for (const [l9, i6] of e9) {
  1568. const e10 = new Array(i6.size);
  1569. o6 = 0;
  1570. for (const s6 of i6)
  1571. e10[o6++] = s6;
  1572. s5[t10] = { styleLayerUID: l9, uniqueSymbols: e10 }, t10++;
  1573. }
  1574. return s5;
  1575. }
  1576. };
  1577. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/SymbolFader.js
  1578. var n7 = 0.5;
  1579. var _2 = 1e-6;
  1580. var m4 = class extends n2 {
  1581. constructor(t10, e9) {
  1582. 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) => {
  1583. t11.allSymbolsFadingOut = true, t11.lastOpacityUpdate = e10, a6(t11, e10, true), t11.decluttered = true, t11.requestRender();
  1584. }, (t11, e10) => this.styleRepository.getStyleLayerByUID(t11.styleLayerUID).z - this.styleRepository.getStyleLayerByUID(e10.styleLayerUID).z, (t11) => {
  1585. const e10 = this.styleRepository.getStyleLayerByUID(t11);
  1586. if (this._zoom + _2 < e10.minzoom || this._zoom - _2 >= e10.maxzoom)
  1587. return false;
  1588. const i6 = e10.getLayoutProperty("visibility");
  1589. return !i6 || i6.getValue() !== i.NONE;
  1590. });
  1591. }
  1592. addTile(t10) {
  1593. t10.decluttered = false, this._tileToHandle.set(t10, t10.on("symbols-changed", () => {
  1594. this._symbolRepository.add(t10), this.restartDeclutter();
  1595. })), this._symbolRepository.add(t10), this.restartDeclutter();
  1596. }
  1597. removeTile(t10) {
  1598. const e9 = this._tileToHandle.get(t10);
  1599. e9 && (this._symbolRepository.removeTile(t10), this.restartDeclutter(), e9.remove(), this._tileToHandle.delete(t10));
  1600. }
  1601. update(t10, e9) {
  1602. 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;
  1603. }
  1604. restartDeclutter() {
  1605. this._completed = false, this._symbolDeclutterer.restart(), this._notifyUnstable();
  1606. }
  1607. clear() {
  1608. this._completed = false, this._symbolRepository = null, this._symbolDeclutterer.restart(), this._tileToHandle.forEach((t10) => t10.remove()), this._tileToHandle.clear();
  1609. }
  1610. get stale() {
  1611. 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;
  1612. }
  1613. deleteStyleLayers(t10) {
  1614. this._symbolRepository.deleteStyleLayers(t10);
  1615. }
  1616. _continueDeclutter() {
  1617. 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());
  1618. }
  1619. _scheduleNotifyStable() {
  1620. r(this._stableNotificationHandle) && clearTimeout(this._stableNotificationHandle), this._stableNotificationHandle = setTimeout(() => {
  1621. this._stableNotificationHandle = null, this.emit("fade-complete");
  1622. }, (1 + n7) * e5);
  1623. }
  1624. _notifyUnstable() {
  1625. r(this._stableNotificationHandle) && (clearTimeout(this._stableNotificationHandle), this._stableNotificationHandle = null), this.emit("fade-start");
  1626. }
  1627. };
  1628. // node_modules/@arcgis/core/views/2d/engine/webgl/RenderableTile.js
  1629. var t8 = class extends r5 {
  1630. _createTransforms() {
  1631. return { dvs: e6(), tileMat3: e6() };
  1632. }
  1633. };
  1634. // node_modules/@arcgis/core/views/2d/engine/vectorTiles/VectorTileContainer.js
  1635. var _3 = 1e-6;
  1636. function f4(e9, t10) {
  1637. if (e9) {
  1638. const s5 = e9.getLayoutProperty("visibility");
  1639. if (!s5 || s5.getValue() !== i.NONE && (e9.minzoom === void 0 || e9.minzoom < t10 + _3) && (e9.maxzoom === void 0 || e9.maxzoom >= t10 - _3))
  1640. return true;
  1641. }
  1642. return false;
  1643. }
  1644. var b = class extends o {
  1645. constructor(e9) {
  1646. super(e9), this._backgroundTiles = [], this._pointToCallbacks = new Map();
  1647. }
  1648. destroy() {
  1649. 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();
  1650. }
  1651. setStyleResources(e9, r10, i6) {
  1652. if (this._spriteMosaic = e9, this._glyphMosaic = r10, this._styleRepository = i6, t(this._symbolFader)) {
  1653. const e10 = new m4(this._styleRepository, this.children);
  1654. e10.on("fade-start", () => {
  1655. this.emit("fade-start"), this.requestRender();
  1656. }), e10.on("fade-complete", () => {
  1657. this.emit("fade-complete"), this.requestRender();
  1658. }), this._symbolFader = e10;
  1659. }
  1660. e2(this._symbolFader).styleRepository = i6;
  1661. }
  1662. setSpriteMosaic(e9) {
  1663. this._spriteMosaic.dispose(), this._spriteMosaic = e9;
  1664. }
  1665. deleteStyleLayers(t10) {
  1666. r(this._symbolFader) && this._symbolFader.deleteStyleLayers(t10);
  1667. }
  1668. async hitTest(e9) {
  1669. const t10 = D();
  1670. return this._pointToCallbacks.set(e9, t10), this.requestRender(), t10.promise;
  1671. }
  1672. enterTileInvalidation() {
  1673. for (const e9 of this.children)
  1674. e9.invalidating = true;
  1675. }
  1676. createRenderParams(e9) {
  1677. return { ...super.createRenderParams(e9), renderPass: null, styleLayer: null, styleLayerUID: -1, glyphMosaic: this._glyphMosaic, spriteMosaic: this._spriteMosaic, hasClipping: !!this._clippingInfos };
  1678. }
  1679. doRender(e9) {
  1680. !this.visible || e9.drawPhase !== I2.MAP && e9.drawPhase !== I2.DEBUG || this._spriteMosaic === void 0 || super.doRender(e9);
  1681. }
  1682. addChild(t10) {
  1683. return super.addChild(t10), r(this._symbolFader) ? this._symbolFader.addTile(t10) : t10.decluttered = true, this.requestRender(), t10;
  1684. }
  1685. removeChild(t10) {
  1686. return r(this._symbolFader) && this._symbolFader.removeTile(t10), this.requestRender(), super.removeChild(t10);
  1687. }
  1688. renderChildren(e9) {
  1689. const { drawPhase: t10 } = e9;
  1690. if (t10 !== I2.DEBUG) {
  1691. if (this._doRender(e9), this._pointToCallbacks.size > 0) {
  1692. e9.drawPhase = I2.HITTEST;
  1693. const s5 = e9.painter.effects.hittestVTL;
  1694. s5.bind(e9), this._doRender(e9), s5.draw(e9, this._pointToCallbacks), s5.unbind(e9), e9.drawPhase = t10;
  1695. }
  1696. } else
  1697. super.renderChildren(e9);
  1698. }
  1699. removeAllChildren() {
  1700. for (let t10 = 0; t10 < this.children.length; t10++) {
  1701. const s5 = this.children[t10];
  1702. r(this._symbolFader) && this._symbolFader.removeTile(s5), s5.dispose();
  1703. }
  1704. super.removeAllChildren();
  1705. }
  1706. getStencilTarget() {
  1707. return this.children.filter((e9) => e9.neededForCoverage && e9.hasData());
  1708. }
  1709. restartDeclutter() {
  1710. r(this._symbolFader) && this._symbolFader.restartDeclutter();
  1711. }
  1712. _doRender(e9) {
  1713. const { context: t10 } = e9, s5 = this._styleRepository;
  1714. if (!s5)
  1715. return;
  1716. const r10 = s5.layers;
  1717. let i6 = true;
  1718. 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);
  1719. const o6 = this.children.filter((e10) => e10.visible && e10.hasData());
  1720. if (!o6 || o6.length === 0)
  1721. return t10.bindVAO(), t10.setStencilTestEnabled(true), void t10.setBlendingEnabled(true);
  1722. for (const l9 of o6)
  1723. l9.triangleCount = 0;
  1724. 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";
  1725. for (let l9 = r10.length - 1; l9 >= 0; l9--)
  1726. this._renderStyleLayer(r10[l9], e9, o6);
  1727. 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";
  1728. for (let l9 = 0; l9 < r10.length; l9++)
  1729. this._renderStyleLayer(r10[l9], e9, o6);
  1730. t10.setDepthTestEnabled(false), e9.renderPass = "symbol";
  1731. for (let l9 = 0; l9 < r10.length; l9++)
  1732. this._renderStyleLayer(r10[l9], e9, o6);
  1733. t10.bindVAO(), t10.setStencilTestEnabled(true), t10.setBlendingEnabled(true);
  1734. }
  1735. _fade(t10, s5) {
  1736. r(this._symbolFader) && (this._symbolFader.update(t10, s5) || this.requestRender());
  1737. }
  1738. _renderStyleLayer(e9, t10, s5) {
  1739. const { painter: r10, renderPass: i6 } = t10;
  1740. if (e9 === void 0)
  1741. return;
  1742. const o6 = e9.getLayoutProperty("visibility");
  1743. if (o6 && o6.getValue() === i.NONE)
  1744. return;
  1745. let a8;
  1746. switch (e9.type) {
  1747. case a3.BACKGROUND:
  1748. return;
  1749. case a3.FILL:
  1750. if (i6 !== "opaque" && t10.renderPass !== "translucent")
  1751. return;
  1752. a8 = "vtlFill";
  1753. break;
  1754. case a3.LINE:
  1755. if (i6 !== "translucent")
  1756. return;
  1757. a8 = "vtlLine";
  1758. break;
  1759. case a3.CIRCLE:
  1760. if (i6 !== "symbol")
  1761. return;
  1762. a8 = "vtlCircle";
  1763. break;
  1764. case a3.SYMBOL:
  1765. if (i6 !== "symbol")
  1766. return;
  1767. a8 = "vtlSymbol";
  1768. }
  1769. if (s5 = e9.type === a3.SYMBOL ? s5.filter((e10) => e10.decluttered) : s5.filter((e10) => e10.neededForCoverage), a8 !== "vtlSymbol") {
  1770. const r11 = t10.displayLevel;
  1771. if (s5.length === 0 || e9.minzoom !== void 0 && e9.minzoom >= r11 + _3 || e9.maxzoom !== void 0 && e9.maxzoom < r11 - _3)
  1772. return;
  1773. }
  1774. const d2 = e9.uid;
  1775. t10.styleLayerUID = d2, t10.styleLayer = e9;
  1776. for (const l9 of s5)
  1777. if (l9.layerData.has(d2)) {
  1778. r10.renderObjects(t10, s5, a8);
  1779. break;
  1780. }
  1781. }
  1782. _renderBackgroundLayers(t10, s5) {
  1783. const { context: r10, displayLevel: o6, painter: l9, state: h7 } = t10, u7 = this._styleRepository;
  1784. let _4 = false;
  1785. for (const e9 of s5) {
  1786. if (u7.getLayerById(e9).type === a3.BACKGROUND && f4(u7.getLayerById(e9), o6)) {
  1787. _4 = true;
  1788. break;
  1789. }
  1790. }
  1791. if (!_4)
  1792. return;
  1793. const b3 = this._tileInfoView.getTileCoverage(t10.state, 0, "smallest"), { spans: g3, lodInfo: T } = b3, { level: E3 } = T, C = u(), L3 = [];
  1794. if (this._renderPasses) {
  1795. const s6 = this._renderPasses[0];
  1796. r(this._clippingInfos) && (s6.brushes[0].prepareState(t10, this._clippingInfos[0]), s6.brushes[0].drawMany(t10, this._clippingInfos));
  1797. }
  1798. const v2 = this._backgroundTiles;
  1799. let S2, P2 = 0;
  1800. for (const { row: e9, colFrom: n8, colTo: a8 } of g3)
  1801. for (let t11 = n8; t11 <= a8; t11++) {
  1802. if (P2 < v2.length)
  1803. 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];
  1804. else {
  1805. const s6 = new e3(E3, e9, T.normalizeCol(t11), T.getWorldForColumn(t11)), r11 = this._tileInfoView.getTileBounds(u(), s6);
  1806. S2 = new t8(s6, r11[0], r11[3], 512, 512, 4096, 4096), v2.push(S2);
  1807. }
  1808. S2.setTransform(h7, this._tileInfoView.getTileResolution(S2.key)), L3.push(S2), P2++;
  1809. }
  1810. r10.setStencilWriteMask(0), r10.setColorMask(true, true, true, true), r10.setStencilOp(O.KEEP, O.KEEP, O.REPLACE), r10.setStencilFunction(I.EQUAL, 0, 255);
  1811. let R2 = true;
  1812. t10.drawPhase === I2.HITTEST && (R2 = false), r10.setStencilTestEnabled(R2);
  1813. for (const e9 of s5) {
  1814. const s6 = u7.getLayerById(e9);
  1815. s6.type === a3.BACKGROUND && f4(s6, o6) && (t10.styleLayerUID = s6.uid, t10.styleLayer = s6, l9.renderObjects(t10, L3, "vtlBackground"));
  1816. }
  1817. l2.pool.release(b3);
  1818. }
  1819. };
  1820. // node_modules/@arcgis/core/views/2d/layers/support/Display.js
  1821. var i5 = class extends t4 {
  1822. constructor(e9) {
  1823. 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);
  1824. }
  1825. doRender(t10) {
  1826. const e9 = t10.state, i6 = this._createCustomRenderParams(t10), a8 = this._canvas, s5 = this._bitmap, n8 = window.devicePixelRatio;
  1827. a8.width = e9.size[0] * n8, a8.height = e9.size[1] * n8, s5.resolution = e9.resolution;
  1828. const o6 = e9.clone();
  1829. 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 });
  1830. }
  1831. _createCustomRenderParams(t10) {
  1832. return { globalOpacity: t10.globalOpacity, state: t10.state, stationary: t10.stationary, pixelRatio: window.devicePixelRatio, context: this._context };
  1833. }
  1834. };
  1835. // node_modules/@arcgis/core/views/2d/tiling/TileInfoViewPOT.js
  1836. var t9 = class extends h3 {
  1837. constructor() {
  1838. super(...arguments), this._fullCacheLodInfos = null, this._levelByScale = {};
  1839. }
  1840. getTileParentId(e9) {
  1841. const l9 = e3.pool.acquire(e9), t10 = l9.level === 0 ? null : e3.getId(l9.level - 1, l9.row >> 1, l9.col >> 1, l9.world);
  1842. return e3.pool.release(l9), t10;
  1843. }
  1844. getTileCoverage(e9, l9, s5) {
  1845. const t10 = super.getTileCoverage(e9, l9, s5);
  1846. if (!t10)
  1847. return t10;
  1848. const o6 = 1 << t10.lodInfo.level;
  1849. return t10.spans = t10.spans.filter((e10) => e10.row >= 0 && e10.row < o6), t10;
  1850. }
  1851. scaleToLevel(e9) {
  1852. if (this._fullCacheLodInfos || this._initializeFullCacheLODs(this._lodInfos), this._levelByScale[e9])
  1853. return this._levelByScale[e9];
  1854. {
  1855. const l9 = this._fullCacheLodInfos;
  1856. if (e9 > l9[0].scale)
  1857. return l9[0].level;
  1858. let s5, t10;
  1859. for (let o6 = 0; o6 < l9.length - 1; o6++)
  1860. if (t10 = l9[o6 + 1], e9 > t10.scale)
  1861. return s5 = l9[o6], s5.level + (s5.scale - e9) / (s5.scale - t10.scale);
  1862. return l9[l9.length - 1].level;
  1863. }
  1864. }
  1865. _initializeFullCacheLODs(l9) {
  1866. let s5;
  1867. if (l9[0].level === 0)
  1868. s5 = l9.map((e9) => ({ level: e9.level, resolution: e9.resolution, scale: e9.scale }));
  1869. else {
  1870. const l10 = this.tileInfo.size[0], t10 = this.tileInfo.spatialReference;
  1871. s5 = S.create({ size: l10, spatialReference: t10 }).lods.map((e9) => ({ level: e9.level, resolution: e9.resolution, scale: e9.scale }));
  1872. }
  1873. for (let e9 = 0; e9 < s5.length; e9++)
  1874. this._levelByScale[s5[e9].scale] = s5[e9].level;
  1875. this._fullCacheLodInfos = s5;
  1876. }
  1877. };
  1878. // node_modules/@arcgis/core/views/2d/layers/VectorTileLayerView2D.js
  1879. var Q = s.getLogger("esri.views.2d.layers.VectorTileLayerView2D");
  1880. var L2 = class extends f3(u4) {
  1881. constructor() {
  1882. super(...arguments), this._styleChanges = [], this._fetchQueue = null, this._parseQueue = null, this._isTileHandlerReady = false, this.fading = false;
  1883. }
  1884. async hitTest(e9, i6) {
  1885. if (!this._tileHandlerPromise)
  1886. return null;
  1887. await this._tileHandlerPromise;
  1888. const s5 = await this._vectorTileContainer.hitTest(i6);
  1889. if (!s5 || s5.length === 0)
  1890. return null;
  1891. const r10 = s5[0] - 1, a8 = this._styleRepository, l9 = a8.getStyleLayerByUID(r10);
  1892. if (!l9)
  1893. return null;
  1894. const n8 = a8.getStyleLayerIndex(l9.id);
  1895. 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 }) }];
  1896. }
  1897. update(e9) {
  1898. if (this._tileHandlerPromise && this._isTileHandlerReady)
  1899. 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()));
  1900. }
  1901. attach() {
  1902. const { style: e9 } = this.layer.currentStyleInfo;
  1903. 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", () => {
  1904. this.fading = true, this.notifyChange("updating"), this.requestUpdate();
  1905. }), this._vectorTileContainer.on("fade-complete", () => {
  1906. this._collisionBoxesDisplay?.requestRender(), this.fading = false, this.notifyChange("updating"), this.requestUpdate();
  1907. }), l(() => this.layer.symbolCollisionBoxesVisible, (e10) => {
  1908. e10 ? (this._collisionBoxesDisplay = new i5({ render: (e11) => this._renderCollisionBoxes(e11.context) }), this.container.addChild(this._collisionBoxesDisplay)) : (this.container.removeChild(this._collisionBoxesDisplay), this._collisionBoxesDisplay = null);
  1909. }, h), this.layer.on("paint-change", (e10) => {
  1910. if (e10.isDataDriven)
  1911. this._styleChanges.push({ type: L.PAINTER_CHANGED, data: e10 }), this.notifyChange("updating"), this.requestUpdate();
  1912. else {
  1913. const t10 = this._styleRepository, i6 = t10.getLayerById(e10.layer);
  1914. if (!i6)
  1915. return;
  1916. const s5 = i6.type === a3.SYMBOL;
  1917. t10.setPaintProperties(e10.layer, e10.paint), s5 && this._vectorTileContainer.restartDeclutter(), this._vectorTileContainer.requestRender();
  1918. }
  1919. }), this.layer.on("layout-change", (e10) => {
  1920. const t10 = this._styleRepository, i6 = t10.getLayerById(e10.layer);
  1921. if (!i6)
  1922. return;
  1923. const s5 = m2(i6.layout, e10.layout);
  1924. if (!t(s5)) {
  1925. if (a2(s5, "visibility") && b2(s5) === 1)
  1926. return t10.setLayoutProperties(e10.layer, e10.layout), i6.type === a3.SYMBOL && this._vectorTileContainer.restartDeclutter(), void this._vectorTileContainer.requestRender();
  1927. this._styleChanges.push({ type: L.LAYOUT_CHANGED, data: e10 }), this.notifyChange("updating"), this.requestUpdate();
  1928. }
  1929. }), this.layer.on("style-layer-visibility-change", (e10) => {
  1930. const t10 = this._styleRepository, i6 = t10.getLayerById(e10.layer);
  1931. i6 && (t10.setStyleLayerVisibility(e10.layer, e10.visibility), i6.type === a3.SYMBOL && this._vectorTileContainer.restartDeclutter(), this._vectorTileContainer.requestRender());
  1932. }), this.layer.on("style-layer-change", (e10) => {
  1933. this._styleChanges.push({ type: L.LAYER_CHANGED, data: e10 }), this.notifyChange("updating"), this.requestUpdate();
  1934. }), this.layer.on("delete-style-layer", (e10) => {
  1935. this._styleChanges.push({ type: L.LAYER_REMOVED, data: e10 }), this.notifyChange("updating"), this.requestUpdate();
  1936. }), this.layer.on("load-style", () => this._loadStyle()), this.layer.on("spriteSource-change", (e10) => {
  1937. this._newSpriteSource = e10.spriteSource, this._styleChanges.push({ type: L.SPRITES_CHANGED, data: null });
  1938. const t10 = this._styleRepository.layers;
  1939. for (const i6 of t10)
  1940. switch (i6.type) {
  1941. case a3.SYMBOL:
  1942. i6.getLayoutProperty("icon-image") && this._styleChanges.push({ type: L.LAYOUT_CHANGED, data: { layer: i6.id, layout: i6.layout } });
  1943. break;
  1944. case a3.LINE:
  1945. i6.getPaintProperty("line-pattern") && this._styleChanges.push({ type: L.PAINTER_CHANGED, data: { layer: i6.id, paint: i6.paint, isDataDriven: i6.isPainterDataDriven() } });
  1946. break;
  1947. case a3.FILL:
  1948. i6.getLayoutProperty("fill-pattern") && this._styleChanges.push({ type: L.PAINTER_CHANGED, data: { layer: i6.id, paint: i6.paint, isDataDriven: i6.isPainterDataDriven() } });
  1949. }
  1950. this.notifyChange("updating"), this.requestUpdate();
  1951. })], this.declaredClass);
  1952. }
  1953. detach() {
  1954. this._stop(), this.container.removeAllChildren(), this._vectorTileContainer?.destroy(), this._vectorTileContainer = null, this._tileHandler?.destroy(), this._tileHandler = null, this.handles.remove(this.declaredClass);
  1955. }
  1956. moveStart() {
  1957. this.requestUpdate();
  1958. }
  1959. viewChange() {
  1960. this.requestUpdate();
  1961. }
  1962. moveEnd() {
  1963. this._collisionBoxesDisplay && this._vectorTileContainer.restartDeclutter(), this.requestUpdate();
  1964. }
  1965. supportsSpatialReference(e9) {
  1966. return E2(this.layer.tileInfo?.spatialReference, e9);
  1967. }
  1968. canResume() {
  1969. let e9 = super.canResume();
  1970. const { currentStyleInfo: t10 } = this.layer;
  1971. if (e9 && t10?.layerDefinition) {
  1972. const i6 = this.view.scale, { minScale: s5, maxScale: r10 } = t10.layerDefinition;
  1973. t10 && t10.layerDefinition && (s5 && s5 < i6 && (e9 = false), r10 && r10 > i6 && (e9 = false));
  1974. }
  1975. return e9;
  1976. }
  1977. isUpdating() {
  1978. const e9 = this._vectorTileContainer.children;
  1979. return !this._isTileHandlerReady || !this._fetchQueue || !this._parseQueue || this._fetchQueue.updating || this._parseQueue.updating || e9.length > 0 && e9.some((e10) => e10.invalidating) || this.fading;
  1980. }
  1981. acquireTile(e9) {
  1982. const t10 = this._createVectorTile(e9);
  1983. return this._tileHandlerPromise.then(() => {
  1984. this._fetchQueue.push(t10.key).then((e10) => this._parseQueue.push({ key: t10.key, data: e10 })).then((e10) => {
  1985. t10.once("attach", () => this.requestUpdate()), t10.setData(e10), this.requestUpdate(), this.notifyChange("updating");
  1986. }).catch((e10) => {
  1987. this.notifyChange("updating"), g(e10) || Q.error(e10);
  1988. });
  1989. }), t10;
  1990. }
  1991. releaseTile(e9) {
  1992. const t10 = e9.key.id;
  1993. this._fetchQueue.abort(t10), this._parseQueue.abort(t10), this.requestUpdate();
  1994. }
  1995. _start() {
  1996. 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)
  1997. return;
  1998. const e9 = new AbortController(), t10 = this._tileHandler.start({ signal: e9.signal }).then(() => {
  1999. 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;
  2000. });
  2001. this._tileHandler.spriteMosaic.then((e10) => {
  2002. this._vectorTileContainer.setStyleResources(e10, this._tileHandler.glyphMosaic, this._styleRepository), this.requestUpdate();
  2003. }), this._tileHandlerAbortController = e9, this._tileHandlerPromise = t10;
  2004. }
  2005. _stop() {
  2006. if (!this._tileHandlerAbortController || !this._vectorTileContainer)
  2007. return;
  2008. const e9 = this._tileHandlerAbortController;
  2009. 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();
  2010. }
  2011. async _getTileData(e9, t10) {
  2012. const i6 = await this._tileHandler.fetchTileData(e9, t10);
  2013. return this.notifyChange("updating"), i6;
  2014. }
  2015. async _parseTileData(e9, t10) {
  2016. return this._tileHandler.parseTileData(e9, t10);
  2017. }
  2018. async _applyStyleChanges() {
  2019. this._isTileHandlerReady = false, this._fetchQueue.pause(), this._parseQueue.pause(), this._fetchQueue.clear(), this._parseQueue.clear(), this._tileManager.clearCache();
  2020. const e9 = this._styleChanges;
  2021. try {
  2022. await this._tileHandler.updateStyle(e9);
  2023. } catch (l9) {
  2024. Q.error("error applying vector-tiles style update", l9.message), this._fetchQueue.resume(), this._parseQueue.resume(), this._isTileHandlerReady = true;
  2025. }
  2026. const t10 = this._styleRepository, i6 = [];
  2027. e9.forEach((e10) => {
  2028. if (e10.type !== L.LAYER_REMOVED)
  2029. return;
  2030. const s6 = e10.data, r11 = t10.getLayerById(s6.layer);
  2031. r11 && i6.push(r11.uid);
  2032. });
  2033. const s5 = [];
  2034. let r10;
  2035. e9.forEach((e10) => {
  2036. const i7 = e10.type, a9 = e10.data;
  2037. switch (i7) {
  2038. case L.PAINTER_CHANGED:
  2039. t10.setPaintProperties(a9.layer, a9.paint), r10 = a9.layer;
  2040. break;
  2041. case L.LAYOUT_CHANGED:
  2042. t10.setLayoutProperties(a9.layer, a9.layout), r10 = a9.layer;
  2043. break;
  2044. case L.LAYER_REMOVED:
  2045. return void t10.deleteStyleLayer(a9.layer);
  2046. case L.LAYER_CHANGED:
  2047. t10.setStyleLayer(a9.layer, a9.index), r10 = a9.layer.id;
  2048. break;
  2049. case L.SPRITES_CHANGED:
  2050. this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(this._newSpriteSource)), this._newSpriteSource = null, r10 = null;
  2051. }
  2052. const l9 = t10.getLayerById(r10);
  2053. l9 && s5.push(l9.uid);
  2054. });
  2055. const a8 = this._vectorTileContainer.children;
  2056. if (i6.length > 0) {
  2057. this._vectorTileContainer.deleteStyleLayers(i6);
  2058. for (const e10 of a8)
  2059. e10.deleteLayerData(i6);
  2060. }
  2061. if (this._fetchQueue.resume(), this._parseQueue.resume(), s5.length > 0) {
  2062. const e10 = [];
  2063. for (const t11 of a8) {
  2064. const i7 = this._fetchQueue.push(t11.key).then((e11) => this._parseQueue.push({ key: t11.key, data: e11, styleLayerUIDs: s5 })).then((e11) => t11.setData(e11));
  2065. e10.push(i7);
  2066. }
  2067. await Promise.all(e10);
  2068. }
  2069. this._styleChanges = [], this._isTileHandlerReady = true, this.notifyChange("updating"), this.requestUpdate();
  2070. }
  2071. async _loadStyle() {
  2072. const { style: e9 } = this.layer.currentStyleInfo, t10 = m(e9);
  2073. 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();
  2074. const { signal: s5 } = this._tileHandlerAbortController;
  2075. try {
  2076. this._tileHandlerPromise = this._tileHandler.setStyle(this._styleRepository, t10), await this._tileHandlerPromise;
  2077. } catch (l9) {
  2078. if (!g(l9))
  2079. throw l9;
  2080. }
  2081. if (s5.aborted)
  2082. return this._fetchQueue.resume(), this._parseQueue.resume(), this._isTileHandlerReady = true, this.notifyChange("updating"), void this.requestUpdate();
  2083. const r10 = await this._tileHandler.spriteMosaic;
  2084. this._vectorTileContainer.setStyleResources(r10, this._tileHandler.glyphMosaic, this._styleRepository), this._fetchQueue.resume(), this._parseQueue.resume(), this._isTileHandlerReady = true, this.notifyChange("updating"), this.requestUpdate();
  2085. }
  2086. _createVectorTile(e9) {
  2087. const t10 = this._tileInfoView.getTileBounds(u(), e9);
  2088. return new m3(e9, t10[0], t10[3], 512, 512, this._styleRepository);
  2089. }
  2090. _renderCollisionBoxes(e9) {
  2091. for (const t10 of this._vectorTileContainer.children)
  2092. if (t10.symbols) {
  2093. const i6 = [];
  2094. for (const [e10, s5] of t10.symbols)
  2095. i6.push(...s5);
  2096. o3(e9, i6);
  2097. }
  2098. }
  2099. };
  2100. function b2(e9) {
  2101. if (t(e9))
  2102. return 0;
  2103. switch (e9.type) {
  2104. case "partial":
  2105. return Object.keys(e9.diff).length;
  2106. case "complete":
  2107. return Math.max(Object.keys(e9.oldValue).length, Object.keys(e9.newValue).length);
  2108. case "collection":
  2109. return Object.keys(e9.added).length + Object.keys(e9.changed).length + Object.keys(e9.removed).length;
  2110. }
  2111. }
  2112. 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);
  2113. var I4 = L2;
  2114. export {
  2115. I4 as default
  2116. };
  2117. //# sourceMappingURL=VectorTileLayerView2D-ZRZJKYDW.js.map