chunk-3XO4E4TL.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. import {
  2. o as o4,
  3. r as r2
  4. } from "./chunk-6G6XHVK2.js";
  5. import {
  6. c as c2,
  7. e as e4
  8. } from "./chunk-YJKEIUMW.js";
  9. import {
  10. l as l2,
  11. n as n2
  12. } from "./chunk-II7RCTF3.js";
  13. import {
  14. f
  15. } from "./chunk-HWIURR7X.js";
  16. import {
  17. J,
  18. Q,
  19. le,
  20. me
  21. } from "./chunk-Q4LKAPDF.js";
  22. import {
  23. D as D4
  24. } from "./chunk-GDB2KX4Y.js";
  25. import {
  26. u as u2
  27. } from "./chunk-546QCRS4.js";
  28. import {
  29. B,
  30. C,
  31. D as D3,
  32. E as E2,
  33. F,
  34. G as G2,
  35. H,
  36. M as M2,
  37. N,
  38. O,
  39. P as P2,
  40. R,
  41. ct,
  42. o as o2
  43. } from "./chunk-WFSV2B2I.js";
  44. import {
  45. D as D2,
  46. G,
  47. L,
  48. M,
  49. P,
  50. V,
  51. Y
  52. } from "./chunk-MI7HWWFL.js";
  53. import {
  54. e as e3
  55. } from "./chunk-ZHRMTKME.js";
  56. import {
  57. n
  58. } from "./chunk-MFFE4I2S.js";
  59. import {
  60. f as f2,
  61. o as o3
  62. } from "./chunk-K3NA3LQS.js";
  63. import {
  64. l
  65. } from "./chunk-4E6K4P67.js";
  66. import {
  67. e as e2
  68. } from "./chunk-3OHML7FO.js";
  69. import {
  70. i,
  71. s as s3
  72. } from "./chunk-CRGVDJI6.js";
  73. import {
  74. z as z2
  75. } from "./chunk-6P6NA7JB.js";
  76. import {
  77. m
  78. } from "./chunk-FONIFA5N.js";
  79. import {
  80. z
  81. } from "./chunk-O4FY3ITT.js";
  82. import {
  83. u
  84. } from "./chunk-WEMIK25H.js";
  85. import {
  86. D
  87. } from "./chunk-ULGDPLM2.js";
  88. import {
  89. s,
  90. s3 as s2
  91. } from "./chunk-EMJ4ZSM2.js";
  92. import {
  93. A,
  94. E,
  95. a,
  96. c,
  97. e,
  98. o,
  99. r,
  100. t,
  101. v
  102. } from "./chunk-GZT4BVFP.js";
  103. // node_modules/@arcgis/core/views/2d/engine/webgl/WGLTile.js
  104. var m2 = class {
  105. acquire(s4) {
  106. return { refCount: 1, version: -1, labelMat2d: e3(), tileMat3: e3(), dvs: e3() };
  107. }
  108. release(s4) {
  109. }
  110. };
  111. var c3 = class extends r2 {
  112. constructor(s4, t2, r4) {
  113. super(s4, t2, r4, o2, o2);
  114. }
  115. destroy() {
  116. super.destroy(), this._transforms && c3.TransformCache.release(this.key.hash);
  117. }
  118. setTransform(a2, n3) {
  119. const h2 = n3 / (a2.resolution * a2.pixelRatio), m3 = this.transforms.tileMat3, [c5, f3] = a2.toScreenNoRotation([0, 0], [this.x, this.y]), l3 = this.width / this.rangeX * h2, u3 = this.height / this.rangeY * h2;
  120. s3(m3, l3, 0, 0, 0, u3, 0, c5, f3, 1), i(this.transforms.dvs, a2.displayViewMat3, m3);
  121. const d = this.transforms.labelMat2d, p = a2.getScreenTransform(d, n3), j = n();
  122. z2(j, [this.x, this.y], p), f2(d, j), o3(d, a2.viewMat2d, d);
  123. }
  124. _createTransforms() {
  125. return c3.TransformCache.acquire(this.key.hash);
  126. }
  127. };
  128. c3.TransformCache = new m2();
  129. // node_modules/@arcgis/core/views/2d/engine/webgl/AttributeStoreView.js
  130. var V2 = s.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");
  131. var L2 = n2(l2, V2);
  132. var G3 = class {
  133. constructor(t2, e5, i3) {
  134. this._texture = null, this._lastTexture = null, this._fbos = {}, this.texelSize = 4;
  135. const { buffer: s4, pixelType: r4, textureOnly: a2 } = t2, d = me(r4);
  136. this.shared = i3, this.pixelType = r4, this.size = e5, this.textureOnly = a2, a2 || (this.data = new d(e(s4))), this._resetRange();
  137. }
  138. destroy() {
  139. o(this._texture, (t2) => t2.dispose());
  140. for (const t2 in this._fbos)
  141. o(this._fbos[t2], (e5) => {
  142. t2 === "0" && e5.detachColorTexture(), e5.dispose();
  143. }), this._fbos[t2] = null;
  144. this._texture = null;
  145. }
  146. get _textureDesc() {
  147. return { target: M.TEXTURE_2D, wrapMode: D2.CLAMP_TO_EDGE, pixelFormat: P.RGBA, dataType: this.pixelType, samplingMode: L.NEAREST, width: this.size, height: this.size };
  148. }
  149. setData(t2, e5, i3) {
  150. const s4 = f(t2), r4 = e(this.data), a2 = s4 * this.texelSize + e5;
  151. !r4 || a2 >= r4.length || (r4[a2] = i3, this.dirtyStart = Math.min(this.dirtyStart, s4), this.dirtyEnd = Math.max(this.dirtyEnd, s4));
  152. }
  153. getData(t2, e5) {
  154. if (t(this.data))
  155. return null;
  156. const i3 = f(t2) * this.texelSize + e5;
  157. return !this.data || i3 >= this.data.length ? null : this.data[i3];
  158. }
  159. getTexture(t2) {
  160. return c(this._texture, () => this._initTexture(t2));
  161. }
  162. getFBO(t2, e5 = 0) {
  163. if (t(this._fbos[e5])) {
  164. const i3 = { colorTarget: Y.TEXTURE, depthStencilTarget: V.NONE }, s4 = e5 === 0 ? this.getTexture(t2) : this._textureDesc;
  165. this._fbos[e5] = new D4(t2, i3, s4);
  166. }
  167. return this._fbos[e5];
  168. }
  169. get locked() {
  170. return !(this.pixelType !== G.UNSIGNED_BYTE || !this.shared || this.textureOnly || !a("esri-atomics") || !this.data) && Atomics.load(this.data, 0) === 1;
  171. }
  172. get hasDirty() {
  173. const t2 = this.dirtyStart;
  174. return this.dirtyEnd >= t2;
  175. }
  176. updateTexture(e5, i3) {
  177. if (!this.locked) {
  178. try {
  179. const i4 = this.dirtyStart, s4 = this.dirtyEnd;
  180. if (!this.hasDirty)
  181. return;
  182. this._resetRange();
  183. const r4 = e(this.data).buffer, a2 = this.getTexture(e5), d = 4, n3 = (i4 - i4 % this.size) / this.size, o6 = (s4 - s4 % this.size) / this.size, u3 = n3, l3 = this.size, p = o6, x = n3 * this.size * d, _2 = (l3 + p * this.size) * d - x, g = me(this.pixelType), c5 = new g(r4, x * g.BYTES_PER_ELEMENT, _2), T = this.size, f3 = p - u3 + 1;
  184. if (f3 > this.size)
  185. return void V2.error(new s2("mapview-webgl", "Out-of-bounds index when updating AttributeData"));
  186. a2.updateData(0, 0, u3, T, f3, c5);
  187. } catch (s4) {
  188. }
  189. i3();
  190. }
  191. }
  192. update(t2) {
  193. const { data: e5, start: i3, end: s4 } = t2;
  194. if (r(e5)) {
  195. const s5 = this.data, r4 = i3 * this.texelSize;
  196. for (let i4 = 0; i4 < e5.length; i4++) {
  197. const a2 = 1 << i4 % this.texelSize;
  198. t2.layout & a2 && (s5[r4 + i4] = e5[i4]);
  199. }
  200. }
  201. this.dirtyStart = Math.min(this.dirtyStart, i3), this.dirtyEnd = Math.max(this.dirtyEnd, s4);
  202. }
  203. resize(t2, e5) {
  204. const i3 = this.size;
  205. if (this.size = e5, this.textureOnly)
  206. return void (i3 !== this.size && (this._lastTexture = this._texture, this._texture = null));
  207. const s4 = me(this.pixelType);
  208. this.destroy(), this.data = new s4(e(t2.buffer));
  209. }
  210. _resetRange() {
  211. this.dirtyStart = 2147483647, this.dirtyEnd = 0;
  212. }
  213. _initTexture(t2) {
  214. const e5 = new u2(t2, this._textureDesc, c(this.data, void 0));
  215. if (r(this._lastTexture) && this._fbos[0]) {
  216. const i3 = this._lastTexture.descriptor.width, s4 = this._lastTexture.descriptor.height, r4 = this._lastTexture.descriptor.dataType, a2 = this._lastTexture.descriptor.pixelFormat, d = this.getFBO(t2), h2 = le(r4), n3 = new (me(r4))(new ArrayBuffer(i3 * s4 * h2 * this.texelSize)), o6 = t2.getBoundFramebufferObject(), { x: u3, y: l3, width: p, height: x } = t2.getViewport();
  217. t2.bindFramebuffer(d), d.readPixels(0, 0, i3, s4, a2, r4, n3), e5.updateData(0, 0, 0, 2 * i3, s4 / 2, n3), t2.setViewport(u3, l3, p, x), t2.bindFramebuffer(o6);
  218. }
  219. return this.destroy(), this._texture = e5, this._texture;
  220. }
  221. };
  222. var P3 = class {
  223. constructor(t2) {
  224. this._onUpdate = t2, this._initialized = false, this._forceNextUpload = false, this._locked = false;
  225. }
  226. initialize(t2) {
  227. const { blocks: e5, shared: i3, size: d } = t2;
  228. if (this.shared = i3, this.size = d, L2("Initializing AttributeStoreView", t2), t(this._data))
  229. this._data = v(e5, (t3) => new G3(t3, d, i3));
  230. else
  231. for (let r4 = 0; r4 < this._data.length; r4++) {
  232. const t3 = this._data[r4], h2 = e5[r4];
  233. r(h2) && (t(t3) ? this._data[r4] = new G3(h2, d, i3) : t3.resize(h2, d));
  234. }
  235. this._initialized = true;
  236. }
  237. destroy() {
  238. o(this._data, (t2) => v(t2, (t3) => t3.destroy())), o(this._defaultTexture, (t2) => t2.dispose());
  239. }
  240. isEmpty() {
  241. const t2 = this._data;
  242. return t(t2);
  243. }
  244. isUpdating() {
  245. const t2 = r(this._pendingAttributeUpdate), i3 = t2;
  246. return a("esri-2d-log-updating") && console.log(`Updating AttributeStoreView ${i3}
  247. -> hasPendingUpdate ${t2}`), i3;
  248. }
  249. getBlock(t2) {
  250. if (t(this._data))
  251. return null;
  252. return this._data[t2];
  253. }
  254. setLabelMinZoom(t2, e5) {
  255. this.setData(t2, 0, 1, e5);
  256. }
  257. getLabelMinZoom(t2) {
  258. return this.getData(t2, 0, 1, 255);
  259. }
  260. getFilterFlags(t2) {
  261. return this.getData(t2, 0, 0, 0);
  262. }
  263. getVVSize(t2) {
  264. return this.getData(t2, P2, 0, 0);
  265. }
  266. getData(t2, e5, i3, r4) {
  267. if (!this._data)
  268. return 0;
  269. const d = e(this._data)[e5];
  270. if (t(d))
  271. return 0;
  272. const n3 = d.getData(t2, i3);
  273. return r(n3) ? n3 : r4;
  274. }
  275. setData(t2, e5, i3, s4) {
  276. const r4 = e(this._data)[e5];
  277. e(r4).setData(t2, i3, s4);
  278. }
  279. lockTextureUpload() {
  280. this._locked = true;
  281. }
  282. unlockTextureUpload() {
  283. this._locked = false;
  284. }
  285. forceTextureUpload() {
  286. this._forceNextUpload = true;
  287. }
  288. async requestUpdate(e5) {
  289. if (this._pendingAttributeUpdate)
  290. return void V2.error(new s2("mapview-webgl", "Tried to update attribute data with a pending update"));
  291. const i3 = D();
  292. return L2("AttributeStoreView Update Requested", e5), this._pendingAttributeUpdate = { data: e5, resolver: i3 }, i3.promise;
  293. }
  294. update() {
  295. if (this._initialized && r(this._pendingAttributeUpdate)) {
  296. a("esri-2d-update-debug") && console.debug("AttributeStoreView::update");
  297. const { data: t2, resolver: i3 } = this._pendingAttributeUpdate, s4 = e(this._data);
  298. for (let e5 = 0; e5 < t2.blocks.length; e5++) {
  299. const i4 = t2.blocks[e5], r4 = s4[e5];
  300. o(r4, (t3) => o(i4, (i5) => {
  301. L2(`Updating block ${e5}`, i5), t3.update(i5);
  302. }));
  303. }
  304. this._pendingAttributeUpdate = null, i3(), this._onUpdate();
  305. }
  306. }
  307. bindTextures(t2, e5 = true) {
  308. this.update();
  309. const i3 = this._getDefaultTexture(t2);
  310. if (!this._initialized)
  311. return t2.bindTexture(i3, B), void (e5 && (t2.bindTexture(i3, C), t2.bindTexture(i3, D3), t2.bindTexture(i3, E2), t2.bindTexture(i3, F), t2.bindTexture(i3, G2), t2.bindTexture(i3, H)));
  312. const s4 = e(this._data);
  313. this._locked && !this._forceNextUpload || (A(s4, (e6) => e6.updateTexture(t2, () => this._onUpdate())), this._forceNextUpload = false), t2.bindTexture(E(s4[M2], i3, (e6) => e6.getTexture(t2)), B), e5 && (t2.bindTexture(E(s4[O], i3, (e6) => e6.getTexture(t2)), H), t2.bindTexture(E(s4[N], i3, (e6) => e6.getTexture(t2)), C), t2.bindTexture(E(s4[P2], i3, (e6) => e6.getTexture(t2)), D3), t2.bindTexture(E(s4[R], i3, (e6) => e6.getTexture(t2)), E2), t2.bindTexture(E(s4[F], i3, (e6) => e6.getTexture(t2)), F), t2.bindTexture(E(s4[G2], i3, (e6) => e6.getTexture(t2)), G2));
  314. }
  315. _getDefaultTexture(t2) {
  316. if (t(this._defaultTexture)) {
  317. const e5 = { wrapMode: D2.CLAMP_TO_EDGE, pixelFormat: P.RGBA, dataType: G.UNSIGNED_BYTE, samplingMode: L.NEAREST, width: 1, height: 1 };
  318. this._defaultTexture = new u2(t2, e5, new Uint8Array(4));
  319. }
  320. return this._defaultTexture;
  321. }
  322. };
  323. // node_modules/@arcgis/core/views/2d/engine/webgl/WGLRendererInfo.js
  324. function c4(e5, t2) {
  325. const i3 = t2.length;
  326. if (e5 < t2[0].value || i3 === 1)
  327. return t2[0].size;
  328. for (let s4 = 1; s4 < i3; s4++)
  329. if (e5 < t2[s4].value) {
  330. const i4 = (e5 - t2[s4 - 1].value) / (t2[s4].value - t2[s4 - 1].value);
  331. return t2[s4 - 1].size + i4 * (t2[s4].size - t2[s4 - 1].size);
  332. }
  333. return t2[i3 - 1].size;
  334. }
  335. var h = class {
  336. constructor() {
  337. this.symbolLevels = [], this.vvColorValues = new Float32Array(8), this.vvColors = new Float32Array(32), this.vvOpacityValues = new Float32Array(8), this.vvOpacities = new Float32Array(8), this.vvSizeMinMaxValue = new Float32Array(4), this._vvMaterialParameters = { vvSizeEnabled: false, vvColorEnabled: false, vvRotationEnabled: false, vvRotationType: "geographic", vvOpacityEnabled: false }, this._technique = e4;
  338. }
  339. getSizeVVFieldStops(i3) {
  340. const s4 = this._vvSizeFieldStops;
  341. switch (s4.type) {
  342. case "static":
  343. return s4;
  344. case "level-dependent":
  345. return c(s4.levels[i3], () => {
  346. let e5 = 1 / 0, a2 = 0;
  347. for (const t2 in s4.levels) {
  348. const s5 = parseFloat(t2), r5 = Math.abs(i3 - s5);
  349. r5 < e5 && (e5 = r5, a2 = s5);
  350. }
  351. if (e5 === 1 / 0)
  352. return { sizes: new Float32Array([0, 0, 0, 0, 0, 0]), values: new Float32Array([0, 0, 0, 0, 0, 0]) };
  353. const r4 = 2 ** ((i3 - a2) / 2), o6 = e(s4.levels[a2]), l3 = new Float32Array(o6.values);
  354. return l3[2] *= r4, l3[3] *= r4, { sizes: e(o6.sizes), values: l3 };
  355. });
  356. }
  357. }
  358. get vvMaterialParameters() {
  359. return this._vvMaterialParameters;
  360. }
  361. update(e5) {
  362. r(this._vvInfo) && this._updateVisualVariables(this._vvInfo.vvRanges, e5);
  363. }
  364. setInfo(e5, t2, i3) {
  365. this._updateEffects(i3), this._vvInfo = t2, this._technique = c2(e5), this.rendererSchema = this._technique.createOrUpdateRendererSchema(this.rendererSchema, e5);
  366. }
  367. getVariation() {
  368. return { ...this._technique.getVariation(this.rendererSchema), outsideLabelsVisible: this.outsideLabelsVisible, supportsTextureFloat: l("2d").supportsTextureFloat };
  369. }
  370. getVariationHash() {
  371. return this._technique.getVariationHash(this.rendererSchema) << 1 | (this.outsideLabelsVisible ? 1 : 0);
  372. }
  373. _updateEffects(e5) {
  374. r(e5) ? this.outsideLabelsVisible = e5.excludedLabelsVisible : this.outsideLabelsVisible = false;
  375. }
  376. _updateVisualVariables(e5, t2) {
  377. const i3 = this._vvMaterialParameters;
  378. if (i3.vvOpacityEnabled = false, i3.vvSizeEnabled = false, i3.vvColorEnabled = false, i3.vvRotationEnabled = false, !e5)
  379. return;
  380. const n3 = e5.size;
  381. if (n3) {
  382. if (i3.vvSizeEnabled = true, n3.minMaxValue) {
  383. const e6 = n3.minMaxValue;
  384. let i4, a2;
  385. if (J(e6.minSize) && J(e6.maxSize))
  386. if (Q(e6.minSize) && Q(e6.maxSize))
  387. i4 = u(e6.minSize), a2 = u(e6.maxSize);
  388. else {
  389. const r4 = t2.scale;
  390. i4 = u(c4(r4, e6.minSize.stops)), a2 = u(c4(r4, e6.maxSize.stops));
  391. }
  392. this.vvSizeMinMaxValue.set([e6.minDataValue, e6.maxDataValue, i4, a2]);
  393. }
  394. if (n3.scaleStops && (this.vvSizeScaleStopsValue = u(c4(t2.scale, n3.scaleStops.stops))), n3.unitValue) {
  395. const e6 = z(t2.spatialReference) / m[n3.unitValue.unit];
  396. this.vvSizeUnitValueToPixelsRatio = e6 / t2.resolution;
  397. }
  398. n3.fieldStops && (this._vvSizeFieldStops = n3.fieldStops);
  399. }
  400. const v2 = e5.color;
  401. v2 && (i3.vvColorEnabled = true, this.vvColorValues.set(v2.values), this.vvColors.set(v2.colors));
  402. const u3 = e5.opacity;
  403. u3 && (i3.vvOpacityEnabled = true, this.vvOpacityValues.set(u3.values), this.vvOpacities.set(u3.opacities));
  404. const h2 = e5.rotation;
  405. h2 && (i3.vvRotationEnabled = true, i3.vvRotationType = h2.type);
  406. }
  407. };
  408. // node_modules/@arcgis/core/views/2d/engine/FeatureContainer.js
  409. var o5 = class extends o4 {
  410. constructor(e5) {
  411. super(e5), this._rendererInfo = new h(), this._materialItemsRequestQueue = new e2(), this.attributeView = new P3(() => this.onAttributeStoreUpdate());
  412. }
  413. destroy() {
  414. this.removeAllChildren(), this.children.forEach((e5) => e5.destroy()), this.attributeView.destroy(), this._materialItemsRequestQueue.clear();
  415. }
  416. setRendererInfo(e5, t2, r4) {
  417. this._rendererInfo.setInfo(e5, t2, r4), this.requestRender();
  418. }
  419. async getMaterialItems(t2, r4) {
  420. if (!t2 || t2.length === 0)
  421. return null;
  422. const s4 = D();
  423. return this._materialItemsRequestQueue.push({ items: t2, abortOptions: r4, resolver: s4 }), this.requestRender(), s4.promise;
  424. }
  425. doRender(e5) {
  426. if (e5.context.capabilities.enable("textureFloat"), e5.context.capabilities.enable("vao"), this._materialItemsRequestQueue.length > 0) {
  427. let t2 = this._materialItemsRequestQueue.pop();
  428. for (; t2; )
  429. this._processMaterialItemRequest(e5, t2), t2 = this._materialItemsRequestQueue.pop();
  430. }
  431. super.doRender(e5);
  432. }
  433. renderChildren(e5) {
  434. for (const t2 of this.children)
  435. t2.commit(e5);
  436. this._rendererInfo.update(e5.state), super.renderChildren(e5);
  437. }
  438. createRenderParams(e5) {
  439. const t2 = super.createRenderParams(e5);
  440. return t2.rendererInfo = this._rendererInfo, t2.attributeView = this.attributeView, t2;
  441. }
  442. onAttributeStoreUpdate() {
  443. }
  444. _processMaterialItemRequest(e5, { items: t2, abortOptions: r4, resolver: s4 }) {
  445. const { painter: i3, pixelRatio: o6 } = e5, n3 = t2.map((e6) => i3.textureManager.rasterizeItem(e6.symbol, o6, e6.glyphIds, r4));
  446. Promise.all(n3).then((e6) => {
  447. if (!this.stage)
  448. return void s4.reject();
  449. const r5 = e6.map((e7, r6) => ({ id: t2[r6].id, mosaicItem: e7 }));
  450. s4.resolve(r5);
  451. }, s4.reject);
  452. }
  453. };
  454. // node_modules/@arcgis/core/views/2d/engine/webgl/cpuMapped/DisplayRecordReader.js
  455. var r3 = 2147483647;
  456. var i2 = class {
  457. constructor(t2) {
  458. this._head = t2, this._cursor = t2;
  459. }
  460. static from(t2, e5 = 0, s4 = t2.byteLength / _.BYTES_PER_RECORD - e5) {
  461. const r4 = new _(new Int32Array(t2, e5 * _.BYTES_PER_RECORD, s4 * _.ELEMENTS_PER_RECORD));
  462. return new i2(r4);
  463. }
  464. size() {
  465. let t2 = this._cursor, e5 = 0;
  466. for (; t2; )
  467. e5 += t2.size(), t2 = t2._link;
  468. return e5;
  469. }
  470. get id() {
  471. return this._cursor.id;
  472. }
  473. set id(t2) {
  474. this._cursor.id = t2;
  475. }
  476. get materialKey() {
  477. return this._cursor.materialKey;
  478. }
  479. set materialKey(t2) {
  480. this._cursor.materialKey = t2;
  481. }
  482. get insertAfter() {
  483. return this._cursor.insertAfter;
  484. }
  485. get indexFrom() {
  486. return this._cursor.indexFrom;
  487. }
  488. set indexFrom(t2) {
  489. this._cursor.indexFrom = t2;
  490. }
  491. get indexCount() {
  492. return this._cursor.indexCount;
  493. }
  494. set indexCount(t2) {
  495. this._cursor.indexCount = t2;
  496. }
  497. get vertexFrom() {
  498. return this._cursor.vertexFrom;
  499. }
  500. set vertexFrom(t2) {
  501. this._cursor.vertexFrom = t2;
  502. }
  503. get vertexCount() {
  504. return this._cursor.vertexCount;
  505. }
  506. set vertexCount(t2) {
  507. this._cursor.vertexCount = t2;
  508. }
  509. get sortKey() {
  510. return this._cursor.sortKey;
  511. }
  512. set sortKey(t2) {
  513. this._cursor.sortKey = t2;
  514. }
  515. get index() {
  516. return this._cursor._indexStart + this._cursor._index;
  517. }
  518. seekIndex(t2) {
  519. let e5 = t2;
  520. for (this._cursor = this._head; this._cursor; ) {
  521. const t3 = this._cursor.size();
  522. if (e5 < t3)
  523. return this._cursor._index = e5, true;
  524. e5 -= t3, this._cursor = this._cursor._link;
  525. }
  526. return false;
  527. }
  528. forEach(t2) {
  529. const e5 = this.getCursor();
  530. for (; e5.next(); )
  531. t2(e5);
  532. }
  533. link(t2) {
  534. if (!this._head)
  535. return void (this._head = t2._head);
  536. let e5 = this._head;
  537. for (; e5._link; )
  538. e5 = e5._link;
  539. e5._link = t2._head, e5._link._indexStart = e5._indexStart + e5.size();
  540. }
  541. getCursor() {
  542. return this.copy();
  543. }
  544. lookup(t2) {
  545. for (this._cursor = this._head; this._cursor && !this._cursor.lookup(t2); ) {
  546. if (!this._cursor._link)
  547. return false;
  548. this._cursor = this._cursor._link;
  549. }
  550. return !!this._cursor;
  551. }
  552. copy() {
  553. const t2 = new i2(this._head?.copy());
  554. if (!t2._head)
  555. return t2;
  556. let e5 = t2._head, s4 = t2._head._link;
  557. for (; s4; )
  558. e5._link = s4.copy(), e5 = s4, s4 = e5._link;
  559. return t2;
  560. }
  561. next() {
  562. return !!this._cursor && (!!this._cursor.next() || !!this._cursor._link && (this._cursor = this._cursor._link, this.next()));
  563. }
  564. peekId() {
  565. return this._cursor.peekId() ?? this._cursor._link.peekId();
  566. }
  567. delete(e5) {
  568. let s4 = this._head, r4 = null;
  569. for (; s4; ) {
  570. if (s4.delete(e5))
  571. return s4.isEmpty() && (r(r4) && (r4._link = s4._link), s4 === this._head && (this._head = s4._link), s4 === this._cursor && (this._cursor = s4._link)), true;
  572. r4 = s4, s4 = s4._link;
  573. }
  574. return false;
  575. }
  576. };
  577. i2.ELEMENTS_PER_RECORD = ct, i2.BYTES_PER_RECORD = i2.ELEMENTS_PER_RECORD * Int32Array.BYTES_PER_ELEMENT;
  578. var _ = class {
  579. constructor(t2) {
  580. this._link = null, this._index = -1, this._indexStart = 0, this._deletedCount = 0, this._offsets = { instance: null }, this._packedRecords = t2;
  581. }
  582. static from(t2, e5 = 0, s4 = t2.byteLength / this.BYTES_PER_RECORD - e5) {
  583. return new _(new Int32Array(t2, e5 * this.BYTES_PER_RECORD, s4 * this.ELEMENTS_PER_RECORD));
  584. }
  585. delete(t2) {
  586. const e5 = this._index, s4 = this.lookup(t2);
  587. if (s4)
  588. for (this.id = r3, ++this._deletedCount; this.next() && this.id === t2; )
  589. this.id = r3, ++this._deletedCount;
  590. return this._index = e5, s4;
  591. }
  592. isEmpty() {
  593. return this._deletedCount === this.size();
  594. }
  595. link(t2) {
  596. this._link ? this._link.link(t2) : this._link = t2;
  597. }
  598. lookup(t2) {
  599. if (t(this._offsets.instance)) {
  600. this._offsets.instance = new Map();
  601. const t3 = this.copy();
  602. t3._index = -1;
  603. let e5 = 0;
  604. for (; t3.next(); )
  605. t3.id !== e5 && (this._offsets.instance.set(t3.id, t3._index), e5 = t3.id);
  606. }
  607. if (!this._offsets.instance.has(t2))
  608. return false;
  609. const s4 = this._index;
  610. return this._index = this._offsets.instance.get(t2), this.id !== r3 || (this._index = s4, false);
  611. }
  612. get id() {
  613. return this._packedRecords[this._index * _.ELEMENTS_PER_RECORD];
  614. }
  615. set id(t2) {
  616. this._packedRecords[this._index * _.ELEMENTS_PER_RECORD] = t2;
  617. }
  618. get materialKey() {
  619. return this._packedRecords[this._index * _.ELEMENTS_PER_RECORD + 1];
  620. }
  621. set materialKey(t2) {
  622. this._packedRecords[this._index * _.ELEMENTS_PER_RECORD + 1] = t2;
  623. }
  624. get insertAfter() {
  625. return this._packedRecords[this._index * _.ELEMENTS_PER_RECORD + 2];
  626. }
  627. get indexFrom() {
  628. return this._packedRecords[this._index * _.ELEMENTS_PER_RECORD + 3];
  629. }
  630. set indexFrom(t2) {
  631. this._packedRecords[this._index * _.ELEMENTS_PER_RECORD + 3] = t2;
  632. }
  633. get indexCount() {
  634. return this._packedRecords[this._index * _.ELEMENTS_PER_RECORD + 4];
  635. }
  636. set indexCount(t2) {
  637. this._packedRecords[this._index * _.ELEMENTS_PER_RECORD + 4] = t2;
  638. }
  639. get vertexFrom() {
  640. return this._packedRecords[this._index * _.ELEMENTS_PER_RECORD + 5];
  641. }
  642. set vertexFrom(t2) {
  643. this._packedRecords[this._index * _.ELEMENTS_PER_RECORD + 5] = t2;
  644. }
  645. get vertexCount() {
  646. return this._packedRecords[this._index * _.ELEMENTS_PER_RECORD + 6];
  647. }
  648. set vertexCount(t2) {
  649. this._packedRecords[this._index * _.ELEMENTS_PER_RECORD + 6] = t2;
  650. }
  651. get sortKey() {
  652. return this._packedRecordsF32 || (this._packedRecordsF32 = new Float32Array(this._packedRecords.buffer)), this._packedRecordsF32[this._index * _.ELEMENTS_PER_RECORD + 7];
  653. }
  654. set sortKey(t2) {
  655. this._packedRecordsF32 || (this._packedRecordsF32 = new Float32Array(this._packedRecords.buffer)), this._packedRecordsF32[this._index * _.ELEMENTS_PER_RECORD + 7] = t2;
  656. }
  657. get index() {
  658. return this._index;
  659. }
  660. size() {
  661. return this._packedRecords.length / _.ELEMENTS_PER_RECORD;
  662. }
  663. next() {
  664. for (; ++this._index < this.size() && this.id === r3; )
  665. ;
  666. return this._index < this.size();
  667. }
  668. peekId() {
  669. const t2 = (this._index + 1) * _.ELEMENTS_PER_RECORD;
  670. return t2 >= this._packedRecords.length ? 0 : this._packedRecords[t2];
  671. }
  672. getCursor() {
  673. return this.copy();
  674. }
  675. copy() {
  676. const t2 = new _(this._packedRecords);
  677. return t2._indexStart = this._indexStart, t2._link = this._link, t2._index = this._index, t2._offsets = this._offsets, t2._deletedCount = this._deletedCount, t2;
  678. }
  679. };
  680. _.ELEMENTS_PER_RECORD = ct, _.BYTES_PER_RECORD = _.ELEMENTS_PER_RECORD * Int32Array.BYTES_PER_ELEMENT;
  681. export {
  682. c3 as c,
  683. i2 as i,
  684. o5 as o
  685. };
  686. //# sourceMappingURL=chunk-3XO4E4TL.js.map