chunk-DXEPL3XQ.js 23 KB

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