chunk-3AFXMP6W.js 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830
  1. import {
  2. c as c3,
  3. e as e2,
  4. r as r3,
  5. s as s3
  6. } from "./chunk-X6GHUY4U.js";
  7. import {
  8. C,
  9. D,
  10. E as E2,
  11. L as L3
  12. } from "./chunk-3OFVLRSL.js";
  13. import {
  14. e as e5
  15. } from "./chunk-IRQMHCT3.js";
  16. import {
  17. x as x2
  18. } from "./chunk-MP62QTGD.js";
  19. import {
  20. e as e3,
  21. r as r4
  22. } from "./chunk-44FMXGSC.js";
  23. import {
  24. e as e4
  25. } from "./chunk-XFDO4CMR.js";
  26. import {
  27. A,
  28. B,
  29. E,
  30. F,
  31. L as L2,
  32. O,
  33. V,
  34. c as c2,
  35. d,
  36. g,
  37. i as i3,
  38. q,
  39. u as u2,
  40. w as w2,
  41. x
  42. } from "./chunk-HIELTLML.js";
  43. import {
  44. r as r5
  45. } from "./chunk-GGGVIS2U.js";
  46. import {
  47. c,
  48. f as f2,
  49. i as i2,
  50. p,
  51. u
  52. } from "./chunk-VGWC3IKZ.js";
  53. import {
  54. n
  55. } from "./chunk-O6VYMEIX.js";
  56. import {
  57. b
  58. } from "./chunk-PIFOHNWC.js";
  59. import {
  60. U
  61. } from "./chunk-5DMBXPN2.js";
  62. import {
  63. Q,
  64. X,
  65. Y,
  66. nt
  67. } from "./chunk-VEGAOVMY.js";
  68. import {
  69. r as r2
  70. } from "./chunk-SQOPWYIT.js";
  71. import {
  72. L,
  73. f,
  74. w
  75. } from "./chunk-V6P2MAQQ.js";
  76. import {
  77. s2 as s,
  78. s3 as s2
  79. } from "./chunk-E5O6P5I2.js";
  80. import {
  81. e,
  82. i2 as i
  83. } from "./chunk-2TIUKVZN.js";
  84. import {
  85. r,
  86. t
  87. } from "./chunk-YXWMMD76.js";
  88. // node_modules/@arcgis/core/chunks/vec42.js
  89. function t2(t10, r12, f10) {
  90. if (t10.count !== r12.count)
  91. return void e5.error("source and destination buffers need to have the same number of elements");
  92. const o7 = t10.count, n7 = f10[0], u6 = f10[1], d4 = f10[2], s5 = f10[3], c7 = f10[4], i7 = f10[5], a2 = f10[6], p3 = f10[7], y = f10[8], B2 = f10[9], m2 = f10[10], l3 = f10[11], S = f10[12], h = f10[13], b2 = f10[14], M2 = f10[15], v = t10.typedBuffer, g2 = t10.typedBufferStride, _ = r12.typedBuffer, j = r12.typedBufferStride;
  93. for (let e11 = 0; e11 < o7; e11++) {
  94. const t11 = e11 * g2, r13 = e11 * j, f11 = _[r13], o8 = _[r13 + 1], z = _[r13 + 2], O2 = _[r13 + 3];
  95. v[t11] = n7 * f11 + c7 * o8 + y * z + S * O2, v[t11 + 1] = u6 * f11 + i7 * o8 + B2 * z + h * O2, v[t11 + 2] = d4 * f11 + a2 * o8 + m2 * z + b2 * O2, v[t11 + 3] = s5 * f11 + p3 * o8 + l3 * z + M2 * O2;
  96. }
  97. }
  98. function r6(t10, r12, f10) {
  99. if (t10.count !== r12.count)
  100. return void e5.error("source and destination buffers need to have the same number of elements");
  101. const o7 = t10.count, n7 = f10[0], u6 = f10[1], d4 = f10[2], s5 = f10[3], c7 = f10[4], i7 = f10[5], a2 = f10[6], p3 = f10[7], y = f10[8], B2 = t10.typedBuffer, m2 = t10.typedBufferStride, l3 = r12.typedBuffer, S = r12.typedBufferStride;
  102. for (let e11 = 0; e11 < o7; e11++) {
  103. const t11 = e11 * m2, r13 = e11 * S, f11 = l3[r13], o8 = l3[r13 + 1], h = l3[r13 + 2], b2 = l3[r13 + 3];
  104. B2[t11] = n7 * f11 + s5 * o8 + a2 * h, B2[t11 + 1] = u6 * f11 + c7 * o8 + p3 * h, B2[t11 + 2] = d4 * f11 + i7 * o8 + y * h, B2[t11 + 3] = b2;
  105. }
  106. }
  107. function f3(e11, t10) {
  108. const r12 = Math.min(e11.count, t10.count), f10 = e11.typedBuffer, o7 = e11.typedBufferStride, n7 = t10.typedBuffer, u6 = t10.typedBufferStride;
  109. for (let d4 = 0; d4 < r12; d4++) {
  110. const e12 = d4 * o7, t11 = d4 * u6, r13 = n7[t11], s5 = n7[t11 + 1], c7 = n7[t11 + 2], i7 = r13 * r13 + s5 * s5 + c7 * c7;
  111. if (i7 > 0) {
  112. const t12 = 1 / Math.sqrt(i7);
  113. f10[e12] = t12 * r13, f10[e12 + 1] = t12 * s5, f10[e12 + 2] = t12 * c7;
  114. }
  115. }
  116. }
  117. function o(e11, t10, r12) {
  118. const f10 = Math.min(e11.count, t10.count), o7 = e11.typedBuffer, n7 = e11.typedBufferStride, u6 = t10.typedBuffer, d4 = t10.typedBufferStride;
  119. for (let s5 = 0; s5 < f10; s5++) {
  120. const e12 = s5 * n7, t11 = s5 * d4;
  121. o7[e12] = r12 * u6[t11], o7[e12 + 1] = r12 * u6[t11 + 1], o7[e12 + 2] = r12 * u6[t11 + 2], o7[e12 + 3] = r12 * u6[t11 + 3];
  122. }
  123. }
  124. function n2(e11, t10, r12) {
  125. const f10 = Math.min(e11.count, t10.count), o7 = e11.typedBuffer, n7 = e11.typedBufferStride, u6 = t10.typedBuffer, d4 = t10.typedBufferStride;
  126. for (let s5 = 0; s5 < f10; s5++) {
  127. const e12 = s5 * n7, t11 = s5 * d4;
  128. o7[e12] = u6[t11] >> r12, o7[e12 + 1] = u6[t11 + 1] >> r12, o7[e12 + 2] = u6[t11 + 2] >> r12, o7[e12 + 3] = u6[t11 + 3] >> r12;
  129. }
  130. }
  131. var u3 = Object.freeze(Object.defineProperty({ __proto__: null, transformMat4: t2, transformMat3: r6, normalize: f3, scale: o, shiftRight: n2 }, Symbol.toStringTag, { value: "Module" }));
  132. // node_modules/@arcgis/core/chunks/vec22.js
  133. function f4(e11, t10, r12) {
  134. const f10 = e11.typedBuffer, n7 = e11.typedBufferStride, d4 = t10.typedBuffer, o7 = t10.typedBufferStride, u6 = r12 ? r12.count : t10.count;
  135. let s5 = (r12 && r12.dstIndex ? r12.dstIndex : 0) * n7, c7 = (r12 && r12.srcIndex ? r12.srcIndex : 0) * o7;
  136. for (let p3 = 0; p3 < u6; ++p3)
  137. f10[s5] = d4[c7], f10[s5 + 1] = d4[c7 + 1], s5 += n7, c7 += o7;
  138. }
  139. function n3(n7, d4, o7) {
  140. const u6 = n7.typedBuffer, s5 = n7.typedBufferStride, c7 = d4.typedBuffer, p3 = d4.typedBufferStride, l3 = o7 ? o7.count : d4.count;
  141. let y = (o7 && o7.dstIndex ? o7.dstIndex : 0) * s5, i7 = (o7 && o7.srcIndex ? o7.srcIndex : 0) * p3;
  142. if (s3(d4.elementType)) {
  143. const e11 = r3(d4.elementType);
  144. if (c3(d4.elementType))
  145. for (let t10 = 0; t10 < l3; ++t10)
  146. u6[y] = Math.max(c7[i7] / e11, -1), u6[y + 1] = Math.max(c7[i7 + 1] / e11, -1), y += s5, i7 += p3;
  147. else
  148. for (let t10 = 0; t10 < l3; ++t10)
  149. u6[y] = c7[i7] / e11, u6[y + 1] = c7[i7 + 1] / e11, y += s5, i7 += p3;
  150. } else
  151. f4(n7, d4, o7);
  152. return n7;
  153. }
  154. function d2(e11, t10, r12, f10) {
  155. var _a, _b;
  156. const n7 = e11.typedBuffer, d4 = e11.typedBufferStride, o7 = (_a = f10 == null ? void 0 : f10.count) != null ? _a : e11.count;
  157. let u6 = ((_b = f10 == null ? void 0 : f10.dstIndex) != null ? _b : 0) * d4;
  158. for (let s5 = 0; s5 < o7; ++s5)
  159. n7[u6] = t10, n7[u6 + 1] = r12, u6 += d4;
  160. }
  161. var o2 = Object.freeze(Object.defineProperty({ __proto__: null, copy: f4, normalizeIntegerBuffer: n3, fill: d2 }, Symbol.toStringTag, { value: "Module" }));
  162. // node_modules/@arcgis/core/chunks/vec43.js
  163. function e6(e11, t10, f10) {
  164. const d4 = e11.typedBuffer, n7 = e11.typedBufferStride, o7 = t10.typedBuffer, r12 = t10.typedBufferStride, c7 = f10 ? f10.count : t10.count;
  165. let u6 = (f10 && f10.dstIndex ? f10.dstIndex : 0) * n7, l3 = (f10 && f10.srcIndex ? f10.srcIndex : 0) * r12;
  166. for (let s5 = 0; s5 < c7; ++s5)
  167. d4[u6] = o7[l3], d4[u6 + 1] = o7[l3 + 1], d4[u6 + 2] = o7[l3 + 2], d4[u6 + 3] = o7[l3 + 3], u6 += n7, l3 += r12;
  168. }
  169. function t3(e11, t10, f10, d4, n7, o7) {
  170. var _a, _b;
  171. const r12 = e11.typedBuffer, c7 = e11.typedBufferStride, u6 = (_a = o7 == null ? void 0 : o7.count) != null ? _a : e11.count;
  172. let l3 = ((_b = o7 == null ? void 0 : o7.dstIndex) != null ? _b : 0) * c7;
  173. for (let s5 = 0; s5 < u6; ++s5)
  174. r12[l3] = t10, r12[l3 + 1] = f10, r12[l3 + 2] = d4, r12[l3 + 3] = n7, l3 += c7;
  175. }
  176. var f5 = Object.freeze(Object.defineProperty({ __proto__: null, copy: e6, fill: t3 }, Symbol.toStringTag, { value: "Module" }));
  177. // node_modules/@arcgis/core/chunks/mat32.js
  178. function e7(e11, t10, r12) {
  179. const o7 = e11.typedBuffer, d4 = e11.typedBufferStride, f10 = t10.typedBuffer, n7 = t10.typedBufferStride, c7 = r12 ? r12.count : t10.count;
  180. let u6 = (r12 && r12.dstIndex ? r12.dstIndex : 0) * d4, l3 = (r12 && r12.srcIndex ? r12.srcIndex : 0) * n7;
  181. for (let p3 = 0; p3 < c7; ++p3) {
  182. for (let e12 = 0; e12 < 9; ++e12)
  183. o7[u6 + e12] = f10[l3 + e12];
  184. u6 += d4, l3 += n7;
  185. }
  186. }
  187. var t4 = Object.freeze(Object.defineProperty({ __proto__: null, copy: e7 }, Symbol.toStringTag, { value: "Module" }));
  188. // node_modules/@arcgis/core/chunks/mat42.js
  189. function e8(e11, t10, r12) {
  190. const o7 = e11.typedBuffer, d4 = e11.typedBufferStride, f10 = t10.typedBuffer, n7 = t10.typedBufferStride, c7 = r12 ? r12.count : t10.count;
  191. let u6 = (r12 && r12.dstIndex ? r12.dstIndex : 0) * d4, l3 = (r12 && r12.srcIndex ? r12.srcIndex : 0) * n7;
  192. for (let p3 = 0; p3 < c7; ++p3) {
  193. for (let e12 = 0; e12 < 16; ++e12)
  194. o7[u6 + e12] = f10[l3 + e12];
  195. u6 += d4, l3 += n7;
  196. }
  197. }
  198. var t5 = Object.freeze(Object.defineProperty({ __proto__: null, copy: e8 }, Symbol.toStringTag, { value: "Module" }));
  199. // node_modules/@arcgis/core/chunks/scalar.js
  200. function e9(e11, t10, r12) {
  201. const n7 = e11.typedBuffer, o7 = e11.typedBufferStride, c7 = t10.typedBuffer, d4 = t10.typedBufferStride, f10 = r12 ? r12.count : t10.count;
  202. let u6 = (r12 && r12.dstIndex ? r12.dstIndex : 0) * o7, s5 = (r12 && r12.srcIndex ? r12.srcIndex : 0) * d4;
  203. for (let p3 = 0; p3 < f10; ++p3)
  204. n7[u6] = c7[s5], u6 += o7, s5 += d4;
  205. }
  206. function t6(e11, t10) {
  207. const r12 = e11.count;
  208. t10 || (t10 = new e11.TypedArrayConstructor(r12));
  209. for (let n7 = 0; n7 < r12; n7++)
  210. t10[n7] = e11.get(n7);
  211. return t10;
  212. }
  213. var r7 = Object.freeze(Object.defineProperty({ __proto__: null, copy: e9, makeDense: t6 }, Symbol.toStringTag, { value: "Module" }));
  214. // node_modules/@arcgis/core/geometry/support/buffer/utils.js
  215. function r8(s5, r12) {
  216. return new s5(new ArrayBuffer(r12 * s5.ElementCount * e2(s5.ElementType)));
  217. }
  218. // node_modules/@arcgis/core/views/3d/glTF/DefaultLoadingContext.js
  219. var n4 = class {
  220. constructor(r12) {
  221. this._streamDataRequester = r12;
  222. }
  223. async loadJSON(r12, e11) {
  224. return this._load("json", r12, e11);
  225. }
  226. async loadBinary(r12, e11) {
  227. return X(r12) ? (f(e11), Y(r12)) : this._load("binary", r12, e11);
  228. }
  229. async loadImage(r12, e11) {
  230. return this._load("image", r12, e11);
  231. }
  232. async _load(t10, i7, m2) {
  233. if (t(this._streamDataRequester))
  234. return (await U(i7, { responseType: c4[t10] })).data;
  235. const n7 = await b(this._streamDataRequester.request(i7, t10, m2));
  236. if (true === n7.ok)
  237. return n7.value;
  238. throw w(n7.error), new s2("", `Request for resource failed: ${n7.error}`);
  239. }
  240. };
  241. var c4 = { image: "image", binary: "array-buffer", json: "json" };
  242. // node_modules/@arcgis/core/views/3d/glTF/DefaultErrorContext.js
  243. var o3 = class {
  244. error(e11) {
  245. throw new s2("gltf-loader-error", e11);
  246. }
  247. errorUnsupported(e11) {
  248. throw new s2("gltf-loader-unsupported-feature", e11);
  249. }
  250. errorUnsupportedIf(r12, e11) {
  251. r12 && this.errorUnsupported(e11);
  252. }
  253. assert(r12, e11) {
  254. r12 || this.error(e11);
  255. }
  256. warn(r12) {
  257. s.getLogger("esri.views.3d.glTF").warn(r12);
  258. }
  259. warnUnsupported(r12) {
  260. this.warn("[Unsupported Feature] " + r12);
  261. }
  262. warnUnsupportedIf(r12, e11) {
  263. r12 && this.warnUnsupported(e11);
  264. }
  265. };
  266. // node_modules/@arcgis/core/views/3d/glTF/LoaderResult.js
  267. function r9(e11 = {}) {
  268. return { color: [1, 1, 1], opacity: 1, alphaMode: "OPAQUE", alphaCutoff: 0.5, doubleSided: false, castShadows: true, receiveShadows: true, receiveAmbientOcclustion: true, textureColor: null, textureNormal: null, textureOcclusion: null, textureEmissive: null, textureMetallicRoughness: null, colorTextureTransform: null, normalTextureTransform: null, occlusionTextureTransform: null, emissiveTextureTransform: null, metallicRoughnessTextureTransform: null, emissiveFactor: [0, 0, 0], metallicFactor: 1, roughnessFactor: 1, colorMixMode: "multiply", ...e11 };
  269. }
  270. function l(r12, l3 = {}) {
  271. return { data: r12, parameters: { wrap: { s: D.REPEAT, t: D.REPEAT, ...l3.wrap }, noUnpackFlip: true, mipmap: false, ...l3 } };
  272. }
  273. // node_modules/@arcgis/core/views/3d/glTF/internal/BinaryStreamReader.js
  274. var t7 = class {
  275. constructor(t10) {
  276. this._data = t10, this._offset4 = 0, this._dataUint32 = new Uint32Array(this._data, 0, Math.floor(this._data.byteLength / 4));
  277. }
  278. readUint32() {
  279. const t10 = this._offset4;
  280. return this._offset4 += 1, this._dataUint32[t10];
  281. }
  282. readUint8Array(t10) {
  283. const s5 = 4 * this._offset4;
  284. return this._offset4 += t10 / 4, new Uint8Array(this._data, s5, t10);
  285. }
  286. remainingBytes() {
  287. return this._data.byteLength - 4 * this._offset4;
  288. }
  289. };
  290. // node_modules/@arcgis/core/views/3d/glTF/internal/enums.js
  291. var A2;
  292. var E3;
  293. !function(A3) {
  294. A3.SCALAR = "SCALAR", A3.VEC2 = "VEC2", A3.VEC3 = "VEC3", A3.VEC4 = "VEC4", A3.MAT2 = "MAT2", A3.MAT3 = "MAT3", A3.MAT4 = "MAT4";
  295. }(A2 || (A2 = {})), function(A3) {
  296. A3[A3.ARRAY_BUFFER = 34962] = "ARRAY_BUFFER", A3[A3.ELEMENT_ARRAY_BUFFER = 34963] = "ELEMENT_ARRAY_BUFFER";
  297. }(E3 || (E3 = {}));
  298. // node_modules/@arcgis/core/views/3d/glTF/internal/fillDefaults.js
  299. var t8 = { baseColorFactor: [1, 1, 1, 1], metallicFactor: 1, roughnessFactor: 1 };
  300. var a = { pbrMetallicRoughness: t8, emissiveFactor: [0, 0, 0], alphaMode: "OPAQUE", alphaCutoff: 0.5, doubleSided: false };
  301. var l2 = { ESRI_externalColorMixMode: "tint" };
  302. var i4 = (e11 = {}) => {
  303. const o7 = { ...t8, ...e11.pbrMetallicRoughness }, r12 = s4({ ...l2, ...e11.extras });
  304. return { ...a, ...e11, pbrMetallicRoughness: o7, extras: r12 };
  305. };
  306. function s4(o7) {
  307. switch (o7.ESRI_externalColorMixMode) {
  308. case "multiply":
  309. case "tint":
  310. case "ignore":
  311. case "replace":
  312. break;
  313. default:
  314. n(o7.ESRI_externalColorMixMode), o7.ESRI_externalColorMixMode = "tint";
  315. }
  316. return o7;
  317. }
  318. var n5 = { magFilter: L3.LINEAR, minFilter: L3.LINEAR_MIPMAP_LINEAR, wrapS: D.REPEAT, wrapT: D.REPEAT };
  319. var c5 = (e11) => ({ ...n5, ...e11 });
  320. // node_modules/@arcgis/core/views/3d/glTF/internal/pathUtils.js
  321. function r10(r12) {
  322. let e11, t10;
  323. return r12.replace(/^(.*\/)?([^/]*)$/, (r13, a2, i7) => (e11 = a2 || "", t10 = i7 || "", "")), { dirPart: e11, filePart: t10 };
  324. }
  325. // node_modules/@arcgis/core/views/3d/glTF/internal/Resource.js
  326. var M = { MAGIC: 1179937895, CHUNK_TYPE_JSON: 1313821514, CHUNK_TYPE_BIN: 5130562, MIN_HEADER_LENGTH: 20 };
  327. var F2 = class {
  328. constructor(e11, t10, r12, s5, n7) {
  329. this._context = e11, this._errorContext = t10, this.uri = r12, this.json = s5, this._glbBuffer = n7, this._bufferLoaders = /* @__PURE__ */ new Map(), this._textureLoaders = /* @__PURE__ */ new Map(), this._textureCache = /* @__PURE__ */ new Map(), this._materialCache = /* @__PURE__ */ new Map(), this._nodeParentMap = /* @__PURE__ */ new Map(), this._nodeTransformCache = /* @__PURE__ */ new Map(), this._baseUri = r10(this.uri).dirPart, this._checkVersionSupported(), this._checkRequiredExtensionsSupported(), t10.errorUnsupportedIf(null == s5.scenes, "Scenes must be defined."), t10.errorUnsupportedIf(null == s5.meshes, "Meshes must be defined"), t10.errorUnsupportedIf(null == s5.nodes, "Nodes must be defined."), this._computeNodeParents();
  330. }
  331. static async load(e11, t10, o7, a2) {
  332. if (X(o7)) {
  333. const r12 = nt(o7);
  334. if (r12 && "model/gltf-binary" !== r12.mediaType)
  335. try {
  336. const s5 = JSON.parse(r12.isBase64 ? atob(r12.data) : r12.data);
  337. return new F2(e11, t10, o7, s5);
  338. } catch {
  339. }
  340. const a3 = Y(o7);
  341. if (F2._isGLBData(a3))
  342. return this._fromGLBData(e11, t10, o7, a3);
  343. }
  344. if (o7.endsWith(".gltf")) {
  345. const r12 = await e11.loadJSON(o7, a2);
  346. return new F2(e11, t10, o7, r12);
  347. }
  348. const i7 = await e11.loadBinary(o7, a2);
  349. if (F2._isGLBData(i7))
  350. return this._fromGLBData(e11, t10, o7, i7);
  351. const u6 = await e11.loadJSON(o7, a2);
  352. return new F2(e11, t10, o7, u6);
  353. }
  354. static _isGLBData(e11) {
  355. if (null == e11)
  356. return false;
  357. const t10 = new t7(e11);
  358. return t10.remainingBytes() >= 4 && t10.readUint32() === M.MAGIC;
  359. }
  360. static async _fromGLBData(e11, t10, r12, s5) {
  361. const n7 = await F2._parseGLBData(t10, s5);
  362. return new F2(e11, t10, r12, n7.json, n7.binaryData);
  363. }
  364. static async _parseGLBData(e11, t10) {
  365. const r12 = new t7(t10);
  366. e11.assert(r12.remainingBytes() >= 12, "GLB binary data is insufficiently large.");
  367. const s5 = r12.readUint32(), n7 = r12.readUint32(), o7 = r12.readUint32();
  368. e11.assert(s5 === M.MAGIC, "Magic first 4 bytes do not fit to expected GLB value."), e11.assert(t10.byteLength >= o7, "GLB binary data is smaller than header specifies."), e11.errorUnsupportedIf(2 !== n7, "An unsupported GLB container version was detected. Only version 2 is supported.");
  369. let a2, i7, u6 = 0;
  370. for (; r12.remainingBytes() >= 8; ) {
  371. const t11 = r12.readUint32(), s6 = r12.readUint32();
  372. 0 === u6 ? (e11.assert(s6 === M.CHUNK_TYPE_JSON, "First GLB chunk must be JSON."), e11.assert(t11 >= 0, "No JSON data found."), a2 = await K(r12.readUint8Array(t11))) : 1 === u6 ? (e11.errorUnsupportedIf(s6 !== M.CHUNK_TYPE_BIN, "Second GLB chunk expected to be BIN."), i7 = r12.readUint8Array(t11)) : e11.warnUnsupported("More than 2 GLB chunks detected. Skipping."), u6 += 1;
  373. }
  374. return a2 || e11.error("No GLB JSON chunk detected."), { json: a2, binaryData: i7 };
  375. }
  376. async getBuffer(e11, t10) {
  377. const r12 = this.json.buffers[e11], s5 = this._errorContext;
  378. if (null == r12.uri)
  379. return s5.assert(null != this._glbBuffer, "GLB buffer not present"), this._glbBuffer;
  380. const n7 = await this._getBufferLoader(e11, t10);
  381. return s5.assert(n7.byteLength === r12.byteLength, "Buffer byte lengths should match."), n7;
  382. }
  383. async _getBufferLoader(e11, t10) {
  384. const r12 = this._bufferLoaders.get(e11);
  385. if (r12)
  386. return r12;
  387. const s5 = this.json.buffers[e11].uri, n7 = this._context.loadBinary(this._resolveUri(s5), t10).then((e12) => new Uint8Array(e12));
  388. return this._bufferLoaders.set(e11, n7), n7;
  389. }
  390. async getAccessor(e11, t10) {
  391. const r12 = this._errorContext;
  392. r12.errorUnsupportedIf(!this.json.accessors, "Accessors missing.");
  393. const s5 = this.json.accessors[e11];
  394. r12.errorUnsupportedIf(null == (s5 == null ? void 0 : s5.bufferView), "Some accessor does not specify a bufferView."), r12.errorUnsupportedIf(s5.type in [A2.MAT2, A2.MAT3, A2.MAT4], `AttributeType ${s5.type} is not supported`);
  395. const n7 = this.json.bufferViews[s5.bufferView], o7 = await this.getBuffer(n7.buffer, t10), a2 = V2[s5.type], i7 = Y2[s5.componentType], u6 = a2 * i7, c7 = n7.byteStride || u6;
  396. return { raw: o7.buffer, byteStride: c7, byteOffset: o7.byteOffset + (n7.byteOffset || 0) + (s5.byteOffset || 0), entryCount: s5.count, isDenselyPacked: c7 === u6, componentCount: a2, componentByteSize: i7, componentType: s5.componentType, min: s5.min, max: s5.max, normalized: !!s5.normalized };
  397. }
  398. async getIndexData(e11, t10) {
  399. if (null == e11.indices)
  400. return;
  401. const r12 = await this.getAccessor(e11.indices, t10);
  402. if (r12.isDenselyPacked)
  403. switch (r12.componentType) {
  404. case C.UNSIGNED_BYTE:
  405. return new Uint8Array(r12.raw, r12.byteOffset, r12.entryCount);
  406. case C.UNSIGNED_SHORT:
  407. return new Uint16Array(r12.raw, r12.byteOffset, r12.entryCount);
  408. case C.UNSIGNED_INT:
  409. return new Uint32Array(r12.raw, r12.byteOffset, r12.entryCount);
  410. }
  411. else
  412. switch (r12.componentType) {
  413. case C.UNSIGNED_BYTE:
  414. return t6(this._wrapAccessor(d, r12));
  415. case C.UNSIGNED_SHORT:
  416. return t6(this._wrapAccessor(g, r12));
  417. case C.UNSIGNED_INT:
  418. return t6(this._wrapAccessor(B, r12));
  419. }
  420. }
  421. async getPositionData(e11, t10) {
  422. const r12 = this._errorContext;
  423. r12.errorUnsupportedIf(null == e11.attributes.POSITION, "No POSITION vertex data found.");
  424. const s5 = await this.getAccessor(e11.attributes.POSITION, t10);
  425. return r12.errorUnsupportedIf(s5.componentType !== C.FLOAT, "Expected type FLOAT for POSITION vertex attribute, but found " + C[s5.componentType]), r12.errorUnsupportedIf(3 !== s5.componentCount, "POSITION vertex attribute must have 3 components, but found " + s5.componentCount.toFixed()), this._wrapAccessor(i3, s5);
  426. }
  427. async getNormalData(e11, t10) {
  428. const r12 = this._errorContext;
  429. r12.assert(null != e11.attributes.NORMAL, "No NORMAL vertex data found.");
  430. const s5 = await this.getAccessor(e11.attributes.NORMAL, t10);
  431. return r12.errorUnsupportedIf(s5.componentType !== C.FLOAT, "Expected type FLOAT for NORMAL vertex attribute, but found " + C[s5.componentType]), r12.errorUnsupportedIf(3 !== s5.componentCount, "NORMAL vertex attribute must have 3 components, but found " + s5.componentCount.toFixed()), this._wrapAccessor(i3, s5);
  432. }
  433. async getTangentData(e11, t10) {
  434. const r12 = this._errorContext;
  435. r12.assert(null != e11.attributes.TANGENT, "No TANGENT vertex data found.");
  436. const s5 = await this.getAccessor(e11.attributes.TANGENT, t10);
  437. return r12.errorUnsupportedIf(s5.componentType !== C.FLOAT, "Expected type FLOAT for TANGENT vertex attribute, but found " + C[s5.componentType]), r12.errorUnsupportedIf(4 !== s5.componentCount, "TANGENT vertex attribute must have 4 components, but found " + s5.componentCount.toFixed()), new c2(s5.raw, s5.byteOffset, s5.byteStride, s5.byteOffset + s5.byteStride * s5.entryCount);
  438. }
  439. async getTextureCoordinates(e11, t10) {
  440. const r12 = this._errorContext;
  441. r12.assert(null != e11.attributes.TEXCOORD_0, "No TEXCOORD_0 vertex data found.");
  442. const s5 = await this.getAccessor(e11.attributes.TEXCOORD_0, t10);
  443. return r12.errorUnsupportedIf(2 !== s5.componentCount, "TEXCOORD_0 vertex attribute must have 2 components, but found " + s5.componentCount.toFixed()), s5.componentType === C.FLOAT ? this._wrapAccessor(u2, s5) : (r12.errorUnsupportedIf(!s5.normalized, "Integer component types are only supported for a normalized accessor for TEXCOORD_0."), J(s5));
  444. }
  445. async getVertexColors(e11, t10) {
  446. const r12 = this._errorContext;
  447. r12.assert(null != e11.attributes.COLOR_0, "No COLOR_0 vertex data found.");
  448. const s5 = await this.getAccessor(e11.attributes.COLOR_0, t10);
  449. if (r12.errorUnsupportedIf(4 !== s5.componentCount && 3 !== s5.componentCount, "COLOR_0 attribute must have 3 or 4 components, but found " + s5.componentCount.toFixed()), 4 === s5.componentCount) {
  450. if (s5.componentType === C.FLOAT)
  451. return this._wrapAccessor(c2, s5);
  452. if (s5.componentType === C.UNSIGNED_BYTE)
  453. return this._wrapAccessor(x, s5);
  454. if (s5.componentType === C.UNSIGNED_SHORT)
  455. return this._wrapAccessor(L2, s5);
  456. } else if (3 === s5.componentCount) {
  457. if (s5.componentType === C.FLOAT)
  458. return this._wrapAccessor(i3, s5);
  459. if (s5.componentType === C.UNSIGNED_BYTE)
  460. return this._wrapAccessor(O, s5);
  461. if (s5.componentType === C.UNSIGNED_SHORT)
  462. return this._wrapAccessor(E, s5);
  463. }
  464. r12.errorUnsupported("Unsupported component type for COLOR_0 attribute: " + C[s5.componentType]);
  465. }
  466. hasPositions(e11) {
  467. return void 0 !== e11.attributes.POSITION;
  468. }
  469. hasNormals(e11) {
  470. return void 0 !== e11.attributes.NORMAL;
  471. }
  472. hasVertexColors(e11) {
  473. return void 0 !== e11.attributes.COLOR_0;
  474. }
  475. hasTextureCoordinates(e11) {
  476. return void 0 !== e11.attributes.TEXCOORD_0;
  477. }
  478. hasTangents(e11) {
  479. return void 0 !== e11.attributes.TANGENT;
  480. }
  481. async getMaterial(e11, t10, r12) {
  482. var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
  483. let s5 = e11.material ? this._materialCache.get(e11.material) : void 0;
  484. if (!s5) {
  485. const n7 = null != e11.material ? i4(this.json.materials[e11.material]) : i4(), o7 = n7.pbrMetallicRoughness, a2 = this.hasVertexColors(e11), i7 = this.getTexture(o7.baseColorTexture, t10), u6 = this.getTexture(n7.normalTexture, t10), c7 = r12 ? this.getTexture(n7.occlusionTexture, t10) : void 0, f10 = r12 ? this.getTexture(n7.emissiveTexture, t10) : void 0, d4 = r12 ? this.getTexture(o7.metallicRoughnessTexture, t10) : void 0, p3 = null != e11.material ? e11.material : -1;
  486. s5 = { alphaMode: n7.alphaMode, alphaCutoff: n7.alphaCutoff, color: o7.baseColorFactor, doubleSided: !!n7.doubleSided, colorTexture: await i7, normalTexture: await u6, name: n7.name, id: p3, occlusionTexture: await c7, emissiveTexture: await f10, emissiveFactor: n7.emissiveFactor, metallicFactor: o7.metallicFactor, roughnessFactor: o7.roughnessFactor, metallicRoughnessTexture: await d4, hasVertexColors: a2, ESRI_externalColorMixMode: n7.extras.ESRI_externalColorMixMode, colorTextureTransform: (_b = (_a = o7 == null ? void 0 : o7.baseColorTexture) == null ? void 0 : _a.extensions) == null ? void 0 : _b.KHR_texture_transform, normalTextureTransform: (_d = (_c = n7.normalTexture) == null ? void 0 : _c.extensions) == null ? void 0 : _d.KHR_texture_transform, occlusionTextureTransform: (_f = (_e = n7.occlusionTexture) == null ? void 0 : _e.extensions) == null ? void 0 : _f.KHR_texture_transform, emissiveTextureTransform: (_h = (_g = n7.emissiveTexture) == null ? void 0 : _g.extensions) == null ? void 0 : _h.KHR_texture_transform, metallicRoughnessTextureTransform: (_j = (_i = o7 == null ? void 0 : o7.metallicRoughnessTexture) == null ? void 0 : _i.extensions) == null ? void 0 : _j.KHR_texture_transform };
  487. }
  488. return s5;
  489. }
  490. async getTexture(t10, r12) {
  491. if (!t10)
  492. return;
  493. this._errorContext.errorUnsupportedIf(0 !== (t10.texCoord || 0), "Only TEXCOORD with index 0 is supported.");
  494. const s5 = t10.index, n7 = this._errorContext, o7 = this.json.textures[s5], a2 = c5(null != o7.sampler ? this.json.samplers[o7.sampler] : {});
  495. n7.errorUnsupportedIf(null == o7.source, "Source is expected to be defined for a texture.");
  496. const i7 = this.json.images[o7.source], u6 = await this._loadTextureImageData(s5, o7, r12);
  497. return r2(this._textureCache, s5, () => {
  498. const e11 = (e12) => 33071 === e12 || 33648 === e12 || 10497 === e12, t11 = (e12) => (n7.error(`Unexpected TextureSampler WrapMode: ${e12}. Using default REPEAT(10497).`), 10497);
  499. return { data: u6, wrapS: e11(a2.wrapS) ? a2.wrapS : t11(a2.wrapS), wrapT: e11(a2.wrapT) ? a2.wrapT : t11(a2.wrapT), minFilter: a2.minFilter, name: i7.name, id: s5 };
  500. });
  501. }
  502. getNodeTransform(e11) {
  503. if (void 0 === e11)
  504. return k;
  505. let t10 = this._nodeTransformCache.get(e11);
  506. if (!t10) {
  507. const r12 = this.getNodeTransform(this._getNodeParent(e11)), s5 = this.json.nodes[e11];
  508. s5.matrix ? t10 = u(e3(), r12, s5.matrix) : s5.translation || s5.rotation || s5.scale ? (t10 = r4(r12), s5.translation && c(t10, t10, s5.translation), s5.rotation && (H[3] = x2(H, s5.rotation), f2(t10, t10, H[3], H)), s5.scale && i2(t10, t10, s5.scale)) : t10 = r12, this._nodeTransformCache.set(e11, t10);
  509. }
  510. return t10;
  511. }
  512. _wrapAccessor(e11, t10) {
  513. return new e11(t10.raw, t10.byteOffset, t10.byteStride, t10.byteOffset + t10.byteStride * (t10.entryCount - 1) + t10.componentByteSize * t10.componentCount);
  514. }
  515. _resolveUri(e11) {
  516. return Q(e11, this._baseUri);
  517. }
  518. _getNodeParent(e11) {
  519. return this._nodeParentMap.get(e11);
  520. }
  521. _checkVersionSupported() {
  522. const e11 = r5.parse(this.json.asset.version, "glTF");
  523. P.validate(e11);
  524. }
  525. _checkRequiredExtensionsSupported() {
  526. const e11 = this.json, t10 = this._errorContext;
  527. e11.extensionsRequired && 0 !== e11.extensionsRequired.length && t10.errorUnsupported("gltf loader was not able to load unsupported feature. Required extensions: " + e11.extensionsRequired.join(", "));
  528. }
  529. _computeNodeParents() {
  530. this.json.nodes.forEach((e11, t10) => {
  531. e11.children && e11.children.forEach((e12) => {
  532. this._nodeParentMap.set(e12, t10);
  533. });
  534. });
  535. }
  536. async _loadTextureImageData(e11, t10, r12) {
  537. const s5 = this._textureLoaders.get(e11);
  538. if (s5)
  539. return s5;
  540. const n7 = this._createTextureLoader(t10, r12);
  541. return this._textureLoaders.set(e11, n7), n7;
  542. }
  543. async _createTextureLoader(e11, t10) {
  544. const r12 = this.json.images[e11.source];
  545. if (r12.uri)
  546. return this._context.loadImage(this._resolveUri(r12.uri), t10);
  547. const s5 = this._errorContext;
  548. s5.errorUnsupportedIf(null == r12.bufferView, "Image bufferView must be defined."), s5.errorUnsupportedIf(null == r12.mimeType, "Image mimeType must be defined.");
  549. const n7 = this.json.bufferViews[r12.bufferView], o7 = await this.getBuffer(n7.buffer, t10);
  550. return s5.errorUnsupportedIf(null != n7.byteStride, "byteStride not supported for image buffer"), q2(new Uint8Array(o7.buffer, o7.byteOffset + (n7.byteOffset || 0), n7.byteLength), r12.mimeType);
  551. }
  552. async getLoadedBuffersSize() {
  553. if (this._glbBuffer)
  554. return this._glbBuffer.byteLength;
  555. const e11 = await L(Array.from(this._bufferLoaders.values())), r12 = await L(Array.from(this._textureLoaders.values()));
  556. return e11.reduce((e12, t10) => {
  557. var _a;
  558. return e12 + ((_a = t10 == null ? void 0 : t10.byteLength) != null ? _a : 0);
  559. }, 0) + r12.reduce((e12, t10) => e12 + (t10 ? t10.width * t10.height * 4 : 0), 0);
  560. }
  561. };
  562. var P = new r5(2, 0, "glTF");
  563. var k = p(e3(), Math.PI / 2);
  564. var H = e4();
  565. var V2 = { SCALAR: 1, VEC2: 2, VEC3: 3, VEC4: 4 };
  566. var Y2 = { [C.BYTE]: 1, [C.UNSIGNED_BYTE]: 1, [C.SHORT]: 2, [C.UNSIGNED_SHORT]: 2, [C.FLOAT]: 4, [C.UNSIGNED_INT]: 4 };
  567. function J(e11) {
  568. switch (e11.componentType) {
  569. case C.BYTE:
  570. return new V(e11.raw, e11.byteOffset, e11.byteStride, e11.byteOffset + e11.byteStride * e11.entryCount);
  571. case C.UNSIGNED_BYTE:
  572. return new A(e11.raw, e11.byteOffset, e11.byteStride, e11.byteOffset + e11.byteStride * e11.entryCount);
  573. case C.SHORT:
  574. return new q(e11.raw, e11.byteOffset, e11.byteStride, e11.byteOffset + e11.byteStride * e11.entryCount);
  575. case C.UNSIGNED_SHORT:
  576. return new w2(e11.raw, e11.byteOffset, e11.byteStride, e11.byteOffset + e11.byteStride * e11.entryCount);
  577. case C.UNSIGNED_INT:
  578. return new F(e11.raw, e11.byteOffset, e11.byteStride, e11.byteOffset + e11.byteStride * e11.entryCount);
  579. case C.FLOAT:
  580. return new u2(e11.raw, e11.byteOffset, e11.byteStride, e11.byteOffset + e11.byteStride * e11.entryCount);
  581. }
  582. }
  583. async function K(e11) {
  584. return new Promise((t10, r12) => {
  585. const s5 = new Blob([e11]), n7 = new FileReader();
  586. n7.onload = () => {
  587. const e12 = n7.result;
  588. t10(JSON.parse(e12));
  589. }, n7.onerror = (e12) => {
  590. r12(e12);
  591. }, n7.readAsText(s5);
  592. });
  593. }
  594. async function q2(e11, t10) {
  595. return new Promise((r12, s5) => {
  596. const n7 = new Blob([e11], { type: t10 }), o7 = URL.createObjectURL(n7), a2 = new Image(), i7 = () => {
  597. URL.revokeObjectURL(o7), "decode" in a2 ? a2.decode().then(() => r12(a2), () => r12(a2)).then(c7) : (r12(a2), c7());
  598. }, u6 = (e12) => {
  599. URL.revokeObjectURL(o7), s5(e12), c7();
  600. }, c7 = () => {
  601. a2.removeEventListener("load", i7), a2.removeEventListener("error", u6);
  602. };
  603. a2.addEventListener("load", i7), a2.addEventListener("error", u6), a2.src = o7;
  604. });
  605. }
  606. // node_modules/@arcgis/core/views/3d/glTF/loader.js
  607. var u4 = 0;
  608. async function m(r12, s5, a2 = {}, i7 = true) {
  609. const m2 = await F2.load(r12, x3, s5, a2), p3 = "gltf_" + u4++, T2 = { lods: [], materials: /* @__PURE__ */ new Map(), textures: /* @__PURE__ */ new Map(), meta: c6(m2) }, h = !(!m2.json.asset.extras || "symbolResource" !== m2.json.asset.extras.ESRI_type), g2 = /* @__PURE__ */ new Map();
  610. await d3(m2, async (r13, s6, n7, u6) => {
  611. var _a;
  612. const c7 = (_a = g2.get(n7)) != null ? _a : 0;
  613. g2.set(n7, c7 + 1);
  614. const d4 = void 0 !== r13.mode ? r13.mode : E2.TRIANGLES, h2 = d4 === E2.TRIANGLES || d4 === E2.TRIANGLE_STRIP || d4 === E2.TRIANGLE_FAN ? d4 : null;
  615. if (t(h2))
  616. return void x3.warnUnsupported("Unsupported primitive mode (" + E2[d4] + "). Skipping primitive.");
  617. if (!m2.hasPositions(r13))
  618. return void x3.warn("Skipping primitive without POSITION vertex attribute.");
  619. const R2 = m2.getPositionData(r13, a2), w3 = m2.getMaterial(r13, a2, i7), v = m2.hasNormals(r13) ? m2.getNormalData(r13, a2) : null, S = m2.hasTangents(r13) ? m2.getTangentData(r13, a2) : null, _ = m2.hasTextureCoordinates(r13) ? m2.getTextureCoordinates(r13, a2) : null, E4 = m2.hasVertexColors(r13) ? m2.getVertexColors(r13, a2) : null, I = m2.getIndexData(r13, a2), M2 = { transform: r4(s6), attributes: { position: await R2, normal: v ? await v : null, texCoord0: _ ? await _ : null, color: E4 ? await E4 : null, tangent: S ? await S : null }, indices: await I, primitiveType: h2, material: f7(T2, await w3, p3) };
  620. let F3 = null;
  621. r(T2.meta) && r(T2.meta.ESRI_lod) && "screenSpaceRadius" === T2.meta.ESRI_lod.metric && (F3 = T2.meta.ESRI_lod.thresholds[n7]), T2.lods[n7] = T2.lods[n7] || { parts: [], name: u6, lodThreshold: F3 }, T2.lods[n7].parts[c7] = M2;
  622. });
  623. for (const e11 of T2.lods)
  624. e11.parts = e11.parts.filter((e12) => !!e12);
  625. const R = await m2.getLoadedBuffersSize();
  626. return { model: T2, meta: { isEsriSymbolResource: h, uri: m2.uri }, customMeta: {}, size: R };
  627. }
  628. function c6(o7) {
  629. const t10 = o7.json;
  630. let r12 = null;
  631. return t10.nodes.forEach((o8) => {
  632. const t11 = o8.extras;
  633. r(t11) && (t11.ESRI_proxyEllipsoid || t11.ESRI_lod) && (r12 = t11);
  634. }), r12;
  635. }
  636. async function d3(e11, o7) {
  637. const t10 = e11.json, r12 = t10.scenes[t10.scene || 0].nodes, s5 = r12.length > 1, a2 = [];
  638. for (const i7 of r12) {
  639. const e12 = t10.nodes[i7];
  640. if (a2.push(n7(i7, 0)), p2(e12) && !s5) {
  641. e12.extensions.MSFT_lod.ids.forEach((e13, o8) => n7(e13, o8 + 1));
  642. }
  643. }
  644. async function n7(r13, s6) {
  645. const i7 = t10.nodes[r13], l3 = e11.getNodeTransform(r13);
  646. if (x3.warnUnsupportedIf(null != i7.weights, "Morph targets are not supported."), null != i7.mesh) {
  647. const e12 = t10.meshes[i7.mesh];
  648. for (const t11 of e12.primitives)
  649. a2.push(o7(t11, l3, s6, e12.name));
  650. }
  651. for (const e12 of i7.children || [])
  652. a2.push(n7(e12, s6));
  653. }
  654. await Promise.all(a2);
  655. }
  656. function p2(e11) {
  657. return e11.extensions && e11.extensions.MSFT_lod && Array.isArray(e11.extensions.MSFT_lod.ids);
  658. }
  659. function f7(e11, o7, t10) {
  660. const r12 = (o8) => {
  661. const r13 = `${t10}_tex_${o8 && o8.id}${o8 && o8.name ? "_" + o8.name : ""}`;
  662. if (o8 && !e11.textures.has(r13)) {
  663. const t11 = l(o8.data, { wrap: { s: o8.wrapS, t: o8.wrapT }, mipmap: T.includes(o8.minFilter), noUnpackFlip: true });
  664. e11.textures.set(r13, t11);
  665. }
  666. return r13;
  667. }, n7 = `${t10}_mat_${o7.id}_${o7.name}`;
  668. if (!e11.materials.has(n7)) {
  669. const t11 = r9({ color: [o7.color[0], o7.color[1], o7.color[2]], opacity: o7.color[3], alphaMode: o7.alphaMode, alphaCutoff: o7.alphaCutoff, doubleSided: o7.doubleSided, colorMixMode: o7.ESRI_externalColorMixMode, textureColor: o7.colorTexture ? r12(o7.colorTexture) : void 0, textureNormal: o7.normalTexture ? r12(o7.normalTexture) : void 0, textureOcclusion: o7.occlusionTexture ? r12(o7.occlusionTexture) : void 0, textureEmissive: o7.emissiveTexture ? r12(o7.emissiveTexture) : void 0, textureMetallicRoughness: o7.metallicRoughnessTexture ? r12(o7.metallicRoughnessTexture) : void 0, emissiveFactor: [o7.emissiveFactor[0], o7.emissiveFactor[1], o7.emissiveFactor[2]], colorTextureTransform: o7.colorTextureTransform, normalTextureTransform: o7.normalTextureTransform, occlusionTextureTransform: o7.occlusionTextureTransform, emissiveTextureTransform: o7.emissiveTextureTransform, metallicRoughnessTextureTransform: o7.metallicRoughnessTextureTransform, metallicFactor: o7.metallicFactor, roughnessFactor: o7.roughnessFactor });
  670. e11.materials.set(n7, t11);
  671. }
  672. return n7;
  673. }
  674. var x3 = new o3();
  675. var T = [L3.LINEAR_MIPMAP_LINEAR, L3.LINEAR_MIPMAP_NEAREST];
  676. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Indices.js
  677. var r11 = 1024;
  678. function n6(n7) {
  679. if (Array.isArray(n7)) {
  680. if (n7.length < r11)
  681. return n7;
  682. for (const r12 of n7)
  683. if (r12 >= 65536)
  684. return new Uint32Array(n7);
  685. return new Uint16Array(n7);
  686. }
  687. if (n7.BYTES_PER_ELEMENT === Uint16Array.BYTES_PER_ELEMENT)
  688. return n7;
  689. for (const r12 of n7)
  690. if (r12 >= 65536)
  691. return n7;
  692. return new Uint16Array(n7);
  693. }
  694. function t9(n7) {
  695. const t10 = 3 * n7;
  696. return t10 <= r11 ? new Array(t10) : t10 <= 65536 ? new Uint16Array(t10) : new Uint32Array(t10);
  697. }
  698. var e10 = (() => {
  699. const r12 = new Uint32Array(131072);
  700. for (let n7 = 0; n7 < r12.length; ++n7)
  701. r12[n7] = n7;
  702. return r12;
  703. })();
  704. var i5 = [0];
  705. var f8 = (() => {
  706. const r12 = new Uint16Array(65536);
  707. for (let n7 = 0; n7 < r12.length; ++n7)
  708. r12[n7] = n7;
  709. return r12;
  710. })();
  711. function u5(n7) {
  712. if (1 === n7)
  713. return i5;
  714. if (n7 < r11)
  715. return Array.from(new Uint16Array(f8.buffer, 0, n7));
  716. if (n7 < f8.length)
  717. return new Uint16Array(f8.buffer, 0, n7);
  718. if (n7 > e10.length) {
  719. const r12 = Math.max(2 * e10.length, n7);
  720. e10 = new Uint32Array(r12);
  721. for (let n8 = 0; n8 < e10.length; n8++)
  722. e10[n8] = n8;
  723. }
  724. return new Uint32Array(e10.buffer, 0, n7);
  725. }
  726. function o4(n7) {
  727. if (1 === n7)
  728. return i5;
  729. if (n7 < r11)
  730. return Array.from(new Uint16Array(f8.buffer, 0, n7));
  731. if (n7 < f8.length)
  732. return new Uint16Array(f8.slice(0, n7));
  733. if (n7 > e10.length) {
  734. const r12 = new Uint32Array(n7);
  735. for (let n8 = 0; n8 < r12.length; n8++)
  736. r12[n8] = n8;
  737. return r12;
  738. }
  739. return new Uint32Array(e10.slice(0, n7));
  740. }
  741. // node_modules/@arcgis/core/views/3d/glTF/internal/indexUtils.js
  742. function o5(r12, o7 = u5) {
  743. return "number" == typeof r12 ? o7(r12) : i(r12) || e(r12) ? new Uint32Array(r12) : r12;
  744. }
  745. function f9(e11) {
  746. const t10 = "number" == typeof e11 ? e11 : e11.length;
  747. if (t10 < 3)
  748. return [];
  749. const n7 = t10 - 2, o7 = t9(n7);
  750. if ("number" == typeof e11) {
  751. let e12 = 0;
  752. for (let t11 = 0; t11 < n7; t11 += 1)
  753. t11 % 2 == 0 ? (o7[e12++] = t11, o7[e12++] = t11 + 1, o7[e12++] = t11 + 2) : (o7[e12++] = t11 + 1, o7[e12++] = t11, o7[e12++] = t11 + 2);
  754. } else {
  755. let t11 = 0;
  756. for (let r12 = 0; r12 < n7; r12 += 1)
  757. if (r12 % 2 == 0) {
  758. const n8 = e11[r12], f10 = e11[r12 + 1], i7 = e11[r12 + 2];
  759. o7[t11++] = n8, o7[t11++] = f10, o7[t11++] = i7;
  760. } else {
  761. const n8 = e11[r12 + 1], f10 = e11[r12], i7 = e11[r12 + 2];
  762. o7[t11++] = n8, o7[t11++] = f10, o7[t11++] = i7;
  763. }
  764. }
  765. return o7;
  766. }
  767. function i6(e11) {
  768. const t10 = "number" == typeof e11 ? e11 : e11.length;
  769. if (t10 < 3)
  770. return new Uint16Array(0);
  771. const n7 = t10 - 2, r12 = n7 <= 65536 ? new Uint16Array(3 * n7) : new Uint32Array(3 * n7);
  772. if ("number" == typeof e11) {
  773. let e12 = 0;
  774. for (let t11 = 0; t11 < n7; ++t11)
  775. r12[e12++] = 0, r12[e12++] = t11 + 1, r12[e12++] = t11 + 2;
  776. return r12;
  777. }
  778. {
  779. const t11 = e11[0];
  780. let o7 = e11[1], f10 = 0;
  781. for (let i7 = 0; i7 < n7; ++i7) {
  782. const n8 = e11[i7 + 2];
  783. r12[f10++] = t11, r12[f10++] = o7, r12[f10++] = n8, o7 = n8;
  784. }
  785. return r12;
  786. }
  787. }
  788. // node_modules/@arcgis/core/views/3d/webgl-engine/materials/DefaultMaterial_COLOR_GAMMA.js
  789. var o6 = 2.1;
  790. export {
  791. r6 as r,
  792. f3 as f,
  793. o,
  794. n2 as n,
  795. n3 as n2,
  796. d2 as d,
  797. e6 as e,
  798. t3 as t,
  799. r8 as r2,
  800. n4 as n3,
  801. m,
  802. n6 as n4,
  803. u5 as u,
  804. o4 as o2,
  805. o5 as o3,
  806. f9 as f2,
  807. i6 as i,
  808. o6 as o4
  809. };
  810. //# sourceMappingURL=chunk-3AFXMP6W.js.map