@loaders.gl/core 5.0.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/api.cjs +1 -1
  2. package/dist/dist.dev.js +3 -3
  3. package/dist/dist.min.js +1 -1
  4. package/dist/index.cjs +1 -1
  5. package/dist/lib/init.js +1 -1
  6. package/dist/loader-utils/index.cjs +29 -2
  7. package/dist/loader-utils/index.cjs.map +2 -2
  8. package/dist/loader-utils/index.d.ts +2 -1
  9. package/dist/loader-utils/index.d.ts.map +1 -1
  10. package/dist/loader-utils/index.js +1 -0
  11. package/dist/loader-utils/index.js.map +1 -1
  12. package/dist/loader-utils/json-loader-metadata.cjs +1 -1
  13. package/dist/loader-utils/json-loader-metadata.js +1 -1
  14. package/dist/loader-utils/json-loader.cjs +1 -1
  15. package/dist/loader-utils/lib/log-utils/log.js +1 -1
  16. package/dist/loader-utils/lib/sources/raster-source.d.ts +17 -1
  17. package/dist/loader-utils/lib/sources/raster-source.d.ts.map +1 -1
  18. package/dist/loader-utils/lib/sources/raster-source.js.map +1 -1
  19. package/dist/loader-utils/lib/sources/raster-tile.d.ts +7 -0
  20. package/dist/loader-utils/lib/sources/raster-tile.d.ts.map +1 -0
  21. package/dist/loader-utils/lib/sources/raster-tile.js +34 -0
  22. package/dist/loader-utils/lib/sources/raster-tile.js.map +1 -0
  23. package/dist/null-loader-metadata.cjs +1 -1
  24. package/dist/null-loader-metadata.js +1 -1
  25. package/dist/null-loader.cjs +1 -1
  26. package/dist/null-worker-node.js +1 -1
  27. package/dist/null-worker.js +1 -1
  28. package/dist/scan/arrow-query.cjs +2 -0
  29. package/dist/scan/arrow-query.cjs.map +2 -2
  30. package/dist/scan/arrow-query.d.ts +1 -1
  31. package/dist/scan/arrow-query.d.ts.map +1 -1
  32. package/dist/scan/arrow-query.js +1 -1
  33. package/dist/scan/arrow-query.js.map +1 -1
  34. package/dist/scan/index.cjs +0 -18
  35. package/dist/scan/index.cjs.map +2 -2
  36. package/dist/scan/index.d.ts +2 -5
  37. package/dist/scan/index.d.ts.map +1 -1
  38. package/dist/scan/index.js +0 -4
  39. package/dist/scan/index.js.map +1 -1
  40. package/dist/worker-utils/index.cjs +2 -2
  41. package/dist/worker-utils/lib/env-utils/version.js +1 -1
  42. package/package.json +2 -2
  43. package/src/loader-utils/index.ts +2 -0
  44. package/src/loader-utils/lib/sources/raster-source.ts +18 -1
  45. package/src/loader-utils/lib/sources/raster-tile.ts +46 -0
  46. package/src/scan/arrow-query.ts +1 -1
  47. package/src/scan/index.ts +2 -11
package/dist/api.cjs CHANGED
@@ -2016,7 +2016,7 @@ var import_log6 = require("probe.gl/log");
2016
2016
 
2017
2017
  // dist/loader-utils/lib/log-utils/log.js
2018
2018
  var import_log5 = require("probe.gl/log");
2019
- var VERSION3 = true ? "5.0.1" : "latest";
2019
+ var VERSION3 = true ? "5.0.2" : "latest";
2020
2020
  var version2 = VERSION3[0] >= "0" && VERSION3[0] <= "9" ? `v${VERSION3}` : "";
2021
2021
  function createLog2() {
2022
2022
  const log3 = new import_log5.Log({ id: "loaders.gl" });
package/dist/dist.dev.js CHANGED
@@ -37,7 +37,7 @@ var __exports__ = (() => {
37
37
  var init_json_loader_metadata = __esm({
38
38
  "dist/loader-utils/json-loader-metadata.js"() {
39
39
  "use strict";
40
- VERSION5 = true ? "5.0.1" : "latest";
40
+ VERSION5 = true ? "5.0.2" : "latest";
41
41
  JSONLoaderMetadata = {
42
42
  dataType: null,
43
43
  batchType: null,
@@ -779,7 +779,7 @@ var __exports__ = (() => {
779
779
  var log = new ProbeLog({ id: "@probe.gl/log" });
780
780
 
781
781
  // dist/loader-utils/lib/log-utils/log.js
782
- var VERSION2 = true ? "5.0.1" : "latest";
782
+ var VERSION2 = true ? "5.0.2" : "latest";
783
783
  var version = VERSION2[0] >= "0" && VERSION2[0] <= "9" ? `v${VERSION2}` : "";
784
784
  function createLog() {
785
785
  const log3 = new ProbeLog({ id: "loaders.gl" });
@@ -875,7 +875,7 @@ var __exports__ = (() => {
875
875
 
876
876
  // dist/worker-utils/lib/env-utils/version.js
877
877
  function getVersion() {
878
- const version2 = false ? NPM_TAG : "5.0.1";
878
+ const version2 = false ? NPM_TAG : "5.0.2";
879
879
  globalThis._loadersgl_ = globalThis._loadersgl_ || {};
880
880
  globalThis._loadersgl_.version ||= version2;
881
881
  return version2;
package/dist/dist.min.js CHANGED
@@ -4,7 +4,7 @@
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 ct=Object.defineProperty;var _s=Object.getOwnPropertyDescriptor;var Ws=Object.getOwnPropertyNames;var Os=Object.prototype.hasOwnProperty;var yr=(e,r,t)=>()=>{if(t)throw t[0];try{return e&&(r=e(e=0)),r}catch(o){throw t=[o],o}};var gr=(e,r)=>{for(var t in r)ct(e,t,{get:r[t],enumerable:!0})},Cs=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Ws(r))!Os.call(e,n)&&n!==t&&ct(e,n,{get:()=>r[n],enumerable:!(o=_s(r,n))||o.enumerable});return e};var Ms=e=>Cs(ct({},"__esModule",{value:!0}),e);var Ui,no,Df,qn=yr(()=>{"use strict";Ui="5.0.1",no={dataType:null,batchType:null,name:"JSON",id:"json",module:"json",version:Ui,encoding:"json",format:"json",extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,options:{}},Df={...no,async preload(){return(await Promise.resolve().then(()=>(so(),Qn))).JSONLoader}}});var Qn={};gr(Qn,{JSONLoader:()=>tr});function Hn(e){return JSON.parse(e)}var tr,so=yr(()=>{"use strict";qn();tr={...no,parseTextSync:Hn,parse:async e=>Hn(new TextDecoder().decode(e))}});var Oa,Uo,ay,vs=yr(()=>{"use strict";Oa="5.0.1",Uo={dataType:null,batchType:null,name:"Null loader",id:"null",module:"core",version:Oa,mimeTypes:["application/x.empty"],extensions:["null"],tests:[()=>!1],options:{null:{}}},ay={...Uo,async preload(){return(await Promise.resolve().then(()=>(Fo(),Ps))).NullLoader}}});var Ps={};gr(Ps,{NullLoader:()=>at});function No(e,r,t){return null}var at,Fo=yr(()=>{"use strict";vs();at={...Uo,parse:async(e,r,t)=>No(e,r||{},t),parseSync:No,parseInBatches:async function*(r,t,o){for await(let n of r)yield No(n,t,o)}}});var Ca={};gr(Ca,{FetchError:()=>Ee,JSONLoader:()=>tr,NullLoader:()=>at,RequestScheduler:()=>Be,_BrowserFileSystem:()=>mr,_fetchProgress:()=>Mo,_selectSource:()=>Oo,_unregisterLoaders:()=>go,assert:()=>be,compareLoaderOptions:()=>po,concatenateArrayBuffersAsync:()=>ee,coreApi:()=>we,createDataSource:()=>_o,createDataSourceSync:()=>Wo,document:()=>xr,encode:()=>Lo,encodeInBatches:()=>Po,encodeSync:()=>st,encodeTable:()=>ot,encodeTableAsText:()=>Io,encodeTableInBatches:()=>nt,encodeText:()=>Ro,encodeTextSync:()=>vo,encodeURLtoURL:()=>it,fetchFile:()=>K,forEach:()=>Dr,getLoaderOptions:()=>U,getPathPrefix:()=>Vr,global:()=>kr,isAsyncIterable:()=>le,isBrowser:()=>L,isIterable:()=>X,isIterator:()=>xe,isPromise:()=>ve,isPureObject:()=>M,isReadableStream:()=>Q,isResponse:()=>k,isWorker:()=>Tr,isWritableStream:()=>Ir,load:()=>hr,loadInBatches:()=>dr,makeIterator:()=>me,makeLineIterator:()=>$r,makeNumberedLineIterator:()=>jr,makeStream:()=>Co,makeTextDecoderIterator:()=>Fr,makeTextEncoderIterator:()=>Nr,parse:()=>S,parseFile:()=>lr,parseInBatches:()=>z,parseSync:()=>fr,preload:()=>pr,preloadSync:()=>Eo,readArrayBuffer:()=>uo,registerLoaders:()=>mo,resolvePath:()=>re,selectLoader:()=>R,selectLoaderSync:()=>se,self:()=>wr,setLoaderOptions:()=>rt,setPathPrefix:()=>Hr,window:()=>br});function be(e,r){if(!e)throw new Error(r||"loader assertion failed.")}var q={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},wr=q.self||q.window||q.global||{},br=q.window||q.self||q.global||{},kr=q.global||q.self||q.window||{},xr=q.document||{};var L=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),Tr=typeof importScripts=="function",$o=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Us=$o&&parseFloat($o[1])||0;var je=globalThis,Fs=globalThis.document||{},Sr=globalThis.process||{},Ns=globalThis.console,$s=globalThis.navigator||{};function Ar(e){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;let r=typeof navigator<"u"&&navigator.userAgent,t=e||r;return!!(t&&t.indexOf("Electron")>=0)}function ae(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||Ar()}var ut="5.0.0";function Ie(e,r){if(!e)throw new Error(r||"Assertion failed")}function Br(e){if(!e)return 0;let r;switch(typeof e){case"number":r=e;break;case"object":r=e.logLevel||e.priority||0;break;default:return 0}return Ie(Number.isFinite(r)&&r>=0),r}function lt(e){let{logLevel:r,message:t}=e;e.logLevel=Br(r);let o=e.args?Array.from(e.args):[];for(;o.length&&o.shift()!==t;);switch(typeof r){case"string":case"function":t!==void 0&&o.unshift(t),e.message=r;break;case"object":Object.assign(e,r);break;default:}typeof e.message=="function"&&(e.message=e.message());let n=typeof e.message;return Ie(n==="string"||n==="object"),Object.assign(e,{args:o},e.opts)}var ce=()=>{},ke=class{constructor({level:r=0}={}){this.userData={},this._onceCache=new Set,this._level=r}set level(r){this.setLevel(r)}get level(){return this.getLevel()}setLevel(r){return this._level=r,this}getLevel(){return this._level}warn(r,...t){return this._log("warn",0,r,t,{once:!0})}error(r,...t){return this._log("error",0,r,t)}log(r,t,...o){return this._log("log",r,t,o)}info(r,t,...o){return this._log("info",r,t,o)}once(r,t,...o){return this._log("once",r,t,o,{once:!0})}_log(r,t,o,n,s={}){let i=lt({logLevel:t,message:o,args:this._buildArgs(t,o,n),opts:s});return this._createLogFunction(r,i,s)}_buildArgs(r,t,o){return[r,t,...o]}_createLogFunction(r,t,o){if(!this._shouldLog(t.logLevel))return ce;let n=this._getOnceTag(o.tag??t.tag??t.message);if((o.once||t.once)&&n!==void 0){if(this._onceCache.has(n))return ce;this._onceCache.add(n)}return this._emit(r,t)}_shouldLog(r){return this.getLevel()>=Br(r)}_getOnceTag(r){if(r!==void 0)try{return typeof r=="string"?r:String(r)}catch{return}}};function Ds(e){try{let r=window[e],t="__storage_test__";return r.setItem(t,t),r.removeItem(t),r}catch{return null}}var De=class{constructor(r,t,o="sessionStorage"){this.storage=Ds(o),this.id=r,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(r){if(Object.assign(this.config,r),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let r={};if(this.storage){let t=this.storage.getItem(this.id);r=t?JSON.parse(t):{}}return Object.assign(this.config,r),this}};function jo(e){let r;return e<10?r=`${e.toFixed(2)}ms`:e<100?r=`${e.toFixed(1)}ms`:e<1e3?r=`${e.toFixed(0)}ms`:r=`${(e/1e3).toFixed(2)}s`,r}function ft(e,r=8){let t=Math.max(r-e.length,0);return`${" ".repeat(t)}${e}`}var ze;(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"})(ze||(ze={}));var zs=10;function Do(e){return typeof e!="string"?e:(e=e.toUpperCase(),ze[e]||ze.WHITE)}function ht(e,r,t){return!ae&&typeof e=="string"&&(r&&(e=`\x1B[${Do(r)}m${e}\x1B[39m`),t&&(e=`\x1B[${Do(t)+zs}m${e}\x1B[49m`)),e}function dt(e,r=["constructor"]){let t=Object.getPrototypeOf(e),o=Object.getOwnPropertyNames(t),n=e;for(let s of o){let i=n[s];typeof i=="function"&&(r.find(a=>s===a)||(n[s]=i.bind(e)))}}var Er=class{getHighResolutionTimer(){let r;if(ae()&&je.performance)r=je?.performance?.now?.();else if("hrtime"in Sr){let t=Sr?.hrtime?.();r=t[0]*1e3+t[1]/1e6}else r=Date.now();return r}getMemoryUsageMB(){let t=je?.performance?.memory?.usedJSHeapSize;return t==null?null:Math.trunc(t/1024/1024)}},N=new Er;globalThis.Probe=Er;globalThis.probe=N;var Le={debug:ae()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},pt={enabled:!0,level:0},Y=class extends ke{constructor({id:r}={id:""}){super({level:0}),this.VERSION=ut,this._startTs=N.getHighResolutionTimer(),this._deltaTs=N.getHighResolutionTimer(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=r,this.userData={},this._storage=new De(`__probe-${this.id}__`,{[this.id]:pt}),this.timeStamp(`${this.id} started`),dt(this),Object.seal(this)}isEnabled(){return this._getConfiguration().enabled}getLevel(){return this._getConfiguration().level}getTotal(){return Number((N.getHighResolutionTimer()-this._startTs).toPrecision(10))}getDelta(){return Number((N.getHighResolutionTimer()-this._deltaTs).toPrecision(10))}set priority(r){this.level=r}get priority(){return this.level}getPriority(){return this.level}enable(r=!0){return this._updateConfiguration({enabled:r}),this}setLevel(r){return this._updateConfiguration({level:r}),this}get(r){return this._getConfiguration()[r]}set(r,t){this._updateConfiguration({[r]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(r,t){if(!r)throw new Error(t||"Assertion failed")}warn(r,...t){return this._log("warn",0,r,t,{method:Le.warn,once:!0})}error(r,...t){return this._log("error",0,r,t,{method:Le.error})}deprecated(r,t){return this.warn(`\`${r}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(r,t){return this.error(`\`${r}\` has been removed. Use \`${t}\` instead`)}probe(r,t,...o){let n=N.getMemoryUsageMB();if(n!==null){let s=`${n}MB `;typeof t=="function"?t=()=>`${s}${t()}`:typeof t=="string"&&(t=`${s}${t}`)}return this._log("log",r,t,o,{method:Le.log,time:!0,once:!0})}log(r,t,...o){return this._log("log",r,t,o,{method:Le.debug})}info(r,t,...o){return this._log("info",r,t,o,{method:console.info})}once(r,t,...o){return this._log("once",r,t,o,{method:Le.debug||Le.info,once:!0})}table(r,t,o){return t?this._log("table",r,t,o&&[o]||[],{method:console.table||ce,tag:Qs(t)}):ce}time(r,t){return this._log("time",r,t,[],{method:console.time?console.time:console.info})}timeEnd(r,t){return this._log("time",r,t,[],{method:console.timeEnd?console.timeEnd:console.info})}timeStamp(r,t){return this._log("time",r,t,[],{method:console.timeStamp||ce})}group(r,t,o={collapsed:!1}){let n=(o.collapsed?console.groupCollapsed:console.group)||console.info;return this._log("group",r,t,[],{method:n})}groupCollapsed(r,t,o={}){return this.group(r,t,Object.assign({},o,{collapsed:!0}))}groupEnd(r){return this._log("groupEnd",r,"",[],{method:console.groupEnd||ce})}withGroup(r,t,o){this.group(r,t)();try{o()}finally{this.groupEnd(r)()}}trace(){console.trace&&console.trace()}_shouldLog(r){return this.isEnabled()&&super._shouldLog(r)}_emit(r,t){let o=t.method;Ie(o),t.total=this.getTotal(),t.delta=this.getDelta(),this._deltaTs=N.getHighResolutionTimer();let n=qs(this.id,t.message,t);return o.bind(console,n,...t.args)}_getConfiguration(){return this._storage.config[this.id]||this._updateConfiguration(pt),this._storage.config[this.id]}_updateConfiguration(r){let t=this._storage.config[this.id]||{...pt};this._storage.setConfiguration({[this.id]:{...t,...r}})}};Y.VERSION=ut;function qs(e,r,t){if(typeof r=="string"){let o=t.time?ft(jo(t.total)):"";r=t.time?`${e}: ${o} ${r}`:`${e}: ${r}`,r=ht(r,t.color,t.background)}return r}function Qs(e){for(let r in e)for(let t in e[r])return t||"untitled";return"empty"}globalThis.probe||(globalThis.probe=N);var Uc=new Y({id:"@probe.gl/log"});var mt="5.0.1",Vs=mt[0]>="0"&&mt[0]<="9"?`v${mt}`:"";function Gs(){let e=new Y({id:"loaders.gl"});return globalThis.loaders||={},globalThis.loaders.log=e,globalThis.loaders.version=Vs,globalThis.probe||={},globalThis.probe.loaders=e,e}var P=Gs(),Re=class{log(){return qe}info(){return qe}once(){return qe}warn(){return qe}error(){return qe}};function qe(){}var Js=new Re;function yt(e){let r=e?.core?.log;return r===null?Js:r||P}var zo=e=>typeof e=="boolean",A=e=>typeof e=="function",_=e=>e!==null&&typeof e=="object",M=e=>_(e)&&e.constructor==={}.constructor;var gt=e=>typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer,ue=e=>_(e)&&typeof e.byteLength=="number"&&typeof e.slice=="function",ve=e=>_(e)&&"then"in e&&A(e.then),X=e=>!!e&&A(e[Symbol.iterator]),le=e=>!!e&&A(e[Symbol.asyncIterator]),xe=e=>!!e&&A(e.next),k=e=>typeof Response<"u"&&e instanceof Response||_(e)&&A(e.arrayBuffer)&&A(e.text)&&A(e.json);var x=e=>typeof Blob<"u"&&e instanceof Blob;var qo=e=>_(e)&&A(e.abort)&&A(e.getWriter),Qo=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||_(e)&&A(e.tee)&&A(e.cancel)&&A(e.getReader),Ho=e=>_(e)&&A(e.end)&&A(e.write)&&zo(e.writable),Vo=e=>_(e)&&A(e.read)&&A(e.pipe)&&zo(e.readable),Q=e=>Qo(e)||Vo(e),Ir=e=>qo(e)||Ho(e);function fe(e,r){return Go(e||{},r)}function Go(e,r,t=0){if(t>3)return r;let o={...e};for(let[n,s]of Object.entries(r))M(s)?o[n]=Go(o[n]||{},r[n],t+1):o[n]=r[n];return o}function wt(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}var Jo="5.0-release",ou=`https://raw.githubusercontent.com/visgl/loaders.gl/${Jo}/`,nu=`https://github.com/visgl/loaders.gl/raw/${Jo}/`,bt="latest";function Ks(){let e="5.0.1";return globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version||=e,e}var Ko=Ks();function Lr(e,r){if(!e)throw new Error(r||"loaders.gl assertion failed.")}var H={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},lu=H.self||H.window||H.global||{},fu=H.window||H.self||H.global||{},hu=H.global||H.self||H.window||{},du=H.document||{};var V=typeof process!="object"||String(process)!=="[object process]"||process.browser;var Yo=typeof window<"u"&&typeof window.orientation<"u",Zo=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),pu=Zo&&parseFloat(Zo[1])||0;var Rr="latest";function Zs(){return typeof __VERSION__>"u"?Rr:__VERSION__}var kt=Zs();function Te(e,r){if(!e)throw new Error(r||"loaders.gl assertion failed.")}var G={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},ku=G.self||G.window||G.global||{},xu=G.window||G.self||G.global||{},Tu=G.global||G.self||G.window||{},Su=G.document||{};var W=typeof process!="object"||String(process)!=="[object process]"||process.browser;var en=typeof window<"u"&&typeof window.orientation<"u",Xo=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Au=Xo&&parseFloat(Xo[1])||0;var Qe=class{constructor(r,t){this.isRunning=!0,this.isCancelled=!1,this.failed=!1,this.postMessageMs=0,this.complete=()=>{},this.processStarted=!1,this._resolve=()=>{},this._reject=()=>{},this.name=r,this.workerThread=t,this.completion=new Promise(o=>{this.complete=o}),this.result=new Promise((o,n)=>{this._resolve=o,this._reject=n})}postMessage(r,t,o){if(!this.isRunning||this.isCancelled)return;let n=performance.now();(r==="process"||r==="process-in-batches"||r==="preload")&&(this.processStarted=!0);try{this.workerThread.postMessage({source:"loaders.gl",type:r,payload:t},o)}finally{this.postMessageMs+=performance.now()-n}}done(r){this.isRunning&&(this.isRunning=!1,this.executionMs=r?.executionMs,clearTimeout(this.cancellationTimer),this.complete(),this.isCancelled||this._resolve(r))}error(r){this.isRunning&&(this.isRunning=!1,this.failed=!0,this.sharedState?.snapshot.cancelled&&(this.isCancelled=!0),clearTimeout(this.cancellationTimer),this.complete(),this._reject(r))}cancel(r,t=1e3){if(!this.isRunning||this.isCancelled)return;if(!Number.isFinite(t)||t<0){this.abort(new RangeError("cancellationTimeout must be finite and nonnegative"));return}this.isCancelled=!0,this.sharedState?.cancel();let o=arguments.length?r:rn(`Worker job "${this.name}" was cancelled`);if(!this.processStarted){this.error(o);return}this._reject(o);try{this.workerThread.postMessage({source:"loaders.gl",type:"cancel",payload:{}},[]),this.cancellationTimer=setTimeout(()=>this.abort(r),t)}catch(n){this.abort(n)}}abort(r){this.isRunning&&(this.isCancelled=!0,this.sharedState?.cancel(),this.workerThread.destroy(),this.error(arguments.length?r:rn(`Worker job "${this.name}" was aborted`)))}};function rn(e){let r=new Error(e);return r.name="AbortError",r}var Pe=class{constructor(...r){let o=globalThis.process?.getBuiltinModule?.("node:worker_threads").Worker;if(o)return new o(...r)}terminate(){}},Iu=globalThis.process?.getBuiltinModule?.("node:worker_threads")?.parentPort??null;var xt=new Map;function tn(e){if(Te(e.source&&!e.url||!e.source&&e.url),e.url&&e.workerType==="module"){let t=globalThis.document?.baseURI??globalThis.location?.href;if(!t)return e.url;let o=new URL(e.url,t),n=globalThis.location?.origin;return/^https?:$/.test(o.protocol)&&o.origin!==n?Tt(`import ${JSON.stringify(o.href)};`):e.url}let r=xt.get(e.source||e.url);return r||(e.url&&(r=Ys(e.url),xt.set(e.url,r)),e.source&&(r=Tt(e.source),xt.set(e.source,r))),Te(r),r}function Ys(e){if(!e.startsWith("http"))return e;let r=Xs(e);return Tt(r)}function Tt(e){let r=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(r)}function Xs(e){return`try {
7
+ "use strict";var __exports__=(()=>{var ct=Object.defineProperty;var _s=Object.getOwnPropertyDescriptor;var Ws=Object.getOwnPropertyNames;var Os=Object.prototype.hasOwnProperty;var yr=(e,r,t)=>()=>{if(t)throw t[0];try{return e&&(r=e(e=0)),r}catch(o){throw t=[o],o}};var gr=(e,r)=>{for(var t in r)ct(e,t,{get:r[t],enumerable:!0})},Cs=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Ws(r))!Os.call(e,n)&&n!==t&&ct(e,n,{get:()=>r[n],enumerable:!(o=_s(r,n))||o.enumerable});return e};var Ms=e=>Cs(ct({},"__esModule",{value:!0}),e);var Ui,no,Df,qn=yr(()=>{"use strict";Ui="5.0.2",no={dataType:null,batchType:null,name:"JSON",id:"json",module:"json",version:Ui,encoding:"json",format:"json",extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,options:{}},Df={...no,async preload(){return(await Promise.resolve().then(()=>(so(),Qn))).JSONLoader}}});var Qn={};gr(Qn,{JSONLoader:()=>tr});function Hn(e){return JSON.parse(e)}var tr,so=yr(()=>{"use strict";qn();tr={...no,parseTextSync:Hn,parse:async e=>Hn(new TextDecoder().decode(e))}});var Oa,Uo,ay,vs=yr(()=>{"use strict";Oa="5.0.2",Uo={dataType:null,batchType:null,name:"Null loader",id:"null",module:"core",version:Oa,mimeTypes:["application/x.empty"],extensions:["null"],tests:[()=>!1],options:{null:{}}},ay={...Uo,async preload(){return(await Promise.resolve().then(()=>(Fo(),Ps))).NullLoader}}});var Ps={};gr(Ps,{NullLoader:()=>at});function No(e,r,t){return null}var at,Fo=yr(()=>{"use strict";vs();at={...Uo,parse:async(e,r,t)=>No(e,r||{},t),parseSync:No,parseInBatches:async function*(r,t,o){for await(let n of r)yield No(n,t,o)}}});var Ca={};gr(Ca,{FetchError:()=>Ee,JSONLoader:()=>tr,NullLoader:()=>at,RequestScheduler:()=>Be,_BrowserFileSystem:()=>mr,_fetchProgress:()=>Mo,_selectSource:()=>Oo,_unregisterLoaders:()=>go,assert:()=>be,compareLoaderOptions:()=>po,concatenateArrayBuffersAsync:()=>ee,coreApi:()=>we,createDataSource:()=>_o,createDataSourceSync:()=>Wo,document:()=>xr,encode:()=>Lo,encodeInBatches:()=>Po,encodeSync:()=>st,encodeTable:()=>ot,encodeTableAsText:()=>Io,encodeTableInBatches:()=>nt,encodeText:()=>Ro,encodeTextSync:()=>vo,encodeURLtoURL:()=>it,fetchFile:()=>K,forEach:()=>Dr,getLoaderOptions:()=>U,getPathPrefix:()=>Vr,global:()=>kr,isAsyncIterable:()=>le,isBrowser:()=>L,isIterable:()=>X,isIterator:()=>xe,isPromise:()=>ve,isPureObject:()=>M,isReadableStream:()=>Q,isResponse:()=>k,isWorker:()=>Tr,isWritableStream:()=>Ir,load:()=>hr,loadInBatches:()=>dr,makeIterator:()=>me,makeLineIterator:()=>$r,makeNumberedLineIterator:()=>jr,makeStream:()=>Co,makeTextDecoderIterator:()=>Fr,makeTextEncoderIterator:()=>Nr,parse:()=>S,parseFile:()=>lr,parseInBatches:()=>z,parseSync:()=>fr,preload:()=>pr,preloadSync:()=>Eo,readArrayBuffer:()=>uo,registerLoaders:()=>mo,resolvePath:()=>re,selectLoader:()=>R,selectLoaderSync:()=>se,self:()=>wr,setLoaderOptions:()=>rt,setPathPrefix:()=>Hr,window:()=>br});function be(e,r){if(!e)throw new Error(r||"loader assertion failed.")}var q={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},wr=q.self||q.window||q.global||{},br=q.window||q.self||q.global||{},kr=q.global||q.self||q.window||{},xr=q.document||{};var L=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),Tr=typeof importScripts=="function",$o=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Us=$o&&parseFloat($o[1])||0;var je=globalThis,Fs=globalThis.document||{},Sr=globalThis.process||{},Ns=globalThis.console,$s=globalThis.navigator||{};function Ar(e){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;let r=typeof navigator<"u"&&navigator.userAgent,t=e||r;return!!(t&&t.indexOf("Electron")>=0)}function ae(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||Ar()}var ut="5.0.0";function Ie(e,r){if(!e)throw new Error(r||"Assertion failed")}function Br(e){if(!e)return 0;let r;switch(typeof e){case"number":r=e;break;case"object":r=e.logLevel||e.priority||0;break;default:return 0}return Ie(Number.isFinite(r)&&r>=0),r}function lt(e){let{logLevel:r,message:t}=e;e.logLevel=Br(r);let o=e.args?Array.from(e.args):[];for(;o.length&&o.shift()!==t;);switch(typeof r){case"string":case"function":t!==void 0&&o.unshift(t),e.message=r;break;case"object":Object.assign(e,r);break;default:}typeof e.message=="function"&&(e.message=e.message());let n=typeof e.message;return Ie(n==="string"||n==="object"),Object.assign(e,{args:o},e.opts)}var ce=()=>{},ke=class{constructor({level:r=0}={}){this.userData={},this._onceCache=new Set,this._level=r}set level(r){this.setLevel(r)}get level(){return this.getLevel()}setLevel(r){return this._level=r,this}getLevel(){return this._level}warn(r,...t){return this._log("warn",0,r,t,{once:!0})}error(r,...t){return this._log("error",0,r,t)}log(r,t,...o){return this._log("log",r,t,o)}info(r,t,...o){return this._log("info",r,t,o)}once(r,t,...o){return this._log("once",r,t,o,{once:!0})}_log(r,t,o,n,s={}){let i=lt({logLevel:t,message:o,args:this._buildArgs(t,o,n),opts:s});return this._createLogFunction(r,i,s)}_buildArgs(r,t,o){return[r,t,...o]}_createLogFunction(r,t,o){if(!this._shouldLog(t.logLevel))return ce;let n=this._getOnceTag(o.tag??t.tag??t.message);if((o.once||t.once)&&n!==void 0){if(this._onceCache.has(n))return ce;this._onceCache.add(n)}return this._emit(r,t)}_shouldLog(r){return this.getLevel()>=Br(r)}_getOnceTag(r){if(r!==void 0)try{return typeof r=="string"?r:String(r)}catch{return}}};function Ds(e){try{let r=window[e],t="__storage_test__";return r.setItem(t,t),r.removeItem(t),r}catch{return null}}var De=class{constructor(r,t,o="sessionStorage"){this.storage=Ds(o),this.id=r,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(r){if(Object.assign(this.config,r),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let r={};if(this.storage){let t=this.storage.getItem(this.id);r=t?JSON.parse(t):{}}return Object.assign(this.config,r),this}};function jo(e){let r;return e<10?r=`${e.toFixed(2)}ms`:e<100?r=`${e.toFixed(1)}ms`:e<1e3?r=`${e.toFixed(0)}ms`:r=`${(e/1e3).toFixed(2)}s`,r}function ft(e,r=8){let t=Math.max(r-e.length,0);return`${" ".repeat(t)}${e}`}var ze;(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"})(ze||(ze={}));var zs=10;function Do(e){return typeof e!="string"?e:(e=e.toUpperCase(),ze[e]||ze.WHITE)}function ht(e,r,t){return!ae&&typeof e=="string"&&(r&&(e=`\x1B[${Do(r)}m${e}\x1B[39m`),t&&(e=`\x1B[${Do(t)+zs}m${e}\x1B[49m`)),e}function dt(e,r=["constructor"]){let t=Object.getPrototypeOf(e),o=Object.getOwnPropertyNames(t),n=e;for(let s of o){let i=n[s];typeof i=="function"&&(r.find(a=>s===a)||(n[s]=i.bind(e)))}}var Er=class{getHighResolutionTimer(){let r;if(ae()&&je.performance)r=je?.performance?.now?.();else if("hrtime"in Sr){let t=Sr?.hrtime?.();r=t[0]*1e3+t[1]/1e6}else r=Date.now();return r}getMemoryUsageMB(){let t=je?.performance?.memory?.usedJSHeapSize;return t==null?null:Math.trunc(t/1024/1024)}},N=new Er;globalThis.Probe=Er;globalThis.probe=N;var Le={debug:ae()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},pt={enabled:!0,level:0},Y=class extends ke{constructor({id:r}={id:""}){super({level:0}),this.VERSION=ut,this._startTs=N.getHighResolutionTimer(),this._deltaTs=N.getHighResolutionTimer(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=r,this.userData={},this._storage=new De(`__probe-${this.id}__`,{[this.id]:pt}),this.timeStamp(`${this.id} started`),dt(this),Object.seal(this)}isEnabled(){return this._getConfiguration().enabled}getLevel(){return this._getConfiguration().level}getTotal(){return Number((N.getHighResolutionTimer()-this._startTs).toPrecision(10))}getDelta(){return Number((N.getHighResolutionTimer()-this._deltaTs).toPrecision(10))}set priority(r){this.level=r}get priority(){return this.level}getPriority(){return this.level}enable(r=!0){return this._updateConfiguration({enabled:r}),this}setLevel(r){return this._updateConfiguration({level:r}),this}get(r){return this._getConfiguration()[r]}set(r,t){this._updateConfiguration({[r]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(r,t){if(!r)throw new Error(t||"Assertion failed")}warn(r,...t){return this._log("warn",0,r,t,{method:Le.warn,once:!0})}error(r,...t){return this._log("error",0,r,t,{method:Le.error})}deprecated(r,t){return this.warn(`\`${r}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(r,t){return this.error(`\`${r}\` has been removed. Use \`${t}\` instead`)}probe(r,t,...o){let n=N.getMemoryUsageMB();if(n!==null){let s=`${n}MB `;typeof t=="function"?t=()=>`${s}${t()}`:typeof t=="string"&&(t=`${s}${t}`)}return this._log("log",r,t,o,{method:Le.log,time:!0,once:!0})}log(r,t,...o){return this._log("log",r,t,o,{method:Le.debug})}info(r,t,...o){return this._log("info",r,t,o,{method:console.info})}once(r,t,...o){return this._log("once",r,t,o,{method:Le.debug||Le.info,once:!0})}table(r,t,o){return t?this._log("table",r,t,o&&[o]||[],{method:console.table||ce,tag:Qs(t)}):ce}time(r,t){return this._log("time",r,t,[],{method:console.time?console.time:console.info})}timeEnd(r,t){return this._log("time",r,t,[],{method:console.timeEnd?console.timeEnd:console.info})}timeStamp(r,t){return this._log("time",r,t,[],{method:console.timeStamp||ce})}group(r,t,o={collapsed:!1}){let n=(o.collapsed?console.groupCollapsed:console.group)||console.info;return this._log("group",r,t,[],{method:n})}groupCollapsed(r,t,o={}){return this.group(r,t,Object.assign({},o,{collapsed:!0}))}groupEnd(r){return this._log("groupEnd",r,"",[],{method:console.groupEnd||ce})}withGroup(r,t,o){this.group(r,t)();try{o()}finally{this.groupEnd(r)()}}trace(){console.trace&&console.trace()}_shouldLog(r){return this.isEnabled()&&super._shouldLog(r)}_emit(r,t){let o=t.method;Ie(o),t.total=this.getTotal(),t.delta=this.getDelta(),this._deltaTs=N.getHighResolutionTimer();let n=qs(this.id,t.message,t);return o.bind(console,n,...t.args)}_getConfiguration(){return this._storage.config[this.id]||this._updateConfiguration(pt),this._storage.config[this.id]}_updateConfiguration(r){let t=this._storage.config[this.id]||{...pt};this._storage.setConfiguration({[this.id]:{...t,...r}})}};Y.VERSION=ut;function qs(e,r,t){if(typeof r=="string"){let o=t.time?ft(jo(t.total)):"";r=t.time?`${e}: ${o} ${r}`:`${e}: ${r}`,r=ht(r,t.color,t.background)}return r}function Qs(e){for(let r in e)for(let t in e[r])return t||"untitled";return"empty"}globalThis.probe||(globalThis.probe=N);var Uc=new Y({id:"@probe.gl/log"});var mt="5.0.2",Vs=mt[0]>="0"&&mt[0]<="9"?`v${mt}`:"";function Gs(){let e=new Y({id:"loaders.gl"});return globalThis.loaders||={},globalThis.loaders.log=e,globalThis.loaders.version=Vs,globalThis.probe||={},globalThis.probe.loaders=e,e}var P=Gs(),Re=class{log(){return qe}info(){return qe}once(){return qe}warn(){return qe}error(){return qe}};function qe(){}var Js=new Re;function yt(e){let r=e?.core?.log;return r===null?Js:r||P}var zo=e=>typeof e=="boolean",A=e=>typeof e=="function",_=e=>e!==null&&typeof e=="object",M=e=>_(e)&&e.constructor==={}.constructor;var gt=e=>typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer,ue=e=>_(e)&&typeof e.byteLength=="number"&&typeof e.slice=="function",ve=e=>_(e)&&"then"in e&&A(e.then),X=e=>!!e&&A(e[Symbol.iterator]),le=e=>!!e&&A(e[Symbol.asyncIterator]),xe=e=>!!e&&A(e.next),k=e=>typeof Response<"u"&&e instanceof Response||_(e)&&A(e.arrayBuffer)&&A(e.text)&&A(e.json);var x=e=>typeof Blob<"u"&&e instanceof Blob;var qo=e=>_(e)&&A(e.abort)&&A(e.getWriter),Qo=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||_(e)&&A(e.tee)&&A(e.cancel)&&A(e.getReader),Ho=e=>_(e)&&A(e.end)&&A(e.write)&&zo(e.writable),Vo=e=>_(e)&&A(e.read)&&A(e.pipe)&&zo(e.readable),Q=e=>Qo(e)||Vo(e),Ir=e=>qo(e)||Ho(e);function fe(e,r){return Go(e||{},r)}function Go(e,r,t=0){if(t>3)return r;let o={...e};for(let[n,s]of Object.entries(r))M(s)?o[n]=Go(o[n]||{},r[n],t+1):o[n]=r[n];return o}function wt(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}var Jo="5.0-release",ou=`https://raw.githubusercontent.com/visgl/loaders.gl/${Jo}/`,nu=`https://github.com/visgl/loaders.gl/raw/${Jo}/`,bt="latest";function Ks(){let e="5.0.2";return globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version||=e,e}var Ko=Ks();function Lr(e,r){if(!e)throw new Error(r||"loaders.gl assertion failed.")}var H={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},lu=H.self||H.window||H.global||{},fu=H.window||H.self||H.global||{},hu=H.global||H.self||H.window||{},du=H.document||{};var V=typeof process!="object"||String(process)!=="[object process]"||process.browser;var Yo=typeof window<"u"&&typeof window.orientation<"u",Zo=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),pu=Zo&&parseFloat(Zo[1])||0;var Rr="latest";function Zs(){return typeof __VERSION__>"u"?Rr:__VERSION__}var kt=Zs();function Te(e,r){if(!e)throw new Error(r||"loaders.gl assertion failed.")}var G={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},ku=G.self||G.window||G.global||{},xu=G.window||G.self||G.global||{},Tu=G.global||G.self||G.window||{},Su=G.document||{};var W=typeof process!="object"||String(process)!=="[object process]"||process.browser;var en=typeof window<"u"&&typeof window.orientation<"u",Xo=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Au=Xo&&parseFloat(Xo[1])||0;var Qe=class{constructor(r,t){this.isRunning=!0,this.isCancelled=!1,this.failed=!1,this.postMessageMs=0,this.complete=()=>{},this.processStarted=!1,this._resolve=()=>{},this._reject=()=>{},this.name=r,this.workerThread=t,this.completion=new Promise(o=>{this.complete=o}),this.result=new Promise((o,n)=>{this._resolve=o,this._reject=n})}postMessage(r,t,o){if(!this.isRunning||this.isCancelled)return;let n=performance.now();(r==="process"||r==="process-in-batches"||r==="preload")&&(this.processStarted=!0);try{this.workerThread.postMessage({source:"loaders.gl",type:r,payload:t},o)}finally{this.postMessageMs+=performance.now()-n}}done(r){this.isRunning&&(this.isRunning=!1,this.executionMs=r?.executionMs,clearTimeout(this.cancellationTimer),this.complete(),this.isCancelled||this._resolve(r))}error(r){this.isRunning&&(this.isRunning=!1,this.failed=!0,this.sharedState?.snapshot.cancelled&&(this.isCancelled=!0),clearTimeout(this.cancellationTimer),this.complete(),this._reject(r))}cancel(r,t=1e3){if(!this.isRunning||this.isCancelled)return;if(!Number.isFinite(t)||t<0){this.abort(new RangeError("cancellationTimeout must be finite and nonnegative"));return}this.isCancelled=!0,this.sharedState?.cancel();let o=arguments.length?r:rn(`Worker job "${this.name}" was cancelled`);if(!this.processStarted){this.error(o);return}this._reject(o);try{this.workerThread.postMessage({source:"loaders.gl",type:"cancel",payload:{}},[]),this.cancellationTimer=setTimeout(()=>this.abort(r),t)}catch(n){this.abort(n)}}abort(r){this.isRunning&&(this.isCancelled=!0,this.sharedState?.cancel(),this.workerThread.destroy(),this.error(arguments.length?r:rn(`Worker job "${this.name}" was aborted`)))}};function rn(e){let r=new Error(e);return r.name="AbortError",r}var Pe=class{constructor(...r){let o=globalThis.process?.getBuiltinModule?.("node:worker_threads").Worker;if(o)return new o(...r)}terminate(){}},Iu=globalThis.process?.getBuiltinModule?.("node:worker_threads")?.parentPort??null;var xt=new Map;function tn(e){if(Te(e.source&&!e.url||!e.source&&e.url),e.url&&e.workerType==="module"){let t=globalThis.document?.baseURI??globalThis.location?.href;if(!t)return e.url;let o=new URL(e.url,t),n=globalThis.location?.origin;return/^https?:$/.test(o.protocol)&&o.origin!==n?Tt(`import ${JSON.stringify(o.href)};`):e.url}let r=xt.get(e.source||e.url);return r||(e.url&&(r=Ys(e.url),xt.set(e.url,r)),e.source&&(r=Tt(e.source),xt.set(e.source,r))),Te(r),r}function Ys(e){if(!e.startsWith("http"))return e;let r=Xs(e);return Tt(r)}function Tt(e){let r=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(r)}function Xs(e){return`try {
8
8
  importScripts('${e}');
9
9
  } catch (error) {
10
10
  console.error(error);
package/dist/index.cjs CHANGED
@@ -31,7 +31,7 @@ var VERSION, NullLoaderMetadata, NullLoader;
31
31
  var init_null_loader_metadata = __esm({
32
32
  "dist/null-loader-metadata.js"() {
33
33
  "use strict";
34
- VERSION = true ? "5.0.1" : "latest";
34
+ VERSION = true ? "5.0.2" : "latest";
35
35
  NullLoaderMetadata = {
36
36
  dataType: null,
37
37
  batchType: null,
package/dist/lib/init.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
  import { log } from '@loaders.gl/core/loader-utils';
5
5
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
6
- const version = typeof "5.0.1" !== 'undefined' ? "5.0.1" : '';
6
+ const version = typeof "5.0.2" !== 'undefined' ? "5.0.2" : '';
7
7
  // @ts-ignore
8
8
  if (!globalThis.loaders) {
9
9
  log.log(1, `loaders.gl ${version}`)();
@@ -58,7 +58,7 @@ var VERSION3, JSONLoaderMetadata, JSONLoader;
58
58
  var init_json_loader_metadata = __esm({
59
59
  "dist/loader-utils/json-loader-metadata.js"() {
60
60
  "use strict";
61
- VERSION3 = true ? "5.0.1" : "latest";
61
+ VERSION3 = true ? "5.0.2" : "latest";
62
62
  JSONLoaderMetadata = {
63
63
  dataType: null,
64
64
  batchType: null,
@@ -263,6 +263,7 @@ __export(index_exports, {
263
263
  promisify2: () => promisify2,
264
264
  rasterCoordinateToPixel: () => rasterCoordinateToPixel,
265
265
  readRangeResponse: () => readRangeResponse,
266
+ readRasterTile: () => readRasterTile,
266
267
  redactCredentialURL: () => redactCredentialURL,
267
268
  registerJSModules: () => registerJSModules,
268
269
  resolveAuthenticationOptions: () => resolveAuthenticationOptions,
@@ -345,7 +346,7 @@ var nodeVersion = matches && parseFloat(matches[1]) || 0;
345
346
 
346
347
  // dist/loader-utils/lib/log-utils/log.js
347
348
  var import_log = require("probe.gl/log");
348
- var VERSION = true ? "5.0.1" : "latest";
349
+ var VERSION = true ? "5.0.2" : "latest";
349
350
  var version = VERSION[0] >= "0" && VERSION[0] <= "9" ? `v${VERSION}` : "";
350
351
  function createLog() {
351
352
  const log3 = new import_log.Log({ id: "loaders.gl" });
@@ -11704,6 +11705,32 @@ var TileSourceAdapter = class {
11704
11705
  }
11705
11706
  };
11706
11707
 
11708
+ // dist/loader-utils/lib/sources/raster-tile.js
11709
+ async function readRasterTile(source, parameters) {
11710
+ const { tileMatrix, bands, signal } = parameters;
11711
+ signal == null ? void 0 : signal.throwIfAborted();
11712
+ const { tileGrid, nativeTileMatrixIds } = await waitForPromiseWithSignal(source.getMetadata({ signal }), signal);
11713
+ signal == null ? void 0 : signal.throwIfAborted();
11714
+ const matrixSet = tileGrid == null ? void 0 : tileGrid.tileMatrixSet;
11715
+ if (!(matrixSet == null ? void 0 : matrixSet.crs) || !matrixSet.matrices.length)
11716
+ throw new Error("readRasterTile requires a complete native tile matrix set");
11717
+ const resolved = resolveTileGridTile(tileGrid, { ...parameters, z: 0 });
11718
+ const matrix = matrixSet.matrices.find((candidate) => candidate.id === tileMatrix);
11719
+ if (bands === void 0 && nativeTileMatrixIds && !nativeTileMatrixIds.includes(tileMatrix))
11720
+ throw new Error(`Tile matrix "${tileMatrix}" does not support native tile reads. Readable matrix IDs: ${JSON.stringify(nativeTileMatrixIds)}`);
11721
+ if (!resolved)
11722
+ return null;
11723
+ if (!source.getRasterTile)
11724
+ throw new Error("Raster source does not support native tile reads");
11725
+ const raster = await waitForPromiseWithSignal(source.getRasterTile({ ...parameters, x: resolved.x }), signal);
11726
+ signal == null ? void 0 : signal.throwIfAborted();
11727
+ if (!raster)
11728
+ return null;
11729
+ if (raster.width !== matrix.tileSize[0] || raster.height !== matrix.tileSize[1])
11730
+ throw new Error(`Raster tile dimensions do not match matrix "${tileMatrix}"`);
11731
+ return raster;
11732
+ }
11733
+
11707
11734
  // dist/loader-utils/lib/sources/raster-source.js
11708
11735
  function getRasterViewportBoundingBox(viewport) {
11709
11736
  if (viewport.bounds) {