@loaders.gl/scene 5.0.0-beta.2 → 5.0.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/DRACO-README.md +1 -1
  2. package/GLTF-README.md +1 -1
  3. package/OBJ-README.md +1 -1
  4. package/README.md +6 -1
  5. package/THIRD-PARTY-NOTICES.md +6 -0
  6. package/dist/dist.dev.js +6557 -1363
  7. package/dist/dist.min.js +24 -16
  8. package/dist/draco/draco-javascript-loader-with-parser.d.ts +2 -2
  9. package/dist/draco/draco-loader-types.cjs +3 -3
  10. package/dist/draco/draco-loader-types.cjs.map +2 -2
  11. package/dist/draco/draco-loader-types.d.ts +1 -1
  12. package/dist/draco/draco-loader-types.d.ts.map +1 -1
  13. package/dist/draco/draco-loader-types.js +1 -1
  14. package/dist/draco/draco-loader-types.js.map +1 -1
  15. package/dist/draco/draco-loader.d.ts +2 -2
  16. package/dist/draco/draco-wasm-loader-with-parser.d.ts +2 -2
  17. package/dist/draco/draco3d-loader-with-parser.d.ts +2 -2
  18. package/dist/draco/lib/utils/version.cjs +1 -1
  19. package/dist/draco/lib/utils/version.js +1 -1
  20. package/dist/draco-worker-node.js +806 -158
  21. package/dist/draco-worker-node.js.map +4 -4
  22. package/dist/draco-worker.js +775 -158
  23. package/dist/draco-worker.js.map +4 -4
  24. package/dist/draco-writer-worker-node.cjs +2122 -219
  25. package/dist/draco-writer-worker-node.cjs.map +4 -4
  26. package/dist/draco-writer-worker.js +2053 -220
  27. package/dist/draco-writer-worker.js.map +4 -4
  28. package/dist/gltf/gltf-loader-types.cjs.map +2 -2
  29. package/dist/gltf/gltf-loader-types.d.ts +6 -0
  30. package/dist/gltf/gltf-loader-types.d.ts.map +1 -1
  31. package/dist/gltf/gltf-loader-types.js.map +1 -1
  32. package/dist/gltf/index.cjs +2 -0
  33. package/dist/gltf/index.cjs.map +2 -2
  34. package/dist/gltf/index.d.ts +2 -2
  35. package/dist/gltf/index.d.ts.map +1 -1
  36. package/dist/gltf/index.js +1 -1
  37. package/dist/gltf/index.js.map +1 -1
  38. package/dist/gltf/lib/api/gltf-extensions.cjs +7 -2
  39. package/dist/gltf/lib/api/gltf-extensions.cjs.map +2 -2
  40. package/dist/gltf/lib/api/gltf-extensions.d.ts.map +1 -1
  41. package/dist/gltf/lib/api/gltf-extensions.js +7 -5
  42. package/dist/gltf/lib/api/gltf-extensions.js.map +1 -1
  43. package/dist/gltf/lib/extensions/EXT_texture_webp.cjs +1 -0
  44. package/dist/gltf/lib/extensions/EXT_texture_webp.cjs.map +2 -2
  45. package/dist/gltf/lib/extensions/EXT_texture_webp.d.ts.map +1 -1
  46. package/dist/gltf/lib/extensions/EXT_texture_webp.js +3 -0
  47. package/dist/gltf/lib/extensions/EXT_texture_webp.js.map +1 -1
  48. package/dist/gltf/lib/extensions/KHR_accessor_float64.cjs +45 -0
  49. package/dist/gltf/lib/extensions/KHR_accessor_float64.cjs.map +7 -0
  50. package/dist/gltf/lib/extensions/KHR_accessor_float64.d.ts +6 -0
  51. package/dist/gltf/lib/extensions/KHR_accessor_float64.d.ts.map +1 -0
  52. package/dist/gltf/lib/extensions/KHR_accessor_float64.js +20 -0
  53. package/dist/gltf/lib/extensions/KHR_accessor_float64.js.map +1 -0
  54. package/dist/gltf/lib/extensions/KHR_gaussian_splatting.cjs +23 -7
  55. package/dist/gltf/lib/extensions/KHR_gaussian_splatting.cjs.map +2 -2
  56. package/dist/gltf/lib/extensions/KHR_gaussian_splatting.d.ts +2 -1
  57. package/dist/gltf/lib/extensions/KHR_gaussian_splatting.d.ts.map +1 -1
  58. package/dist/gltf/lib/extensions/KHR_gaussian_splatting.js +21 -5
  59. package/dist/gltf/lib/extensions/KHR_gaussian_splatting.js.map +1 -1
  60. package/dist/gltf/lib/extensions/MSFT_texture_dds.cjs +64 -0
  61. package/dist/gltf/lib/extensions/MSFT_texture_dds.cjs.map +7 -0
  62. package/dist/gltf/lib/extensions/MSFT_texture_dds.d.ts +12 -0
  63. package/dist/gltf/lib/extensions/MSFT_texture_dds.d.ts.map +1 -0
  64. package/dist/gltf/lib/extensions/MSFT_texture_dds.js +39 -0
  65. package/dist/gltf/lib/extensions/MSFT_texture_dds.js.map +1 -0
  66. package/dist/gltf/lib/extensions/utils/3d-tiles-utils.cjs +1 -1
  67. package/dist/gltf/lib/extensions/utils/3d-tiles-utils.cjs.map +2 -2
  68. package/dist/gltf/lib/extensions/utils/3d-tiles-utils.d.ts.map +1 -1
  69. package/dist/gltf/lib/extensions/utils/3d-tiles-utils.js +3 -1
  70. package/dist/gltf/lib/extensions/utils/3d-tiles-utils.js.map +1 -1
  71. package/dist/gltf/lib/parsers/parse-gltf.cjs +25 -0
  72. package/dist/gltf/lib/parsers/parse-gltf.cjs.map +2 -2
  73. package/dist/gltf/lib/parsers/parse-gltf.d.ts +2 -0
  74. package/dist/gltf/lib/parsers/parse-gltf.d.ts.map +1 -1
  75. package/dist/gltf/lib/parsers/parse-gltf.js +18 -0
  76. package/dist/gltf/lib/parsers/parse-gltf.js.map +1 -1
  77. package/dist/gltf/lib/types/gltf-additional-extension-schemas.cjs +22 -0
  78. package/dist/gltf/lib/types/gltf-additional-extension-schemas.cjs.map +2 -2
  79. package/dist/gltf/lib/types/gltf-additional-extension-schemas.d.ts +23 -0
  80. package/dist/gltf/lib/types/gltf-additional-extension-schemas.d.ts.map +1 -1
  81. package/dist/gltf/lib/types/gltf-additional-extension-schemas.js +22 -0
  82. package/dist/gltf/lib/types/gltf-additional-extension-schemas.js.map +1 -1
  83. package/dist/gltf/lib/types/gltf-ext-gaussian-splatting-schema.cjs.map +1 -1
  84. package/dist/gltf/lib/types/gltf-ext-gaussian-splatting-schema.d.ts +1 -1
  85. package/dist/gltf/lib/types/gltf-ext-gaussian-splatting-schema.d.ts.map +1 -1
  86. package/dist/gltf/lib/types/gltf-extension-schemas.cjs +8 -0
  87. package/dist/gltf/lib/types/gltf-extension-schemas.cjs.map +2 -2
  88. package/dist/gltf/lib/types/gltf-extension-schemas.d.ts +27 -0
  89. package/dist/gltf/lib/types/gltf-extension-schemas.d.ts.map +1 -1
  90. package/dist/gltf/lib/types/gltf-extension-schemas.js +8 -1
  91. package/dist/gltf/lib/types/gltf-extension-schemas.js.map +1 -1
  92. package/dist/gltf/lib/types/gltf-json-schema.cjs.map +1 -1
  93. package/dist/gltf/lib/types/gltf-json-schema.d.ts +2 -2
  94. package/dist/gltf/lib/types/gltf-json-schema.d.ts.map +1 -1
  95. package/dist/gltf/lib/types/gltf-texture-procedurals.cjs +19 -0
  96. package/dist/gltf/lib/types/gltf-texture-procedurals.cjs.map +7 -0
  97. package/dist/gltf/lib/types/gltf-texture-procedurals.d.ts +45 -0
  98. package/dist/gltf/lib/types/gltf-texture-procedurals.d.ts.map +1 -0
  99. package/dist/gltf/lib/types/gltf-texture-procedurals.js +5 -0
  100. package/dist/gltf/lib/types/gltf-texture-procedurals.js.map +1 -0
  101. package/dist/gltf/lib/types/gltf-types.cjs.map +1 -1
  102. package/dist/gltf/lib/types/gltf-types.d.ts +7 -0
  103. package/dist/gltf/lib/types/gltf-types.d.ts.map +1 -1
  104. package/dist/gltf/lib/types/gltf-version-zod-schemas.d.ts +34 -0
  105. package/dist/gltf/lib/types/gltf-version-zod-schemas.d.ts.map +1 -1
  106. package/dist/gltf/lib/types/gltf-zod-schema.cjs +4 -1
  107. package/dist/gltf/lib/types/gltf-zod-schema.cjs.map +2 -2
  108. package/dist/gltf/lib/types/gltf-zod-schema.d.ts +56 -0
  109. package/dist/gltf/lib/types/gltf-zod-schema.d.ts.map +1 -1
  110. package/dist/gltf/lib/types/gltf-zod-schema.js +6 -2
  111. package/dist/gltf/lib/types/gltf-zod-schema.js.map +1 -1
  112. package/dist/gltf/lib/utils/version.cjs +1 -1
  113. package/dist/gltf/lib/utils/version.js +1 -1
  114. package/dist/gltf/schema.cjs +3 -0
  115. package/dist/gltf/schema.cjs.map +2 -2
  116. package/dist/gltf/schema.d.ts +1 -0
  117. package/dist/gltf/schema.d.ts.map +1 -1
  118. package/dist/gltf/schema.js +1 -0
  119. package/dist/gltf/schema.js.map +1 -1
  120. package/dist/gltf-loader-types.cjs.map +2 -2
  121. package/dist/index.cjs +7 -1
  122. package/dist/index.cjs.map +2 -2
  123. package/dist/index.d.ts +3 -0
  124. package/dist/index.d.ts.map +1 -1
  125. package/dist/index.js +3 -1
  126. package/dist/index.js.map +1 -1
  127. package/dist/materialx/parse-materialx.cjs +61 -0
  128. package/dist/materialx/parse-materialx.cjs.map +7 -0
  129. package/dist/materialx/parse-materialx.d.ts +23 -0
  130. package/dist/materialx/parse-materialx.d.ts.map +1 -0
  131. package/dist/materialx/parse-materialx.js +39 -0
  132. package/dist/materialx/parse-materialx.js.map +1 -0
  133. package/dist/materialx/procedural-graph.cjs +77 -0
  134. package/dist/materialx/procedural-graph.cjs.map +7 -0
  135. package/dist/materialx/procedural-graph.d.ts +40 -0
  136. package/dist/materialx/procedural-graph.d.ts.map +1 -0
  137. package/dist/materialx/procedural-graph.js +59 -0
  138. package/dist/materialx/procedural-graph.js.map +1 -0
  139. package/dist/materialx-loader-types.cjs +57 -0
  140. package/dist/materialx-loader-types.cjs.map +7 -0
  141. package/dist/materialx-loader-types.d.ts +34 -0
  142. package/dist/materialx-loader-types.d.ts.map +1 -0
  143. package/dist/materialx-loader-types.js +20 -0
  144. package/dist/materialx-loader-types.js.map +1 -0
  145. package/dist/materialx-loader.cjs +40 -0
  146. package/dist/materialx-loader.cjs.map +7 -0
  147. package/dist/materialx-loader.d.ts +19 -0
  148. package/dist/materialx-loader.d.ts.map +1 -0
  149. package/dist/materialx-loader.js +14 -0
  150. package/dist/materialx-loader.js.map +1 -0
  151. package/dist/mtl-loader-types.cjs +1 -1
  152. package/dist/obj/mtl-loader-types.cjs +1 -1
  153. package/dist/obj/mtl-loader-types.js +1 -1
  154. package/dist/obj/obj-loader-types.cjs +3 -3
  155. package/dist/obj/obj-loader-types.cjs.map +2 -2
  156. package/dist/obj/obj-loader-types.d.ts +1 -1
  157. package/dist/obj/obj-loader-types.d.ts.map +1 -1
  158. package/dist/obj/obj-loader-types.js +2 -2
  159. package/dist/obj/obj-loader-types.js.map +1 -1
  160. package/dist/obj/obj-loader.cjs +5 -5
  161. package/dist/obj/obj-loader.cjs.map +2 -2
  162. package/dist/obj/obj-loader.d.ts +1 -1
  163. package/dist/obj/obj-loader.d.ts.map +1 -1
  164. package/dist/obj/obj-loader.js +1 -1
  165. package/dist/obj/obj-loader.js.map +1 -1
  166. package/dist/obj/obj-writer.cjs +1 -1
  167. package/dist/obj/obj-writer.js +1 -1
  168. package/dist/obj-loader-types.cjs +3 -3
  169. package/dist/obj-loader-types.cjs.map +2 -2
  170. package/dist/obj-loader.cjs +5 -5
  171. package/dist/obj-loader.cjs.map +2 -2
  172. package/dist/obj-worker.js +985 -368
  173. package/dist/obj-writer.cjs +1 -1
  174. package/dist/stl/parse-stl.cjs +100 -0
  175. package/dist/stl/parse-stl.cjs.map +7 -0
  176. package/dist/stl/parse-stl.d.ts +4 -0
  177. package/dist/stl/parse-stl.d.ts.map +1 -0
  178. package/dist/stl/parse-stl.js +84 -0
  179. package/dist/stl/parse-stl.js.map +1 -0
  180. package/dist/stl-loader-types.cjs +58 -0
  181. package/dist/stl-loader-types.cjs.map +7 -0
  182. package/dist/stl-loader-types.d.ts +32 -0
  183. package/dist/stl-loader-types.d.ts.map +1 -0
  184. package/dist/stl-loader-types.js +25 -0
  185. package/dist/stl-loader-types.js.map +1 -0
  186. package/dist/stl-loader.cjs +38 -0
  187. package/dist/stl-loader.cjs.map +7 -0
  188. package/dist/stl-loader.d.ts +17 -0
  189. package/dist/stl-loader.d.ts.map +1 -0
  190. package/dist/stl-loader.js +13 -0
  191. package/dist/stl-loader.js.map +1 -0
  192. package/dist/usd/index.cjs.map +1 -1
  193. package/dist/usd/index.d.ts +1 -1
  194. package/dist/usd/index.d.ts.map +1 -1
  195. package/dist/usd/lib/parse-usd.cjs +42 -5
  196. package/dist/usd/lib/parse-usd.cjs.map +2 -2
  197. package/dist/usd/lib/parse-usd.d.ts.map +1 -1
  198. package/dist/usd/lib/parse-usd.js +53 -6
  199. package/dist/usd/lib/parse-usd.js.map +1 -1
  200. package/dist/usd/lib/parse-usdc.cjs +187 -0
  201. package/dist/usd/lib/parse-usdc.cjs.map +7 -0
  202. package/dist/usd/lib/parse-usdc.d.ts +4 -0
  203. package/dist/usd/lib/parse-usdc.d.ts.map +1 -0
  204. package/dist/usd/lib/parse-usdc.js +176 -0
  205. package/dist/usd/lib/parse-usdc.js.map +1 -0
  206. package/dist/usd/lib/parse-usdz.cjs +22 -0
  207. package/dist/usd/lib/parse-usdz.cjs.map +2 -2
  208. package/dist/usd/lib/parse-usdz.d.ts.map +1 -1
  209. package/dist/usd/lib/parse-usdz.js +26 -0
  210. package/dist/usd/lib/parse-usdz.js.map +1 -1
  211. package/dist/usd/lib/usd-types.cjs.map +1 -1
  212. package/dist/usd/lib/usd-types.d.ts +14 -1
  213. package/dist/usd/lib/usd-types.d.ts.map +1 -1
  214. package/dist/usd/lib/usd-types.js +1 -1
  215. package/dist/usd/lib/usd-types.js.map +1 -1
  216. package/dist/usd/libs/README.md +27 -0
  217. package/dist/usd/libs/THREE-LICENSE +21 -0
  218. package/dist/usd/libs/usdc-parser.d.ts +78 -0
  219. package/dist/usd/libs/usdc-parser.d.ts.map +1 -0
  220. package/dist/usd/libs/usdc-parser.js +1669 -0
  221. package/dist/usd/libs/usdc-parser.js.map +1 -0
  222. package/dist/usd/usd-loader-types.cjs +4 -4
  223. package/dist/usd/usd-loader-types.cjs.map +2 -2
  224. package/dist/usd/usd-loader-types.d.ts +7 -7
  225. package/dist/usd/usd-loader-types.d.ts.map +1 -1
  226. package/dist/usd/usd-loader-types.js +6 -6
  227. package/dist/usd/usd-loader-types.js.map +1 -1
  228. package/dist/usd/usd-loader.cjs.map +1 -1
  229. package/dist/usd/usd-loader.d.ts +4 -4
  230. package/dist/usd/usd-loader.d.ts.map +1 -1
  231. package/dist/usd/usd-loader.js +2 -2
  232. package/dist/usd/usd-loader.js.map +1 -1
  233. package/dist/usd-loader-types.cjs +4 -4
  234. package/dist/usd-loader-types.cjs.map +2 -2
  235. package/dist/usd-loader.cjs.map +1 -1
  236. package/package.json +19 -7
  237. package/src/draco/draco-loader-types.ts +1 -1
  238. package/src/gltf/gltf-loader-types.ts +6 -0
  239. package/src/gltf/index.ts +4 -1
  240. package/src/gltf/lib/api/gltf-extensions.ts +7 -2
  241. package/src/gltf/lib/extensions/EXT_texture_webp.ts +3 -0
  242. package/src/gltf/lib/extensions/KHR_accessor_float64.ts +22 -0
  243. package/src/gltf/lib/extensions/KHR_gaussian_splatting.ts +31 -7
  244. package/src/gltf/lib/extensions/MSFT_texture_dds.ts +52 -0
  245. package/src/gltf/lib/extensions/utils/3d-tiles-utils.ts +5 -1
  246. package/src/gltf/lib/parsers/parse-gltf.ts +31 -0
  247. package/src/gltf/lib/types/gltf-additional-extension-schemas.ts +32 -0
  248. package/src/gltf/lib/types/gltf-ext-gaussian-splatting-schema.ts +1 -1
  249. package/src/gltf/lib/types/gltf-extension-schemas.ts +12 -0
  250. package/src/gltf/lib/types/gltf-json-schema.ts +2 -1
  251. package/src/gltf/lib/types/gltf-texture-procedurals.ts +67 -0
  252. package/src/gltf/lib/types/gltf-types.ts +8 -0
  253. package/src/gltf/lib/types/gltf-zod-schema.ts +7 -1
  254. package/src/gltf/schema.ts +1 -0
  255. package/src/index.ts +6 -1
  256. package/src/materialx/README.md +5 -0
  257. package/src/materialx/parse-materialx.ts +70 -0
  258. package/src/materialx/procedural-graph.ts +94 -0
  259. package/src/materialx-loader-types.ts +24 -0
  260. package/src/materialx-loader.ts +15 -0
  261. package/src/obj/obj-loader-types.ts +1 -1
  262. package/src/obj/obj-loader.ts +1 -1
  263. package/src/stl/parse-stl.ts +90 -0
  264. package/src/stl-loader-types.ts +28 -0
  265. package/src/stl-loader.ts +12 -0
  266. package/src/usd/index.ts +1 -0
  267. package/src/usd/lib/parse-usd.ts +68 -7
  268. package/src/usd/lib/parse-usdc.ts +188 -0
  269. package/src/usd/lib/parse-usdz.ts +28 -0
  270. package/src/usd/lib/usd-types.ts +16 -2
  271. package/src/usd/libs/README.md +27 -0
  272. package/src/usd/libs/THREE-LICENSE +21 -0
  273. package/src/usd/libs/usdc-parser.d.ts +18 -0
  274. package/src/usd/libs/usdc-parser.js +1669 -0
  275. package/src/usd/usd-loader-types.ts +5 -5
  276. package/src/usd/usd-loader.ts +2 -2
@@ -52,7 +52,7 @@
52
52
 
53
53
  // ../core/src/worker-utils/lib/env-utils/version.ts
54
54
  function getVersion() {
55
- const version = false ? NPM_TAG : "5.0.0-beta.2";
55
+ const version = false ? NPM_TAG : "5.0.0-beta.5";
56
56
  globalThis._loadersgl_ = globalThis._loadersgl_ || {};
57
57
  globalThis._loadersgl_.version ||= version;
58
58
  return version;
@@ -101,15 +101,15 @@
101
101
  }
102
102
  });
103
103
 
104
- // ../../node_modules/@math.gl/core/dist/worker-utils/lib/node/worker_threads-browser.js
104
+ // ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/node/worker_threads-browser.js
105
105
  var parentPort;
106
106
  var init_worker_threads_browser = __esm({
107
- "../../node_modules/@math.gl/core/dist/worker-utils/lib/node/worker_threads-browser.js"() {
108
- parentPort = null;
107
+ "../../node_modules/@math.gl/tasks/dist/worker-utils/lib/node/worker_threads-browser.js"() {
108
+ parentPort = globalThis.process?.getBuiltinModule?.("node:worker_threads")?.parentPort ?? null;
109
109
  }
110
110
  });
111
111
 
112
- // ../../node_modules/@math.gl/core/dist/worker-utils/lib/worker-utils/get-transfer-list.js
112
+ // ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-utils/get-transfer-list.js
113
113
  function getTransferList(object, recursive = true, transfers) {
114
114
  const transfersSet = transfers || /* @__PURE__ */ new Set();
115
115
  const seen = /* @__PURE__ */ new Set();
@@ -122,6 +122,9 @@
122
122
  else if (ArrayBuffer.isView(value)) {
123
123
  if (isTransferable(value.buffer))
124
124
  transfersSet.add(value.buffer);
125
+ } else if (recursive && typeof MessageChannel !== "undefined" && value instanceof MessageChannel) {
126
+ visit(value.port1);
127
+ visit(value.port2);
125
128
  } else if (recursive && value instanceof Map) {
126
129
  for (const [key, item] of value) {
127
130
  visit(key);
@@ -157,11 +160,11 @@
157
160
  return false;
158
161
  }
159
162
  var init_get_transfer_list = __esm({
160
- "../../node_modules/@math.gl/core/dist/worker-utils/lib/worker-utils/get-transfer-list.js"() {
163
+ "../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-utils/get-transfer-list.js"() {
161
164
  }
162
165
  });
163
166
 
164
- // ../../node_modules/@math.gl/core/dist/worker-utils/lib/worker-farm/worker-body.js
167
+ // ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-farm/worker-body.js
165
168
  async function getParentPort() {
166
169
  return parentPort;
167
170
  }
@@ -174,7 +177,7 @@
174
177
  }
175
178
  var onMessageWrapperMap, WorkerBody;
176
179
  var init_worker_body = __esm({
177
- "../../node_modules/@math.gl/core/dist/worker-utils/lib/worker-farm/worker-body.js"() {
180
+ "../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-farm/worker-body.js"() {
178
181
  init_get_transfer_list();
179
182
  init_worker_threads_browser();
180
183
  onMessageWrapperMap = /* @__PURE__ */ new Map();
@@ -189,16 +192,16 @@
189
192
  */
190
193
  static set onmessage(onMessage) {
191
194
  async function handleMessage(message) {
192
- const parentPort2 = await getParentPort();
193
- const { type, payload } = parentPort2 ? message : message.data;
195
+ const parentPort3 = await getParentPort();
196
+ const { type, payload } = parentPort3 ? message : message.data;
194
197
  onMessage(type, payload);
195
198
  }
196
- getParentPort().then((parentPort2) => {
197
- if (parentPort2) {
198
- parentPort2.on("message", (message) => {
199
+ getParentPort().then((parentPort3) => {
200
+ if (parentPort3) {
201
+ parentPort3.on("message", (message) => {
199
202
  handleMessage(message);
200
203
  });
201
- parentPort2.on("exit", () => console.debug("Node worker closing"));
204
+ parentPort3.on("exit", () => console.debug("Node worker closing"));
202
205
  } else {
203
206
  globalThis.onmessage = handleMessage;
204
207
  }
@@ -216,9 +219,9 @@
216
219
  };
217
220
  onMessageWrapperMap.set(onMessage, onMessageWrapper);
218
221
  }
219
- const parentPort2 = await getParentPort();
220
- if (parentPort2) {
221
- parentPort2.on("message", onMessageWrapper);
222
+ const parentPort3 = await getParentPort();
223
+ if (parentPort3) {
224
+ parentPort3.on("message", onMessageWrapper);
222
225
  } else {
223
226
  globalThis.addEventListener("message", onMessageWrapper);
224
227
  }
@@ -229,9 +232,9 @@
229
232
  if (!onMessageWrapper) {
230
233
  return;
231
234
  }
232
- const parentPort2 = await getParentPort();
233
- if (parentPort2) {
234
- parentPort2.off("message", onMessageWrapper);
235
+ const parentPort3 = await getParentPort();
236
+ if (parentPort3) {
237
+ parentPort3.off("message", onMessageWrapper);
235
238
  } else {
236
239
  globalThis.removeEventListener("message", onMessageWrapper);
237
240
  }
@@ -241,12 +244,12 @@
241
244
  * @param type
242
245
  * @param payload
243
246
  */
244
- static async postMessage(type, payload) {
247
+ static async postMessage(type, payload, copy = false) {
245
248
  const data = { source: "loaders.gl", type, payload };
246
- const transferList = getTransferList(payload);
247
- const parentPort2 = await getParentPort();
248
- if (parentPort2) {
249
- parentPort2.postMessage(data, transferList);
249
+ const transferList = copy ? [] : getTransferList(payload);
250
+ const parentPort3 = await getParentPort();
251
+ if (parentPort3) {
252
+ parentPort3.postMessage(data, transferList);
250
253
  } else {
251
254
  globalThis.postMessage(data, transferList);
252
255
  }
@@ -255,10 +258,10 @@
255
258
  }
256
259
  });
257
260
 
258
- // ../../node_modules/@math.gl/core/dist/worker-utils/lib/async-queue/async-queue.js
261
+ // ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/async-queue/async-queue.js
259
262
  var AsyncQueue;
260
263
  var init_async_queue = __esm({
261
- "../../node_modules/@math.gl/core/dist/worker-utils/lib/async-queue/async-queue.js"() {
264
+ "../../node_modules/@math.gl/tasks/dist/worker-utils/lib/async-queue/async-queue.js"() {
262
265
  AsyncQueue = class {
263
266
  constructor() {
264
267
  this._values = [];
@@ -327,10 +330,10 @@
327
330
  }
328
331
  });
329
332
 
330
- // ../../node_modules/@math.gl/core/dist/worker-utils/lib/worker-api/shared-state.js
333
+ // ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/shared-state.js
331
334
  var SharedWorkerState;
332
335
  var init_shared_state = __esm({
333
- "../../node_modules/@math.gl/core/dist/worker-utils/lib/worker-api/shared-state.js"() {
336
+ "../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/shared-state.js"() {
334
337
  SharedWorkerState = class {
335
338
  constructor(buffer) {
336
339
  if (typeof SharedArrayBuffer === "undefined" || !(buffer instanceof SharedArrayBuffer) || buffer.byteLength !== 16)
@@ -371,8 +374,19 @@
371
374
  }
372
375
  });
373
376
 
374
- // ../../node_modules/@math.gl/core/dist/worker-utils/lib/worker-api/create-worker.js
375
- async function createWorker(process2, processInBatches) {
377
+ // ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/validate-output-ownership.js
378
+ function validateOutputOwnership(ownership) {
379
+ if (ownership !== void 0 && ownership !== "copy" && ownership !== "transfer") {
380
+ throw new Error("Invalid worker output ownership");
381
+ }
382
+ }
383
+ var init_validate_output_ownership = __esm({
384
+ "../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/validate-output-ownership.js"() {
385
+ }
386
+ });
387
+
388
+ // ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/create-worker.js
389
+ async function createWorker(process2, processInBatches, preload2) {
376
390
  if (!await WorkerBody.inWorkerThread()) {
377
391
  return;
378
392
  }
@@ -413,10 +427,12 @@
413
427
  }
414
428
  switch (type) {
415
429
  case "preload":
430
+ await preload2?.();
416
431
  WorkerBody.postMessage("done", {});
417
432
  break;
418
433
  case "process":
419
434
  throwIfAborted();
435
+ validateOutputOwnership(payload.options?.["outputOwnership"]);
420
436
  if (!process2) {
421
437
  throw new Error("Worker does not support atomic processing");
422
438
  }
@@ -426,10 +442,11 @@
426
442
  await WorkerBody.postMessage("done", {
427
443
  result,
428
444
  executionMs: performance.now() - startedAt
429
- });
445
+ }, payload.options?.["outputOwnership"] === "copy");
430
446
  break;
431
447
  case "process-in-batches":
432
448
  throwIfAborted();
449
+ validateOutputOwnership(payload.options?.["outputOwnership"]);
433
450
  if (!processInBatches) {
434
451
  throw new Error("Worker does not support batched processing");
435
452
  }
@@ -441,7 +458,7 @@
441
458
  const resultIterator = processInBatches(createDemandDrivenIterator(inputBatches), payload.options || {}, jobContext, payload.context || {});
442
459
  for await (const batch of resultIterator) {
443
460
  throwIfAborted();
444
- await WorkerBody.postMessage("output-batch", { result: batch });
461
+ await WorkerBody.postMessage("output-batch", { result: batch }, payload.options?.["outputOwnership"] === "copy");
445
462
  await outputAcknowledgements.next();
446
463
  }
447
464
  throwIfAborted();
@@ -539,14 +556,14 @@
539
556
  });
540
557
  }
541
558
  function createProgressReporter() {
542
- let pending;
559
+ let pending2;
543
560
  let finished = false;
544
561
  let scheduled = false;
545
562
  const flush = () => {
546
563
  scheduled = false;
547
- if (pending) {
548
- WorkerBody.postMessage("progress", { progress: pending });
549
- pending = void 0;
564
+ if (pending2) {
565
+ WorkerBody.postMessage("progress", { progress: pending2 });
566
+ pending2 = void 0;
550
567
  }
551
568
  };
552
569
  return {
@@ -554,9 +571,9 @@
554
571
  report(progress) {
555
572
  if (finished)
556
573
  return;
557
- if (pending && pending.phase !== progress.phase)
574
+ if (pending2 && pending2.phase !== progress.phase)
558
575
  flush();
559
- pending = { ...progress };
576
+ pending2 = { ...progress };
560
577
  if (!scheduled) {
561
578
  scheduled = true;
562
579
  setTimeout(flush, 0);
@@ -565,7 +582,7 @@
565
582
  /** Flushes final progress and suppresses reports from stale callbacks. */
566
583
  finish(discard = false) {
567
584
  if (discard)
568
- pending = void 0;
585
+ pending2 = void 0;
569
586
  flush();
570
587
  finished = true;
571
588
  }
@@ -573,10 +590,11 @@
573
590
  }
574
591
  var requestId, activeController, activeInputBatches, activeOutputAcknowledgements;
575
592
  var init_create_worker = __esm({
576
- "../../node_modules/@math.gl/core/dist/worker-utils/lib/worker-api/create-worker.js"() {
593
+ "../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/create-worker.js"() {
577
594
  init_shared_state();
578
595
  init_async_queue();
579
596
  init_worker_body();
597
+ init_validate_output_ownership();
580
598
  requestId = 0;
581
599
  activeController = null;
582
600
  activeInputBatches = null;
@@ -584,29 +602,589 @@
584
602
  }
585
603
  });
586
604
 
587
- // ../../node_modules/@math.gl/core/dist/worker-utils/index.js
605
+ // ../../node_modules/@math.gl/tasks/dist/worker-utils/index.js
588
606
  var import_meta, path, moduleUrl;
589
607
  var init_worker_utils = __esm({
590
- "../../node_modules/@math.gl/core/dist/worker-utils/index.js"() {
608
+ "../../node_modules/@math.gl/tasks/dist/worker-utils/index.js"() {
609
+ init_worker_body();
591
610
  init_create_worker();
611
+ init_get_transfer_list();
592
612
  import_meta = {};
593
613
  path = typeof __filename === "string" ? __filename.replace(/\\/g, "/") : "";
594
614
  moduleUrl = path ? `file://${path.startsWith("/") ? "" : "/"}${encodeURI(path).replace(/#/g, "%23").replace(/\?/g, "%3F")}` : import_meta.url;
595
615
  }
596
616
  });
597
617
 
598
- // ../../node_modules/@math.gl/core/dist/tasks/index.js
599
- var init_tasks = __esm({
600
- "../../node_modules/@math.gl/core/dist/tasks/index.js"() {
618
+ // ../../node_modules/@math.gl/tasks/dist/tasks/task-preload.js
619
+ function preloadTaskCode(task, signal) {
620
+ if (!task.preload)
621
+ return Promise.resolve();
622
+ let promise = pending.get(task);
623
+ if (!promise) {
624
+ promise = Promise.resolve().then(() => task.preload()).then(() => {
625
+ loaded.add(task);
626
+ });
627
+ pending.set(task, promise);
628
+ void promise.catch(() => pending.delete(task));
629
+ }
630
+ return withSignal(promise, signal);
631
+ }
632
+ function withSignal(operation, signal) {
633
+ if (!signal)
634
+ return operation;
635
+ return new Promise((resolve, reject) => {
636
+ const abort = () => {
637
+ signal.removeEventListener("abort", abort);
638
+ reject(signal.reason);
639
+ };
640
+ signal.addEventListener("abort", abort, { once: true });
641
+ if (signal.aborted)
642
+ abort();
643
+ operation.then((value) => {
644
+ signal.removeEventListener("abort", abort);
645
+ resolve(value);
646
+ }, (error) => {
647
+ signal.removeEventListener("abort", abort);
648
+ reject(error);
649
+ });
650
+ });
651
+ }
652
+ var pending, loaded;
653
+ var init_task_preload = __esm({
654
+ "../../node_modules/@math.gl/tasks/dist/tasks/task-preload.js"() {
655
+ pending = /* @__PURE__ */ new WeakMap();
656
+ loaded = /* @__PURE__ */ new WeakSet();
657
+ }
658
+ });
659
+
660
+ // ../../node_modules/@math.gl/tasks/dist/tasks/task-channel.js
661
+ var TaskRequestError, TaskChannel;
662
+ var init_task_channel = __esm({
663
+ "../../node_modules/@math.gl/tasks/dist/tasks/task-channel.js"() {
664
+ TaskRequestError = class extends Error {
665
+ };
666
+ TaskChannel = class {
667
+ constructor(options) {
668
+ this.options = options;
669
+ this.nextId = 1;
670
+ this.pending = /* @__PURE__ */ new Map();
671
+ this.incoming = /* @__PURE__ */ new Map();
672
+ }
673
+ /** Send a request without serializing other in-flight requests. */
674
+ request(operation, value, signal, transfer = []) {
675
+ if (this.failure)
676
+ return Promise.reject(this.failure.reason);
677
+ if (signal?.aborted)
678
+ return Promise.reject(signal.reason);
679
+ const id = this.nextId++;
680
+ return new Promise((resolve, reject) => {
681
+ const abort = () => {
682
+ const pending2 = this.pending.get(id);
683
+ if (!pending2)
684
+ return;
685
+ this.pending.delete(id);
686
+ pending2.cleanup();
687
+ reject(signal?.reason);
688
+ this.send({ source: "math.gl/tasks", kind: "cancel", id });
689
+ };
690
+ this.pending.set(id, {
691
+ resolve,
692
+ reject,
693
+ cleanup: () => signal?.removeEventListener("abort", abort)
694
+ });
695
+ signal?.addEventListener("abort", abort, { once: true });
696
+ this.send({ source: "math.gl/tasks", kind: "request", id, operation, value }, transfer);
697
+ });
698
+ }
699
+ /** Send a one-way notification. */
700
+ emit(operation, value, transfer = []) {
701
+ if (this.failure)
702
+ throw this.failure.reason;
703
+ this.send({ source: "math.gl/tasks", kind: "event", id: 0, operation, value }, transfer);
704
+ }
705
+ /** Dispatch a transport message; unrelated protocols are ignored. */
706
+ receive(message) {
707
+ if (this.failure || message?.source !== "math.gl/tasks")
708
+ return;
709
+ if (message.kind === "failure") {
710
+ const reason = new Error(message.error?.message ?? "Task channel failed");
711
+ this.close(reason);
712
+ this.options.onFailure?.(reason);
713
+ } else if (message.kind === "result" || message.kind === "error") {
714
+ const pending2 = this.pending.get(message.id);
715
+ if (!pending2)
716
+ return;
717
+ this.pending.delete(message.id);
718
+ pending2.cleanup();
719
+ if (message.kind === "result")
720
+ pending2.resolve(message.value);
721
+ else {
722
+ const error = new TaskRequestError(message.error?.message ?? "Task request failed");
723
+ error.name = message.error?.name ?? "Error";
724
+ pending2.reject(error);
725
+ }
726
+ } else if (message.kind === "cancel") {
727
+ this.incoming.get(message.id)?.abort(new DOMException("Task request cancelled", "AbortError"));
728
+ } else if (message.kind === "event") {
729
+ try {
730
+ this.options.handleEvent?.(message.operation, message.value);
731
+ } catch (error) {
732
+ this.fail(error);
733
+ }
734
+ } else if (message.kind === "request") {
735
+ if (this.incoming.has(message.id)) {
736
+ this.fail(new Error("Duplicate task request identifier"));
737
+ return;
738
+ }
739
+ const controller = new AbortController();
740
+ this.incoming.set(message.id, controller);
741
+ void Promise.resolve().then(() => {
742
+ controller.signal.throwIfAborted();
743
+ return this.options.handleRequest(message.operation, message.value, controller.signal);
744
+ }).then((value) => {
745
+ if (!controller.signal.aborted && !this.failure) {
746
+ this.send({ source: "math.gl/tasks", kind: "result", id: message.id, value }, this.options.getResultTransferList?.(value, message.value));
747
+ }
748
+ }).catch((reason) => {
749
+ if (!controller.signal.aborted && !this.failure) {
750
+ this.send({
751
+ source: "math.gl/tasks",
752
+ kind: "error",
753
+ id: message.id,
754
+ error: {
755
+ name: reason instanceof Error ? reason.name : "Error",
756
+ message: reason instanceof Error ? reason.message : String(reason)
757
+ }
758
+ });
759
+ }
760
+ }).finally(() => this.incoming.delete(message.id));
761
+ }
762
+ }
763
+ /** Reject all outstanding calls with a common cause and abort incoming callbacks. */
764
+ close(reason = new Error("Task channel closed")) {
765
+ if (this.failure)
766
+ return;
767
+ this.failure = { reason };
768
+ for (const pending2 of this.pending.values()) {
769
+ pending2.cleanup();
770
+ pending2.reject(reason);
771
+ }
772
+ this.pending.clear();
773
+ for (const controller of this.incoming.values())
774
+ controller.abort(reason);
775
+ this.incoming.clear();
776
+ }
777
+ send(message, transfer = []) {
778
+ if (this.failure)
779
+ return;
780
+ try {
781
+ this.options.send(message, transfer);
782
+ } catch (error) {
783
+ this.fail(error);
784
+ }
785
+ }
786
+ /** Invalidate the channel and notify the peer when the transport still works. */
787
+ fail(reason) {
788
+ if (this.failure)
789
+ return;
790
+ this.close(reason);
791
+ try {
792
+ this.options.send({
793
+ source: "math.gl/tasks",
794
+ kind: "failure",
795
+ id: 0,
796
+ error: {
797
+ name: reason instanceof Error ? reason.name : "Error",
798
+ message: reason instanceof Error ? reason.message : String(reason)
799
+ }
800
+ }, []);
801
+ } catch {
802
+ }
803
+ this.options.onFailure?.(reason);
804
+ }
805
+ };
806
+ }
807
+ });
808
+
809
+ // ../../node_modules/@math.gl/tasks/dist/tasks/task-runtime.js
810
+ function assertPayload(value) {
811
+ if (!value || typeof value !== "object" || Object.getPrototypeOf(value) !== Object.prototype) {
812
+ throw new TypeError("Task payloads must be plain objects with named fields");
813
+ }
814
+ }
815
+ function clonePayload(value, ownership = "copy") {
816
+ assertPayload(value);
817
+ if (!["copy", "transfer", "share"].includes(ownership))
818
+ throw new TypeError("Invalid input ownership");
819
+ const transfer = getTransferList(value);
820
+ if (ownership === "share" && transfer.length)
821
+ throw new TypeError("Share requires shared storage");
822
+ return structuredClone(value, {
823
+ transfer: ownership === "transfer" ? transfer : []
824
+ });
825
+ }
826
+ function taskContext(state, context = {}) {
827
+ const signal = context.signal ?? new AbortController().signal;
828
+ return {
829
+ state,
830
+ signal,
831
+ requestHost: async (operation, payload, controls) => {
832
+ signal.throwIfAborted();
833
+ if (!context.requestHost)
834
+ throw new Error("No host request handler configured");
835
+ return context.requestHost(operation, payload, controls);
836
+ },
837
+ emitHost: (operation, payload) => {
838
+ signal.throwIfAborted();
839
+ context.emitHost?.(operation, payload);
840
+ },
841
+ throwIfAborted: () => {
842
+ signal.throwIfAborted();
843
+ context.throwIfAborted?.();
844
+ },
845
+ reportProgress: (progress) => context.reportProgress?.({
846
+ ...progress,
847
+ phase: progress.phase ?? "process",
848
+ unit: progress.unit ?? "items"
849
+ })
850
+ };
851
+ }
852
+ async function initializeTaskWorker(task) {
853
+ if (!await WorkerBody.inWorkerThread())
854
+ throw new Error("initializeTaskWorker must run inside a worker");
855
+ if (installed)
856
+ throw new Error("A task is already installed in this worker");
857
+ installed = true;
858
+ const runtime = new TaskRuntime(task);
859
+ let channelStream;
860
+ const channel = new TaskChannel({
861
+ getResultTransferList: (value, request) => request.outputOwnership === "transfer" ? getTransferList(value) : [],
862
+ send: (message, transfer) => {
863
+ const snapshot = structuredClone(message, { transfer });
864
+ void WorkerBody.postMessage("task-channel", snapshot).catch((reason) => channel.fail(reason));
865
+ },
866
+ handleRequest: async (operation, value, signal) => {
867
+ const request = value;
868
+ const context = {
869
+ signal,
870
+ reportProgress: (progress) => channel.emit("task:progress", { id: request.progressId, progress }),
871
+ requestHost: (operation2, payload, controls = {}) => {
872
+ const request2 = {
873
+ operation: operation2,
874
+ payload: clonePayload(payload, controls.inputOwnership),
875
+ outputOwnership: controls.outputOwnership ?? "copy"
876
+ };
877
+ return channel.request("task:host-request", request2, signal, getTransferList(request2));
878
+ },
879
+ emitHost: (operation2, payload) => channel.emit("task:host-event", { operation: operation2, payload, id: request.progressId })
880
+ };
881
+ switch (operation) {
882
+ case "initialize":
883
+ return runtime.initialize(request.input, context);
884
+ case "process":
885
+ return runtime.process(request.input, request.options, context);
886
+ case "stream-open": {
887
+ if (channelStream)
888
+ throw new Error("A task stream is already open");
889
+ async function* inputs() {
890
+ while (true) {
891
+ const result = await channel.request("task:next-input", { outputOwnership: "transfer" }, signal);
892
+ if (result.done)
893
+ return;
894
+ yield result.value;
895
+ }
896
+ }
897
+ channelStream = runtime.stream(inputs(), request.options, context)[Symbol.asyncIterator]();
898
+ return {};
899
+ }
900
+ case "stream-next":
901
+ if (!channelStream)
902
+ throw new Error("No active task stream");
903
+ return channelStream.next();
904
+ case "stream-close":
905
+ try {
906
+ await channelStream?.return?.();
907
+ } finally {
908
+ channelStream = void 0;
909
+ }
910
+ return {};
911
+ case "destroy":
912
+ return runtime.destroy();
913
+ default:
914
+ throw new Error("Unknown task channel operation");
915
+ }
916
+ }
917
+ });
918
+ await WorkerBody.addEventListener((type, payload) => {
919
+ if (type === "task-channel")
920
+ channel.receive(payload);
921
+ });
922
+ let streamOptions = {};
923
+ return createWorker(async (request, _options, context) => {
924
+ switch (request.operation) {
925
+ case "initialize":
926
+ return runtime.initialize(request.input, context);
927
+ case "destroy":
928
+ return runtime.destroy();
929
+ case "stream-options":
930
+ streamOptions = request.options;
931
+ return {};
932
+ case "process":
933
+ return runtime.process(request.input, request.options, context);
934
+ default:
935
+ throw new Error("Unknown task operation");
936
+ }
937
+ }, async function* (inputs, _options, context) {
938
+ async function* batches() {
939
+ for await (const input of inputs) {
940
+ assertPayload(input);
941
+ yield input;
942
+ }
943
+ }
944
+ try {
945
+ yield* runtime.stream(batches(), streamOptions, context);
946
+ } finally {
947
+ streamOptions = {};
948
+ }
949
+ }, () => preloadTaskCode(task));
950
+ }
951
+ var TaskRuntime, installed;
952
+ var init_task_runtime = __esm({
953
+ "../../node_modules/@math.gl/tasks/dist/tasks/task-runtime.js"() {
601
954
  init_worker_utils();
955
+ init_task_preload();
956
+ init_task_channel();
957
+ TaskRuntime = class {
958
+ constructor(task) {
959
+ this.task = task;
960
+ this.initialized = false;
961
+ }
962
+ async initialize(input, context = {}) {
963
+ if (this.initialized)
964
+ throw new Error("Task is already initialized");
965
+ assertPayload(input);
966
+ await preloadTaskCode(this.task, context.signal);
967
+ context.signal?.throwIfAborted();
968
+ this.state = await this.task.initialize?.(input, taskContext(void 0, context));
969
+ this.initialized = true;
970
+ return {};
971
+ }
972
+ async destroy() {
973
+ if (this.initialized) {
974
+ this.initialized = false;
975
+ const state = this.state;
976
+ this.state = void 0;
977
+ if (this.task.initialize)
978
+ await this.task.destroy?.(state);
979
+ }
980
+ return {};
981
+ }
982
+ async process(input, options, context = {}) {
983
+ if (!this.initialized)
984
+ throw new Error("Task is not initialized");
985
+ if (!this.task.process)
986
+ throw new Error("Task has no atomic processor");
987
+ assertPayload(input);
988
+ const result = await this.task.process(input, options, taskContext(this.state, context));
989
+ assertPayload(result);
990
+ return result;
991
+ }
992
+ async *stream(inputs, options, context = {}) {
993
+ if (!this.initialized)
994
+ throw new Error("Task is not initialized");
995
+ if (!this.task.processInBatches)
996
+ throw new Error("Task has no streaming processor");
997
+ for await (const output of this.task.processInBatches(inputs, options, taskContext(this.state, context))) {
998
+ assertPayload(output);
999
+ yield output;
1000
+ }
1001
+ }
1002
+ };
1003
+ installed = false;
1004
+ }
1005
+ });
1006
+
1007
+ // ../../node_modules/@math.gl/tasks/dist/tasks/index.js
1008
+ var init_tasks = __esm({
1009
+ "../../node_modules/@math.gl/tasks/dist/tasks/index.js"() {
1010
+ init_task_runtime();
1011
+ }
1012
+ });
1013
+
1014
+ // ../../node_modules/@math.gl/tasks/dist/index.js
1015
+ var init_dist = __esm({
1016
+ "../../node_modules/@math.gl/tasks/dist/index.js"() {
1017
+ init_tasks();
1018
+ }
1019
+ });
1020
+
1021
+ // ../core/src/worker-utils/lib/node/worker_threads-browser.ts
1022
+ var worker_threads_browser_exports = {};
1023
+ __export(worker_threads_browser_exports, {
1024
+ NodeWorker: () => NodeWorker,
1025
+ parentPort: () => parentPort2
1026
+ });
1027
+ var NodeWorker, parentPort2;
1028
+ var init_worker_threads_browser2 = __esm({
1029
+ "../core/src/worker-utils/lib/node/worker_threads-browser.ts"() {
1030
+ "use strict";
1031
+ NodeWorker = class {
1032
+ /** Restores the native worker constructor when this browser shim is embedded in a Node bundle. */
1033
+ constructor(...arguments_) {
1034
+ const runtimeProcess = globalThis.process;
1035
+ const WorkerConstructor = runtimeProcess?.getBuiltinModule?.("node:worker_threads").Worker;
1036
+ if (WorkerConstructor) {
1037
+ return new WorkerConstructor(...arguments_);
1038
+ }
1039
+ }
1040
+ /** No-op browser fallback matching the native Worker API. */
1041
+ terminate() {
1042
+ }
1043
+ };
1044
+ parentPort2 = null;
1045
+ }
1046
+ });
1047
+
1048
+ // ../core/src/worker-utils/lib/worker-api/task-runtime.ts
1049
+ function normalizeTaskProgress(progress) {
1050
+ return { ...progress, phase: progress.phase ?? "process", unit: progress.unit ?? "items" };
1051
+ }
1052
+ async function isWorkerThread() {
1053
+ if (typeof self !== "undefined" && typeof document === "undefined" && typeof self.postMessage === "function")
1054
+ return true;
1055
+ if (typeof process !== "undefined" && process.versions?.node) {
1056
+ const { isMainThread } = await Promise.resolve().then(() => (init_worker_threads_browser2(), worker_threads_browser_exports));
1057
+ return !isMainThread;
1058
+ }
1059
+ return false;
1060
+ }
1061
+ var initializeTaskWorker2;
1062
+ var init_task_runtime2 = __esm({
1063
+ "../core/src/worker-utils/lib/worker-api/task-runtime.ts"() {
1064
+ "use strict";
1065
+ init_dist();
1066
+ initializeTaskWorker2 = initializeTaskWorker;
1067
+ }
1068
+ });
1069
+
1070
+ // ../core/src/worker-utils/lib/worker-utils/get-transfer-list.ts
1071
+ function getTransferList2(object, recursive = true, transfers) {
1072
+ const transfersSet = transfers || /* @__PURE__ */ new Set();
1073
+ if (!object) {
1074
+ } else if (isTransferable2(object)) {
1075
+ transfersSet.add(object);
1076
+ } else if (isTransferable2(object.buffer)) {
1077
+ transfersSet.add(object.buffer);
1078
+ } else if (ArrayBuffer.isView(object)) {
1079
+ } else if (recursive && typeof object === "object") {
1080
+ for (const key in object) {
1081
+ getTransferList2(object[key], recursive, transfersSet);
1082
+ }
1083
+ }
1084
+ return transfers === void 0 ? Array.from(transfersSet) : [];
1085
+ }
1086
+ function isTransferable2(object) {
1087
+ if (!object) {
1088
+ return false;
1089
+ }
1090
+ if (object instanceof ArrayBuffer) {
1091
+ return true;
1092
+ }
1093
+ if (typeof MessagePort !== "undefined" && object instanceof MessagePort) {
1094
+ return true;
1095
+ }
1096
+ if (typeof ImageBitmap !== "undefined" && object instanceof ImageBitmap) {
1097
+ return true;
1098
+ }
1099
+ if (typeof OffscreenCanvas !== "undefined" && object instanceof OffscreenCanvas) {
1100
+ return true;
1101
+ }
1102
+ return false;
1103
+ }
1104
+ var init_get_transfer_list2 = __esm({
1105
+ "../core/src/worker-utils/lib/worker-utils/get-transfer-list.ts"() {
1106
+ "use strict";
602
1107
  }
603
1108
  });
604
1109
 
605
1110
  // ../core/src/worker-utils/lib/worker-api/create-worker.ts
1111
+ async function createWorker2(process2, processInBatches) {
1112
+ if (!await isWorkerThread()) return;
1113
+ await initializeTaskWorker2(createWorkerTask(process2, processInBatches));
1114
+ }
1115
+ function createWorkerTask(process2, processInBatches) {
1116
+ return {
1117
+ id: "loaders.gl",
1118
+ initialize: (state) => state,
1119
+ destroy: (state) => state.port?.close(),
1120
+ process: async ({ value }, options, context) => {
1121
+ if (!process2) throw new Error("Worker does not support atomic processing");
1122
+ return { value: await process2(value, options, createContext(context), context.state.context) };
1123
+ },
1124
+ ...processInBatches ? {
1125
+ processInBatches: async function* (inputs, options, context) {
1126
+ async function* values() {
1127
+ for await (const input of inputs) yield input.value;
1128
+ }
1129
+ for await (const value of processInBatches(
1130
+ values(),
1131
+ options,
1132
+ createContext(context),
1133
+ context.state.context
1134
+ )) {
1135
+ yield { value };
1136
+ }
1137
+ }
1138
+ } : {}
1139
+ };
1140
+ }
1141
+ function createContext(context) {
1142
+ let requestIdentifier = 0;
1143
+ const port = context.state.port;
1144
+ return {
1145
+ signal: context.signal,
1146
+ throwIfAborted: () => context.throwIfAborted(),
1147
+ reportProgress: (progress) => context.reportProgress(normalizeTaskProgress(progress)),
1148
+ process: port ? (input, options = {}, jobContext = {}) => {
1149
+ context.throwIfAborted();
1150
+ const identifier = ++requestIdentifier;
1151
+ return new Promise((resolve, reject) => {
1152
+ const onMessage = (event) => {
1153
+ if (event.data.identifier !== identifier) return;
1154
+ cleanup();
1155
+ if (event.data.error) {
1156
+ const error = new Error(event.data.error.message);
1157
+ error.name = event.data.error.name;
1158
+ reject(error);
1159
+ } else resolve(event.data.value);
1160
+ };
1161
+ const onAbort = () => {
1162
+ cleanup();
1163
+ reject(context.signal.reason);
1164
+ };
1165
+ const cleanup = () => {
1166
+ port.removeEventListener("message", onMessage);
1167
+ context.signal.removeEventListener("abort", onAbort);
1168
+ };
1169
+ port.addEventListener("message", onMessage);
1170
+ context.signal.addEventListener("abort", onAbort, { once: true });
1171
+ port.start();
1172
+ try {
1173
+ const request = { identifier, input, options, context: jobContext };
1174
+ port.postMessage(request, getTransferList2(request));
1175
+ } catch (error) {
1176
+ cleanup();
1177
+ reject(error);
1178
+ }
1179
+ });
1180
+ } : void 0
1181
+ };
1182
+ }
606
1183
  var init_create_worker2 = __esm({
607
1184
  "../core/src/worker-utils/lib/worker-api/create-worker.ts"() {
608
1185
  "use strict";
609
- init_tasks();
1186
+ init_task_runtime2();
1187
+ init_get_transfer_list2();
610
1188
  }
611
1189
  });
612
1190
 
@@ -783,7 +1361,7 @@
783
1361
 
784
1362
  // ../core/src/loader-utils/lib/worker-loader-utils/create-loader-worker.ts
785
1363
  async function createLoaderWorker(loader, selectLoader = () => loader) {
786
- await createWorker(
1364
+ await createWorker2(
787
1365
  (input, options, workerContext, loaderContext) => processLoaderWorkerData(
788
1366
  selectLoader(options || {}),
789
1367
  input,
@@ -1037,7 +1615,7 @@
1037
1615
  });
1038
1616
 
1039
1617
  // ../../node_modules/@math.gl/core/dist/index.js
1040
- var init_dist = __esm({
1618
+ var init_dist2 = __esm({
1041
1619
  "../../node_modules/@math.gl/core/dist/index.js"() {
1042
1620
  init_math_utils();
1043
1621
  init_types2();
@@ -8775,11 +9353,11 @@ return true;`);
8775
9353
  this._offsets = new OffsetsBufferBuilder(opts.type);
8776
9354
  }
8777
9355
  setValue(index, value) {
8778
- const pending = this._pending || (this._pending = /* @__PURE__ */ new Map());
8779
- const current = pending.get(index);
9356
+ const pending2 = this._pending || (this._pending = /* @__PURE__ */ new Map());
9357
+ const current = pending2.get(index);
8780
9358
  current && (this._pendingLength -= current.length);
8781
9359
  this._pendingLength += value instanceof MapRow ? value[kKeys].length : value.length;
8782
- pending.set(index, value);
9360
+ pending2.set(index, value);
8783
9361
  }
8784
9362
  setValid(index, isValid) {
8785
9363
  if (!super.setValid(index, isValid)) {
@@ -8802,12 +9380,12 @@ return true;`);
8802
9380
  return super.finish();
8803
9381
  }
8804
9382
  _flush() {
8805
- const pending = this._pending;
9383
+ const pending2 = this._pending;
8806
9384
  const pendingLength = this._pendingLength;
8807
9385
  this._pendingLength = 0;
8808
9386
  this._pending = void 0;
8809
- if (pending && pending.size > 0) {
8810
- this._flushPending(pending, pendingLength);
9387
+ if (pending2 && pending2.size > 0) {
9388
+ this._flushPending(pending2, pendingLength);
8811
9389
  }
8812
9390
  return this;
8813
9391
  }
@@ -11393,11 +11971,11 @@ return true;`);
11393
11971
  setValue(index, value) {
11394
11972
  return super.setValue(index, toUint8Array(value));
11395
11973
  }
11396
- _flushPending(pending, pendingLength) {
11974
+ _flushPending(pending2, pendingLength) {
11397
11975
  const offsets = this._offsets;
11398
11976
  const data = this._values.reserve(pendingLength).buffer;
11399
11977
  let offset = 0;
11400
- for (const [index, value] of pending) {
11978
+ for (const [index, value] of pending2) {
11401
11979
  if (value === void 0) {
11402
11980
  offsets.set(index, 0);
11403
11981
  } else {
@@ -11434,11 +12012,11 @@ return true;`);
11434
12012
  setValue(index, value) {
11435
12013
  return super.setValue(index, toUint8Array(value));
11436
12014
  }
11437
- _flushPending(pending, pendingLength) {
12015
+ _flushPending(pending2, pendingLength) {
11438
12016
  const offsets = this._offsets;
11439
12017
  const data = this._values.reserve(pendingLength).buffer;
11440
12018
  let offset = 0;
11441
- for (const [index, value] of pending) {
12019
+ for (const [index, value] of pending2) {
11442
12020
  if (value === void 0) {
11443
12021
  offsets.set(index, BigInt(0));
11444
12022
  } else {
@@ -11749,10 +12327,10 @@ return true;`);
11749
12327
  this.type = new List2(new Field2(name, child.type, true));
11750
12328
  return this.numChildren - 1;
11751
12329
  }
11752
- _flushPending(pending) {
12330
+ _flushPending(pending2) {
11753
12331
  const offsets = this._offsets;
11754
12332
  const [child] = this.children;
11755
- for (const [index, value] of pending) {
12333
+ for (const [index, value] of pending2) {
11756
12334
  if (typeof value === "undefined") {
11757
12335
  offsets.set(index, 0);
11758
12336
  } else {
@@ -11791,10 +12369,10 @@ return true;`);
11791
12369
  this.type = new LargeList2(new Field2(name, child.type, true));
11792
12370
  return this.numChildren - 1;
11793
12371
  }
11794
- _flushPending(pending) {
12372
+ _flushPending(pending2) {
11795
12373
  const offsets = this._offsets;
11796
12374
  const [child] = this.children;
11797
- for (const [index, value] of pending) {
12375
+ for (const [index, value] of pending2) {
11798
12376
  if (typeof value === "undefined") {
11799
12377
  offsets.set(index, BigInt(0));
11800
12378
  } else {
@@ -11824,11 +12402,11 @@ return true;`);
11824
12402
  }
11825
12403
  setValue(index, value) {
11826
12404
  const row = value instanceof Map ? value : new Map(Object.entries(value));
11827
- const pending = this._pending || (this._pending = /* @__PURE__ */ new Map());
11828
- const current = pending.get(index);
12405
+ const pending2 = this._pending || (this._pending = /* @__PURE__ */ new Map());
12406
+ const current = pending2.get(index);
11829
12407
  current && (this._pendingLength -= current.size);
11830
12408
  this._pendingLength += row.size;
11831
- pending.set(index, row);
12409
+ pending2.set(index, row);
11832
12410
  }
11833
12411
  addChild(child, name = `${this.numChildren}`) {
11834
12412
  if (this.numChildren > 0) {
@@ -11838,10 +12416,10 @@ return true;`);
11838
12416
  this.type = new Map_(new Field2(name, child.type, true), this.type.keysSorted);
11839
12417
  return this.numChildren - 1;
11840
12418
  }
11841
- _flushPending(pending) {
12419
+ _flushPending(pending2) {
11842
12420
  const offsets = this._offsets;
11843
12421
  const [child] = this.children;
11844
- for (const [index, value] of pending) {
12422
+ for (const [index, value] of pending2) {
11845
12423
  if (value === void 0) {
11846
12424
  offsets.set(index, 0);
11847
12425
  } else {
@@ -12050,7 +12628,7 @@ return true;`);
12050
12628
  return super.setValue(index, encodeUtf8(value));
12051
12629
  }
12052
12630
  // @ts-ignore
12053
- _flushPending(pending, pendingLength) {
12631
+ _flushPending(pending2, pendingLength) {
12054
12632
  }
12055
12633
  };
12056
12634
  Utf8Builder.prototype._flushPending = BinaryBuilder.prototype._flushPending;
@@ -12081,7 +12659,7 @@ return true;`);
12081
12659
  return super.setValue(index, encodeUtf8(value));
12082
12660
  }
12083
12661
  // @ts-ignore
12084
- _flushPending(pending, pendingLength) {
12662
+ _flushPending(pending2, pendingLength) {
12085
12663
  }
12086
12664
  };
12087
12665
  LargeUtf8Builder.prototype._flushPending = LargeBinaryBuilder.prototype._flushPending;
@@ -16032,12 +16610,6 @@ return true;`);
16032
16610
  metadata: serializeArrowMetadata(arrowSchema.metadata)
16033
16611
  };
16034
16612
  }
16035
- function deserializeArrowSchema(schema, options) {
16036
- return new Schema2(
16037
- schema.fields.map((field) => deserializeArrowField(field, options)),
16038
- deserializeArrowMetadata(schema.metadata)
16039
- );
16040
- }
16041
16613
  function serializeArrowMetadata(arrowMetadata) {
16042
16614
  return Object.fromEntries(arrowMetadata);
16043
16615
  }
@@ -16506,7 +17078,7 @@ return true;`);
16506
17078
  var init_float162 = __esm({
16507
17079
  "../core/src/schema/float16.ts"() {
16508
17080
  "use strict";
16509
- init_dist();
17081
+ init_dist2();
16510
17082
  }
16511
17083
  });
16512
17084
 
@@ -17717,7 +18289,29 @@ return true;`);
17717
18289
  }
17718
18290
  });
17719
18291
 
17720
- // ../core/src/schema-utils/lib/arrow/split-arrow-buffers.ts
18292
+ // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-data.js
18293
+ function getArrowVariadicBuffers(data) {
18294
+ return data.variadicBuffers ?? [];
18295
+ }
18296
+ function createArrowData(type, offset, length, nullCount, buffers, children, dictionary, variadicBuffers) {
18297
+ return Reflect.construct(Data, [
18298
+ type,
18299
+ offset,
18300
+ length,
18301
+ nullCount,
18302
+ buffers,
18303
+ children,
18304
+ dictionary,
18305
+ variadicBuffers
18306
+ ]);
18307
+ }
18308
+ var init_arrow_data = __esm({
18309
+ "../../node_modules/@math.gl/arrow/dist/arrow/arrow-data.js"() {
18310
+ init_Arrow_dom();
18311
+ }
18312
+ });
18313
+
18314
+ // ../../node_modules/@math.gl/arrow/dist/arrow/split-arrow-buffers.js
17721
18315
  function splitArrowBuffers(input, options = {}) {
17722
18316
  const context = { ...options, copies: /* @__PURE__ */ new WeakMap() };
17723
18317
  if (isArrowTable2(input)) {
@@ -17740,17 +18334,12 @@ return true;`);
17740
18334
  function isArrowVector2(input) {
17741
18335
  return "data" in input && Array.isArray(input.data);
17742
18336
  }
17743
- function splitArrowTableBuffersInternal(table, options) {
17744
- const recordBatches = table.batches.map(
17745
- (recordBatch) => splitArrowRecordBatchBuffers(recordBatch, options)
17746
- );
17747
- return new Table(table.schema, recordBatches);
18337
+ function splitArrowTableBuffersInternal(arrowTable, options) {
18338
+ const recordBatches = arrowTable.batches.map((recordBatch) => splitArrowRecordBatchBuffers(recordBatch, options));
18339
+ return new Table(arrowTable.schema, recordBatches);
17748
18340
  }
17749
18341
  function splitArrowRecordBatchBuffers(recordBatch, options) {
17750
- return new RecordBatch3(
17751
- recordBatch.schema,
17752
- splitArrowDataBuffers(recordBatch.data, options)
17753
- );
18342
+ return new RecordBatch3(recordBatch.schema, splitArrowDataBuffers(recordBatch.data, options));
17754
18343
  }
17755
18344
  function splitArrowDataBuffers(data, options) {
17756
18345
  const children = data.children.map((childData) => splitArrowDataBuffers(childData, options));
@@ -17761,7 +18350,7 @@ return true;`);
17761
18350
  [BufferType.VALIDITY]: splitArrowBuffer(data.buffers[BufferType.VALIDITY], options),
17762
18351
  [BufferType.TYPE]: splitArrowBuffer(data.buffers[BufferType.TYPE], options)
17763
18352
  };
17764
- return new Data(
18353
+ return createArrowData(
17765
18354
  data.type,
17766
18355
  data.offset,
17767
18356
  data.length,
@@ -17769,7 +18358,8 @@ return true;`);
17769
18358
  data._nullCount,
17770
18359
  buffers,
17771
18360
  children,
17772
- dictionary
18361
+ dictionary,
18362
+ getArrowVariadicBuffers(data).map((buffer) => splitArrowBuffer(buffer, options))
17773
18363
  );
17774
18364
  }
17775
18365
  function splitArrowVectorBuffers(vector, options) {
@@ -17787,7 +18377,7 @@ return true;`);
17787
18377
  }
17788
18378
  let copy = options.copies.get(array);
17789
18379
  if (!copy) {
17790
- copy = array.slice();
18380
+ copy = array instanceof Uint8Array ? new Uint8Array(array) : array.slice();
17791
18381
  options.copies.set(array, copy);
17792
18382
  }
17793
18383
  return copy;
@@ -17796,29 +18386,106 @@ return true;`);
17796
18386
  return ArrayBuffer.isView(value) && !(value instanceof DataView);
17797
18387
  }
17798
18388
  var init_split_arrow_buffers = __esm({
17799
- "../core/src/schema-utils/lib/arrow/split-arrow-buffers.ts"() {
17800
- "use strict";
18389
+ "../../node_modules/@math.gl/arrow/dist/arrow/split-arrow-buffers.js"() {
17801
18390
  init_Arrow_dom();
18391
+ init_arrow_data();
18392
+ }
18393
+ });
18394
+
18395
+ // ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js
18396
+ var init_indexed_arrow_vector = __esm({
18397
+ "../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js"() {
18398
+ }
18399
+ });
18400
+
18401
+ // ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js
18402
+ var init_indexed_arrow_table = __esm({
18403
+ "../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js"() {
17802
18404
  }
17803
18405
  });
17804
18406
 
17805
- // ../core/src/schema-utils/lib/arrow/arrow-table-transport.ts
17806
- function dehydrateArrowTable(table, options) {
17807
- const splitTable = splitArrowBuffers(table, options);
18407
+ // ../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js
18408
+ var init_mapped_arrow_table = __esm({
18409
+ "../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js"() {
18410
+ }
18411
+ });
18412
+
18413
+ // ../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js
18414
+ var init_rename_arrow_columns = __esm({
18415
+ "../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js"() {
18416
+ }
18417
+ });
18418
+
18419
+ // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-table-transport.js
18420
+ function dehydrateArrowTable(arrowTable, options) {
18421
+ const splitTable = splitArrowBuffers(arrowTable, options);
17808
18422
  return {
17809
- shape: "arrow-table",
17810
18423
  transport: "arrow-js",
17811
- schema: serializeArrowSchema(splitTable.schema),
17812
- batches: splitTable.batches.map((recordBatch) => dehydrateArrowRecordBatch(recordBatch))
18424
+ version: 1,
18425
+ schema: tableToIPC(new Table(splitTable.schema, [])),
18426
+ metadataVersion: splitTable.schema.metadataVersion,
18427
+ batches: splitTable.batches.map((batch) => dehydrateArrowData(batch.data))
17813
18428
  };
17814
18429
  }
17815
18430
  function hydrateArrowTable(table) {
17816
- const schema = deserializeArrowSchema(table.schema);
17817
- const recordBatches = table.batches.map(
17818
- (recordBatch) => new RecordBatch3(schema, hydrateArrowData(recordBatch.data))
17819
- );
17820
- return new Table(schema, recordBatches);
18431
+ if (table.transport !== "arrow-js" || table.version !== 1) {
18432
+ throw new Error("Unsupported Arrow column-buffer transport protocol.");
18433
+ }
18434
+ const decodedSchema = tableFromIPC(table.schema).schema;
18435
+ const schema = new Schema2(decodedSchema.fields, decodedSchema.metadata, decodedSchema.dictionaries, table.metadataVersion);
18436
+ const type = new Struct(schema.fields);
18437
+ const batches = table.batches.map((data) => new RecordBatch3(schema, hydrateArrowData(data, type)));
18438
+ return new Table(schema, batches);
17821
18439
  }
18440
+ function dehydrateArrowData(data) {
18441
+ return {
18442
+ offset: data.offset,
18443
+ length: data.length,
18444
+ nullCount: data.nullCount,
18445
+ buffers: {
18446
+ [BufferType.OFFSET]: data.buffers[BufferType.OFFSET],
18447
+ [BufferType.DATA]: data.buffers[BufferType.DATA],
18448
+ [BufferType.VALIDITY]: data.buffers[BufferType.VALIDITY],
18449
+ [BufferType.TYPE]: data.buffers[BufferType.TYPE]
18450
+ },
18451
+ children: data.children.map((child) => dehydrateArrowData(child)),
18452
+ variadicBuffers: getArrowVariadicBuffers(data),
18453
+ dictionary: data.dictionary?.data.map((chunk) => dehydrateArrowData(chunk))
18454
+ };
18455
+ }
18456
+ function hydrateArrowData(data, type) {
18457
+ const children = data.children.map((child, index) => hydrateArrowData(child, type.children[index].type));
18458
+ const dictionary = data.dictionary && DataType.isDictionary(type) ? new Vector(data.dictionary.map((chunk) => hydrateArrowData(chunk, type.dictionary))) : void 0;
18459
+ return createArrowData(type, data.offset, data.length, data.nullCount, data.buffers, children, dictionary, data.variadicBuffers);
18460
+ }
18461
+ var init_arrow_table_transport = __esm({
18462
+ "../../node_modules/@math.gl/arrow/dist/arrow/arrow-table-transport.js"() {
18463
+ init_Arrow_dom();
18464
+ init_arrow_data();
18465
+ init_split_arrow_buffers();
18466
+ }
18467
+ });
18468
+
18469
+ // ../../node_modules/@math.gl/arrow/dist/arrow/index.js
18470
+ var init_arrow = __esm({
18471
+ "../../node_modules/@math.gl/arrow/dist/arrow/index.js"() {
18472
+ init_indexed_arrow_table();
18473
+ init_indexed_arrow_vector();
18474
+ init_mapped_arrow_table();
18475
+ init_rename_arrow_columns();
18476
+ init_split_arrow_buffers();
18477
+ init_arrow_table_transport();
18478
+ }
18479
+ });
18480
+
18481
+ // ../../node_modules/@math.gl/arrow/dist/index.js
18482
+ var init_dist3 = __esm({
18483
+ "../../node_modules/@math.gl/arrow/dist/index.js"() {
18484
+ init_arrow();
18485
+ }
18486
+ });
18487
+
18488
+ // ../core/src/arrow-worker-transport.ts
17822
18489
  function serializeArrowWorkerResult(result, options) {
17823
18490
  if (!isArrowTableWrapper(result)) {
17824
18491
  return result;
@@ -17848,60 +18515,10 @@ return true;`);
17848
18515
  table && table.shape === "arrow-table" && table.data && table.data.transport === "arrow-js" && Array.isArray(table.data.batches)
17849
18516
  );
17850
18517
  }
17851
- function dehydrateArrowRecordBatch(recordBatch) {
17852
- return { data: dehydrateArrowData(recordBatch.data) };
17853
- }
17854
- function dehydrateArrowData(data) {
17855
- return {
17856
- type: serializeArrowType(data.type),
17857
- offset: data.offset,
17858
- length: data.length,
17859
- // @ts-expect-error _nullCount is protected. Preserve the Arrow lazy null-count state.
17860
- nullCount: data._nullCount,
17861
- buffers: {
17862
- [BufferType.OFFSET]: data.buffers[BufferType.OFFSET],
17863
- [BufferType.DATA]: data.buffers[BufferType.DATA],
17864
- [BufferType.VALIDITY]: data.buffers[BufferType.VALIDITY],
17865
- [BufferType.TYPE]: data.buffers[BufferType.TYPE]
17866
- },
17867
- children: data.children.map((childData) => dehydrateArrowData(childData)),
17868
- dictionary: data.dictionary ? dehydrateArrowVector(data.dictionary) : void 0
17869
- };
17870
- }
17871
- function dehydrateArrowVector(vector) {
17872
- return { data: vector.data.map((data) => dehydrateArrowData(data)) };
17873
- }
17874
- function hydrateArrowData(data) {
17875
- const children = data.children.map((childData) => hydrateArrowData(childData));
17876
- const dictionary = data.dictionary ? hydrateArrowVector(data.dictionary) : void 0;
17877
- return new Data(
17878
- deserializeArrowType(data.type),
17879
- data.offset,
17880
- data.length,
17881
- data.nullCount,
17882
- data.buffers,
17883
- children,
17884
- dictionary
17885
- );
17886
- }
17887
- function hydrateArrowVector(vector) {
17888
- return new Vector(vector.data.map((data) => hydrateArrowData(data)));
17889
- }
17890
- var init_arrow_table_transport = __esm({
17891
- "../core/src/schema-utils/lib/arrow/arrow-table-transport.ts"() {
17892
- "use strict";
17893
- init_Arrow_dom();
17894
- init_convert_arrow_schema();
17895
- init_split_arrow_buffers();
17896
- }
17897
- });
17898
-
17899
- // ../core/src/schema-utils/arrow-transport.ts
17900
- var init_arrow_transport = __esm({
17901
- "../core/src/schema-utils/arrow-transport.ts"() {
18518
+ var init_arrow_worker_transport = __esm({
18519
+ "../core/src/arrow-worker-transport.ts"() {
17902
18520
  "use strict";
17903
- init_arrow_table_transport();
17904
- init_split_arrow_buffers();
18521
+ init_dist3();
17905
18522
  }
17906
18523
  });
17907
18524
 
@@ -17910,7 +18527,7 @@ return true;`);
17910
18527
  var init_version2 = __esm({
17911
18528
  "src/draco/lib/utils/version.ts"() {
17912
18529
  "use strict";
17913
- VERSION2 = true ? "5.0.0-beta.2" : "latest";
18530
+ VERSION2 = true ? "5.0.0-beta.5" : "latest";
17914
18531
  }
17915
18532
  });
17916
18533
 
@@ -18090,7 +18707,7 @@ return true;`);
18090
18707
  var init_draco_loader_types = __esm({
18091
18708
  "src/draco/draco-loader-types.ts"() {
18092
18709
  "use strict";
18093
- init_arrow_transport();
18710
+ init_arrow_worker_transport();
18094
18711
  init_version2();
18095
18712
  init_draco_format();
18096
18713
  init_draco_loader_options();