libtess-KSRIGUYS.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. import {
  2. fs_exports,
  3. init_fs,
  4. init_path,
  5. path_exports
  6. } from "./chunk-VUY5VYI5.js";
  7. import {
  8. __toCommonJS
  9. } from "./chunk-S5KM4IGW.js";
  10. // node_modules/@arcgis/core/chunks/libtess.js
  11. function n(n2, t2) {
  12. for (var e2 = 0; e2 < t2.length; e2++) {
  13. const r2 = t2[e2];
  14. if ("string" != typeof r2 && !Array.isArray(r2)) {
  15. for (const t3 in r2)
  16. if ("default" !== t3 && !(t3 in n2)) {
  17. const e3 = Object.getOwnPropertyDescriptor(r2, t3);
  18. e3 && Object.defineProperty(n2, t3, e3.get ? e3 : { enumerable: true, get: () => r2[t3] });
  19. }
  20. }
  21. }
  22. return Object.freeze(Object.defineProperty(n2, Symbol.toStringTag, { value: "Module" }));
  23. }
  24. var t;
  25. var e;
  26. var r;
  27. var o = { exports: {} };
  28. t = o, e = function() {
  29. function n2(n3) {
  30. const e2 = n3.locateFile, r2 = {};
  31. var o2 = void 0 !== o2 ? o2 : {};
  32. const i2 = (() => {
  33. let n4;
  34. return { resolve: (t2) => n4(t2), promise: new Promise((t2) => n4 = t2) };
  35. })(), a = () => i2.promise;
  36. o2.locateFile = e2, o2.onRuntimeInitialized = () => {
  37. i2.resolve(r2);
  38. }, r2.Module = o2, r2.whenLoaded = a;
  39. var u, s = {};
  40. for (u in o2)
  41. o2.hasOwnProperty(u) && (s[u] = o2[u]);
  42. var f, c, l, p, m, h = "object" == typeof window, d = "function" == typeof importScripts, y = "object" == typeof process && "object" == typeof process.versions && "string" == typeof process.versions.node, g = "";
  43. function v(n4) {
  44. return o2.locateFile ? o2.locateFile(n4, g) : g + n4;
  45. }
  46. y ? (g = d ? (init_path(), __toCommonJS(path_exports)).dirname(g) + "/" : __dirname + "/", f = function(n4, t2) {
  47. return p || (p = (init_fs(), __toCommonJS(fs_exports))), m || (m = (init_path(), __toCommonJS(path_exports))), n4 = m.normalize(n4), p.readFileSync(n4, t2 ? null : "utf8");
  48. }, l = function(n4) {
  49. var t2 = f(n4, true);
  50. return t2.buffer || (t2 = new Uint8Array(t2)), T(t2.buffer), t2;
  51. }, c = function(n4, t2, e3) {
  52. p || (p = (init_fs(), __toCommonJS(fs_exports))), m || (m = (init_path(), __toCommonJS(path_exports))), n4 = m.normalize(n4), p.readFile(n4, function(n5, r3) {
  53. n5 ? e3(n5) : t2(r3.buffer);
  54. });
  55. }, process.argv.length > 1 && process.argv[1].replace(/\\/g, "/"), process.argv.slice(2), t.exports = o2, process.on("uncaughtException", function(n4) {
  56. if (!(n4 instanceof Pn))
  57. throw n4;
  58. }), process.on("unhandledRejection", Q), o2.inspect = function() {
  59. return "[Emscripten Module object]";
  60. }) : (h || d) && (d ? g = self.location.href : "undefined" != typeof document && document.currentScript && (g = document.currentScript.src), g = 0 !== g.indexOf("blob:") ? g.substr(0, g.lastIndexOf("/") + 1) : "", f = function(n4) {
  61. var t2 = new XMLHttpRequest();
  62. return t2.open("GET", n4, false), t2.send(null), t2.responseText;
  63. }, d && (l = function(n4) {
  64. var t2 = new XMLHttpRequest();
  65. return t2.open("GET", n4, false), t2.responseType = "arraybuffer", t2.send(null), new Uint8Array(t2.response);
  66. }), c = function(n4, t2, e3) {
  67. var r3 = new XMLHttpRequest();
  68. r3.open("GET", n4, true), r3.responseType = "arraybuffer", r3.onload = function() {
  69. 200 == r3.status || 0 == r3.status && r3.response ? t2(r3.response) : e3();
  70. }, r3.onerror = e3, r3.send(null);
  71. });
  72. var w = o2.print || console.log.bind(console), b = o2.printErr || console.warn.bind(console);
  73. for (u in s)
  74. s.hasOwnProperty(u) && (o2[u] = s[u]);
  75. s = null, o2.arguments && o2.arguments, o2.thisProgram && o2.thisProgram, o2.quit && o2.quit;
  76. var A, _, E = 0, R = function(n4) {
  77. E = n4;
  78. }, P = function() {
  79. return E;
  80. };
  81. o2.wasmBinary && (A = o2.wasmBinary), o2.noExitRuntime, "object" != typeof WebAssembly && Q("no native wasm support detected");
  82. var S = false;
  83. function T(n4, t2) {
  84. n4 || Q("Assertion failed: " + t2);
  85. }
  86. var j, x, I, H, M = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0;
  87. function F(n4, t2, e3) {
  88. for (var r3 = t2 + e3, o3 = t2; n4[o3] && !(o3 >= r3); )
  89. ++o3;
  90. if (o3 - t2 > 16 && n4.subarray && M)
  91. return M.decode(n4.subarray(t2, o3));
  92. for (var i3 = ""; t2 < o3; ) {
  93. var a2 = n4[t2++];
  94. if (128 & a2) {
  95. var u2 = 63 & n4[t2++];
  96. if (192 != (224 & a2)) {
  97. var s2 = 63 & n4[t2++];
  98. if ((a2 = 224 == (240 & a2) ? (15 & a2) << 12 | u2 << 6 | s2 : (7 & a2) << 18 | u2 << 12 | s2 << 6 | 63 & n4[t2++]) < 65536)
  99. i3 += String.fromCharCode(a2);
  100. else {
  101. var f2 = a2 - 65536;
  102. i3 += String.fromCharCode(55296 | f2 >> 10, 56320 | 1023 & f2);
  103. }
  104. } else
  105. i3 += String.fromCharCode((31 & a2) << 6 | u2);
  106. } else
  107. i3 += String.fromCharCode(a2);
  108. }
  109. return i3;
  110. }
  111. function q(n4, t2) {
  112. return n4 ? F(x, n4, t2) : "";
  113. }
  114. function C(n4, t2) {
  115. return n4 % t2 > 0 && (n4 += t2 - n4 % t2), n4;
  116. }
  117. function O(n4) {
  118. j = n4, o2.HEAP8 = new Int8Array(n4), o2.HEAP16 = new Int16Array(n4), o2.HEAP32 = I = new Int32Array(n4), o2.HEAPU8 = x = new Uint8Array(n4), o2.HEAPU16 = new Uint16Array(n4), o2.HEAPU32 = new Uint32Array(n4), o2.HEAPF32 = new Float32Array(n4), o2.HEAPF64 = new Float64Array(n4);
  119. }
  120. o2.INITIAL_MEMORY;
  121. var W = [], U = [], L = [];
  122. function k() {
  123. if (o2.preRun)
  124. for ("function" == typeof o2.preRun && (o2.preRun = [o2.preRun]); o2.preRun.length; )
  125. z(o2.preRun.shift());
  126. on(W);
  127. }
  128. function B() {
  129. on(U);
  130. }
  131. function D() {
  132. if (o2.postRun)
  133. for ("function" == typeof o2.postRun && (o2.postRun = [o2.postRun]); o2.postRun.length; )
  134. G(o2.postRun.shift());
  135. on(L);
  136. }
  137. function z(n4) {
  138. W.unshift(n4);
  139. }
  140. function N(n4) {
  141. U.unshift(n4);
  142. }
  143. function G(n4) {
  144. L.unshift(n4);
  145. }
  146. var X = 0, Y = null;
  147. function J(n4) {
  148. X++, o2.monitorRunDependencies && o2.monitorRunDependencies(X);
  149. }
  150. function K(n4) {
  151. if (X--, o2.monitorRunDependencies && o2.monitorRunDependencies(X), 0 == X && Y) {
  152. var t2 = Y;
  153. Y = null, t2();
  154. }
  155. }
  156. function Q(n4) {
  157. throw o2.onAbort && o2.onAbort(n4), b(n4 += ""), S = true, n4 = "abort(" + n4 + "). Build with -s ASSERTIONS=1 for more info.", new WebAssembly.RuntimeError(n4);
  158. }
  159. o2.preloadedImages = {}, o2.preloadedAudios = {};
  160. var V, Z = "data:application/octet-stream;base64,";
  161. function $(n4) {
  162. return n4.startsWith(Z);
  163. }
  164. function nn(n4) {
  165. return n4.startsWith("file://");
  166. }
  167. function tn(n4) {
  168. try {
  169. if (n4 == V && A)
  170. return new Uint8Array(A);
  171. if (l)
  172. return l(n4);
  173. throw "both async and sync fetching of the wasm failed";
  174. } catch (b2) {
  175. Q(b2);
  176. }
  177. }
  178. function en() {
  179. if (!A && (h || d)) {
  180. if ("function" == typeof fetch && !nn(V))
  181. return fetch(V, { credentials: "same-origin" }).then(function(n4) {
  182. if (!n4.ok)
  183. throw "failed to load wasm binary file at '" + V + "'";
  184. return n4.arrayBuffer();
  185. }).catch(function() {
  186. return tn(V);
  187. });
  188. if (c)
  189. return new Promise(function(n4, t2) {
  190. c(V, function(t3) {
  191. n4(new Uint8Array(t3));
  192. }, t2);
  193. });
  194. }
  195. return Promise.resolve().then(function() {
  196. return tn(V);
  197. });
  198. }
  199. function rn() {
  200. var n4 = { a: hn };
  201. function t2(n5, t3) {
  202. var e4 = n5.exports;
  203. o2.asm = e4, O((_ = o2.asm.m).buffer), H = o2.asm.q, N(o2.asm.n), K();
  204. }
  205. function e3(n5) {
  206. t2(n5.instance);
  207. }
  208. function r3(t3) {
  209. return en().then(function(t4) {
  210. return WebAssembly.instantiate(t4, n4);
  211. }).then(t3, function(n5) {
  212. b("failed to asynchronously prepare wasm: " + n5), Q(n5);
  213. });
  214. }
  215. function i3() {
  216. return A || "function" != typeof WebAssembly.instantiateStreaming || $(V) || nn(V) || "function" != typeof fetch ? r3(e3) : fetch(V, { credentials: "same-origin" }).then(function(t3) {
  217. return WebAssembly.instantiateStreaming(t3, n4).then(e3, function(n5) {
  218. return b("wasm streaming compile failed: " + n5), b("falling back to ArrayBuffer instantiation"), r3(e3);
  219. });
  220. });
  221. }
  222. if (J(), o2.instantiateWasm)
  223. try {
  224. return o2.instantiateWasm(n4, t2);
  225. } catch (a2) {
  226. return b("Module.instantiateWasm callback failed with error: " + a2), false;
  227. }
  228. return i3(), {};
  229. }
  230. function on(n4) {
  231. for (; n4.length > 0; ) {
  232. var t2 = n4.shift();
  233. if ("function" != typeof t2) {
  234. var e3 = t2.func;
  235. "number" == typeof e3 ? void 0 === t2.arg ? H.get(e3)() : H.get(e3)(t2.arg) : e3(void 0 === t2.arg ? null : t2.arg);
  236. } else
  237. t2(o2);
  238. }
  239. }
  240. function an() {
  241. throw "longjmp";
  242. }
  243. function un(n4, t2, e3) {
  244. x.copyWithin(n4, t2, t2 + e3);
  245. }
  246. function sn(n4) {
  247. try {
  248. return _.grow(n4 - j.byteLength + 65535 >>> 16), O(_.buffer), 1;
  249. } catch (t2) {
  250. }
  251. }
  252. function fn(n4) {
  253. var t2 = x.length, e3 = 2147483648;
  254. if ((n4 >>>= 0) > e3)
  255. return false;
  256. for (var r3 = 1; r3 <= 4; r3 *= 2) {
  257. var o3 = t2 * (1 + 0.2 / r3);
  258. if (o3 = Math.min(o3, n4 + 100663296), sn(Math.min(e3, C(Math.max(n4, o3), 65536))))
  259. return true;
  260. }
  261. return false;
  262. }
  263. $(V = "libtess.wasm") || (V = v(V));
  264. var cn = { mappings: {}, buffers: [null, [], []], printChar: function(n4, t2) {
  265. var e3 = cn.buffers[n4];
  266. 0 === t2 || 10 === t2 ? ((1 === n4 ? w : b)(F(e3, 0)), e3.length = 0) : e3.push(t2);
  267. }, varargs: void 0, get: function() {
  268. return cn.varargs += 4, I[cn.varargs - 4 >> 2];
  269. }, getStr: function(n4) {
  270. return q(n4);
  271. }, get64: function(n4, t2) {
  272. return n4;
  273. } };
  274. function ln(n4, t2, e3, r3) {
  275. for (var o3 = 0, i3 = 0; i3 < e3; i3++) {
  276. for (var a2 = I[t2 + 8 * i3 >> 2], u2 = I[t2 + (8 * i3 + 4) >> 2], s2 = 0; s2 < u2; s2++)
  277. cn.printChar(n4, x[a2 + s2]);
  278. o3 += u2;
  279. }
  280. return I[r3 >> 2] = o3, 0;
  281. }
  282. function pn() {
  283. return P();
  284. }
  285. function mn(n4) {
  286. R(n4);
  287. }
  288. var hn = { h: an, l: un, g: fn, f: ln, b: pn, k: _n, d: An, j: En, i: Rn, e: bn, c: wn, a: mn };
  289. rn(), o2.___wasm_call_ctors = function() {
  290. return (o2.___wasm_call_ctors = o2.asm.n).apply(null, arguments);
  291. }, o2._malloc = function() {
  292. return (o2._malloc = o2.asm.o).apply(null, arguments);
  293. }, o2._free = function() {
  294. return (o2._free = o2.asm.p).apply(null, arguments);
  295. }, o2._triangulate = function() {
  296. return (o2._triangulate = o2.asm.r).apply(null, arguments);
  297. };
  298. var dn, yn = o2.stackSave = function() {
  299. return (yn = o2.stackSave = o2.asm.s).apply(null, arguments);
  300. }, gn = o2.stackRestore = function() {
  301. return (gn = o2.stackRestore = o2.asm.t).apply(null, arguments);
  302. }, vn = o2._setThrew = function() {
  303. return (vn = o2._setThrew = o2.asm.u).apply(null, arguments);
  304. };
  305. function wn(n4, t2, e3) {
  306. var r3 = yn();
  307. try {
  308. H.get(n4)(t2, e3);
  309. } catch (o3) {
  310. if (gn(r3), o3 !== o3 + 0 && "longjmp" !== o3)
  311. throw o3;
  312. vn(1, 0);
  313. }
  314. }
  315. function bn(n4, t2) {
  316. var e3 = yn();
  317. try {
  318. H.get(n4)(t2);
  319. } catch (r3) {
  320. if (gn(e3), r3 !== r3 + 0 && "longjmp" !== r3)
  321. throw r3;
  322. vn(1, 0);
  323. }
  324. }
  325. function An(n4, t2) {
  326. var e3 = yn();
  327. try {
  328. return H.get(n4)(t2);
  329. } catch (r3) {
  330. if (gn(e3), r3 !== r3 + 0 && "longjmp" !== r3)
  331. throw r3;
  332. vn(1, 0);
  333. }
  334. }
  335. function _n(n4) {
  336. var t2 = yn();
  337. try {
  338. return H.get(n4)();
  339. } catch (e3) {
  340. if (gn(t2), e3 !== e3 + 0 && "longjmp" !== e3)
  341. throw e3;
  342. vn(1, 0);
  343. }
  344. }
  345. function En(n4, t2, e3) {
  346. var r3 = yn();
  347. try {
  348. return H.get(n4)(t2, e3);
  349. } catch (o3) {
  350. if (gn(r3), o3 !== o3 + 0 && "longjmp" !== o3)
  351. throw o3;
  352. vn(1, 0);
  353. }
  354. }
  355. function Rn(n4, t2, e3, r3) {
  356. var o3 = yn();
  357. try {
  358. return H.get(n4)(t2, e3, r3);
  359. } catch (i3) {
  360. if (gn(o3), i3 !== i3 + 0 && "longjmp" !== i3)
  361. throw i3;
  362. vn(1, 0);
  363. }
  364. }
  365. function Pn(n4) {
  366. this.name = "ExitStatus", this.message = "Program terminated with exit(" + n4 + ")", this.status = n4;
  367. }
  368. function Sn(n4) {
  369. function t2() {
  370. dn || (dn = true, o2.calledRun = true, S || (B(), o2.onRuntimeInitialized && o2.onRuntimeInitialized(), D()));
  371. }
  372. X > 0 || (k(), X > 0 || (o2.setStatus ? (o2.setStatus("Running..."), setTimeout(function() {
  373. setTimeout(function() {
  374. o2.setStatus("");
  375. }, 1), t2();
  376. }, 1)) : t2()));
  377. }
  378. if (Y = function n4() {
  379. dn || Sn(), dn || (Y = n4);
  380. }, o2.run = Sn, o2.preInit)
  381. for ("function" == typeof o2.preInit && (o2.preInit = [o2.preInit]); o2.preInit.length > 0; )
  382. o2.preInit.pop()();
  383. Sn();
  384. let Tn = null, jn = null, xn = null, In = null;
  385. const Hn = r2.Module, Mn = 2, Fn = 4e3;
  386. let qn = 0;
  387. const Cn = (n4, t2, e3) => {
  388. Tn || (Tn = Hn._triangulate);
  389. let r3 = Hn.HEAPF32;
  390. const o3 = Hn.HEAP32.BYTES_PER_ELEMENT, i3 = 2, a2 = r3.BYTES_PER_ELEMENT;
  391. e3 > qn && (qn = e3, xn && (Hn._free(xn), xn = 0), jn && (Hn._free(jn), jn = 0)), xn || (xn = Hn._malloc(e3 * a2)), In || (In = Hn._malloc(Fn * o3));
  392. const u2 = e3 * Mn;
  393. jn || (jn = Hn._malloc(u2 * a2)), r3 = Hn.HEAPF32, r3.set(n4, xn / a2), Hn.HEAP32.set(t2, In / o3);
  394. const s2 = u2 / i3, f2 = Tn(xn, In, Math.min(t2.length, Fn), i3, jn, s2), c2 = f2 * i3;
  395. r3 = Hn.HEAPF32;
  396. const l2 = r3.slice(jn / a2, jn / a2 + c2), p2 = {};
  397. return p2.buffer = l2, p2.vertexCount = f2, p2;
  398. };
  399. return r2.triangulate = Cn, r2.whenLoaded();
  400. }
  401. return { load: n2 };
  402. }, void 0 !== (r = e()) && (t.exports = r);
  403. var i = n({ __proto__: null, default: o.exports }, [o.exports]);
  404. export {
  405. i as l
  406. };
  407. //# sourceMappingURL=libtess-KSRIGUYS.js.map