@loaders.gl/core 3.3.0-alpha.1 → 3.3.0-alpha.10
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/dist.min.js +220 -848
- package/dist/es5/bundle.js +0 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/core-addons/write-file-browser.js +2 -0
- package/dist/es5/core-addons/write-file-browser.js.map +1 -1
- package/dist/es5/index.js +108 -130
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/iterators/batch-iterators/timed-batch-iterator.js +34 -69
- package/dist/es5/iterators/batch-iterators/timed-batch-iterator.js.map +1 -1
- package/dist/es5/iterators/make-iterator/make-array-buffer-iterator.js +9 -17
- package/dist/es5/iterators/make-iterator/make-array-buffer-iterator.js.map +1 -1
- package/dist/es5/iterators/make-iterator/make-blob-iterator.js +0 -11
- package/dist/es5/iterators/make-iterator/make-blob-iterator.js.map +1 -1
- package/dist/es5/iterators/make-iterator/make-iterator.js +0 -11
- package/dist/es5/iterators/make-iterator/make-iterator.js.map +1 -1
- package/dist/es5/iterators/make-iterator/make-stream-iterator.js +29 -75
- package/dist/es5/iterators/make-iterator/make-stream-iterator.js.map +1 -1
- package/dist/es5/iterators/make-iterator/make-string-iterator.js +1 -8
- package/dist/es5/iterators/make-iterator/make-string-iterator.js.map +1 -1
- package/dist/es5/iterators/make-stream/make-dom-stream.js +2 -17
- package/dist/es5/iterators/make-stream/make-dom-stream.js.map +1 -1
- package/dist/es5/iterators/make-stream/make-node-stream.js +0 -50
- package/dist/es5/iterators/make-stream/make-node-stream.js.map +1 -1
- package/dist/es5/javascript-utils/is-type.js +1 -34
- package/dist/es5/javascript-utils/is-type.js.map +1 -1
- package/dist/es5/lib/api/encode.js +42 -118
- package/dist/es5/lib/api/encode.js.map +1 -1
- package/dist/es5/lib/api/load-in-batches.js +1 -15
- package/dist/es5/lib/api/load-in-batches.js.map +1 -1
- package/dist/es5/lib/api/load.js +0 -18
- package/dist/es5/lib/api/load.js.map +1 -1
- package/dist/es5/lib/api/loader-options.js +4 -5
- package/dist/es5/lib/api/loader-options.js.map +1 -1
- package/dist/es5/lib/api/parse-in-batches.js +122 -196
- package/dist/es5/lib/api/parse-in-batches.js.map +1 -1
- package/dist/es5/lib/api/parse-sync.js +2 -16
- package/dist/es5/lib/api/parse-sync.js.map +1 -1
- package/dist/es5/lib/api/parse.js +3 -42
- package/dist/es5/lib/api/parse.js.map +1 -1
- package/dist/es5/lib/api/register-loaders.js +3 -14
- package/dist/es5/lib/api/register-loaders.js.map +1 -1
- package/dist/es5/lib/api/save.js +0 -11
- package/dist/es5/lib/api/save.js.map +1 -1
- package/dist/es5/lib/api/select-loader.js +18 -91
- package/dist/es5/lib/api/select-loader.js.map +1 -1
- package/dist/es5/lib/common.js.map +1 -1
- package/dist/es5/lib/fetch/fetch-error-message.js +1 -15
- package/dist/es5/lib/fetch/fetch-error-message.js.map +1 -1
- package/dist/es5/lib/fetch/fetch-file.js +0 -14
- package/dist/es5/lib/fetch/fetch-file.js.map +1 -1
- package/dist/es5/lib/fetch/read-array-buffer.js +0 -20
- package/dist/es5/lib/fetch/read-array-buffer.js.map +1 -1
- package/dist/es5/lib/fetch/read-file.js +0 -3
- package/dist/es5/lib/fetch/read-file.js.map +1 -1
- package/dist/es5/lib/fetch/write-file.js +0 -13
- package/dist/es5/lib/fetch/write-file.js.map +1 -1
- package/dist/es5/lib/filesystems/browser-filesystem.js +9 -55
- package/dist/es5/lib/filesystems/browser-filesystem.js.map +1 -1
- package/dist/es5/lib/filesystems/filesystem.js.map +1 -1
- package/dist/es5/lib/filesystems/read-array-buffer.js +0 -10
- package/dist/es5/lib/filesystems/read-array-buffer.js.map +1 -1
- package/dist/es5/lib/init.js +1 -4
- package/dist/es5/lib/init.js.map +1 -1
- package/dist/es5/lib/loader-utils/check-errors.js +0 -14
- package/dist/es5/lib/loader-utils/check-errors.js.map +1 -1
- package/dist/es5/lib/loader-utils/get-data.js +2 -64
- package/dist/es5/lib/loader-utils/get-data.js.map +1 -1
- package/dist/es5/lib/loader-utils/loader-context.js +2 -15
- package/dist/es5/lib/loader-utils/loader-context.js.map +1 -1
- package/dist/es5/lib/loader-utils/loggers.js +4 -22
- package/dist/es5/lib/loader-utils/loggers.js.map +1 -1
- package/dist/es5/lib/loader-utils/normalize-loader.js +4 -16
- package/dist/es5/lib/loader-utils/normalize-loader.js.map +1 -1
- package/dist/es5/lib/loader-utils/option-defaults.js +2 -3
- package/dist/es5/lib/loader-utils/option-defaults.js.map +1 -1
- package/dist/es5/lib/loader-utils/option-utils.js +10 -38
- package/dist/es5/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/es5/lib/progress/fetch-progress.js +6 -35
- package/dist/es5/lib/progress/fetch-progress.js.map +1 -1
- package/dist/es5/lib/utils/log.js +0 -1
- package/dist/es5/lib/utils/log.js.map +1 -1
- package/dist/es5/lib/utils/mime-type-utils.js +1 -4
- package/dist/es5/lib/utils/mime-type-utils.js.map +1 -1
- package/dist/es5/lib/utils/resource-utils.js +1 -11
- package/dist/es5/lib/utils/resource-utils.js.map +1 -1
- package/dist/es5/lib/utils/response-utils.js +1 -47
- package/dist/es5/lib/utils/response-utils.js.map +1 -1
- package/dist/es5/null-loader.js +32 -67
- package/dist/es5/null-loader.js.map +1 -1
- package/dist/es5/workers/null-worker.js +0 -2
- package/dist/es5/workers/null-worker.js.map +1 -1
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/core-addons/write-file-browser.js.map +1 -1
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/iterators/batch-iterators/timed-batch-iterator.js +1 -3
- package/dist/esm/iterators/batch-iterators/timed-batch-iterator.js.map +1 -1
- package/dist/esm/iterators/make-iterator/make-array-buffer-iterator.js +5 -2
- package/dist/esm/iterators/make-iterator/make-array-buffer-iterator.js.map +1 -1
- package/dist/esm/iterators/make-iterator/make-blob-iterator.js +1 -1
- package/dist/esm/iterators/make-iterator/make-blob-iterator.js.map +1 -1
- package/dist/esm/iterators/make-iterator/make-iterator.js +1 -5
- package/dist/esm/iterators/make-iterator/make-iterator.js.map +1 -1
- package/dist/esm/iterators/make-iterator/make-stream-iterator.js +1 -5
- package/dist/esm/iterators/make-iterator/make-stream-iterator.js.map +1 -1
- package/dist/esm/iterators/make-iterator/make-string-iterator.js +2 -1
- package/dist/esm/iterators/make-iterator/make-string-iterator.js.map +1 -1
- package/dist/esm/iterators/make-stream/make-dom-stream.js +3 -6
- package/dist/esm/iterators/make-stream/make-dom-stream.js.map +1 -1
- package/dist/esm/iterators/make-stream/make-node-stream.js +0 -18
- package/dist/esm/iterators/make-stream/make-node-stream.js.map +1 -1
- package/dist/esm/javascript-utils/is-type.js +4 -2
- package/dist/esm/javascript-utils/is-type.js.map +1 -1
- package/dist/esm/lib/api/encode.js +8 -15
- package/dist/esm/lib/api/encode.js.map +1 -1
- package/dist/esm/lib/api/load-in-batches.js +1 -2
- package/dist/esm/lib/api/load-in-batches.js.map +1 -1
- package/dist/esm/lib/api/load.js +2 -1
- package/dist/esm/lib/api/load.js.map +1 -1
- package/dist/esm/lib/api/loader-options.js.map +1 -1
- package/dist/esm/lib/api/parse-in-batches.js +12 -12
- package/dist/esm/lib/api/parse-in-batches.js.map +1 -1
- package/dist/esm/lib/api/parse-sync.js +3 -5
- package/dist/esm/lib/api/parse-sync.js.map +1 -1
- package/dist/esm/lib/api/parse.js +5 -5
- package/dist/esm/lib/api/parse.js.map +1 -1
- package/dist/esm/lib/api/register-loaders.js +1 -2
- package/dist/esm/lib/api/register-loaders.js.map +1 -1
- package/dist/esm/lib/api/save.js.map +1 -1
- package/dist/esm/lib/api/select-loader.js +17 -35
- package/dist/esm/lib/api/select-loader.js.map +1 -1
- package/dist/esm/lib/common.js.map +1 -1
- package/dist/esm/lib/fetch/fetch-error-message.js +0 -3
- package/dist/esm/lib/fetch/fetch-error-message.js.map +1 -1
- package/dist/esm/lib/fetch/fetch-file.js +1 -3
- package/dist/esm/lib/fetch/fetch-file.js.map +1 -1
- package/dist/esm/lib/fetch/read-array-buffer.js +3 -6
- package/dist/esm/lib/fetch/read-array-buffer.js.map +1 -1
- package/dist/esm/lib/fetch/read-file.js +4 -2
- package/dist/esm/lib/fetch/read-file.js.map +1 -1
- package/dist/esm/lib/fetch/write-file.js +1 -4
- package/dist/esm/lib/fetch/write-file.js.map +1 -1
- package/dist/esm/lib/filesystems/browser-filesystem.js +6 -19
- package/dist/esm/lib/filesystems/browser-filesystem.js.map +1 -1
- package/dist/esm/lib/filesystems/filesystem.js.map +1 -1
- package/dist/esm/lib/filesystems/read-array-buffer.js +2 -1
- package/dist/esm/lib/filesystems/read-array-buffer.js.map +1 -1
- package/dist/esm/lib/init.js +3 -2
- package/dist/esm/lib/init.js.map +1 -1
- package/dist/esm/lib/loader-utils/check-errors.js +2 -5
- package/dist/esm/lib/loader-utils/check-errors.js.map +1 -1
- package/dist/esm/lib/loader-utils/get-data.js +3 -23
- package/dist/esm/lib/loader-utils/get-data.js.map +1 -1
- package/dist/esm/lib/loader-utils/loader-context.js +4 -6
- package/dist/esm/lib/loader-utils/loader-context.js.map +1 -1
- package/dist/esm/lib/loader-utils/loggers.js +19 -14
- package/dist/esm/lib/loader-utils/loggers.js.map +1 -1
- package/dist/esm/lib/loader-utils/normalize-loader.js +6 -9
- package/dist/esm/lib/loader-utils/normalize-loader.js.map +1 -1
- package/dist/esm/lib/loader-utils/option-defaults.js +2 -0
- package/dist/esm/lib/loader-utils/option-defaults.js.map +1 -1
- package/dist/esm/lib/loader-utils/option-utils.js +14 -14
- package/dist/esm/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/esm/lib/progress/fetch-progress.js +5 -10
- package/dist/esm/lib/progress/fetch-progress.js.map +1 -1
- package/dist/esm/lib/utils/log.js +1 -0
- package/dist/esm/lib/utils/log.js.map +1 -1
- package/dist/esm/lib/utils/mime-type-utils.js +4 -4
- package/dist/esm/lib/utils/mime-type-utils.js.map +1 -1
- package/dist/esm/lib/utils/resource-utils.js +2 -7
- package/dist/esm/lib/utils/resource-utils.js.map +1 -1
- package/dist/esm/lib/utils/response-utils.js +5 -18
- package/dist/esm/lib/utils/response-utils.js.map +1 -1
- package/dist/esm/null-loader.js +2 -1
- package/dist/esm/null-loader.js.map +1 -1
- package/dist/esm/workers/null-worker.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/iterators/make-iterator/make-iterator.d.ts +1 -1
- package/dist/iterators/make-iterator/make-iterator.d.ts.map +1 -1
- package/dist/iterators/make-iterator/make-stream-iterator.d.ts +1 -1
- package/dist/iterators/make-iterator/make-stream-iterator.d.ts.map +1 -1
- package/dist/iterators/make-stream/make-dom-stream.d.ts +1 -1
- package/dist/iterators/make-stream/make-dom-stream.d.ts.map +1 -1
- package/dist/iterators/make-stream/make-dom-stream.js +1 -1
- package/dist/iterators/make-stream/make-node-stream.d.ts +1 -1
- package/dist/iterators/make-stream/make-node-stream.d.ts.map +1 -1
- package/dist/javascript-utils/is-type.d.ts +1 -1
- package/dist/javascript-utils/is-type.d.ts.map +1 -1
- package/dist/lib/api/load-in-batches.d.ts +1 -1
- package/dist/lib/api/load-in-batches.d.ts.map +1 -1
- package/dist/lib/api/register-loaders.d.ts +1 -1
- package/dist/lib/api/register-loaders.d.ts.map +1 -1
- package/dist/lib/filesystems/browser-filesystem.d.ts +1 -1
- package/dist/lib/filesystems/browser-filesystem.d.ts.map +1 -1
- package/dist/lib/filesystems/filesystem.d.ts +2 -2
- package/dist/lib/filesystems/filesystem.d.ts.map +1 -1
- package/dist/lib/loader-utils/loggers.d.ts +2 -1
- package/dist/lib/loader-utils/loggers.d.ts.map +1 -1
- package/dist/lib/loader-utils/loggers.js +2 -2
- package/dist/lib/loader-utils/option-utils.d.ts +1 -1
- package/dist/lib/loader-utils/option-utils.d.ts.map +1 -1
- package/dist/null-worker.js +1 -1
- package/package.json +6 -7
- package/src/index.ts +17 -0
- package/src/iterators/make-stream/make-dom-stream.ts +1 -1
- package/src/lib/api/register-loaders.ts +1 -1
- package/src/lib/loader-utils/loggers.ts +1 -1
package/dist/dist.min.js
CHANGED
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
for (var name in all)
|
|
18
18
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
19
|
};
|
|
20
|
-
var __reExport = (target,
|
|
21
|
-
if (
|
|
22
|
-
for (let key of __getOwnPropNames(
|
|
20
|
+
var __reExport = (target, module, desc) => {
|
|
21
|
+
if (module && typeof module === "object" || typeof module === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(module))
|
|
23
23
|
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
24
|
-
__defProp(target, key, { get: () =>
|
|
24
|
+
__defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
|
|
25
25
|
}
|
|
26
26
|
return target;
|
|
27
27
|
};
|
|
28
|
-
var __toModule = (
|
|
29
|
-
return __reExport(__markAsModule(__defProp(
|
|
28
|
+
var __toModule = (module) => {
|
|
29
|
+
return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
// ../loader-utils/src/lib/env-utils/assert.ts
|
|
@@ -232,6 +232,22 @@
|
|
|
232
232
|
}
|
|
233
233
|
return false;
|
|
234
234
|
}
|
|
235
|
+
function getTransferListForWriter(object) {
|
|
236
|
+
if (object === null) {
|
|
237
|
+
return {};
|
|
238
|
+
}
|
|
239
|
+
const clone = Object.assign({}, object);
|
|
240
|
+
Object.keys(clone).forEach((key) => {
|
|
241
|
+
if (typeof object[key] === "object" && !ArrayBuffer.isView(object[key]) && !(object[key] instanceof Array)) {
|
|
242
|
+
clone[key] = getTransferListForWriter(object[key]);
|
|
243
|
+
} else if (typeof clone[key] === "function" || clone[key] instanceof RegExp) {
|
|
244
|
+
clone[key] = {};
|
|
245
|
+
} else {
|
|
246
|
+
clone[key] = object[key];
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
return clone;
|
|
250
|
+
}
|
|
235
251
|
var init_get_transfer_list = __esm({
|
|
236
252
|
"../worker-utils/src/lib/worker-utils/get-transfer-list.ts"() {
|
|
237
253
|
}
|
|
@@ -262,7 +278,7 @@
|
|
|
262
278
|
this.worker = isBrowser2 ? this._createBrowserWorker() : this._createNodeWorker();
|
|
263
279
|
}
|
|
264
280
|
static isSupported() {
|
|
265
|
-
return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !==
|
|
281
|
+
return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !== "undefined" && !isBrowser2;
|
|
266
282
|
}
|
|
267
283
|
destroy() {
|
|
268
284
|
this.onMessage = NOOP;
|
|
@@ -510,31 +526,6 @@
|
|
|
510
526
|
}
|
|
511
527
|
});
|
|
512
528
|
|
|
513
|
-
// ../worker-utils/src/lib/worker-utils/remove-nontransferable-options.ts
|
|
514
|
-
function removeNontransferableOptions(object) {
|
|
515
|
-
return JSON.parse(stringifyJSON(object));
|
|
516
|
-
}
|
|
517
|
-
function stringifyJSON(v) {
|
|
518
|
-
const cache3 = new Set();
|
|
519
|
-
return JSON.stringify(v, (key, value) => {
|
|
520
|
-
if (typeof value === "object" && value !== null) {
|
|
521
|
-
if (cache3.has(value)) {
|
|
522
|
-
try {
|
|
523
|
-
return JSON.parse(JSON.stringify(value));
|
|
524
|
-
} catch (err) {
|
|
525
|
-
return void 0;
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
cache3.add(value);
|
|
529
|
-
}
|
|
530
|
-
return value;
|
|
531
|
-
});
|
|
532
|
-
}
|
|
533
|
-
var init_remove_nontransferable_options = __esm({
|
|
534
|
-
"../worker-utils/src/lib/worker-utils/remove-nontransferable-options.ts"() {
|
|
535
|
-
}
|
|
536
|
-
});
|
|
537
|
-
|
|
538
529
|
// ../worker-utils/src/lib/worker-api/get-worker-url.ts
|
|
539
530
|
function getWorkerName(worker) {
|
|
540
531
|
const warning = worker.version !== VERSION2 ? ` (worker-utils@${VERSION2})` : "";
|
|
@@ -583,7 +574,7 @@
|
|
|
583
574
|
const workerPool = workerFarm.getWorkerPool(workerPoolProps);
|
|
584
575
|
const jobName = options.jobName || worker.name;
|
|
585
576
|
const job = await workerPool.startJob(jobName, onMessage.bind(null, context));
|
|
586
|
-
const transferableOptions =
|
|
577
|
+
const transferableOptions = getTransferListForWriter(options);
|
|
587
578
|
job.postMessage("process", { input: data, options: transferableOptions });
|
|
588
579
|
const result = await job.result;
|
|
589
580
|
return result.result;
|
|
@@ -617,8 +608,8 @@
|
|
|
617
608
|
var init_process_on_worker = __esm({
|
|
618
609
|
"../worker-utils/src/lib/worker-api/process-on-worker.ts"() {
|
|
619
610
|
init_worker_farm();
|
|
620
|
-
init_remove_nontransferable_options();
|
|
621
611
|
init_get_worker_url();
|
|
612
|
+
init_get_transfer_list();
|
|
622
613
|
}
|
|
623
614
|
});
|
|
624
615
|
|
|
@@ -1591,7 +1582,7 @@
|
|
|
1591
1582
|
}
|
|
1592
1583
|
});
|
|
1593
1584
|
|
|
1594
|
-
// ../../node_modules
|
|
1585
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
|
|
1595
1586
|
function isElectron(mockUserAgent) {
|
|
1596
1587
|
if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
|
|
1597
1588
|
return true;
|
|
@@ -1607,25 +1598,25 @@
|
|
|
1607
1598
|
return false;
|
|
1608
1599
|
}
|
|
1609
1600
|
var init_is_electron = __esm({
|
|
1610
|
-
"../../node_modules
|
|
1601
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
|
|
1611
1602
|
}
|
|
1612
1603
|
});
|
|
1613
1604
|
|
|
1614
|
-
// ../../node_modules
|
|
1605
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
|
|
1615
1606
|
function isBrowser3() {
|
|
1616
1607
|
const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
|
|
1617
1608
|
return !isNode || isElectron();
|
|
1618
1609
|
}
|
|
1619
1610
|
var init_is_browser = __esm({
|
|
1620
|
-
"../../node_modules
|
|
1611
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
|
|
1621
1612
|
init_is_electron();
|
|
1622
1613
|
}
|
|
1623
1614
|
});
|
|
1624
1615
|
|
|
1625
|
-
// ../../node_modules
|
|
1626
|
-
var globals3, self_3, window_3,
|
|
1616
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
|
|
1617
|
+
var globals3, self_3, window_3, document_3, process_;
|
|
1627
1618
|
var init_globals3 = __esm({
|
|
1628
|
-
"../../node_modules
|
|
1619
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
|
|
1629
1620
|
globals3 = {
|
|
1630
1621
|
self: typeof self !== "undefined" && self,
|
|
1631
1622
|
window: typeof window !== "undefined" && window,
|
|
@@ -1635,24 +1626,31 @@
|
|
|
1635
1626
|
};
|
|
1636
1627
|
self_3 = globals3.self || globals3.window || globals3.global;
|
|
1637
1628
|
window_3 = globals3.window || globals3.self || globals3.global;
|
|
1638
|
-
global_3 = globals3.global || globals3.self || globals3.window;
|
|
1639
1629
|
document_3 = globals3.document || {};
|
|
1640
1630
|
process_ = globals3.process || {};
|
|
1641
1631
|
}
|
|
1642
1632
|
});
|
|
1643
1633
|
|
|
1644
|
-
// ../../node_modules
|
|
1634
|
+
// ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
|
|
1645
1635
|
var VERSION4, isBrowser4;
|
|
1646
1636
|
var init_globals4 = __esm({
|
|
1647
|
-
"../../node_modules
|
|
1637
|
+
"../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
|
|
1648
1638
|
init_is_browser();
|
|
1649
|
-
init_globals3();
|
|
1650
1639
|
VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
1651
1640
|
isBrowser4 = isBrowser3();
|
|
1652
1641
|
}
|
|
1653
1642
|
});
|
|
1654
1643
|
|
|
1655
|
-
// ../../node_modules
|
|
1644
|
+
// ../../node_modules/@probe.gl/env/dist/esm/index.js
|
|
1645
|
+
var init_esm2 = __esm({
|
|
1646
|
+
"../../node_modules/@probe.gl/env/dist/esm/index.js"() {
|
|
1647
|
+
init_globals4();
|
|
1648
|
+
init_globals3();
|
|
1649
|
+
init_is_browser();
|
|
1650
|
+
}
|
|
1651
|
+
});
|
|
1652
|
+
|
|
1653
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
|
|
1656
1654
|
function getStorage(type) {
|
|
1657
1655
|
try {
|
|
1658
1656
|
const storage = window[type];
|
|
@@ -1666,9 +1664,15 @@
|
|
|
1666
1664
|
}
|
|
1667
1665
|
var LocalStorage;
|
|
1668
1666
|
var init_local_storage = __esm({
|
|
1669
|
-
"../../node_modules
|
|
1667
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
|
|
1668
|
+
init_defineProperty();
|
|
1670
1669
|
LocalStorage = class {
|
|
1671
|
-
constructor(id
|
|
1670
|
+
constructor(id) {
|
|
1671
|
+
let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1672
|
+
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
1673
|
+
_defineProperty(this, "storage", void 0);
|
|
1674
|
+
_defineProperty(this, "id", void 0);
|
|
1675
|
+
_defineProperty(this, "config", {});
|
|
1672
1676
|
this.storage = getStorage(type);
|
|
1673
1677
|
this.id = id;
|
|
1674
1678
|
this.config = {};
|
|
@@ -1703,7 +1707,7 @@
|
|
|
1703
1707
|
}
|
|
1704
1708
|
});
|
|
1705
1709
|
|
|
1706
|
-
// ../../node_modules
|
|
1710
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
|
|
1707
1711
|
function formatTime(ms) {
|
|
1708
1712
|
let formatted;
|
|
1709
1713
|
if (ms < 10) {
|
|
@@ -1717,11 +1721,13 @@
|
|
|
1717
1721
|
}
|
|
1718
1722
|
return formatted;
|
|
1719
1723
|
}
|
|
1720
|
-
function leftPad(string
|
|
1724
|
+
function leftPad(string) {
|
|
1725
|
+
let length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
1721
1726
|
const padLength = Math.max(length - string.length, 0);
|
|
1722
1727
|
return "".concat(" ".repeat(padLength)).concat(string);
|
|
1723
1728
|
}
|
|
1724
|
-
function formatImage(image, message, scale
|
|
1729
|
+
function formatImage(image, message, scale) {
|
|
1730
|
+
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
1725
1731
|
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
1726
1732
|
if (image.width > maxWidth) {
|
|
1727
1733
|
scale = Math.min(scale, maxWidth / image.width);
|
|
@@ -1732,16 +1738,16 @@
|
|
|
1732
1738
|
return ["".concat(message, " %c+"), style];
|
|
1733
1739
|
}
|
|
1734
1740
|
var init_formatters = __esm({
|
|
1735
|
-
"../../node_modules
|
|
1741
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
|
|
1736
1742
|
}
|
|
1737
1743
|
});
|
|
1738
1744
|
|
|
1739
|
-
// ../../node_modules
|
|
1745
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
|
|
1740
1746
|
function getColor(color) {
|
|
1741
1747
|
return typeof color === "string" ? COLOR[color.toUpperCase()] || COLOR.WHITE : color;
|
|
1742
1748
|
}
|
|
1743
1749
|
function addColor(string, color, background) {
|
|
1744
|
-
if (!
|
|
1750
|
+
if (!isBrowser3 && typeof string === "string") {
|
|
1745
1751
|
if (color) {
|
|
1746
1752
|
color = getColor(color);
|
|
1747
1753
|
string = "[".concat(color, "m").concat(string, "[39m");
|
|
@@ -1755,31 +1761,32 @@
|
|
|
1755
1761
|
}
|
|
1756
1762
|
var COLOR;
|
|
1757
1763
|
var init_color = __esm({
|
|
1758
|
-
"../../node_modules
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
BLACK
|
|
1762
|
-
RED
|
|
1763
|
-
GREEN
|
|
1764
|
-
YELLOW
|
|
1765
|
-
BLUE
|
|
1766
|
-
MAGENTA
|
|
1767
|
-
CYAN
|
|
1768
|
-
WHITE
|
|
1769
|
-
BRIGHT_BLACK
|
|
1770
|
-
BRIGHT_RED
|
|
1771
|
-
BRIGHT_GREEN
|
|
1772
|
-
BRIGHT_YELLOW
|
|
1773
|
-
BRIGHT_BLUE
|
|
1774
|
-
BRIGHT_MAGENTA
|
|
1775
|
-
BRIGHT_CYAN
|
|
1776
|
-
BRIGHT_WHITE
|
|
1777
|
-
};
|
|
1764
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
|
|
1765
|
+
init_esm2();
|
|
1766
|
+
(function(COLOR2) {
|
|
1767
|
+
COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
|
|
1768
|
+
COLOR2[COLOR2["RED"] = 31] = "RED";
|
|
1769
|
+
COLOR2[COLOR2["GREEN"] = 32] = "GREEN";
|
|
1770
|
+
COLOR2[COLOR2["YELLOW"] = 33] = "YELLOW";
|
|
1771
|
+
COLOR2[COLOR2["BLUE"] = 34] = "BLUE";
|
|
1772
|
+
COLOR2[COLOR2["MAGENTA"] = 35] = "MAGENTA";
|
|
1773
|
+
COLOR2[COLOR2["CYAN"] = 36] = "CYAN";
|
|
1774
|
+
COLOR2[COLOR2["WHITE"] = 37] = "WHITE";
|
|
1775
|
+
COLOR2[COLOR2["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
|
|
1776
|
+
COLOR2[COLOR2["BRIGHT_RED"] = 91] = "BRIGHT_RED";
|
|
1777
|
+
COLOR2[COLOR2["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
|
|
1778
|
+
COLOR2[COLOR2["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
|
|
1779
|
+
COLOR2[COLOR2["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
|
|
1780
|
+
COLOR2[COLOR2["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
|
|
1781
|
+
COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
|
|
1782
|
+
COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
|
|
1783
|
+
})(COLOR || (COLOR = {}));
|
|
1778
1784
|
}
|
|
1779
1785
|
});
|
|
1780
1786
|
|
|
1781
|
-
// ../../node_modules
|
|
1782
|
-
function autobind(obj
|
|
1787
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
|
|
1788
|
+
function autobind(obj) {
|
|
1789
|
+
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
1783
1790
|
const proto = Object.getPrototypeOf(obj);
|
|
1784
1791
|
const propNames = Object.getOwnPropertyNames(proto);
|
|
1785
1792
|
for (const key of propNames) {
|
|
@@ -1791,28 +1798,30 @@
|
|
|
1791
1798
|
}
|
|
1792
1799
|
}
|
|
1793
1800
|
var init_autobind = __esm({
|
|
1794
|
-
"../../node_modules
|
|
1801
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
|
|
1795
1802
|
}
|
|
1796
1803
|
});
|
|
1797
1804
|
|
|
1798
|
-
// ../../node_modules
|
|
1805
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
|
|
1799
1806
|
function assert3(condition, message) {
|
|
1800
1807
|
if (!condition) {
|
|
1801
1808
|
throw new Error(message || "Assertion failed");
|
|
1802
1809
|
}
|
|
1803
1810
|
}
|
|
1804
1811
|
var init_assert3 = __esm({
|
|
1805
|
-
"../../node_modules
|
|
1812
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
|
|
1806
1813
|
}
|
|
1807
1814
|
});
|
|
1808
1815
|
|
|
1809
|
-
// ../../node_modules
|
|
1816
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
|
|
1810
1817
|
function getHiResTimestamp2() {
|
|
1811
1818
|
let timestamp;
|
|
1812
|
-
if (
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1819
|
+
if (isBrowser3 && "performance" in window_3) {
|
|
1820
|
+
var _window$performance, _window$performance$n;
|
|
1821
|
+
timestamp = window_3 === null || window_3 === void 0 ? void 0 : (_window$performance = window_3.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
|
|
1822
|
+
} else if ("hrtime" in process_) {
|
|
1823
|
+
var _process$hrtime;
|
|
1824
|
+
const timeParts = process_ === null || process_ === void 0 ? void 0 : (_process$hrtime = process_.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_);
|
|
1816
1825
|
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
1817
1826
|
} else {
|
|
1818
1827
|
timestamp = Date.now();
|
|
@@ -1820,21 +1829,19 @@
|
|
|
1820
1829
|
return timestamp;
|
|
1821
1830
|
}
|
|
1822
1831
|
var init_hi_res_timestamp2 = __esm({
|
|
1823
|
-
"../../node_modules
|
|
1824
|
-
|
|
1832
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
|
|
1833
|
+
init_esm2();
|
|
1825
1834
|
}
|
|
1826
1835
|
});
|
|
1827
1836
|
|
|
1828
|
-
//
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
function getTableHeader(table) {
|
|
1832
|
-
for (const key in table) {
|
|
1833
|
-
for (const title in table[key]) {
|
|
1834
|
-
return title || "untitled";
|
|
1835
|
-
}
|
|
1837
|
+
// (disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image
|
|
1838
|
+
var init_node_asciify_image = __esm({
|
|
1839
|
+
"(disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image"() {
|
|
1836
1840
|
}
|
|
1837
|
-
|
|
1841
|
+
});
|
|
1842
|
+
|
|
1843
|
+
// ../../node_modules/@probe.gl/log/dist/esm/log.js
|
|
1844
|
+
function noop() {
|
|
1838
1845
|
}
|
|
1839
1846
|
function normalizeLogLevel(logLevel) {
|
|
1840
1847
|
if (!logLevel) {
|
|
@@ -1863,7 +1870,6 @@
|
|
|
1863
1870
|
const args = opts.args ? Array.from(opts.args) : [];
|
|
1864
1871
|
while (args.length && args.shift() !== message) {
|
|
1865
1872
|
}
|
|
1866
|
-
opts.args = args;
|
|
1867
1873
|
switch (typeof logLevel) {
|
|
1868
1874
|
case "string":
|
|
1869
1875
|
case "function":
|
|
@@ -1882,7 +1888,9 @@
|
|
|
1882
1888
|
}
|
|
1883
1889
|
const messageType = typeof opts.message;
|
|
1884
1890
|
assert3(messageType === "string" || messageType === "object");
|
|
1885
|
-
return Object.assign(opts,
|
|
1891
|
+
return Object.assign(opts, {
|
|
1892
|
+
args
|
|
1893
|
+
}, opts.opts);
|
|
1886
1894
|
}
|
|
1887
1895
|
function decorateMessage(id, message, opts) {
|
|
1888
1896
|
if (typeof message === "string") {
|
|
@@ -1892,29 +1900,25 @@
|
|
|
1892
1900
|
}
|
|
1893
1901
|
return message;
|
|
1894
1902
|
}
|
|
1895
|
-
function logImageInNode({
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
return () => asciify(image, {
|
|
1907
|
-
fit: "box",
|
|
1908
|
-
width: "".concat(Math.round(80 * scale), "%")
|
|
1909
|
-
}).then((data) => console.log(data));
|
|
1910
|
-
}
|
|
1903
|
+
function logImageInNode(_ref2) {
|
|
1904
|
+
let {
|
|
1905
|
+
image,
|
|
1906
|
+
message = "",
|
|
1907
|
+
scale = 1
|
|
1908
|
+
} = _ref2;
|
|
1909
|
+
asciify.nodeAsciifyImage({
|
|
1910
|
+
image,
|
|
1911
|
+
message,
|
|
1912
|
+
scale
|
|
1913
|
+
});
|
|
1911
1914
|
return noop;
|
|
1912
1915
|
}
|
|
1913
|
-
function logImageInBrowser({
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1916
|
+
function logImageInBrowser(_ref3) {
|
|
1917
|
+
let {
|
|
1918
|
+
image,
|
|
1919
|
+
message = "",
|
|
1920
|
+
scale = 1
|
|
1921
|
+
} = _ref3;
|
|
1918
1922
|
if (typeof image === "string") {
|
|
1919
1923
|
const img = new Image();
|
|
1920
1924
|
img.onload = () => {
|
|
@@ -1937,18 +1941,28 @@
|
|
|
1937
1941
|
}
|
|
1938
1942
|
return noop;
|
|
1939
1943
|
}
|
|
1944
|
+
function getTableHeader(table) {
|
|
1945
|
+
for (const key in table) {
|
|
1946
|
+
for (const title in table[key]) {
|
|
1947
|
+
return title || "untitled";
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
return "empty";
|
|
1951
|
+
}
|
|
1940
1952
|
var originalConsole, DEFAULT_SETTINGS, cache, ONCE, Log;
|
|
1941
1953
|
var init_log = __esm({
|
|
1942
|
-
"../../node_modules
|
|
1943
|
-
|
|
1954
|
+
"../../node_modules/@probe.gl/log/dist/esm/log.js"() {
|
|
1955
|
+
init_defineProperty();
|
|
1956
|
+
init_esm2();
|
|
1944
1957
|
init_local_storage();
|
|
1945
1958
|
init_formatters();
|
|
1946
1959
|
init_color();
|
|
1947
1960
|
init_autobind();
|
|
1948
1961
|
init_assert3();
|
|
1949
1962
|
init_hi_res_timestamp2();
|
|
1963
|
+
init_node_asciify_image();
|
|
1950
1964
|
originalConsole = {
|
|
1951
|
-
debug:
|
|
1965
|
+
debug: isBrowser3 ? console.debug || console.log : console.log,
|
|
1952
1966
|
log: console.log,
|
|
1953
1967
|
info: console.info,
|
|
1954
1968
|
warn: console.warn,
|
|
@@ -1963,16 +1977,20 @@
|
|
|
1963
1977
|
once: true
|
|
1964
1978
|
};
|
|
1965
1979
|
Log = class {
|
|
1966
|
-
constructor({
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1980
|
+
constructor() {
|
|
1981
|
+
let {
|
|
1982
|
+
id
|
|
1983
|
+
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
1984
|
+
id: ""
|
|
1985
|
+
};
|
|
1986
|
+
_defineProperty(this, "id", void 0);
|
|
1987
|
+
_defineProperty(this, "VERSION", VERSION4);
|
|
1988
|
+
_defineProperty(this, "_startTs", getHiResTimestamp2());
|
|
1989
|
+
_defineProperty(this, "_deltaTs", getHiResTimestamp2());
|
|
1990
|
+
_defineProperty(this, "_storage", void 0);
|
|
1991
|
+
_defineProperty(this, "userData", {});
|
|
1992
|
+
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
1971
1993
|
this.id = id;
|
|
1972
|
-
this.VERSION = VERSION4;
|
|
1973
|
-
this._startTs = getHiResTimestamp2();
|
|
1974
|
-
this._deltaTs = getHiResTimestamp2();
|
|
1975
|
-
this.LOG_THROTTLE_TIMEOUT = 0;
|
|
1976
1994
|
this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS);
|
|
1977
1995
|
this.userData = {};
|
|
1978
1996
|
this.timeStamp("".concat(this.id, " started"));
|
|
@@ -2006,7 +2024,8 @@
|
|
|
2006
2024
|
getPriority() {
|
|
2007
2025
|
return this.level;
|
|
2008
2026
|
}
|
|
2009
|
-
enable(
|
|
2027
|
+
enable() {
|
|
2028
|
+
let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
2010
2029
|
this._storage.updateConfiguration({
|
|
2011
2030
|
enabled
|
|
2012
2031
|
});
|
|
@@ -2018,6 +2037,21 @@
|
|
|
2018
2037
|
});
|
|
2019
2038
|
return this;
|
|
2020
2039
|
}
|
|
2040
|
+
get(setting) {
|
|
2041
|
+
return this._storage.config[setting];
|
|
2042
|
+
}
|
|
2043
|
+
set(setting, value) {
|
|
2044
|
+
this._storage.updateConfiguration({
|
|
2045
|
+
[setting]: value
|
|
2046
|
+
});
|
|
2047
|
+
}
|
|
2048
|
+
settings() {
|
|
2049
|
+
if (console.table) {
|
|
2050
|
+
console.table(this._storage.config);
|
|
2051
|
+
} else {
|
|
2052
|
+
console.log(this._storage.config);
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2021
2055
|
assert(condition, message) {
|
|
2022
2056
|
assert3(condition, message);
|
|
2023
2057
|
}
|
|
@@ -2046,6 +2080,9 @@
|
|
|
2046
2080
|
return this._getLogFunction(logLevel, message, console.info, arguments);
|
|
2047
2081
|
}
|
|
2048
2082
|
once(logLevel, message) {
|
|
2083
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
2084
|
+
args[_key - 2] = arguments[_key];
|
|
2085
|
+
}
|
|
2049
2086
|
return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
|
|
2050
2087
|
}
|
|
2051
2088
|
table(logLevel, table, columns) {
|
|
@@ -2056,17 +2093,18 @@
|
|
|
2056
2093
|
}
|
|
2057
2094
|
return noop;
|
|
2058
2095
|
}
|
|
2059
|
-
image({
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2096
|
+
image(_ref) {
|
|
2097
|
+
let {
|
|
2098
|
+
logLevel,
|
|
2099
|
+
priority,
|
|
2100
|
+
image,
|
|
2101
|
+
message = "",
|
|
2102
|
+
scale = 1
|
|
2103
|
+
} = _ref;
|
|
2066
2104
|
if (!this._shouldLog(logLevel || priority)) {
|
|
2067
2105
|
return noop;
|
|
2068
2106
|
}
|
|
2069
|
-
return
|
|
2107
|
+
return isBrowser3 ? logImageInBrowser({
|
|
2070
2108
|
image,
|
|
2071
2109
|
message,
|
|
2072
2110
|
scale
|
|
@@ -2076,21 +2114,6 @@
|
|
|
2076
2114
|
scale
|
|
2077
2115
|
});
|
|
2078
2116
|
}
|
|
2079
|
-
settings() {
|
|
2080
|
-
if (console.table) {
|
|
2081
|
-
console.table(this._storage.config);
|
|
2082
|
-
} else {
|
|
2083
|
-
console.log(this._storage.config);
|
|
2084
|
-
}
|
|
2085
|
-
}
|
|
2086
|
-
get(setting) {
|
|
2087
|
-
return this._storage.config[setting];
|
|
2088
|
-
}
|
|
2089
|
-
set(setting, value) {
|
|
2090
|
-
this._storage.updateConfiguration({
|
|
2091
|
-
[setting]: value
|
|
2092
|
-
});
|
|
2093
|
-
}
|
|
2094
2117
|
time(logLevel, message) {
|
|
2095
2118
|
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
2096
2119
|
}
|
|
@@ -2100,10 +2123,11 @@
|
|
|
2100
2123
|
timeStamp(logLevel, message) {
|
|
2101
2124
|
return this._getLogFunction(logLevel, message, console.timeStamp || noop);
|
|
2102
2125
|
}
|
|
2103
|
-
group(logLevel, message
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2126
|
+
group(logLevel, message) {
|
|
2127
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
2128
|
+
collapsed: false
|
|
2129
|
+
};
|
|
2130
|
+
const options = normalizeArguments({
|
|
2107
2131
|
logLevel,
|
|
2108
2132
|
message,
|
|
2109
2133
|
opts
|
|
@@ -2111,10 +2135,11 @@
|
|
|
2111
2135
|
const {
|
|
2112
2136
|
collapsed
|
|
2113
2137
|
} = opts;
|
|
2114
|
-
|
|
2115
|
-
return this._getLogFunction(
|
|
2138
|
+
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
2139
|
+
return this._getLogFunction(options);
|
|
2116
2140
|
}
|
|
2117
|
-
groupCollapsed(logLevel, message
|
|
2141
|
+
groupCollapsed(logLevel, message) {
|
|
2142
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2118
2143
|
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
2119
2144
|
collapsed: true
|
|
2120
2145
|
}));
|
|
@@ -2138,7 +2163,7 @@
|
|
|
2138
2163
|
_shouldLog(logLevel) {
|
|
2139
2164
|
return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);
|
|
2140
2165
|
}
|
|
2141
|
-
_getLogFunction(logLevel, message, method, args
|
|
2166
|
+
_getLogFunction(logLevel, message, method, args, opts) {
|
|
2142
2167
|
if (this._shouldLog(logLevel)) {
|
|
2143
2168
|
opts = normalizeArguments({
|
|
2144
2169
|
logLevel,
|
|
@@ -2165,48 +2190,18 @@
|
|
|
2165
2190
|
return noop;
|
|
2166
2191
|
}
|
|
2167
2192
|
};
|
|
2168
|
-
Log
|
|
2169
|
-
}
|
|
2170
|
-
});
|
|
2171
|
-
|
|
2172
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
|
|
2173
|
-
var init_hi_res_timestamp3 = __esm({
|
|
2174
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js"() {
|
|
2175
|
-
}
|
|
2176
|
-
});
|
|
2177
|
-
|
|
2178
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js
|
|
2179
|
-
var init_stat2 = __esm({
|
|
2180
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js"() {
|
|
2181
|
-
init_hi_res_timestamp3();
|
|
2182
|
-
}
|
|
2183
|
-
});
|
|
2184
|
-
|
|
2185
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js
|
|
2186
|
-
var init_stats2 = __esm({
|
|
2187
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js"() {
|
|
2188
|
-
init_stat2();
|
|
2193
|
+
_defineProperty(Log, "VERSION", VERSION4);
|
|
2189
2194
|
}
|
|
2190
2195
|
});
|
|
2191
2196
|
|
|
2192
|
-
// ../../node_modules
|
|
2193
|
-
var init_esm2 = __esm({
|
|
2194
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js"() {
|
|
2195
|
-
init_stats2();
|
|
2196
|
-
init_stat2();
|
|
2197
|
-
init_hi_res_timestamp3();
|
|
2198
|
-
}
|
|
2199
|
-
});
|
|
2200
|
-
|
|
2201
|
-
// ../../node_modules/probe.gl/dist/esm/index.js
|
|
2197
|
+
// ../../node_modules/@probe.gl/log/dist/esm/index.js
|
|
2202
2198
|
var esm_default;
|
|
2203
2199
|
var init_esm3 = __esm({
|
|
2204
|
-
"../../node_modules
|
|
2200
|
+
"../../node_modules/@probe.gl/log/dist/esm/index.js"() {
|
|
2205
2201
|
init_log();
|
|
2206
2202
|
init_log();
|
|
2207
|
-
init_esm2();
|
|
2208
2203
|
esm_default = new Log({
|
|
2209
|
-
id: "probe.gl"
|
|
2204
|
+
id: "@probe.gl/log"
|
|
2210
2205
|
});
|
|
2211
2206
|
}
|
|
2212
2207
|
});
|
|
@@ -2497,658 +2492,35 @@
|
|
|
2497
2492
|
}
|
|
2498
2493
|
});
|
|
2499
2494
|
|
|
2500
|
-
//
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
return true;
|
|
2507
|
-
}
|
|
2508
|
-
const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
|
|
2509
|
-
const userAgent = mockUserAgent || realUserAgent;
|
|
2510
|
-
if (userAgent && userAgent.indexOf("Electron") >= 0) {
|
|
2511
|
-
return true;
|
|
2512
|
-
}
|
|
2513
|
-
return false;
|
|
2514
|
-
}
|
|
2515
|
-
var init_is_electron2 = __esm({
|
|
2516
|
-
"../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
|
|
2495
|
+
// src/lib/utils/log.ts
|
|
2496
|
+
var log;
|
|
2497
|
+
var init_log2 = __esm({
|
|
2498
|
+
"src/lib/utils/log.ts"() {
|
|
2499
|
+
init_esm3();
|
|
2500
|
+
log = new Log({ id: "loaders.gl" });
|
|
2517
2501
|
}
|
|
2518
2502
|
});
|
|
2519
2503
|
|
|
2520
|
-
//
|
|
2521
|
-
function
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
}
|
|
2525
|
-
var init_is_browser2 = __esm({
|
|
2526
|
-
"../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
|
|
2527
|
-
init_is_electron2();
|
|
2504
|
+
// src/lib/api/select-loader.ts
|
|
2505
|
+
async function selectLoader(data, loaders = [], options, context) {
|
|
2506
|
+
if (!validHTTPResponse(data)) {
|
|
2507
|
+
return null;
|
|
2528
2508
|
}
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
var globals4, self_4, window_4, document_4, process_2;
|
|
2533
|
-
var init_globals5 = __esm({
|
|
2534
|
-
"../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
|
|
2535
|
-
globals4 = {
|
|
2536
|
-
self: typeof self !== "undefined" && self,
|
|
2537
|
-
window: typeof window !== "undefined" && window,
|
|
2538
|
-
global: typeof global !== "undefined" && global,
|
|
2539
|
-
document: typeof document !== "undefined" && document,
|
|
2540
|
-
process: typeof process === "object" && process
|
|
2541
|
-
};
|
|
2542
|
-
self_4 = globals4.self || globals4.window || globals4.global;
|
|
2543
|
-
window_4 = globals4.window || globals4.self || globals4.global;
|
|
2544
|
-
document_4 = globals4.document || {};
|
|
2545
|
-
process_2 = globals4.process || {};
|
|
2509
|
+
let loader = selectLoaderSync(data, loaders, { ...options, nothrow: true }, context);
|
|
2510
|
+
if (loader) {
|
|
2511
|
+
return loader;
|
|
2546
2512
|
}
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
var VERSION5, isBrowser6;
|
|
2551
|
-
var init_globals6 = __esm({
|
|
2552
|
-
"../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
|
|
2553
|
-
init_is_browser2();
|
|
2554
|
-
VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
2555
|
-
isBrowser6 = isBrowser5();
|
|
2513
|
+
if (isBlob(data)) {
|
|
2514
|
+
data = await data.slice(0, 10).arrayBuffer();
|
|
2515
|
+
loader = selectLoaderSync(data, loaders, options, context);
|
|
2556
2516
|
}
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
// ../../node_modules/@probe.gl/env/dist/esm/index.js
|
|
2560
|
-
var init_esm4 = __esm({
|
|
2561
|
-
"../../node_modules/@probe.gl/env/dist/esm/index.js"() {
|
|
2562
|
-
init_globals6();
|
|
2563
|
-
init_globals5();
|
|
2564
|
-
init_is_browser2();
|
|
2517
|
+
if (!loader && !options?.nothrow) {
|
|
2518
|
+
throw new Error(getNoValidLoaderMessage(data));
|
|
2565
2519
|
}
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
try {
|
|
2571
|
-
const storage = window[type];
|
|
2572
|
-
const x = "__storage_test__";
|
|
2573
|
-
storage.setItem(x, x);
|
|
2574
|
-
storage.removeItem(x);
|
|
2575
|
-
return storage;
|
|
2576
|
-
} catch (e) {
|
|
2577
|
-
return null;
|
|
2578
|
-
}
|
|
2579
|
-
}
|
|
2580
|
-
var LocalStorage2;
|
|
2581
|
-
var init_local_storage2 = __esm({
|
|
2582
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
|
|
2583
|
-
init_defineProperty();
|
|
2584
|
-
LocalStorage2 = class {
|
|
2585
|
-
constructor(id) {
|
|
2586
|
-
let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2587
|
-
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
2588
|
-
_defineProperty(this, "storage", void 0);
|
|
2589
|
-
_defineProperty(this, "id", void 0);
|
|
2590
|
-
_defineProperty(this, "config", {});
|
|
2591
|
-
this.storage = getStorage2(type);
|
|
2592
|
-
this.id = id;
|
|
2593
|
-
this.config = {};
|
|
2594
|
-
Object.assign(this.config, defaultSettings);
|
|
2595
|
-
this._loadConfiguration();
|
|
2596
|
-
}
|
|
2597
|
-
getConfiguration() {
|
|
2598
|
-
return this.config;
|
|
2599
|
-
}
|
|
2600
|
-
setConfiguration(configuration) {
|
|
2601
|
-
this.config = {};
|
|
2602
|
-
return this.updateConfiguration(configuration);
|
|
2603
|
-
}
|
|
2604
|
-
updateConfiguration(configuration) {
|
|
2605
|
-
Object.assign(this.config, configuration);
|
|
2606
|
-
if (this.storage) {
|
|
2607
|
-
const serialized = JSON.stringify(this.config);
|
|
2608
|
-
this.storage.setItem(this.id, serialized);
|
|
2609
|
-
}
|
|
2610
|
-
return this;
|
|
2611
|
-
}
|
|
2612
|
-
_loadConfiguration() {
|
|
2613
|
-
let configuration = {};
|
|
2614
|
-
if (this.storage) {
|
|
2615
|
-
const serializedConfiguration = this.storage.getItem(this.id);
|
|
2616
|
-
configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};
|
|
2617
|
-
}
|
|
2618
|
-
Object.assign(this.config, configuration);
|
|
2619
|
-
return this;
|
|
2620
|
-
}
|
|
2621
|
-
};
|
|
2622
|
-
}
|
|
2623
|
-
});
|
|
2624
|
-
|
|
2625
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
|
|
2626
|
-
function formatTime2(ms) {
|
|
2627
|
-
let formatted;
|
|
2628
|
-
if (ms < 10) {
|
|
2629
|
-
formatted = "".concat(ms.toFixed(2), "ms");
|
|
2630
|
-
} else if (ms < 100) {
|
|
2631
|
-
formatted = "".concat(ms.toFixed(1), "ms");
|
|
2632
|
-
} else if (ms < 1e3) {
|
|
2633
|
-
formatted = "".concat(ms.toFixed(0), "ms");
|
|
2634
|
-
} else {
|
|
2635
|
-
formatted = "".concat((ms / 1e3).toFixed(2), "s");
|
|
2636
|
-
}
|
|
2637
|
-
return formatted;
|
|
2638
|
-
}
|
|
2639
|
-
function leftPad2(string) {
|
|
2640
|
-
let length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
2641
|
-
const padLength = Math.max(length - string.length, 0);
|
|
2642
|
-
return "".concat(" ".repeat(padLength)).concat(string);
|
|
2643
|
-
}
|
|
2644
|
-
function formatImage2(image, message, scale) {
|
|
2645
|
-
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
2646
|
-
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
2647
|
-
if (image.width > maxWidth) {
|
|
2648
|
-
scale = Math.min(scale, maxWidth / image.width);
|
|
2649
|
-
}
|
|
2650
|
-
const width = image.width * scale;
|
|
2651
|
-
const height = image.height * scale;
|
|
2652
|
-
const style = ["font-size:1px;", "padding:".concat(Math.floor(height / 2), "px ").concat(Math.floor(width / 2), "px;"), "line-height:".concat(height, "px;"), "background:url(".concat(imageUrl, ");"), "background-size:".concat(width, "px ").concat(height, "px;"), "color:transparent;"].join("");
|
|
2653
|
-
return ["".concat(message, " %c+"), style];
|
|
2654
|
-
}
|
|
2655
|
-
var init_formatters2 = __esm({
|
|
2656
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
|
|
2657
|
-
}
|
|
2658
|
-
});
|
|
2659
|
-
|
|
2660
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
|
|
2661
|
-
function getColor2(color) {
|
|
2662
|
-
return typeof color === "string" ? COLOR2[color.toUpperCase()] || COLOR2.WHITE : color;
|
|
2663
|
-
}
|
|
2664
|
-
function addColor2(string, color, background) {
|
|
2665
|
-
if (!isBrowser5 && typeof string === "string") {
|
|
2666
|
-
if (color) {
|
|
2667
|
-
color = getColor2(color);
|
|
2668
|
-
string = "[".concat(color, "m").concat(string, "[39m");
|
|
2669
|
-
}
|
|
2670
|
-
if (background) {
|
|
2671
|
-
color = getColor2(background);
|
|
2672
|
-
string = "[".concat(background + 10, "m").concat(string, "[49m");
|
|
2673
|
-
}
|
|
2674
|
-
}
|
|
2675
|
-
return string;
|
|
2676
|
-
}
|
|
2677
|
-
var COLOR2;
|
|
2678
|
-
var init_color2 = __esm({
|
|
2679
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
|
|
2680
|
-
init_esm4();
|
|
2681
|
-
(function(COLOR3) {
|
|
2682
|
-
COLOR3[COLOR3["BLACK"] = 30] = "BLACK";
|
|
2683
|
-
COLOR3[COLOR3["RED"] = 31] = "RED";
|
|
2684
|
-
COLOR3[COLOR3["GREEN"] = 32] = "GREEN";
|
|
2685
|
-
COLOR3[COLOR3["YELLOW"] = 33] = "YELLOW";
|
|
2686
|
-
COLOR3[COLOR3["BLUE"] = 34] = "BLUE";
|
|
2687
|
-
COLOR3[COLOR3["MAGENTA"] = 35] = "MAGENTA";
|
|
2688
|
-
COLOR3[COLOR3["CYAN"] = 36] = "CYAN";
|
|
2689
|
-
COLOR3[COLOR3["WHITE"] = 37] = "WHITE";
|
|
2690
|
-
COLOR3[COLOR3["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
|
|
2691
|
-
COLOR3[COLOR3["BRIGHT_RED"] = 91] = "BRIGHT_RED";
|
|
2692
|
-
COLOR3[COLOR3["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
|
|
2693
|
-
COLOR3[COLOR3["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
|
|
2694
|
-
COLOR3[COLOR3["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
|
|
2695
|
-
COLOR3[COLOR3["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
|
|
2696
|
-
COLOR3[COLOR3["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
|
|
2697
|
-
COLOR3[COLOR3["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
|
|
2698
|
-
})(COLOR2 || (COLOR2 = {}));
|
|
2699
|
-
}
|
|
2700
|
-
});
|
|
2701
|
-
|
|
2702
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
|
|
2703
|
-
function autobind2(obj) {
|
|
2704
|
-
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
2705
|
-
const proto = Object.getPrototypeOf(obj);
|
|
2706
|
-
const propNames = Object.getOwnPropertyNames(proto);
|
|
2707
|
-
for (const key of propNames) {
|
|
2708
|
-
if (typeof obj[key] === "function") {
|
|
2709
|
-
if (!predefined.find((name) => key === name)) {
|
|
2710
|
-
obj[key] = obj[key].bind(obj);
|
|
2711
|
-
}
|
|
2712
|
-
}
|
|
2713
|
-
}
|
|
2714
|
-
}
|
|
2715
|
-
var init_autobind2 = __esm({
|
|
2716
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
|
|
2717
|
-
}
|
|
2718
|
-
});
|
|
2719
|
-
|
|
2720
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
|
|
2721
|
-
function assert4(condition, message) {
|
|
2722
|
-
if (!condition) {
|
|
2723
|
-
throw new Error(message || "Assertion failed");
|
|
2724
|
-
}
|
|
2725
|
-
}
|
|
2726
|
-
var init_assert4 = __esm({
|
|
2727
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
|
|
2728
|
-
}
|
|
2729
|
-
});
|
|
2730
|
-
|
|
2731
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
|
|
2732
|
-
function getHiResTimestamp4() {
|
|
2733
|
-
let timestamp;
|
|
2734
|
-
if (isBrowser5 && "performance" in window_4) {
|
|
2735
|
-
var _window$performance, _window$performance$n;
|
|
2736
|
-
timestamp = window_4 === null || window_4 === void 0 ? void 0 : (_window$performance = window_4.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
|
|
2737
|
-
} else if ("hrtime" in process_2) {
|
|
2738
|
-
var _process$hrtime;
|
|
2739
|
-
const timeParts = process_2 === null || process_2 === void 0 ? void 0 : (_process$hrtime = process_2.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_2);
|
|
2740
|
-
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
2741
|
-
} else {
|
|
2742
|
-
timestamp = Date.now();
|
|
2743
|
-
}
|
|
2744
|
-
return timestamp;
|
|
2745
|
-
}
|
|
2746
|
-
var init_hi_res_timestamp4 = __esm({
|
|
2747
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
|
|
2748
|
-
init_esm4();
|
|
2749
|
-
}
|
|
2750
|
-
});
|
|
2751
|
-
|
|
2752
|
-
// ../../node_modules/@probe.gl/log/dist/esm/log.js
|
|
2753
|
-
function noop2() {
|
|
2754
|
-
}
|
|
2755
|
-
function normalizeLogLevel2(logLevel) {
|
|
2756
|
-
if (!logLevel) {
|
|
2757
|
-
return 0;
|
|
2758
|
-
}
|
|
2759
|
-
let resolvedLevel;
|
|
2760
|
-
switch (typeof logLevel) {
|
|
2761
|
-
case "number":
|
|
2762
|
-
resolvedLevel = logLevel;
|
|
2763
|
-
break;
|
|
2764
|
-
case "object":
|
|
2765
|
-
resolvedLevel = logLevel.logLevel || logLevel.priority || 0;
|
|
2766
|
-
break;
|
|
2767
|
-
default:
|
|
2768
|
-
return 0;
|
|
2769
|
-
}
|
|
2770
|
-
assert4(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
|
|
2771
|
-
return resolvedLevel;
|
|
2772
|
-
}
|
|
2773
|
-
function normalizeArguments2(opts) {
|
|
2774
|
-
const {
|
|
2775
|
-
logLevel,
|
|
2776
|
-
message
|
|
2777
|
-
} = opts;
|
|
2778
|
-
opts.logLevel = normalizeLogLevel2(logLevel);
|
|
2779
|
-
const args = opts.args ? Array.from(opts.args) : [];
|
|
2780
|
-
while (args.length && args.shift() !== message) {
|
|
2781
|
-
}
|
|
2782
|
-
switch (typeof logLevel) {
|
|
2783
|
-
case "string":
|
|
2784
|
-
case "function":
|
|
2785
|
-
if (message !== void 0) {
|
|
2786
|
-
args.unshift(message);
|
|
2787
|
-
}
|
|
2788
|
-
opts.message = logLevel;
|
|
2789
|
-
break;
|
|
2790
|
-
case "object":
|
|
2791
|
-
Object.assign(opts, logLevel);
|
|
2792
|
-
break;
|
|
2793
|
-
default:
|
|
2794
|
-
}
|
|
2795
|
-
if (typeof opts.message === "function") {
|
|
2796
|
-
opts.message = opts.message();
|
|
2797
|
-
}
|
|
2798
|
-
const messageType = typeof opts.message;
|
|
2799
|
-
assert4(messageType === "string" || messageType === "object");
|
|
2800
|
-
return Object.assign(opts, {
|
|
2801
|
-
args
|
|
2802
|
-
}, opts.opts);
|
|
2803
|
-
}
|
|
2804
|
-
function decorateMessage2(id, message, opts) {
|
|
2805
|
-
if (typeof message === "string") {
|
|
2806
|
-
const time = opts.time ? leftPad2(formatTime2(opts.total)) : "";
|
|
2807
|
-
message = opts.time ? "".concat(id, ": ").concat(time, " ").concat(message) : "".concat(id, ": ").concat(message);
|
|
2808
|
-
message = addColor2(message, opts.color, opts.background);
|
|
2809
|
-
}
|
|
2810
|
-
return message;
|
|
2811
|
-
}
|
|
2812
|
-
function logImageInNode2(_ref2) {
|
|
2813
|
-
let {
|
|
2814
|
-
image,
|
|
2815
|
-
message = "",
|
|
2816
|
-
scale = 1
|
|
2817
|
-
} = _ref2;
|
|
2818
|
-
let asciify = null;
|
|
2819
|
-
try {
|
|
2820
|
-
asciify = module.require("asciify-image");
|
|
2821
|
-
} catch (error) {
|
|
2822
|
-
}
|
|
2823
|
-
if (asciify) {
|
|
2824
|
-
return () => asciify(image, {
|
|
2825
|
-
fit: "box",
|
|
2826
|
-
width: "".concat(Math.round(80 * scale), "%")
|
|
2827
|
-
}).then((data) => console.log(data));
|
|
2828
|
-
}
|
|
2829
|
-
return noop2;
|
|
2830
|
-
}
|
|
2831
|
-
function logImageInBrowser2(_ref3) {
|
|
2832
|
-
let {
|
|
2833
|
-
image,
|
|
2834
|
-
message = "",
|
|
2835
|
-
scale = 1
|
|
2836
|
-
} = _ref3;
|
|
2837
|
-
if (typeof image === "string") {
|
|
2838
|
-
const img = new Image();
|
|
2839
|
-
img.onload = () => {
|
|
2840
|
-
const args = formatImage2(img, message, scale);
|
|
2841
|
-
console.log(...args);
|
|
2842
|
-
};
|
|
2843
|
-
img.src = image;
|
|
2844
|
-
return noop2;
|
|
2845
|
-
}
|
|
2846
|
-
const element = image.nodeName || "";
|
|
2847
|
-
if (element.toLowerCase() === "img") {
|
|
2848
|
-
console.log(...formatImage2(image, message, scale));
|
|
2849
|
-
return noop2;
|
|
2850
|
-
}
|
|
2851
|
-
if (element.toLowerCase() === "canvas") {
|
|
2852
|
-
const img = new Image();
|
|
2853
|
-
img.onload = () => console.log(...formatImage2(img, message, scale));
|
|
2854
|
-
img.src = image.toDataURL();
|
|
2855
|
-
return noop2;
|
|
2856
|
-
}
|
|
2857
|
-
return noop2;
|
|
2858
|
-
}
|
|
2859
|
-
function getTableHeader2(table) {
|
|
2860
|
-
for (const key in table) {
|
|
2861
|
-
for (const title in table[key]) {
|
|
2862
|
-
return title || "untitled";
|
|
2863
|
-
}
|
|
2864
|
-
}
|
|
2865
|
-
return "empty";
|
|
2866
|
-
}
|
|
2867
|
-
var originalConsole2, DEFAULT_SETTINGS2, cache2, ONCE2, Log2;
|
|
2868
|
-
var init_log2 = __esm({
|
|
2869
|
-
"../../node_modules/@probe.gl/log/dist/esm/log.js"() {
|
|
2870
|
-
init_defineProperty();
|
|
2871
|
-
init_esm4();
|
|
2872
|
-
init_local_storage2();
|
|
2873
|
-
init_formatters2();
|
|
2874
|
-
init_color2();
|
|
2875
|
-
init_autobind2();
|
|
2876
|
-
init_assert4();
|
|
2877
|
-
init_hi_res_timestamp4();
|
|
2878
|
-
originalConsole2 = {
|
|
2879
|
-
debug: isBrowser5 ? console.debug || console.log : console.log,
|
|
2880
|
-
log: console.log,
|
|
2881
|
-
info: console.info,
|
|
2882
|
-
warn: console.warn,
|
|
2883
|
-
error: console.error
|
|
2884
|
-
};
|
|
2885
|
-
DEFAULT_SETTINGS2 = {
|
|
2886
|
-
enabled: true,
|
|
2887
|
-
level: 0
|
|
2888
|
-
};
|
|
2889
|
-
cache2 = {};
|
|
2890
|
-
ONCE2 = {
|
|
2891
|
-
once: true
|
|
2892
|
-
};
|
|
2893
|
-
Log2 = class {
|
|
2894
|
-
constructor() {
|
|
2895
|
-
let {
|
|
2896
|
-
id
|
|
2897
|
-
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
2898
|
-
id: ""
|
|
2899
|
-
};
|
|
2900
|
-
_defineProperty(this, "id", void 0);
|
|
2901
|
-
_defineProperty(this, "VERSION", VERSION5);
|
|
2902
|
-
_defineProperty(this, "_startTs", getHiResTimestamp4());
|
|
2903
|
-
_defineProperty(this, "_deltaTs", getHiResTimestamp4());
|
|
2904
|
-
_defineProperty(this, "_storage", void 0);
|
|
2905
|
-
_defineProperty(this, "userData", {});
|
|
2906
|
-
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
2907
|
-
this.id = id;
|
|
2908
|
-
this._storage = new LocalStorage2("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS2);
|
|
2909
|
-
this.userData = {};
|
|
2910
|
-
this.timeStamp("".concat(this.id, " started"));
|
|
2911
|
-
autobind2(this);
|
|
2912
|
-
Object.seal(this);
|
|
2913
|
-
}
|
|
2914
|
-
set level(newLevel) {
|
|
2915
|
-
this.setLevel(newLevel);
|
|
2916
|
-
}
|
|
2917
|
-
get level() {
|
|
2918
|
-
return this.getLevel();
|
|
2919
|
-
}
|
|
2920
|
-
isEnabled() {
|
|
2921
|
-
return this._storage.config.enabled;
|
|
2922
|
-
}
|
|
2923
|
-
getLevel() {
|
|
2924
|
-
return this._storage.config.level;
|
|
2925
|
-
}
|
|
2926
|
-
getTotal() {
|
|
2927
|
-
return Number((getHiResTimestamp4() - this._startTs).toPrecision(10));
|
|
2928
|
-
}
|
|
2929
|
-
getDelta() {
|
|
2930
|
-
return Number((getHiResTimestamp4() - this._deltaTs).toPrecision(10));
|
|
2931
|
-
}
|
|
2932
|
-
set priority(newPriority) {
|
|
2933
|
-
this.level = newPriority;
|
|
2934
|
-
}
|
|
2935
|
-
get priority() {
|
|
2936
|
-
return this.level;
|
|
2937
|
-
}
|
|
2938
|
-
getPriority() {
|
|
2939
|
-
return this.level;
|
|
2940
|
-
}
|
|
2941
|
-
enable() {
|
|
2942
|
-
let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
2943
|
-
this._storage.updateConfiguration({
|
|
2944
|
-
enabled
|
|
2945
|
-
});
|
|
2946
|
-
return this;
|
|
2947
|
-
}
|
|
2948
|
-
setLevel(level) {
|
|
2949
|
-
this._storage.updateConfiguration({
|
|
2950
|
-
level
|
|
2951
|
-
});
|
|
2952
|
-
return this;
|
|
2953
|
-
}
|
|
2954
|
-
get(setting) {
|
|
2955
|
-
return this._storage.config[setting];
|
|
2956
|
-
}
|
|
2957
|
-
set(setting, value) {
|
|
2958
|
-
this._storage.updateConfiguration({
|
|
2959
|
-
[setting]: value
|
|
2960
|
-
});
|
|
2961
|
-
}
|
|
2962
|
-
settings() {
|
|
2963
|
-
if (console.table) {
|
|
2964
|
-
console.table(this._storage.config);
|
|
2965
|
-
} else {
|
|
2966
|
-
console.log(this._storage.config);
|
|
2967
|
-
}
|
|
2968
|
-
}
|
|
2969
|
-
assert(condition, message) {
|
|
2970
|
-
assert4(condition, message);
|
|
2971
|
-
}
|
|
2972
|
-
warn(message) {
|
|
2973
|
-
return this._getLogFunction(0, message, originalConsole2.warn, arguments, ONCE2);
|
|
2974
|
-
}
|
|
2975
|
-
error(message) {
|
|
2976
|
-
return this._getLogFunction(0, message, originalConsole2.error, arguments);
|
|
2977
|
-
}
|
|
2978
|
-
deprecated(oldUsage, newUsage) {
|
|
2979
|
-
return this.warn("`".concat(oldUsage, "` is deprecated and will be removed in a later version. Use `").concat(newUsage, "` instead"));
|
|
2980
|
-
}
|
|
2981
|
-
removed(oldUsage, newUsage) {
|
|
2982
|
-
return this.error("`".concat(oldUsage, "` has been removed. Use `").concat(newUsage, "` instead"));
|
|
2983
|
-
}
|
|
2984
|
-
probe(logLevel, message) {
|
|
2985
|
-
return this._getLogFunction(logLevel, message, originalConsole2.log, arguments, {
|
|
2986
|
-
time: true,
|
|
2987
|
-
once: true
|
|
2988
|
-
});
|
|
2989
|
-
}
|
|
2990
|
-
log(logLevel, message) {
|
|
2991
|
-
return this._getLogFunction(logLevel, message, originalConsole2.debug, arguments);
|
|
2992
|
-
}
|
|
2993
|
-
info(logLevel, message) {
|
|
2994
|
-
return this._getLogFunction(logLevel, message, console.info, arguments);
|
|
2995
|
-
}
|
|
2996
|
-
once(logLevel, message) {
|
|
2997
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
2998
|
-
args[_key - 2] = arguments[_key];
|
|
2999
|
-
}
|
|
3000
|
-
return this._getLogFunction(logLevel, message, originalConsole2.debug || originalConsole2.info, arguments, ONCE2);
|
|
3001
|
-
}
|
|
3002
|
-
table(logLevel, table, columns) {
|
|
3003
|
-
if (table) {
|
|
3004
|
-
return this._getLogFunction(logLevel, table, console.table || noop2, columns && [columns], {
|
|
3005
|
-
tag: getTableHeader2(table)
|
|
3006
|
-
});
|
|
3007
|
-
}
|
|
3008
|
-
return noop2;
|
|
3009
|
-
}
|
|
3010
|
-
image(_ref) {
|
|
3011
|
-
let {
|
|
3012
|
-
logLevel,
|
|
3013
|
-
priority,
|
|
3014
|
-
image,
|
|
3015
|
-
message = "",
|
|
3016
|
-
scale = 1
|
|
3017
|
-
} = _ref;
|
|
3018
|
-
if (!this._shouldLog(logLevel || priority)) {
|
|
3019
|
-
return noop2;
|
|
3020
|
-
}
|
|
3021
|
-
return isBrowser5 ? logImageInBrowser2({
|
|
3022
|
-
image,
|
|
3023
|
-
message,
|
|
3024
|
-
scale
|
|
3025
|
-
}) : logImageInNode2({
|
|
3026
|
-
image,
|
|
3027
|
-
message,
|
|
3028
|
-
scale
|
|
3029
|
-
});
|
|
3030
|
-
}
|
|
3031
|
-
time(logLevel, message) {
|
|
3032
|
-
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
3033
|
-
}
|
|
3034
|
-
timeEnd(logLevel, message) {
|
|
3035
|
-
return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info);
|
|
3036
|
-
}
|
|
3037
|
-
timeStamp(logLevel, message) {
|
|
3038
|
-
return this._getLogFunction(logLevel, message, console.timeStamp || noop2);
|
|
3039
|
-
}
|
|
3040
|
-
group(logLevel, message) {
|
|
3041
|
-
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
3042
|
-
collapsed: false
|
|
3043
|
-
};
|
|
3044
|
-
const options = normalizeArguments2({
|
|
3045
|
-
logLevel,
|
|
3046
|
-
message,
|
|
3047
|
-
opts
|
|
3048
|
-
});
|
|
3049
|
-
const {
|
|
3050
|
-
collapsed
|
|
3051
|
-
} = opts;
|
|
3052
|
-
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
3053
|
-
return this._getLogFunction(options);
|
|
3054
|
-
}
|
|
3055
|
-
groupCollapsed(logLevel, message) {
|
|
3056
|
-
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
3057
|
-
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
3058
|
-
collapsed: true
|
|
3059
|
-
}));
|
|
3060
|
-
}
|
|
3061
|
-
groupEnd(logLevel) {
|
|
3062
|
-
return this._getLogFunction(logLevel, "", console.groupEnd || noop2);
|
|
3063
|
-
}
|
|
3064
|
-
withGroup(logLevel, message, func) {
|
|
3065
|
-
this.group(logLevel, message)();
|
|
3066
|
-
try {
|
|
3067
|
-
func();
|
|
3068
|
-
} finally {
|
|
3069
|
-
this.groupEnd(logLevel)();
|
|
3070
|
-
}
|
|
3071
|
-
}
|
|
3072
|
-
trace() {
|
|
3073
|
-
if (console.trace) {
|
|
3074
|
-
console.trace();
|
|
3075
|
-
}
|
|
3076
|
-
}
|
|
3077
|
-
_shouldLog(logLevel) {
|
|
3078
|
-
return this.isEnabled() && this.getLevel() >= normalizeLogLevel2(logLevel);
|
|
3079
|
-
}
|
|
3080
|
-
_getLogFunction(logLevel, message, method, args, opts) {
|
|
3081
|
-
if (this._shouldLog(logLevel)) {
|
|
3082
|
-
opts = normalizeArguments2({
|
|
3083
|
-
logLevel,
|
|
3084
|
-
message,
|
|
3085
|
-
args,
|
|
3086
|
-
opts
|
|
3087
|
-
});
|
|
3088
|
-
method = method || opts.method;
|
|
3089
|
-
assert4(method);
|
|
3090
|
-
opts.total = this.getTotal();
|
|
3091
|
-
opts.delta = this.getDelta();
|
|
3092
|
-
this._deltaTs = getHiResTimestamp4();
|
|
3093
|
-
const tag = opts.tag || opts.message;
|
|
3094
|
-
if (opts.once) {
|
|
3095
|
-
if (!cache2[tag]) {
|
|
3096
|
-
cache2[tag] = getHiResTimestamp4();
|
|
3097
|
-
} else {
|
|
3098
|
-
return noop2;
|
|
3099
|
-
}
|
|
3100
|
-
}
|
|
3101
|
-
message = decorateMessage2(this.id, opts.message, opts);
|
|
3102
|
-
return method.bind(console, message, ...opts.args);
|
|
3103
|
-
}
|
|
3104
|
-
return noop2;
|
|
3105
|
-
}
|
|
3106
|
-
};
|
|
3107
|
-
_defineProperty(Log2, "VERSION", VERSION5);
|
|
3108
|
-
}
|
|
3109
|
-
});
|
|
3110
|
-
|
|
3111
|
-
// ../../node_modules/@probe.gl/log/dist/esm/index.js
|
|
3112
|
-
var esm_default2;
|
|
3113
|
-
var init_esm5 = __esm({
|
|
3114
|
-
"../../node_modules/@probe.gl/log/dist/esm/index.js"() {
|
|
3115
|
-
init_log2();
|
|
3116
|
-
init_log2();
|
|
3117
|
-
esm_default2 = new Log2({
|
|
3118
|
-
id: "@probe.gl/log"
|
|
3119
|
-
});
|
|
3120
|
-
}
|
|
3121
|
-
});
|
|
3122
|
-
|
|
3123
|
-
// src/lib/utils/log.ts
|
|
3124
|
-
var log;
|
|
3125
|
-
var init_log3 = __esm({
|
|
3126
|
-
"src/lib/utils/log.ts"() {
|
|
3127
|
-
init_esm5();
|
|
3128
|
-
log = new Log2({ id: "loaders.gl" });
|
|
3129
|
-
}
|
|
3130
|
-
});
|
|
3131
|
-
|
|
3132
|
-
// src/lib/api/select-loader.ts
|
|
3133
|
-
async function selectLoader(data, loaders = [], options, context) {
|
|
3134
|
-
if (!validHTTPResponse(data)) {
|
|
3135
|
-
return null;
|
|
3136
|
-
}
|
|
3137
|
-
let loader = selectLoaderSync(data, loaders, { ...options, nothrow: true }, context);
|
|
3138
|
-
if (loader) {
|
|
3139
|
-
return loader;
|
|
3140
|
-
}
|
|
3141
|
-
if (isBlob(data)) {
|
|
3142
|
-
data = await data.slice(0, 10).arrayBuffer();
|
|
3143
|
-
loader = selectLoaderSync(data, loaders, options, context);
|
|
3144
|
-
}
|
|
3145
|
-
if (!loader && !options?.nothrow) {
|
|
3146
|
-
throw new Error(getNoValidLoaderMessage(data));
|
|
3147
|
-
}
|
|
3148
|
-
return loader;
|
|
3149
|
-
}
|
|
3150
|
-
function selectLoaderSync(data, loaders = [], options, context) {
|
|
3151
|
-
if (!validHTTPResponse(data)) {
|
|
2520
|
+
return loader;
|
|
2521
|
+
}
|
|
2522
|
+
function selectLoaderSync(data, loaders = [], options, context) {
|
|
2523
|
+
if (!validHTTPResponse(data)) {
|
|
3152
2524
|
return null;
|
|
3153
2525
|
}
|
|
3154
2526
|
if (loaders && !Array.isArray(loaders)) {
|
|
@@ -3314,7 +2686,7 @@
|
|
|
3314
2686
|
"src/lib/api/select-loader.ts"() {
|
|
3315
2687
|
init_src2();
|
|
3316
2688
|
init_normalize_loader();
|
|
3317
|
-
|
|
2689
|
+
init_log2();
|
|
3318
2690
|
init_resource_utils();
|
|
3319
2691
|
init_register_loaders();
|
|
3320
2692
|
init_is_type();
|
|
@@ -3955,15 +3327,15 @@
|
|
|
3955
3327
|
context = context && JSON.parse(JSON.stringify(context));
|
|
3956
3328
|
return { arrayBuffer, options, context };
|
|
3957
3329
|
}
|
|
3958
|
-
var
|
|
3330
|
+
var VERSION5, NullWorkerLoader, NullLoader;
|
|
3959
3331
|
var init_null_loader = __esm({
|
|
3960
3332
|
"src/null-loader.ts"() {
|
|
3961
|
-
|
|
3333
|
+
VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
3962
3334
|
NullWorkerLoader = {
|
|
3963
3335
|
name: "Null loader",
|
|
3964
3336
|
id: "null",
|
|
3965
3337
|
module: "core",
|
|
3966
|
-
version:
|
|
3338
|
+
version: VERSION5,
|
|
3967
3339
|
worker: true,
|
|
3968
3340
|
mimeTypes: ["application/x.empty"],
|
|
3969
3341
|
extensions: ["null"],
|
|
@@ -3976,7 +3348,7 @@
|
|
|
3976
3348
|
name: "Null loader",
|
|
3977
3349
|
id: "null",
|
|
3978
3350
|
module: "core",
|
|
3979
|
-
version:
|
|
3351
|
+
version: VERSION5,
|
|
3980
3352
|
mimeTypes: ["application/x.empty"],
|
|
3981
3353
|
extensions: ["null"],
|
|
3982
3354
|
parse: async (arrayBuffer, options, context) => parseSync2(arrayBuffer, options, context),
|
|
@@ -4223,10 +3595,10 @@
|
|
|
4223
3595
|
|
|
4224
3596
|
// src/bundle.ts
|
|
4225
3597
|
var require_bundle = __commonJS({
|
|
4226
|
-
"src/bundle.ts"(exports,
|
|
3598
|
+
"src/bundle.ts"(exports, module) {
|
|
4227
3599
|
var moduleExports = (init_src3(), src_exports);
|
|
4228
3600
|
globalThis.loaders = globalThis.loaders || {};
|
|
4229
|
-
|
|
3601
|
+
module.exports = Object.assign(globalThis.loaders, moduleExports);
|
|
4230
3602
|
}
|
|
4231
3603
|
});
|
|
4232
3604
|
require_bundle();
|