chunk-OBOLLK7J.js 80 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954
  1. import {
  2. f as f6
  3. } from "./chunk-CR67YDNV.js";
  4. import {
  5. c as c4,
  6. i as i3,
  7. o as o2
  8. } from "./chunk-3XO4E4TL.js";
  9. import {
  10. K as K2,
  11. S as S2,
  12. c as c5,
  13. d as d3,
  14. g as g3,
  15. h as h2,
  16. p,
  17. u as u4,
  18. y as y3
  19. } from "./chunk-3RTOMVBL.js";
  20. import {
  21. a as a3
  22. } from "./chunk-YJKEIUMW.js";
  23. import {
  24. o
  25. } from "./chunk-GZJP6H3U.js";
  26. import {
  27. E as E3,
  28. e as e4,
  29. l as l5,
  30. l2 as l6,
  31. x
  32. } from "./chunk-PS4B3D6M.js";
  33. import {
  34. n as n3
  35. } from "./chunk-DO6JJUZG.js";
  36. import {
  37. Q,
  38. j2 as j,
  39. n as n2,
  40. q as q2
  41. } from "./chunk-MWIFVNKP.js";
  42. import {
  43. U as U3
  44. } from "./chunk-ZIWBDWEW.js";
  45. import {
  46. R as R3,
  47. d as d2,
  48. r as r4
  49. } from "./chunk-B2HJOMLZ.js";
  50. import {
  51. G,
  52. K,
  53. W,
  54. X as X2,
  55. ae,
  56. ge,
  57. he,
  58. ie as ie2,
  59. se
  60. } from "./chunk-Q4LKAPDF.js";
  61. import {
  62. S
  63. } from "./chunk-23ONSYIH.js";
  64. import {
  65. A
  66. } from "./chunk-P2L4QEOI.js";
  67. import {
  68. c as c3,
  69. f as f5
  70. } from "./chunk-GDB2KX4Y.js";
  71. import {
  72. r as r3
  73. } from "./chunk-T4GXZJ3D.js";
  74. import {
  75. U as U2
  76. } from "./chunk-WFSV2B2I.js";
  77. import {
  78. f as f3,
  79. g as g2
  80. } from "./chunk-M5BTTMP6.js";
  81. import {
  82. C,
  83. E as E2,
  84. F,
  85. I,
  86. R as R2
  87. } from "./chunk-MI7HWWFL.js";
  88. import {
  89. O,
  90. U
  91. } from "./chunk-Q34L5KZA.js";
  92. import {
  93. e as e5
  94. } from "./chunk-ZHRMTKME.js";
  95. import {
  96. t as t3
  97. } from "./chunk-MFFE4I2S.js";
  98. import {
  99. i as i2
  100. } from "./chunk-VAY3LZG7.js";
  101. import {
  102. l as l4
  103. } from "./chunk-4E6K4P67.js";
  104. import {
  105. z
  106. } from "./chunk-P4UZNLD5.js";
  107. import {
  108. $,
  109. L,
  110. X,
  111. fe,
  112. ie
  113. } from "./chunk-FYNVVMWY.js";
  114. import {
  115. t as t2
  116. } from "./chunk-HBMVUVZX.js";
  117. import {
  118. M,
  119. f as f4,
  120. h,
  121. i,
  122. r as r2
  123. } from "./chunk-CRGVDJI6.js";
  124. import {
  125. N,
  126. O as O2,
  127. j as j2
  128. } from "./chunk-QTOOFNRV.js";
  129. import {
  130. a as a2
  131. } from "./chunk-RMX2AZ4P.js";
  132. import {
  133. l as l2
  134. } from "./chunk-YIS6BAC3.js";
  135. import {
  136. E,
  137. e as e3,
  138. l as l3,
  139. q,
  140. s as s2,
  141. u as u3
  142. } from "./chunk-N2663GRX.js";
  143. import {
  144. u as u2
  145. } from "./chunk-WEMIK25H.js";
  146. import {
  147. s as s3
  148. } from "./chunk-7N4X6GF3.js";
  149. import {
  150. c as c2,
  151. f as f2,
  152. l,
  153. s,
  154. v,
  155. y as y2
  156. } from "./chunk-2Z6LERTI.js";
  157. import {
  158. c,
  159. e as e2,
  160. u
  161. } from "./chunk-OWVBLVP3.js";
  162. import {
  163. R,
  164. k2 as k
  165. } from "./chunk-MRJEICT6.js";
  166. import {
  167. d,
  168. e,
  169. n2 as n,
  170. y3 as y
  171. } from "./chunk-Y3WMVFTW.js";
  172. import {
  173. f,
  174. g,
  175. w
  176. } from "./chunk-ULGDPLM2.js";
  177. import {
  178. a,
  179. r,
  180. t
  181. } from "./chunk-GZT4BVFP.js";
  182. // node_modules/@arcgis/core/views/2d/engine/webgl/DirtyMap.js
  183. var t4 = -1;
  184. var e6 = class {
  185. constructor() {
  186. this._dirties = [{ vertexFrom: t4, vertexCount: t4, indexFrom: t4, indexCount: t4, allDirty: false }, { vertexFrom: t4, vertexCount: t4, indexFrom: t4, indexCount: t4, allDirty: false }, { vertexFrom: t4, vertexCount: t4, indexFrom: t4, indexCount: t4, allDirty: false }, { vertexFrom: t4, vertexCount: t4, indexFrom: t4, indexCount: t4, allDirty: false }, { vertexFrom: t4, vertexCount: t4, indexFrom: t4, indexCount: t4, allDirty: false }];
  187. }
  188. hasDirty() {
  189. return this._dirties.some((e12) => e12.indexCount !== t4 || e12.allDirty);
  190. }
  191. markAllClean() {
  192. for (const e12 of this._dirties)
  193. e12.indexFrom = t4, e12.indexCount = t4, e12.vertexFrom = t4, e12.vertexCount = t4, e12.allDirty = false;
  194. }
  195. markAllDirty() {
  196. for (const t11 of this._dirties)
  197. t11.allDirty = true;
  198. }
  199. forEach(e12) {
  200. for (let r8 = 0; r8 < this._dirties.length; ++r8) {
  201. const { indexCount: i5, indexFrom: o7, vertexCount: n7, vertexFrom: x4, allDirty: l8 } = this._dirties[r8], s7 = {};
  202. let d7, m = false;
  203. (l8 || x4 !== t4 && n7 > 0) && (s7.geometry = { count: n7, from: x4, allDirty: l8 }, m = true), (l8 || o7 !== t4 && i5 > 0) && (d7 = { count: i5, from: o7, allDirty: l8 }, m = true), m && e12({ indices: d7, vertices: s7 }, r8);
  204. }
  205. }
  206. markDirtyIndices(e12, r8, i5) {
  207. const o7 = this._dirties[e12], n7 = r8, x4 = i5;
  208. if (!o7.allDirty)
  209. if (o7.indexCount !== t4) {
  210. const t11 = Math.min(o7.indexFrom, n7), e13 = Math.max(o7.indexFrom + o7.indexCount, n7 + x4) - t11;
  211. o7.indexFrom = t11, o7.indexCount = e13;
  212. } else
  213. o7.indexFrom = n7, o7.indexCount = x4;
  214. }
  215. markDirtyVertices(e12, r8, i5, o7) {
  216. const n7 = this._dirties[e12], x4 = i5, l8 = o7;
  217. if (!n7.allDirty)
  218. if (n7.vertexCount !== t4) {
  219. const t11 = Math.min(n7.vertexFrom, x4), e13 = Math.max(n7.vertexFrom + n7.vertexCount, x4 + l8) - t11;
  220. n7.vertexFrom = t11, n7.vertexCount = e13;
  221. } else
  222. n7.vertexFrom = x4, n7.vertexCount = l8;
  223. }
  224. };
  225. // node_modules/@arcgis/core/views/2d/engine/webgl/FreeList.js
  226. var e7 = class {
  227. constructor(e12) {
  228. this._largestRange = null, this._parent = e12, this._updateLargestRange();
  229. }
  230. get largestRange() {
  231. return this._largestRange;
  232. }
  233. rangeCreated(e12) {
  234. (!this._largestRange || e12.count > this._largestRange.count) && (this._largestRange = e12);
  235. }
  236. rangeResized(e12, t11) {
  237. e12 === this._largestRange ? e12.count < t11 && this._updateLargestRange() : (!this._largestRange || e12.count > this._largestRange.count) && (this._largestRange = e12);
  238. }
  239. findBestRange(e12) {
  240. let t11 = this._parent._freeHead, n7 = null;
  241. for (; t11 !== null; )
  242. t11.count >= e12 && (!n7 || t11.count - e12 < n7.count - e12) && (n7 = t11), t11 = t11.next;
  243. return n7;
  244. }
  245. findAdjacentRanges(e12, t11) {
  246. let n7 = true, r8 = false, s7 = null, o7 = this._parent._freeHead;
  247. for (; n7 && !r8; ) {
  248. const a5 = s7 !== null ? s7.from + s7.count : 0, l8 = o7 !== null ? o7.from : this._parent._size;
  249. e12 >= a5 && e12 + t11 <= l8 ? (n7 = false, r8 = true) : o7 !== null ? (s7 = o7, o7 = o7.next) : n7 = false;
  250. }
  251. return [s7, o7];
  252. }
  253. _updateLargestRange() {
  254. let e12 = null, t11 = this._parent._freeHead;
  255. for (; t11 !== null; )
  256. (!e12 || t11.count > e12.count) && (e12 = t11), t11 = t11.next;
  257. this._largestRange = e12;
  258. }
  259. };
  260. var t5 = class {
  261. constructor(t11, n7) {
  262. this._allocated = 0, this._size = t11, this._freeHead = t11 > 0 ? { from: 0, count: t11, prev: null, next: null } : null, this._bookKeeper = n7 || new e7(this), this._freeHead && this._bookKeeper.rangeCreated(this._freeHead);
  263. }
  264. allocate(e12) {
  265. const n7 = this._bookKeeper.findBestRange(e12);
  266. if (n7 === null)
  267. return -1;
  268. const r8 = n7.from, s7 = n7.count;
  269. if (n7.from += e12, n7.count -= e12, this._bookKeeper.rangeResized(n7, r8, s7), this._allocated += e12, n7.count === 0) {
  270. const e13 = n7.prev !== null ? this._freeHead : n7.next;
  271. t5._removeRange(n7), this._freeHead = e13;
  272. }
  273. return r8;
  274. }
  275. free(e12, n7) {
  276. const [r8, s7] = this._bookKeeper.findAdjacentRanges(e12, n7), o7 = { from: e12, count: n7, prev: r8, next: s7 };
  277. if (r8 !== null && (r8.next = o7), s7 !== null && (s7.prev = o7), this._bookKeeper.rangeCreated(o7), this._allocated -= n7, s7 !== null && o7.from + o7.count === s7.from) {
  278. const e13 = o7.from, n8 = o7.count;
  279. t5._fuse(o7, s7), t5._removeRange(s7), this._bookKeeper.rangeResized(o7, e13, n8), this._bookKeeper.rangeResized(s7, void 0, 0);
  280. }
  281. if (r8 !== null && r8.from + r8.count === o7.from) {
  282. const e13 = r8.from, n8 = r8.count;
  283. t5._fuse(r8, o7), t5._removeRange(o7), this._bookKeeper.rangeResized(r8, e13, n8), this._bookKeeper.rangeResized(o7, void 0, 0);
  284. }
  285. this._freeHead = o7.prev !== null ? this._freeHead : o7;
  286. }
  287. get fragmentation() {
  288. const e12 = this._size - this._allocated;
  289. if (e12 === 0)
  290. return 0;
  291. return 1 - this._bookKeeper.largestRange.count / e12;
  292. }
  293. static _removeRange(e12) {
  294. e12.prev !== null ? e12.next !== null ? (e12.prev.next = e12.next, e12.next.prev = e12.prev) : e12.prev.next = null : e12.next !== null && (e12.next.prev = null);
  295. }
  296. static _fuse(e12, t11) {
  297. e12.count += t11.count, e12.next = t11.next, t11.from += t11.count, t11.count = 0, t11.next !== null && (t11.next.prev = e12);
  298. }
  299. };
  300. // node_modules/@arcgis/core/views/2d/engine/webgl/DisplayRecordStore.js
  301. var s4 = ["FILL", "LINE", "MARKER", "TEXT", "LABEL"];
  302. function o3(e12) {
  303. const t11 = e12.getStrides(), r8 = {};
  304. for (let i5 = 0; i5 < t11.length; i5++)
  305. r8[s4[i5]] = t11[i5];
  306. return r8;
  307. }
  308. var n4 = 0.5;
  309. var d4 = class {
  310. constructor(r8, i5, s7, o7) {
  311. this._strides = r8, this._displayList = i5, this._freeListsAndStorage = {}, this._dirtyMap = null, this._dirtyMap = s7;
  312. for (const n7 in r8) {
  313. this._freeListsAndStorage[n7] = { vtxFreeList: o7 ? new t5(o7) : null, idxFreeList: o7 ? new t5(o7) : null, vertexBuffers: {}, indexBuffer: o7 ? new Uint32Array(o7) : null };
  314. for (const e12 in r8[n7])
  315. this._freeListsAndStorage[n7].vertexBuffers[e12] = { data: o7 ? K(o7, r8[n7][e12]) : null, stride: r8[n7][e12] };
  316. }
  317. }
  318. static fromTileData(t11, i5) {
  319. const n7 = o3(t11), a5 = [0, 0, 0, 0, 0], x4 = [0, 0, 0, 0, 0], u5 = t11.tileDisplayData.displayObjects;
  320. for (const e12 of u5)
  321. for (const t12 of e12.displayRecords)
  322. a5[t12.geometryType] = Math.max(a5[t12.geometryType], t12.vertexFrom + t12.vertexCount), x4[t12.geometryType] = Math.max(x4[t12.geometryType], t12.indexFrom + t12.indexCount);
  323. const f11 = new d4(n7, t11.tileDisplayData.displayList, i5, null);
  324. for (let o7 = 0; o7 < t11.tileBufferData.geometries.length; ++o7) {
  325. const i6 = a5[o7], n8 = x4[o7], d7 = t11.tileBufferData.geometries[o7], u6 = s4[o7], l8 = f11._storageFor(u6), c6 = t11.tileBufferData.geometries[o7].indexBuffer;
  326. let m;
  327. l8.indexBuffer = c6, l8.idxFreeList = new t5(c6.length), l8.idxFreeList.allocate(n8);
  328. for (const e12 in d7.vertexBuffer) {
  329. const i7 = t11.tileBufferData.geometries[o7].vertexBuffer[e12];
  330. l8.vertexBuffers[e12].data = i7.data, l8.vertexBuffers[e12].stride = i7.stride;
  331. const s7 = X2(i7.stride), n9 = i7.data.length * s7 / i7.stride;
  332. m || (m = n9);
  333. }
  334. l8.vtxFreeList = new t5(m), l8.vtxFreeList.allocate(i6);
  335. }
  336. return f11;
  337. }
  338. delete(e12) {
  339. const t11 = s4[e12.geometryType];
  340. this._freeVertices(t11, e12.vertexFrom, e12.vertexCount), this._freeIndices(t11, e12.indexFrom, e12.indexCount), this._displayList.removeFromList(e12), e12.vertexFrom = void 0, e12.indexFrom = void 0;
  341. }
  342. setMeshData(e12, t11, r8, o7, n7) {
  343. const d7 = s4[e12.geometryType];
  344. let a5, x4;
  345. e12.meshData = null, e12.vertexFrom === void 0 ? (x4 = t11.vertexCount, a5 = this._allocateVertices(d7, x4)) : t11.vertexCount > e12.vertexCount ? (this._freeVertices(d7, e12.vertexFrom, e12.vertexCount), x4 = t11.vertexCount, a5 = this._allocateVertices(d7, x4)) : t11.vertexCount === e12.vertexCount ? (a5 = e12.vertexFrom, x4 = e12.vertexCount) : (this._freeVertices(d7, e12.vertexFrom + t11.vertexCount, e12.vertexCount - t11.vertexCount), a5 = e12.vertexFrom, x4 = t11.vertexCount);
  346. let u5, f11, l8, c6 = true;
  347. if (e12.indexFrom === void 0 ? (u5 = n7, l8 = t11.indexCount, f11 = this._allocateIndices(d7, l8)) : t11.indexCount > e12.indexCount ? (u5 = this._displayList.removeFromList(e12), this._freeIndices(d7, e12.indexFrom, e12.indexCount), l8 = t11.indexCount, f11 = this._allocateIndices(d7, l8)) : t11.indexCount === e12.indexCount ? (c6 = false, f11 = e12.indexFrom, l8 = e12.indexCount) : (u5 = this._displayList.removeFromList(e12), this._freeIndices(d7, e12.indexFrom + t11.indexCount, e12.indexCount - t11.indexCount), f11 = e12.indexFrom, l8 = t11.indexCount), a5 !== -1 && f11 !== -1) {
  348. const s7 = this._storageFor(d7);
  349. if (ae(a5, f11, s7.vertexBuffers, s7.indexBuffer, t11, r8, o7), e12.vertexFrom = a5, e12.indexFrom = f11, e12.vertexCount = t11.vertexCount, e12.indexCount = t11.indexCount, this._dirtyMap) {
  350. this._dirtyMap.markDirtyIndices(e12.geometryType, e12.indexFrom, e12.indexCount);
  351. for (const t12 in r8)
  352. this._dirtyMap.markDirtyVertices(e12.geometryType, t12, e12.vertexFrom, e12.vertexCount);
  353. }
  354. return c6 && this._displayList.addToList(e12, u5), true;
  355. }
  356. return a5 !== -1 && this._freeVertices(d7, a5, x4), f11 !== -1 && this._freeIndices(d7, f11, l8), e12.setMeshDataFromBuffers(t11, r8, o7), e12.vertexFrom = void 0, e12.vertexCount = 0, e12.indexFrom = void 0, e12.indexCount = 0, false;
  357. }
  358. tryAddMeshData(e12, t11) {
  359. const r8 = t11.vertexBuffer, o7 = t11.indexBuffer, n7 = s4[e12.geometryType], d7 = this._allocateVertices(n7, e12.vertexCount);
  360. if (d7 === -1)
  361. return this._freeVertices(n7, d7, e12.vertexCount), false;
  362. const a5 = this._allocateIndices(n7, e12.indexCount);
  363. if (a5 === -1)
  364. return this._freeVertices(n7, d7, e12.vertexCount), this._freeIndices(n7, a5, e12.indexCount), false;
  365. const x4 = this._storageFor(n7);
  366. if (ae(d7, a5, x4.vertexBuffers, x4.indexBuffer, e12, r8, o7), e12.vertexFrom = d7, e12.indexFrom = a5, this._dirtyMap) {
  367. this._dirtyMap.markDirtyIndices(e12.geometryType, e12.indexFrom, e12.indexCount);
  368. for (const t12 in r8)
  369. this._dirtyMap.markDirtyVertices(e12.geometryType, t12, d7, e12.vertexCount);
  370. }
  371. return this._displayList.addToList(e12), true;
  372. }
  373. _allocateVertices(e12, t11) {
  374. const r8 = this._storageFor(e12), i5 = r8.vtxFreeList.allocate(t11);
  375. if (i5 === -1)
  376. return -1;
  377. return r8.vtxFreeList.fragmentation > n4 ? -1 : i5;
  378. }
  379. _freeVertices(e12, t11, r8) {
  380. this._storageFor(e12).vtxFreeList.free(t11, r8);
  381. }
  382. _freeIndices(e12, t11, r8) {
  383. this._storageFor(e12).idxFreeList.free(t11, r8);
  384. }
  385. _allocateIndices(e12, t11) {
  386. const r8 = this._storageFor(e12), i5 = r8.idxFreeList.allocate(t11);
  387. if (i5 === -1)
  388. return -1;
  389. return r8.idxFreeList.fragmentation > n4 ? -1 : i5;
  390. }
  391. _storageFor(e12) {
  392. return this._freeListsAndStorage[e12];
  393. }
  394. _stridesFor(e12, t11) {
  395. return this._strides[e12][t11];
  396. }
  397. };
  398. // node_modules/@arcgis/core/views/2d/engine/webgl/WGLBuffers.js
  399. var f7 = class {
  400. constructor(a5) {
  401. this.geometryMap = ie2(() => ({ indexBuffer: c3.createIndex(a5, F.STATIC_DRAW), vao: null }), (e12, s7) => ({ vertexBuffer: c3.createVertex(a5, se[s7]) }));
  402. }
  403. dispose() {
  404. for (let e12 = 0; e12 < 5; e12++) {
  405. const t11 = this.geometryMap[e12];
  406. if (t11) {
  407. t11.data.vao && t11.data.vao.dispose(false), t11.data.indexBuffer && t11.data.indexBuffer.dispose();
  408. for (const e13 in t11.buffers)
  409. t11.buffers[e13] && t11.buffers[e13].data.vertexBuffer.dispose();
  410. }
  411. }
  412. }
  413. get(e12) {
  414. const t11 = this.geometryMap[e12];
  415. return { getVAO(e13, r8, s7) {
  416. if (!t11.data.vao) {
  417. const f11 = {};
  418. for (const e14 in t11.buffers)
  419. f11[e14] = t11.buffers[e14].data.vertexBuffer;
  420. t11.data.vao = new f5(e13, s7, r8, f11, t11.data.indexBuffer);
  421. }
  422. return t11.data.vao;
  423. } };
  424. }
  425. has(e12) {
  426. return this.geometryMap[e12] != null;
  427. }
  428. upload(e12, t11) {
  429. t11.forEach((t12, r8) => {
  430. this._upload(t12, r8, e12);
  431. });
  432. }
  433. _upload(e12, t11, r8) {
  434. if (e12.indices && (e12.indices.allDirty ? this._uploadIndices(r8, t11) : e12.indices.from != null && e12.indices.count != null && this._uploadIndices(r8, t11, e12.indices.from, e12.indices.count)), e12.vertices) {
  435. const s7 = e12.vertices;
  436. for (const e13 in s7) {
  437. const a5 = s7[e13];
  438. a5.allDirty ? this._uploadVertices(r8, t11, e13) : a5.from != null && a5.count != null && this._uploadVertices(r8, t11, e13, a5.from, a5.count);
  439. }
  440. }
  441. }
  442. _uploadVertices(e12, t11, r8, s7, a5) {
  443. const f11 = this.geometryMap[t11];
  444. if (!f11)
  445. return;
  446. const o7 = e12.geometries[t11].vertexBuffer[r8];
  447. if (!o7)
  448. return;
  449. const i5 = o7.stride, n7 = o7.data.buffer;
  450. f11.buffers[r8] && n7.byteLength > 0 && (s7 != null && a5 != null ? f11.buffers[r8].data.vertexBuffer.setSubData(n7, s7 * i5, s7 * i5, (s7 + a5) * i5) : f11.buffers[r8].data.vertexBuffer.setData(n7));
  451. }
  452. _uploadIndices(e12, t11, r8, s7) {
  453. const a5 = this.geometryMap[t11];
  454. if (!a5)
  455. return;
  456. const f11 = 4, o7 = e12.geometries[t11].indexBuffer.buffer;
  457. a5.data.indexBuffer && o7.byteLength > 0 && (r8 != null && s7 != null ? a5.data.indexBuffer.setSubData(o7, r8 * f11, r8 * f11, (r8 + s7) * f11) : a5.data.indexBuffer.setData(o7));
  458. }
  459. };
  460. // node_modules/@arcgis/core/views/2d/engine/webgl/GraphicTile.js
  461. var a4 = class extends c4 {
  462. constructor() {
  463. super(...arguments), this._data = null, this._displayList = null, this._lastCommitTime = 0, this._hasData = false, this._invalidated = false, this._wglBuffers = null, this._dirtyMap = new e6();
  464. }
  465. destroy() {
  466. super.destroy(), this.clear();
  467. }
  468. get hasData() {
  469. return !!this._hasData;
  470. }
  471. get displayObjects() {
  472. return this._displayObjects ?? [];
  473. }
  474. getGeometry(t11) {
  475. return this._wglBuffers && this._wglBuffers.has(t11) ? this._wglBuffers.get(t11) : null;
  476. }
  477. getDisplayList() {
  478. return this._displayList;
  479. }
  480. patch(e12) {
  481. if (e12.clear === true)
  482. return this.clear(), void (this._hasData = false);
  483. const i5 = e12.addOrUpdate, a5 = e12.remove;
  484. !this._data && i5 && i5.tileDisplayData.displayObjects.length ? (i5.tileDisplayData.computeDisplayList(), this._dirtyMap = new e6(), this._dispRecStore = d4.fromTileData(i5, this._dirtyMap), this._data = i5, this._dirtyMap.markAllDirty(), this._hasData = true, e12.end && this.ready()) : this._data && (i5 && i5.tileDisplayData.displayObjects.length || a5.length) ? this._doPatchData(e12) : e12.end && this.ready(), e12.end && !this._data && this.clear(), this.requestRender(), this.emit("change");
  485. }
  486. commit(t11) {
  487. t11.time && t11.time === this._lastCommitTime || (this._lastCommitTime = t11.time, this.visible && this._data && (this._wglBuffers || (this._wglBuffers = new f7(t11.context)), (this._dirtyMap.hasDirty() || this._invalidated) && (this._invalidated = false, this._wglBuffers.upload(this._data.tileBufferData, this._dirtyMap), this._displayList = this._data.tileDisplayData.displayList.clone(), this._displayObjects = this._data.tileDisplayData.displayObjects.slice(), this._dirtyMap.markAllClean())));
  488. }
  489. clear() {
  490. this._data = null, this._displayList = null, this._dispRecStore = null, this._wglBuffers && (this._wglBuffers.dispose(), this._wglBuffers = null);
  491. }
  492. _doPatchData(t11) {
  493. this._invalidated = true, this._patchData(t11) || (this._dirtyMap.markAllDirty(), this._data.reshuffle(), this._dispRecStore = d4.fromTileData(this._data, this._dirtyMap)), this.requestRender();
  494. }
  495. _patchData(t11) {
  496. let s7 = true;
  497. const e12 = t11.addOrUpdate && t11.addOrUpdate.tileDisplayData && t11.addOrUpdate.tileDisplayData.displayObjects || [], i5 = (t11.remove || []).slice();
  498. for (const a5 of e12)
  499. a5.insertAfter != null && i5.push(a5.id);
  500. for (const a5 of i5) {
  501. const t12 = this._data.tileDisplayData.displayObjectRegistry.get(a5);
  502. if (t12) {
  503. this._data.tileDisplayData.displayList.removeFromList(t12.displayRecords);
  504. for (const e13 of t12.displayRecords)
  505. this._dispRecStore.delete(e13);
  506. this._data.tileDisplayData.displayObjectRegistry.delete(a5);
  507. const s8 = this._data.tileDisplayData.displayObjects.indexOf(t12);
  508. this._data.tileDisplayData.displayObjects.splice(s8, 1);
  509. }
  510. }
  511. for (const a5 of e12) {
  512. let e13, i6 = this._data.tileDisplayData.displayObjectRegistry.get(a5.id);
  513. if (i6) {
  514. const t12 = i6.displayRecords;
  515. i6.set(a5), i6.displayRecords = t12;
  516. const s8 = i6.displayRecords.length;
  517. for (let e14 = 0; e14 < s8; ++e14) {
  518. const t13 = i6.displayRecords[e14], s9 = a5.displayRecords[e14];
  519. (e14 >= a5.displayRecords.length || t13.geometryType !== s9.geometryType || t13.symbolLevel !== s9.symbolLevel || t13.zOrder !== s9.zOrder || t13.materialKey !== s9.materialKey) && (this._dispRecStore.delete(i6.displayRecords[e14]), e14 < a5.displayRecords.length && (i6.displayRecords[e14] = void 0));
  520. }
  521. i6.displayRecords.length = a5.displayRecords.length;
  522. } else {
  523. let t12;
  524. i6 = a5.copy(), i6.displayRecords = [], this._data.tileDisplayData.displayObjectRegistry.set(a5.id, i6);
  525. const s8 = this._data.tileDisplayData.displayObjects;
  526. if (i6.insertAfter != null)
  527. if (e13 = {}, i6.insertAfter >= 0) {
  528. const e14 = this._data.tileDisplayData.displayObjectRegistry.get(i6.insertAfter);
  529. e14 ? (t12 = s8.indexOf(e14) + 1, t12 < s8.length ? s8.splice(t12, 0, i6) : (s8.push(i6), t12 = s8.length)) : (s8.push(i6), t12 = s8.length);
  530. } else
  531. s8.unshift(i6), t12 = 0;
  532. else
  533. s8.push(i6), t12 = s8.length;
  534. if (e13) {
  535. const i7 = a5.displayRecords.length > 0 ? 1 : 0;
  536. let l9 = 0;
  537. for (let a6 = t12 - 1; a6 >= 0 && l9 < i7; --a6)
  538. for (let t13 = s8[a6].displayRecords.length - 1; t13 >= 0 && l9 < i7; --t13) {
  539. const i8 = s8[a6].displayRecords[t13], d7 = this._data.tileDisplayData.displayList.getDPInfoType();
  540. e13[d7] || (e13[d7] = i8, ++l9);
  541. }
  542. }
  543. }
  544. const l8 = a5.displayRecords.length;
  545. for (let d7 = 0; d7 < l8; ++d7) {
  546. const l9 = a5.displayRecords[d7];
  547. let r8 = i6.displayRecords[d7];
  548. r8 ? (r8.meshData = l9.meshData, r8.materialKey = l9.materialKey) : (r8 = l9.copy(), r8.vertexFrom = void 0, r8.indexFrom = void 0, i6.displayRecords[d7] = r8);
  549. const p3 = l9.geometryType, h4 = this._data.tileDisplayData.displayList.getDPInfoType(), o7 = t11.addOrUpdate.tileBufferData.geometries[p3], y7 = o7.vertexBuffer, c6 = o7.indexBuffer;
  550. let n7;
  551. e13 && (n7 = e13[h4] ? this._data.tileDisplayData.displayList.splitAfter(e13[h4]) : -1), s7 = this._dispRecStore.setMeshData(r8, l9, y7, c6, n7) && s7, e13 && r8.indexFrom != null && r8.indexFrom != null && (e13[h4] = r8);
  552. }
  553. }
  554. return s7;
  555. }
  556. };
  557. // node_modules/@arcgis/core/views/2d/engine/webgl/MemoryRequirements.js
  558. var e8 = class {
  559. constructor() {
  560. this._byGeometryType = null;
  561. }
  562. get satisfied() {
  563. return !this._byGeometryType;
  564. }
  565. reset() {
  566. this._byGeometryType = null;
  567. }
  568. verticesFor(e12) {
  569. return this._byGeometryType ? this._byGeometryType[e12].vertices : 0;
  570. }
  571. indicesFor(e12) {
  572. return this._byGeometryType ? this._byGeometryType[e12].indices : 0;
  573. }
  574. needMore(e12, t11, i5) {
  575. if (!t11 && !i5)
  576. return;
  577. this._byGeometryType || (this._byGeometryType = [{ vertices: 0, indices: 0 }, { vertices: 0, indices: 0 }, { vertices: 0, indices: 0 }, { vertices: 0, indices: 0 }, { vertices: 0, indices: 0 }]);
  578. const s7 = this._byGeometryType[e12];
  579. s7.vertices += t11, s7.indices += i5;
  580. }
  581. };
  582. // node_modules/@arcgis/core/views/2d/engine/webgl/TileBufferData.js
  583. var r5 = 5;
  584. var f8 = class {
  585. constructor() {
  586. this.geometries = [{ indexBuffer: void 0, vertexBuffer: {} }, { indexBuffer: void 0, vertexBuffer: {} }, { indexBuffer: void 0, vertexBuffer: {} }, { indexBuffer: void 0, vertexBuffer: {} }, { indexBuffer: void 0, vertexBuffer: {} }];
  587. }
  588. clone() {
  589. const e12 = new f8();
  590. for (let r8 = 0; r8 < this.geometries.length; r8++) {
  591. const f11 = this.geometries[r8], t11 = e12.geometries[r8];
  592. t11.indexBuffer = f11.indexBuffer.slice(), t11.vertexBuffer = {};
  593. for (const e13 in f11.vertexBuffer) {
  594. const { data: r9, stride: i5 } = f11.vertexBuffer[e13];
  595. t11.vertexBuffer[e13] = { data: r9.slice(), stride: i5 };
  596. }
  597. }
  598. return e12;
  599. }
  600. static deserialize(t11) {
  601. const i5 = new f8();
  602. for (let f11 = 0; f11 < r5; ++f11) {
  603. i5.geometries[f11].indexBuffer = new Uint32Array(t11.geometries[f11].indexBuffer), i5.geometries[f11].vertexBuffer = {};
  604. for (const r8 in t11.geometries[f11].vertexBuffer)
  605. i5.geometries[f11].vertexBuffer[r8] = { data: W(t11.geometries[f11].vertexBuffer[r8].data, t11.geometries[f11].vertexBuffer[r8].stride), stride: t11.geometries[f11].vertexBuffer[r8].stride };
  606. }
  607. return i5;
  608. }
  609. serialize() {
  610. const e12 = { geometries: [{ indexBuffer: this.geometries[0].indexBuffer.buffer, vertexBuffer: {} }, { indexBuffer: this.geometries[1].indexBuffer.buffer, vertexBuffer: {} }, { indexBuffer: this.geometries[2].indexBuffer.buffer, vertexBuffer: {} }, { indexBuffer: this.geometries[3].indexBuffer.buffer, vertexBuffer: {} }, { indexBuffer: this.geometries[4].indexBuffer.buffer, vertexBuffer: {} }] };
  611. for (let f11 = 0; f11 < r5; ++f11)
  612. for (const r8 in this.geometries[f11].vertexBuffer)
  613. e12.geometries[f11].vertexBuffer[r8] = { data: this.geometries[f11].vertexBuffer[r8].data.buffer, stride: this.geometries[f11].vertexBuffer[r8].stride };
  614. return e12;
  615. }
  616. getBuffers() {
  617. const e12 = [];
  618. for (let f11 = 0; f11 < r5; ++f11) {
  619. e12.push(this.geometries[f11].indexBuffer.buffer);
  620. for (const r8 in this.geometries[f11].vertexBuffer)
  621. e12.push(this.geometries[f11].vertexBuffer[r8].data.buffer);
  622. }
  623. return e12;
  624. }
  625. };
  626. // node_modules/@arcgis/core/views/2d/engine/webgl/GraphicDisplayList.js
  627. function t6(e12, t11, n7, ...o7) {
  628. t11 < e12.length ? e12.splice(t11, n7, ...o7) : e12.push(...o7);
  629. }
  630. var n5 = class {
  631. constructor() {
  632. this.symbolLevels = [];
  633. }
  634. replay(t11, n7, o7) {
  635. for (const i5 of this.symbolLevels)
  636. for (const r8 of i5.zLevels) {
  637. const i6 = r8.geometryDPInfo.unified;
  638. if (i6)
  639. for (const r9 of i6) {
  640. const { geometryType: i7, materialKey: l8, indexFrom: s7, indexCount: m } = r9, y7 = U3.load(l8).symbologyType, d7 = t11.painter.getBrush(i7, y7), u5 = { geometryType: i7, materialKey: l8, indexFrom: s7, indexCount: m, target: n7.getGeometry(i7) };
  641. d7.prepareState(t11, n7), d7.drawGeometry(t11, n7, u5, o7);
  642. }
  643. }
  644. }
  645. get empty() {
  646. return !this.symbolLevels || this.symbolLevels.length === 0;
  647. }
  648. clear() {
  649. this.symbolLevels.length = 0;
  650. }
  651. addToList(e12, t11) {
  652. if (Array.isArray(e12))
  653. for (const n7 of e12)
  654. this._addToList(n7, t11);
  655. else
  656. this._addToList(e12, t11);
  657. }
  658. removeFromList(e12) {
  659. Array.isArray(e12) || (e12 = [e12]);
  660. let t11 = null;
  661. for (const n7 of e12)
  662. t11 = this._removeFromList(n7);
  663. return t11;
  664. }
  665. clone() {
  666. const e12 = new n5();
  667. for (const t11 of this.symbolLevels)
  668. e12.symbolLevels.push(t11.clone());
  669. return e12;
  670. }
  671. splitAfter(e12) {
  672. const t11 = this._getDisplayList(e12.symbolLevel, e12.zOrder), n7 = t11.length, i5 = e12.indexFrom + e12.indexCount;
  673. for (let r8 = 0; r8 < n7; ++r8) {
  674. const n8 = t11[r8];
  675. if (n8.geometryType === e12.geometryType && i5 > n8.indexFrom && i5 <= n8.indexFrom + n8.indexCount) {
  676. if (i5 < n8.indexFrom + n8.indexCount) {
  677. const e13 = new o4();
  678. e13.geometryType = n8.geometryType, e13.materialKey = n8.materialKey, e13.indexFrom = i5, e13.indexCount = n8.indexFrom + n8.indexCount - i5, t11.splice(r8 + 1, 0, e13), n8.indexCount = i5 - n8.indexFrom;
  679. }
  680. return r8;
  681. }
  682. }
  683. }
  684. _addToList(e12, n7) {
  685. const i5 = e12.symbolLevel, r8 = e12.zOrder, l8 = this._getDisplayList(i5, r8), s7 = n7 != null ? n7 : l8.length - 1, m = s7 >= 0 && s7 < l8.length ? l8[s7] : null;
  686. if (m !== null && m.materialKey === e12.materialKey && m.indexFrom + m.indexCount === e12.indexFrom && m.geometryType === e12.geometryType)
  687. m.indexCount += e12.indexCount;
  688. else {
  689. const n8 = new o4();
  690. n8.indexFrom = e12.indexFrom, n8.indexCount = e12.indexCount, n8.materialKey = e12.materialKey, n8.geometryType = e12.geometryType, t6(l8, s7 + 1, 0, n8);
  691. }
  692. }
  693. _removeFromList(e12) {
  694. const n7 = e12.symbolLevel, i5 = e12.zOrder, r8 = this._getDisplayList(n7, i5), l8 = r8.length;
  695. let s7;
  696. for (let t11 = 0; t11 < l8; ++t11) {
  697. const n8 = r8[t11];
  698. if (e12.indexFrom + e12.indexCount > n8.indexFrom && e12.indexFrom < n8.indexFrom + n8.indexCount && n8.geometryType === e12.geometryType) {
  699. s7 = t11;
  700. break;
  701. }
  702. }
  703. if (s7 !== void 0) {
  704. const n8 = r8[s7];
  705. if (e12.indexFrom === n8.indexFrom)
  706. return n8.indexCount -= e12.indexCount, n8.indexFrom += e12.indexCount, n8.indexCount === 0 && t6(r8, s7, 1), s7 - 1;
  707. if (e12.indexFrom + e12.indexCount === n8.indexFrom + n8.indexCount)
  708. return n8.indexCount -= e12.indexCount, n8.indexCount === 0 ? (t6(r8, s7, 1), s7 - 1) : s7;
  709. {
  710. const i6 = n8.indexFrom, l9 = e12.indexFrom - n8.indexFrom, m = e12.indexCount, y7 = n8.indexFrom + n8.indexCount - (e12.indexFrom + e12.indexCount);
  711. n8.indexCount = l9;
  712. const d7 = new o4();
  713. return d7.geometryType = n8.geometryType, d7.materialKey = n8.materialKey, d7.indexFrom = i6 + l9 + m, d7.indexCount = y7, t6(r8, s7 + 1, 0, d7), s7;
  714. }
  715. }
  716. return null;
  717. }
  718. _getDisplayList(e12, t11) {
  719. let n7;
  720. const o7 = this.symbolLevels.length;
  721. for (let i5 = 0; i5 < o7; i5++)
  722. if (this.symbolLevels[i5].symbolLevel === e12) {
  723. n7 = this.symbolLevels[i5];
  724. break;
  725. }
  726. let s7;
  727. n7 || (n7 = new l7(), n7.symbolLevel = e12, this.symbolLevels.push(n7));
  728. const m = n7.zLevels.length;
  729. for (let i5 = 0; i5 < m; i5++)
  730. if (n7.zLevels[i5].zLevel === t11) {
  731. s7 = n7.zLevels[i5];
  732. break;
  733. }
  734. return s7 || (s7 = new r6(), s7.geometryDPInfo = new i4(), s7.zLevel = t11, n7.zLevels.push(s7)), s7.geometryDPInfo.unified || (s7.geometryDPInfo.unified = []), s7.geometryDPInfo.unified;
  735. }
  736. getDPInfoType() {
  737. return "unified";
  738. }
  739. };
  740. var o4 = class {
  741. constructor() {
  742. this.materialKey = null, this.indexFrom = 0, this.indexCount = 0;
  743. }
  744. clone() {
  745. const e12 = new o4();
  746. return e12.geometryType = this.geometryType, e12.materialKey = this.materialKey, e12.indexFrom = this.indexFrom, e12.indexCount = this.indexCount, e12;
  747. }
  748. };
  749. var i4 = class {
  750. constructor() {
  751. this.fill = null, this.line = null, this.marker = null, this.text = null, this.label = null, this.unified = null;
  752. }
  753. clone() {
  754. const e12 = new i4();
  755. return e12.fill = this.fill && this.fill.map((e13) => e13.clone()), e12.line = this.line && this.line.map((e13) => e13.clone()), e12.marker = this.marker && this.marker.map((e13) => e13.clone()), e12.text = this.text && this.text.map((e13) => e13.clone()), e12.label = this.label && this.label.map((e13) => e13.clone()), e12.unified = this.unified && this.unified.map((e13) => e13.clone()), e12;
  756. }
  757. };
  758. var r6 = class {
  759. constructor() {
  760. this.geometryDPInfo = new i4();
  761. }
  762. clone() {
  763. const e12 = new r6();
  764. return e12.zLevel = this.zLevel, e12.geometryDPInfo = this.geometryDPInfo.clone(), e12;
  765. }
  766. };
  767. var l7 = class {
  768. constructor() {
  769. this.zLevels = [];
  770. }
  771. clone() {
  772. const e12 = new l7();
  773. e12.symbolLevel = this.symbolLevel;
  774. for (const t11 of this.zLevels)
  775. e12.zLevels.push(t11.clone());
  776. return e12;
  777. }
  778. };
  779. // node_modules/@arcgis/core/views/2d/engine/webgl/MeshData.js
  780. var t7 = class {
  781. constructor() {
  782. this.vertexData = new Map(), this.vertexCount = 0, this.indexData = [];
  783. }
  784. clear() {
  785. this.vertexData.clear(), this.vertexCount = 0, this.indexData = [];
  786. }
  787. update(t11, e12, a5) {
  788. for (const s7 in t11)
  789. this.vertexData.set(s7, t11[s7]);
  790. for (const s7 in this.vertexData)
  791. t11[s7] === null && this.vertexData.delete(s7);
  792. this.vertexCount = e12, this.indexData = a5;
  793. }
  794. };
  795. // node_modules/@arcgis/core/views/2d/engine/webgl/WGLDisplayRecord.js
  796. var s5 = class {
  797. constructor(t11, e12, s7, r8 = 0, i5 = 0) {
  798. this.id = t11, this.geometryType = e12, this.materialKey = s7, this.minZoom = r8, this.maxZoom = i5, this.meshData = null, this.symbolLevel = 0, this.zOrder = 0, this.vertexFrom = 0, this.vertexCount = 0, this.indexFrom = 0, this.indexCount = 0;
  799. }
  800. get sortKey() {
  801. return this._sortKey === void 0 && this._computeSortKey(), this._sortKey;
  802. }
  803. clone() {
  804. return this.copy();
  805. }
  806. copy() {
  807. const t11 = new s5(this.id, this.geometryType, this.materialKey);
  808. return t11.vertexFrom = this.vertexFrom, t11.vertexCount = this.vertexCount, t11.indexFrom = this.indexFrom, t11.indexCount = this.indexCount, t11.zOrder = this.zOrder, t11.symbolLevel = this.symbolLevel, t11.meshData = this.meshData, t11.minZoom = this.minZoom, t11.maxZoom = this.maxZoom, t11;
  809. }
  810. setMeshDataFromBuffers(s7, r8, i5) {
  811. const o7 = new t7();
  812. for (const t11 in r8) {
  813. const i6 = r8[t11].stride, a5 = r8[t11].data, h4 = [], n7 = X2(i6);
  814. for (let t12 = 0; t12 < i6 * s7.vertexCount / n7; ++t12)
  815. h4[t12] = a5[t12 + i6 * s7.vertexFrom / n7];
  816. o7.vertexData.set(t11, h4);
  817. }
  818. o7.indexData.length = 0;
  819. for (let t11 = 0; t11 < s7.indexCount; ++t11)
  820. o7.indexData[t11] = i5[t11 + s7.indexFrom] - s7.vertexFrom;
  821. o7.vertexCount = s7.vertexCount, this.meshData = o7;
  822. }
  823. readMeshDataFromBuffers(s7, r8) {
  824. this.meshData ? this.meshData.clear() : this.meshData = new t7();
  825. for (const t11 in s7) {
  826. const r9 = s7[t11].stride, i5 = s7[t11].data, o7 = [], a5 = X2(r9);
  827. for (let t12 = 0; t12 < r9 * this.vertexCount / a5; ++t12)
  828. o7[t12] = i5[t12 + r9 * this.vertexFrom / a5];
  829. this.meshData.vertexData.set(t11, o7);
  830. }
  831. this.meshData.indexData.length = 0;
  832. for (let t11 = 0; t11 < this.indexCount; ++t11)
  833. this.meshData.indexData[t11] = r8[t11 + this.indexFrom] - this.vertexFrom;
  834. this.meshData.vertexCount = this.vertexCount;
  835. }
  836. writeMeshDataToBuffers(t11, s7, r8, i5) {
  837. for (const o7 in s7) {
  838. const r9 = s7[o7].stride, i6 = this.meshData.vertexData.get(o7), a5 = s7[o7].data, h4 = X2(r9);
  839. for (let e12 = 0; e12 < r9 * this.meshData.vertexCount / h4; ++e12)
  840. a5[e12 + r9 * t11 / h4] = i6[e12];
  841. }
  842. for (let e12 = 0; e12 < this.meshData.indexData.length; ++e12)
  843. i5[e12 + r8] = this.meshData.indexData[e12] + t11;
  844. this.vertexFrom = t11, this.vertexCount = this.meshData.vertexCount, this.indexFrom = r8, this.indexCount = this.meshData.indexData.length;
  845. }
  846. static writeAllMeshDataToBuffers(t11, e12, s7) {
  847. let r8 = 0, i5 = 0;
  848. for (const o7 of t11)
  849. o7.writeMeshDataToBuffers(r8, e12, i5, s7), r8 += o7.vertexCount, i5 += o7.indexCount;
  850. }
  851. _computeSortKey() {
  852. this._sortKey = (31 & this.symbolLevel) << 12 | (127 & this.zOrder) << 4 | 7 & this.geometryType;
  853. }
  854. serialize(t11) {
  855. return t11.push(this.geometryType), t11.push(this.materialKey), t11.push(this.vertexFrom), t11.push(this.vertexCount), t11.push(this.indexFrom), t11.push(this.indexCount), t11.push(this.minZoom), t11.push(this.maxZoom), t11;
  856. }
  857. static deserialize(t11, e12) {
  858. const r8 = t11.readInt32(), i5 = t11.readInt32(), o7 = new s5(e12.id, r8, i5);
  859. return o7.vertexFrom = t11.readInt32(), o7.vertexCount = t11.readInt32(), o7.indexFrom = t11.readInt32(), o7.indexCount = t11.readInt32(), o7.minZoom = t11.readInt32(), o7.maxZoom = t11.readInt32(), o7;
  860. }
  861. };
  862. // node_modules/@arcgis/core/views/2d/engine/webgl/util/serializationUtils.js
  863. function e9(e12, n7) {
  864. if (n7 !== null) {
  865. e12.push(n7.length);
  866. for (const r8 of n7)
  867. r8.serialize(e12);
  868. return e12;
  869. }
  870. e12.push(0);
  871. }
  872. function n6(e12, n7, r8) {
  873. const t11 = e12.readInt32(), o7 = new Array(t11);
  874. for (let i5 = 0; i5 < o7.length; i5++)
  875. o7[i5] = n7.deserialize(e12, r8);
  876. return o7;
  877. }
  878. // node_modules/@arcgis/core/views/2d/engine/webgl/WGLDisplayObject.js
  879. var e10 = class {
  880. constructor(s7) {
  881. this.insertAfter = null, this.id = s7, this.displayRecords = [];
  882. }
  883. copy() {
  884. const s7 = new e10(this.id);
  885. return s7.set(this), s7;
  886. }
  887. clone() {
  888. const s7 = new e10(this.id);
  889. return s7.displayRecords = this.displayRecords.map((s8) => s8.clone()), s7.insertAfter = this.insertAfter, s7;
  890. }
  891. set(s7) {
  892. this.id = s7.id, this.displayRecords = s7.displayRecords, this.insertAfter = s7.insertAfter;
  893. }
  894. serialize(s7) {
  895. return s7.push(this.id), e9(s7, this.displayRecords), s7;
  896. }
  897. static deserialize(i5) {
  898. const r8 = i5.readInt32(), d7 = new e10(r8), o7 = { id: r8 };
  899. return d7.displayRecords = n6(i5, s5, o7), d7;
  900. }
  901. };
  902. // node_modules/@arcgis/core/views/2d/engine/webgl/TileDisplayData.js
  903. var e11 = class {
  904. get displayObjectRegistry() {
  905. if (!this._displayObjectRegistry) {
  906. this._displayObjectRegistry = new Map();
  907. for (const s7 of this.displayObjects)
  908. this._displayObjectRegistry.set(s7.id, s7);
  909. }
  910. return this._displayObjectRegistry;
  911. }
  912. get displayList() {
  913. return this._displayList;
  914. }
  915. computeDisplayList() {
  916. this._displayList = new n5();
  917. for (const s7 of this.displayObjects)
  918. for (const t11 of s7.displayRecords)
  919. this._displayList.addToList(t11);
  920. }
  921. clone() {
  922. const s7 = new e11();
  923. return this.displayObjects && (s7.displayObjects = this.displayObjects.map((s8) => s8.clone())), s7;
  924. }
  925. serialize(s7) {
  926. return e9(s7, this.displayObjects), s7;
  927. }
  928. _deserializeObjects(s7) {
  929. const i5 = s7.readInt32(), e12 = new Array(i5), a5 = new Map();
  930. for (let l8 = 0; l8 < e12.length; ++l8) {
  931. const i6 = e10.deserialize(s7);
  932. e12[l8] = i6, a5.set(i6.id, i6);
  933. }
  934. this.displayObjects = e12, this._displayList = null, this._displayObjectRegistry = a5;
  935. }
  936. static deserialize(s7) {
  937. const t11 = new e11();
  938. return t11._deserializeObjects(s7), t11;
  939. }
  940. };
  941. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/VertexBuffer.js
  942. var t8 = class {
  943. constructor(e12, t11) {
  944. this.data = e12, this.stride = t11;
  945. }
  946. static decode(r8) {
  947. const s7 = W(r8.data, r8.stride), n7 = r8.stride;
  948. return new t8(s7, n7);
  949. }
  950. static fromVertexVector(r8) {
  951. const s7 = W(r8.data.buffer(), r8.stride), n7 = r8.stride;
  952. return new t8(s7, n7);
  953. }
  954. };
  955. var r7 = class {
  956. constructor(e12, t11, r8) {
  957. this.geometryType = e12, this.indexBuffer = new Uint32Array(t11), this.namedBuffers = r8;
  958. }
  959. static decode(e12) {
  960. const s7 = e12.geometryType, n7 = e12.indexBuffer, o7 = {};
  961. for (const r8 in e12.namedBuffers)
  962. o7[r8] = t8.decode(e12.namedBuffers[r8]);
  963. return new r7(s7, n7, o7);
  964. }
  965. static fromVertexData(s7, n7) {
  966. const o7 = s7.indices, c6 = W(s7.vertices, s7.stride), i5 = s7.stride, d7 = { geometry: new t8(c6, i5) };
  967. return new r7(n7, o7, d7);
  968. }
  969. static fromVertexVectors(e12) {
  970. const s7 = e12.geometryType, n7 = e12.indexVector.buffer(), o7 = {};
  971. for (const r8 in e12.namedVectors)
  972. o7[r8] = t8.fromVertexVector(e12.namedVectors[r8]);
  973. return new r7(s7, n7, o7);
  974. }
  975. };
  976. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/VertexVector.js
  977. var s6 = class {
  978. constructor(t11, e12) {
  979. this.data = t11, this.stride = e12;
  980. }
  981. get vertexCount() {
  982. const t11 = this.stride / 4, e12 = this.data.length / t11;
  983. return e12 !== (0 | e12) && console.debug("Corrupted stride"), e12;
  984. }
  985. transfer(t11, e12) {
  986. const r8 = this.data.buffer();
  987. t11.vertexCount = this.vertexCount, t11.data = r8, t11.stride = this.stride, e12.push(r8);
  988. }
  989. };
  990. var o5 = class {
  991. constructor(e12, o7, n7) {
  992. this.geometryType = e12, this.indexVector = new e4(Uint32Array, 6 * o7), this.namedVectors = {};
  993. const i5 = G(e12, n7);
  994. for (const t11 in i5) {
  995. const e13 = i5[t11];
  996. let n8;
  997. switch (e13 % 4) {
  998. case 0:
  999. case 2:
  1000. n8 = new e4(Uint32Array, e13 * o7);
  1001. break;
  1002. case 1:
  1003. case 3:
  1004. n8 = new e4(Uint8Array, e13 * o7);
  1005. }
  1006. this.namedVectors[t11] = new s6(n8, e13);
  1007. }
  1008. }
  1009. get(t11) {
  1010. return this.namedVectors[t11].data;
  1011. }
  1012. getVector(t11) {
  1013. return this.namedVectors[t11];
  1014. }
  1015. transfer(t11, e12) {
  1016. const r8 = this.indexVector.buffer(), s7 = {};
  1017. e12.push(r8);
  1018. for (const o7 in this.namedVectors) {
  1019. const t12 = this.namedVectors[o7];
  1020. s7[o7] = {}, t12.transfer(s7[o7], e12);
  1021. }
  1022. t11.geometryType = this.geometryType, t11.indexBuffer = r8, t11.namedBuffers = s7, this.destroy();
  1023. }
  1024. intoBuffers() {
  1025. const t11 = r7.fromVertexVectors(this);
  1026. return this.destroy(), t11;
  1027. }
  1028. destroy() {
  1029. this.indexVector = null, this.namedVectors = null;
  1030. }
  1031. };
  1032. // node_modules/@arcgis/core/views/2d/engine/webgl/TileData.js
  1033. var D = new e8();
  1034. var d5 = new e8();
  1035. var p2 = 1.5;
  1036. var h3 = 5;
  1037. function x2(e12, t11) {
  1038. const r8 = {};
  1039. for (const s7 in e12) {
  1040. const i5 = { data: K(t11, e12[s7]), stride: e12[s7] };
  1041. r8[s7] = i5;
  1042. }
  1043. return r8;
  1044. }
  1045. function y4(e12) {
  1046. return [e12.fill || {}, e12.line || {}, e12.icon || {}, e12.text || {}, e12.label || {}];
  1047. }
  1048. function B(e12) {
  1049. const t11 = [[], [], [], [], []], r8 = e12;
  1050. for (const s7 of r8)
  1051. for (const e13 of s7.displayRecords)
  1052. t11[e13.geometryType].push(e13);
  1053. return t11;
  1054. }
  1055. var g4 = class {
  1056. constructor() {
  1057. this.tileDisplayData = null, this.tileBufferData = null;
  1058. }
  1059. reshuffle() {
  1060. D.reset();
  1061. const e12 = B(this.tileDisplayData.displayObjects);
  1062. for (const s7 of e12)
  1063. for (const e13 of s7)
  1064. e13 && D.needMore(e13.geometryType, e13.meshData ? e13.meshData.vertexCount : e13.vertexCount, e13.meshData ? e13.meshData.indexData.length : e13.indexCount);
  1065. const t11 = e12.length, r8 = new f8();
  1066. for (let s7 = 0; s7 < t11; ++s7) {
  1067. r8.geometries[s7].indexBuffer = new Uint32Array(Math.round(p2 * D.indicesFor(s7)));
  1068. const e13 = [];
  1069. for (const r9 in this.tileBufferData.geometries[s7].vertexBuffer)
  1070. e13.push(this.tileBufferData.geometries[s7].vertexBuffer[r9].stride);
  1071. const t12 = g4._computeVertexAlignment(e13), i5 = Math.round(p2 * D.verticesFor(s7)), a5 = g4._align(i5, t12);
  1072. for (const f11 in this.tileBufferData.geometries[s7].vertexBuffer) {
  1073. const e14 = this.tileBufferData.geometries[s7].vertexBuffer[f11].stride;
  1074. r8.geometries[s7].vertexBuffer[f11] = { stride: e14, data: K(a5, e14) };
  1075. }
  1076. }
  1077. d5.reset(), this.tileDisplayData.displayList.clear();
  1078. for (let s7 = 0; s7 < t11; ++s7) {
  1079. const t12 = e12[s7];
  1080. for (const e13 of t12) {
  1081. if (e13.meshData)
  1082. e13.writeMeshDataToBuffers(d5.verticesFor(s7), r8.geometries[s7].vertexBuffer, d5.indicesFor(s7), r8.geometries[s7].indexBuffer), e13.meshData = null;
  1083. else {
  1084. const t13 = this.tileBufferData.geometries[s7].vertexBuffer, i5 = this.tileBufferData.geometries[s7].indexBuffer, o7 = r8.geometries[s7].vertexBuffer, f11 = r8.geometries[s7].indexBuffer, n7 = d5.verticesFor(s7), l8 = d5.indicesFor(s7);
  1085. ae(n7, l8, o7, f11, e13, t13, i5), e13.vertexFrom = n7, e13.indexFrom = l8;
  1086. }
  1087. d5.needMore(s7, e13.vertexCount, e13.indexCount);
  1088. }
  1089. }
  1090. for (const s7 of this.tileDisplayData.displayObjects)
  1091. this.tileDisplayData.displayList.addToList(s7.displayRecords);
  1092. this.tileBufferData = r8;
  1093. }
  1094. getStrides() {
  1095. const e12 = [];
  1096. for (let t11 = 0; t11 < this.tileBufferData.geometries.length; ++t11) {
  1097. const r8 = this.tileBufferData.geometries[t11];
  1098. e12[t11] = {};
  1099. for (const s7 in r8.vertexBuffer)
  1100. e12[t11][s7] = r8.vertexBuffer[s7].stride;
  1101. }
  1102. return e12;
  1103. }
  1104. clone() {
  1105. const e12 = new g4();
  1106. return e12.tileBufferData = this.tileBufferData.clone(), e12.tileDisplayData = this.tileDisplayData.clone(), e12;
  1107. }
  1108. _guessSize() {
  1109. const { displayObjects: e12 } = this.tileDisplayData, t11 = Math.min(e12.length, 4), r8 = 12, s7 = 40;
  1110. let i5 = 0;
  1111. for (let o7 = 0; o7 < t11; o7++)
  1112. i5 = Math.max(i5, e12[o7].displayRecords.length);
  1113. return 2 * (e12.length * r8 + e12.length * i5 * s7);
  1114. }
  1115. serialize() {
  1116. const e12 = this.tileBufferData.serialize(), t11 = this.tileBufferData.getBuffers(), r8 = this.tileDisplayData.serialize(new e4(Int32Array, this._guessSize())).buffer();
  1117. return t11.push(r8), { result: { displayData: r8, bufferData: e12 }, transferList: t11 };
  1118. }
  1119. static fromVertexData(r8, s7) {
  1120. const i5 = {}, o7 = new Map();
  1121. for (const e12 of s7)
  1122. o7.set(e12.id, e12);
  1123. return he((s8) => {
  1124. const a5 = r8.data[s8];
  1125. if (r(a5)) {
  1126. const e12 = i3.from(a5.records).getCursor();
  1127. for (; e12.next(); ) {
  1128. const t11 = e12.id, r9 = e12.materialKey, i6 = e12.indexFrom, a6 = e12.indexCount, f11 = e12.vertexFrom, l8 = e12.vertexCount, u5 = o7.get(t11), c6 = new s5(t11, s8, r9);
  1129. c6.indexFrom = i6, c6.indexCount = a6, c6.vertexFrom = f11, c6.vertexCount = l8, u5.displayRecords.push(c6);
  1130. }
  1131. i5[s8] = r7.fromVertexData(a5, s8);
  1132. } else
  1133. i5[s8] = new o5(s8, 0, S.DEFAULT).intoBuffers();
  1134. }), g4.fromMeshData({ displayObjects: s7, vertexBuffersMap: i5 });
  1135. }
  1136. static fromMeshData(e12) {
  1137. const t11 = new g4(), r8 = new e11(), o7 = new f8();
  1138. r8.displayObjects = e12.displayObjects;
  1139. for (const s7 in e12.vertexBuffersMap) {
  1140. const t12 = e12.vertexBuffersMap[s7];
  1141. o7.geometries[s7].indexBuffer = t12.indexBuffer, o7.geometries[s7].vertexBuffer = t12.namedBuffers;
  1142. }
  1143. return t11.tileDisplayData = r8, t11.tileBufferData = o7, t11;
  1144. }
  1145. static bind(e12, t11) {
  1146. const r8 = new g4();
  1147. return r8.tileDisplayData = e12, r8.tileBufferData = t11, r8;
  1148. }
  1149. static create(e12, t11) {
  1150. const r8 = new g4();
  1151. r8.tileDisplayData = new e11(), r8.tileDisplayData.displayObjects = e12;
  1152. const o7 = [0, 0, 0, 0, 0], a5 = [0, 0, 0, 0, 0], f11 = [[], [], [], [], []];
  1153. for (const s7 of e12)
  1154. for (const e13 of s7.displayRecords)
  1155. f11[e13.geometryType].push(e13), o7[e13.geometryType] += e13.meshData.vertexCount, a5[e13.geometryType] += e13.meshData.indexData.length;
  1156. const l8 = new f8(), u5 = y4(t11);
  1157. for (let s7 = 0; s7 < h3; s7++) {
  1158. const e13 = new Uint32Array(a5[s7]), t12 = x2(u5[s7], o7[s7]);
  1159. s5.writeAllMeshDataToBuffers(f11[s7], t12, e13), l8.geometries[s7] = { indexBuffer: e13, vertexBuffer: t12 };
  1160. }
  1161. return r8.tileBufferData = l8, r8;
  1162. }
  1163. static _align(e12, t11) {
  1164. const r8 = e12 % t11;
  1165. return r8 === 0 ? e12 : e12 + (t11 - r8);
  1166. }
  1167. static _computeVertexAlignment(e12) {
  1168. let t11 = false, r8 = false;
  1169. for (const s7 of e12)
  1170. s7 % 4 == 2 ? t11 = true : s7 % 4 != 0 && (r8 = true);
  1171. return r8 ? 4 : t11 ? 2 : 1;
  1172. }
  1173. };
  1174. // node_modules/@arcgis/core/views/2d/layers/features/support/GraphicsReader.js
  1175. var o6 = class extends d2 {
  1176. constructor(r8, t11) {
  1177. super(r8, t11, null);
  1178. }
  1179. static from(s7, n7) {
  1180. const i5 = A.createInstance(), c6 = [], u5 = s7.filter((r8) => !!r8.geometry);
  1181. for (const e12 of u5) {
  1182. const s8 = v(e12.geometry);
  1183. X(c6, [e12], s8, false, false, n7);
  1184. }
  1185. return new o6(i5, c6);
  1186. }
  1187. get geometryType() {
  1188. const r8 = this._current;
  1189. return r8 ? r8.geometryType : null;
  1190. }
  1191. get insertAfter() {
  1192. return this._current.insertAfter;
  1193. }
  1194. readGraphic() {
  1195. return this._current;
  1196. }
  1197. getCursor() {
  1198. return this.copy();
  1199. }
  1200. copy() {
  1201. const r8 = new o6(this.instance, this._features);
  1202. return this.copyInto(r8), r8;
  1203. }
  1204. };
  1205. // node_modules/@arcgis/core/views/2d/layers/graphics/GraphicStoreItem.js
  1206. var y5 = new t2();
  1207. var f9 = new t2();
  1208. var d6 = "esriGeometryPolyline";
  1209. function b(t11) {
  1210. t11.coords.length = 0, t11.lengths.length = 0;
  1211. }
  1212. var z2 = class {
  1213. constructor() {
  1214. this.bounds = u3(), this.graphic = null;
  1215. }
  1216. static acquire(t11 = null, e12, s7, r8, i5) {
  1217. let o7;
  1218. return z2._pool.length === 0 ? o7 = new z2() : (o7 = z2._pool.pop(), this._set.delete(o7)), o7.acquire(t11, e12, s7, r8, i5), o7;
  1219. }
  1220. static release(t11) {
  1221. t11 && !this._set.has(t11) && (t11.release(), this._pool.push(t11), this._set.add(t11));
  1222. }
  1223. static getCentroidQuantized(e12, s7) {
  1224. if (c2(e12.geometry)) {
  1225. const i5 = e12.symbol;
  1226. if (t(i5))
  1227. return null;
  1228. if (i5?.layers.length > 0 && i5.layers.some((t11) => t11.type === "text" || t11.type === "marker")) {
  1229. const t11 = e2(e12.geometry);
  1230. return t11 !== null ? O(s7, {}, { x: t11[0], y: t11[1] }, false, false) : null;
  1231. }
  1232. }
  1233. return null;
  1234. }
  1235. acquire(t11 = null, e12, s7, r8, i5) {
  1236. t11 && this.set(t11, e12, s7, r8, i5);
  1237. }
  1238. release() {
  1239. this.graphic = null, this.symbolResource = null, this.geometry = null;
  1240. }
  1241. get symbol() {
  1242. return this.symbolResource.symbol;
  1243. }
  1244. set(t11, e12, s7, r8, i5) {
  1245. this.graphic = t11, this.geometry = s7, this.symbolResource = e12, this.bounds = r8, i5 && (this.size = i5);
  1246. }
  1247. getGeometryQuantized(t11, e12, r8, l8) {
  1248. const g7 = this.geometry;
  1249. if (c2(g7)) {
  1250. const e13 = g7.rings;
  1251. if (e13.length === 1 && e13[0].length === 2)
  1252. return U(t11, { paths: [[e13[0][0], e13[0][1]]] });
  1253. } else {
  1254. if (y2(g7))
  1255. return b(y5), b(f9), $(y5, g7), fe(f9, y5, g7.hasZ, g7.hasM, d6, t11.scale[0]), ie(y5, f9, g7.hasZ, g7.hasM, d6, t11), L(y5, g7.hasZ, g7.hasM);
  1256. if (f2(g7)) {
  1257. const i5 = 0.5 * l8 * Math.max(Math.abs(this.size[0]) + this.size[2] - this.size[0], Math.abs(this.size[1]) + this.size[3] - this.size[1]), o7 = R(r8);
  1258. let n7 = g7.points;
  1259. if (o7) {
  1260. const [t12, r9] = o7.valid, l9 = r9 - t12;
  1261. n7 = n7.filter((o8) => {
  1262. if (o8[0] + i5 > r9 || o8[0] - i5 < t12) {
  1263. const t13 = [...o8];
  1264. return o8[0] + i5 > r9 ? t13[0] -= l9 : t13[0] += l9, q(e12, o8, i5) || q(e12, t13, i5);
  1265. }
  1266. return q(e12, o8, i5);
  1267. });
  1268. }
  1269. return n7.length === 0 ? { points: n7 } : U(t11, { points: n7 });
  1270. }
  1271. }
  1272. return U(t11, this.geometry);
  1273. }
  1274. };
  1275. z2._pool = [], z2._set = new Set();
  1276. // node_modules/@arcgis/core/views/2d/layers/graphics/GraphicStore.js
  1277. var g5 = { minX: 0, minY: 0, maxX: 0, maxY: 0 };
  1278. var f10 = u3();
  1279. var _ = 1e-5;
  1280. function b2(e12, t11, r8, i5, s7) {
  1281. return g5.minX = t11, g5.minY = r8, g5.maxX = i5, g5.maxY = s7, e12.search(g5);
  1282. }
  1283. function y6(e12) {
  1284. return { minX: e12.bounds[0], minY: e12.bounds[1], maxX: e12.bounds[2], maxY: e12.bounds[3] };
  1285. }
  1286. var I2 = class {
  1287. constructor(e12, t11, r8, s7, o7, n7, h4) {
  1288. this._graphics = s7, this._onAdd = o7, this._onRemove = n7, this._hashToCIM = h4, this._index = i2(9, y6), this._itemByGraphic = new Map(), this._inflatedSizeHelper = new Q(), this._tileInfoView = e12, this._uidFieldName = r8;
  1289. const a5 = e12.getClosestInfoForScale(t11);
  1290. a5 && (this._resolution = this._tileInfoView.getTileResolution(a5.level));
  1291. }
  1292. setResourceManager(e12) {
  1293. this._cimResourceManager = e12, this._hittestDrawHelper = new j(e12);
  1294. }
  1295. hitTest(e12, t11, r8, i5, n7) {
  1296. e12 = z(e12, this._tileInfoView.spatialReference);
  1297. const h4 = 0.5 * i5 * window.devicePixelRatio * r8;
  1298. f10[0] = e12 - h4, f10[1] = t11 - h4, f10[2] = e12 + h4, f10[3] = t11 + h4;
  1299. const u5 = 0.5 * i5 * (r8 + g3), l8 = b2(this._index, e12 - u5, t11 - u5, e12 + u5, t11 + u5);
  1300. if (!l8 || l8.length === 0)
  1301. return [];
  1302. const c6 = [], d7 = u3(), p3 = u3();
  1303. for (const s7 of l8) {
  1304. const { geometry: e13, symbolResource: t12 } = s7;
  1305. this._getSymbolBounds(d7, t12, e13, p3, n7), p3[3] = p3[2] = p3[1] = p3[0] = 0, E(d7, f10) && s7.graphic.visible && c6.push(s7);
  1306. }
  1307. if (c6.length === 0)
  1308. return [];
  1309. const g7 = this._hittestDrawHelper, _2 = [];
  1310. for (const s7 of c6) {
  1311. const { geometry: e13, symbolResource: t12 } = s7, { hash: r9, textInfo: o7 } = t12, h5 = this._hashToCIM.get(r9);
  1312. h5 && (g7.hitTest(f10, h5.symbol, e13, o7, n7, i5) && _2.push(s7));
  1313. }
  1314. return _2.sort(z3), _2.map((e13) => e13.graphic);
  1315. }
  1316. getGraphicsData(e12, t11, r8) {
  1317. const i5 = this._searchForItems(t11);
  1318. if (i5.length === 0 || r8.length === 0)
  1319. return [];
  1320. i5.sort((e13, t12) => e13.zorder - t12.zorder), i5[0].insertAfter = -1;
  1321. for (let l8 = 1; l8 < i5.length; l8++)
  1322. i5[l8].insertAfter = i5[l8 - 1].graphic.uid;
  1323. i5.sort((e13, t12) => e13.graphic.uid - t12.graphic.uid), r8.sort((e13, t12) => e13.uid - t12.uid);
  1324. let s7, o7 = 0, n7 = 0;
  1325. const h4 = t11.resolution, a5 = [], u5 = { originPosition: "upperLeft", scale: [h4, h4], translate: [t11.bounds[0], t11.bounds[3]] };
  1326. for (const l8 of r8) {
  1327. for (n7 = -2; o7 < i5.length; )
  1328. if (s7 = i5[o7], o7++, l8.uid === s7.graphic.uid) {
  1329. n7 = s7.insertAfter;
  1330. break;
  1331. }
  1332. if (!s7.geometry || n7 === -2)
  1333. continue;
  1334. const r9 = s7.getGeometryQuantized(u5, t11.bounds, this._tileInfoView.spatialReference, h4), c6 = { ...s7.graphic.attributes };
  1335. c6[this._uidFieldName] = l8.uid, s7.groupId == null && (s7.groupId = e12.createTemplateGroup(s7.symbol, null)), a5.push({ centroid: z2.getCentroidQuantized(s7, u5), geometry: r9, attributes: c6, symbol: s7.symbol, groupId: s7.groupId, insertAfter: n7, zorder: s7.zorder });
  1336. }
  1337. return a5.sort((e13, t12) => e13.zorder - t12.zorder), a5;
  1338. }
  1339. queryTileData(e12, t11) {
  1340. if (this._graphics.length === 0)
  1341. return [];
  1342. const { bounds: r8, resolution: i5 } = t11, s7 = this._searchForItems(t11), o7 = [];
  1343. return s7.length === 0 || this._createTileGraphics(o7, e12, s7, { originPosition: "upperLeft", scale: [i5, i5], translate: [r8[0], r8[3]] }, t11), o7;
  1344. }
  1345. has(e12) {
  1346. return this._itemByGraphic.has(e12);
  1347. }
  1348. getBounds(e12) {
  1349. const t11 = this._itemByGraphic.get(e12);
  1350. return t11 ? t11.bounds : null;
  1351. }
  1352. getAllBounds() {
  1353. return Array.from(this._itemByGraphic.values()).filter((e12) => e12.graphic.visible).map((e12) => e12.bounds);
  1354. }
  1355. addOrModify(r8, i5, s7) {
  1356. if (!r8 || t(i5))
  1357. return;
  1358. this.has(r8) && this.remove(r8), this._onAdd(r8);
  1359. const o7 = [0, 0, 0, 0], n7 = this._getSymbolBounds(null, i5, s7, o7, 0), h4 = z2.acquire(r8, i5, s7, r(n7) ? n7 : null, o7);
  1360. return this._itemByGraphic.set(r8, h4), s7 && this._index.insert(h4), h4.bounds;
  1361. }
  1362. remove(e12) {
  1363. if (!this._itemByGraphic.has(e12))
  1364. return;
  1365. this._onRemove(e12);
  1366. const t11 = this._itemByGraphic.get(e12);
  1367. t11.bounds && this._index.remove(t11), this._itemByGraphic.delete(e12);
  1368. }
  1369. updateZ() {
  1370. const e12 = this._graphics.items;
  1371. let t11, r8;
  1372. for (let i5 = 0; i5 < e12.length; i5++)
  1373. r8 = e12[i5], t11 = this._itemByGraphic.get(r8), t11 && (t11.zorder = i5);
  1374. }
  1375. update(e12, r8, i5) {
  1376. const s7 = this._itemByGraphic.get(e12);
  1377. s7.groupId = null;
  1378. const o7 = e3(s7.bounds);
  1379. this._index.remove(s7);
  1380. const h4 = this._getSymbolBounds(s7.bounds, r8, i5, s7.size, 0);
  1381. return r(h4) && s7.set(e12, r8, i5, h4, s7.size), i5 && this._index.insert(s7), { oldBounds: o7, newBounds: s7.bounds };
  1382. }
  1383. updateLevel(e12) {
  1384. if (this._resolution === e12)
  1385. return;
  1386. this._resolution = e12, this._index.clear();
  1387. const r8 = this._itemByGraphic, i5 = [];
  1388. for (const [s7, o7] of r8) {
  1389. const e13 = this._getSymbolBounds(o7.bounds, o7.symbolResource, o7.geometry, o7.size, 0);
  1390. o7.geometry && r(e13) && (o7.bounds = e13, i5.push(o7));
  1391. }
  1392. this._index.load(i5);
  1393. }
  1394. clear() {
  1395. this._itemByGraphic.clear(), this._index.clear();
  1396. }
  1397. _createTileGraphics(e12, t11, r8, i5, s7) {
  1398. const o7 = this._uidFieldName, n7 = this._tileInfoView.spatialReference, { bounds: h4, resolution: a5 } = s7;
  1399. let u5, l8, c6, m;
  1400. r8.sort((e13, t12) => e13.zorder - t12.zorder);
  1401. for (let p3 = 0; p3 < r8.length; p3++) {
  1402. c6 = r8[p3], u5 = c6.graphic, l8 = c6.getGeometryQuantized(i5, h4, n7, a5), m = p3 === 0 ? -1 : r8[p3 - 1].graphic.uid;
  1403. const s8 = { ...c6.graphic.attributes };
  1404. s8[o7] = u5.uid, c6.groupId == null && (c6.groupId = t11.createTemplateGroup(c6.symbol, null)), e12.push({ centroid: z2.getCentroidQuantized(c6, i5), geometry: l8, attributes: s8, symbol: c6.symbol, groupId: c6.groupId, insertAfter: m, zorder: c6.zorder });
  1405. }
  1406. }
  1407. _searchForItems(e12) {
  1408. const t11 = this._tileInfoView.spatialReference, r8 = e12.bounds;
  1409. if (t11.isWrappable) {
  1410. const [i5, o7] = R(t11).valid, n7 = Math.abs(r8[2] - o7) < _, h4 = Math.abs(r8[0] - i5) < _;
  1411. if ((!n7 || !h4) && (n7 || h4)) {
  1412. const t12 = e12.resolution;
  1413. let h5;
  1414. h5 = u3(n7 ? [i5, r8[1], i5 + t12 * g3, r8[3]] : [o7 - t12 * g3, r8[1], o7, r8[3]]);
  1415. const a5 = b2(this._index, r8[0], r8[1], r8[2], r8[3]), u5 = b2(this._index, h5[0], h5[1], h5[2], h5[3]);
  1416. return [...new Set([...a5, ...u5])];
  1417. }
  1418. }
  1419. return b2(this._index, r8[0], r8[1], r8[2], r8[3]);
  1420. }
  1421. _getSymbolBounds(e12, t11, i5, o7, n7) {
  1422. if (!t11 || !t11.symbol || !i5)
  1423. return null;
  1424. if (e12 || (e12 = u3()), c(e12, i5), !o7 || o7[0] === 0 && o7[1] === 0 && o7[2] === 0 && o7[3] === 0) {
  1425. const { hash: e13, textInfo: i6 } = t11, s7 = this._hashToCIM.get(e13);
  1426. if (!s7)
  1427. return null;
  1428. o7 || (o7 = [0, 0, 0, 0]);
  1429. const h4 = this._inflatedSizeHelper.getSymbolInflateSize(o7, s7.symbol, this._cimResourceManager, n7, i6);
  1430. o7[0] = u2(h4[0]), o7[1] = u2(h4[1]), o7[2] = u2(h4[2]), o7[3] = u2(h4[3]);
  1431. }
  1432. const a5 = this._resolution, u5 = Q.safeSize(o7);
  1433. return e12[0] -= u5 * a5, e12[1] -= u5 * a5, e12[2] += u5 * a5, e12[3] += u5 * a5, e12;
  1434. }
  1435. };
  1436. var z3 = (e12, t11) => {
  1437. const r8 = y3(e12.graphic), i5 = y3(t11.graphic);
  1438. return r8 === i5 ? t11.zorder - e12.zorder : r8 - i5;
  1439. };
  1440. // node_modules/@arcgis/core/views/layers/GraphicsView.js
  1441. var t9 = (t11) => {
  1442. let p3 = class extends s3(t11) {
  1443. constructor() {
  1444. super(...arguments), this.graphics = null, this.renderer = null;
  1445. }
  1446. };
  1447. return e([d()], p3.prototype, "graphics", void 0), e([d()], p3.prototype, "renderer", void 0), e([d()], p3.prototype, "updating", void 0), e([d()], p3.prototype, "view", void 0), p3 = e([n("esri.views.layers.GraphicsView")], p3), p3;
  1448. };
  1449. // node_modules/@arcgis/core/views/2d/layers/graphics/GraphicsView2D.js
  1450. var ie3 = a("esri-2d-graphic-debug");
  1451. function re(e12, t11, s7) {
  1452. if (s7.has(e12))
  1453. return s7.get(e12);
  1454. const i5 = { tile: t11, addedOrModified: [], removed: [] };
  1455. return s7.set(e12, i5), i5;
  1456. }
  1457. var oe = class extends t9(a2(y)) {
  1458. constructor(e12) {
  1459. super(e12), this._storage = new r4(), this._displayIds = new Map(), this._controller = new AbortController(), this._tiles = new Map(), this._graphicStoreUpdate = false, this._graphicsSet = new Set(), this._matcher = Promise.resolve(null), this._tileUpdateSet = new Set(), this._tilesToUpdate = new Map(), this._graphicIdToAbortController = new Map(), this._attached = false, this._updatingGraphicsTimer = null, this._hashToExpandedSymbol = new Map(), this._hashToExpandedSymbolPromise = new Map(), this._hashToCIMSymbolPromise = new Map(), this._hashToCIM = new Map(), this._processing = false, this._needsProcessing = false, this._pendingUpdate = { added: new Set(), updated: new Set(), removed: new Set() }, this.lastUpdateId = -1, this.updateRequested = false, this.graphicUpdateHandler = this.graphicUpdateHandler.bind(this);
  1460. }
  1461. destroy() {
  1462. this._updatingGraphicsTimer && (clearTimeout(this._updatingGraphicsTimer), this._updatingGraphicsTimer = null, this.notifyChange("updating")), this._controller.abort(), this.container.destroy(), this._set("graphics", null), this._graphicStore.clear(), this._attributeStore = null, this._hashToExpandedSymbol.clear(), this.view = null, this.renderer = null, this._hashToCIM.clear(), this._hashToCIMSymbolPromise.clear(), this._hashToExpandedSymbolPromise.clear();
  1463. }
  1464. _createMatcher(e12, t11, s7) {
  1465. if (e12) {
  1466. const i5 = K2({ indexCount: 0, fields: {} }, "feature", e12);
  1467. this._matcher = l6(i5, t11, null, s7);
  1468. }
  1469. }
  1470. _createDisplayId(e12) {
  1471. return this._displayIds.has(e12) || this._displayIds.set(e12, this._storage.createDisplayId()), this._displayIds.get(e12);
  1472. }
  1473. initialize() {
  1474. this._attributeStore = new R3({ type: "local", initialize: (e13) => Promise.resolve(this.container.attributeView.initialize(e13)), update: (e13) => this.container.attributeView.requestUpdate(e13), render: () => this.container.requestRender() }, l4("2d"), () => this.notifyChange("updating")), this.container.hasHighlight = () => this._attributeStore.hasHighlight;
  1475. const e12 = (e13) => {
  1476. this._createDisplayId(e13.uid), this._setFilterState(e13.uid, e13.visible);
  1477. }, t11 = (e13) => {
  1478. const t12 = this._displayIds.get(e13.uid);
  1479. this._displayIds.delete(e13.uid), this._storage.releaseDisplayId(t12);
  1480. }, s7 = new x(this.container.getMaterialItems.bind(this.container), this.view.featuresTilingScheme.tileInfo);
  1481. this._graphicStore = new I2(this.view.featuresTilingScheme, this.view.state.scale, this.uid, this.graphics, e12, t11, this._hashToCIM), this._meshFactory = new l5(null, this.uid, s7), this._templateStore = s7, this.handles.add([l2(() => this.renderer, (e13) => {
  1482. this._createMatcher(e13, s7, this.container.stage.resourceManager);
  1483. for (const t12 of this.graphics)
  1484. this._pendingUpdate.updated.add(t12);
  1485. this.requestUpdate();
  1486. }), this.view.graphicsTileStore.on("update", (e13) => this._onTileUpdate(e13)), this.container.on("attach", () => {
  1487. ie3 && this.container.enableRenderingBounds(() => this._graphicStore.getAllBounds()), this.graphics.items.length > 0 && this._graphicsChangeHandler({ target: this.graphics, added: this.graphics.items, removed: [], moved: [] }), this.handles.add(this.graphics.on("change", (e14) => this._graphicsChangeHandler(e14)), "graphics");
  1488. const e13 = this.container.stage.resourceManager;
  1489. this._createMatcher(this.renderer, s7, e13), this._graphicStore.setResourceManager(e13), this._attached = true, this.notifyChange("updating");
  1490. })]);
  1491. const i5 = this.view.graphicsTileStore.tiles;
  1492. this._onTileUpdate({ added: i5, removed: [] });
  1493. }
  1494. get updating() {
  1495. return !this._attached || this._updatingGraphicsTimer !== null || this._tileUpdateSet.size > 0 || this._tilesToUpdate.size > 0 || this._attributeStore.isUpdating();
  1496. }
  1497. hitTest(e12) {
  1498. if (!this.view || !this.view.position)
  1499. return [];
  1500. const { resolution: t11, rotation: s7 } = this.view.state;
  1501. return this._graphicStore.hitTest(e12.x, e12.y, 2, t11, s7);
  1502. }
  1503. update(e12) {
  1504. f(this._controller.signal);
  1505. const t11 = e12.state, { resolution: s7 } = t11;
  1506. if (this._graphicStore.updateLevel(s7), this._graphicStoreUpdate = true, this.updateRequested = false, this._pendingUpdate.updated.size > 0) {
  1507. if (!this._processing)
  1508. return void this._updateGraphics();
  1509. this._needsProcessing = true;
  1510. }
  1511. }
  1512. viewChange() {
  1513. this.requestUpdate();
  1514. }
  1515. requestUpdate() {
  1516. this.updateRequested || (this.updateRequested = true, this.requestUpdateCallback());
  1517. }
  1518. processUpdate(e12) {
  1519. this.updateRequested && (this.updateRequested = false, this.update(e12));
  1520. }
  1521. graphicUpdateHandler(e12) {
  1522. const { graphic: t11, property: s7, newValue: i5 } = e12;
  1523. switch (s7) {
  1524. case "attributes":
  1525. case "geometry":
  1526. case "symbol":
  1527. this._pendingUpdate.updated.add(t11), this.requestUpdate();
  1528. break;
  1529. case "visible":
  1530. this._setFilterState(t11.uid, i5), this._attributeStore.sendUpdates();
  1531. }
  1532. }
  1533. setHighlight(e12) {
  1534. const t11 = e12.map((e13) => this._displayIds.get(e13));
  1535. this._attributeStore.setHighlight(e12, t11);
  1536. }
  1537. _getIntersectingTiles(e12) {
  1538. const t11 = this._graphicStore.getBounds(e12);
  1539. if (!t11 || s2(t11) === 0 || l3(t11) === 0)
  1540. return [];
  1541. const s7 = p(t11, this.view.spatialReference);
  1542. return r(s7) ? [...new Set([...this.view.graphicsTileStore.boundsIntersections(s7[0]), ...this.view.graphicsTileStore.boundsIntersections(s7[1])])] : this.view.graphicsTileStore.boundsIntersections(t11);
  1543. }
  1544. async _updateTile(e12) {
  1545. f(this._controller.signal);
  1546. const t11 = e12.tile, s7 = this._getGraphicsData(this._templateStore, t11, e12.addedOrModified), i5 = await this._processGraphics(t11, s7);
  1547. return f(this._controller.signal), this._patchTile(t11.key, { type: "update", addOrUpdate: i5, remove: e12.removed, end: true, clear: false, sort: false }), i5;
  1548. }
  1549. _patchTile(e12, t11) {
  1550. if (!this._tiles.has(e12))
  1551. return;
  1552. const s7 = this._tiles.get(e12);
  1553. this.container.onTileData(s7, t11), this.container.requestRender();
  1554. }
  1555. _graphicsChangeHandler(e12) {
  1556. const t11 = this._pendingUpdate;
  1557. for (const s7 of e12.added)
  1558. t11.added.add(s7);
  1559. for (const s7 of e12.moved)
  1560. t11.updated.add(s7);
  1561. for (const s7 of e12.removed)
  1562. this._pendingUpdate.added.has(s7) ? t11.added.delete(s7) : t11.removed.add(s7);
  1563. this._processing ? this._needsProcessing = true : this._updateGraphics();
  1564. }
  1565. _getGraphicsToUpdate() {
  1566. const e12 = { added: [], removed: [], updated: [] };
  1567. if (!this.graphics)
  1568. return e12;
  1569. const t11 = this._pendingUpdate;
  1570. for (const s7 of this.graphics.items)
  1571. t11.added.has(s7) ? e12.added.push(s7) : t11.updated.has(s7) && e12.updated.push(s7);
  1572. for (const s7 of t11.removed)
  1573. this._graphicStore.has(s7) && e12.removed.push(s7);
  1574. return t11.added.clear(), t11.removed.clear(), t11.updated.clear(), e12;
  1575. }
  1576. async _updateGraphics() {
  1577. this._processing = true;
  1578. const { added: e12, removed: t11, updated: s7 } = this._getGraphicsToUpdate(), i5 = this._tilesToUpdate;
  1579. let r8;
  1580. try {
  1581. if (!this._graphicStoreUpdate) {
  1582. const e13 = this.view.state, { resolution: t12 } = e13;
  1583. this._graphicStore.updateLevel(t12);
  1584. }
  1585. const o7 = [], a5 = new Array(e12.length + t11.length);
  1586. for (let e13 = 0; e13 < s7.length; e13++) {
  1587. const t12 = s7[e13], h5 = this._getIntersectingTiles(t12);
  1588. for (const e14 of h5) {
  1589. r8 = e14.id;
  1590. re(r8, e14, i5).removed.push(this._displayIds.get(t12.uid));
  1591. }
  1592. o7.push(this._updateGraphic(t12, null)), a5[e13] = t12;
  1593. }
  1594. const h4 = s7.length;
  1595. for (let t12 = 0; t12 < e12.length; t12++) {
  1596. const s8 = e12[t12];
  1597. a5[h4 + t12] = s8, this._graphicsSet.add(s8), o7.push(this._addGraphic(s8));
  1598. }
  1599. for (const e13 of t11) {
  1600. this._abortProcessingGraphic(e13.uid);
  1601. const t12 = this._getIntersectingTiles(e13);
  1602. for (const s8 of t12) {
  1603. r8 = s8.id;
  1604. re(r8, s8, i5).removed.push(this._displayIds.get(e13.uid));
  1605. }
  1606. this._graphicsSet.delete(e13), this._graphicStore.remove(e13);
  1607. }
  1608. let n7;
  1609. this._flipUpdatingGraphics(), await Promise.all(o7);
  1610. for (let e13 = 0; e13 < a5.length; e13++) {
  1611. n7 = a5[e13];
  1612. const t12 = this._getIntersectingTiles(n7);
  1613. for (const e14 of t12) {
  1614. r8 = e14.id;
  1615. re(r8, e14, i5).addedOrModified.push(n7);
  1616. }
  1617. }
  1618. this._graphicStore.updateZ();
  1619. const l8 = [];
  1620. for (const [e13, t12] of i5)
  1621. l8.push(this._updateTile(t12));
  1622. await Promise.all(l8);
  1623. } catch (o7) {
  1624. g(o7), 0;
  1625. }
  1626. for (const a5 of t11)
  1627. try {
  1628. const e13 = await this._getSymbolForGraphic(a5, null);
  1629. if (e13) {
  1630. const t12 = e13.hash();
  1631. this._hashToExpandedSymbol.delete(t12);
  1632. }
  1633. } catch (o7) {
  1634. g(o7), 0;
  1635. }
  1636. i5.clear(), this.notifyChange("updating"), this._processing = false, this._needsProcessing && (this._needsProcessing = false, this._updateGraphics());
  1637. }
  1638. _getArcadeInfo(e12) {
  1639. const t11 = (e12.attributes ? Object.keys(e12.attributes) : []).map((t12) => ({ name: t12, alias: t12, type: typeof e12.attributes[t12] == "string" ? "esriFieldTypeString" : "esriFieldTypeDouble" }));
  1640. return t(e12.geometry) ? null : { geometryType: v(e12.geometry), spatialReference: k.fromJSON(e12.geometry.spatialReference), fields: t11 };
  1641. }
  1642. _getSymbolForGraphic(e12, t11) {
  1643. return f(this._controller.signal), r(e12.symbol) ? Promise.resolve(e12.symbol) : r(this.renderer) ? this.renderer.getSymbolAsync(e12, { scale: this.view.scale, signal: r(t11) ? t11.signal : null }) : Promise.resolve(this._getNullSymbol(e12));
  1644. }
  1645. _getCIMSymbol(e12, t11, s7) {
  1646. let i5 = this._hashToCIM.get(t11);
  1647. if (i5)
  1648. return Promise.resolve(i5);
  1649. const r8 = q2(e12);
  1650. if (r(r8)) {
  1651. if (r8.type === "CIMSymbolReference")
  1652. return i5 = r8, this._hashToCIM.set(t11, i5), Promise.resolve(i5);
  1653. let e13 = this._hashToCIMSymbolPromise.get(t11);
  1654. return e13 || (e13 = r8.fetchCIMSymbol(s7).then((e14) => (this._hashToCIM.set(t11, e14.data), this._hashToCIMSymbolPromise.delete(t11), e14)).catch((e14) => (this._hashToCIMSymbolPromise.delete(t11), w(e14), null)), this._hashToCIMSymbolPromise.set(t11, e13), e13);
  1655. }
  1656. return Promise.resolve(null);
  1657. }
  1658. _expandCIMSymbol(e12, t11, s7, i5) {
  1659. const r8 = this._hashToExpandedSymbol.get(s7);
  1660. if (r8)
  1661. return Promise.resolve(r8);
  1662. let o7 = this._hashToExpandedSymbolPromise.get(s7);
  1663. if (o7)
  1664. return o7;
  1665. const a5 = this.container.stage, h4 = this._getArcadeInfo(t11), n7 = S2(null), l8 = o(e12, n7);
  1666. return o7 = n3(l8, h4, a5.resourceManager, i5), this._hashToExpandedSymbolPromise.set(s7, o7), o7.then((e13) => (this._hashToExpandedSymbol.set(s7, e13), this._hashToExpandedSymbolPromise.delete(s7), e13)), o7;
  1667. }
  1668. async _getSymbolResources(e12, t11) {
  1669. f(this._controller.signal);
  1670. return this.container.stage ? this._getSymbolForGraphic(e12, t11).then((i5) => {
  1671. const r8 = i5.hash();
  1672. return this._getCIMSymbol(i5, r8, t11).then((i6) => t(i6) ? null : this._expandCIMSymbol(i6, e12, r8, t11).then((e13) => {
  1673. const t12 = e13.layers.filter((e14) => e14.type === "text" && typeof e14.text == "string");
  1674. if (t12 && t12.length > 0) {
  1675. const i7 = new Array(t12.length);
  1676. for (let e14 = 0; e14 < t12.length; e14++) {
  1677. const r9 = t12[e14], o8 = [], [a5] = n2(r9.text);
  1678. r9.text = a5;
  1679. for (let e15 = 0; e15 < a5.length; e15++)
  1680. o8.push(a5.charCodeAt(e15));
  1681. i7[e14] = { symbol: r9, id: e14, glyphIds: o8 };
  1682. }
  1683. const o7 = new Map();
  1684. return this.container.getMaterialItems(i7).then((s7) => {
  1685. for (let e14 = 0; e14 < t12.length; e14++) {
  1686. const i8 = t12[e14];
  1687. o7.set(i8.cim, { text: i8.text, mosaicItem: s7[e14].mosaicItem });
  1688. }
  1689. return { symbol: e13, textInfo: o7, hash: r8 };
  1690. });
  1691. }
  1692. return { symbol: e13, hash: r8 };
  1693. }));
  1694. }).catch((e13) => (w(e13), null)) : null;
  1695. }
  1696. async _projectAndNormalizeGeometry(e12, t11) {
  1697. if (f(this._controller.signal), t(e12.geometry) || e12.geometry.type === "mesh")
  1698. return null;
  1699. let s7 = e12.geometry;
  1700. if (c2(s7)) {
  1701. const e13 = s7.rings;
  1702. s7.rings = e13;
  1703. } else if (y2(s7)) {
  1704. const e13 = s7.paths;
  1705. s7.paths = e13;
  1706. } else if (s(s7)) {
  1707. const i6 = await this._getSymbolForGraphic(e12, t11);
  1708. if (f(this._controller.signal), h2(i6.type) || u4(i6.type)) {
  1709. s7 = s7.center;
  1710. } else
  1711. s7 = d3(s7);
  1712. }
  1713. await f3(s7.spatialReference, this.view.spatialReference);
  1714. const i5 = f6(s7), r8 = g2(i5, s7.spatialReference, this.view.spatialReference);
  1715. return u(r8), r8;
  1716. }
  1717. _onTileUpdate(e12) {
  1718. const t11 = R(this.view.spatialReference);
  1719. if (e12.added && e12.added.length > 0)
  1720. for (const s7 of e12.added)
  1721. this._addNewTile(s7, t11);
  1722. if (e12.removed && e12.removed.length > 0)
  1723. for (const s7 of e12.removed)
  1724. this._removeTile(s7.key);
  1725. }
  1726. async _addGraphic(e12) {
  1727. this._abortProcessingGraphic(e12.uid), f(this._controller.signal);
  1728. const t11 = new AbortController();
  1729. this._graphicIdToAbortController.set(e12.uid, t11);
  1730. const s7 = { signal: t11.signal };
  1731. try {
  1732. await this._addOrUpdateGraphic(e12, s7), f(this._controller.signal), this._graphicIdToAbortController.delete(e12.uid);
  1733. } catch (i5) {
  1734. if (this._graphicIdToAbortController.delete(e12.uid), !g(i5))
  1735. throw i5;
  1736. }
  1737. }
  1738. _updateGraphic(e12, t11) {
  1739. f(this._controller.signal);
  1740. const s7 = this._projectAndNormalizeGeometry(e12, t11), i5 = this._getSymbolResources(e12, t11);
  1741. return Promise.all([s7, i5]).then(([t12, s8]) => {
  1742. f(this._controller.signal), this._graphicStore.addOrModify(e12, s8, t12);
  1743. });
  1744. }
  1745. _addOrUpdateGraphic(e12, t11) {
  1746. f(this._controller.signal);
  1747. const s7 = this._projectAndNormalizeGeometry(e12, t11), i5 = this._getSymbolResources(e12, t11);
  1748. return Promise.all([s7, i5]).then(([t12, s8]) => {
  1749. f(this._controller.signal), this._graphicsSet.has(e12) && this._graphicStore.addOrModify(e12, s8, t12);
  1750. });
  1751. }
  1752. _addTile(e12) {
  1753. const t11 = this.view.featuresTilingScheme.getTileBounds(u3(), e12), s7 = new a4(e12, t11[0], t11[3]);
  1754. return this._tiles.set(e12, s7), this.container.addChild(s7), s7;
  1755. }
  1756. async _addNewTile(e12, t11) {
  1757. const s7 = this._addTile(e12.key), i5 = this._graphicStore.queryTileData(this._templateStore, e12);
  1758. if (i5.length === 0)
  1759. return;
  1760. if (t11) {
  1761. const s8 = Math.round((t11.valid[1] - t11.valid[0]) / e12.resolution);
  1762. for (const e13 of i5)
  1763. e13.geometry && (l(e13.geometry) || f2(e13.geometry)) && this._wrapPoints(e13, s8);
  1764. }
  1765. const r8 = e12.key;
  1766. this._tileUpdateSet.add(e12.key), this.notifyChange("updating");
  1767. try {
  1768. const t12 = { type: "update", clear: false, addOrUpdate: await this._processGraphics(e12, i5), remove: [], end: true, sort: false };
  1769. s7.patch(t12), this._tileUpdateSet.delete(r8), this.notifyChange("updating");
  1770. } catch (o7) {
  1771. if (this._tileUpdateSet.delete(r8), this.notifyChange("updating"), !g(o7))
  1772. throw o7;
  1773. }
  1774. }
  1775. _removeTile(e12) {
  1776. if (!this._tiles.has(e12))
  1777. return;
  1778. const t11 = this._tiles.get(e12);
  1779. this.container.removeChild(t11), t11.destroy(), this._tiles.delete(e12);
  1780. }
  1781. _setFilterState(e12, t11) {
  1782. const s7 = this._displayIds.get(e12), i5 = this._attributeStore.getHighlightFlag(e12);
  1783. this._attributeStore.setData(s7, 0, 0, i5 | (t11 ? U2 : 0));
  1784. }
  1785. _getGraphicsData(e12, t11, s7) {
  1786. const i5 = this.view, r8 = R(i5.spatialReference), o7 = this._graphicStore.getGraphicsData(e12, t11, s7);
  1787. if (r8) {
  1788. const e13 = Math.round((r8.valid[1] - r8.valid[0]) / t11.resolution);
  1789. for (const t12 of o7)
  1790. t12.geometry && (l(t12.geometry) || f2(t12.geometry)) && this._wrapPoints(t12, e13);
  1791. }
  1792. return o7;
  1793. }
  1794. _wrapPoints(e12, t11) {
  1795. const s7 = e12.geometry;
  1796. f2(s7) ? this._wrapMultipoint(s7, t11) : this._wrapPoint(e12, t11);
  1797. }
  1798. _wrapMultipoint(e12, t11) {
  1799. const s7 = e12.points, i5 = [];
  1800. let r8 = 0, o7 = 0;
  1801. for (const [a5, h4] of s7) {
  1802. if (i5.push([a5 + r8, h4]), r8 = 0, t11 === c5) {
  1803. const e13 = 5 * g3;
  1804. a5 + o7 < e13 ? (i5.push([t11, 0]), r8 = -t11) : a5 + o7 > c5 - e13 && (i5.push([-t11, 0]), r8 = t11);
  1805. } else
  1806. a5 + o7 < -g3 ? (i5.push([t11, 0]), r8 = -t11) : a5 + o7 > c5 + g3 && (i5.push([-t11, 0]), r8 = t11);
  1807. o7 += a5;
  1808. }
  1809. e12.points = i5;
  1810. }
  1811. _wrapPoint(e12, t11) {
  1812. const s7 = e12.geometry;
  1813. if (t11 === c5) {
  1814. const i5 = 5 * g3;
  1815. s7.x < i5 ? e12.geometry = { points: [[s7.x, s7.y], [t11, 0]] } : s7.x > c5 - i5 && (e12.geometry = { points: [[s7.x, s7.y], [-t11, 0]] });
  1816. } else
  1817. s7.x < -g3 ? e12.geometry = { points: [[s7.x, s7.y], [t11, 0]] } : s7.x > c5 + g3 && (e12.geometry = { points: [[s7.x, s7.y], [-t11, 0]] });
  1818. }
  1819. _processGraphics(e12, t11, s7) {
  1820. if (!(t11 && t11.length) || !this._meshFactory)
  1821. return null;
  1822. const i5 = o6.from(t11, this.uid), r8 = this._meshFactory;
  1823. return this._matcher.then((t12) => r8.analyzeGraphics(i5, this.container.stage.resourceManager, t12, null, null, s7).then(() => (this._attributeStore.sendUpdates(), this._processAnalyzedGraphics(e12, i5))));
  1824. }
  1825. _processAnalyzedGraphics(e12, t11) {
  1826. const s7 = this._meshFactory, i5 = t11.getSize(), r8 = t11.getCursor(), o7 = { features: i5, records: i5, metrics: 0 }, a5 = new E3(e12.key.id, o7, S.DEFAULT, false, false), h4 = [];
  1827. for (; r8.next(); ) {
  1828. const t12 = r8.readGraphic();
  1829. t12.insertAfter = t12.insertAfter === -1 ? -1 : this._displayIds.get(t12.insertAfter), t12.displayId = this._displayIds.get(t12.attributes[this.uid]);
  1830. const i6 = new e10(t12.displayId);
  1831. i6.insertAfter = t12.insertAfter, h4.push(i6), s7.writeGraphic(a5, r8, e12.level, this.container.stage.resourceManager);
  1832. }
  1833. const n7 = e12.tileInfoView.tileInfo.isWrappable, l8 = a5.serialize(n7);
  1834. if (l8.length !== 1)
  1835. return new g4();
  1836. const d7 = l8[0].message;
  1837. return g4.fromVertexData(d7, h4);
  1838. }
  1839. _abortProcessingGraphic(e12) {
  1840. if (this._graphicIdToAbortController.has(e12)) {
  1841. this._graphicIdToAbortController.get(e12).abort();
  1842. }
  1843. }
  1844. _getNullSymbol(e12) {
  1845. const t11 = e12.geometry;
  1846. return y2(t11) ? O2 : c2(t11) || s(t11) ? j2 : N;
  1847. }
  1848. _flipUpdatingGraphics() {
  1849. this._updatingGraphicsTimer && clearTimeout(this._updatingGraphicsTimer), this._updatingGraphicsTimer = setTimeout(() => {
  1850. this._updatingGraphicsTimer = null, this.notifyChange("updating");
  1851. }, 160), this.notifyChange("updating");
  1852. }
  1853. };
  1854. e([d({ constructOnly: true })], oe.prototype, "requestUpdateCallback", void 0), e([d()], oe.prototype, "container", void 0), e([d({ constructOnly: true })], oe.prototype, "graphics", void 0), e([d()], oe.prototype, "updating", null), e([d()], oe.prototype, "view", void 0), e([d()], oe.prototype, "updateRequested", void 0), oe = e([n("esri.views.2d.layers.support.GraphicsView2D")], oe);
  1855. var ae2 = oe;
  1856. // node_modules/@arcgis/core/views/2d/layers/graphics/GraphicBoundsRenderer.js
  1857. var g6 = Math.PI / 180;
  1858. var v2 = 4;
  1859. var x3 = class extends a3 {
  1860. constructor(t11) {
  1861. super(), this._dvsMat3 = e5(), this._localOrigin = { x: 0, y: 0 }, this._getBounds = t11;
  1862. }
  1863. destroy() {
  1864. this._vao && (this._vao.dispose(true), this._vao = null, this._vertexBuffer = null, this._indexBuffer = null), this._program && (this._program.dispose(), this._program = null);
  1865. }
  1866. doRender(t11) {
  1867. const { context: e12 } = t11, s7 = this._getBounds();
  1868. if (s7.length < 1)
  1869. return;
  1870. this._createShaderProgram(e12), this._updateMatricesAndLocalOrigin(t11), this._updateBufferData(e12, s7), e12.setBlendingEnabled(true), e12.setDepthTestEnabled(false), e12.setStencilWriteMask(0), e12.setStencilTestEnabled(false), e12.setBlendFunction(R2.ONE, R2.ONE_MINUS_SRC_ALPHA), e12.setColorMask(true, true, true, true);
  1871. const r8 = this._program;
  1872. e12.bindVAO(this._vao), e12.useProgram(r8), r8.setUniformMatrix3fv("u_dvsMat3", this._dvsMat3), e12.gl.lineWidth(1), e12.drawElements(E2.LINES, 8 * s7.length, C.UNSIGNED_INT, 0), e12.bindVAO();
  1873. }
  1874. _createTransforms() {
  1875. return { dvs: e5() };
  1876. }
  1877. _createShaderProgram(t11) {
  1878. if (this._program)
  1879. return;
  1880. const e12 = "precision highp float;\n uniform mat3 u_dvsMat3;\n\n attribute vec2 a_position;\n\n void main() {\n mediump vec3 pos = u_dvsMat3 * vec3(a_position, 1.0);\n gl_Position = vec4(pos.xy, 0.0, 1.0);\n }", s7 = "precision mediump float;\n void main() {\n gl_FragColor = vec4(0.75, 0.0, 0.0, 0.75);\n }";
  1881. this._program = t11.programCache.acquire(e12, s7, b3().attributes);
  1882. }
  1883. _updateMatricesAndLocalOrigin(o7) {
  1884. const { state: l8 } = o7, { displayMat3: u5, size: c6, resolution: _2, pixelRatio: m, rotation: h4, viewpoint: d7 } = l8, p3 = g6 * h4, { x: v3, y: x4 } = d7.targetGeometry, b4 = z(v3, l8.spatialReference);
  1885. this._localOrigin.x = b4, this._localOrigin.y = x4;
  1886. const y7 = m * c6[0], B2 = m * c6[1], M2 = _2 * y7, A2 = _2 * B2, O3 = r2(this._dvsMat3);
  1887. i(O3, O3, u5), M(O3, O3, t3(y7 / 2, B2 / 2)), f4(O3, O3, r3(c6[0] / M2, -B2 / A2, 1)), h(O3, O3, -p3);
  1888. }
  1889. _updateBufferData(t11, e12) {
  1890. const { x: s7, y: r8 } = this._localOrigin, i5 = 2 * v2 * e12.length, o7 = new Float32Array(i5), a5 = new Uint32Array(8 * e12.length);
  1891. let n7 = 0, f11 = 0;
  1892. for (const l8 of e12)
  1893. l8 && (o7[2 * n7 + 0] = l8[0] - s7, o7[2 * n7 + 1] = l8[1] - r8, o7[2 * n7 + 2] = l8[0] - s7, o7[2 * n7 + 3] = l8[3] - r8, o7[2 * n7 + 4] = l8[2] - s7, o7[2 * n7 + 5] = l8[3] - r8, o7[2 * n7 + 6] = l8[2] - s7, o7[2 * n7 + 7] = l8[1] - r8, a5[f11 + 0] = n7 + 0, a5[f11 + 1] = n7 + 3, a5[f11 + 2] = n7 + 3, a5[f11 + 3] = n7 + 2, a5[f11 + 4] = n7 + 2, a5[f11 + 5] = n7 + 1, a5[f11 + 6] = n7 + 1, a5[f11 + 7] = n7 + 0, n7 += 4, f11 += 8);
  1894. if (this._vertexBuffer ? this._vertexBuffer.setData(o7.buffer) : this._vertexBuffer = c3.createVertex(t11, F.DYNAMIC_DRAW, o7.buffer), this._indexBuffer ? this._indexBuffer.setData(a5) : this._indexBuffer = c3.createIndex(t11, F.DYNAMIC_DRAW, a5), !this._vao) {
  1895. const e13 = b3();
  1896. this._vao = new f5(t11, e13.attributes, e13.bufferLayouts, { geometry: this._vertexBuffer }, this._indexBuffer);
  1897. }
  1898. }
  1899. };
  1900. var b3 = () => ge("bounds", { geometry: [{ location: 0, name: "a_position", count: 2, type: C.FLOAT }] });
  1901. // node_modules/@arcgis/core/views/2d/layers/graphics/BaseGraphicContainer.js
  1902. var t10 = class extends o2 {
  1903. constructor(e12) {
  1904. super(e12), this.hasHighlight = () => true;
  1905. }
  1906. destroy() {
  1907. super.destroy(), this._boundsRenderer && (this._boundsRenderer.destroy(), this._boundsRenderer = null);
  1908. }
  1909. enableRenderingBounds(e12) {
  1910. this._boundsRenderer = new x3(e12), this.requestRender();
  1911. }
  1912. get hasLabels() {
  1913. return false;
  1914. }
  1915. onTileData(e12, s7) {
  1916. e12.patch(s7), this.contains(e12) || this.addChild(e12), this.requestRender();
  1917. }
  1918. onTileError(e12) {
  1919. e12.clear(), this.contains(e12) || this.addChild(e12);
  1920. }
  1921. _renderChildren(e12, s7) {
  1922. for (const t11 of this.children)
  1923. t11.isReady && t11.hasData && (t11.commit(e12), e12.context.setStencilFunction(I.EQUAL, t11.stencilRef, 255), t11._displayList.replay(e12, t11, s7));
  1924. }
  1925. };
  1926. export {
  1927. ae2 as ae,
  1928. t10 as t
  1929. };
  1930. //# sourceMappingURL=chunk-OBOLLK7J.js.map