@loaders.gl/tiles-3d 5.0.0-beta.2 → 5.0.0-beta.4
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.
- package/dist/3d-tiles/3d-tiles-archive-loader.js +1 -1
- package/dist/3d-tiles/dist.dev.js +502 -342
- package/dist/3d-tiles/dist.min.js +19 -19
- package/dist/3d-tiles/index.cjs +307 -183
- package/dist/3d-tiles/index.cjs.map +3 -3
- package/dist/3d-tiles/lib/classes/tile-3d-batch-table.d.ts.map +1 -1
- package/dist/3d-tiles/lib/classes/tile-3d-batch-table.js +12 -8
- package/dist/3d-tiles/lib/classes/tile-3d-batch-table.js.map +1 -1
- package/dist/3d-tiles/lib/utils/version.js +1 -1
- package/dist/3d-tiles-archive-writer.cjs +1 -1
- package/dist/cesium-ion-loader-with-parser.cjs +301 -177
- package/dist/cesium-ion-loader-with-parser.cjs.map +3 -3
- package/dist/copc/copc-source-loader.js +1 -1
- package/dist/copc/copc-writer.js +1 -1
- package/dist/copc/index.cjs +358 -9
- package/dist/copc/index.cjs.map +3 -3
- package/dist/dist.min.js +2 -2
- package/dist/i3s/arcgis-webscene-loader.js +1 -1
- package/dist/i3s/dist.dev.js +3731 -694
- package/dist/i3s/dist.min.js +43 -35
- package/dist/i3s/i3s-attribute-loader.js +1 -1
- package/dist/i3s/i3s-building-scene-layer-loader.js +1 -1
- package/dist/i3s/i3s-content-loader.js +1 -1
- package/dist/i3s/i3s-lepcc-loader-types.js +1 -1
- package/dist/i3s/i3s-loader.js +1 -1
- package/dist/i3s/i3s-node-page-loader.js +1 -1
- package/dist/i3s/i3s-slpk-loader.js +1 -1
- package/dist/i3s/i3s-slpk-writer.js +1 -1
- package/dist/i3s/index.cjs +2542 -373
- package/dist/i3s/index.cjs.map +3 -3
- package/dist/i3s-content-worker-node.js +11 -11
- package/dist/i3s-content-worker-node.js.map +4 -4
- package/dist/i3s-content-worker.js +392 -56
- package/dist/i3s-lepcc-worker-node.js +369 -37
- package/dist/i3s-lepcc-worker-node.js.map +4 -4
- package/dist/i3s-lepcc-worker.js +340 -33
- package/dist/i3s-mesh-writer.cjs +2464 -295
- package/dist/i3s-mesh-writer.cjs.map +3 -3
- package/dist/i3s-slpk-writer.cjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/point-cloud-tile-source-loader-types.js +1 -1
- package/dist/point-cloud-tile-source-loader.cjs +1 -1
- package/dist/potree/dist.dev.js +84 -28
- package/dist/potree/dist.min.js +26 -26
- package/dist/potree/index.cjs +11 -6
- package/dist/potree/index.cjs.map +1 -1
- package/dist/potree/potree-bin-loader.js +1 -1
- package/dist/potree/potree-hierarchy-chunk-loader.js +1 -1
- package/dist/potree/potree-loader-types.js +1 -1
- package/dist/potree/potree-source-loader.js +1 -1
- package/dist/potree/potree-writer.js +1 -1
- package/dist/potree-loader.cjs +1 -1
- package/package.json +13 -13
- package/src/3d-tiles/lib/classes/tile-3d-batch-table.ts +12 -8
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
|
|
113
113
|
// ../core/src/worker-utils/lib/env-utils/version.ts
|
|
114
114
|
function getVersion() {
|
|
115
|
-
const version = false ? NPM_TAG : "5.0.0-beta.
|
|
115
|
+
const version = false ? NPM_TAG : "5.0.0-beta.4";
|
|
116
116
|
globalThis._loadersgl_ = globalThis._loadersgl_ || {};
|
|
117
117
|
globalThis._loadersgl_.version ||= version;
|
|
118
118
|
return version;
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
var parentPort;
|
|
166
166
|
var init_worker_threads_browser = __esm({
|
|
167
167
|
"../../node_modules/@math.gl/core/dist/worker-utils/lib/node/worker_threads-browser.js"() {
|
|
168
|
-
parentPort = null;
|
|
168
|
+
parentPort = globalThis.process?.getBuiltinModule?.("node:worker_threads")?.parentPort ?? null;
|
|
169
169
|
}
|
|
170
170
|
});
|
|
171
171
|
|
|
@@ -182,6 +182,9 @@
|
|
|
182
182
|
else if (ArrayBuffer.isView(value2)) {
|
|
183
183
|
if (isTransferable(value2.buffer))
|
|
184
184
|
transfersSet.add(value2.buffer);
|
|
185
|
+
} else if (recursive && typeof MessageChannel !== "undefined" && value2 instanceof MessageChannel) {
|
|
186
|
+
visit(value2.port1);
|
|
187
|
+
visit(value2.port2);
|
|
185
188
|
} else if (recursive && value2 instanceof Map) {
|
|
186
189
|
for (const [key2, item] of value2) {
|
|
187
190
|
visit(key2);
|
|
@@ -249,16 +252,16 @@
|
|
|
249
252
|
*/
|
|
250
253
|
static set onmessage(onMessage) {
|
|
251
254
|
async function handleMessage(message) {
|
|
252
|
-
const
|
|
253
|
-
const { type, payload } =
|
|
255
|
+
const parentPort3 = await getParentPort();
|
|
256
|
+
const { type, payload } = parentPort3 ? message : message.data;
|
|
254
257
|
onMessage(type, payload);
|
|
255
258
|
}
|
|
256
|
-
getParentPort().then((
|
|
257
|
-
if (
|
|
258
|
-
|
|
259
|
+
getParentPort().then((parentPort3) => {
|
|
260
|
+
if (parentPort3) {
|
|
261
|
+
parentPort3.on("message", (message) => {
|
|
259
262
|
handleMessage(message);
|
|
260
263
|
});
|
|
261
|
-
|
|
264
|
+
parentPort3.on("exit", () => console.debug("Node worker closing"));
|
|
262
265
|
} else {
|
|
263
266
|
globalThis.onmessage = handleMessage;
|
|
264
267
|
}
|
|
@@ -276,9 +279,9 @@
|
|
|
276
279
|
};
|
|
277
280
|
onMessageWrapperMap.set(onMessage, onMessageWrapper);
|
|
278
281
|
}
|
|
279
|
-
const
|
|
280
|
-
if (
|
|
281
|
-
|
|
282
|
+
const parentPort3 = await getParentPort();
|
|
283
|
+
if (parentPort3) {
|
|
284
|
+
parentPort3.on("message", onMessageWrapper);
|
|
282
285
|
} else {
|
|
283
286
|
globalThis.addEventListener("message", onMessageWrapper);
|
|
284
287
|
}
|
|
@@ -289,9 +292,9 @@
|
|
|
289
292
|
if (!onMessageWrapper) {
|
|
290
293
|
return;
|
|
291
294
|
}
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
294
|
-
|
|
295
|
+
const parentPort3 = await getParentPort();
|
|
296
|
+
if (parentPort3) {
|
|
297
|
+
parentPort3.off("message", onMessageWrapper);
|
|
295
298
|
} else {
|
|
296
299
|
globalThis.removeEventListener("message", onMessageWrapper);
|
|
297
300
|
}
|
|
@@ -301,12 +304,12 @@
|
|
|
301
304
|
* @param type
|
|
302
305
|
* @param payload
|
|
303
306
|
*/
|
|
304
|
-
static async postMessage(type, payload) {
|
|
307
|
+
static async postMessage(type, payload, copy2 = false) {
|
|
305
308
|
const data = { source: "loaders.gl", type, payload };
|
|
306
|
-
const transferList = getTransferList(payload);
|
|
307
|
-
const
|
|
308
|
-
if (
|
|
309
|
-
|
|
309
|
+
const transferList = copy2 ? [] : getTransferList(payload);
|
|
310
|
+
const parentPort3 = await getParentPort();
|
|
311
|
+
if (parentPort3) {
|
|
312
|
+
parentPort3.postMessage(data, transferList);
|
|
310
313
|
} else {
|
|
311
314
|
globalThis.postMessage(data, transferList);
|
|
312
315
|
}
|
|
@@ -431,8 +434,19 @@
|
|
|
431
434
|
}
|
|
432
435
|
});
|
|
433
436
|
|
|
437
|
+
// ../../node_modules/@math.gl/core/dist/worker-utils/lib/worker-api/validate-output-ownership.js
|
|
438
|
+
function validateOutputOwnership(ownership) {
|
|
439
|
+
if (ownership !== void 0 && ownership !== "copy" && ownership !== "transfer") {
|
|
440
|
+
throw new Error("Invalid worker output ownership");
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
var init_validate_output_ownership = __esm({
|
|
444
|
+
"../../node_modules/@math.gl/core/dist/worker-utils/lib/worker-api/validate-output-ownership.js"() {
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
|
|
434
448
|
// ../../node_modules/@math.gl/core/dist/worker-utils/lib/worker-api/create-worker.js
|
|
435
|
-
async function createWorker(process2, processInBatches) {
|
|
449
|
+
async function createWorker(process2, processInBatches, preload5) {
|
|
436
450
|
if (!await WorkerBody.inWorkerThread()) {
|
|
437
451
|
return;
|
|
438
452
|
}
|
|
@@ -473,10 +487,12 @@
|
|
|
473
487
|
}
|
|
474
488
|
switch (type) {
|
|
475
489
|
case "preload":
|
|
490
|
+
await preload5?.();
|
|
476
491
|
WorkerBody.postMessage("done", {});
|
|
477
492
|
break;
|
|
478
493
|
case "process":
|
|
479
494
|
throwIfAborted();
|
|
495
|
+
validateOutputOwnership(payload.options?.["outputOwnership"]);
|
|
480
496
|
if (!process2) {
|
|
481
497
|
throw new Error("Worker does not support atomic processing");
|
|
482
498
|
}
|
|
@@ -486,10 +502,11 @@
|
|
|
486
502
|
await WorkerBody.postMessage("done", {
|
|
487
503
|
result,
|
|
488
504
|
executionMs: performance.now() - startedAt
|
|
489
|
-
});
|
|
505
|
+
}, payload.options?.["outputOwnership"] === "copy");
|
|
490
506
|
break;
|
|
491
507
|
case "process-in-batches":
|
|
492
508
|
throwIfAborted();
|
|
509
|
+
validateOutputOwnership(payload.options?.["outputOwnership"]);
|
|
493
510
|
if (!processInBatches) {
|
|
494
511
|
throw new Error("Worker does not support batched processing");
|
|
495
512
|
}
|
|
@@ -501,7 +518,7 @@
|
|
|
501
518
|
const resultIterator = processInBatches(createDemandDrivenIterator(inputBatches), payload.options || {}, jobContext, payload.context || {});
|
|
502
519
|
for await (const batch of resultIterator) {
|
|
503
520
|
throwIfAborted();
|
|
504
|
-
await WorkerBody.postMessage("output-batch", { result: batch });
|
|
521
|
+
await WorkerBody.postMessage("output-batch", { result: batch }, payload.options?.["outputOwnership"] === "copy");
|
|
505
522
|
await outputAcknowledgements.next();
|
|
506
523
|
}
|
|
507
524
|
throwIfAborted();
|
|
@@ -599,14 +616,14 @@
|
|
|
599
616
|
});
|
|
600
617
|
}
|
|
601
618
|
function createProgressReporter() {
|
|
602
|
-
let
|
|
619
|
+
let pending2;
|
|
603
620
|
let finished = false;
|
|
604
621
|
let scheduled = false;
|
|
605
622
|
const flush = () => {
|
|
606
623
|
scheduled = false;
|
|
607
|
-
if (
|
|
608
|
-
WorkerBody.postMessage("progress", { progress:
|
|
609
|
-
|
|
624
|
+
if (pending2) {
|
|
625
|
+
WorkerBody.postMessage("progress", { progress: pending2 });
|
|
626
|
+
pending2 = void 0;
|
|
610
627
|
}
|
|
611
628
|
};
|
|
612
629
|
return {
|
|
@@ -614,9 +631,9 @@
|
|
|
614
631
|
report(progress) {
|
|
615
632
|
if (finished)
|
|
616
633
|
return;
|
|
617
|
-
if (
|
|
634
|
+
if (pending2 && pending2.phase !== progress.phase)
|
|
618
635
|
flush();
|
|
619
|
-
|
|
636
|
+
pending2 = { ...progress };
|
|
620
637
|
if (!scheduled) {
|
|
621
638
|
scheduled = true;
|
|
622
639
|
setTimeout(flush, 0);
|
|
@@ -625,7 +642,7 @@
|
|
|
625
642
|
/** Flushes final progress and suppresses reports from stale callbacks. */
|
|
626
643
|
finish(discard = false) {
|
|
627
644
|
if (discard)
|
|
628
|
-
|
|
645
|
+
pending2 = void 0;
|
|
629
646
|
flush();
|
|
630
647
|
finished = true;
|
|
631
648
|
}
|
|
@@ -637,6 +654,7 @@
|
|
|
637
654
|
init_shared_state();
|
|
638
655
|
init_async_queue();
|
|
639
656
|
init_worker_body();
|
|
657
|
+
init_validate_output_ownership();
|
|
640
658
|
requestId = 0;
|
|
641
659
|
activeController = null;
|
|
642
660
|
activeInputBatches = null;
|
|
@@ -648,6 +666,7 @@
|
|
|
648
666
|
var import_meta, path, moduleUrl;
|
|
649
667
|
var init_worker_utils = __esm({
|
|
650
668
|
"../../node_modules/@math.gl/core/dist/worker-utils/index.js"() {
|
|
669
|
+
init_worker_body();
|
|
651
670
|
init_create_worker();
|
|
652
671
|
import_meta = {};
|
|
653
672
|
path = typeof __filename === "string" ? __filename.replace(/\\/g, "/") : "";
|
|
@@ -655,18 +674,335 @@
|
|
|
655
674
|
}
|
|
656
675
|
});
|
|
657
676
|
|
|
677
|
+
// ../../node_modules/@math.gl/core/dist/tasks/task-preload.js
|
|
678
|
+
function preloadTaskCode(task, signal) {
|
|
679
|
+
if (!task.preload)
|
|
680
|
+
return Promise.resolve();
|
|
681
|
+
let promise = pending.get(task);
|
|
682
|
+
if (!promise) {
|
|
683
|
+
promise = Promise.resolve().then(() => task.preload()).then(() => {
|
|
684
|
+
loaded.add(task);
|
|
685
|
+
});
|
|
686
|
+
pending.set(task, promise);
|
|
687
|
+
void promise.catch(() => pending.delete(task));
|
|
688
|
+
}
|
|
689
|
+
return withSignal(promise, signal);
|
|
690
|
+
}
|
|
691
|
+
function withSignal(operation2, signal) {
|
|
692
|
+
if (!signal)
|
|
693
|
+
return operation2;
|
|
694
|
+
return new Promise((resolve, reject) => {
|
|
695
|
+
const abort = () => {
|
|
696
|
+
signal.removeEventListener("abort", abort);
|
|
697
|
+
reject(signal.reason);
|
|
698
|
+
};
|
|
699
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
700
|
+
if (signal.aborted)
|
|
701
|
+
abort();
|
|
702
|
+
operation2.then((value2) => {
|
|
703
|
+
signal.removeEventListener("abort", abort);
|
|
704
|
+
resolve(value2);
|
|
705
|
+
}, (error) => {
|
|
706
|
+
signal.removeEventListener("abort", abort);
|
|
707
|
+
reject(error);
|
|
708
|
+
});
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
var pending, loaded;
|
|
712
|
+
var init_task_preload = __esm({
|
|
713
|
+
"../../node_modules/@math.gl/core/dist/tasks/task-preload.js"() {
|
|
714
|
+
pending = /* @__PURE__ */ new WeakMap();
|
|
715
|
+
loaded = /* @__PURE__ */ new WeakSet();
|
|
716
|
+
}
|
|
717
|
+
});
|
|
718
|
+
|
|
719
|
+
// ../../node_modules/@math.gl/core/dist/tasks/task-runtime.js
|
|
720
|
+
function assertPayload(value2) {
|
|
721
|
+
if (!value2 || typeof value2 !== "object" || Object.getPrototypeOf(value2) !== Object.prototype) {
|
|
722
|
+
throw new TypeError("Task payloads must be plain objects with named fields");
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
function taskContext(state, context = {}) {
|
|
726
|
+
const signal = context.signal ?? new AbortController().signal;
|
|
727
|
+
return {
|
|
728
|
+
state,
|
|
729
|
+
signal,
|
|
730
|
+
throwIfAborted: () => {
|
|
731
|
+
signal.throwIfAborted();
|
|
732
|
+
context.throwIfAborted?.();
|
|
733
|
+
},
|
|
734
|
+
reportProgress: (progress) => context.reportProgress?.({
|
|
735
|
+
...progress,
|
|
736
|
+
phase: progress.phase ?? "process",
|
|
737
|
+
unit: progress.unit ?? "items"
|
|
738
|
+
})
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
async function initializeTaskWorker(task) {
|
|
742
|
+
if (!await WorkerBody.inWorkerThread())
|
|
743
|
+
throw new Error("initializeTaskWorker must run inside a worker");
|
|
744
|
+
if (installed)
|
|
745
|
+
throw new Error("A task is already installed in this worker");
|
|
746
|
+
installed = true;
|
|
747
|
+
const runtime = new TaskRuntime(task);
|
|
748
|
+
let streamOptions = {};
|
|
749
|
+
return createWorker(async (request, _options, context) => {
|
|
750
|
+
switch (request.operation) {
|
|
751
|
+
case "initialize":
|
|
752
|
+
return runtime.initialize(request.input, context);
|
|
753
|
+
case "destroy":
|
|
754
|
+
return runtime.destroy();
|
|
755
|
+
case "stream-options":
|
|
756
|
+
streamOptions = request.options;
|
|
757
|
+
return {};
|
|
758
|
+
case "process":
|
|
759
|
+
return runtime.process(request.input, request.options, context);
|
|
760
|
+
default:
|
|
761
|
+
throw new Error("Unknown task operation");
|
|
762
|
+
}
|
|
763
|
+
}, async function* (inputs, _options, context) {
|
|
764
|
+
async function* batches() {
|
|
765
|
+
for await (const input of inputs) {
|
|
766
|
+
assertPayload(input);
|
|
767
|
+
yield input;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
try {
|
|
771
|
+
yield* runtime.stream(batches(), streamOptions, context);
|
|
772
|
+
} finally {
|
|
773
|
+
streamOptions = {};
|
|
774
|
+
}
|
|
775
|
+
}, () => preloadTaskCode(task));
|
|
776
|
+
}
|
|
777
|
+
var TaskRuntime, installed;
|
|
778
|
+
var init_task_runtime = __esm({
|
|
779
|
+
"../../node_modules/@math.gl/core/dist/tasks/task-runtime.js"() {
|
|
780
|
+
init_worker_utils();
|
|
781
|
+
init_task_preload();
|
|
782
|
+
TaskRuntime = class {
|
|
783
|
+
constructor(task) {
|
|
784
|
+
this.task = task;
|
|
785
|
+
this.initialized = false;
|
|
786
|
+
}
|
|
787
|
+
async initialize(input, context = {}) {
|
|
788
|
+
if (this.initialized)
|
|
789
|
+
throw new Error("Task is already initialized");
|
|
790
|
+
assertPayload(input);
|
|
791
|
+
await preloadTaskCode(this.task, context.signal);
|
|
792
|
+
context.signal?.throwIfAborted();
|
|
793
|
+
this.state = await this.task.initialize?.(input, taskContext(void 0, context));
|
|
794
|
+
this.initialized = true;
|
|
795
|
+
return {};
|
|
796
|
+
}
|
|
797
|
+
async destroy() {
|
|
798
|
+
if (this.initialized) {
|
|
799
|
+
this.initialized = false;
|
|
800
|
+
const state = this.state;
|
|
801
|
+
this.state = void 0;
|
|
802
|
+
if (this.task.initialize)
|
|
803
|
+
await this.task.destroy?.(state);
|
|
804
|
+
}
|
|
805
|
+
return {};
|
|
806
|
+
}
|
|
807
|
+
async process(input, options, context = {}) {
|
|
808
|
+
if (!this.initialized)
|
|
809
|
+
throw new Error("Task is not initialized");
|
|
810
|
+
if (!this.task.process)
|
|
811
|
+
throw new Error("Task has no atomic processor");
|
|
812
|
+
assertPayload(input);
|
|
813
|
+
const result = await this.task.process(input, options, taskContext(this.state, context));
|
|
814
|
+
assertPayload(result);
|
|
815
|
+
return result;
|
|
816
|
+
}
|
|
817
|
+
async *stream(inputs, options, context = {}) {
|
|
818
|
+
if (!this.initialized)
|
|
819
|
+
throw new Error("Task is not initialized");
|
|
820
|
+
if (!this.task.processInBatches)
|
|
821
|
+
throw new Error("Task has no streaming processor");
|
|
822
|
+
for await (const output of this.task.processInBatches(inputs, options, taskContext(this.state, context))) {
|
|
823
|
+
assertPayload(output);
|
|
824
|
+
yield output;
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
};
|
|
828
|
+
installed = false;
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
|
|
658
832
|
// ../../node_modules/@math.gl/core/dist/tasks/index.js
|
|
659
833
|
var init_tasks = __esm({
|
|
660
834
|
"../../node_modules/@math.gl/core/dist/tasks/index.js"() {
|
|
661
|
-
|
|
835
|
+
init_task_runtime();
|
|
836
|
+
}
|
|
837
|
+
});
|
|
838
|
+
|
|
839
|
+
// ../core/src/worker-utils/lib/node/worker_threads-browser.ts
|
|
840
|
+
var worker_threads_browser_exports = {};
|
|
841
|
+
__export(worker_threads_browser_exports, {
|
|
842
|
+
NodeWorker: () => NodeWorker,
|
|
843
|
+
parentPort: () => parentPort2
|
|
844
|
+
});
|
|
845
|
+
var NodeWorker, parentPort2;
|
|
846
|
+
var init_worker_threads_browser2 = __esm({
|
|
847
|
+
"../core/src/worker-utils/lib/node/worker_threads-browser.ts"() {
|
|
848
|
+
"use strict";
|
|
849
|
+
NodeWorker = class {
|
|
850
|
+
/** Restores the native worker constructor when this browser shim is embedded in a Node bundle. */
|
|
851
|
+
constructor(...arguments_) {
|
|
852
|
+
const runtimeProcess = globalThis.process;
|
|
853
|
+
const WorkerConstructor = runtimeProcess?.getBuiltinModule?.("node:worker_threads").Worker;
|
|
854
|
+
if (WorkerConstructor) {
|
|
855
|
+
return new WorkerConstructor(...arguments_);
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
/** No-op browser fallback matching the native Worker API. */
|
|
859
|
+
terminate() {
|
|
860
|
+
}
|
|
861
|
+
};
|
|
862
|
+
parentPort2 = null;
|
|
863
|
+
}
|
|
864
|
+
});
|
|
865
|
+
|
|
866
|
+
// ../core/src/worker-utils/lib/worker-api/task-runtime.ts
|
|
867
|
+
function normalizeTaskProgress(progress) {
|
|
868
|
+
return { ...progress, phase: progress.phase ?? "process", unit: progress.unit ?? "items" };
|
|
869
|
+
}
|
|
870
|
+
async function isWorkerThread() {
|
|
871
|
+
if (typeof self !== "undefined" && typeof document === "undefined" && typeof self.postMessage === "function")
|
|
872
|
+
return true;
|
|
873
|
+
if (typeof process !== "undefined" && process.versions?.node) {
|
|
874
|
+
const { isMainThread } = await Promise.resolve().then(() => (init_worker_threads_browser2(), worker_threads_browser_exports));
|
|
875
|
+
return !isMainThread;
|
|
876
|
+
}
|
|
877
|
+
return false;
|
|
878
|
+
}
|
|
879
|
+
var initializeTaskWorker2;
|
|
880
|
+
var init_task_runtime2 = __esm({
|
|
881
|
+
"../core/src/worker-utils/lib/worker-api/task-runtime.ts"() {
|
|
882
|
+
"use strict";
|
|
883
|
+
init_tasks();
|
|
884
|
+
initializeTaskWorker2 = initializeTaskWorker;
|
|
885
|
+
}
|
|
886
|
+
});
|
|
887
|
+
|
|
888
|
+
// ../core/src/worker-utils/lib/worker-utils/get-transfer-list.ts
|
|
889
|
+
function getTransferList2(object2, recursive = true, transfers) {
|
|
890
|
+
const transfersSet = transfers || /* @__PURE__ */ new Set();
|
|
891
|
+
if (!object2) {
|
|
892
|
+
} else if (isTransferable2(object2)) {
|
|
893
|
+
transfersSet.add(object2);
|
|
894
|
+
} else if (isTransferable2(object2.buffer)) {
|
|
895
|
+
transfersSet.add(object2.buffer);
|
|
896
|
+
} else if (ArrayBuffer.isView(object2)) {
|
|
897
|
+
} else if (recursive && typeof object2 === "object") {
|
|
898
|
+
for (const key2 in object2) {
|
|
899
|
+
getTransferList2(object2[key2], recursive, transfersSet);
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
return transfers === void 0 ? Array.from(transfersSet) : [];
|
|
903
|
+
}
|
|
904
|
+
function isTransferable2(object2) {
|
|
905
|
+
if (!object2) {
|
|
906
|
+
return false;
|
|
907
|
+
}
|
|
908
|
+
if (object2 instanceof ArrayBuffer) {
|
|
909
|
+
return true;
|
|
910
|
+
}
|
|
911
|
+
if (typeof MessagePort !== "undefined" && object2 instanceof MessagePort) {
|
|
912
|
+
return true;
|
|
913
|
+
}
|
|
914
|
+
if (typeof ImageBitmap !== "undefined" && object2 instanceof ImageBitmap) {
|
|
915
|
+
return true;
|
|
916
|
+
}
|
|
917
|
+
if (typeof OffscreenCanvas !== "undefined" && object2 instanceof OffscreenCanvas) {
|
|
918
|
+
return true;
|
|
919
|
+
}
|
|
920
|
+
return false;
|
|
921
|
+
}
|
|
922
|
+
var init_get_transfer_list2 = __esm({
|
|
923
|
+
"../core/src/worker-utils/lib/worker-utils/get-transfer-list.ts"() {
|
|
924
|
+
"use strict";
|
|
662
925
|
}
|
|
663
926
|
});
|
|
664
927
|
|
|
665
928
|
// ../core/src/worker-utils/lib/worker-api/create-worker.ts
|
|
929
|
+
async function createWorker2(process2, processInBatches) {
|
|
930
|
+
if (!await isWorkerThread()) return;
|
|
931
|
+
await initializeTaskWorker2(createWorkerTask(process2, processInBatches));
|
|
932
|
+
}
|
|
933
|
+
function createWorkerTask(process2, processInBatches) {
|
|
934
|
+
return {
|
|
935
|
+
id: "loaders.gl",
|
|
936
|
+
initialize: (state) => state,
|
|
937
|
+
destroy: (state) => state.port?.close(),
|
|
938
|
+
process: async ({ value: value2 }, options, context) => {
|
|
939
|
+
if (!process2) throw new Error("Worker does not support atomic processing");
|
|
940
|
+
return { value: await process2(value2, options, createContext(context), context.state.context) };
|
|
941
|
+
},
|
|
942
|
+
...processInBatches ? {
|
|
943
|
+
processInBatches: async function* (inputs, options, context) {
|
|
944
|
+
async function* values() {
|
|
945
|
+
for await (const input of inputs) yield input.value;
|
|
946
|
+
}
|
|
947
|
+
for await (const value2 of processInBatches(
|
|
948
|
+
values(),
|
|
949
|
+
options,
|
|
950
|
+
createContext(context),
|
|
951
|
+
context.state.context
|
|
952
|
+
)) {
|
|
953
|
+
yield { value: value2 };
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
} : {}
|
|
957
|
+
};
|
|
958
|
+
}
|
|
959
|
+
function createContext(context) {
|
|
960
|
+
let requestIdentifier = 0;
|
|
961
|
+
const port = context.state.port;
|
|
962
|
+
return {
|
|
963
|
+
signal: context.signal,
|
|
964
|
+
throwIfAborted: () => context.throwIfAborted(),
|
|
965
|
+
reportProgress: (progress) => context.reportProgress(normalizeTaskProgress(progress)),
|
|
966
|
+
process: port ? (input, options = {}, jobContext = {}) => {
|
|
967
|
+
context.throwIfAborted();
|
|
968
|
+
const identifier = ++requestIdentifier;
|
|
969
|
+
return new Promise((resolve, reject) => {
|
|
970
|
+
const onMessage = (event) => {
|
|
971
|
+
if (event.data.identifier !== identifier) return;
|
|
972
|
+
cleanup();
|
|
973
|
+
if (event.data.error) {
|
|
974
|
+
const error = new Error(event.data.error.message);
|
|
975
|
+
error.name = event.data.error.name;
|
|
976
|
+
reject(error);
|
|
977
|
+
} else resolve(event.data.value);
|
|
978
|
+
};
|
|
979
|
+
const onAbort = () => {
|
|
980
|
+
cleanup();
|
|
981
|
+
reject(context.signal.reason);
|
|
982
|
+
};
|
|
983
|
+
const cleanup = () => {
|
|
984
|
+
port.removeEventListener("message", onMessage);
|
|
985
|
+
context.signal.removeEventListener("abort", onAbort);
|
|
986
|
+
};
|
|
987
|
+
port.addEventListener("message", onMessage);
|
|
988
|
+
context.signal.addEventListener("abort", onAbort, { once: true });
|
|
989
|
+
port.start();
|
|
990
|
+
try {
|
|
991
|
+
const request = { identifier, input, options, context: jobContext };
|
|
992
|
+
port.postMessage(request, getTransferList2(request));
|
|
993
|
+
} catch (error) {
|
|
994
|
+
cleanup();
|
|
995
|
+
reject(error);
|
|
996
|
+
}
|
|
997
|
+
});
|
|
998
|
+
} : void 0
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
666
1001
|
var init_create_worker2 = __esm({
|
|
667
1002
|
"../core/src/worker-utils/lib/worker-api/create-worker.ts"() {
|
|
668
1003
|
"use strict";
|
|
669
|
-
|
|
1004
|
+
init_task_runtime2();
|
|
1005
|
+
init_get_transfer_list2();
|
|
670
1006
|
}
|
|
671
1007
|
});
|
|
672
1008
|
|
|
@@ -843,7 +1179,7 @@
|
|
|
843
1179
|
|
|
844
1180
|
// ../core/src/loader-utils/lib/worker-loader-utils/create-loader-worker.ts
|
|
845
1181
|
async function createLoaderWorker(loader, selectLoader = () => loader) {
|
|
846
|
-
await
|
|
1182
|
+
await createWorker2(
|
|
847
1183
|
(input, options, workerContext, loaderContext) => processLoaderWorkerData(
|
|
848
1184
|
selectLoader(options || {}),
|
|
849
1185
|
input,
|
|
@@ -9161,7 +9497,7 @@
|
|
|
9161
9497
|
var init_version2 = __esm({
|
|
9162
9498
|
"../images/src/lib/utils/version.ts"() {
|
|
9163
9499
|
"use strict";
|
|
9164
|
-
VERSION2 = true ? "5.0.0-beta.
|
|
9500
|
+
VERSION2 = true ? "5.0.0-beta.4" : "latest";
|
|
9165
9501
|
}
|
|
9166
9502
|
});
|
|
9167
9503
|
|
|
@@ -18837,11 +19173,11 @@ return true;`);
|
|
|
18837
19173
|
this._offsets = new OffsetsBufferBuilder(opts.type);
|
|
18838
19174
|
}
|
|
18839
19175
|
setValue(index, value2) {
|
|
18840
|
-
const
|
|
18841
|
-
const current =
|
|
19176
|
+
const pending2 = this._pending || (this._pending = /* @__PURE__ */ new Map());
|
|
19177
|
+
const current = pending2.get(index);
|
|
18842
19178
|
current && (this._pendingLength -= current.length);
|
|
18843
19179
|
this._pendingLength += value2 instanceof MapRow ? value2[kKeys].length : value2.length;
|
|
18844
|
-
|
|
19180
|
+
pending2.set(index, value2);
|
|
18845
19181
|
}
|
|
18846
19182
|
setValid(index, isValid) {
|
|
18847
19183
|
if (!super.setValid(index, isValid)) {
|
|
@@ -18864,12 +19200,12 @@ return true;`);
|
|
|
18864
19200
|
return super.finish();
|
|
18865
19201
|
}
|
|
18866
19202
|
_flush() {
|
|
18867
|
-
const
|
|
19203
|
+
const pending2 = this._pending;
|
|
18868
19204
|
const pendingLength = this._pendingLength;
|
|
18869
19205
|
this._pendingLength = 0;
|
|
18870
19206
|
this._pending = void 0;
|
|
18871
|
-
if (
|
|
18872
|
-
this._flushPending(
|
|
19207
|
+
if (pending2 && pending2.size > 0) {
|
|
19208
|
+
this._flushPending(pending2, pendingLength);
|
|
18873
19209
|
}
|
|
18874
19210
|
return this;
|
|
18875
19211
|
}
|
|
@@ -21455,11 +21791,11 @@ return true;`);
|
|
|
21455
21791
|
setValue(index, value2) {
|
|
21456
21792
|
return super.setValue(index, toUint8Array(value2));
|
|
21457
21793
|
}
|
|
21458
|
-
_flushPending(
|
|
21794
|
+
_flushPending(pending2, pendingLength) {
|
|
21459
21795
|
const offsets = this._offsets;
|
|
21460
21796
|
const data = this._values.reserve(pendingLength).buffer;
|
|
21461
21797
|
let offset2 = 0;
|
|
21462
|
-
for (const [index, value2] of
|
|
21798
|
+
for (const [index, value2] of pending2) {
|
|
21463
21799
|
if (value2 === void 0) {
|
|
21464
21800
|
offsets.set(index, 0);
|
|
21465
21801
|
} else {
|
|
@@ -21496,11 +21832,11 @@ return true;`);
|
|
|
21496
21832
|
setValue(index, value2) {
|
|
21497
21833
|
return super.setValue(index, toUint8Array(value2));
|
|
21498
21834
|
}
|
|
21499
|
-
_flushPending(
|
|
21835
|
+
_flushPending(pending2, pendingLength) {
|
|
21500
21836
|
const offsets = this._offsets;
|
|
21501
21837
|
const data = this._values.reserve(pendingLength).buffer;
|
|
21502
21838
|
let offset2 = 0;
|
|
21503
|
-
for (const [index, value2] of
|
|
21839
|
+
for (const [index, value2] of pending2) {
|
|
21504
21840
|
if (value2 === void 0) {
|
|
21505
21841
|
offsets.set(index, BigInt(0));
|
|
21506
21842
|
} else {
|
|
@@ -21811,10 +22147,10 @@ return true;`);
|
|
|
21811
22147
|
this.type = new List2(new Field2(name, child2.type, true));
|
|
21812
22148
|
return this.numChildren - 1;
|
|
21813
22149
|
}
|
|
21814
|
-
_flushPending(
|
|
22150
|
+
_flushPending(pending2) {
|
|
21815
22151
|
const offsets = this._offsets;
|
|
21816
22152
|
const [child2] = this.children;
|
|
21817
|
-
for (const [index, value2] of
|
|
22153
|
+
for (const [index, value2] of pending2) {
|
|
21818
22154
|
if (typeof value2 === "undefined") {
|
|
21819
22155
|
offsets.set(index, 0);
|
|
21820
22156
|
} else {
|
|
@@ -21853,10 +22189,10 @@ return true;`);
|
|
|
21853
22189
|
this.type = new LargeList2(new Field2(name, child2.type, true));
|
|
21854
22190
|
return this.numChildren - 1;
|
|
21855
22191
|
}
|
|
21856
|
-
_flushPending(
|
|
22192
|
+
_flushPending(pending2) {
|
|
21857
22193
|
const offsets = this._offsets;
|
|
21858
22194
|
const [child2] = this.children;
|
|
21859
|
-
for (const [index, value2] of
|
|
22195
|
+
for (const [index, value2] of pending2) {
|
|
21860
22196
|
if (typeof value2 === "undefined") {
|
|
21861
22197
|
offsets.set(index, BigInt(0));
|
|
21862
22198
|
} else {
|
|
@@ -21886,11 +22222,11 @@ return true;`);
|
|
|
21886
22222
|
}
|
|
21887
22223
|
setValue(index, value2) {
|
|
21888
22224
|
const row = value2 instanceof Map ? value2 : new Map(Object.entries(value2));
|
|
21889
|
-
const
|
|
21890
|
-
const current =
|
|
22225
|
+
const pending2 = this._pending || (this._pending = /* @__PURE__ */ new Map());
|
|
22226
|
+
const current = pending2.get(index);
|
|
21891
22227
|
current && (this._pendingLength -= current.size);
|
|
21892
22228
|
this._pendingLength += row.size;
|
|
21893
|
-
|
|
22229
|
+
pending2.set(index, row);
|
|
21894
22230
|
}
|
|
21895
22231
|
addChild(child2, name = `${this.numChildren}`) {
|
|
21896
22232
|
if (this.numChildren > 0) {
|
|
@@ -21900,10 +22236,10 @@ return true;`);
|
|
|
21900
22236
|
this.type = new Map_(new Field2(name, child2.type, true), this.type.keysSorted);
|
|
21901
22237
|
return this.numChildren - 1;
|
|
21902
22238
|
}
|
|
21903
|
-
_flushPending(
|
|
22239
|
+
_flushPending(pending2) {
|
|
21904
22240
|
const offsets = this._offsets;
|
|
21905
22241
|
const [child2] = this.children;
|
|
21906
|
-
for (const [index, value2] of
|
|
22242
|
+
for (const [index, value2] of pending2) {
|
|
21907
22243
|
if (value2 === void 0) {
|
|
21908
22244
|
offsets.set(index, 0);
|
|
21909
22245
|
} else {
|
|
@@ -22112,7 +22448,7 @@ return true;`);
|
|
|
22112
22448
|
return super.setValue(index, encodeUtf8(value2));
|
|
22113
22449
|
}
|
|
22114
22450
|
// @ts-ignore
|
|
22115
|
-
_flushPending(
|
|
22451
|
+
_flushPending(pending2, pendingLength) {
|
|
22116
22452
|
}
|
|
22117
22453
|
};
|
|
22118
22454
|
Utf8Builder.prototype._flushPending = BinaryBuilder.prototype._flushPending;
|
|
@@ -22143,7 +22479,7 @@ return true;`);
|
|
|
22143
22479
|
return super.setValue(index, encodeUtf8(value2));
|
|
22144
22480
|
}
|
|
22145
22481
|
// @ts-ignore
|
|
22146
|
-
_flushPending(
|
|
22482
|
+
_flushPending(pending2, pendingLength) {
|
|
22147
22483
|
}
|
|
22148
22484
|
};
|
|
22149
22485
|
LargeUtf8Builder.prototype._flushPending = LargeBinaryBuilder.prototype._flushPending;
|
|
@@ -27183,7 +27519,7 @@ return true;`);
|
|
|
27183
27519
|
var init_version3 = __esm({
|
|
27184
27520
|
"../scene/src/draco/lib/utils/version.ts"() {
|
|
27185
27521
|
"use strict";
|
|
27186
|
-
VERSION3 = true ? "5.0.0-beta.
|
|
27522
|
+
VERSION3 = true ? "5.0.0-beta.4" : "latest";
|
|
27187
27523
|
}
|
|
27188
27524
|
});
|
|
27189
27525
|
|
|
@@ -39772,7 +40108,7 @@ return true;`);
|
|
|
39772
40108
|
"use strict";
|
|
39773
40109
|
init_i3s_format();
|
|
39774
40110
|
init_i3s_loader_options();
|
|
39775
|
-
VERSION4 = true ? "5.0.0-beta.
|
|
40111
|
+
VERSION4 = true ? "5.0.0-beta.4" : "latest";
|
|
39776
40112
|
I3SContentLoader = {
|
|
39777
40113
|
...I3SContentFormat,
|
|
39778
40114
|
dataType: null,
|