@loaders.gl/core 4.2.0-alpha.5 → 4.2.0-alpha.6
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.dev.js +82 -51
- package/dist/dist.min.js +3 -3
- package/dist/index.cjs +6 -4
- package/dist/index.cjs.map +2 -2
- package/dist/lib/api/parse-in-batches.js +1 -0
- package/dist/lib/filesystems/browser-filesystem.js +4 -3
- package/dist/lib/init.js +1 -1
- package/dist/lib/loader-utils/loggers.js +1 -0
- package/dist/null-loader.js +1 -1
- package/dist/null-worker-node.js +4 -2
- package/dist/null-worker.js +4 -2
- package/package.json +9 -8
- package/src/lib/api/parse-in-batches.ts +6 -5
- package/src/lib/utils/resource-utils.ts +1 -1
package/dist/dist.dev.js
CHANGED
|
@@ -10,6 +10,7 @@ var __exports__ = (() => {
|
|
|
10
10
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
11
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12
12
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
14
|
var __export = (target, all) => {
|
|
14
15
|
for (var name in all)
|
|
15
16
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -23,6 +24,10 @@ var __exports__ = (() => {
|
|
|
23
24
|
return to;
|
|
24
25
|
};
|
|
25
26
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var __publicField = (obj, key, value) => {
|
|
28
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
29
|
+
return value;
|
|
30
|
+
};
|
|
26
31
|
|
|
27
32
|
// bundle.ts
|
|
28
33
|
var bundle_exports = {};
|
|
@@ -178,12 +183,16 @@ var __exports__ = (() => {
|
|
|
178
183
|
|
|
179
184
|
// ../worker-utils/src/lib/worker-farm/worker-job.ts
|
|
180
185
|
var WorkerJob = class {
|
|
186
|
+
name;
|
|
187
|
+
workerThread;
|
|
188
|
+
isRunning = true;
|
|
189
|
+
/** Promise that resolves when Job is done */
|
|
190
|
+
result;
|
|
191
|
+
_resolve = () => {
|
|
192
|
+
};
|
|
193
|
+
_reject = () => {
|
|
194
|
+
};
|
|
181
195
|
constructor(jobName, workerThread) {
|
|
182
|
-
this.isRunning = true;
|
|
183
|
-
this._resolve = () => {
|
|
184
|
-
};
|
|
185
|
-
this._reject = () => {
|
|
186
|
-
};
|
|
187
196
|
this.name = jobName;
|
|
188
197
|
this.workerThread = workerThread;
|
|
189
198
|
this.result = new Promise((resolve2, reject) => {
|
|
@@ -320,9 +329,19 @@ var __exports__ = (() => {
|
|
|
320
329
|
var NOOP = () => {
|
|
321
330
|
};
|
|
322
331
|
var WorkerThread = class {
|
|
332
|
+
name;
|
|
333
|
+
source;
|
|
334
|
+
url;
|
|
335
|
+
terminated = false;
|
|
336
|
+
worker;
|
|
337
|
+
onMessage;
|
|
338
|
+
onError;
|
|
339
|
+
_loadableURL = "";
|
|
340
|
+
/** Checks if workers are supported on this platform */
|
|
341
|
+
static isSupported() {
|
|
342
|
+
return typeof Worker !== "undefined" && isBrowser2 || typeof NodeWorker !== "undefined" && !isBrowser2;
|
|
343
|
+
}
|
|
323
344
|
constructor(props) {
|
|
324
|
-
this.terminated = false;
|
|
325
|
-
this._loadableURL = "";
|
|
326
345
|
const { name, source, url } = props;
|
|
327
346
|
assert2(source || url);
|
|
328
347
|
this.name = name;
|
|
@@ -332,10 +351,6 @@ var __exports__ = (() => {
|
|
|
332
351
|
this.onError = (error) => console.log(error);
|
|
333
352
|
this.worker = isBrowser2 ? this._createBrowserWorker() : this._createNodeWorker();
|
|
334
353
|
}
|
|
335
|
-
/** Checks if workers are supported on this platform */
|
|
336
|
-
static isSupported() {
|
|
337
|
-
return typeof Worker !== "undefined" && isBrowser2 || typeof NodeWorker !== "undefined" && !isBrowser2;
|
|
338
|
-
}
|
|
339
354
|
/**
|
|
340
355
|
* Terminate this worker thread
|
|
341
356
|
* @note Can free up significant memory
|
|
@@ -423,30 +438,33 @@ var __exports__ = (() => {
|
|
|
423
438
|
|
|
424
439
|
// ../worker-utils/src/lib/worker-farm/worker-pool.ts
|
|
425
440
|
var WorkerPool = class {
|
|
441
|
+
name = "unnamed";
|
|
442
|
+
source;
|
|
443
|
+
// | Function;
|
|
444
|
+
url;
|
|
445
|
+
maxConcurrency = 1;
|
|
446
|
+
maxMobileConcurrency = 1;
|
|
447
|
+
onDebug = () => {
|
|
448
|
+
};
|
|
449
|
+
reuseWorkers = true;
|
|
450
|
+
props = {};
|
|
451
|
+
jobQueue = [];
|
|
452
|
+
idleQueue = [];
|
|
453
|
+
count = 0;
|
|
454
|
+
isDestroyed = false;
|
|
455
|
+
/** Checks if workers are supported on this platform */
|
|
456
|
+
static isSupported() {
|
|
457
|
+
return WorkerThread.isSupported();
|
|
458
|
+
}
|
|
426
459
|
/**
|
|
427
460
|
* @param processor - worker function
|
|
428
461
|
* @param maxConcurrency - max count of workers
|
|
429
462
|
*/
|
|
430
463
|
constructor(props) {
|
|
431
|
-
this.name = "unnamed";
|
|
432
|
-
this.maxConcurrency = 1;
|
|
433
|
-
this.maxMobileConcurrency = 1;
|
|
434
|
-
this.onDebug = () => {
|
|
435
|
-
};
|
|
436
|
-
this.reuseWorkers = true;
|
|
437
|
-
this.props = {};
|
|
438
|
-
this.jobQueue = [];
|
|
439
|
-
this.idleQueue = [];
|
|
440
|
-
this.count = 0;
|
|
441
|
-
this.isDestroyed = false;
|
|
442
464
|
this.source = props.source;
|
|
443
465
|
this.url = props.url;
|
|
444
466
|
this.setProps(props);
|
|
445
467
|
}
|
|
446
|
-
/** Checks if workers are supported on this platform */
|
|
447
|
-
static isSupported() {
|
|
448
|
-
return WorkerThread.isSupported();
|
|
449
|
-
}
|
|
450
468
|
/**
|
|
451
469
|
* Terminates all workers in the pool
|
|
452
470
|
* @note Can free up significant memory
|
|
@@ -569,23 +587,24 @@ var __exports__ = (() => {
|
|
|
569
587
|
onDebug: () => {
|
|
570
588
|
}
|
|
571
589
|
};
|
|
572
|
-
var
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
this.workerPools = /* @__PURE__ */ new Map();
|
|
576
|
-
this.props = { ...DEFAULT_PROPS };
|
|
577
|
-
this.setProps(props);
|
|
578
|
-
this.workerPools = /* @__PURE__ */ new Map();
|
|
579
|
-
}
|
|
590
|
+
var _WorkerFarm = class {
|
|
591
|
+
props;
|
|
592
|
+
workerPools = /* @__PURE__ */ new Map();
|
|
580
593
|
/** Checks if workers are supported on this platform */
|
|
581
594
|
static isSupported() {
|
|
582
595
|
return WorkerThread.isSupported();
|
|
583
596
|
}
|
|
584
597
|
/** Get the singleton instance of the global worker farm */
|
|
585
598
|
static getWorkerFarm(props = {}) {
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
return
|
|
599
|
+
_WorkerFarm._workerFarm = _WorkerFarm._workerFarm || new _WorkerFarm({});
|
|
600
|
+
_WorkerFarm._workerFarm.setProps(props);
|
|
601
|
+
return _WorkerFarm._workerFarm;
|
|
602
|
+
}
|
|
603
|
+
/** get global instance with WorkerFarm.getWorkerFarm() */
|
|
604
|
+
constructor(props) {
|
|
605
|
+
this.props = { ...DEFAULT_PROPS };
|
|
606
|
+
this.setProps(props);
|
|
607
|
+
this.workerPools = /* @__PURE__ */ new Map();
|
|
589
608
|
}
|
|
590
609
|
/**
|
|
591
610
|
* Terminate all workers in the farm
|
|
@@ -639,6 +658,9 @@ var __exports__ = (() => {
|
|
|
639
658
|
};
|
|
640
659
|
}
|
|
641
660
|
};
|
|
661
|
+
var WorkerFarm = _WorkerFarm;
|
|
662
|
+
// singleton
|
|
663
|
+
__publicField(WorkerFarm, "_workerFarm");
|
|
642
664
|
|
|
643
665
|
// ../worker-utils/src/lib/worker-api/get-worker-url.ts
|
|
644
666
|
function getWorkerName(worker) {
|
|
@@ -931,7 +953,7 @@ var __exports__ = (() => {
|
|
|
931
953
|
return obj;
|
|
932
954
|
}
|
|
933
955
|
|
|
934
|
-
//
|
|
956
|
+
// ../../node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js
|
|
935
957
|
function getHiResTimestamp() {
|
|
936
958
|
let timestamp;
|
|
937
959
|
if (typeof window !== "undefined" && window.performance) {
|
|
@@ -945,7 +967,7 @@ var __exports__ = (() => {
|
|
|
945
967
|
return timestamp;
|
|
946
968
|
}
|
|
947
969
|
|
|
948
|
-
//
|
|
970
|
+
// ../../node_modules/@probe.gl/stats/dist/lib/stat.js
|
|
949
971
|
var Stat = class {
|
|
950
972
|
constructor(name, type) {
|
|
951
973
|
_defineProperty(this, "name", void 0);
|
|
@@ -1057,7 +1079,7 @@ var __exports__ = (() => {
|
|
|
1057
1079
|
}
|
|
1058
1080
|
};
|
|
1059
1081
|
|
|
1060
|
-
//
|
|
1082
|
+
// ../../node_modules/@probe.gl/stats/dist/lib/stats.js
|
|
1061
1083
|
var Stats = class {
|
|
1062
1084
|
constructor(options) {
|
|
1063
1085
|
_defineProperty(this, "id", void 0);
|
|
@@ -1141,12 +1163,14 @@ var __exports__ = (() => {
|
|
|
1141
1163
|
debounceTime: 0
|
|
1142
1164
|
};
|
|
1143
1165
|
var RequestScheduler = class {
|
|
1166
|
+
props;
|
|
1167
|
+
stats;
|
|
1168
|
+
activeRequestCount = 0;
|
|
1169
|
+
/** Tracks the number of active requests and prioritizes/cancels queued requests. */
|
|
1170
|
+
requestQueue = [];
|
|
1171
|
+
requestMap = /* @__PURE__ */ new Map();
|
|
1172
|
+
updateTimer = null;
|
|
1144
1173
|
constructor(props = {}) {
|
|
1145
|
-
this.activeRequestCount = 0;
|
|
1146
|
-
/** Tracks the number of active requests and prioritizes/cancels queued requests. */
|
|
1147
|
-
this.requestQueue = [];
|
|
1148
|
-
this.requestMap = /* @__PURE__ */ new Map();
|
|
1149
|
-
this.updateTimer = null;
|
|
1150
1174
|
this.props = { ...DEFAULT_PROPS2, ...props };
|
|
1151
1175
|
this.stats = new Stats({ id: this.props.id });
|
|
1152
1176
|
this.stats.get(STAT_QUEUED_REQUESTS);
|
|
@@ -1472,6 +1496,10 @@ var __exports__ = (() => {
|
|
|
1472
1496
|
|
|
1473
1497
|
// ../loader-utils/src/lib/files/blob-file.ts
|
|
1474
1498
|
var BlobFile = class {
|
|
1499
|
+
handle;
|
|
1500
|
+
size;
|
|
1501
|
+
bigsize;
|
|
1502
|
+
url;
|
|
1475
1503
|
constructor(blob) {
|
|
1476
1504
|
this.handle = blob instanceof ArrayBuffer ? new Blob([blob]) : blob;
|
|
1477
1505
|
this.size = blob instanceof ArrayBuffer ? blob.byteLength : blob.size;
|
|
@@ -1496,10 +1524,11 @@ var __exports__ = (() => {
|
|
|
1496
1524
|
// ../loader-utils/src/lib/files/node-file-facade.ts
|
|
1497
1525
|
var NOT_IMPLEMENTED = new Error("Not implemented");
|
|
1498
1526
|
var NodeFileFacade = class {
|
|
1527
|
+
handle;
|
|
1528
|
+
size = 0;
|
|
1529
|
+
bigsize = 0n;
|
|
1530
|
+
url = "";
|
|
1499
1531
|
constructor(url, flags, mode) {
|
|
1500
|
-
this.size = 0;
|
|
1501
|
-
this.bigsize = 0n;
|
|
1502
|
-
this.url = "";
|
|
1503
1532
|
if (globalThis.loaders?.NodeFile) {
|
|
1504
1533
|
return new globalThis.loaders.NodeFile(url, flags, mode);
|
|
1505
1534
|
}
|
|
@@ -2296,6 +2325,7 @@ var __exports__ = (() => {
|
|
|
2296
2325
|
}
|
|
2297
2326
|
};
|
|
2298
2327
|
var ConsoleLog = class {
|
|
2328
|
+
console;
|
|
2299
2329
|
constructor() {
|
|
2300
2330
|
this.console = console;
|
|
2301
2331
|
}
|
|
@@ -3459,15 +3489,16 @@ var __exports__ = (() => {
|
|
|
3459
3489
|
|
|
3460
3490
|
// src/lib/filesystems/browser-filesystem.ts
|
|
3461
3491
|
var BrowserFileSystem = class {
|
|
3492
|
+
_fetch;
|
|
3493
|
+
files = {};
|
|
3494
|
+
lowerCaseFiles = {};
|
|
3495
|
+
usedFiles = {};
|
|
3462
3496
|
/**
|
|
3463
3497
|
* A FileSystem API wrapper around a list of browser 'File' objects
|
|
3464
3498
|
* @param files
|
|
3465
3499
|
* @param options
|
|
3466
3500
|
*/
|
|
3467
3501
|
constructor(files, options) {
|
|
3468
|
-
this.files = {};
|
|
3469
|
-
this.lowerCaseFiles = {};
|
|
3470
|
-
this.usedFiles = {};
|
|
3471
3502
|
this._fetch = options?.fetch || fetch;
|
|
3472
3503
|
for (let i = 0; i < files.length; ++i) {
|
|
3473
3504
|
const file = files[i];
|
package/dist/dist.min.js
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
5
|
else if (typeof exports === 'object') exports['loaders'] = factory();
|
|
6
6
|
else root['loaders'] = factory();})(globalThis, function () {
|
|
7
|
-
"use strict";var __exports__=(()=>{var
|
|
7
|
+
"use strict";var __exports__=(()=>{var be=Object.defineProperty;var Or=Object.getOwnPropertyDescriptor;var Ur=Object.getOwnPropertyNames;var jr=Object.prototype.hasOwnProperty;var Dr=(e,t,r)=>t in e?be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var kt=(e,t)=>{for(var r in t)be(e,r,{get:t[r],enumerable:!0})},$r=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ur(t))!jr.call(e,n)&&n!==r&&be(e,n,{get:()=>t[n],enumerable:!(o=Or(t,n))||o.enumerable});return e};var zr=e=>$r(be({},"__esModule",{value:!0}),e);var St=(e,t,r)=>(Dr(e,typeof t!="symbol"?t+"":t,r),r);var on={};kt(on,{JSONLoader:()=>rt,NullLoader:()=>Wr,NullWorkerLoader:()=>Nr,RequestScheduler:()=>H,_BrowserFileSystem:()=>Re,_fetchProgress:()=>Cr,_unregisterLoaders:()=>lr,assert:()=>$,concatenateArrayBuffersAsync:()=>W,document:()=>Pe,encode:()=>Lr,encodeInBatches:()=>Fr,encodeSync:()=>xt,encodeTable:()=>wt,encodeTableAsText:()=>Er,encodeTableInBatches:()=>bt,encodeText:()=>Rr,encodeTextSync:()=>Ir,encodeURLtoURL:()=>Tt,fetchFile:()=>U,forEach:()=>Ke,getLoaderOptions:()=>L,getPathPrefix:()=>tt,global:()=>ve,isAsyncIterable:()=>he,isBrowser:()=>p,isIterable:()=>pe,isIterator:()=>de,isPromise:()=>Dt,isPureObject:()=>me,isReadableStream:()=>O,isResponse:()=>m,isWorker:()=>Ne,isWritableStream:()=>zt,load:()=>_r,loadInBatches:()=>Sr,makeIterator:()=>X,makeLineIterator:()=>Qe,makeNumberedLineIterator:()=>Je,makeStream:()=>vr,makeTextDecoderIterator:()=>Ge,makeTextEncoderIterator:()=>qe,parse:()=>E,parseInBatches:()=>P,parseSync:()=>Ar,readArrayBuffer:()=>Qt,registerLoaders:()=>fr,resolvePath:()=>v,selectLoader:()=>Z,selectLoaderSync:()=>Y,self:()=>Ie,setLoaderOptions:()=>ft,setPathPrefix:()=>et,window:()=>Fe});function $(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var A={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Ie=A.self||A.window||A.global||{},Fe=A.window||A.self||A.global||{},ve=A.global||A.self||A.window||{},Pe=A.document||{};var p=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser),Ne=typeof importScripts=="function",Et=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Vr=Et&&parseFloat(Et[1])||0;function We(e,t){return Bt(e||{},t)}function Bt(e,t,r=0){if(r>3)return t;let o={...e};for(let[n,s]of Object.entries(t))s&&typeof s=="object"&&!Array.isArray(s)?o[n]=Bt(o[n]||{},t[n],r+1):o[n]=t[n];return o}var Lt="latest";function Hr(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.0-alpha.5"),globalThis._loadersgl_.version}var re=Hr();function l(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var _={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},ln=_.self||_.window||_.global||{},mn=_.window||_.self||_.global||{},pn=_.global||_.self||_.window||{},hn=_.document||{};var d=typeof process!="object"||String(process)!=="[object process]"||process.browser;var It=typeof window<"u"&&typeof window.orientation<"u",Rt=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),dn=Rt&&parseFloat(Rt[1])||0;var oe=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(t,r){this.name=t,this.workerThread=r,this.result=new Promise((o,n)=>{this._resolve=o,this._reject=n})}postMessage(t,r){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:r})}done(t){l(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){l(this.isRunning),this.isRunning=!1,this._reject(t)}};var z=class{terminate(){}};var Ce=new Map;function Ft(e){l(e.source&&!e.url||!e.source&&e.url);let t=Ce.get(e.source||e.url);return t||(e.url&&(t=Gr(e.url),Ce.set(e.url,t)),e.source&&(t=vt(e.source),Ce.set(e.source,t))),l(t),t}function Gr(e){if(!e.startsWith("http"))return e;let t=qr(e);return vt(t)}function vt(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function qr(e){return`try {
|
|
8
8
|
importScripts('${e}');
|
|
9
9
|
} catch (error) {
|
|
10
10
|
console.error(error);
|
|
11
11
|
throw error;
|
|
12
|
-
}`}function
|
|
13
|
-
`))>=0;){let n=t.slice(0,o+1);t=t.slice(o+1),yield n}}t.length>0&&(yield t)}async function*Qe(e){let t=1;for await(let r of e)yield{counter:t,line:r},t++}async function Je(e,t){for(;;){let{done:r,value:o}=await e.next();if(r){e.return();return}if(t(o))return}}async function N(e){let t=[];for await(let r of e)t.push(r);return se(...t)}function v(e){return v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(e)}function Ke(e,t){if(v(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t||"default");if(v(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ye(e){var t=Ke(e,"string");return v(t)==="symbol"?t:String(t)}function f(e,t,r){return t=Ye(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ie(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var W=class{constructor(t,r){f(this,"name",void 0),f(this,"type",void 0),f(this,"sampleSize",1),f(this,"time",0),f(this,"count",0),f(this,"samples",0),f(this,"lastTiming",0),f(this,"lastSampleTime",0),f(this,"lastSampleCount",0),f(this,"_count",0),f(this,"_time",0),f(this,"_samples",0),f(this,"_startTime",0),f(this,"_timerPending",!1),this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=ie(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(ie()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var z=class{constructor(t){f(this,"id",void 0),f(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:o}=t,n=this.stats[r];return n||(t instanceof W?n=t:n=new W(r,o),this.stats[r]=n),n}};var Qr="Queued Requests",Jr="Active Requests",Kr="Cancelled Requests",Yr="Queued Requests Ever",Zr="Active Requests Ever",Xr={id:"request-scheduler",throttleRequests:!0,maxRequests:6,debounceTime:0},V=class{constructor(t={}){this.activeRequestCount=0,this.requestQueue=[],this.requestMap=new Map,this.updateTimer=null,this.props={...Xr,...t},this.stats=new z({id:this.props.id}),this.stats.get(Qr),this.stats.get(Jr),this.stats.get(Kr),this.stats.get(Yr),this.stats.get(Zr)}scheduleRequest(t,r=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);let o={handle:t,priority:0,getPriority:r},n=new Promise(s=>(o.resolve=s,o));return this.requestQueue.push(o),this.requestMap.set(t,n),this._issueNewRequests(),n}_issueRequest(t){let{handle:r,resolve:o}=t,n=!1,s=()=>{n||(n=!0,this.requestMap.delete(r),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,o?o({done:s}):Promise.resolve({done:s})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;let t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(t!==0){this._updateAllRequests();for(let r=0;r<t;++r){let o=this.requestQueue.shift();o&&this._issueRequest(o)}}}_updateAllRequests(){let t=this.requestQueue;for(let r=0;r<t.length;++r){let o=t[r];this._updateRequest(o)||(t.splice(r,1),this.requestMap.delete(o.handle),r--)}t.sort((r,o)=>r.priority-o.priority)}_updateRequest(t){return t.priority=t.getPriority(t.handle),t.priority<0?(t.resolve(null),!1):!0}};var Ze="",Nt={};function Xe(e){Ze=e}function et(){return Ze}function F(e){for(let t in Nt)if(e.startsWith(t)){let r=Nt[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${Ze}${e}`),e}var eo="4.2.0-alpha.4",tt={name:"JSON",id:"json",module:"json",version:eo,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:Wt,parse:async e=>Wt(new TextDecoder().decode(e)),options:{}};function Wt(e){return JSON.parse(e)}function Ct(e){return e&&typeof e=="object"&&e.isBuffer}function we(e){if(Ct(e))return e;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}var C={};_t(C,{dirname:()=>ro,filename:()=>to,join:()=>oo,resolve:()=>no});function Ot(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function to(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function ro(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function oo(...e){let t="/";return e=e.map((r,o)=>(o&&(r=r.replace(new RegExp(`^${t}`),"")),o!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function no(...e){let t=[];for(let s=0;s<e.length;s++)t[s]=e[s];let r="",o=!1,n;for(let s=t.length-1;s>=-1&&!o;s--){let i;s>=0?i=t[s]:(n===void 0&&(n=Ot()),i=n),i.length!==0&&(r=`${i}/${r}`,o=i.charCodeAt(0)===ae)}return r=so(r,!o),o?`/${r}`:r.length>0?r:"."}var ae=47,rt=46;function so(e,t){let r="",o=-1,n=0,s,i=!1;for(let a=0;a<=e.length;++a){if(a<e.length)s=e.charCodeAt(a);else{if(s===ae)break;s=ae}if(s===ae){if(!(o===a-1||n===1))if(o!==a-1&&n===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==rt||r.charCodeAt(r.length-2)!==rt){if(r.length>2){let c=r.length-1,u=c;for(;u>=0&&r.charCodeAt(u)!==ae;--u);if(u!==c){r=u===-1?"":r.slice(0,u),o=a,n=0,i=!1;continue}}else if(r.length===2||r.length===1){r="",o=a,n=0,i=!1;continue}}t&&(r.length>0?r+="/..":r="..",i=!0)}else{let c=e.slice(o+1,a);r.length>0?r+=`/${c}`:r=c,i=!1}o=a,n=0}else s===rt&&n!==-1?++n:n=-1}return r}var ce=class{constructor(t){this.handle=t instanceof ArrayBuffer?new Blob([t]):t,this.size=t instanceof ArrayBuffer?t.byteLength:t.size,this.bigsize=BigInt(this.size),this.url=t instanceof File?t.name:""}async close(){}async stat(){return{size:this.handle.size,bigsize:BigInt(this.handle.size),isDirectory:!1}}async read(t,r){return await this.handle.slice(t,t+r).arrayBuffer()}};var fe=new Error("Not implemented"),ue=class{constructor(t,r,o){if(this.size=0,this.bigsize=0n,this.url="",globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(t,r,o);throw h?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(t,r){throw fe}async write(t,r,o){throw fe}async stat(){throw fe}async truncate(t){throw fe}async append(t){throw fe}async close(){}};var Mt=e=>typeof e=="boolean",w=e=>typeof e=="function",k=e=>e!==null&&typeof e=="object",le=e=>k(e)&&e.constructor==={}.constructor,Ut=e=>k(e)&&w(e.then),me=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",pe=e=>e&&typeof e[Symbol.asyncIterator]=="function",he=e=>e&&w(e.next),p=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var d=e=>typeof Blob<"u"&&e instanceof Blob,jt=e=>e&&typeof e=="object"&&e.isBuffer,io=e=>k(e)&&w(e.abort)&&w(e.getWriter),ao=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||k(e)&&w(e.tee)&&w(e.cancel)&&w(e.getReader),co=e=>k(e)&&w(e.end)&&w(e.write)&&Mt(e.writable),fo=e=>k(e)&&w(e.read)&&w(e.pipe)&&Mt(e.readable),O=e=>ao(e)||fo(e),Dt=e=>io(e)||co(e);var uo=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,lo=/^([-\w.]+\/[-\w.+]+)/;function $t(e){let t=lo.exec(e);return t?t[1]:e}function ot(e){let t=uo.exec(e);return t?t[1]:""}var zt=/\?.*/;function Vt(e){let t=e.match(zt);return t&&t[0]}function H(e){return e.replace(zt,"")}function b(e){return p(e)?e.url:d(e)?e.name||"":typeof e=="string"?e:""}function de(e){if(p(e)){let t=e,r=t.headers.get("content-type")||"",o=H(t.url);return $t(r)||ot(o)}return d(e)?e.type||"":typeof e=="string"?ot(e):""}function Ht(e){return p(e)?e.headers["content-length"]||-1:d(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function be(e){if(p(e))return e;let t={},r=Ht(e);r>=0&&(t["content-length"]=String(r));let o=b(e),n=de(e);n&&(t["content-type"]=n);let s=await po(e);s&&(t["x-first-bytes"]=s),typeof e=="string"&&(e=new TextEncoder().encode(e));let i=new Response(e,{headers:t});return Object.defineProperty(i,"url",{value:o}),i}async function nt(e){if(!e.ok){let t=await mo(e);throw new Error(t)}}async function mo(e){let t=`Failed to fetch resource ${e.url} (${e.status}): `;try{let r=e.headers.get("Content-Type"),o=e.statusText;r?.includes("application/json")&&(o+=` ${await e.text()}`),t+=o,t=t.length>60?`${t.slice(0,60)}...`:t}catch{}return t}async function po(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(o=>{let n=new FileReader;n.onload=s=>o(s?.target?.result),n.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${ho(r)}`}return null}function ho(e){let t="",r=new Uint8Array(e);for(let o=0;o<r.byteLength;o++)t+=String.fromCharCode(r[o]);return btoa(t)}function go(e){return!yo(e)&&!wo(e)}function yo(e){return e.startsWith("http:")||e.startsWith("https:")}function wo(e){return e.startsWith("data:")}async function M(e,t){if(typeof e=="string"){let r=F(e);return go(r)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(r,t):await fetch(r,t)}return await be(e)}async function Gt(e,t,r){e instanceof Blob||(e=new Blob([e]));let o=e.slice(t,t+r);return await bo(o)}async function bo(e){return await new Promise((t,r)=>{let o=new FileReader;o.onload=n=>t(n?.target?.result),o.onerror=n=>r(n),o.readAsArrayBuffer(e)})}function st(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function x(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||st()}var xo=globalThis.self||globalThis.window||globalThis.global,G=globalThis.window||globalThis.self||globalThis.global,To=globalThis.document||{},U=globalThis.process||{},Ao=globalThis.console,bi=globalThis.navigator||{};var xe=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",Ai=x();function _o(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Te=class{constructor(t,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";f(this,"storage",void 0),f(this,"id",void 0),f(this,"config",void 0),this.storage=_o(o),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function qt(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function Qt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function Ae(e,t,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,n=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>o&&(r=Math.min(r,o/e.width));let s=e.width*r,i=e.height*r,a=["font-size:1px;","padding:".concat(Math.floor(i/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(i,"px;"),"background:url(".concat(n,");"),"background-size:".concat(s,"px ").concat(i,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),a]}var _e;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(_e||(_e={}));var ko=10;function Jt(e){return typeof e!="string"?e:(e=e.toUpperCase(),_e[e]||_e.WHITE)}function Kt(e,t,r){if(!x&&typeof e=="string"){if(t){let o=Jt(t);e="\x1B[".concat(o,"m").concat(e,"\x1B[39m")}if(r){let o=Jt(r);e="\x1B[".concat(o+ko,"m").concat(e,"\x1B[49m")}}return e}function Yt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),o=Object.getOwnPropertyNames(r),n=e;for(let s of o){let i=n[s];typeof i=="function"&&(t.find(a=>s===a)||(n[s]=i.bind(e)))}}function q(e,t){if(!e)throw new Error(t||"Assertion failed")}function j(){let e;if(x()&&G.performance){var t,r;e=G===null||G===void 0||(t=G.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in U){var o;let n=U===null||U===void 0||(o=U.hrtime)===null||o===void 0?void 0:o.call(U);e=n[0]*1e3+n[1]/1e6}else e=Date.now();return e}var Q={debug:x()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},So={enabled:!0,level:0};function y(){}var Zt={},Xt={once:!0},S=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};f(this,"id",void 0),f(this,"VERSION",xe),f(this,"_startTs",j()),f(this,"_deltaTs",j()),f(this,"_storage",void 0),f(this,"userData",{}),f(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new Te("__probe-".concat(this.id,"__"),So),this.timeStamp("".concat(this.id," started")),Yt(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((j()-this._startTs).toPrecision(10))}getDelta(){return Number((j()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){q(t,r)}warn(t){return this._getLogFunction(0,t,Q.warn,arguments,Xt)}error(t){return this._getLogFunction(0,t,Q.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,Q.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Q.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Q.debug||Q.info,arguments,Xt)}table(t,r,o){return r?this._getLogFunction(t,r,console.table||y,o&&[o],{tag:Ro(r)}):y}image(t){let{logLevel:r,priority:o,image:n,message:s="",scale:i=1}=t;return this._shouldLog(r||o)?x()?Lo({image:n,message:s,scale:i}):Bo({image:n,message:s,scale:i}):y}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||y)}group(t,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},n=er({logLevel:t,message:r,opts:o}),{collapsed:s}=o;return n.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(t,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},o,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||y)}withGroup(t,r,o){this.group(t,r)();try{o()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=tr(t)}_getLogFunction(t,r,o,n,s){if(this._shouldLog(t)){s=er({logLevel:t,message:r,args:n,opts:s}),o=o||s.method,q(o),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=j();let i=s.tag||s.message;if(s.once&&i)if(!Zt[i])Zt[i]=j();else return y;return r=Eo(this.id,s.message,s),o.bind(console,r,...s.args)}return y}};f(S,"VERSION",xe);function tr(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return q(Number.isFinite(t)&&t>=0),t}function er(e){let{logLevel:t,message:r}=e;e.logLevel=tr(t);let o=e.args?Array.from(e.args):[];for(;o.length&&o.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&o.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let n=typeof e.message;return q(n==="string"||n==="object"),Object.assign(e,{args:o},e.opts)}function Eo(e,t,r){if(typeof t=="string"){let o=r.time?Qt(qt(r.total)):"";t=r.time?"".concat(e,": ").concat(o," ").concat(t):"".concat(e,": ").concat(t),t=Kt(t,r.color,r.background)}return t}function Bo(e){let{image:t,message:r="",scale:o=1}=e;return console.warn("removed"),y}function Lo(e){let{image:t,message:r="",scale:o=1}=e;if(typeof t=="string"){let s=new Image;return s.onload=()=>{let i=Ae(s,r,o);console.log(...i)},s.src=t,y}let n=t.nodeName||"";if(n.toLowerCase()==="img")return console.log(...Ae(t,r,o)),y;if(n.toLowerCase()==="canvas"){let s=new Image;return s.onload=()=>console.log(...Ae(s,r,o)),s.src=t.toDataURL(),y}return y}function Ro(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Ji=new S({id:"@probe.gl/log"});var it=new S({id:"loaders.gl"}),ke=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},Se=class{constructor(){this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}};var at={fetch:null,mimeType:void 0,nothrow:!1,log:new Se,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:h,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},rr={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function ge(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function L(){let e=ge();return e.globalOptions=e.globalOptions||{...at},e.globalOptions}function ct(e){let t=ge(),r=L();t.globalOptions=sr(r,e)}function J(e,t,r,o){return r=r||[],r=Array.isArray(r)?r:[r],Io(e,r),sr(t,e,o)}function Io(e,t){or(e,null,at,rr,t);for(let r of t){let o=e&&e[r.id]||{},n=r.options&&r.options[r.id]||{},s=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};or(o,r.id,n,s,t)}}function or(e,t,r,o,n){let s=t||"Top level",i=t?`${t}.`:"";for(let a in e){let c=!t&&k(e[a]),u=a==="baseUri"&&!t,B=a==="workerUrl"&&t;if(!(a in r)&&!u&&!B){if(a in o)it.warn(`${s} loader option '${i}${a}' no longer supported, use '${o[a]}'`)();else if(!c){let R=vo(a,n);it.warn(`${s} loader option '${i}${a}' not recognized. ${R}`)()}}}}function vo(e,t){let r=e.toLowerCase(),o="";for(let n of t)for(let s in n.options){if(e===s)return`Did you mean '${n.id}.${s}'?`;let i=s.toLowerCase();(r.startsWith(i)||i.startsWith(r))&&(o=o||`Did you mean '${n.id}.${s}'?`)}return o}function sr(e,t,r){let n={...e.options||{}};return Fo(n,r),n.log===null&&(n.log=new ke),nr(n,L()),nr(n,t),n}function nr(e,t){for(let r in t)if(r in t){let o=t[r];le(o)&&le(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function Fo(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function T(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e?.extensions)):!1}function ye(e){D(e,"null loader"),D(T(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e?.parseTextSync||e?.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var ir=()=>{let e=ge();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function ar(e){let t=ir();e=Array.isArray(e)?e:[e];for(let r of e){let o=ye(r);t.find(n=>o===n)||t.unshift(o)}}function cr(){return ir()}function fr(){let e=ge();e.loaderRegistry=[]}var ur=new S({id:"loaders.gl"});var Po=/\.([^.]+)$/;async function Y(e,t=[],r,o){if(!mr(e))return null;let n=K(e,t,{...r,nothrow:!0},o);if(n)return n;if(d(e)&&(e=await e.slice(0,10).arrayBuffer(),n=K(e,t,r,o)),!n&&!r?.nothrow)throw new Error(pr(e));return n}function K(e,t=[],r,o){if(!mr(e))return null;if(t&&!Array.isArray(t))return ye(t);let n=[];t&&(n=n.concat(t)),r?.ignoreRegisteredLoaders||n.push(...cr()),Wo(n);let s=No(e,n,r,o);if(!s&&!r?.nothrow)throw new Error(pr(e));return s}function No(e,t,r,o){let n=b(e),s=de(e),i=H(n)||o?.url,a=null,c="";return r?.mimeType&&(a=ft(t,r?.mimeType),c=`match forced by supplied MIME type ${r?.mimeType}`),a=a||Co(t,i),c=c||(a?`matched url ${i}`:""),a=a||ft(t,s),c=c||(a?`matched MIME type ${s}`:""),a=a||Mo(t,e),c=c||(a?`matched initial data ${hr(e)}`:""),r?.fallbackMimeType&&(a=a||ft(t,r?.fallbackMimeType),c=c||(a?`matched fallback MIME type ${s}`:"")),c&&ur.log(1,`selectLoader selected ${a?.name}: ${c}.`),a}function mr(e){return!(e instanceof Response&&e.status===204)}function pr(e){let t=b(e),r=de(e),o="No valid loader found (";o+=t?`${C.filename(t)}, `:"no url provided, ",o+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let n=e?hr(e):"";return o+=n?` first bytes: "${n}"`:"first bytes: not available",o+=")",o}function Wo(e){for(let t of e)ye(t)}function Co(e,t){let r=t&&Po.exec(t),o=r&&r[1];return o?Oo(e,o):null}function Oo(e,t){t=t.toLowerCase();for(let r of e)for(let o of r.extensions)if(o.toLowerCase()===t)return r;return null}function ft(e,t){for(let r of e)if(r.mimeTypes&&r.mimeTypes.includes(t)||t===`application/x.${r.id}`)return r;return null}function Mo(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(Uo(t,r))return r}else if(ArrayBuffer.isView(t)){if(lr(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&lr(t,0,r))return r;return null}function Uo(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(o=>e.startsWith(o))}function lr(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(n=>jo(e,t,r,n))}function jo(e,t,r,o){if(o instanceof ArrayBuffer)return Ve(o,e,o.byteLength);switch(typeof o){case"function":return o(e);case"string":let n=ut(e,t,o.length);return o===n;default:return!1}}function hr(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?ut(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?ut(e,0,t):""}function ut(e,t,r){if(e.byteLength<t+r)return"";let o=new DataView(e),n="";for(let s=0;s<r;s++)n+=String.fromCharCode(o.getUint8(t+s));return n}function*dr(e,t){let r=t?.chunkSize||262144,o=0,n=new TextEncoder;for(;o<e.length;){let s=Math.min(e.length-o,r),i=e.slice(o,o+s);o+=s,yield n.encode(i)}}function*gr(e,t={}){let{chunkSize:r=262144}=t,o=0;for(;o<e.byteLength;){let n=Math.min(e.byteLength-o,r),s=new ArrayBuffer(n),i=new Uint8Array(e,o,n);new Uint8Array(s).set(i),o+=n,yield s}}async function*yr(e,t){let r=t?.chunkSize||1048576,o=0;for(;o<e.size;){let n=o+r,s=await e.slice(o,n).arrayBuffer();o=n,yield s}}function lt(e,t){return h?Do(e,t):$o(e,t)}async function*Do(e,t){let r=e.getReader(),o;try{for(;;){let n=o||r.read();t?._streamReadAhead&&(o=r.read());let{done:s,value:i}=await n;if(s)return;yield we(i)}}catch{r.releaseLock()}}async function*$o(e,t){for await(let r of e)yield we(r)}function Z(e,t){if(typeof e=="string")return dr(e,t);if(e instanceof ArrayBuffer)return gr(e,t);if(d(e))return yr(e,t);if(O(e))return lt(e,t);if(p(e))return lt(e.body,t);throw new Error("makeIterator")}var mt="Cannot convert supplied data type";function pt(e,t,r){if(t.text&&typeof e=="string")return e;if(jt(e)&&(e=e.buffer),e instanceof ArrayBuffer){let o=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(o):o}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let o=e.buffer,n=e.byteLength||e.length;return(e.byteOffset!==0||n!==o.byteLength)&&(o=o.slice(e.byteOffset,e.byteOffset+n)),o}throw new Error(mt)}async function wr(e,t,r){let o=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||o)return pt(e,t,r);if(d(e)&&(e=await be(e)),p(e)){let n=e;return await nt(n),t.binary?await n.arrayBuffer():await n.text()}if(O(e)&&(e=Z(e,r)),me(e)||pe(e))return N(e);throw new Error(mt)}async function br(e,t){if(he(e))return e;if(p(e)){let r=e;await nt(r);let o=await r.body;return Z(o,t)}return d(e)||O(e)?Z(e,t):pe(e)?e:zo(e)}function zo(e){if(ArrayBuffer.isView(e))return function*(){yield e.buffer}();if(e instanceof ArrayBuffer)return function*(){yield e}();if(he(e))return e;if(me(e))return e[Symbol.iterator]();throw new Error(mt)}function X(e,t){let r=L(),o=e||r;return typeof o.fetch=="function"?o.fetch:k(o.fetch)?n=>M(n,o.fetch):t?.fetch?t?.fetch:M}function ee(e,t,r){if(r)return r;let o={fetch:X(t,e),...e};if(o.url){let n=H(o.url);o.baseUrl=n,o.queryString=Vt(o.url),o.filename=C.filename(n),o.baseUrl=C.dirname(n)}return Array.isArray(o.loaders)||(o.loaders=null),o}function Ee(e,t){if(e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let o=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...o]:o}return r&&r.length?r:void 0}async function E(e,t,r,o){t&&!Array.isArray(t)&&!T(t)&&(o=void 0,r=t,t=void 0),e=await e,r=r||{};let n=b(e),i=Ee(t,o),a=await Y(e,i,r);return a?(r=J(r,a,i,n),o=ee({url:n,_parse:E,loaders:i},r,o||null),await Vo(a,e,r,o)):null}async function Vo(e,t,r,o){if(je(e),r=Ne(e.options,r),p(t)){let s=t,{ok:i,redirected:a,status:c,statusText:u,type:B,url:R}=s,At=Object.fromEntries(s.headers.entries());o.response={headers:At,ok:i,redirected:a,status:c,statusText:u,type:B,url:R}}t=await wr(t,e,r);let n=e;if(n.parseTextSync&&typeof t=="string")return n.parseTextSync(t,r,o);if(De(e,r))return await $e(e,t,r,o,E);if(n.parseText&&typeof t=="string")return await n.parseText(t,r,o);if(n.parse)return await n.parse(t,r,o);throw m(!n.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function xr(e,t,r,o){!Array.isArray(t)&&!T(t)&&(o=void 0,r=t,t=void 0),r=r||{};let s=Ee(t,o),i=K(e,s,r);if(!i)return null;r=J(r,i,s);let a=b(e),c=()=>{throw new Error("parseSync called parse (which is async")};return o=ee({url:a,_parseSync:c,_parse:c,loaders:t},r,o||null),Ho(i,e,r,o)}function Ho(e,t,r,o){if(t=pt(t,e,r),e.parseTextSync&&typeof t=="string")return e.parseTextSync(t,r);if(e.parseSync&&t instanceof ArrayBuffer)return e.parseSync(t,r,o);throw new Error(`${e.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${o.url||""}`)}function ht(e){switch(typeof e=="object"&&e?.shape){case"array-row-table":case"object-row-table":return Array.isArray(e.data);case"geojson-table":return Array.isArray(e.features);case"columnar-table":return e.data&&typeof e.data=="object";case"arrow-table":return Boolean(e?.data?.numRows!==void 0);default:return!1}}function dt(e){switch(e.shape){case"array-row-table":case"object-row-table":return e.data.length;case"geojson-table":return e.features.length;case"arrow-table":return e.data.numRows;case"columnar-table":for(let r of Object.values(e.data))return r.length||0;return 0;default:throw new Error("table")}}function gt(e){return{...e,length:dt(e),batchType:"data"}}async function P(e,t,r,o){let n=Array.isArray(t)?t:void 0;!Array.isArray(t)&&!T(t)&&(o=void 0,r=t,t=void 0),e=await e,r=r||{};let s=b(e),i=await Y(e,t,r);return i?(r=J(r,i,n,s),o=ee({url:s,_parseInBatches:P,_parse:E,loaders:n},r,o||null),await Go(i,e,r,o)):[]}async function Go(e,t,r,o){let n=await qo(e,t,r,o);if(!r.metadata)return n;let s={shape:"metadata",batchType:"metadata",metadata:{_loader:e,_context:o},data:[],bytesUsed:0};async function*i(a){yield s,yield*a}return i(n)}async function qo(e,t,r,o){let n=await br(t,r),s=await Ko(n,r?.transforms||[]);return e.parseInBatches?e.parseInBatches(s,r,o):Qo(s,e,r,o)}async function*Qo(e,t,r,o){let n=await N(e),s=await E(n,t,{...r,mimeType:t.mimeTypes[0]},o);yield Jo(s,t)}function Jo(e,t){let r=ht(e)?gt(e):{shape:"unknown",batchType:"data",data:e,length:Array.isArray(e)?e.length:1};return r.mimeType=t.mimeTypes[0],r}async function Ko(e,t=[]){let r=e;for await(let o of t)r=o(r);return r}async function Tr(e,t,r,o){let n,s;!Array.isArray(t)&&!T(t)?(n=[],s=t,o=void 0):(n=t,s=r);let i=X(s),a=e;return typeof e=="string"&&(a=await i(e)),d(e)&&(a=await i(e)),Array.isArray(n)?await E(a,n,s):await E(a,n,s)}function _r(e,t,r,o){let n;!Array.isArray(t)&&!T(t)?(o=void 0,r=t,n=void 0):n=t;let s=X(r||{});return Array.isArray(e)?e.map(a=>Ar(a,n,r||{},s)):Ar(e,n,r||{},s)}async function Ar(e,t,r,o){if(typeof e=="string"){let s=await o(e);return Array.isArray(t)?await P(s,t,r):await P(s,t,r)}return Array.isArray(t)?await P(e,t,r):await P(e,t,r)}async function yt(e,t,r){if(t.encode)return await t.encode(e,r);if(t.encodeText){let o=await t.encodeText(e,r);return new TextEncoder().encode(o)}if(t.encodeInBatches){let o=wt(e,t,r),n=[];for await(let s of o)n.push(s);return se(...n)}throw new Error("Writer could not encode data")}async function kr(e,t,r){if(t.text&&t.encodeText)return await t.encodeText(e,r);if(t.text){let o=await yt(e,t,r);return new TextDecoder().decode(o)}throw new Error(`Writer ${t.name} could not encode data as text`)}function wt(e,t,r){if(t.encodeInBatches){let o=Yo(e);return t.encodeInBatches(o,r)}throw new Error("Writer could not encode data in batches")}function Yo(e){return[{...e,start:0,end:e.length}]}async function Er(e,t,r){return r={...L(),...r},t.encodeURLtoURL?Zo(t,e,r):ze(t,r)?await Ue(t,e,r):await t.encode(e,r)}function bt(e,t,r){if(t.encodeSync)return t.encodeSync(e,r);if(t.encodeTextSync)return new TextEncoder().encode(t.encodeTextSync(e,r));throw new Error(`Writer ${t.name} could not synchronously encode data`)}async function Br(e,t,r){if(t.encodeText)return await t.encodeText(e,r);if(t.encodeTextSync)return t.encodeTextSync(e,r);if(t.text){let o=await t.encode(e,r);return new TextDecoder().decode(o)}throw new Error(`Writer ${t.name} could not encode data as text`)}function Lr(e,t,r){if(t.encodeTextSync)return t.encodeTextSync(e,r);if(t.text&&t.encodeSync){let o=bt(e,t,r);return new TextDecoder().decode(o)}throw new Error(`Writer ${t.name} could not encode data as text`)}function Rr(e,t,r){if(t.encodeInBatches){let o=Xo(e);return t.encodeInBatches(o,r)}throw new Error(`Writer ${t.name} could not encode in batches`)}async function xt(e,t,r,o){if(e=F(e),t=F(t),h||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,o)}async function Zo(e,t,r){if(h)throw new Error(`Writer ${e.name} not supported in browser`);let o=Sr("input");await new ue(o,"w").write(t);let s=Sr("output"),i=await xt(o,s,e,r);return(await M(i)).arrayBuffer()}function Xo(e){return[{...e,start:0,end:e.length}]}function Sr(e){return`/tmp/${e}`}function Ir(e,t){if(globalThis.loaders.makeNodeStream)return globalThis.loaders.makeNodeStream(e,t);let r=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new ReadableStream({type:"bytes",async pull(o){try{let{done:n,value:s}=await r.next();n?o.close():o.enqueue(new Uint8Array(s))}catch(n){o.error(n)}},async cancel(){await r?.return?.()}},{highWaterMark:2**24,...t})}var vr="4.2.0-alpha.4",Fr={name:"Null loader",id:"null",module:"core",version:vr,worker:!0,mimeTypes:["application/x.empty"],extensions:["null"],tests:[()=>!1],options:{null:{}}},Pr={name:"Null loader",id:"null",module:"core",version:vr,mimeTypes:["application/x.empty"],extensions:["null"],parse:async(e,t,r)=>Tt(e,t||{},r),parseSync:Tt,parseInBatches:async function*(t,r,o){for await(let n of t)yield Tt(n,r,o)},tests:[()=>!1],options:{null:{}}};function Tt(e,t,r){return null}async function Nr(e,t,r=()=>{},o=()=>{}){if(e=await e,!e.ok)return e;let n=e.body;if(!n)return e;let s=e.headers.get("content-length")||0,i=s?parseInt(s):0;if(!(i>0)||typeof ReadableStream>"u"||!n.getReader)return e;let a=new ReadableStream({async start(c){let u=n.getReader();await Wr(c,u,0,i,t,r,o)}});return new Response(a)}async function Wr(e,t,r,o,n,s,i){try{let{done:a,value:c}=await t.read();if(a){s(),e.close();return}r+=c.byteLength;let u=Math.round(r/o*100);n(u,{loadedBytes:r,totalBytes:o}),e.enqueue(c),await Wr(e,t,r,o,n,s,i)}catch(a){e.error(a),i(a)}}var Be=class{constructor(t,r){this.files={},this.lowerCaseFiles={},this.usedFiles={},this._fetch=r?.fetch||fetch;for(let o=0;o<t.length;++o){let n=t[o];this.files[n.name]=n,this.lowerCaseFiles[n.name.toLowerCase()]=n,this.usedFiles[n.name]=!1}this.fetch=this.fetch.bind(this)}async fetch(t,r){if(t.includes("://"))return this._fetch(t,r);let o=this.files[t];if(!o)return new Response(t,{status:400,statusText:"NOT FOUND"});let s=new Headers(r?.headers).get("Range"),i=s&&/bytes=($1)-($2)/.exec(s);if(i){let c=parseInt(i[1]),u=parseInt(i[2]),B=await o.slice(c,u).arrayBuffer(),R=new Response(B);return Object.defineProperty(R,"url",{value:t}),R}let a=new Response(o);return Object.defineProperty(a,"url",{value:t}),a}async readdir(t){let r=[];for(let o in this.files)r.push(o);return r}async stat(t,r){let o=this.files[t];if(!o)throw new Error(t);return{size:o.size}}async unlink(t){delete this.files[t],delete this.lowerCaseFiles[t],this.usedFiles[t]=!0}async openReadableFile(t,r){return new ce(this.files[t])}_getFile(t,r){let o=this.files[t]||this.lowerCaseFiles[t];return o&&r&&(this.usedFiles[t]=!0),o}};return jr(en);})();
|
|
12
|
+
}`}function Me(e,t=!0,r){let o=r||new Set;if(e){if(Pt(e))o.add(e);else if(Pt(e.buffer))o.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(let n in e)Me(e[n],t,o)}}return r===void 0?Array.from(o):[]}function Pt(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}function Oe(e){if(e===null)return{};let t=Object.assign({},e);return Object.keys(t).forEach(r=>{typeof e[r]=="object"&&!ArrayBuffer.isView(e[r])&&!(e[r]instanceof Array)?t[r]=Oe(e[r]):typeof t[r]=="function"||t[r]instanceof RegExp?t[r]={}:t[r]=e[r]}),t}var Ue=()=>{},I=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&d||typeof z<"u"&&!d}constructor(t){let{name:r,source:o,url:n}=t;l(o||n),this.name=r,this.source=o,this.url=n,this.onMessage=Ue,this.onError=s=>console.log(s),this.worker=d?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=Ue,this.onError=Ue,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,r){r=r||Me(t),this.worker.postMessage(t,r)}_getErrorFromErrorEvent(t){let r="Failed to load ";return r+=`worker ${this.name} from ${this.url}. `,t.message&&(r+=`${t.message} in `),t.lineno&&(r+=`:${t.lineno}:${t.colno}`),new Error(r)}_createBrowserWorker(){this._loadableURL=Ft({source:this.source,url:this.url});let t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=r=>{r.data?this.onMessage(r.data):this.onError(new Error("No data received"))},t.onerror=r=>{this.onError(this._getErrorFromErrorEvent(r)),this.terminated=!0},t.onmessageerror=r=>console.error(r),t}_createNodeWorker(){let t;if(this.url){let o=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;t=new z(o,{eval:!1})}else if(this.source)t=new z(this.source,{eval:!0});else throw new Error("no worker");return t.on("message",r=>{this.onMessage(r)}),t.on("error",r=>{this.onError(r)}),t.on("exit",r=>{}),t}};var ne=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return I.isSupported()}constructor(t){this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},t.name!==void 0&&(this.name=t.name),t.maxConcurrency!==void 0&&(this.maxConcurrency=t.maxConcurrency),t.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=t.maxMobileConcurrency),t.reuseWorkers!==void 0&&(this.reuseWorkers=t.reuseWorkers),t.onDebug!==void 0&&(this.onDebug=t.onDebug)}async startJob(t,r=(n,s,i)=>n.done(i),o=(n,s)=>n.error(s)){let n=new Promise(s=>(this.jobQueue.push({name:t,onMessage:r,onError:o,onStart:s}),this));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;let t=this._getAvailableWorker();if(!t)return;let r=this.jobQueue.shift();if(r){this.onDebug({message:"Starting job",name:r.name,workerThread:t,backlog:this.jobQueue.length});let o=new oe(r.name,t);t.onMessage=n=>r.onMessage(o,n.type,n.payload),t.onError=n=>r.onError(o,n),r.onStart(o);try{await o.result}catch(n){console.error(`Worker exception: ${n}`)}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){!d||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let t=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new I({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return It?this.maxMobileConcurrency:this.maxConcurrency}};var Qr={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},N=class{props;workerPools=new Map;static isSupported(){return I.isSupported()}static getWorkerFarm(t={}){return N._workerFarm=N._workerFarm||new N({}),N._workerFarm.setProps(t),N._workerFarm}constructor(t){this.props={...Qr},this.setProps(t),this.workerPools=new Map}destroy(){for(let t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(let r of this.workerPools.values())r.setProps(this._getWorkerPoolProps())}getWorkerPool(t){let{name:r,source:o,url:n}=t,s=this.workerPools.get(r);return s||(s=new ne({name:r,source:o,url:n}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(r,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},g=N;St(g,"_workerFarm");function Nt(e){let t=e.version!==re?` (worker-utils@${re})`:"";return`${e.name}@${e.version}${t}`}function se(e,t={}){let r=t[e.id]||{},o=d?`${e.id}-worker.js`:`${e.id}-worker-node.js`,n=r.workerUrl;if(!n&&e.id==="compression"&&(n=t.workerUrl),t._workerType==="test"&&(d?n=`modules/${e.module}/dist/${o}`:n=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!n){let s=e.version;s==="latest"&&(s=Lt);let i=s?`@${s}`:"";n=`https://unpkg.com/@loaders.gl/${e.module}${i}/dist/${o}`}return l(n),n}async function je(e,t,r={},o={}){let n=Nt(e),s=g.getWorkerFarm(r),{source:i}=r,a={name:n,source:i};i||(a.url=se(e,r));let c=s.getWorkerPool(a),u=r.jobName||e.name,B=await c.startJob(u,Jr.bind(null,o)),R=Oe(r);return B.postMessage("process",{input:t,options:R}),(await B.result).result}async function Jr(e,t,r,o){switch(r){case"done":t.done(o);break;case"error":t.error(new Error(o.error));break;case"process":let{id:n,input:s,options:i}=o;try{if(!e.process){t.postMessage("error",{id:n,error:"Worker not set up to process on main thread"});return}let a=await e.process(s,i);t.postMessage("done",{id:n,result:a})}catch(a){let c=a instanceof Error?a.message:"unknown error";t.postMessage("error",{id:n,error:c})}break;default:console.warn(`process-on-worker: unknown message ${r}`)}}function De(e,t=re){l(e,"no worker provided");let r=e.version;return!(!t||!r)}function $e(e,t){return!g.isSupported()||!d&&!t?._nodeWorkers?!1:e.worker&&t?.worker}async function ze(e,t,r,o,n){let s=e.id,i=se(e,r),c=g.getWorkerFarm(r).getWorkerPool({name:s,url:i});r=JSON.parse(JSON.stringify(r)),o=JSON.parse(JSON.stringify(o||{}));let u=await c.startJob("process-on-worker",Kr.bind(null,n));return u.postMessage("process",{input:t,options:r,context:o}),await(await u.result).result}async function Kr(e,t,r,o){switch(r){case"done":t.done(o);break;case"error":t.error(new Error(o.error));break;case"process":let{id:n,input:s,options:i}=o;try{let a=await e(s,i);t.postMessage("done",{id:n,result:a})}catch(a){let c=a instanceof Error?a.message:"unknown error";t.postMessage("error",{id:n,error:c})}break;default:console.warn(`parse-with-worker unknown message ${r}`)}}function Ve(e,t){return!g.isSupported()||!p&&!t?._nodeWorkers?!1:e.worker&&t?.worker}function He(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let o=new Uint8Array(e),n=new Uint8Array(t);for(let s=0;s<o.length;++s)if(o[s]!==n[s])return!1;return!0}function ie(...e){return Wt(e)}function Wt(e){let t=e.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),r=t.reduce((s,i)=>s+i.byteLength,0),o=new Uint8Array(r),n=0;for(let s of t)o.set(s,n),n+=s.byteLength;return o.buffer}async function*Ge(e,t={}){let r=new TextDecoder(void 0,t);for await(let o of e)yield typeof o=="string"?o:r.decode(o,{stream:!0})}async function*qe(e){let t=new TextEncoder;for await(let r of e)yield typeof r=="string"?t.encode(r):r}async function*Qe(e){let t="";for await(let r of e){t+=r;let o;for(;(o=t.indexOf(`
|
|
13
|
+
`))>=0;){let n=t.slice(0,o+1);t=t.slice(o+1),yield n}}t.length>0&&(yield t)}async function*Je(e){let t=1;for await(let r of e)yield{counter:t,line:r},t++}async function Ke(e,t){for(;;){let{done:r,value:o}=await e.next();if(r){e.return();return}if(t(o))return}}async function W(e){let t=[];for await(let r of e)t.push(r);return ie(...t)}function F(e){return F=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F(e)}function Ye(e,t){if(F(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t||"default");if(F(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ze(e){var t=Ye(e,"string");return F(t)==="symbol"?t:String(t)}function f(e,t,r){return t=Ze(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ae(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var C=class{constructor(t,r){f(this,"name",void 0),f(this,"type",void 0),f(this,"sampleSize",1),f(this,"time",0),f(this,"count",0),f(this,"samples",0),f(this,"lastTiming",0),f(this,"lastSampleTime",0),f(this,"lastSampleCount",0),f(this,"_count",0),f(this,"_time",0),f(this,"_samples",0),f(this,"_startTime",0),f(this,"_timerPending",!1),this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=ae(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(ae()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var V=class{constructor(t){f(this,"id",void 0),f(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:o}=t,n=this.stats[r];return n||(t instanceof C?n=t:n=new C(r,o),this.stats[r]=n),n}};var Yr="Queued Requests",Zr="Active Requests",Xr="Cancelled Requests",eo="Queued Requests Ever",to="Active Requests Ever",ro={id:"request-scheduler",throttleRequests:!0,maxRequests:6,debounceTime:0},H=class{props;stats;activeRequestCount=0;requestQueue=[];requestMap=new Map;updateTimer=null;constructor(t={}){this.props={...ro,...t},this.stats=new V({id:this.props.id}),this.stats.get(Yr),this.stats.get(Zr),this.stats.get(Xr),this.stats.get(eo),this.stats.get(to)}scheduleRequest(t,r=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);let o={handle:t,priority:0,getPriority:r},n=new Promise(s=>(o.resolve=s,o));return this.requestQueue.push(o),this.requestMap.set(t,n),this._issueNewRequests(),n}_issueRequest(t){let{handle:r,resolve:o}=t,n=!1,s=()=>{n||(n=!0,this.requestMap.delete(r),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,o?o({done:s}):Promise.resolve({done:s})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;let t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(t!==0){this._updateAllRequests();for(let r=0;r<t;++r){let o=this.requestQueue.shift();o&&this._issueRequest(o)}}}_updateAllRequests(){let t=this.requestQueue;for(let r=0;r<t.length;++r){let o=t[r];this._updateRequest(o)||(t.splice(r,1),this.requestMap.delete(o.handle),r--)}t.sort((r,o)=>r.priority-o.priority)}_updateRequest(t){return t.priority=t.getPriority(t.handle),t.priority<0?(t.resolve(null),!1):!0}};var Xe="",Ct={};function et(e){Xe=e}function tt(){return Xe}function v(e){for(let t in Ct)if(e.startsWith(t)){let r=Ct[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${Xe}${e}`),e}var oo="4.2.0-alpha.5",rt={name:"JSON",id:"json",module:"json",version:oo,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:Mt,parse:async e=>Mt(new TextDecoder().decode(e)),options:{}};function Mt(e){return JSON.parse(e)}function Ot(e){return e&&typeof e=="object"&&e.isBuffer}function xe(e){if(Ot(e))return e;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}var M={};kt(M,{dirname:()=>so,filename:()=>no,join:()=>io,resolve:()=>ao});function Ut(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function no(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function so(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function io(...e){let t="/";return e=e.map((r,o)=>(o&&(r=r.replace(new RegExp(`^${t}`),"")),o!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function ao(...e){let t=[];for(let s=0;s<e.length;s++)t[s]=e[s];let r="",o=!1,n;for(let s=t.length-1;s>=-1&&!o;s--){let i;s>=0?i=t[s]:(n===void 0&&(n=Ut()),i=n),i.length!==0&&(r=`${i}/${r}`,o=i.charCodeAt(0)===ce)}return r=co(r,!o),o?`/${r}`:r.length>0?r:"."}var ce=47,ot=46;function co(e,t){let r="",o=-1,n=0,s,i=!1;for(let a=0;a<=e.length;++a){if(a<e.length)s=e.charCodeAt(a);else{if(s===ce)break;s=ce}if(s===ce){if(!(o===a-1||n===1))if(o!==a-1&&n===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==ot||r.charCodeAt(r.length-2)!==ot){if(r.length>2){let c=r.length-1,u=c;for(;u>=0&&r.charCodeAt(u)!==ce;--u);if(u!==c){r=u===-1?"":r.slice(0,u),o=a,n=0,i=!1;continue}}else if(r.length===2||r.length===1){r="",o=a,n=0,i=!1;continue}}t&&(r.length>0?r+="/..":r="..",i=!0)}else{let c=e.slice(o+1,a);r.length>0?r+=`/${c}`:r=c,i=!1}o=a,n=0}else s===ot&&n!==-1?++n:n=-1}return r}var fe=class{handle;size;bigsize;url;constructor(t){this.handle=t instanceof ArrayBuffer?new Blob([t]):t,this.size=t instanceof ArrayBuffer?t.byteLength:t.size,this.bigsize=BigInt(this.size),this.url=t instanceof File?t.name:""}async close(){}async stat(){return{size:this.handle.size,bigsize:BigInt(this.handle.size),isDirectory:!1}}async read(t,r){return await this.handle.slice(t,t+r).arrayBuffer()}};var ue=new Error("Not implemented"),le=class{handle;size=0;bigsize=0n;url="";constructor(t,r,o){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(t,r,o);throw p?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(t,r){throw ue}async write(t,r,o){throw ue}async stat(){throw ue}async truncate(t){throw ue}async append(t){throw ue}async close(){}};var jt=e=>typeof e=="boolean",w=e=>typeof e=="function",k=e=>e!==null&&typeof e=="object",me=e=>k(e)&&e.constructor==={}.constructor,Dt=e=>k(e)&&w(e.then),pe=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",he=e=>e&&typeof e[Symbol.asyncIterator]=="function",de=e=>e&&w(e.next),m=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var h=e=>typeof Blob<"u"&&e instanceof Blob,$t=e=>e&&typeof e=="object"&&e.isBuffer,fo=e=>k(e)&&w(e.abort)&&w(e.getWriter),uo=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||k(e)&&w(e.tee)&&w(e.cancel)&&w(e.getReader),lo=e=>k(e)&&w(e.end)&&w(e.write)&&jt(e.writable),mo=e=>k(e)&&w(e.read)&&w(e.pipe)&&jt(e.readable),O=e=>uo(e)||mo(e),zt=e=>fo(e)||lo(e);var po=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,ho=/^([-\w.]+\/[-\w.+]+)/;function Vt(e){let t=ho.exec(e);return t?t[1]:e}function nt(e){let t=po.exec(e);return t?t[1]:""}var Ht=/\?.*/;function Gt(e){let t=e.match(Ht);return t&&t[0]}function G(e){return e.replace(Ht,"")}function b(e){return m(e)?e.url:h(e)?e.name||"":typeof e=="string"?e:""}function ge(e){if(m(e)){let t=e,r=t.headers.get("content-type")||"",o=G(t.url);return Vt(r)||nt(o)}return h(e)?e.type||"":typeof e=="string"?nt(e):""}function qt(e){return m(e)?e.headers["content-length"]||-1:h(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function Te(e){if(m(e))return e;let t={},r=qt(e);r>=0&&(t["content-length"]=String(r));let o=b(e),n=ge(e);n&&(t["content-type"]=n);let s=await yo(e);s&&(t["x-first-bytes"]=s),typeof e=="string"&&(e=new TextEncoder().encode(e));let i=new Response(e,{headers:t});return Object.defineProperty(i,"url",{value:o}),i}async function st(e){if(!e.ok){let t=await go(e);throw new Error(t)}}async function go(e){let t=`Failed to fetch resource ${e.url} (${e.status}): `;try{let r=e.headers.get("Content-Type"),o=e.statusText;r?.includes("application/json")&&(o+=` ${await e.text()}`),t+=o,t=t.length>60?`${t.slice(0,60)}...`:t}catch{}return t}async function yo(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(o=>{let n=new FileReader;n.onload=s=>o(s?.target?.result),n.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${wo(r)}`}return null}function wo(e){let t="",r=new Uint8Array(e);for(let o=0;o<r.byteLength;o++)t+=String.fromCharCode(r[o]);return btoa(t)}function bo(e){return!xo(e)&&!To(e)}function xo(e){return e.startsWith("http:")||e.startsWith("https:")}function To(e){return e.startsWith("data:")}async function U(e,t){if(typeof e=="string"){let r=v(e);return bo(r)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(r,t):await fetch(r,t)}return await Te(e)}async function Qt(e,t,r){e instanceof Blob||(e=new Blob([e]));let o=e.slice(t,t+r);return await Ao(o)}async function Ao(e){return await new Promise((t,r)=>{let o=new FileReader;o.onload=n=>t(n?.target?.result),o.onerror=n=>r(n),o.readAsArrayBuffer(e)})}function it(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function x(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||it()}var _o=globalThis.self||globalThis.window||globalThis.global,q=globalThis.window||globalThis.self||globalThis.global,ko=globalThis.document||{},j=globalThis.process||{},So=globalThis.console,_i=globalThis.navigator||{};var Ae=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",Ei=x();function Eo(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var _e=class{constructor(t,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";f(this,"storage",void 0),f(this,"id",void 0),f(this,"config",void 0),this.storage=Eo(o),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function Jt(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function Kt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function ke(e,t,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,n=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>o&&(r=Math.min(r,o/e.width));let s=e.width*r,i=e.height*r,a=["font-size:1px;","padding:".concat(Math.floor(i/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(i,"px;"),"background:url(".concat(n,");"),"background-size:".concat(s,"px ").concat(i,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),a]}var Se;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Se||(Se={}));var Bo=10;function Yt(e){return typeof e!="string"?e:(e=e.toUpperCase(),Se[e]||Se.WHITE)}function Zt(e,t,r){if(!x&&typeof e=="string"){if(t){let o=Yt(t);e="\x1B[".concat(o,"m").concat(e,"\x1B[39m")}if(r){let o=Yt(r);e="\x1B[".concat(o+Bo,"m").concat(e,"\x1B[49m")}}return e}function Xt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),o=Object.getOwnPropertyNames(r),n=e;for(let s of o){let i=n[s];typeof i=="function"&&(t.find(a=>s===a)||(n[s]=i.bind(e)))}}function Q(e,t){if(!e)throw new Error(t||"Assertion failed")}function D(){let e;if(x()&&q.performance){var t,r;e=q===null||q===void 0||(t=q.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in j){var o;let n=j===null||j===void 0||(o=j.hrtime)===null||o===void 0?void 0:o.call(j);e=n[0]*1e3+n[1]/1e6}else e=Date.now();return e}var J={debug:x()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Lo={enabled:!0,level:0};function y(){}var er={},tr={once:!0},S=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};f(this,"id",void 0),f(this,"VERSION",Ae),f(this,"_startTs",D()),f(this,"_deltaTs",D()),f(this,"_storage",void 0),f(this,"userData",{}),f(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new _e("__probe-".concat(this.id,"__"),Lo),this.timeStamp("".concat(this.id," started")),Xt(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((D()-this._startTs).toPrecision(10))}getDelta(){return Number((D()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){Q(t,r)}warn(t){return this._getLogFunction(0,t,J.warn,arguments,tr)}error(t){return this._getLogFunction(0,t,J.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,J.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,J.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,J.debug||J.info,arguments,tr)}table(t,r,o){return r?this._getLogFunction(t,r,console.table||y,o&&[o],{tag:vo(r)}):y}image(t){let{logLevel:r,priority:o,image:n,message:s="",scale:i=1}=t;return this._shouldLog(r||o)?x()?Fo({image:n,message:s,scale:i}):Io({image:n,message:s,scale:i}):y}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||y)}group(t,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},n=rr({logLevel:t,message:r,opts:o}),{collapsed:s}=o;return n.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(t,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},o,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||y)}withGroup(t,r,o){this.group(t,r)();try{o()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=or(t)}_getLogFunction(t,r,o,n,s){if(this._shouldLog(t)){s=rr({logLevel:t,message:r,args:n,opts:s}),o=o||s.method,Q(o),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=D();let i=s.tag||s.message;if(s.once&&i)if(!er[i])er[i]=D();else return y;return r=Ro(this.id,s.message,s),o.bind(console,r,...s.args)}return y}};f(S,"VERSION",Ae);function or(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Q(Number.isFinite(t)&&t>=0),t}function rr(e){let{logLevel:t,message:r}=e;e.logLevel=or(t);let o=e.args?Array.from(e.args):[];for(;o.length&&o.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&o.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let n=typeof e.message;return Q(n==="string"||n==="object"),Object.assign(e,{args:o},e.opts)}function Ro(e,t,r){if(typeof t=="string"){let o=r.time?Kt(Jt(r.total)):"";t=r.time?"".concat(e,": ").concat(o," ").concat(t):"".concat(e,": ").concat(t),t=Zt(t,r.color,r.background)}return t}function Io(e){let{image:t,message:r="",scale:o=1}=e;return console.warn("removed"),y}function Fo(e){let{image:t,message:r="",scale:o=1}=e;if(typeof t=="string"){let s=new Image;return s.onload=()=>{let i=ke(s,r,o);console.log(...i)},s.src=t,y}let n=t.nodeName||"";if(n.toLowerCase()==="img")return console.log(...ke(t,r,o)),y;if(n.toLowerCase()==="canvas"){let s=new Image;return s.onload=()=>console.log(...ke(s,r,o)),s.src=t.toDataURL(),y}return y}function vo(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Xi=new S({id:"@probe.gl/log"});var at=new S({id:"loaders.gl"}),Ee=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},Be=class{console;constructor(){this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}};var ct={fetch:null,mimeType:void 0,nothrow:!1,log:new Be,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:p,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},nr={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function ye(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function L(){let e=ye();return e.globalOptions=e.globalOptions||{...ct},e.globalOptions}function ft(e){let t=ye(),r=L();t.globalOptions=ar(r,e)}function K(e,t,r,o){return r=r||[],r=Array.isArray(r)?r:[r],Po(e,r),ar(t,e,o)}function Po(e,t){sr(e,null,ct,nr,t);for(let r of t){let o=e&&e[r.id]||{},n=r.options&&r.options[r.id]||{},s=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};sr(o,r.id,n,s,t)}}function sr(e,t,r,o,n){let s=t||"Top level",i=t?`${t}.`:"";for(let a in e){let c=!t&&k(e[a]),u=a==="baseUri"&&!t,B=a==="workerUrl"&&t;if(!(a in r)&&!u&&!B){if(a in o)at.warn(`${s} loader option '${i}${a}' no longer supported, use '${o[a]}'`)();else if(!c){let R=No(a,n);at.warn(`${s} loader option '${i}${a}' not recognized. ${R}`)()}}}}function No(e,t){let r=e.toLowerCase(),o="";for(let n of t)for(let s in n.options){if(e===s)return`Did you mean '${n.id}.${s}'?`;let i=s.toLowerCase();(r.startsWith(i)||i.startsWith(r))&&(o=o||`Did you mean '${n.id}.${s}'?`)}return o}function ar(e,t,r){let n={...e.options||{}};return Wo(n,r),n.log===null&&(n.log=new Ee),ir(n,L()),ir(n,t),n}function ir(e,t){for(let r in t)if(r in t){let o=t[r];me(o)&&me(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function Wo(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function T(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e?.extensions)):!1}function we(e){$(e,"null loader"),$(T(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e?.parseTextSync||e?.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var cr=()=>{let e=ye();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function fr(e){let t=cr();e=Array.isArray(e)?e:[e];for(let r of e){let o=we(r);t.find(n=>o===n)||t.unshift(o)}}function ur(){return cr()}function lr(){let e=ye();e.loaderRegistry=[]}var mr=new S({id:"loaders.gl"});var Co=/\.([^.]+)$/;async function Z(e,t=[],r,o){if(!hr(e))return null;let n=Y(e,t,{...r,nothrow:!0},o);if(n)return n;if(h(e)&&(e=await e.slice(0,10).arrayBuffer(),n=Y(e,t,r,o)),!n&&!r?.nothrow)throw new Error(dr(e));return n}function Y(e,t=[],r,o){if(!hr(e))return null;if(t&&!Array.isArray(t))return we(t);let n=[];t&&(n=n.concat(t)),r?.ignoreRegisteredLoaders||n.push(...ur()),Oo(n);let s=Mo(e,n,r,o);if(!s&&!r?.nothrow)throw new Error(dr(e));return s}function Mo(e,t,r,o){let n=b(e),s=ge(e),i=G(n)||o?.url,a=null,c="";return r?.mimeType&&(a=ut(t,r?.mimeType),c=`match forced by supplied MIME type ${r?.mimeType}`),a=a||Uo(t,i),c=c||(a?`matched url ${i}`:""),a=a||ut(t,s),c=c||(a?`matched MIME type ${s}`:""),a=a||Do(t,e),c=c||(a?`matched initial data ${gr(e)}`:""),r?.fallbackMimeType&&(a=a||ut(t,r?.fallbackMimeType),c=c||(a?`matched fallback MIME type ${s}`:"")),c&&mr.log(1,`selectLoader selected ${a?.name}: ${c}.`),a}function hr(e){return!(e instanceof Response&&e.status===204)}function dr(e){let t=b(e),r=ge(e),o="No valid loader found (";o+=t?`${M.filename(t)}, `:"no url provided, ",o+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let n=e?gr(e):"";return o+=n?` first bytes: "${n}"`:"first bytes: not available",o+=")",o}function Oo(e){for(let t of e)we(t)}function Uo(e,t){let r=t&&Co.exec(t),o=r&&r[1];return o?jo(e,o):null}function jo(e,t){t=t.toLowerCase();for(let r of e)for(let o of r.extensions)if(o.toLowerCase()===t)return r;return null}function ut(e,t){for(let r of e)if(r.mimeTypes&&r.mimeTypes.includes(t)||t===`application/x.${r.id}`)return r;return null}function Do(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if($o(t,r))return r}else if(ArrayBuffer.isView(t)){if(pr(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&pr(t,0,r))return r;return null}function $o(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(o=>e.startsWith(o))}function pr(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(n=>zo(e,t,r,n))}function zo(e,t,r,o){if(o instanceof ArrayBuffer)return He(o,e,o.byteLength);switch(typeof o){case"function":return o(e);case"string":let n=lt(e,t,o.length);return o===n;default:return!1}}function gr(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?lt(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?lt(e,0,t):""}function lt(e,t,r){if(e.byteLength<t+r)return"";let o=new DataView(e),n="";for(let s=0;s<r;s++)n+=String.fromCharCode(o.getUint8(t+s));return n}function*yr(e,t){let r=t?.chunkSize||262144,o=0,n=new TextEncoder;for(;o<e.length;){let s=Math.min(e.length-o,r),i=e.slice(o,o+s);o+=s,yield n.encode(i)}}function*wr(e,t={}){let{chunkSize:r=262144}=t,o=0;for(;o<e.byteLength;){let n=Math.min(e.byteLength-o,r),s=new ArrayBuffer(n),i=new Uint8Array(e,o,n);new Uint8Array(s).set(i),o+=n,yield s}}async function*br(e,t){let r=t?.chunkSize||1048576,o=0;for(;o<e.size;){let n=o+r,s=await e.slice(o,n).arrayBuffer();o=n,yield s}}function mt(e,t){return p?Vo(e,t):Ho(e,t)}async function*Vo(e,t){let r=e.getReader(),o;try{for(;;){let n=o||r.read();t?._streamReadAhead&&(o=r.read());let{done:s,value:i}=await n;if(s)return;yield xe(i)}}catch{r.releaseLock()}}async function*Ho(e,t){for await(let r of e)yield xe(r)}function X(e,t){if(typeof e=="string")return yr(e,t);if(e instanceof ArrayBuffer)return wr(e,t);if(h(e))return br(e,t);if(O(e))return mt(e,t);if(m(e))return mt(e.body,t);throw new Error("makeIterator")}var pt="Cannot convert supplied data type";function ht(e,t,r){if(t.text&&typeof e=="string")return e;if($t(e)&&(e=e.buffer),e instanceof ArrayBuffer){let o=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(o):o}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let o=e.buffer,n=e.byteLength||e.length;return(e.byteOffset!==0||n!==o.byteLength)&&(o=o.slice(e.byteOffset,e.byteOffset+n)),o}throw new Error(pt)}async function xr(e,t,r){let o=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||o)return ht(e,t,r);if(h(e)&&(e=await Te(e)),m(e)){let n=e;return await st(n),t.binary?await n.arrayBuffer():await n.text()}if(O(e)&&(e=X(e,r)),pe(e)||he(e))return W(e);throw new Error(pt)}async function Tr(e,t){if(de(e))return e;if(m(e)){let r=e;await st(r);let o=await r.body;return X(o,t)}return h(e)||O(e)?X(e,t):he(e)?e:Go(e)}function Go(e){if(ArrayBuffer.isView(e))return function*(){yield e.buffer}();if(e instanceof ArrayBuffer)return function*(){yield e}();if(de(e))return e;if(pe(e))return e[Symbol.iterator]();throw new Error(pt)}function ee(e,t){let r=L(),o=e||r;return typeof o.fetch=="function"?o.fetch:k(o.fetch)?n=>U(n,o.fetch):t?.fetch?t?.fetch:U}function te(e,t,r){if(r)return r;let o={fetch:ee(t,e),...e};if(o.url){let n=G(o.url);o.baseUrl=n,o.queryString=Gt(o.url),o.filename=M.filename(n),o.baseUrl=M.dirname(n)}return Array.isArray(o.loaders)||(o.loaders=null),o}function Le(e,t){if(e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let o=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...o]:o}return r&&r.length?r:void 0}async function E(e,t,r,o){t&&!Array.isArray(t)&&!T(t)&&(o=void 0,r=t,t=void 0),e=await e,r=r||{};let n=b(e),i=Le(t,o),a=await Z(e,i,r);return a?(r=K(r,a,i,n),o=te({url:n,_parse:E,loaders:i},r,o||null),await qo(a,e,r,o)):null}async function qo(e,t,r,o){if(De(e),r=We(e.options,r),m(t)){let s=t,{ok:i,redirected:a,status:c,statusText:u,type:B,url:R}=s,_t=Object.fromEntries(s.headers.entries());o.response={headers:_t,ok:i,redirected:a,status:c,statusText:u,type:B,url:R}}t=await xr(t,e,r);let n=e;if(n.parseTextSync&&typeof t=="string")return n.parseTextSync(t,r,o);if($e(e,r))return await ze(e,t,r,o,E);if(n.parseText&&typeof t=="string")return await n.parseText(t,r,o);if(n.parse)return await n.parse(t,r,o);throw l(!n.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function Ar(e,t,r,o){!Array.isArray(t)&&!T(t)&&(o=void 0,r=t,t=void 0),r=r||{};let s=Le(t,o),i=Y(e,s,r);if(!i)return null;r=K(r,i,s);let a=b(e),c=()=>{throw new Error("parseSync called parse (which is async")};return o=te({url:a,_parseSync:c,_parse:c,loaders:t},r,o||null),Qo(i,e,r,o)}function Qo(e,t,r,o){if(t=ht(t,e,r),e.parseTextSync&&typeof t=="string")return e.parseTextSync(t,r);if(e.parseSync&&t instanceof ArrayBuffer)return e.parseSync(t,r,o);throw new Error(`${e.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${o.url||""}`)}function dt(e){switch(typeof e=="object"&&e?.shape){case"array-row-table":case"object-row-table":return Array.isArray(e.data);case"geojson-table":return Array.isArray(e.features);case"columnar-table":return e.data&&typeof e.data=="object";case"arrow-table":return Boolean(e?.data?.numRows!==void 0);default:return!1}}function gt(e){switch(e.shape){case"array-row-table":case"object-row-table":return e.data.length;case"geojson-table":return e.features.length;case"arrow-table":return e.data.numRows;case"columnar-table":for(let r of Object.values(e.data))return r.length||0;return 0;default:throw new Error("table")}}function yt(e){return{...e,length:gt(e),batchType:"data"}}async function P(e,t,r,o){let n=Array.isArray(t)?t:void 0;!Array.isArray(t)&&!T(t)&&(o=void 0,r=t,t=void 0),e=await e,r=r||{};let s=b(e),i=await Z(e,t,r);return i?(r=K(r,i,n,s),o=te({url:s,_parseInBatches:P,_parse:E,loaders:n},r,o||null),await Jo(i,e,r,o)):[]}async function Jo(e,t,r,o){let n=await Ko(e,t,r,o);if(!r.metadata)return n;let s={shape:"metadata",batchType:"metadata",metadata:{_loader:e,_context:o},data:[],bytesUsed:0};async function*i(a){yield s,yield*a}return i(n)}async function Ko(e,t,r,o){let n=await Tr(t,r),s=await Xo(n,r?.transforms||[]);return e.parseInBatches?e.parseInBatches(s,r,o):Yo(s,e,r,o)}async function*Yo(e,t,r,o){let n=await W(e),s=await E(n,t,{...r,mimeType:t.mimeTypes[0]},o);yield Zo(s,t)}function Zo(e,t){let r=dt(e)?yt(e):{shape:"unknown",batchType:"data",data:e,length:Array.isArray(e)?e.length:1};return r.mimeType=t.mimeTypes[0],r}async function Xo(e,t=[]){let r=e;for await(let o of t)r=o(r);return r}async function _r(e,t,r,o){let n,s;!Array.isArray(t)&&!T(t)?(n=[],s=t,o=void 0):(n=t,s=r);let i=ee(s),a=e;return typeof e=="string"&&(a=await i(e)),h(e)&&(a=await i(e)),Array.isArray(n)?await E(a,n,s):await E(a,n,s)}function Sr(e,t,r,o){let n;!Array.isArray(t)&&!T(t)?(o=void 0,r=t,n=void 0):n=t;let s=ee(r||{});return Array.isArray(e)?e.map(a=>kr(a,n,r||{},s)):kr(e,n,r||{},s)}async function kr(e,t,r,o){if(typeof e=="string"){let s=await o(e);return Array.isArray(t)?await P(s,t,r):await P(s,t,r)}return Array.isArray(t)?await P(e,t,r):await P(e,t,r)}async function wt(e,t,r){if(t.encode)return await t.encode(e,r);if(t.encodeText){let o=await t.encodeText(e,r);return new TextEncoder().encode(o)}if(t.encodeInBatches){let o=bt(e,t,r),n=[];for await(let s of o)n.push(s);return ie(...n)}throw new Error("Writer could not encode data")}async function Er(e,t,r){if(t.text&&t.encodeText)return await t.encodeText(e,r);if(t.text){let o=await wt(e,t,r);return new TextDecoder().decode(o)}throw new Error(`Writer ${t.name} could not encode data as text`)}function bt(e,t,r){if(t.encodeInBatches){let o=en(e);return t.encodeInBatches(o,r)}throw new Error("Writer could not encode data in batches")}function en(e){return[{...e,start:0,end:e.length}]}async function Lr(e,t,r){return r={...L(),...r},t.encodeURLtoURL?tn(t,e,r):Ve(t,r)?await je(t,e,r):await t.encode(e,r)}function xt(e,t,r){if(t.encodeSync)return t.encodeSync(e,r);if(t.encodeTextSync)return new TextEncoder().encode(t.encodeTextSync(e,r));throw new Error(`Writer ${t.name} could not synchronously encode data`)}async function Rr(e,t,r){if(t.encodeText)return await t.encodeText(e,r);if(t.encodeTextSync)return t.encodeTextSync(e,r);if(t.text){let o=await t.encode(e,r);return new TextDecoder().decode(o)}throw new Error(`Writer ${t.name} could not encode data as text`)}function Ir(e,t,r){if(t.encodeTextSync)return t.encodeTextSync(e,r);if(t.text&&t.encodeSync){let o=xt(e,t,r);return new TextDecoder().decode(o)}throw new Error(`Writer ${t.name} could not encode data as text`)}function Fr(e,t,r){if(t.encodeInBatches){let o=rn(e);return t.encodeInBatches(o,r)}throw new Error(`Writer ${t.name} could not encode in batches`)}async function Tt(e,t,r,o){if(e=v(e),t=v(t),p||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,o)}async function tn(e,t,r){if(p)throw new Error(`Writer ${e.name} not supported in browser`);let o=Br("input");await new le(o,"w").write(t);let s=Br("output"),i=await Tt(o,s,e,r);return(await U(i)).arrayBuffer()}function rn(e){return[{...e,start:0,end:e.length}]}function Br(e){return`/tmp/${e}`}function vr(e,t){if(globalThis.loaders.makeNodeStream)return globalThis.loaders.makeNodeStream(e,t);let r=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new ReadableStream({type:"bytes",async pull(o){try{let{done:n,value:s}=await r.next();n?o.close():o.enqueue(new Uint8Array(s))}catch(n){o.error(n)}},async cancel(){await r?.return?.()}},{highWaterMark:2**24,...t})}var Pr="4.2.0-alpha.5",Nr={name:"Null loader",id:"null",module:"core",version:Pr,worker:!0,mimeTypes:["application/x.empty"],extensions:["null"],tests:[()=>!1],options:{null:{}}},Wr={name:"Null loader",id:"null",module:"core",version:Pr,mimeTypes:["application/x.empty"],extensions:["null"],parse:async(e,t,r)=>At(e,t||{},r),parseSync:At,parseInBatches:async function*(t,r,o){for await(let n of t)yield At(n,r,o)},tests:[()=>!1],options:{null:{}}};function At(e,t,r){return null}async function Cr(e,t,r=()=>{},o=()=>{}){if(e=await e,!e.ok)return e;let n=e.body;if(!n)return e;let s=e.headers.get("content-length")||0,i=s?parseInt(s):0;if(!(i>0)||typeof ReadableStream>"u"||!n.getReader)return e;let a=new ReadableStream({async start(c){let u=n.getReader();await Mr(c,u,0,i,t,r,o)}});return new Response(a)}async function Mr(e,t,r,o,n,s,i){try{let{done:a,value:c}=await t.read();if(a){s(),e.close();return}r+=c.byteLength;let u=Math.round(r/o*100);n(u,{loadedBytes:r,totalBytes:o}),e.enqueue(c),await Mr(e,t,r,o,n,s,i)}catch(a){e.error(a),i(a)}}var Re=class{_fetch;files={};lowerCaseFiles={};usedFiles={};constructor(t,r){this._fetch=r?.fetch||fetch;for(let o=0;o<t.length;++o){let n=t[o];this.files[n.name]=n,this.lowerCaseFiles[n.name.toLowerCase()]=n,this.usedFiles[n.name]=!1}this.fetch=this.fetch.bind(this)}async fetch(t,r){if(t.includes("://"))return this._fetch(t,r);let o=this.files[t];if(!o)return new Response(t,{status:400,statusText:"NOT FOUND"});let s=new Headers(r?.headers).get("Range"),i=s&&/bytes=($1)-($2)/.exec(s);if(i){let c=parseInt(i[1]),u=parseInt(i[2]),B=await o.slice(c,u).arrayBuffer(),R=new Response(B);return Object.defineProperty(R,"url",{value:t}),R}let a=new Response(o);return Object.defineProperty(a,"url",{value:t}),a}async readdir(t){let r=[];for(let o in this.files)r.push(o);return r}async stat(t,r){let o=this.files[t];if(!o)throw new Error(t);return{size:o.size}}async unlink(t){delete this.files[t],delete this.lowerCaseFiles[t],this.usedFiles[t]=!0}async openReadableFile(t,r){return new fe(this.files[t])}_getFile(t,r){let o=this.files[t]||this.lowerCaseFiles[t];return o&&r&&(this.usedFiles[t]=!0),o}};return zr(on);})();
|
|
14
14
|
return __exports__;
|
|
15
15
|
});
|
package/dist/index.cjs
CHANGED
|
@@ -323,6 +323,7 @@ var NullLog = class {
|
|
|
323
323
|
}
|
|
324
324
|
};
|
|
325
325
|
var ConsoleLog = class {
|
|
326
|
+
console;
|
|
326
327
|
constructor() {
|
|
327
328
|
this.console = console;
|
|
328
329
|
}
|
|
@@ -1369,7 +1370,7 @@ function makeStream(source, options) {
|
|
|
1369
1370
|
}
|
|
1370
1371
|
|
|
1371
1372
|
// dist/null-loader.js
|
|
1372
|
-
var VERSION = true ? "4.2.0-alpha.
|
|
1373
|
+
var VERSION = true ? "4.2.0-alpha.5" : "latest";
|
|
1373
1374
|
var NullWorkerLoader = {
|
|
1374
1375
|
name: "Null loader",
|
|
1375
1376
|
id: "null",
|
|
@@ -1459,15 +1460,16 @@ async function read(controller, reader, loadedBytes, totalBytes, onProgress, onD
|
|
|
1459
1460
|
// dist/lib/filesystems/browser-filesystem.js
|
|
1460
1461
|
var import_loader_utils14 = require("@loaders.gl/loader-utils");
|
|
1461
1462
|
var BrowserFileSystem = class {
|
|
1463
|
+
_fetch;
|
|
1464
|
+
files = {};
|
|
1465
|
+
lowerCaseFiles = {};
|
|
1466
|
+
usedFiles = {};
|
|
1462
1467
|
/**
|
|
1463
1468
|
* A FileSystem API wrapper around a list of browser 'File' objects
|
|
1464
1469
|
* @param files
|
|
1465
1470
|
* @param options
|
|
1466
1471
|
*/
|
|
1467
1472
|
constructor(files, options) {
|
|
1468
|
-
this.files = {};
|
|
1469
|
-
this.lowerCaseFiles = {};
|
|
1470
|
-
this.usedFiles = {};
|
|
1471
1473
|
this._fetch = (options == null ? void 0 : options.fetch) || fetch;
|
|
1472
1474
|
for (let i = 0; i < files.length; ++i) {
|
|
1473
1475
|
const file = files[i];
|