chunk-RMZNH22Z.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. import {
  2. O
  3. } from "./chunk-RUM3DXFX.js";
  4. import {
  5. s2 as s,
  6. s3 as s2
  7. } from "./chunk-E5O6P5I2.js";
  8. import {
  9. y
  10. } from "./chunk-SPWQ3AWG.js";
  11. // node_modules/@arcgis/core/chunks/quatf32.js
  12. function e() {
  13. const e2 = new Float32Array(4);
  14. return e2[3] = 1, e2;
  15. }
  16. function r(e2) {
  17. const r3 = new Float32Array(4);
  18. return r3[0] = e2[0], r3[1] = e2[1], r3[2] = e2[2], r3[3] = e2[3], r3;
  19. }
  20. function t(e2, r3, t3, n3) {
  21. const o3 = new Float32Array(4);
  22. return o3[0] = e2, o3[1] = r3, o3[2] = t3, o3[3] = n3, o3;
  23. }
  24. function n(e2, r3) {
  25. return new Float32Array(e2, r3, 4);
  26. }
  27. var o = Object.freeze(Object.defineProperty({ __proto__: null, create: e, clone: r, fromValues: t, createView: n }, Symbol.toStringTag, { value: "Module" }));
  28. // node_modules/@arcgis/core/views/3d/layers/i3s/LEPCC.js
  29. var t2 = true;
  30. var o2 = { identifierOffset: 0, identifierLength: 10, versionOffset: 10, checksumOffset: 12, byteCount: 16 };
  31. function r2(e2, r3, n3) {
  32. return { identifier: String.fromCharCode.apply(null, new Uint8Array(e2, n3 + o2.identifierOffset, o2.identifierLength)), version: r3.getUint16(n3 + o2.versionOffset, t2), checksum: r3.getUint32(n3 + o2.checksumOffset, t2) };
  33. }
  34. var n2 = { sizeLo: 0, sizeHi: 4, minX: 8, minY: 16, minZ: 24, maxX: 32, maxY: 40, maxZ: 48, errorX: 56, errorY: 64, errorZ: 72, count: 80, reserved: 84, byteCount: 88 };
  35. function i(e2, o3) {
  36. return { sizeLo: e2.getUint32(o3 + n2.sizeLo, t2), sizeHi: e2.getUint32(o3 + n2.sizeHi, t2), minX: e2.getFloat64(o3 + n2.minX, t2), minY: e2.getFloat64(o3 + n2.minY, t2), minZ: e2.getFloat64(o3 + n2.minZ, t2), maxX: e2.getFloat64(o3 + n2.maxX, t2), maxY: e2.getFloat64(o3 + n2.maxY, t2), maxZ: e2.getFloat64(o3 + n2.maxZ, t2), errorX: e2.getFloat64(o3 + n2.errorX, t2), errorY: e2.getFloat64(o3 + n2.errorY, t2), errorZ: e2.getFloat64(o3 + n2.errorZ, t2), count: e2.getUint32(o3 + n2.count, t2), reserved: e2.getUint32(o3 + n2.reserved, t2) };
  37. }
  38. function c(t3) {
  39. const c3 = new DataView(t3, 0);
  40. let d3 = 0;
  41. const { identifier: l3, version: a3 } = r2(t3, c3, d3);
  42. if (d3 += o2.byteCount, "LEPCC " !== l3)
  43. throw new s2("lepcc-decode-error", "Bad identifier");
  44. if (a3 > 1)
  45. throw new s2("lepcc-decode-error", "Unknown version");
  46. const u3 = i(c3, d3);
  47. d3 += n2.byteCount;
  48. if (u3.sizeHi * 2 ** 32 + u3.sizeLo !== t3.byteLength)
  49. throw new s2("lepcc-decode-error", "Bad size");
  50. const f3 = new Float64Array(3 * u3.count), h3 = [], w2 = [], g2 = [], p = [];
  51. if (d3 = s3(t3, d3, h3), d3 = s3(t3, d3, w2), d3 = s3(t3, d3, g2), d3 = s3(t3, d3, p), d3 !== t3.byteLength)
  52. throw new s2("lepcc-decode-error", "Bad length");
  53. let m2 = 0, U = 0;
  54. for (let e2 = 0; e2 < h3.length; e2++) {
  55. U += h3[e2];
  56. let t4 = 0;
  57. for (let o3 = 0; o3 < w2[e2]; o3++) {
  58. t4 += g2[m2];
  59. const e3 = p[m2];
  60. f3[3 * m2] = Math.min(u3.maxX, u3.minX + 2 * u3.errorX * t4), f3[3 * m2 + 1] = Math.min(u3.maxY, u3.minY + 2 * u3.errorY * U), f3[3 * m2 + 2] = Math.min(u3.maxZ, u3.minZ + 2 * u3.errorZ * e3), m2++;
  61. }
  62. }
  63. return { errorX: u3.errorX, errorY: u3.errorY, errorZ: u3.errorZ, result: f3 };
  64. }
  65. function s3(e2, t3, o3) {
  66. const r3 = [];
  67. t3 = d(e2, t3, r3);
  68. const n3 = [];
  69. for (let i2 = 0; i2 < r3.length; i2++) {
  70. n3.length = 0, t3 = d(e2, t3, n3);
  71. for (let e3 = 0; e3 < n3.length; e3++)
  72. o3.push(n3[e3] + r3[i2]);
  73. }
  74. return t3;
  75. }
  76. function d(o3, r3, n3) {
  77. const i2 = new DataView(o3, r3), c3 = i2.getUint8(0), s5 = 31 & c3, d3 = !!(32 & c3), l3 = (192 & c3) >> 6;
  78. let a3 = 0;
  79. if (0 === l3)
  80. a3 = i2.getUint32(1, t2), r3 += 5;
  81. else if (1 === l3)
  82. a3 = i2.getUint16(1, t2), r3 += 3;
  83. else {
  84. if (2 !== l3)
  85. throw new s2("lepcc-decode-error", "Bad count type");
  86. a3 = i2.getUint8(1), r3 += 2;
  87. }
  88. if (d3)
  89. throw new s2("lepcc-decode-error", "LUT not implemented");
  90. const u3 = Math.ceil(a3 * s5 / 8), f3 = new Uint8Array(o3, r3, u3);
  91. let h3 = 0, w2 = 0, g2 = 0;
  92. const p = -1 >>> 32 - s5;
  93. for (let e2 = 0; e2 < a3; e2++) {
  94. for (; w2 < s5; )
  95. h3 |= f3[g2] << w2, w2 += 8, g2 += 1;
  96. n3[e2] = h3 & p, h3 >>>= s5, w2 -= s5, w2 + s5 > 32 && (h3 |= f3[g2 - 1] >> 8 - w2);
  97. }
  98. return r3 + g2;
  99. }
  100. var l = { sizeLo: 0, sizeHi: 4, count: 8, colorMapCount: 12, lookupMethod: 14, compressionMethod: 15, byteCount: 16 };
  101. function a(e2, o3) {
  102. return { sizeLo: e2.getUint32(o3 + l.sizeLo, t2), sizeHi: e2.getUint32(o3 + l.sizeHi, t2), count: e2.getUint32(o3 + l.count, t2), colorMapCount: e2.getUint16(o3 + l.colorMapCount, t2), lookupMethod: e2.getUint8(o3 + l.lookupMethod), compressionMethod: e2.getUint8(o3 + l.compressionMethod) };
  103. }
  104. function u(t3) {
  105. const n3 = new DataView(t3, 0);
  106. let i2 = 0;
  107. const { identifier: c3, version: s5 } = r2(t3, n3, i2);
  108. if (i2 += o2.byteCount, "ClusterRGB" !== c3)
  109. throw new s2("lepcc-decode-error", "Bad identifier");
  110. if (s5 > 1)
  111. throw new s2("lepcc-decode-error", "Unknown version");
  112. const d3 = a(n3, i2);
  113. i2 += l.byteCount;
  114. if (d3.sizeHi * 2 ** 32 + d3.sizeLo !== t3.byteLength)
  115. throw new s2("lepcc-decode-error", "Bad size");
  116. if ((2 === d3.lookupMethod || 1 === d3.lookupMethod) && 0 === d3.compressionMethod) {
  117. if (3 * d3.colorMapCount + d3.count + i2 !== t3.byteLength || d3.colorMapCount > 256)
  118. throw new s2("lepcc-decode-error", "Bad count");
  119. const o3 = new Uint8Array(t3, i2, 3 * d3.colorMapCount), r3 = new Uint8Array(t3, i2 + 3 * d3.colorMapCount, d3.count), n4 = new Uint8Array(3 * d3.count);
  120. for (let e2 = 0; e2 < d3.count; e2++) {
  121. const t4 = r3[e2];
  122. n4[3 * e2] = o3[3 * t4], n4[3 * e2 + 1] = o3[3 * t4 + 1], n4[3 * e2 + 2] = o3[3 * t4 + 2];
  123. }
  124. return n4;
  125. }
  126. if (0 === d3.lookupMethod && 0 === d3.compressionMethod) {
  127. if (3 * d3.count + i2 !== t3.byteLength || 0 !== d3.colorMapCount)
  128. throw new s2("lepcc-decode-error", "Bad count");
  129. return new Uint8Array(t3, i2).slice();
  130. }
  131. if (d3.lookupMethod <= 2 && 1 === d3.compressionMethod) {
  132. if (i2 + 3 !== t3.byteLength || 1 !== d3.colorMapCount)
  133. throw new s2("lepcc-decode-error", "Bad count");
  134. const o3 = n3.getUint8(i2), r3 = n3.getUint8(i2 + 1), c4 = n3.getUint8(i2 + 2), s6 = new Uint8Array(3 * d3.count);
  135. for (let e2 = 0; e2 < d3.count; e2++)
  136. s6[3 * e2] = o3, s6[3 * e2 + 1] = r3, s6[3 * e2 + 2] = c4;
  137. return s6;
  138. }
  139. throw new s2("lepcc-decode-error", "Bad method " + d3.lookupMethod + "," + d3.compressionMethod);
  140. }
  141. var f = { sizeLo: 0, sizeHi: 4, count: 8, scaleFactor: 12, bitsPerPoint: 14, reserved: 15, byteCount: 16 };
  142. function h(e2, o3) {
  143. return { sizeLo: e2.getUint32(o3 + f.sizeLo, t2), sizeHi: e2.getUint32(o3 + f.sizeHi, t2), count: e2.getUint32(o3 + f.count, t2), scaleFactor: e2.getUint16(o3 + f.scaleFactor, t2), bitsPerPoint: e2.getUint8(o3 + f.bitsPerPoint), reserved: e2.getUint8(o3 + f.reserved) };
  144. }
  145. function w(t3) {
  146. const n3 = new DataView(t3, 0);
  147. let i2 = 0;
  148. const { identifier: c3, version: s5 } = r2(t3, n3, i2);
  149. if (i2 += o2.byteCount, "Intensity " !== c3)
  150. throw new s2("lepcc-decode-error", "Bad identifier");
  151. if (s5 > 1)
  152. throw new s2("lepcc-decode-error", "Unknown version");
  153. const l3 = h(n3, i2);
  154. i2 += f.byteCount;
  155. if (l3.sizeHi * 2 ** 32 + l3.sizeLo !== t3.byteLength)
  156. throw new s2("lepcc-decode-error", "Bad size");
  157. const a3 = new Uint16Array(l3.count);
  158. if (8 === l3.bitsPerPoint) {
  159. if (l3.count + i2 !== t3.byteLength)
  160. throw new s2("lepcc-decode-error", "Bad size");
  161. const o3 = new Uint8Array(t3, i2, l3.count);
  162. for (let e2 = 0; e2 < l3.count; e2++)
  163. a3[e2] = o3[e2] * l3.scaleFactor;
  164. } else if (16 === l3.bitsPerPoint) {
  165. if (2 * l3.count + i2 !== t3.byteLength)
  166. throw new s2("lepcc-decode-error", "Bad size");
  167. const o3 = new Uint16Array(t3, i2, l3.count);
  168. for (let e2 = 0; e2 < l3.count; e2++)
  169. a3[e2] = o3[e2] * l3.scaleFactor;
  170. } else {
  171. const o3 = [];
  172. if (d(t3, i2, o3) !== t3.byteLength)
  173. throw new s2("lepcc-decode-error", "Bad size");
  174. for (let e2 = 0; e2 < l3.count; e2++)
  175. a3[e2] = o3[e2] * l3.scaleFactor;
  176. }
  177. return a3;
  178. }
  179. // node_modules/@arcgis/core/views/3d/layers/i3s/I3SBinaryReader.js
  180. var u2 = s.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");
  181. function a2(t3, n3, r3) {
  182. let o3 = "", i2 = 0;
  183. for (; i2 < r3; ) {
  184. const u3 = t3[n3 + i2];
  185. if (u3 < 128)
  186. o3 += String.fromCharCode(u3), i2++;
  187. else if (u3 >= 192 && u3 < 224) {
  188. if (i2 + 1 >= r3)
  189. throw new s2("utf8-decode-error", "UTF-8 Decode failed. Two byte character was truncated.");
  190. const a3 = (31 & u3) << 6 | 63 & t3[n3 + i2 + 1];
  191. o3 += String.fromCharCode(a3), i2 += 2;
  192. } else if (u3 >= 224 && u3 < 240) {
  193. if (i2 + 2 >= r3)
  194. throw new s2("utf8-decode-error", "UTF-8 Decode failed. Multi byte character was truncated.");
  195. const a3 = (15 & u3) << 12 | (63 & t3[n3 + i2 + 1]) << 6 | 63 & t3[n3 + i2 + 2];
  196. o3 += String.fromCharCode(a3), i2 += 3;
  197. } else {
  198. if (!(u3 >= 240 && u3 < 248))
  199. throw new s2("utf8-decode-error", "UTF-8 Decode failed. Invalid multi byte sequence.");
  200. {
  201. if (i2 + 3 >= r3)
  202. throw new s2("utf8-decode-error", "UTF-8 Decode failed. Multi byte character was truncated.");
  203. const a3 = (7 & u3) << 18 | (63 & t3[n3 + i2 + 1]) << 12 | (63 & t3[n3 + i2 + 2]) << 6 | 63 & t3[n3 + i2 + 3];
  204. if (a3 >= 65536) {
  205. const e2 = 55296 + (a3 - 65536 >> 10), t4 = 56320 + (1023 & a3);
  206. o3 += String.fromCharCode(e2, t4);
  207. } else
  208. o3 += String.fromCharCode(a3);
  209. i2 += 4;
  210. }
  211. }
  212. }
  213. return o3;
  214. }
  215. function s4(e2, t3) {
  216. const n3 = { byteOffset: 0, byteCount: 0, fields: /* @__PURE__ */ Object.create(null) };
  217. let r3 = 0;
  218. for (let o3 = 0; o3 < t3.length; o3++) {
  219. const i2 = t3[o3], u3 = i2.valueType || i2.type, a3 = h2[u3];
  220. n3.fields[i2.property] = a3(e2, r3), r3 += m[u3].BYTES_PER_ELEMENT;
  221. }
  222. return n3.byteCount = r3, n3;
  223. }
  224. function c2(t3, n3, r3) {
  225. const o3 = [];
  226. let i2, u3, s5 = 0;
  227. for (u3 = 0; u3 < t3; u3 += 1) {
  228. if (i2 = n3[u3], i2 > 0) {
  229. if (o3.push(a2(r3, s5, i2 - 1)), 0 !== r3[s5 + i2 - 1])
  230. throw new s2("string-array-error", "Invalid string array: missing null termination.");
  231. } else
  232. o3.push(null);
  233. s5 += i2;
  234. }
  235. return o3;
  236. }
  237. function f2(e2, t3) {
  238. return new (0, m[t3.valueType])(e2, t3.byteOffset, t3.count * t3.valuesPerElement);
  239. }
  240. function l2(e2, t3) {
  241. return new Uint8Array(e2, t3.byteOffset, t3.byteCount);
  242. }
  243. function b(n3, r3, o3) {
  244. const i2 = null != r3.header ? s4(n3, r3.header) : { byteOffset: 0, byteCount: 0, fields: { count: o3 } }, u3 = { header: i2, byteOffset: i2.byteCount, byteCount: 0, entries: /* @__PURE__ */ Object.create(null) };
  245. let a3 = i2.byteCount;
  246. for (let s5 = 0; s5 < r3.ordering.length; s5++) {
  247. const n4 = r3.ordering[s5], o4 = y(r3[n4]);
  248. if (o4.count = i2.fields.count, "String" === o4.valueType) {
  249. if (o4.byteOffset = a3, o4.byteCount = i2.fields[n4 + "ByteCount"], "UTF-8" !== o4.encoding)
  250. throw new s2("unsupported-encoding", "Unsupported String encoding.", { encoding: o4.encoding });
  251. } else {
  252. if (!A(o4.valueType))
  253. throw new s2("unsupported-value-type", "Unsupported binary valueType", { valueType: o4.valueType });
  254. {
  255. const e2 = O2(o4.valueType);
  256. a3 += a3 % e2 != 0 ? e2 - a3 % e2 : 0, o4.byteOffset = a3, o4.byteCount = e2 * o4.valuesPerElement * o4.count;
  257. }
  258. }
  259. a3 += o4.byteCount, u3.entries[n4] = o4;
  260. }
  261. return u3.byteCount = a3 - u3.byteOffset, u3;
  262. }
  263. function d2(t3, n3, r3) {
  264. if (n3 !== t3 && u2.error(`Invalid ${r3} buffer size
  265. expected: ${t3}, actual: ${n3})`), n3 < t3)
  266. throw new s2("buffer-too-small", "Binary buffer is too small", { expectedSize: t3, actualSize: n3 });
  267. }
  268. function g(e2, t3) {
  269. const n3 = s4(e2, t3 && t3.header);
  270. let r3 = n3.byteCount;
  271. const o3 = { isDraco: false, header: n3, byteOffset: n3.byteCount, byteCount: 0, vertexAttributes: {} }, i2 = n3.fields, u3 = null != i2.vertexCount ? i2.vertexCount : i2.count;
  272. for (const s5 of t3.ordering) {
  273. if (!t3.vertexAttributes[s5])
  274. continue;
  275. const e3 = { ...t3.vertexAttributes[s5], byteOffset: r3, count: u3 }, n4 = C[s5] ? C[s5] : "_" + s5;
  276. o3.vertexAttributes[n4] = e3, r3 += O2(e3.valueType) * e3.valuesPerElement * u3;
  277. }
  278. const a3 = i2.faceCount;
  279. if (t3.faces && a3) {
  280. o3.faces = {};
  281. for (const e3 of t3.ordering) {
  282. if (!t3.faces[e3])
  283. continue;
  284. const n4 = { ...t3.faces[e3], byteOffset: r3, count: a3 };
  285. o3.faces[e3] = n4, r3 += O2(n4.valueType) * n4.valuesPerElement * a3;
  286. }
  287. }
  288. const c3 = i2.featureCount;
  289. if (t3.featureAttributes && t3.featureAttributeOrder && c3) {
  290. o3.featureAttributes = {};
  291. for (const e3 of t3.featureAttributeOrder) {
  292. if (!t3.featureAttributes[e3])
  293. continue;
  294. const n4 = { ...t3.featureAttributes[e3], byteOffset: r3, count: c3 };
  295. o3.featureAttributes[e3] = n4;
  296. r3 += ("UInt64" === n4.valueType ? 8 : O2(n4.valueType)) * n4.valuesPerElement * c3;
  297. }
  298. }
  299. return d2(r3, e2.byteLength, "geometry"), o3.byteCount = r3 - o3.byteOffset, o3;
  300. }
  301. var C = { position: O.POSITION, normal: O.NORMAL, color: O.COLOR, uv0: O.UV0, region: O.UVREGION };
  302. function I(t3, n3, i2) {
  303. if ("lepcc-rgb" === t3.encoding)
  304. return u(n3);
  305. if ("lepcc-intensity" === t3.encoding)
  306. return w(n3);
  307. if (null != t3.encoding && "" !== t3.encoding)
  308. throw new s2("unknown-attribute-storage-info-encoding", "Unknown Attribute Storage Info Encoding");
  309. t3["attributeByteCounts "] && !t3.attributeByteCounts && (u2.warn("Warning: Trailing space in 'attributeByteCounts '."), t3.attributeByteCounts = t3["attributeByteCounts "]), "ObjectIds" === t3.ordering[0] && t3.hasOwnProperty("objectIds") && (u2.warn("Warning: Case error in objectIds"), t3.ordering[0] = "objectIds");
  310. const a3 = b(n3, t3, i2);
  311. d2(a3.byteOffset + a3.byteCount, n3.byteLength, "attribute");
  312. const s5 = a3.entries.attributeValues || a3.entries.objectIds;
  313. if (s5) {
  314. if ("String" === s5.valueType) {
  315. const e2 = a3.entries.attributeByteCounts, t4 = f2(n3, e2), r3 = l2(n3, s5);
  316. return c2(e2.count, t4, r3);
  317. }
  318. return f2(n3, s5);
  319. }
  320. throw new s2("bad-attribute-storage-info", "Bad attributeStorageInfo specification.");
  321. }
  322. var m = { Float32: Float32Array, Float64: Float64Array, UInt8: Uint8Array, Int8: Int8Array, UInt16: Uint16Array, Int16: Int16Array, UInt32: Uint32Array, Int32: Int32Array };
  323. var h2 = { Float32: (e2, t3) => new DataView(e2, 0).getFloat32(t3, true), Float64: (e2, t3) => new DataView(e2, 0).getFloat64(t3, true), UInt8: (e2, t3) => new DataView(e2, 0).getUint8(t3), Int8: (e2, t3) => new DataView(e2, 0).getInt8(t3), UInt16: (e2, t3) => new DataView(e2, 0).getUint16(t3, true), Int16: (e2, t3) => new DataView(e2, 0).getInt16(t3, true), UInt32: (e2, t3) => new DataView(e2, 0).getUint32(t3, true), Int32: (e2, t3) => new DataView(e2, 0).getInt32(t3, true) };
  324. function A(e2) {
  325. return m.hasOwnProperty(e2);
  326. }
  327. function O2(e2) {
  328. return A(e2) ? m[e2].BYTES_PER_ELEMENT : 0;
  329. }
  330. export {
  331. e,
  332. r,
  333. c,
  334. f2 as f,
  335. g,
  336. I
  337. };
  338. //# sourceMappingURL=chunk-RMZNH22Z.js.map