@deck.gl/core 9.2.9 → 9.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controllers/orbit-controller.d.ts +2 -1
- package/dist/controllers/orbit-controller.d.ts.map +1 -1
- package/dist/controllers/orbit-controller.js +9 -5
- package/dist/controllers/orbit-controller.js.map +1 -1
- package/dist/dist.dev.js +9 -4
- package/dist/index.cjs +10 -5
- package/dist/index.cjs.map +2 -2
- package/dist/lib/init.js +2 -2
- package/dist/lib/init.js.map +1 -1
- package/dist.min.js +2 -2
- package/package.json +2 -2
- package/src/controllers/orbit-controller.ts +10 -6
package/dist/lib/init.js
CHANGED
|
@@ -9,8 +9,8 @@ import jsonLoader from "../utils/json-loader.js";
|
|
|
9
9
|
function checkVersion() {
|
|
10
10
|
// Version detection using typescript plugin.
|
|
11
11
|
// Fallback for tests and SSR since global variable is defined by esbuild.
|
|
12
|
-
const version = typeof "9.2.
|
|
13
|
-
? "9.2.
|
|
12
|
+
const version = typeof "9.2.10" !== 'undefined'
|
|
13
|
+
? "9.2.10" : globalThis.DECK_VERSION || 'untranspiled source';
|
|
14
14
|
// Note: a `deck` object not created by deck.gl may exist in the global scope
|
|
15
15
|
const existingVersion = globalThis.deck && globalThis.deck.VERSION;
|
|
16
16
|
if (existingVersion && existingVersion !== version) {
|
package/dist/lib/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/lib/init.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAE/C,OAAO,GAAG,wBAAqB;AAC/B,OAAO,EAAC,QAAQ,EAAC,0BAAuB;AACxC,OAAO,UAAU,gCAA6B;AAM9C,SAAS,YAAY;IACnB,6CAA6C;IAC7C,0EAA0E;IAC1E,MAAM,OAAO,GACX,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/lib/init.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAE/C,OAAO,GAAG,wBAAqB;AAC/B,OAAO,EAAC,QAAQ,EAAC,0BAAuB;AACxC,OAAO,UAAU,gCAA6B;AAM9C,SAAS,YAAY;IACnB,6CAA6C;IAC7C,0EAA0E;IAC1E,MAAM,OAAO,GACX,eAAkB,KAAK,WAAW;QAChC,CAAC,UACD,CAAC,CAAC,UAAU,CAAC,YAAY,IAAI,qBAAqB,CAAC;IAEvD,6EAA6E;IAC7E,MAAM,eAAe,GAAG,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC;IAEnE,IAAI,eAAe,IAAI,eAAe,KAAK,OAAO,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,yCAAyC,eAAe,OAAO,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,OAAO,EAAE,CAAC,EAAE,CAAC;QAEnC,UAAU,CAAC,IAAI,GAAG;YAChB,GAAG,UAAU,CAAC,IAAI;YAClB,OAAO,EAAE,OAAO;YAChB,OAAO;YACP,GAAG;YACH,eAAe;YACf,gBAAgB,EAAE,QAAQ;SAC3B,CAAC;QAEF,eAAe,CAAC;YACd,UAAU;YACV,8CAA8C;YAC9C,CAAC,WAAW,EAAE,EAAC,WAAW,EAAE,EAAC,gBAAgB,EAAE,MAAM,EAAC,EAAC,CAAC;SACzD,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC"}
|
package/dist.min.js
CHANGED
|
@@ -858,7 +858,7 @@ ${t.source}`}),super(e,{id:t.id||xe("clip-space"),...t,vs:X3,vertexCount:4,geome
|
|
|
858
858
|
} catch (error) {
|
|
859
859
|
console.error(error);
|
|
860
860
|
throw error;
|
|
861
|
-
}`}function Jf(r,e=!0,t){let n=t||new Set;if(r){if(bg(r))n.add(r);else if(bg(r.buffer))n.add(r.buffer);else if(!ArrayBuffer.isView(r)){if(e&&typeof r=="object")for(let s in r)Jf(r[s],e,n)}}return t===void 0?Array.from(n):[]}function bg(r){return r?r instanceof ArrayBuffer||typeof MessagePort<"u"&&r instanceof MessagePort||typeof ImageBitmap<"u"&&r instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas:!1}var eh=()=>{},vr=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&tt||typeof rs<"u"&&!tt}constructor(e){let{name:t,source:n,url:s}=e;ke(n||s),this.name=t,this.source=n,this.url=s,this.onMessage=eh,this.onError=i=>console.log(i),this.worker=tt?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=eh,this.onError=eh,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||Jf(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=yg({source:this.source,url:this.url});let e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}_createNodeWorker(){let e;if(this.url){let n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;e=new rs(n,{eval:!1})}else if(this.source)e=new rs(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",t=>{this.onMessage(t)}),e.on("error",t=>{this.onError(t)}),e.on("exit",t=>{}),e}};var gi=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return vr.isSupported()}constructor(e){this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,t=(s,i,o)=>s.done(o),n=(s,i)=>s.error(i)){let s=new Promise(i=>(this.jobQueue.push({name:e,onMessage:t,onError:n,onStart:i}),this));return this._startQueuedJob(),await s}async _startQueuedJob(){if(!this.jobQueue.length)return;let e=this._getAvailableWorker();if(!e)return;let t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});let n=new mi(t.name,e);e.onMessage=s=>t.onMessage(n,s.type,s.payload),e.onError=s=>t.onError(n,s),t.onStart(n);try{await n.result}catch(s){console.error(`Worker exception: ${s}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!tt||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new vr({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return _g?this.maxMobileConcurrency:this.maxConcurrency}};var xw={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},an=class{props;workerPools=new Map;static isSupported(){return vr.isSupported()}static getWorkerFarm(e={}){return an._workerFarm=an._workerFarm||new an({}),an._workerFarm.setProps(e),an._workerFarm}constructor(e){this.props={...xw},this.setProps(e),this.workerPools=new Map}destroy(){for(let e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(let t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){let{name:t,source:n,url:s}=e,i=this.workerPools.get(t);return i||(i=new gi({name:t,source:n,url:s}),i.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,i)),i}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},Ar=an;L(Ar,"_workerFarm");function th(r,e={}){let t=e[r.id]||{},n=tt?`${r.id}-worker.js`:`${r.id}-worker-node.js`,s=t.workerUrl;if(!s&&r.id==="compression"&&(s=e.workerUrl),e._workerType==="test"&&(tt?s=`modules/${r.module}/dist/${n}`:s=`modules/${r.module}/src/workers/${r.id}-worker-node.ts`),!s){let i=r.version;i==="latest"&&(i=mg);let o=i?`@${i}`:"";s=`https://unpkg.com/@loaders.gl/${r.module}${o}/dist/${n}`}return ke(s),s}function rh(r,e=Gf){ke(r,"no worker provided");let t=r.version;return!(!e||!t)}function nh(r,e){return!Ar.isSupported()||!tt&&!e?._nodeWorkers?!1:r.worker&&e?.worker}async function sh(r,e,t,n,s){let i=r.id,o=th(r,t),c=Ar.getWorkerFarm(t).getWorkerPool({name:i,url:o});t=JSON.parse(JSON.stringify(t)),n=JSON.parse(JSON.stringify(n||{}));let l=await c.startJob("process-on-worker",bw.bind(null,s));return l.postMessage("process",{input:e,options:t,context:n}),await(await l.result).result}async function bw(r,e,t,n){switch(t){case"done":e.done(n);break;case"error":e.error(new Error(n.error));break;case"process":let{id:s,input:i,options:o}=n;try{let a=await r(i,o);e.postMessage("done",{id:s,result:a})}catch(a){let c=a instanceof Error?a.message:"unknown error";e.postMessage("error",{id:s,error:c})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}}function ih(r,e,t){if(t=t||r.byteLength,r.byteLength<t||e.byteLength<t)return!1;let n=new Uint8Array(r),s=new Uint8Array(e);for(let i=0;i<n.length;++i)if(n[i]!==s[i])return!1;return!0}function oh(...r){return Tg(r)}function Tg(r){let e=r.map(i=>i instanceof ArrayBuffer?new Uint8Array(i):i),t=e.reduce((i,o)=>i+o.byteLength,0),n=new Uint8Array(t),s=0;for(let i of e)n.set(i,s),s+=i.byteLength;return n.buffer}async function ah(r){let e=[];for await(let t of r)e.push(t);return oh(...e)}var Tw="",wg={};function ch(r){for(let e in wg)if(r.startsWith(e)){let t=wg[e];r=r.replace(e,t)}return!r.startsWith("http://")&&!r.startsWith("https://")&&(r=`${Tw}${r}`),r}function vg(r){return r&&typeof r=="object"&&r.isBuffer}function Ka(r){if(vg(r))return r;if(r instanceof ArrayBuffer)return r;if(ArrayBuffer.isView(r))return r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);if(typeof r=="string"){let e=r;return new TextEncoder().encode(e).buffer}if(r&&typeof r=="object"&&r._toArrayBuffer)return r._toArrayBuffer();throw new Error("toArrayBuffer")}var cn={};$t(cn,{dirname:()=>vw,filename:()=>ww,join:()=>Aw,resolve:()=>Sw});function Ag(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let r=window.location?.pathname;return r?.slice(0,r.lastIndexOf("/")+1)||""}function ww(r){let e=r?r.lastIndexOf("/"):-1;return e>=0?r.substr(e+1):""}function vw(r){let e=r?r.lastIndexOf("/"):-1;return e>=0?r.substr(0,e):""}function Aw(...r){let e="/";return r=r.map((t,n)=>(n&&(t=t.replace(new RegExp(`^${e}`),"")),n!==r.length-1&&(t=t.replace(new RegExp(`${e}$`),"")),t)),r.join(e)}function Sw(...r){let e=[];for(let i=0;i<r.length;i++)e[i]=r[i];let t="",n=!1,s;for(let i=e.length-1;i>=-1&&!n;i--){let o;i>=0?o=e[i]:(s===void 0&&(s=Ag()),o=s),o.length!==0&&(t=`${o}/${t}`,n=o.charCodeAt(0)===_i)}return t=Ew(t,!n),n?`/${t}`:t.length>0?t:"."}var _i=47,lh=46;function Ew(r,e){let t="",n=-1,s=0,i,o=!1;for(let a=0;a<=r.length;++a){if(a<r.length)i=r.charCodeAt(a);else{if(i===_i)break;i=_i}if(i===_i){if(!(n===a-1||s===1))if(n!==a-1&&s===2){if(t.length<2||!o||t.charCodeAt(t.length-1)!==lh||t.charCodeAt(t.length-2)!==lh){if(t.length>2){let c=t.length-1,l=c;for(;l>=0&&t.charCodeAt(l)!==_i;--l);if(l!==c){t=l===-1?"":t.slice(0,l),n=a,s=0,o=!1;continue}}else if(t.length===2||t.length===1){t="",n=a,s=0,o=!1;continue}}e&&(t.length>0?t+="/..":t="..",o=!0)}else{let c=r.slice(n+1,a);t.length>0?t+=`/${c}`:t=c,o=!1}n=a,s=0}else i===lh&&s!==-1?++s:s=-1}return t}var Rw=r=>typeof r=="boolean",yi=r=>typeof r=="function",ln=r=>r!==null&&typeof r=="object",uh=r=>ln(r)&&r.constructor==={}.constructor;var Sg=r=>Boolean(r)&&typeof r[Symbol.iterator]=="function",Eg=r=>r&&typeof r[Symbol.asyncIterator]=="function";var rt=r=>typeof Response<"u"&&r instanceof Response||r&&r.arrayBuffer&&r.text&&r.json;var nt=r=>typeof Blob<"u"&&r instanceof Blob,Rg=r=>r&&typeof r=="object"&&r.isBuffer;var Iw=r=>typeof ReadableStream<"u"&&r instanceof ReadableStream||ln(r)&&yi(r.tee)&&yi(r.cancel)&&yi(r.getReader);var Pw=r=>ln(r)&&yi(r.read)&&yi(r.pipe)&&Rw(r.readable),Za=r=>Iw(r)||Pw(r);var Ga=class extends Error{constructor(e,t){super(e),this.reason=t.reason,this.url=t.url,this.response=t.response}reason;url;response};var Cw=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Mw=/^([-\w.]+\/[-\w.+]+)/;function fh(r,e){return r.toLowerCase()===e.toLowerCase()}function Ig(r){let e=Mw.exec(r);return e?e[1]:r}function hh(r){let e=Cw.exec(r);return e?e[1]:""}var Pg=/\?.*/;function Cg(r){let e=r.match(Pg);return e&&e[0]}function ns(r){return r.replace(Pg,"")}function Mg(r){if(r.length<50)return r;let e=r.slice(r.length-15);return`${r.substr(0,32)}...${e}`}function un(r){return rt(r)?r.url:nt(r)?r.name||"":typeof r=="string"?r:""}function xi(r){if(rt(r)){let e=r,t=e.headers.get("content-type")||"",n=ns(e.url);return Ig(t)||hh(n)}return nt(r)?r.type||"":typeof r=="string"?hh(r):""}function Og(r){return rt(r)?r.headers["content-length"]||-1:nt(r)?r.size:typeof r=="string"?r.length:r instanceof ArrayBuffer||ArrayBuffer.isView(r)?r.byteLength:-1}async function Qa(r){if(rt(r))return r;let e={},t=Og(r);t>=0&&(e["content-length"]=String(t));let n=un(r),s=xi(r);s&&(e["content-type"]=s);let i=await kw(r);i&&(e["x-first-bytes"]=i),typeof r=="string"&&(r=new TextEncoder().encode(r));let o=new Response(r,{headers:e});return Object.defineProperty(o,"url",{value:n}),o}async function kg(r){if(!r.ok)throw await Ow(r)}async function Ow(r){let e=Mg(r.url),t=`Failed to fetch resource (${r.status}) ${r.statusText}: ${e}`;t=t.length>100?`${t.slice(0,100)}...`:t;let n={reason:r.statusText,url:r.url,response:r};try{let s=r.headers.get("Content-Type");n.reason=!r.bodyUsed&&s?.includes("application/json")?await r.json():await r.text()}catch{}return new Ga(t,n)}async function kw(r){if(typeof r=="string")return`data:,${r.slice(0,5)}`;if(r instanceof Blob){let t=r.slice(0,5);return await new Promise(n=>{let s=new FileReader;s.onload=i=>n(i?.target?.result),s.readAsDataURL(t)})}if(r instanceof ArrayBuffer){let t=r.slice(0,5);return`data:base64,${Nw(t)}`}return null}function Nw(r){let e="",t=new Uint8Array(r);for(let n=0;n<t.byteLength;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function Dw(r){return!Fw(r)&&!Bw(r)}function Fw(r){return r.startsWith("http:")||r.startsWith("https:")}function Bw(r){return r.startsWith("data:")}async function ss(r,e){if(typeof r=="string"){let t=ch(r);return Dw(t)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(t,e):await fetch(t,e)}return await Qa(r)}Cs();var dh=new Ie({id:"loaders.gl"}),Ja=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},ec=class{console;constructor(){this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}};var ph={fetch:null,mimeType:void 0,nothrow:!1,log:new ec,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:on,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},Ng={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 mh(){globalThis.loaders=globalThis.loaders||{};let{loaders:r}=globalThis;return r._state||(r._state={}),r._state}function gh(){let r=mh();return r.globalOptions=r.globalOptions||{...ph},r.globalOptions}function Bg(r,e,t,n){return t=t||[],t=Array.isArray(t)?t:[t],Lw(r,t),Vw(e,r,n)}function Lw(r,e){Dg(r,null,ph,Ng,e);for(let t of e){let n=r&&r[t.id]||{},s=t.options&&t.options[t.id]||{},i=t.deprecatedOptions&&t.deprecatedOptions[t.id]||{};Dg(n,t.id,s,i,e)}}function Dg(r,e,t,n,s){let i=e||"Top level",o=e?`${e}.`:"";for(let a in r){let c=!e&&ln(r[a]),l=a==="baseUri"&&!e,u=a==="workerUrl"&&e;if(!(a in t)&&!l&&!u){if(a in n)dh.warn(`${i} loader option '${o}${a}' no longer supported, use '${n[a]}'`)();else if(!c){let f=Uw(a,s);dh.warn(`${i} loader option '${o}${a}' not recognized. ${f}`)()}}}}function Uw(r,e){let t=r.toLowerCase(),n="";for(let s of e)for(let i in s.options){if(r===i)return`Did you mean '${s.id}.${i}'?`;let o=i.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(n=n||`Did you mean '${s.id}.${i}'?`)}return n}function Vw(r,e,t){let s={...r.options||{}};return zw(s,t),s.log===null&&(s.log=new Ja),Fg(s,gh()),Fg(s,e),s}function Fg(r,e){for(let t in e)if(t in e){let n=e[t];uh(n)&&uh(r[t])?r[t]={...r[t],...e[t]}:r[t]=e[t]}}function zw(r,e){e&&!("baseUri"in r)&&(r.baseUri=e)}function bi(r){return r?(Array.isArray(r)&&(r=r[0]),Array.isArray(r?.extensions)):!1}function Ti(r){wr(r,"null loader"),wr(bi(r),"invalid loader");let e;return Array.isArray(r)&&(e=r[1],r=r[0],r={...r,options:{...r.options,...e}}),(r?.parseTextSync||r?.parseText)&&(r.text=!0),r.text||(r.binary=!0),r}var Lg=()=>{let r=mh();return r.loaderRegistry=r.loaderRegistry||[],r.loaderRegistry};function wi(r){let e=Lg();r=Array.isArray(r)?r:[r];for(let t of r){let n=Ti(t);e.find(s=>n===s)||e.unshift(n)}}function Ug(){return Lg()}var Ww=/\.([^.]+)$/;async function Wg(r,e=[],t,n){if(!$g(r))return null;let s=Vg(r,e,{...t,nothrow:!0},n);if(s)return s;if(nt(r)&&(r=await r.slice(0,10).arrayBuffer(),s=Vg(r,e,t,n)),!s&&!t?.nothrow)throw new Error(jg(r));return s}function Vg(r,e=[],t,n){if(!$g(r))return null;if(e&&!Array.isArray(e))return Ti(e);let s=[];e&&(s=s.concat(e)),t?.ignoreRegisteredLoaders||s.push(...Ug()),jw(s);let i=$w(r,s,t,n);if(!i&&!t?.nothrow)throw new Error(jg(r));return i}function $w(r,e,t,n){let s=un(r),i=xi(r),o=ns(s)||n?.url,a=null,c="";return t?.mimeType&&(a=_h(e,t?.mimeType),c=`match forced by supplied MIME type ${t?.mimeType}`),a=a||Hw(e,o),c=c||(a?`matched url ${o}`:""),a=a||_h(e,i),c=c||(a?`matched MIME type ${i}`:""),a=a||Yw(e,r),c=c||(a?`matched initial data ${Hg(r)}`:""),t?.fallbackMimeType&&(a=a||_h(e,t?.fallbackMimeType),c=c||(a?`matched fallback MIME type ${i}`:"")),c&&Kf.log(1,`selectLoader selected ${a?.name}: ${c}.`),a}function $g(r){return!(r instanceof Response&&r.status===204)}function jg(r){let e=un(r),t=xi(r),n="No valid loader found (";n+=e?`${cn.filename(e)}, `:"no url provided, ",n+=`MIME type: ${t?`"${t}"`:"not provided"}, `;let s=r?Hg(r):"";return n+=s?` first bytes: "${s}"`:"first bytes: not available",n+=")",n}function jw(r){for(let e of r)Ti(e)}function Hw(r,e){let t=e&&Ww.exec(e),n=t&&t[1];return n?Xw(r,n):null}function Xw(r,e){e=e.toLowerCase();for(let t of r)for(let n of t.extensions)if(n.toLowerCase()===e)return t;return null}function _h(r,e){for(let t of r)if(t.mimeTypes?.some(n=>fh(e,n))||fh(e,`application/x.${t.id}`))return t;return null}function Yw(r,e){if(!e)return null;for(let t of r)if(typeof e=="string"){if(qw(e,t))return t}else if(ArrayBuffer.isView(e)){if(zg(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&zg(e,0,t))return t;return null}function qw(r,e){return e.testText?e.testText(r):(Array.isArray(e.tests)?e.tests:[e.tests]).some(n=>r.startsWith(n))}function zg(r,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(s=>Kw(r,e,t,s))}function Kw(r,e,t,n){if(n instanceof ArrayBuffer)return ih(n,r,n.byteLength);switch(typeof n){case"function":return n(r);case"string":let s=yh(r,e,n.length);return n===s;default:return!1}}function Hg(r,e=5){return typeof r=="string"?r.slice(0,e):ArrayBuffer.isView(r)?yh(r.buffer,r.byteOffset,e):r instanceof ArrayBuffer?yh(r,0,e):""}function yh(r,e,t){if(r.byteLength<e+t)return"";let n=new DataView(r),s="";for(let i=0;i<t;i++)s+=String.fromCharCode(n.getUint8(e+i));return s}function*Xg(r,e){let t=e?.chunkSize||262144,n=0,s=new TextEncoder;for(;n<r.length;){let i=Math.min(r.length-n,t),o=r.slice(n,n+i);n+=i,yield s.encode(o)}}function*Yg(r,e={}){let{chunkSize:t=262144}=e,n=0;for(;n<r.byteLength;){let s=Math.min(r.byteLength-n,t),i=new ArrayBuffer(s),o=new Uint8Array(r,n,s);new Uint8Array(i).set(o),n+=s,yield i}}async function*qg(r,e){let t=e?.chunkSize||1048576,n=0;for(;n<r.size;){let s=n+t,i=await r.slice(n,s).arrayBuffer();n=s,yield i}}function xh(r,e){return on?Zw(r,e):Gw(r,e)}async function*Zw(r,e){let t=r.getReader(),n;try{for(;;){let s=n||t.read();e?._streamReadAhead&&(n=t.read());let{done:i,value:o}=await s;if(i)return;yield Ka(o)}}catch{t.releaseLock()}}async function*Gw(r,e){for await(let t of r)yield Ka(t)}function Kg(r,e){if(typeof r=="string")return Xg(r,e);if(r instanceof ArrayBuffer)return Yg(r,e);if(nt(r))return qg(r,e);if(Za(r))return xh(r,e);if(rt(r))return xh(r.body,e);throw new Error("makeIterator")}var Zg="Cannot convert supplied data type";function Qw(r,e,t){if(e.text&&typeof r=="string")return r;if(Rg(r)&&(r=r.buffer),r instanceof ArrayBuffer){let n=r;return e.text&&!e.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(r)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(r);let n=r.buffer,s=r.byteLength||r.length;return(r.byteOffset!==0||s!==n.byteLength)&&(n=n.slice(r.byteOffset,r.byteOffset+s)),n}throw new Error(Zg)}async function Gg(r,e,t){let n=r instanceof ArrayBuffer||ArrayBuffer.isView(r);if(typeof r=="string"||n)return Qw(r,e,t);if(nt(r)&&(r=await Qa(r)),rt(r)){let s=r;return await kg(s),e.binary?await s.arrayBuffer():await s.text()}if(Za(r)&&(r=Kg(r,t)),Sg(r)||Eg(r))return ah(r);throw new Error(Zg)}function tc(r,e){let t=gh(),n=r||t;return typeof n.fetch=="function"?n.fetch:ln(n.fetch)?s=>ss(s,n.fetch):e?.fetch?e?.fetch:ss}function Qg(r,e,t){if(t)return t;let n={fetch:tc(e,r),...r};if(n.url){let s=ns(n.url);n.baseUrl=s,n.queryString=Cg(n.url),n.filename=cn.filename(s),n.baseUrl=cn.dirname(s)}return Array.isArray(n.loaders)||(n.loaders=null),n}function Jg(r,e){if(r&&!Array.isArray(r))return r;let t;if(r&&(t=Array.isArray(r)?r:[r]),e&&e.loaders){let n=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...n]:n}return t&&t.length?t:void 0}async function Sr(r,e,t,n){e&&!Array.isArray(e)&&!bi(e)&&(n=void 0,t=e,e=void 0),r=await r,t=t||{};let s=un(r),o=Jg(e,n),a=await Wg(r,o,t);return a?(t=Bg(t,a,o,s),n=Qg({url:s,_parse:Sr,loaders:o},t,n||null),await Jw(a,r,t,n)):null}async function Jw(r,e,t,n){if(rh(r),t=Zf(r.options,t),rt(e)){let i=e,{ok:o,redirected:a,status:c,statusText:l,type:u,url:f}=i,h=Object.fromEntries(i.headers.entries());n.response={headers:h,ok:o,redirected:a,status:c,statusText:l,type:u,url:f}}e=await Gg(e,r,t);let s=r;if(s.parseTextSync&&typeof e=="string")return s.parseTextSync(e,t,n);if(nh(r,t))return await sh(r,e,t,n,Sr);if(s.parseText&&typeof e=="string")return await s.parseText(e,t,n);if(s.parse)return await s.parse(e,t,n);throw ke(!s.parseSync),new Error(`${r.id} loader - no parser found and worker is disabled`)}async function Er(r,e,t,n){let s,i;!Array.isArray(e)&&!bi(e)?(s=[],i=e,n=void 0):(s=e,i=t);let o=tc(i),a=r;return typeof r=="string"&&(a=await o(r)),nt(r)&&(a=await o(r)),Array.isArray(s)?await Sr(a,s,i):await Sr(a,s,i)}var e_="4.3.3";var e2=globalThis.loaders?.parseImageNode,Th=typeof Image<"u",wh=typeof ImageBitmap<"u",t2=Boolean(e2),vh=on?!0:t2;function t_(r){switch(r){case"auto":return wh||Th||vh;case"imagebitmap":return wh;case"image":return Th;case"data":return vh;default:throw new Error(`@loaders.gl/images: image ${r} not supported in this environment`)}}function r_(){if(wh)return"imagebitmap";if(Th)return"image";if(vh)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function r2(r){let e=n2(r);if(!e)throw new Error("Not an image");return e}function n_(r){switch(r2(r)){case"data":return r;case"image":case"imagebitmap":let e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=r.width,e.height=r.height,t.drawImage(r,0,0),t.getImageData(0,0,r.width,r.height);default:throw new Error("getImageData")}}function n2(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&r instanceof Image?"image":r&&typeof r=="object"&&r.data&&r.width&&r.height?"data":null}var s2=/^data:image\/svg\+xml/,i2=/\.svg((\?|#).*)?$/;function rc(r){return r&&(s2.test(r)||i2.test(r))}function s_(r,e){if(rc(e)){let n=new TextDecoder().decode(r);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return Ah(r,e)}function Ah(r,e){if(rc(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(r)])}async function nc(r,e,t){let n=s_(r,t),s=self.URL||self.webkitURL,i=typeof n!="string"&&s.createObjectURL(n);try{return await o2(i||n,e)}finally{i&&s.revokeObjectURL(i)}}async function o2(r,e){let t=new Image;return t.src=r,e.image&&e.image.decode&&t.decode?(await t.decode(),t):await new Promise((n,s)=>{try{t.onload=()=>n(t),t.onerror=i=>{let o=i instanceof Error?i.message:"error";s(new Error(o))}}catch(i){s(i)}})}var a2={},i_=!0;async function o_(r,e,t){let n;rc(t)?n=await nc(r,e,t):n=Ah(r,t);let s=e&&e.imagebitmap;return await c2(n,s)}async function c2(r,e=null){if((l2(e)||!i_)&&(e=null),e)try{return await createImageBitmap(r,e)}catch(t){console.warn(t),i_=!1}return await createImageBitmap(r)}function l2(r){for(let e in r||a2)return!1;return!0}function a_(r){return!d2(r,"ftyp",4)||!(r[8]&96)?null:u2(r)}function u2(r){switch(f2(r,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function f2(r,e,t){return String.fromCharCode(...r.slice(e,t))}function h2(r){return[...r].map(e=>e.charCodeAt(0))}function d2(r,e,t=0){let n=h2(e);for(let s=0;s<n.length;++s)if(n[s]!==r[s+t])return!1;return!0}var kt=!1,vi=!0;function sc(r){let e=Ai(r);return m2(e)||y2(e)||g2(e)||_2(e)||p2(e)}function p2(r){let e=new Uint8Array(r instanceof DataView?r.buffer:r),t=a_(e);return t?{mimeType:t.mimeType,width:0,height:0}:null}function m2(r){let e=Ai(r);return e.byteLength>=24&&e.getUint32(0,kt)===2303741511?{mimeType:"image/png",width:e.getUint32(16,kt),height:e.getUint32(20,kt)}:null}function g2(r){let e=Ai(r);return e.byteLength>=10&&e.getUint32(0,kt)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,vi),height:e.getUint16(8,vi)}:null}function _2(r){let e=Ai(r);return e.byteLength>=14&&e.getUint16(0,kt)===16973&&e.getUint32(2,vi)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,vi),height:e.getUint32(22,vi)}:null}function y2(r){let e=Ai(r);if(!(e.byteLength>=3&&e.getUint16(0,kt)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=x2(),i=2;for(;i+9<e.byteLength;){let o=e.getUint16(i,kt);if(s.has(o))return{mimeType:"image/jpeg",height:e.getUint16(i+5,kt),width:e.getUint16(i+7,kt)};if(!n.has(o))return null;i+=2,i+=e.getUint16(i,kt)}return null}function x2(){let r=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)r.add(t);return{tableMarkers:r,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Ai(r){if(r instanceof DataView)return r;if(ArrayBuffer.isView(r))return new DataView(r.buffer);if(r instanceof ArrayBuffer)return new DataView(r);throw new Error("toDataView")}async function c_(r,e){let{mimeType:t}=sc(r)||{},n=globalThis.loaders?.parseImageNode;return wr(n),await n(r,t)}async function l_(r,e,t){e=e||{};let s=(e.image||{}).type||"auto",{url:i}=t||{},o=b2(s),a;switch(o){case"imagebitmap":a=await o_(r,e,i);break;case"image":a=await nc(r,e,i);break;case"data":a=await c_(r,e);break;default:wr(!1)}return s==="data"&&(a=n_(a)),a}function b2(r){switch(r){case"auto":case"data":return r_();default:return t_(r),r}}var T2=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],w2=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],v2={image:{type:"auto",decode:!0}},Sh={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:e_,mimeTypes:w2,extensions:T2,parse:l_,tests:[r=>Boolean(sc(new DataView(r)))],options:v2};Cs();var A2=new Ie({id:"deck"}),$=A2;var Eh={};function ic(r){Eh=r}function he(r,e,t,n){$.level>0&&Eh[r]&&Eh[r].call(null,e,t,n)}function S2(r){let e=r[0],t=r[r.length-1];return e==="{"&&t==="}"||e==="["&&t==="]"}var u_={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:S2,parseTextSync:JSON.parse};function E2(){let r="9.2.9",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==r)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${r}`);return e||($.log(1,`deck.gl ${r}`)(),globalThis.deck={...globalThis.deck,VERSION:r,version:r,log:$,_registerLoggers:ic},wi([u_,[Sh,{imagebitmap:{premultiplyAlpha:"none"}}]])),r}var oc=E2();var f_=`uniform layerUniforms {
|
|
861
|
+
}`}function Jf(r,e=!0,t){let n=t||new Set;if(r){if(bg(r))n.add(r);else if(bg(r.buffer))n.add(r.buffer);else if(!ArrayBuffer.isView(r)){if(e&&typeof r=="object")for(let s in r)Jf(r[s],e,n)}}return t===void 0?Array.from(n):[]}function bg(r){return r?r instanceof ArrayBuffer||typeof MessagePort<"u"&&r instanceof MessagePort||typeof ImageBitmap<"u"&&r instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas:!1}var eh=()=>{},vr=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&tt||typeof rs<"u"&&!tt}constructor(e){let{name:t,source:n,url:s}=e;ke(n||s),this.name=t,this.source=n,this.url=s,this.onMessage=eh,this.onError=i=>console.log(i),this.worker=tt?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=eh,this.onError=eh,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||Jf(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=yg({source:this.source,url:this.url});let e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}_createNodeWorker(){let e;if(this.url){let n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;e=new rs(n,{eval:!1})}else if(this.source)e=new rs(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",t=>{this.onMessage(t)}),e.on("error",t=>{this.onError(t)}),e.on("exit",t=>{}),e}};var gi=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return vr.isSupported()}constructor(e){this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,t=(s,i,o)=>s.done(o),n=(s,i)=>s.error(i)){let s=new Promise(i=>(this.jobQueue.push({name:e,onMessage:t,onError:n,onStart:i}),this));return this._startQueuedJob(),await s}async _startQueuedJob(){if(!this.jobQueue.length)return;let e=this._getAvailableWorker();if(!e)return;let t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});let n=new mi(t.name,e);e.onMessage=s=>t.onMessage(n,s.type,s.payload),e.onError=s=>t.onError(n,s),t.onStart(n);try{await n.result}catch(s){console.error(`Worker exception: ${s}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!tt||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new vr({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return _g?this.maxMobileConcurrency:this.maxConcurrency}};var xw={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},an=class{props;workerPools=new Map;static isSupported(){return vr.isSupported()}static getWorkerFarm(e={}){return an._workerFarm=an._workerFarm||new an({}),an._workerFarm.setProps(e),an._workerFarm}constructor(e){this.props={...xw},this.setProps(e),this.workerPools=new Map}destroy(){for(let e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(let t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){let{name:t,source:n,url:s}=e,i=this.workerPools.get(t);return i||(i=new gi({name:t,source:n,url:s}),i.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,i)),i}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},Ar=an;L(Ar,"_workerFarm");function th(r,e={}){let t=e[r.id]||{},n=tt?`${r.id}-worker.js`:`${r.id}-worker-node.js`,s=t.workerUrl;if(!s&&r.id==="compression"&&(s=e.workerUrl),e._workerType==="test"&&(tt?s=`modules/${r.module}/dist/${n}`:s=`modules/${r.module}/src/workers/${r.id}-worker-node.ts`),!s){let i=r.version;i==="latest"&&(i=mg);let o=i?`@${i}`:"";s=`https://unpkg.com/@loaders.gl/${r.module}${o}/dist/${n}`}return ke(s),s}function rh(r,e=Gf){ke(r,"no worker provided");let t=r.version;return!(!e||!t)}function nh(r,e){return!Ar.isSupported()||!tt&&!e?._nodeWorkers?!1:r.worker&&e?.worker}async function sh(r,e,t,n,s){let i=r.id,o=th(r,t),c=Ar.getWorkerFarm(t).getWorkerPool({name:i,url:o});t=JSON.parse(JSON.stringify(t)),n=JSON.parse(JSON.stringify(n||{}));let l=await c.startJob("process-on-worker",bw.bind(null,s));return l.postMessage("process",{input:e,options:t,context:n}),await(await l.result).result}async function bw(r,e,t,n){switch(t){case"done":e.done(n);break;case"error":e.error(new Error(n.error));break;case"process":let{id:s,input:i,options:o}=n;try{let a=await r(i,o);e.postMessage("done",{id:s,result:a})}catch(a){let c=a instanceof Error?a.message:"unknown error";e.postMessage("error",{id:s,error:c})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}}function ih(r,e,t){if(t=t||r.byteLength,r.byteLength<t||e.byteLength<t)return!1;let n=new Uint8Array(r),s=new Uint8Array(e);for(let i=0;i<n.length;++i)if(n[i]!==s[i])return!1;return!0}function oh(...r){return Tg(r)}function Tg(r){let e=r.map(i=>i instanceof ArrayBuffer?new Uint8Array(i):i),t=e.reduce((i,o)=>i+o.byteLength,0),n=new Uint8Array(t),s=0;for(let i of e)n.set(i,s),s+=i.byteLength;return n.buffer}async function ah(r){let e=[];for await(let t of r)e.push(t);return oh(...e)}var Tw="",wg={};function ch(r){for(let e in wg)if(r.startsWith(e)){let t=wg[e];r=r.replace(e,t)}return!r.startsWith("http://")&&!r.startsWith("https://")&&(r=`${Tw}${r}`),r}function vg(r){return r&&typeof r=="object"&&r.isBuffer}function Ka(r){if(vg(r))return r;if(r instanceof ArrayBuffer)return r;if(ArrayBuffer.isView(r))return r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);if(typeof r=="string"){let e=r;return new TextEncoder().encode(e).buffer}if(r&&typeof r=="object"&&r._toArrayBuffer)return r._toArrayBuffer();throw new Error("toArrayBuffer")}var cn={};$t(cn,{dirname:()=>vw,filename:()=>ww,join:()=>Aw,resolve:()=>Sw});function Ag(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let r=window.location?.pathname;return r?.slice(0,r.lastIndexOf("/")+1)||""}function ww(r){let e=r?r.lastIndexOf("/"):-1;return e>=0?r.substr(e+1):""}function vw(r){let e=r?r.lastIndexOf("/"):-1;return e>=0?r.substr(0,e):""}function Aw(...r){let e="/";return r=r.map((t,n)=>(n&&(t=t.replace(new RegExp(`^${e}`),"")),n!==r.length-1&&(t=t.replace(new RegExp(`${e}$`),"")),t)),r.join(e)}function Sw(...r){let e=[];for(let i=0;i<r.length;i++)e[i]=r[i];let t="",n=!1,s;for(let i=e.length-1;i>=-1&&!n;i--){let o;i>=0?o=e[i]:(s===void 0&&(s=Ag()),o=s),o.length!==0&&(t=`${o}/${t}`,n=o.charCodeAt(0)===_i)}return t=Ew(t,!n),n?`/${t}`:t.length>0?t:"."}var _i=47,lh=46;function Ew(r,e){let t="",n=-1,s=0,i,o=!1;for(let a=0;a<=r.length;++a){if(a<r.length)i=r.charCodeAt(a);else{if(i===_i)break;i=_i}if(i===_i){if(!(n===a-1||s===1))if(n!==a-1&&s===2){if(t.length<2||!o||t.charCodeAt(t.length-1)!==lh||t.charCodeAt(t.length-2)!==lh){if(t.length>2){let c=t.length-1,l=c;for(;l>=0&&t.charCodeAt(l)!==_i;--l);if(l!==c){t=l===-1?"":t.slice(0,l),n=a,s=0,o=!1;continue}}else if(t.length===2||t.length===1){t="",n=a,s=0,o=!1;continue}}e&&(t.length>0?t+="/..":t="..",o=!0)}else{let c=r.slice(n+1,a);t.length>0?t+=`/${c}`:t=c,o=!1}n=a,s=0}else i===lh&&s!==-1?++s:s=-1}return t}var Rw=r=>typeof r=="boolean",yi=r=>typeof r=="function",ln=r=>r!==null&&typeof r=="object",uh=r=>ln(r)&&r.constructor==={}.constructor;var Sg=r=>Boolean(r)&&typeof r[Symbol.iterator]=="function",Eg=r=>r&&typeof r[Symbol.asyncIterator]=="function";var rt=r=>typeof Response<"u"&&r instanceof Response||r&&r.arrayBuffer&&r.text&&r.json;var nt=r=>typeof Blob<"u"&&r instanceof Blob,Rg=r=>r&&typeof r=="object"&&r.isBuffer;var Iw=r=>typeof ReadableStream<"u"&&r instanceof ReadableStream||ln(r)&&yi(r.tee)&&yi(r.cancel)&&yi(r.getReader);var Pw=r=>ln(r)&&yi(r.read)&&yi(r.pipe)&&Rw(r.readable),Za=r=>Iw(r)||Pw(r);var Ga=class extends Error{constructor(e,t){super(e),this.reason=t.reason,this.url=t.url,this.response=t.response}reason;url;response};var Cw=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Mw=/^([-\w.]+\/[-\w.+]+)/;function fh(r,e){return r.toLowerCase()===e.toLowerCase()}function Ig(r){let e=Mw.exec(r);return e?e[1]:r}function hh(r){let e=Cw.exec(r);return e?e[1]:""}var Pg=/\?.*/;function Cg(r){let e=r.match(Pg);return e&&e[0]}function ns(r){return r.replace(Pg,"")}function Mg(r){if(r.length<50)return r;let e=r.slice(r.length-15);return`${r.substr(0,32)}...${e}`}function un(r){return rt(r)?r.url:nt(r)?r.name||"":typeof r=="string"?r:""}function xi(r){if(rt(r)){let e=r,t=e.headers.get("content-type")||"",n=ns(e.url);return Ig(t)||hh(n)}return nt(r)?r.type||"":typeof r=="string"?hh(r):""}function Og(r){return rt(r)?r.headers["content-length"]||-1:nt(r)?r.size:typeof r=="string"?r.length:r instanceof ArrayBuffer||ArrayBuffer.isView(r)?r.byteLength:-1}async function Qa(r){if(rt(r))return r;let e={},t=Og(r);t>=0&&(e["content-length"]=String(t));let n=un(r),s=xi(r);s&&(e["content-type"]=s);let i=await kw(r);i&&(e["x-first-bytes"]=i),typeof r=="string"&&(r=new TextEncoder().encode(r));let o=new Response(r,{headers:e});return Object.defineProperty(o,"url",{value:n}),o}async function kg(r){if(!r.ok)throw await Ow(r)}async function Ow(r){let e=Mg(r.url),t=`Failed to fetch resource (${r.status}) ${r.statusText}: ${e}`;t=t.length>100?`${t.slice(0,100)}...`:t;let n={reason:r.statusText,url:r.url,response:r};try{let s=r.headers.get("Content-Type");n.reason=!r.bodyUsed&&s?.includes("application/json")?await r.json():await r.text()}catch{}return new Ga(t,n)}async function kw(r){if(typeof r=="string")return`data:,${r.slice(0,5)}`;if(r instanceof Blob){let t=r.slice(0,5);return await new Promise(n=>{let s=new FileReader;s.onload=i=>n(i?.target?.result),s.readAsDataURL(t)})}if(r instanceof ArrayBuffer){let t=r.slice(0,5);return`data:base64,${Nw(t)}`}return null}function Nw(r){let e="",t=new Uint8Array(r);for(let n=0;n<t.byteLength;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function Dw(r){return!Fw(r)&&!Bw(r)}function Fw(r){return r.startsWith("http:")||r.startsWith("https:")}function Bw(r){return r.startsWith("data:")}async function ss(r,e){if(typeof r=="string"){let t=ch(r);return Dw(t)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(t,e):await fetch(t,e)}return await Qa(r)}Cs();var dh=new Ie({id:"loaders.gl"}),Ja=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},ec=class{console;constructor(){this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}};var ph={fetch:null,mimeType:void 0,nothrow:!1,log:new ec,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:on,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},Ng={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 mh(){globalThis.loaders=globalThis.loaders||{};let{loaders:r}=globalThis;return r._state||(r._state={}),r._state}function gh(){let r=mh();return r.globalOptions=r.globalOptions||{...ph},r.globalOptions}function Bg(r,e,t,n){return t=t||[],t=Array.isArray(t)?t:[t],Lw(r,t),Vw(e,r,n)}function Lw(r,e){Dg(r,null,ph,Ng,e);for(let t of e){let n=r&&r[t.id]||{},s=t.options&&t.options[t.id]||{},i=t.deprecatedOptions&&t.deprecatedOptions[t.id]||{};Dg(n,t.id,s,i,e)}}function Dg(r,e,t,n,s){let i=e||"Top level",o=e?`${e}.`:"";for(let a in r){let c=!e&&ln(r[a]),l=a==="baseUri"&&!e,u=a==="workerUrl"&&e;if(!(a in t)&&!l&&!u){if(a in n)dh.warn(`${i} loader option '${o}${a}' no longer supported, use '${n[a]}'`)();else if(!c){let f=Uw(a,s);dh.warn(`${i} loader option '${o}${a}' not recognized. ${f}`)()}}}}function Uw(r,e){let t=r.toLowerCase(),n="";for(let s of e)for(let i in s.options){if(r===i)return`Did you mean '${s.id}.${i}'?`;let o=i.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(n=n||`Did you mean '${s.id}.${i}'?`)}return n}function Vw(r,e,t){let s={...r.options||{}};return zw(s,t),s.log===null&&(s.log=new Ja),Fg(s,gh()),Fg(s,e),s}function Fg(r,e){for(let t in e)if(t in e){let n=e[t];uh(n)&&uh(r[t])?r[t]={...r[t],...e[t]}:r[t]=e[t]}}function zw(r,e){e&&!("baseUri"in r)&&(r.baseUri=e)}function bi(r){return r?(Array.isArray(r)&&(r=r[0]),Array.isArray(r?.extensions)):!1}function Ti(r){wr(r,"null loader"),wr(bi(r),"invalid loader");let e;return Array.isArray(r)&&(e=r[1],r=r[0],r={...r,options:{...r.options,...e}}),(r?.parseTextSync||r?.parseText)&&(r.text=!0),r.text||(r.binary=!0),r}var Lg=()=>{let r=mh();return r.loaderRegistry=r.loaderRegistry||[],r.loaderRegistry};function wi(r){let e=Lg();r=Array.isArray(r)?r:[r];for(let t of r){let n=Ti(t);e.find(s=>n===s)||e.unshift(n)}}function Ug(){return Lg()}var Ww=/\.([^.]+)$/;async function Wg(r,e=[],t,n){if(!$g(r))return null;let s=Vg(r,e,{...t,nothrow:!0},n);if(s)return s;if(nt(r)&&(r=await r.slice(0,10).arrayBuffer(),s=Vg(r,e,t,n)),!s&&!t?.nothrow)throw new Error(jg(r));return s}function Vg(r,e=[],t,n){if(!$g(r))return null;if(e&&!Array.isArray(e))return Ti(e);let s=[];e&&(s=s.concat(e)),t?.ignoreRegisteredLoaders||s.push(...Ug()),jw(s);let i=$w(r,s,t,n);if(!i&&!t?.nothrow)throw new Error(jg(r));return i}function $w(r,e,t,n){let s=un(r),i=xi(r),o=ns(s)||n?.url,a=null,c="";return t?.mimeType&&(a=_h(e,t?.mimeType),c=`match forced by supplied MIME type ${t?.mimeType}`),a=a||Hw(e,o),c=c||(a?`matched url ${o}`:""),a=a||_h(e,i),c=c||(a?`matched MIME type ${i}`:""),a=a||Yw(e,r),c=c||(a?`matched initial data ${Hg(r)}`:""),t?.fallbackMimeType&&(a=a||_h(e,t?.fallbackMimeType),c=c||(a?`matched fallback MIME type ${i}`:"")),c&&Kf.log(1,`selectLoader selected ${a?.name}: ${c}.`),a}function $g(r){return!(r instanceof Response&&r.status===204)}function jg(r){let e=un(r),t=xi(r),n="No valid loader found (";n+=e?`${cn.filename(e)}, `:"no url provided, ",n+=`MIME type: ${t?`"${t}"`:"not provided"}, `;let s=r?Hg(r):"";return n+=s?` first bytes: "${s}"`:"first bytes: not available",n+=")",n}function jw(r){for(let e of r)Ti(e)}function Hw(r,e){let t=e&&Ww.exec(e),n=t&&t[1];return n?Xw(r,n):null}function Xw(r,e){e=e.toLowerCase();for(let t of r)for(let n of t.extensions)if(n.toLowerCase()===e)return t;return null}function _h(r,e){for(let t of r)if(t.mimeTypes?.some(n=>fh(e,n))||fh(e,`application/x.${t.id}`))return t;return null}function Yw(r,e){if(!e)return null;for(let t of r)if(typeof e=="string"){if(qw(e,t))return t}else if(ArrayBuffer.isView(e)){if(zg(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&zg(e,0,t))return t;return null}function qw(r,e){return e.testText?e.testText(r):(Array.isArray(e.tests)?e.tests:[e.tests]).some(n=>r.startsWith(n))}function zg(r,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(s=>Kw(r,e,t,s))}function Kw(r,e,t,n){if(n instanceof ArrayBuffer)return ih(n,r,n.byteLength);switch(typeof n){case"function":return n(r);case"string":let s=yh(r,e,n.length);return n===s;default:return!1}}function Hg(r,e=5){return typeof r=="string"?r.slice(0,e):ArrayBuffer.isView(r)?yh(r.buffer,r.byteOffset,e):r instanceof ArrayBuffer?yh(r,0,e):""}function yh(r,e,t){if(r.byteLength<e+t)return"";let n=new DataView(r),s="";for(let i=0;i<t;i++)s+=String.fromCharCode(n.getUint8(e+i));return s}function*Xg(r,e){let t=e?.chunkSize||262144,n=0,s=new TextEncoder;for(;n<r.length;){let i=Math.min(r.length-n,t),o=r.slice(n,n+i);n+=i,yield s.encode(o)}}function*Yg(r,e={}){let{chunkSize:t=262144}=e,n=0;for(;n<r.byteLength;){let s=Math.min(r.byteLength-n,t),i=new ArrayBuffer(s),o=new Uint8Array(r,n,s);new Uint8Array(i).set(o),n+=s,yield i}}async function*qg(r,e){let t=e?.chunkSize||1048576,n=0;for(;n<r.size;){let s=n+t,i=await r.slice(n,s).arrayBuffer();n=s,yield i}}function xh(r,e){return on?Zw(r,e):Gw(r,e)}async function*Zw(r,e){let t=r.getReader(),n;try{for(;;){let s=n||t.read();e?._streamReadAhead&&(n=t.read());let{done:i,value:o}=await s;if(i)return;yield Ka(o)}}catch{t.releaseLock()}}async function*Gw(r,e){for await(let t of r)yield Ka(t)}function Kg(r,e){if(typeof r=="string")return Xg(r,e);if(r instanceof ArrayBuffer)return Yg(r,e);if(nt(r))return qg(r,e);if(Za(r))return xh(r,e);if(rt(r))return xh(r.body,e);throw new Error("makeIterator")}var Zg="Cannot convert supplied data type";function Qw(r,e,t){if(e.text&&typeof r=="string")return r;if(Rg(r)&&(r=r.buffer),r instanceof ArrayBuffer){let n=r;return e.text&&!e.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(r)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(r);let n=r.buffer,s=r.byteLength||r.length;return(r.byteOffset!==0||s!==n.byteLength)&&(n=n.slice(r.byteOffset,r.byteOffset+s)),n}throw new Error(Zg)}async function Gg(r,e,t){let n=r instanceof ArrayBuffer||ArrayBuffer.isView(r);if(typeof r=="string"||n)return Qw(r,e,t);if(nt(r)&&(r=await Qa(r)),rt(r)){let s=r;return await kg(s),e.binary?await s.arrayBuffer():await s.text()}if(Za(r)&&(r=Kg(r,t)),Sg(r)||Eg(r))return ah(r);throw new Error(Zg)}function tc(r,e){let t=gh(),n=r||t;return typeof n.fetch=="function"?n.fetch:ln(n.fetch)?s=>ss(s,n.fetch):e?.fetch?e?.fetch:ss}function Qg(r,e,t){if(t)return t;let n={fetch:tc(e,r),...r};if(n.url){let s=ns(n.url);n.baseUrl=s,n.queryString=Cg(n.url),n.filename=cn.filename(s),n.baseUrl=cn.dirname(s)}return Array.isArray(n.loaders)||(n.loaders=null),n}function Jg(r,e){if(r&&!Array.isArray(r))return r;let t;if(r&&(t=Array.isArray(r)?r:[r]),e&&e.loaders){let n=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...n]:n}return t&&t.length?t:void 0}async function Sr(r,e,t,n){e&&!Array.isArray(e)&&!bi(e)&&(n=void 0,t=e,e=void 0),r=await r,t=t||{};let s=un(r),o=Jg(e,n),a=await Wg(r,o,t);return a?(t=Bg(t,a,o,s),n=Qg({url:s,_parse:Sr,loaders:o},t,n||null),await Jw(a,r,t,n)):null}async function Jw(r,e,t,n){if(rh(r),t=Zf(r.options,t),rt(e)){let i=e,{ok:o,redirected:a,status:c,statusText:l,type:u,url:f}=i,h=Object.fromEntries(i.headers.entries());n.response={headers:h,ok:o,redirected:a,status:c,statusText:l,type:u,url:f}}e=await Gg(e,r,t);let s=r;if(s.parseTextSync&&typeof e=="string")return s.parseTextSync(e,t,n);if(nh(r,t))return await sh(r,e,t,n,Sr);if(s.parseText&&typeof e=="string")return await s.parseText(e,t,n);if(s.parse)return await s.parse(e,t,n);throw ke(!s.parseSync),new Error(`${r.id} loader - no parser found and worker is disabled`)}async function Er(r,e,t,n){let s,i;!Array.isArray(e)&&!bi(e)?(s=[],i=e,n=void 0):(s=e,i=t);let o=tc(i),a=r;return typeof r=="string"&&(a=await o(r)),nt(r)&&(a=await o(r)),Array.isArray(s)?await Sr(a,s,i):await Sr(a,s,i)}var e_="4.3.3";var e2=globalThis.loaders?.parseImageNode,Th=typeof Image<"u",wh=typeof ImageBitmap<"u",t2=Boolean(e2),vh=on?!0:t2;function t_(r){switch(r){case"auto":return wh||Th||vh;case"imagebitmap":return wh;case"image":return Th;case"data":return vh;default:throw new Error(`@loaders.gl/images: image ${r} not supported in this environment`)}}function r_(){if(wh)return"imagebitmap";if(Th)return"image";if(vh)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function r2(r){let e=n2(r);if(!e)throw new Error("Not an image");return e}function n_(r){switch(r2(r)){case"data":return r;case"image":case"imagebitmap":let e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=r.width,e.height=r.height,t.drawImage(r,0,0),t.getImageData(0,0,r.width,r.height);default:throw new Error("getImageData")}}function n2(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&r instanceof Image?"image":r&&typeof r=="object"&&r.data&&r.width&&r.height?"data":null}var s2=/^data:image\/svg\+xml/,i2=/\.svg((\?|#).*)?$/;function rc(r){return r&&(s2.test(r)||i2.test(r))}function s_(r,e){if(rc(e)){let n=new TextDecoder().decode(r);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return Ah(r,e)}function Ah(r,e){if(rc(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(r)])}async function nc(r,e,t){let n=s_(r,t),s=self.URL||self.webkitURL,i=typeof n!="string"&&s.createObjectURL(n);try{return await o2(i||n,e)}finally{i&&s.revokeObjectURL(i)}}async function o2(r,e){let t=new Image;return t.src=r,e.image&&e.image.decode&&t.decode?(await t.decode(),t):await new Promise((n,s)=>{try{t.onload=()=>n(t),t.onerror=i=>{let o=i instanceof Error?i.message:"error";s(new Error(o))}}catch(i){s(i)}})}var a2={},i_=!0;async function o_(r,e,t){let n;rc(t)?n=await nc(r,e,t):n=Ah(r,t);let s=e&&e.imagebitmap;return await c2(n,s)}async function c2(r,e=null){if((l2(e)||!i_)&&(e=null),e)try{return await createImageBitmap(r,e)}catch(t){console.warn(t),i_=!1}return await createImageBitmap(r)}function l2(r){for(let e in r||a2)return!1;return!0}function a_(r){return!d2(r,"ftyp",4)||!(r[8]&96)?null:u2(r)}function u2(r){switch(f2(r,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function f2(r,e,t){return String.fromCharCode(...r.slice(e,t))}function h2(r){return[...r].map(e=>e.charCodeAt(0))}function d2(r,e,t=0){let n=h2(e);for(let s=0;s<n.length;++s)if(n[s]!==r[s+t])return!1;return!0}var kt=!1,vi=!0;function sc(r){let e=Ai(r);return m2(e)||y2(e)||g2(e)||_2(e)||p2(e)}function p2(r){let e=new Uint8Array(r instanceof DataView?r.buffer:r),t=a_(e);return t?{mimeType:t.mimeType,width:0,height:0}:null}function m2(r){let e=Ai(r);return e.byteLength>=24&&e.getUint32(0,kt)===2303741511?{mimeType:"image/png",width:e.getUint32(16,kt),height:e.getUint32(20,kt)}:null}function g2(r){let e=Ai(r);return e.byteLength>=10&&e.getUint32(0,kt)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,vi),height:e.getUint16(8,vi)}:null}function _2(r){let e=Ai(r);return e.byteLength>=14&&e.getUint16(0,kt)===16973&&e.getUint32(2,vi)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,vi),height:e.getUint32(22,vi)}:null}function y2(r){let e=Ai(r);if(!(e.byteLength>=3&&e.getUint16(0,kt)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=x2(),i=2;for(;i+9<e.byteLength;){let o=e.getUint16(i,kt);if(s.has(o))return{mimeType:"image/jpeg",height:e.getUint16(i+5,kt),width:e.getUint16(i+7,kt)};if(!n.has(o))return null;i+=2,i+=e.getUint16(i,kt)}return null}function x2(){let r=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)r.add(t);return{tableMarkers:r,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Ai(r){if(r instanceof DataView)return r;if(ArrayBuffer.isView(r))return new DataView(r.buffer);if(r instanceof ArrayBuffer)return new DataView(r);throw new Error("toDataView")}async function c_(r,e){let{mimeType:t}=sc(r)||{},n=globalThis.loaders?.parseImageNode;return wr(n),await n(r,t)}async function l_(r,e,t){e=e||{};let s=(e.image||{}).type||"auto",{url:i}=t||{},o=b2(s),a;switch(o){case"imagebitmap":a=await o_(r,e,i);break;case"image":a=await nc(r,e,i);break;case"data":a=await c_(r,e);break;default:wr(!1)}return s==="data"&&(a=n_(a)),a}function b2(r){switch(r){case"auto":case"data":return r_();default:return t_(r),r}}var T2=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],w2=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],v2={image:{type:"auto",decode:!0}},Sh={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:e_,mimeTypes:w2,extensions:T2,parse:l_,tests:[r=>Boolean(sc(new DataView(r)))],options:v2};Cs();var A2=new Ie({id:"deck"}),$=A2;var Eh={};function ic(r){Eh=r}function he(r,e,t,n){$.level>0&&Eh[r]&&Eh[r].call(null,e,t,n)}function S2(r){let e=r[0],t=r[r.length-1];return e==="{"&&t==="}"||e==="["&&t==="]"}var u_={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:S2,parseTextSync:JSON.parse};function E2(){let r="9.2.10",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==r)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${r}`);return e||($.log(1,`deck.gl ${r}`)(),globalThis.deck={...globalThis.deck,VERSION:r,version:r,log:$,_registerLoggers:ic},wi([u_,[Sh,{imagebitmap:{premultiplyAlpha:"none"}}]])),r}var oc=E2();var f_=`uniform layerUniforms {
|
|
862
862
|
uniform float opacity;
|
|
863
863
|
} layer;
|
|
864
864
|
`,Rh={name:"layer",vs:f_,fs:f_,getUniforms:r=>({opacity:Math.pow(r.opacity,.45454545454545453)}),uniformTypes:{opacity:"f32"}};var R2=`
|
|
@@ -1667,6 +1667,6 @@ void main(void) {
|
|
|
1667
1667
|
discard;
|
|
1668
1668
|
}
|
|
1669
1669
|
fragColor = vec4(1.0);
|
|
1670
|
-
}`;function hE(r,e){let t=xl(e.size),n=bl(e.size);return new ht(r,{vs:uE,fs:fE,bufferLayout:[{name:"aPrev",format:n},{name:"aCur",format:n},{name:"aTo",format:e.getBufferLayout().attributes[0].format}],varyings:["vNext"],modules:[lE],defines:{ATTRIBUTE_TYPE:t},parameters:{depthCompare:"always",blendColorOperation:"max",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaOperation:"max",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"}})}function dE(r){return r.createTexture({data:new Uint8Array(4),format:"rgba8unorm",width:1,height:1})}function pE(r,e){return r.createFramebuffer({id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,colorAttachments:[e]})}var mE={interpolation:mo,spring:go},_o=class{constructor(e,{id:t,timeline:n}){if(!e)throw new Error("AttributeTransitionManager is constructed without device");this.id=t,this.device=e,this.timeline=n,this.transitions={},this.needsRedraw=!1,this.numInstances=1}finalize(){for(let e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:t,numInstances:n}){this.numInstances=n||1;for(let s in e){let i=e[s],o=i.getTransitionSetting(t);o&&this._updateAttribute(s,i,o)}for(let s in this.transitions){let i=e[s];(!i||!i.getTransitionSetting(t))&&this._removeTransition(s)}}hasAttribute(e){let t=this.transitions[e];return t&&t.inProgress}getAttributes(){let e={};for(let t in this.transitions){let n=this.transitions[t];n.inProgress&&(e[t]=n.attributeInTransition)}return e}run(){if(this.numInstances===0)return!1;for(let t in this.transitions)this.transitions[t].update()&&(this.needsRedraw=!0);let e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].delete(),delete this.transitions[e]}_updateAttribute(e,t,n){let s=this.transitions[e],i=!s||s.type!==n.type;if(i){s&&this._removeTransition(e);let o=mE[n.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,device:this.device}):($.error(`unsupported transition type '${n.type}'`)(),i=!1)}(i||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(n,this.numInstances))}};var qx="attributeManager.invalidate",gE="attributeManager.updateStart",_E="attributeManager.updateEnd",yE="attribute.updateStart",xE="attribute.allocate",bE="attribute.updateEnd",Sn=class{constructor(e,{id:t="attribute-manager",stats:n,timeline:s}={}){this.mergeBoundsMemoized=st(J_),this.id=t,this.device=e,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=n,this.attributeTransitionManager=new _o(e,{id:`${t}-transitions`,timeline:s}),Object.seal(this)}finalize(){for(let e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){let t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}setNeedsRedraw(){this.needsRedraw=!0}add(e){this._add(e)}addInstanced(e){this._add(e,{stepMode:"instance"})}remove(e){for(let t of e)this.attributes[t]!==void 0&&(this.attributes[t].delete(),delete this.attributes[t])}invalidate(e,t){let n=this._invalidateTrigger(e,t);he(qx,this,e,n)}invalidateAll(e){for(let t in this.attributes)this.attributes[t].setNeedsUpdate(t,e);he(qx,this,"all")}update({data:e,numInstances:t,startIndices:n=null,transitions:s,props:i={},buffers:o={},context:a={}}){let c=!1;he(gE,this),this.stats&&this.stats.get("Update Attributes").timeStart();for(let l in this.attributes){let u=this.attributes[l],f=u.settings.accessor;u.startIndices=n,u.numInstances=t,i[l]&&$.removed(`props.${l}`,`data.attributes.${l}`)(),u.setExternalBuffer(o[l])||u.setBinaryValue(typeof f=="string"?o[f]:void 0,e.startIndices)||typeof f=="string"&&!o[f]&&u.setConstantValue(a,i[f])||u.needsUpdate()&&(c=!0,this._updateAttribute({attribute:u,numInstances:t,data:e,props:i,context:a})),this.needsRedraw=this.needsRedraw||u.needsRedraw()}c&&he(_E,this,t),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:t,transitions:s})}updateTransition(){let{attributeTransitionManager:e}=this,t=e.run();return this.needsRedraw=this.needsRedraw||t,t}getAttributes(){return{...this.attributes,...this.attributeTransitionManager.getAttributes()}}getBounds(e){let t=e.map(n=>this.attributes[n]?.getBounds());return this.mergeBoundsMemoized(t)}getChangedAttributes(e={clearChangedFlags:!1}){let{attributes:t,attributeTransitionManager:n}=this,s={...n.getAttributes()};for(let i in t){let o=t[i];o.needsRedraw(e)&&!n.hasAttribute(i)&&(s[i]=o)}return s}getBufferLayouts(e){return Object.values(this.getAttributes()).map(t=>t.getBufferLayout(e))}_add(e,t){for(let n in e){let s=e[n],i={...s,id:n,size:s.isIndexed&&1||s.size||1,...t};this.attributes[n]=new fr(this.device,i)}this._mapUpdateTriggersToAttributes()}_mapUpdateTriggersToAttributes(){let e={};for(let t in this.attributes)this.attributes[t].getUpdateTriggers().forEach(s=>{e[s]||(e[s]=[]),e[s].push(t)});this.updateTriggers=e}_invalidateTrigger(e,t){let{attributes:n,updateTriggers:s}=this,i=s[e];return i&&i.forEach(o=>{let a=n[o];a&&a.setNeedsUpdate(a.id,t)}),i}_updateAttribute(e){let{attribute:t,numInstances:n}=e;if(he(yE,t),t.constant){t.setConstantValue(e.context,t.value);return}t.allocate(n)&&he(xE,t,n),t.updateBuffer(e)&&(this.needsRedraw=!0,he(bE,t,n))}};H();fl();var yo=class extends bt{get value(){return this._value}_onUpdate(){let{time:e,settings:{fromValue:t,toValue:n,duration:s,easing:i}}=this,o=i(e/s);this._value=Qt(t,n,o)}};var Kx=1e-5;function Zx(r,e,t,n,s){let i=e-r,a=(t-e)*s,c=-i*n;return a+c+i+e}function TE(r,e,t,n,s){if(Array.isArray(t)){let i=[];for(let o=0;o<t.length;o++)i[o]=Zx(r[o],e[o],t[o],n,s);return i}return Zx(r,e,t,n,s)}function Gx(r,e){if(Array.isArray(r)){let t=0;for(let n=0;n<r.length;n++){let s=r[n]-e[n];t+=s*s}return Math.sqrt(t)}return Math.abs(r-e)}var xo=class extends bt{get value(){return this._currValue}_onUpdate(){let{fromValue:e,toValue:t,damping:n,stiffness:s}=this.settings,{_prevValue:i=e,_currValue:o=e}=this,a=TE(i,o,t,n,s),c=Gx(a,t),l=Gx(a,o);c<Kx&&l<Kx&&(a=t,this.end()),this._prevValue=o,this._currValue=a}};var wE={interpolation:yo,spring:xo},bo=class{constructor(e){this.transitions=new Map,this.timeline=e}get active(){return this.transitions.size>0}add(e,t,n,s){let{transitions:i}=this;if(i.has(e)){let c=i.get(e),{value:l=c.settings.fromValue}=c;t=l,this.remove(e)}if(s=yl(s),!s)return;let o=wE[s.type];if(!o){$.error(`unsupported transition type '${s.type}'`)();return}let a=new o(this.timeline);a.start({...s,fromValue:t,toValue:n}),i.set(e,a)}remove(e){let{transitions:t}=this;t.has(e)&&(t.get(e).cancel(),t.delete(e))}update(){let e={};for(let[t,n]of this.transitions)n.update(),e[t]=n.value,n.inProgress||this.remove(t);return e}clear(){for(let e of this.transitions.keys())this.remove(e)}};function Jx(r){let e=r[at];for(let t in e){let n=e[t],{validate:s}=n;if(s&&!s(r[t],n))throw new Error(`Invalid prop ${t}: ${r[t]}`)}}function eb(r,e){let t=Al({newProps:r,oldProps:e,propTypes:r[at],ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),n=AE(r,e),s=!1;return n||(s=SE(r,e)),{dataChanged:n,propsChanged:t,updateTriggersChanged:s,extensionsChanged:EE(r,e),transitionsChanged:vE(r,e)}}function vE(r,e){if(!r.transitions)return!1;let t={},n=r[at],s=!1;for(let i in r.transitions){let o=n[i],a=o&&o.type;(a==="number"||a==="color"||a==="array")&&Id(r[i],e[i],o)&&(t[i]=!0,s=!0)}return s?t:!1}function Al({newProps:r,oldProps:e,ignoreProps:t={},propTypes:n={},triggerName:s="props"}){if(e===r)return!1;if(typeof r!="object"||r===null)return`${s} changed shallowly`;if(typeof e!="object"||e===null)return`${s} changed shallowly`;for(let i of Object.keys(r))if(!(i in t)){if(!(i in e))return`${s}.${i} added`;let o=Id(r[i],e[i],n[i]);if(o)return`${s}.${i} ${o}`}for(let i of Object.keys(e))if(!(i in t)){if(!(i in r))return`${s}.${i} dropped`;if(!Object.hasOwnProperty.call(r,i)){let o=Id(r[i],e[i],n[i]);if(o)return`${s}.${i} ${o}`}}return!1}function Id(r,e,t){let n=t&&t.equal;return n&&!n(r,e,t)||!n&&(n=r&&e&&r.equals,n&&!n.call(r,e))?"changed deeply":!n&&e!==r?"changed shallowly":null}function AE(r,e){if(e===null)return"oldProps is null, initial diff";let t=!1,{dataComparator:n,_dataDiff:s}=r;return n?n(r.data,e.data)||(t="Data comparator detected a change"):r.data!==e.data&&(t="A new data container was supplied"),t&&s&&(t=s(r.data,e.data)||t),t}function SE(r,e){if(e===null)return{all:!0};if("all"in r.updateTriggers&&Qx(r,e,"all"))return{all:!0};let t={},n=!1;for(let s in r.updateTriggers)s!=="all"&&Qx(r,e,s)&&(t[s]=!0,n=!0);return n?t:!1}function EE(r,e){if(e===null)return!0;let t=e.extensions,{extensions:n}=r;if(n===t)return!1;if(!t||!n||n.length!==t.length)return!0;for(let s=0;s<n.length;s++)if(!n[s].equals(t[s]))return!0;return!1}function Qx(r,e,t){let n=r.updateTriggers[t];n=n??{};let s=e.updateTriggers[t];return s=s??{},Al({oldProps:s,newProps:n,triggerName:t})}var RE="count(): argument not an object",IE="count(): argument not a container";function Sl(r){if(!CE(r))throw new Error(RE);if(typeof r.count=="function")return r.count();if(Number.isFinite(r.size))return r.size;if(Number.isFinite(r.length))return r.length;if(PE(r))return Object.keys(r).length;throw new Error(IE)}function PE(r){return r!==null&&typeof r=="object"&&r.constructor===Object}function CE(r){return r!==null&&typeof r=="object"}function To(r,e){if(!e)return r;let t={...r,...e};if("defines"in e&&(t.defines={...r.defines,...e.defines}),"modules"in e&&(t.modules=(r.modules||[]).concat(e.modules),e.modules.some(n=>n.name==="project64"))){let n=t.modules.findIndex(s=>s.name==="project32");n>=0&&t.modules.splice(n,1)}if("inject"in e)if(!r.inject)t.inject=e.inject;else{let n={...r.inject};for(let s in e.inject)n[s]=(n[s]||"")+e.inject[s];t.inject=n}return t}H();var ME={minFilter:"linear",mipmapFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},Pd={};function tb(r,e,t,n){if(t instanceof K)return t;t.constructor&&t.constructor.name!=="Object"&&(t={data:t});let s=null;t.compressed&&(s={minFilter:"linear",mipmapFilter:t.data.length>1?"nearest":"linear"});let{width:i,height:o}=t.data,a=e.createTexture({...t,sampler:{...ME,...s,...n},mipLevels:e.getMipLevelCount(i,o)});return a.generateMipmapsWebGL(),Pd[a.id]=r,a}function rb(r,e){!e||!(e instanceof K)||Pd[e.id]===r&&(e.delete(),delete Pd[e.id])}var OE={boolean:{validate(r,e){return!0},equal(r,e,t){return Boolean(r)===Boolean(e)}},number:{validate(r,e){return Number.isFinite(r)&&(!("max"in e)||r<=e.max)&&(!("min"in e)||r>=e.min)}},color:{validate(r,e){return e.optional&&!r||Cd(r)&&(r.length===3||r.length===4)},equal(r,e,t){return le(r,e,1)}},accessor:{validate(r,e){let t=El(r);return t==="function"||t===El(e.value)},equal(r,e,t){return typeof e=="function"?!0:le(r,e,1)}},array:{validate(r,e){return e.optional&&!r||Cd(r)},equal(r,e,t){let{compare:n}=t,s=Number.isInteger(n)?n:n?1:0;return n?le(r,e,s):r===e}},object:{equal(r,e,t){if(t.ignore)return!0;let{compare:n}=t,s=Number.isInteger(n)?n:n?1:0;return n?le(r,e,s):r===e}},function:{validate(r,e){return e.optional&&!r||typeof r=="function"},equal(r,e,t){return!t.compare&&t.ignore!==!1||r===e}},data:{transform:(r,e,t)=>{if(!r)return r;let{dataTransform:n}=t.props;return n?n(r):typeof r.shape=="string"&&r.shape.endsWith("-table")&&Array.isArray(r.data)?r.data:r}},image:{transform:(r,e,t)=>{let n=t.context;return!n||!n.device?null:tb(t.id,n.device,r,{...e.parameters,...t.props.textureParameters})},release:(r,e,t)=>{rb(t.id,r)}}};function nb(r){let e={},t={},n={};for(let[s,i]of Object.entries(r)){let o=i?.deprecatedFor;if(o)n[s]=Array.isArray(o)?o:[o];else{let a=kE(s,i);e[s]=a,t[s]=a.value}}return{propTypes:e,defaultProps:t,deprecatedProps:n}}function kE(r,e){switch(El(e)){case"object":return wo(r,e);case"array":return wo(r,{type:"array",value:e,compare:!1});case"boolean":return wo(r,{type:"boolean",value:e});case"number":return wo(r,{type:"number",value:e});case"function":return wo(r,{type:"function",value:e,compare:!0});default:return{name:r,type:"unknown",value:e}}}function wo(r,e){return"type"in e?{name:r,...OE[e.type],...e}:"value"in e?{name:r,type:El(e.value),...e}:{name:r,type:"object",value:e}}function Cd(r){return Array.isArray(r)||ArrayBuffer.isView(r)}function El(r){return Cd(r)?"array":r===null?"null":typeof r}function sb(r,e){let t;for(let i=e.length-1;i>=0;i--){let o=e[i];"extensions"in o&&(t=o.extensions)}let n=Md(r.constructor,t),s=Object.create(n);s[_s]=r,s[Dt]={},s[xt]={};for(let i=0;i<e.length;++i){let o=e[i];for(let a in o)s[a]=o[a]}return Object.freeze(s),s}var NE="_mergedDefaultProps";function Md(r,e){if(!(r instanceof Is.constructor))return{};let t=NE;if(e)for(let s of e){let i=s.constructor;i&&(t+=`:${i.extensionName||i.name}`)}let n=ib(r,t);return n||(r[t]=DE(r,e||[]))}function DE(r,e){if(!r.prototype)return null;let n=Object.getPrototypeOf(r),s=Md(n),i=ib(r,"defaultProps")||{},o=nb(i),a=Object.assign(Object.create(null),s,o.defaultProps),c=Object.assign(Object.create(null),s?.[at],o.propTypes),l=Object.assign(Object.create(null),s?.[Cc],o.deprecatedProps);for(let u of e){let f=Md(u.constructor);f&&(Object.assign(a,f),Object.assign(c,f[at]),Object.assign(l,f[Cc]))}return FE(a,r),LE(a,c),BE(a,l),a[at]=c,a[Cc]=l,e.length===0&&!Od(r,"_propTypes")&&(r._propTypes=c),a}function FE(r,e){let t=VE(e);Object.defineProperties(r,{id:{writable:!0,value:t}})}function BE(r,e){for(let t in e)Object.defineProperty(r,t,{enumerable:!1,set(n){let s=`${this.id}: ${t}`;for(let i of e[t])Od(this,i)||(this[i]=n);$.deprecated(s,e[t].join("/"))()}})}function LE(r,e){let t={},n={};for(let s in e){let i=e[s],{name:o,value:a}=i;i.async&&(t[o]=a,n[o]=UE(o))}r[ir]=t,r[Dt]={},Object.defineProperties(r,n)}function UE(r){return{enumerable:!0,set(e){typeof e=="string"||e instanceof Promise||gl(e)?this[Dt][r]=e:this[xt][r]=e},get(){if(this[xt]){if(r in this[xt])return this[xt][r]||this[ir][r];if(r in this[Dt]){let e=this[_s]&&this[_s].internalState;if(e&&e.hasAsyncProp(r))return e.getAsyncProp(r)||this[ir][r]}}return this[ir][r]}}}function Od(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function ib(r,e){return Od(r,e)&&r[e]}function VE(r){let e=r.componentName;return e||$.warn(`${r.name}.componentName not specified`)(),e||r.name}var zE=0,vo=class{constructor(...e){this.props=sb(this,e),this.id=this.props.id,this.count=zE++}clone(e){let{props:t}=this,n={};for(let s in t[ir])s in t[xt]?n[s]=t[xt][s]:s in t[Dt]&&(n[s]=t[Dt][s]);return new this.constructor({...t,...n,...e})}};vo.componentName="Component";vo.defaultProps={};var Is=vo;var WE=Object.freeze({}),En=class{constructor(e){this.component=e,this.asyncProps={},this.onAsyncPropUpdated=()=>{},this.oldProps=null,this.oldAsyncProps=null}finalize(){for(let e in this.asyncProps){let t=this.asyncProps[e];t&&t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}this.asyncProps={},this.component=null,this.resetOldProps()}getOldProps(){return this.oldAsyncProps||this.oldProps||WE}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component?this.component.props:null}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){let t=this.asyncProps[e];return t&&t.resolvedValue}isAsyncPropLoading(e){if(e){let t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(let t in this.asyncProps)if(this.isAsyncPropLoading(t))return!0;return!1}reloadAsyncProp(e,t){this._watchPromise(e,Promise.resolve(t))}setAsyncProps(e){this.component=e[_s]||this.component;let t=e[xt]||{},n=e[Dt]||e,s=e[ir]||{};for(let i in t){let o=t[i];this._createAsyncPropData(i,s[i]),this._updateAsyncProp(i,o),t[i]=this.getAsyncProp(i)}for(let i in n){let o=n[i];this._createAsyncPropData(i,s[i]),this._updateAsyncProp(i,o)}}_fetch(e,t){return null}_onResolve(e,t){}_onError(e,t){}_updateAsyncProp(e,t){if(this._didAsyncInputValueChange(e,t)){if(typeof t=="string"&&(t=this._fetch(e,t)),t instanceof Promise){this._watchPromise(e,t);return}if(gl(t)){this._resolveAsyncIterable(e,t);return}this._setPropValue(e,t)}}_freezeAsyncOldProps(){if(!this.oldAsyncProps&&this.oldProps){this.oldAsyncProps=Object.create(this.oldProps);for(let e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}_didAsyncInputValueChange(e,t){let n=this.asyncProps[e];return t===n.resolvedValue||t===n.lastValue?!1:(n.lastValue=t,!0)}_setPropValue(e,t){this._freezeAsyncOldProps();let n=this.asyncProps[e];n&&(t=this._postProcessValue(n,t),n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount)}_setAsyncPropValue(e,t,n){let s=this.asyncProps[e];s&&n>=s.resolvedLoadCount&&t!==void 0&&(this._freezeAsyncOldProps(),s.resolvedValue=t,s.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}_watchPromise(e,t){let n=this.asyncProps[e];if(n){n.pendingLoadCount++;let s=n.pendingLoadCount;t.then(i=>{this.component&&(i=this._postProcessValue(n,i),this._setAsyncPropValue(e,i,s),this._onResolve(e,i))}).catch(i=>{this._onError(e,i)})}}async _resolveAsyncIterable(e,t){if(e!=="data"){this._setPropValue(e,t);return}let n=this.asyncProps[e];if(!n)return;n.pendingLoadCount++;let s=n.pendingLoadCount,i=[],o=0;for await(let a of t){if(!this.component)return;let{dataTransform:c}=this.component.props;c?i=c(a,i):i=i.concat(a),Object.defineProperty(i,"__diff",{enumerable:!1,value:[{startRow:o,endRow:i.length}]}),o=i.length,this._setAsyncPropValue(e,i,s)}this._onResolve(e,i)}_postProcessValue(e,t){let n=e.type;return n&&this.component&&(n.release&&n.release(e.resolvedValue,n,this.component),n.transform)?n.transform(t,n,this.component):t}_createAsyncPropData(e,t){if(!this.asyncProps[e]){let s=this.component&&this.component.props[at];this.asyncProps[e]={type:s&&s[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}};var Ao=class extends En{constructor({attributeManager:e,layer:t}){super(t),this.attributeManager=e,this.needsRedraw=!0,this.needsUpdate=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}_fetch(e,t){let n=this.layer,s=n?.props.fetch;return s?s(t,{propName:e,layer:n}):super._fetch(e,t)}_onResolve(e,t){let n=this.layer;if(n){let s=n.props.onDataLoad;e==="data"&&s&&s(t,{propName:e,layer:n})}}_onError(e,t){let n=this.layer;n&&n.raiseError(t,`loading ${e} of ${this.layer}`)}};var $E="layer.changeFlag",jE="layer.initialize",HE="layer.update",XE="layer.finalize",YE="layer.matched",ob=2**24-1,qE=Object.freeze([]),KE=st(({oldViewport:r,viewport:e})=>r.equals(e)),At=new Uint8ClampedArray(0),ZE={data:{type:"data",value:qE,async:!0},dataComparator:{type:"function",value:null,optional:!0},_dataDiff:{type:"function",value:r=>r&&r.__diff,optional:!0},dataTransform:{type:"function",value:null,optional:!0},onDataLoad:{type:"function",value:null,optional:!0},onError:{type:"function",value:null,optional:!0},fetch:{type:"function",value:(r,{propName:e,layer:t,loaders:n,loadOptions:s,signal:i})=>{let{resourceManager:o}=t.context;s=s||t.getLoadOptions(),n=n||t.props.loaders,i&&(s={...s,fetch:{...s?.fetch,signal:i}});let a=o.contains(r);return!a&&!s&&(o.add({resourceId:r,data:Er(r,n),persistent:!1}),a=!0),a?o.subscribe({resourceId:r,onChange:c=>t.internalState?.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):Er(r,n,s)}},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},operation:"draw",onHover:{type:"function",value:null,optional:!0},onClick:{type:"function",value:null,optional:!0},onDragStart:{type:"function",value:null,optional:!0},onDrag:{type:"function",value:null,optional:!0},onDragEnd:{type:"function",value:null,optional:!0},coordinateSystem:Y.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{type:"object",value:{},optional:!0,compare:2},loadOptions:{type:"object",value:null,optional:!0,ignore:!0},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,ignore:!0},getPolygonOffset:{type:"function",value:({layerIndex:r})=>[0,-r*100]},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}},So=class extends Is{constructor(){super(...arguments),this.internalState=null,this.lifecycle=kr.NO_STATE,this.parent=null}static get componentName(){return Object.prototype.hasOwnProperty.call(this,"layerName")?this.layerName:""}get root(){let e=this;for(;e.parent;)e=e.parent;return e}toString(){return`${this.constructor.layerName||this.constructor.name}({id: '${this.props.id}'})`}project(e){ie(this.internalState);let t=this.internalState.viewport||this.context.viewport,n=Gh(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,i,o]=us(n,t.pixelProjectionMatrix);return e.length===2?[s,i]:[s,i,o]}unproject(e){return ie(this.internalState),(this.internalState.viewport||this.context.viewport).unproject(e)}projectPosition(e,t){ie(this.internalState);let n=this.internalState.viewport||this.context.viewport;return Rc(e,{viewport:n,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem,...t})}get isComposite(){return!1}get isDrawable(){return!0}setState(e){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,e),this.setNeedsRedraw()}setNeedsRedraw(){this.internalState&&(this.internalState.needsRedraw=!0)}setNeedsUpdate(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}get isLoaded(){return this.internalState?!this.internalState.isAsyncPropLoading():!1}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){let e=this.state;return e&&(e.models||e.model&&[e.model])||[]}setShaderModuleProps(...e){for(let t of this.getModels())t.shaderInputs.setProps(...e)}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}use64bitPositions(){let{coordinateSystem:e}=this.props;return e===Y.DEFAULT||e===Y.LNGLAT||e===Y.CARTESIAN}onHover(e,t){return this.props.onHover&&this.props.onHover(e,t)||!1}onClick(e,t){return this.props.onClick&&this.props.onClick(e,t)||!1}nullPickingColor(){return[0,0,0]}encodePickingColor(e,t=[]){return t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}decodePickingColor(e){ie(e instanceof Uint8Array);let[t,n,s]=e;return t+n*256+s*65536-1}getNumInstances(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&this.state.numInstances!==void 0?this.state.numInstances:Sl(this.props.data)}getStartIndices(){return this.props.startIndices?this.props.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}getBounds(){return this.getAttributeManager()?.getBounds(["positions","instancePositions"])}getShaders(e){e=To(e,{disableWarnings:!0,modules:this.context.defaultShaderModules});for(let t of this.props.extensions)e=To(e,t.getShaders.call(this,t));return e}shouldUpdateState(e){return e.changeFlags.propsOrDataChanged}updateState(e){let t=this.getAttributeManager(),{dataChanged:n}=e.changeFlags;if(n&&t)if(Array.isArray(n))for(let s of n)t.invalidateAll(s);else t.invalidateAll();if(t){let{props:s}=e,i=this.internalState.hasPickingBuffer,o=Number.isInteger(s.highlightedObjectIndex)||Boolean(s.pickable)||s.extensions.some(a=>a.getNeedsPickingBuffer.call(this,a));if(i!==o){this.internalState.hasPickingBuffer=o;let{pickingColors:a,instancePickingColors:c}=t.attributes,l=a||c;l&&(o&&l.constant&&(l.constant=!1,t.invalidate(l.id)),!l.value&&!o&&(l.constant=!0,l.value=[0,0,0]))}}}finalizeState(e){for(let n of this.getModels())n.destroy();let t=this.getAttributeManager();t&&t.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}draw(e){for(let t of this.getModels())t.draw(e.renderPass)}getPickingInfo({info:e,mode:t,sourceLayer:n}){let{index:s}=e;return s>=0&&Array.isArray(this.props.data)&&(e.object=this.props.data[s]),e}raiseError(e,t){t&&(e=new Error(`${t}: ${e.message}`,{cause:e})),this.props.onError?.(e)||this.context?.onError?.(e,this)}getNeedsRedraw(e={clearRedrawFlags:!1}){return this._getNeedsRedraw(e)}needsUpdate(){return this.internalState?this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()):!1}hasUniformTransition(){return this.internalState?.uniformTransitions.active||!1}activateViewport(e){if(!this.internalState)return;let t=this.internalState.viewport;this.internalState.viewport=e,(!t||!KE({oldViewport:t,viewport:e}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(e="all"){let t=this.getAttributeManager();t&&(e==="all"?t.invalidateAll():t.invalidate(e))}updateAttributes(e){let t=!1;for(let n in e)e[n].layoutChanged()&&(t=!0);for(let n of this.getModels())this._setModelAttributes(n,e,t)}_updateAttributes(){let e=this.getAttributeManager();if(!e)return;let t=this.props,n=this.getNumInstances(),s=this.getStartIndices();e.update({data:t.data,numInstances:n,startIndices:s,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this});let i=e.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(i)}_updateAttributeTransition(){let e=this.getAttributeManager();e&&e.updateTransition()}_updateUniformTransition(){let{uniformTransitions:e}=this.internalState;if(e.active){let t=e.update(),n=Object.create(this.props);for(let s in t)Object.defineProperty(n,s,{value:t[s]});return n}return this.props}calculateInstancePickingColors(e,{numInstances:t}){if(e.constant)return;let n=Math.floor(At.length/4);if(this.internalState.usesPickingColorCache=!0,n<t){t>ob&&$.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),At=yt.allocate(At,t,{size:4,copy:!0,maxCount:Math.max(t,ob)});let s=Math.floor(At.length/4),i=[0,0,0];for(let o=n;o<s;o++)this.encodePickingColor(o,i),At[o*4+0]=i[0],At[o*4+1]=i[1],At[o*4+2]=i[2],At[o*4+3]=0}e.value=At.subarray(0,t*4)}_setModelAttributes(e,t,n=!1){if(!Object.keys(t).length)return;if(n){let a=this.getAttributeManager();e.setBufferLayout(a.getBufferLayouts(e)),t=a.getAttributes()}let s=e.userData?.excludeAttributes||{},i={},o={};for(let a in t){if(s[a])continue;let c=t[a].getValue();for(let l in c){let u=c[l];u instanceof W?t[a].settings.isIndexed?e.setIndexBuffer(u):i[l]=u:u&&(o[l]=u)}}e.setAttributes(i),e.setConstantAttributes(o)}disablePickingIndex(e){let t=this.props.data;if(!("attributes"in t)){this._disablePickingIndex(e);return}let{pickingColors:n,instancePickingColors:s}=this.getAttributeManager().attributes,i=n||s,o=i&&t.attributes&&t.attributes[i.id];if(o&&o.value){let a=o.value,c=this.encodePickingColor(e);for(let l=0;l<t.length;l++){let u=i.getVertexOffset(l);a[u]===c[0]&&a[u+1]===c[1]&&a[u+2]===c[2]&&this._disablePickingIndex(l)}}else this._disablePickingIndex(e)}_disablePickingIndex(e){let{pickingColors:t,instancePickingColors:n}=this.getAttributeManager().attributes,s=t||n;if(!s)return;let i=s.getVertexOffset(e),o=s.getVertexOffset(e+1);s.buffer.write(new Uint8Array(o-i),i)}restorePickingColors(){let{pickingColors:e,instancePickingColors:t}=this.getAttributeManager().attributes,n=e||t;n&&(this.internalState.usesPickingColorCache&&n.value.buffer!==At.buffer&&(n.value=At.subarray(0,n.value.length)),n.updateSubBuffer({startOffset:0}))}_initialize(){ie(!this.internalState),ie(Number.isFinite(this.props.coordinateSystem)),he(jE,this);let e=this._getAttributeManager();e&&e.addInstanced({instancePickingColors:{type:"uint8",size:4,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Ao({attributeManager:e,layer:this}),this._clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>($.deprecated("layer.state.attributeManager","layer.getAttributeManager()")(),e)}),this.internalState.uniformTransitions=new bo(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);for(let t of this.props.extensions)t.initializeState.call(this,this.context,t);this.setChangeFlags({dataChanged:"init",propsChanged:"init",viewportChanged:!0,extensionsChanged:!0}),this._update()}_transferState(e){he(YE,this,this===e);let{state:t,internalState:n}=e;this!==e&&(this.internalState=n,this.state=t,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}_update(){let e=this.needsUpdate();if(he(HE,this,e),!e)return;let t=this.props,n=this.context,s=this.internalState,i=n.viewport,o=this._updateUniformTransition();s.propsInTransition=o,n.viewport=s.viewport||i,this.props=o;try{let a=this._getUpdateParams(),c=this.getModels();if(n.device)this.updateState(a);else try{this.updateState(a)}catch{}for(let u of this.props.extensions)u.updateState.call(this,a,u);this.setNeedsRedraw(),this._updateAttributes();let l=this.getModels()[0]!==c[0];this._postUpdate(a,l)}finally{n.viewport=i,this.props=t,this._clearChangeFlags(),s.needsUpdate=!1,s.resetOldProps()}}_finalize(){he(XE,this),this.finalizeState(this.context);for(let e of this.props.extensions)e.finalizeState.call(this,this.context,e)}_drawLayer({renderPass:e,shaderModuleProps:t=null,uniforms:n={},parameters:s={}}){this._updateAttributeTransition();let i=this.props,o=this.context;this.props=this.internalState.propsInTransition||i;try{t&&this.setShaderModuleProps(t);let{getPolygonOffset:a}=this.props,c=a&&a(n)||[0,0];o.device instanceof An&&o.device.setParametersWebGL({polygonOffset:c});for(let l of this.getModels())l.device.type==="webgpu"?l.setParameters({...l.parameters,...s}):l.setParameters(s);if(o.device instanceof An)o.device.withParametersWebGL(s,()=>{let l={renderPass:e,shaderModuleProps:t,uniforms:n,parameters:s,context:o};for(let u of this.props.extensions)u.draw.call(this,l,u);this.draw(l)});else{let l={renderPass:e,shaderModuleProps:t,uniforms:n,parameters:s,context:o};for(let u of this.props.extensions)u.draw.call(this,l,u);this.draw(l)}}finally{this.props=i}}getChangeFlags(){return this.internalState?.changeFlags}setChangeFlags(e){if(!this.internalState)return;let{changeFlags:t}=this.internalState;for(let s in e)if(e[s]){let i=!1;switch(s){case"dataChanged":let o=e[s],a=t[s];o&&Array.isArray(a)&&(t.dataChanged=Array.isArray(o)?a.concat(o):o,i=!0);default:t[s]||(t[s]=e[s],i=!0)}i&&he($E,this,s,e)}let n=Boolean(t.dataChanged||t.updateTriggersChanged||t.propsChanged||t.extensionsChanged);t.propsOrDataChanged=n,t.somethingChanged=n||t.viewportChanged||t.stateChanged}_clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}_diffProps(e,t){let n=eb(e,t);if(n.updateTriggersChanged)for(let s in n.updateTriggersChanged)n.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(n.transitionsChanged)for(let s in n.transitionsChanged)this.internalState.uniformTransitions.add(s,t[s],e[s],e.transitions?.[s]);return this.setChangeFlags(n)}validateProps(){Jx(this.props)}updateAutoHighlight(e){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(e)}_updateAutoHighlight(e){let t={highlightedObjectColor:e.picked?e.color:null},{highlightColor:n}=this.props;e.picked&&typeof n=="function"&&(t.highlightColor=n(e)),this.setShaderModuleProps({picking:t}),this.setNeedsRedraw()}_getAttributeManager(){let e=this.context;return new Sn(e.device,{id:this.props.id,stats:e.stats,timeline:e.timeline})}_postUpdate(e,t){let{props:n,oldProps:s}=e,i=this.state.model;i?.isInstanced&&i.setInstanceCount(this.getNumInstances());let{autoHighlight:o,highlightedObjectIndex:a,highlightColor:c}=n;if(t||s.autoHighlight!==o||s.highlightedObjectIndex!==a||s.highlightColor!==c){let l={};Array.isArray(c)&&(l.highlightColor=c),(t||s.autoHighlight!==o||a!==s.highlightedObjectIndex)&&(l.highlightedObjectColor=Number.isFinite(a)&&a>=0?this.encodePickingColor(a):null),this.setShaderModuleProps({picking:l})}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(e){if(!this.internalState)return!1;let t=!1;t=t||this.internalState.needsRedraw&&this.id;let n=this.getAttributeManager(),s=n?n.getNeedsRedraw(e):!1;if(t=t||s,t)for(let i of this.props.extensions)i.onNeedsRedraw.call(this,i);return this.internalState.needsRedraw=this.internalState.needsRedraw&&!e.clearRedrawFlags,t}_onAsyncPropUpdated(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}};So.defaultProps=ZE;So.layerName="Layer";var Rl=So;var GE="compositeLayer.renderLayers",Il=class extends Rl{get isComposite(){return!0}get isDrawable(){return!1}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(e=>e.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(e){}setState(e){super.setState(e),this.setNeedsUpdate()}getPickingInfo({info:e}){let{object:t}=e;return t&&t.__source&&t.__source.parent&&t.__source.parent.id===this.id&&(e.object=t.__source.object,e.index=t.__source.index),e}filterSubLayer(e){return!0}shouldRenderSubLayer(e,t){return t&&t.length}getSubLayerClass(e,t){let{_subLayerProps:n}=this.props;return n&&n[e]&&n[e].type||t}getSubLayerRow(e,t,n){return e.__source={parent:this,object:t,index:n},e}getSubLayerAccessor(e){if(typeof e=="function"){let t={index:-1,data:this.props.data,target:[]};return(n,s)=>n&&n.__source?(t.index=n.__source.index,e(n.__source.object,t)):e(n,s)}return e}getSubLayerProps(e={}){let{opacity:t,pickable:n,visible:s,parameters:i,getPolygonOffset:o,highlightedObjectIndex:a,autoHighlight:c,highlightColor:l,coordinateSystem:u,coordinateOrigin:f,wrapLongitude:h,positionFormat:d,modelMatrix:m,extensions:y,fetch:_,operation:x,_subLayerProps:E}=this.props,b={id:"",updateTriggers:{},opacity:t,pickable:n,visible:s,parameters:i,getPolygonOffset:o,highlightedObjectIndex:a,autoHighlight:c,highlightColor:l,coordinateSystem:u,coordinateOrigin:f,wrapLongitude:h,positionFormat:d,modelMatrix:m,extensions:y,fetch:_,operation:x},S=E&&e.id&&E[e.id],C=S&&S.updateTriggers,P=e.id||"sublayer";if(S){let B=this.props[at],N=e.type?e.type._propTypes:{};for(let k in S){let F=N[k]||B[k];F&&F.type==="accessor"&&(S[k]=this.getSubLayerAccessor(S[k]))}}Object.assign(b,e,S),b.id=`${this.props.id}-${P}`,b.updateTriggers={all:this.props.updateTriggers?.all,...e.updateTriggers,...C};for(let B of y){let N=B.getSubLayerProps.call(this,B);N&&Object.assign(b,N,{updateTriggers:Object.assign(b.updateTriggers,N.updateTriggers)})}return b}_updateAutoHighlight(e){for(let t of this.getSubLayers())t.updateAutoHighlight(e)}_getAttributeManager(){return null}_postUpdate(e,t){let n=this.internalState.subLayers,s=!n||this.needsUpdate();if(s){let i=this.renderLayers();n=Nr(i,Boolean),this.internalState.subLayers=n}he(GE,this,s,n);for(let i of n)i.parent=this}};Il.layerName="CompositeLayer";var ab=Il;var kd=Math.PI/180;function QE({height:r,focalDistance:e,orbitAxis:t,rotationX:n,rotationOrbit:s,zoom:i}){let o=t==="Z"?[0,0,1]:[0,1,0],a=t==="Z"?[0,-e,0]:[0,0,e],c=new Q().lookAt({eye:a,up:o});c.rotateX(n*kd),t==="Z"?c.rotateZ(s*kd):c.rotateY(s*kd);let l=Math.pow(2,i)/r;return c.scale(l),c}var Pl=class extends $e{constructor(e){let{height:t,projectionMatrix:n,fovy:s=50,orbitAxis:i="Z",target:o=[0,0,0],rotationX:a=0,rotationOrbit:c=0,zoom:l=0}=e,u=n?n[5]/2:rr(s);super({...e,longitude:void 0,viewMatrix:QE({height:t||1,focalDistance:u,orbitAxis:i,rotationX:a,rotationOrbit:c,zoom:l}),fovy:s,focalDistance:u,position:o,zoom:l}),this.target=o,this.orbitAxis=i,this.rotationX=a,this.rotationOrbit=c,this.fovy=s,this.projectedCenter=this.project(this.center)}unproject(e,{topLeft:t=!0}={}){let[n,s,i=this.projectedCenter[2]]=e,o=t?s:this.height-s,[a,c,l]=ot([n,o,i],this.pixelUnprojectionMatrix);return[a,c,l]}panByPosition(e,t,n){let s=this.project(e),i=[this.width/2+s[0]-t[0],this.height/2+s[1]-t[1],this.projectedCenter[2]];return{target:this.unproject(i)}}};Pl.displayName="OrbitViewport";var Cl=Pl;var JE=new Q().lookAt({eye:[0,0,1]});function eR({width:r,height:e,near:t,far:n,padding:s}){let i=-r/2,o=r/2,a=-e/2,c=e/2;if(s){let{left:l=0,right:u=0,top:f=0,bottom:h=0}=s,d=ee((l+r-u)/2,0,r)-r/2,m=ee((f+e-h)/2,0,e)-e/2;i-=d,o-=d,a+=m,c+=m}return new Q().ortho({left:i,right:o,bottom:a,top:c,near:t,far:n})}var Ml=class extends $e{constructor(e){let{width:t,height:n,near:s=.1,far:i=1e3,zoom:o=0,target:a=[0,0,0],padding:c=null,flipY:l=!0}=e,u=e.zoomX??(Array.isArray(o)?o[0]:o),f=e.zoomY??(Array.isArray(o)?o[1]:o),h=Math.min(u,f),d=Math.pow(2,h),m;if(u!==f){let y=Math.pow(2,u),_=Math.pow(2,f);m={unitsPerMeter:[y/d,_/d,1],metersPerUnit:[d/y,d/_,1]}}super({...e,longitude:void 0,position:a,viewMatrix:JE.clone().scale([d,d*(l?-1:1),d]),projectionMatrix:eR({width:t||1,height:n||1,padding:c,near:s,far:i}),zoom:h,distanceScales:m}),this.target=a,this.zoomX=u,this.zoomY=f,this.flipY=l}projectFlat([e,t]){let{unitsPerMeter:n}=this.distanceScales;return[e*n[0],t*n[1]]}unprojectFlat([e,t]){let{metersPerUnit:n}=this.distanceScales;return[e*n[0],t*n[1]]}panByPosition(e,t,n){let s=ot(t,this.pixelUnprojectionMatrix),i=this.projectFlat(e),o=_e.add([],i,_e.negate([],s)),a=_e.add([],this.center,o);return{target:this.unprojectFlat(a)}}};Ml.displayName="OrthographicViewport";var Ol=Ml;var kl=class extends $e{constructor(e){let{longitude:t,latitude:n,modelMatrix:s,bearing:i=0,pitch:o=0,up:a=[0,0,1]}=e,l=new ft({bearing:i,pitch:o===-90?1e-4:90+o}).toVector3().normalize(),u=s?new Q(s).transformAsVector(l):l,f=Number.isFinite(n)?Fi({latitude:n}):0,h=Math.pow(2,f),d=new Q().lookAt({eye:[0,0,0],center:u,up:a}).scale(h);super({...e,zoom:f,viewMatrix:d}),this.latitude=n,this.longitude=t,this.pitch=o,this.bearing=i,this.up=a}};kl.displayName="FirstPersonViewport";var Nl=kl;var Rn=20,cb=500,Eo=class extends ur{constructor(e){let{width:t,height:n,position:s=[0,0,0],bearing:i=0,pitch:o=0,longitude:a=null,latitude:c=null,maxPitch:l=90,minPitch:u=-90,startRotatePos:f,startBearing:h,startPitch:d,startZoomPosition:m,startPanPos:y,startPanPosition:_}=e;super({width:t,height:n,position:s,bearing:i,pitch:o,longitude:a,latitude:c,maxPitch:l,minPitch:u},{startRotatePos:f,startBearing:h,startPitch:d,startZoomPosition:m,startPanPos:y,startPanPosition:_}),this.makeViewport=e.makeViewport}panStart({pos:e}){let{position:t}=this.getViewportProps();return this._getUpdatedState({startPanPos:e,startPanPosition:t})}pan({pos:e}){if(!e)return this;let{startPanPos:t=[0,0],startPanPosition:n=[0,0]}=this.getState(),{width:s,height:i,bearing:o,pitch:a}=this.getViewportProps(),c=cb*(e[0]-t[0])/s,l=cb*(e[1]-t[1])/i,u=new ft({bearing:o,pitch:a}),f=new ft({bearing:o,pitch:-90}),h=u.toVector3().normalize(),d=f.toVector3().cross(h).normalize();return this._getUpdatedState({position:new G(n).add(d.scale(c)).add(h.scale(l))})}panEnd(){return this._getUpdatedState({startPanPos:null,startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:n=0}){let{startRotatePos:s,startBearing:i,startPitch:o}=this.getState(),{width:a,height:c}=this.getViewportProps();if(!s||i===void 0||o===void 0)return this;let l;if(e){let u=(e[0]-s[0])/a,f=(e[1]-s[1])/c;l={bearing:i-u*180,pitch:o-f*90}}else l={bearing:i-t,pitch:o-n};return this._getUpdatedState(l)}rotateEnd(){return this._getUpdatedState({startRotatePos:null,startBearing:null,startPitch:null})}zoomStart(){return this._getUpdatedState({startZoomPosition:this.getViewportProps().position})}zoom({pos:e,scale:t}){let n=this.getViewportProps(),s=this.getState().startZoomPosition||n.position,i=this.makeViewport(n),{projectionMatrix:o,width:a}=i,l=2*Math.atan(1/o[0])*(e[0]/a-.5),u=this.getDirection(!0);return this._move(u.rotateZ({radians:-l}),Math.log2(t)*Rn,s)}zoomEnd(){return this._getUpdatedState({startZoomPosition:null})}moveLeft(e=Rn){let t=this.getDirection(!0);return this._move(t.rotateZ({radians:Math.PI/2}),e)}moveRight(e=Rn){let t=this.getDirection(!0);return this._move(t.rotateZ({radians:-Math.PI/2}),e)}moveUp(e=Rn){let t=this.getDirection(!0);return this._move(t,e)}moveDown(e=Rn){let t=this.getDirection(!0);return this._move(t.negate(),e)}rotateLeft(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch-e})}zoomIn(e=Rn){return this._move(new G(0,0,1),e)}zoomOut(e=Rn){return this._move(new G(0,0,-1),e)}shortestPathFrom(e){let t=e.getViewportProps(),n={...this.getViewportProps()},{bearing:s,longitude:i}=n;return Math.abs(s-t.bearing)>180&&(n.bearing=s<0?s+360:s-360),i!==null&&t.longitude!==null&&Math.abs(i-t.longitude)>180&&(n.longitude=i<0?i+360:i-360),n}_move(e,t,n=this.getViewportProps().position){let s=e.scale(t);return this._getUpdatedState({position:new G(n).add(s)})}getDirection(e=!1){return new ft({bearing:this.getViewportProps().bearing,pitch:e?90:90+this.getViewportProps().pitch}).toVector3().normalize()}_getUpdatedState(e){return new Eo({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...e})}applyConstraints(e){let{pitch:t,maxPitch:n,minPitch:s,longitude:i,bearing:o}=e;return e.pitch=ee(t,s,n),i!==null&&(i<-180||i>180)&&(e.longitude=pn(i+180,360)-180),(o<-180||o>180)&&(e.bearing=pn(o+180,360)-180),e}},In=class extends De{constructor(){super(...arguments),this.ControllerState=Eo,this.transition={transitionDuration:300,transitionInterpolator:new Ae(["position","pitch","bearing"])}}};var Dl=class extends Ne{constructor(e={}){super(e)}getViewportType(){return Nl}get ControllerType(){return In}};Dl.displayName="FirstPersonView";var lb=Dl;var Ro=class extends ur{constructor(e){let{width:t,height:n,rotationX:s=0,rotationOrbit:i=0,target:o=[0,0,0],zoom:a=0,minRotationX:c=-90,maxRotationX:l=90,minZoom:u=-1/0,maxZoom:f=1/0,startPanPosition:h,startRotatePos:d,startRotationX:m,startRotationOrbit:y,startZoomPosition:_,startZoom:x}=e;super({width:t,height:n,rotationX:s,rotationOrbit:i,target:o,zoom:a,minRotationX:c,maxRotationX:l,minZoom:u,maxZoom:f},{startPanPosition:h,startRotatePos:d,startRotationX:m,startRotationOrbit:y,startZoomPosition:_,startZoom:x}),this.makeViewport=e.makeViewport}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){let n=this.getState().startPanPosition||t;if(!n)return this;let i=this.makeViewport(this.getViewportProps()).panByPosition(n,e);return this._getUpdatedState(i)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this.getViewportProps().rotationX,startRotationOrbit:this.getViewportProps().rotationOrbit})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:n=0}){let{startRotatePos:s,startRotationX:i,startRotationOrbit:o}=this.getState(),{width:a,height:c}=this.getViewportProps();if(!s||i===void 0||o===void 0)return this;let l;if(e){let u=(e[0]-s[0])/a,f=(e[1]-s[1])/c;(i<-90||i>90)&&(u*=-1),l={rotationX:i+f*180,rotationOrbit:o+u*180}}else l={rotationX:i+n,rotationOrbit:o+t};return this._getUpdatedState(l)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(e){let t=e.getViewportProps(),n={...this.getViewportProps()},{rotationOrbit:s}=n;return Math.abs(s-t.rotationOrbit)>180&&(n.rotationOrbit=s<0?s+360:s-360),n}zoomStart({pos:e}){return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this.getViewportProps().zoom})}zoom({pos:e,startPos:t,scale:n}){let{startZoom:s,startZoomPosition:i}=this.getState();if(i||(s=this.getViewportProps().zoom,i=this._unproject(t)||this._unproject(e)),!i)return this;let o=this._calculateNewZoom({scale:n,startZoom:s}),a=this.makeViewport({...this.getViewportProps(),zoom:o});return this._getUpdatedState({zoom:o,...a.panByPosition(i,e)})}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}zoomOut(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}moveLeft(e=50){return this._panFromCenter([-e,0])}moveRight(e=50){return this._panFromCenter([e,0])}moveUp(e=50){return this._panFromCenter([0,-e])}moveDown(e=50){return this._panFromCenter([0,e])}rotateLeft(e=15){return this._getUpdatedState({rotationOrbit:this.getViewportProps().rotationOrbit-e})}rotateRight(e=15){return this._getUpdatedState({rotationOrbit:this.getViewportProps().rotationOrbit+e})}rotateUp(e=10){return this._getUpdatedState({rotationX:this.getViewportProps().rotationX-e})}rotateDown(e=10){return this._getUpdatedState({rotationX:this.getViewportProps().rotationX+e})}_unproject(e){let t=this.makeViewport(this.getViewportProps());return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){let{maxZoom:n,minZoom:s}=this.getViewportProps();t===void 0&&(t=this.getViewportProps().zoom);let i=t+Math.log2(e);return ee(i,s,n)}_panFromCenter(e){let{width:t,height:n,target:s}=this.getViewportProps();return this.pan({startPosition:s,pos:[t/2+e[0],n/2+e[1]]})}_getUpdatedState(e){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...e})}applyConstraints(e){let{maxZoom:t,minZoom:n,zoom:s,maxRotationX:i,minRotationX:o,rotationOrbit:a}=e;return e.zoom=Array.isArray(s)?[ee(s[0],n,t),ee(s[1],n,t)]:ee(s,n,t),e.rotationX=ee(e.rotationX,o,i),(a<-180||a>180)&&(e.rotationOrbit=pn(a+180,360)-180),e}},Pn=class extends De{constructor(){super(...arguments),this.ControllerState=Ro,this.transition={transitionDuration:300,transitionInterpolator:new Ae({transitionProps:{compare:["target","zoom","rotationX","rotationOrbit"],required:["target","zoom"]}})}}};var Fl=class extends Ne{constructor(e={}){super(e),this.props.orbitAxis=e.orbitAxis||"Z"}getViewportType(){return Cl}get ControllerType(){return Pn}};Fl.displayName="OrbitView";var ub=Fl;var Nd=class extends Ro{constructor(e){super(e),this.zoomAxis=e.zoomAxis||"all"}_calculateNewZoom({scale:e,startZoom:t}){let{maxZoom:n,minZoom:s}=this.getViewportProps();t===void 0&&(t=this.getViewportProps().zoom);let i=Math.log2(e);if(Array.isArray(t)){let[o,a]=t;switch(this.zoomAxis){case"X":o=ee(o+i,s,n);break;case"Y":a=ee(a+i,s,n);break;default:let c=Math.min(o+i,a+i);c<s&&(i+=s-c),c=Math.max(o+i,a+i),c>n&&(i+=n-c),o+=i,a+=i}return[o,a]}return ee(t+i,s,n)}},Cn=class extends De{constructor(){super(...arguments),this.ControllerState=Nd,this.transition={transitionDuration:300,transitionInterpolator:new Ae(["target","zoom"])},this.dragMode="pan"}_onPanRotate(){return!1}};var Bl=class extends Ne{constructor(e={}){super(e)}getViewportType(){return Ol}get ControllerType(){return Cn}};Bl.displayName="OrthographicView";var fb=Bl;var Dd=class extends Gi{constructor(e){let{startPanPos:t,...n}=e;super(n),t!==void 0&&(this._state.startPanPos=t)}panStart({pos:e}){let{latitude:t,longitude:n,zoom:s}=this.getViewportProps();return this._getUpdatedState({startPanLngLat:[n,t],startPanPos:e,startZoom:s})}pan({pos:e,startPos:t}){let n=this.getState(),s=n.startPanLngLat||this._unproject(t);if(!s)return this;let i=n.startZoom??this.getViewportProps().zoom,o=n.startPanPos||t,a=[s[0],s[1],i],l=this.makeViewport(this.getViewportProps()).panByPosition(a,e,o);return this._getUpdatedState(l)}panEnd(){return this._getUpdatedState({startPanLngLat:null,startPanPos:null,startZoom:null})}zoom({scale:e}){let n=(this.getState().startZoom||this.getViewportProps().zoom)+Math.log2(e);return this._getUpdatedState({zoom:n})}applyConstraints(e){let{longitude:t,latitude:n,maxZoom:s,minZoom:i,zoom:o}=e,a=xn(0),c=xn(n)-a;return e.zoom=ee(o,i+c,s+c),(t<-180||t>180)&&(e.longitude=pn(t+180,360)-180),e.latitude=ee(n,-ze,ze),e}},Mn=class extends De{constructor(){super(...arguments),this.ControllerState=Dd,this.transition={transitionDuration:300,transitionInterpolator:new Ae(["longitude","latitude","zoom"])},this.dragMode="pan"}setProps(e){super.setProps(e),this.dragRotate=!1,this.touchRotate=!1}};var Ll=class extends Ne{constructor(e={}){super(e)}getViewportType(e){return e.zoom>12?Or:xs}get ControllerType(){return Mn}};Ll.displayName="GlobeView";var hb=Ll;var Io=class{static get componentName(){return Object.prototype.hasOwnProperty.call(this,"extensionName")?this.extensionName:""}constructor(e){e&&(this.opts=e)}equals(e){return this===e?!0:this.constructor===e.constructor&&le(this.opts,e.opts,1)}getShaders(e){return null}getSubLayerProps(e){let{defaultProps:t}=e.constructor,n={updateTriggers:{}};for(let s in t)if(s in this.props){let i=t[s],o=this.props[s];n[s]=o,i&&i.type==="accessor"&&(n.updateTriggers[s]=this.props.updateTriggers[s],typeof o=="function"&&(n[s]=this.getSubLayerAccessor(o)))}return n}initializeState(e,t){}updateState(e,t){}onNeedsRedraw(e){}getNeedsPickingBuffer(e){return!1}draw(e,t){}finalizeState(e,t){}};Io.defaultProps={};Io.extensionName="LayerExtension";var db=Io;var Fd={bearing:0,pitch:0,position:[0,0,0]},tR={speed:1.2,curve:1.414},Po=class extends cr{constructor(e={}){super({compare:["longitude","latitude","zoom","bearing","pitch","position"],extract:["width","height","longitude","latitude","zoom","bearing","pitch","position"],required:["width","height","latitude","longitude","zoom"]}),this.opts={...tR,...e}}interpolateProps(e,t,n){let s=Hh(e,t,n,this.opts);for(let i in Fd)s[i]=Qt(e[i]||Fd[i],t[i]||Fd[i],n);return s}getDuration(e,t){let{transitionDuration:n}=t;return n==="auto"&&(n=Xh(e,t,this.opts)),n}};H();var Co=class{constructor(e){this.indexStarts=[0],this.vertexStarts=[0],this.vertexCount=0,this.instanceCount=0;let{attributes:t={}}=e;this.typedArrayManager=yt,this.attributes={},this._attributeDefs=t,this.opts=e,this.updateGeometry(e)}updateGeometry(e){Object.assign(this.opts,e);let{data:t,buffers:n={},getGeometry:s,geometryBuffer:i,positionFormat:o,dataChanged:a,normalize:c=!0}=this.opts;if(this.data=t,this.getGeometry=s,this.positionSize=i&&i.size||(o==="XY"?2:3),this.buffers=n,this.normalize=c,i&&(ie(t.startIndices),this.getGeometry=this.getGeometryFromBuffer(i),c||(n.vertexPositions=i)),this.geometryBuffer=n.vertexPositions,Array.isArray(a))for(let l of a)this._rebuildGeometry(l);else this._rebuildGeometry()}updatePartialGeometry({startRow:e,endRow:t}){this._rebuildGeometry({startRow:e,endRow:t})}getGeometryFromBuffer(e){let t=e.value||e;return ArrayBuffer.isView(t)?_l(t,{size:this.positionSize,offset:e.offset,stride:e.stride,startIndices:this.data.startIndices}):null}_allocate(e,t){let{attributes:n,buffers:s,_attributeDefs:i,typedArrayManager:o}=this;for(let a in i)if(a in s)o.release(n[a]),n[a]=null;else{let c=i[a];c.copy=t,n[a]=o.allocate(n[a],e,c)}}_forEachGeometry(e,t,n){let{data:s,getGeometry:i}=this,{iterable:o,objectInfo:a}=Es(s,t,n);for(let c of o){a.index++;let l=i?i(c,a):null;e(l,a.index)}}_rebuildGeometry(e){if(!this.data)return;let{indexStarts:t,vertexStarts:n,instanceCount:s}=this,{data:i,geometryBuffer:o}=this,{startRow:a=0,endRow:c=1/0}=e||{},l={};if(e||(t=[0],n=[0]),this.normalize||!o)this._forEachGeometry((f,h)=>{let d=f&&this.normalizeGeometry(f);l[h]=d,n[h+1]=n[h]+(d?this.getGeometrySize(d):0)},a,c),s=n[n.length-1];else if(n=i.startIndices,s=n[i.length]||0,ArrayBuffer.isView(o))s=s||o.length/this.positionSize;else if(o instanceof W){let f=this.positionSize*4;s=s||o.byteLength/f}else if(o.buffer){let f=o.stride||this.positionSize*4;s=s||o.buffer.byteLength/f}else if(o.value){let f=o.value,h=o.stride/f.BYTES_PER_ELEMENT||this.positionSize;s=s||f.length/h}this._allocate(s,Boolean(e)),this.indexStarts=t,this.vertexStarts=n,this.instanceCount=s;let u={};this._forEachGeometry((f,h)=>{let d=l[h]||f;u.vertexStart=n[h],u.indexStart=t[h];let m=h<n.length-1?n[h+1]:s;u.geometrySize=m-n[h],u.geometryIndex=h,this.updateGeometryAttributes(d,u)},a,c),this.vertexCount=t[t.length-1]}};var Ul=class{constructor(e){this.map=null,this.width=0,this.height=0,this.props={...e},this._initialize(this.props)}finalize(){this.map?.remove(),this.map=null}setProps(e){let t=this.props,n={...this.props,...e};if(this.props=n,!this.map)return;this._update(t,n)&&this.redraw()}redraw(){let e=this.map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this.map}_initialize(e){let{mapLib:t,container:n}=e;t.accessToken=e.mapboxApiAccessToken||"",this.map=new e.mapLib.Map({container:n,maxZoom:24,...e.mapOptions,...pb(e.viewState),style:e.mapStyle,interactive:!1,trackResize:!1}),Object.defineProperty(n,"offsetWidth",{get:()=>this.width}),Object.defineProperty(n,"clientWidth",{get:()=>this.width}),Object.defineProperty(n,"offsetHeight",{get:()=>this.height}),Object.defineProperty(n,"clientHeight",{get:()=>this.height}),this.map.resize()}_update(e,t){e.mapStyle!==t.mapStyle&&this.map.setStyle(t.mapStyle);let s=e.width!==t.width||e.height!==t.height;s&&(this.width=t.width,this.height=t.height,this.map.resize());let i=e.viewState,o=t.viewState,a=o.latitude!==i.latitude||o.longitude!==i.longitude||o.zoom!==i.zoom||o.pitch!==i.pitch||o.bearing!==i.bearing;return a&&this.map.jumpTo(pb(o)),s||a}};function pb(r){return{center:[r.longitude,r.latitude],zoom:r.zoom,bearing:r.bearing??0,pitch:r.pitch??0}}var mb={position:"absolute",left:0,top:0,width:"100%",height:"100%"};function rR(r){let{container:e=document.body}=r;if(typeof e=="string"&&(e=document.getElementById(e)),!e)throw Error("Deck: container not found");window.getComputedStyle(e).position==="static"&&(e.style.position="relative");let n=document.createElement("div");e.appendChild(n),Object.assign(n.style,mb);let s=document.createElement("canvas");return e.appendChild(s),Object.assign(s.style,mb),{container:e,mapCanvas:n,deckCanvas:s}}var Mo=class extends ml{constructor(e){if(typeof document>"u")throw Error("Deck can only be used in the browser");let{mapCanvas:t,deckCanvas:n}=rR(e),s=e.viewState||e.initialViewState,i=Number.isFinite(s&&s.latitude),{map:o=globalThis.mapboxgl||globalThis.maplibregl}=e;super({canvas:n,...e}),o&&o.Map?this._map=i&&new Ul({...e,width:0,height:0,viewState:s,container:t,mapLib:o}):this._map=o}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"mapStyle"in e&&this._map&&this._map.setProps({mapStyle:e.mapStyle}),super.setProps(e)}_drawLayers(e,t){if(this._map){let n=this.getViewports()[0];n&&this._map.setProps({width:n.width,height:n.height,viewState:n})}super._drawLayers(e,t)}};globalThis.luma=globalThis.luma||{};globalThis.loaders=globalThis.loaders||{};Object.assign(globalThis.luma,Yf);Object.assign(globalThis.loaders,bh);return Tb(nR);})();
|
|
1670
|
+
}`;function hE(r,e){let t=xl(e.size),n=bl(e.size);return new ht(r,{vs:uE,fs:fE,bufferLayout:[{name:"aPrev",format:n},{name:"aCur",format:n},{name:"aTo",format:e.getBufferLayout().attributes[0].format}],varyings:["vNext"],modules:[lE],defines:{ATTRIBUTE_TYPE:t},parameters:{depthCompare:"always",blendColorOperation:"max",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaOperation:"max",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"}})}function dE(r){return r.createTexture({data:new Uint8Array(4),format:"rgba8unorm",width:1,height:1})}function pE(r,e){return r.createFramebuffer({id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,colorAttachments:[e]})}var mE={interpolation:mo,spring:go},_o=class{constructor(e,{id:t,timeline:n}){if(!e)throw new Error("AttributeTransitionManager is constructed without device");this.id=t,this.device=e,this.timeline=n,this.transitions={},this.needsRedraw=!1,this.numInstances=1}finalize(){for(let e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:t,numInstances:n}){this.numInstances=n||1;for(let s in e){let i=e[s],o=i.getTransitionSetting(t);o&&this._updateAttribute(s,i,o)}for(let s in this.transitions){let i=e[s];(!i||!i.getTransitionSetting(t))&&this._removeTransition(s)}}hasAttribute(e){let t=this.transitions[e];return t&&t.inProgress}getAttributes(){let e={};for(let t in this.transitions){let n=this.transitions[t];n.inProgress&&(e[t]=n.attributeInTransition)}return e}run(){if(this.numInstances===0)return!1;for(let t in this.transitions)this.transitions[t].update()&&(this.needsRedraw=!0);let e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].delete(),delete this.transitions[e]}_updateAttribute(e,t,n){let s=this.transitions[e],i=!s||s.type!==n.type;if(i){s&&this._removeTransition(e);let o=mE[n.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,device:this.device}):($.error(`unsupported transition type '${n.type}'`)(),i=!1)}(i||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(n,this.numInstances))}};var qx="attributeManager.invalidate",gE="attributeManager.updateStart",_E="attributeManager.updateEnd",yE="attribute.updateStart",xE="attribute.allocate",bE="attribute.updateEnd",Sn=class{constructor(e,{id:t="attribute-manager",stats:n,timeline:s}={}){this.mergeBoundsMemoized=st(J_),this.id=t,this.device=e,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=n,this.attributeTransitionManager=new _o(e,{id:`${t}-transitions`,timeline:s}),Object.seal(this)}finalize(){for(let e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){let t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}setNeedsRedraw(){this.needsRedraw=!0}add(e){this._add(e)}addInstanced(e){this._add(e,{stepMode:"instance"})}remove(e){for(let t of e)this.attributes[t]!==void 0&&(this.attributes[t].delete(),delete this.attributes[t])}invalidate(e,t){let n=this._invalidateTrigger(e,t);he(qx,this,e,n)}invalidateAll(e){for(let t in this.attributes)this.attributes[t].setNeedsUpdate(t,e);he(qx,this,"all")}update({data:e,numInstances:t,startIndices:n=null,transitions:s,props:i={},buffers:o={},context:a={}}){let c=!1;he(gE,this),this.stats&&this.stats.get("Update Attributes").timeStart();for(let l in this.attributes){let u=this.attributes[l],f=u.settings.accessor;u.startIndices=n,u.numInstances=t,i[l]&&$.removed(`props.${l}`,`data.attributes.${l}`)(),u.setExternalBuffer(o[l])||u.setBinaryValue(typeof f=="string"?o[f]:void 0,e.startIndices)||typeof f=="string"&&!o[f]&&u.setConstantValue(a,i[f])||u.needsUpdate()&&(c=!0,this._updateAttribute({attribute:u,numInstances:t,data:e,props:i,context:a})),this.needsRedraw=this.needsRedraw||u.needsRedraw()}c&&he(_E,this,t),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:t,transitions:s})}updateTransition(){let{attributeTransitionManager:e}=this,t=e.run();return this.needsRedraw=this.needsRedraw||t,t}getAttributes(){return{...this.attributes,...this.attributeTransitionManager.getAttributes()}}getBounds(e){let t=e.map(n=>this.attributes[n]?.getBounds());return this.mergeBoundsMemoized(t)}getChangedAttributes(e={clearChangedFlags:!1}){let{attributes:t,attributeTransitionManager:n}=this,s={...n.getAttributes()};for(let i in t){let o=t[i];o.needsRedraw(e)&&!n.hasAttribute(i)&&(s[i]=o)}return s}getBufferLayouts(e){return Object.values(this.getAttributes()).map(t=>t.getBufferLayout(e))}_add(e,t){for(let n in e){let s=e[n],i={...s,id:n,size:s.isIndexed&&1||s.size||1,...t};this.attributes[n]=new fr(this.device,i)}this._mapUpdateTriggersToAttributes()}_mapUpdateTriggersToAttributes(){let e={};for(let t in this.attributes)this.attributes[t].getUpdateTriggers().forEach(s=>{e[s]||(e[s]=[]),e[s].push(t)});this.updateTriggers=e}_invalidateTrigger(e,t){let{attributes:n,updateTriggers:s}=this,i=s[e];return i&&i.forEach(o=>{let a=n[o];a&&a.setNeedsUpdate(a.id,t)}),i}_updateAttribute(e){let{attribute:t,numInstances:n}=e;if(he(yE,t),t.constant){t.setConstantValue(e.context,t.value);return}t.allocate(n)&&he(xE,t,n),t.updateBuffer(e)&&(this.needsRedraw=!0,he(bE,t,n))}};H();fl();var yo=class extends bt{get value(){return this._value}_onUpdate(){let{time:e,settings:{fromValue:t,toValue:n,duration:s,easing:i}}=this,o=i(e/s);this._value=Qt(t,n,o)}};var Kx=1e-5;function Zx(r,e,t,n,s){let i=e-r,a=(t-e)*s,c=-i*n;return a+c+i+e}function TE(r,e,t,n,s){if(Array.isArray(t)){let i=[];for(let o=0;o<t.length;o++)i[o]=Zx(r[o],e[o],t[o],n,s);return i}return Zx(r,e,t,n,s)}function Gx(r,e){if(Array.isArray(r)){let t=0;for(let n=0;n<r.length;n++){let s=r[n]-e[n];t+=s*s}return Math.sqrt(t)}return Math.abs(r-e)}var xo=class extends bt{get value(){return this._currValue}_onUpdate(){let{fromValue:e,toValue:t,damping:n,stiffness:s}=this.settings,{_prevValue:i=e,_currValue:o=e}=this,a=TE(i,o,t,n,s),c=Gx(a,t),l=Gx(a,o);c<Kx&&l<Kx&&(a=t,this.end()),this._prevValue=o,this._currValue=a}};var wE={interpolation:yo,spring:xo},bo=class{constructor(e){this.transitions=new Map,this.timeline=e}get active(){return this.transitions.size>0}add(e,t,n,s){let{transitions:i}=this;if(i.has(e)){let c=i.get(e),{value:l=c.settings.fromValue}=c;t=l,this.remove(e)}if(s=yl(s),!s)return;let o=wE[s.type];if(!o){$.error(`unsupported transition type '${s.type}'`)();return}let a=new o(this.timeline);a.start({...s,fromValue:t,toValue:n}),i.set(e,a)}remove(e){let{transitions:t}=this;t.has(e)&&(t.get(e).cancel(),t.delete(e))}update(){let e={};for(let[t,n]of this.transitions)n.update(),e[t]=n.value,n.inProgress||this.remove(t);return e}clear(){for(let e of this.transitions.keys())this.remove(e)}};function Jx(r){let e=r[at];for(let t in e){let n=e[t],{validate:s}=n;if(s&&!s(r[t],n))throw new Error(`Invalid prop ${t}: ${r[t]}`)}}function eb(r,e){let t=Al({newProps:r,oldProps:e,propTypes:r[at],ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),n=AE(r,e),s=!1;return n||(s=SE(r,e)),{dataChanged:n,propsChanged:t,updateTriggersChanged:s,extensionsChanged:EE(r,e),transitionsChanged:vE(r,e)}}function vE(r,e){if(!r.transitions)return!1;let t={},n=r[at],s=!1;for(let i in r.transitions){let o=n[i],a=o&&o.type;(a==="number"||a==="color"||a==="array")&&Id(r[i],e[i],o)&&(t[i]=!0,s=!0)}return s?t:!1}function Al({newProps:r,oldProps:e,ignoreProps:t={},propTypes:n={},triggerName:s="props"}){if(e===r)return!1;if(typeof r!="object"||r===null)return`${s} changed shallowly`;if(typeof e!="object"||e===null)return`${s} changed shallowly`;for(let i of Object.keys(r))if(!(i in t)){if(!(i in e))return`${s}.${i} added`;let o=Id(r[i],e[i],n[i]);if(o)return`${s}.${i} ${o}`}for(let i of Object.keys(e))if(!(i in t)){if(!(i in r))return`${s}.${i} dropped`;if(!Object.hasOwnProperty.call(r,i)){let o=Id(r[i],e[i],n[i]);if(o)return`${s}.${i} ${o}`}}return!1}function Id(r,e,t){let n=t&&t.equal;return n&&!n(r,e,t)||!n&&(n=r&&e&&r.equals,n&&!n.call(r,e))?"changed deeply":!n&&e!==r?"changed shallowly":null}function AE(r,e){if(e===null)return"oldProps is null, initial diff";let t=!1,{dataComparator:n,_dataDiff:s}=r;return n?n(r.data,e.data)||(t="Data comparator detected a change"):r.data!==e.data&&(t="A new data container was supplied"),t&&s&&(t=s(r.data,e.data)||t),t}function SE(r,e){if(e===null)return{all:!0};if("all"in r.updateTriggers&&Qx(r,e,"all"))return{all:!0};let t={},n=!1;for(let s in r.updateTriggers)s!=="all"&&Qx(r,e,s)&&(t[s]=!0,n=!0);return n?t:!1}function EE(r,e){if(e===null)return!0;let t=e.extensions,{extensions:n}=r;if(n===t)return!1;if(!t||!n||n.length!==t.length)return!0;for(let s=0;s<n.length;s++)if(!n[s].equals(t[s]))return!0;return!1}function Qx(r,e,t){let n=r.updateTriggers[t];n=n??{};let s=e.updateTriggers[t];return s=s??{},Al({oldProps:s,newProps:n,triggerName:t})}var RE="count(): argument not an object",IE="count(): argument not a container";function Sl(r){if(!CE(r))throw new Error(RE);if(typeof r.count=="function")return r.count();if(Number.isFinite(r.size))return r.size;if(Number.isFinite(r.length))return r.length;if(PE(r))return Object.keys(r).length;throw new Error(IE)}function PE(r){return r!==null&&typeof r=="object"&&r.constructor===Object}function CE(r){return r!==null&&typeof r=="object"}function To(r,e){if(!e)return r;let t={...r,...e};if("defines"in e&&(t.defines={...r.defines,...e.defines}),"modules"in e&&(t.modules=(r.modules||[]).concat(e.modules),e.modules.some(n=>n.name==="project64"))){let n=t.modules.findIndex(s=>s.name==="project32");n>=0&&t.modules.splice(n,1)}if("inject"in e)if(!r.inject)t.inject=e.inject;else{let n={...r.inject};for(let s in e.inject)n[s]=(n[s]||"")+e.inject[s];t.inject=n}return t}H();var ME={minFilter:"linear",mipmapFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},Pd={};function tb(r,e,t,n){if(t instanceof K)return t;t.constructor&&t.constructor.name!=="Object"&&(t={data:t});let s=null;t.compressed&&(s={minFilter:"linear",mipmapFilter:t.data.length>1?"nearest":"linear"});let{width:i,height:o}=t.data,a=e.createTexture({...t,sampler:{...ME,...s,...n},mipLevels:e.getMipLevelCount(i,o)});return a.generateMipmapsWebGL(),Pd[a.id]=r,a}function rb(r,e){!e||!(e instanceof K)||Pd[e.id]===r&&(e.delete(),delete Pd[e.id])}var OE={boolean:{validate(r,e){return!0},equal(r,e,t){return Boolean(r)===Boolean(e)}},number:{validate(r,e){return Number.isFinite(r)&&(!("max"in e)||r<=e.max)&&(!("min"in e)||r>=e.min)}},color:{validate(r,e){return e.optional&&!r||Cd(r)&&(r.length===3||r.length===4)},equal(r,e,t){return le(r,e,1)}},accessor:{validate(r,e){let t=El(r);return t==="function"||t===El(e.value)},equal(r,e,t){return typeof e=="function"?!0:le(r,e,1)}},array:{validate(r,e){return e.optional&&!r||Cd(r)},equal(r,e,t){let{compare:n}=t,s=Number.isInteger(n)?n:n?1:0;return n?le(r,e,s):r===e}},object:{equal(r,e,t){if(t.ignore)return!0;let{compare:n}=t,s=Number.isInteger(n)?n:n?1:0;return n?le(r,e,s):r===e}},function:{validate(r,e){return e.optional&&!r||typeof r=="function"},equal(r,e,t){return!t.compare&&t.ignore!==!1||r===e}},data:{transform:(r,e,t)=>{if(!r)return r;let{dataTransform:n}=t.props;return n?n(r):typeof r.shape=="string"&&r.shape.endsWith("-table")&&Array.isArray(r.data)?r.data:r}},image:{transform:(r,e,t)=>{let n=t.context;return!n||!n.device?null:tb(t.id,n.device,r,{...e.parameters,...t.props.textureParameters})},release:(r,e,t)=>{rb(t.id,r)}}};function nb(r){let e={},t={},n={};for(let[s,i]of Object.entries(r)){let o=i?.deprecatedFor;if(o)n[s]=Array.isArray(o)?o:[o];else{let a=kE(s,i);e[s]=a,t[s]=a.value}}return{propTypes:e,defaultProps:t,deprecatedProps:n}}function kE(r,e){switch(El(e)){case"object":return wo(r,e);case"array":return wo(r,{type:"array",value:e,compare:!1});case"boolean":return wo(r,{type:"boolean",value:e});case"number":return wo(r,{type:"number",value:e});case"function":return wo(r,{type:"function",value:e,compare:!0});default:return{name:r,type:"unknown",value:e}}}function wo(r,e){return"type"in e?{name:r,...OE[e.type],...e}:"value"in e?{name:r,type:El(e.value),...e}:{name:r,type:"object",value:e}}function Cd(r){return Array.isArray(r)||ArrayBuffer.isView(r)}function El(r){return Cd(r)?"array":r===null?"null":typeof r}function sb(r,e){let t;for(let i=e.length-1;i>=0;i--){let o=e[i];"extensions"in o&&(t=o.extensions)}let n=Md(r.constructor,t),s=Object.create(n);s[_s]=r,s[Dt]={},s[xt]={};for(let i=0;i<e.length;++i){let o=e[i];for(let a in o)s[a]=o[a]}return Object.freeze(s),s}var NE="_mergedDefaultProps";function Md(r,e){if(!(r instanceof Is.constructor))return{};let t=NE;if(e)for(let s of e){let i=s.constructor;i&&(t+=`:${i.extensionName||i.name}`)}let n=ib(r,t);return n||(r[t]=DE(r,e||[]))}function DE(r,e){if(!r.prototype)return null;let n=Object.getPrototypeOf(r),s=Md(n),i=ib(r,"defaultProps")||{},o=nb(i),a=Object.assign(Object.create(null),s,o.defaultProps),c=Object.assign(Object.create(null),s?.[at],o.propTypes),l=Object.assign(Object.create(null),s?.[Cc],o.deprecatedProps);for(let u of e){let f=Md(u.constructor);f&&(Object.assign(a,f),Object.assign(c,f[at]),Object.assign(l,f[Cc]))}return FE(a,r),LE(a,c),BE(a,l),a[at]=c,a[Cc]=l,e.length===0&&!Od(r,"_propTypes")&&(r._propTypes=c),a}function FE(r,e){let t=VE(e);Object.defineProperties(r,{id:{writable:!0,value:t}})}function BE(r,e){for(let t in e)Object.defineProperty(r,t,{enumerable:!1,set(n){let s=`${this.id}: ${t}`;for(let i of e[t])Od(this,i)||(this[i]=n);$.deprecated(s,e[t].join("/"))()}})}function LE(r,e){let t={},n={};for(let s in e){let i=e[s],{name:o,value:a}=i;i.async&&(t[o]=a,n[o]=UE(o))}r[ir]=t,r[Dt]={},Object.defineProperties(r,n)}function UE(r){return{enumerable:!0,set(e){typeof e=="string"||e instanceof Promise||gl(e)?this[Dt][r]=e:this[xt][r]=e},get(){if(this[xt]){if(r in this[xt])return this[xt][r]||this[ir][r];if(r in this[Dt]){let e=this[_s]&&this[_s].internalState;if(e&&e.hasAsyncProp(r))return e.getAsyncProp(r)||this[ir][r]}}return this[ir][r]}}}function Od(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function ib(r,e){return Od(r,e)&&r[e]}function VE(r){let e=r.componentName;return e||$.warn(`${r.name}.componentName not specified`)(),e||r.name}var zE=0,vo=class{constructor(...e){this.props=sb(this,e),this.id=this.props.id,this.count=zE++}clone(e){let{props:t}=this,n={};for(let s in t[ir])s in t[xt]?n[s]=t[xt][s]:s in t[Dt]&&(n[s]=t[Dt][s]);return new this.constructor({...t,...n,...e})}};vo.componentName="Component";vo.defaultProps={};var Is=vo;var WE=Object.freeze({}),En=class{constructor(e){this.component=e,this.asyncProps={},this.onAsyncPropUpdated=()=>{},this.oldProps=null,this.oldAsyncProps=null}finalize(){for(let e in this.asyncProps){let t=this.asyncProps[e];t&&t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}this.asyncProps={},this.component=null,this.resetOldProps()}getOldProps(){return this.oldAsyncProps||this.oldProps||WE}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component?this.component.props:null}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){let t=this.asyncProps[e];return t&&t.resolvedValue}isAsyncPropLoading(e){if(e){let t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(let t in this.asyncProps)if(this.isAsyncPropLoading(t))return!0;return!1}reloadAsyncProp(e,t){this._watchPromise(e,Promise.resolve(t))}setAsyncProps(e){this.component=e[_s]||this.component;let t=e[xt]||{},n=e[Dt]||e,s=e[ir]||{};for(let i in t){let o=t[i];this._createAsyncPropData(i,s[i]),this._updateAsyncProp(i,o),t[i]=this.getAsyncProp(i)}for(let i in n){let o=n[i];this._createAsyncPropData(i,s[i]),this._updateAsyncProp(i,o)}}_fetch(e,t){return null}_onResolve(e,t){}_onError(e,t){}_updateAsyncProp(e,t){if(this._didAsyncInputValueChange(e,t)){if(typeof t=="string"&&(t=this._fetch(e,t)),t instanceof Promise){this._watchPromise(e,t);return}if(gl(t)){this._resolveAsyncIterable(e,t);return}this._setPropValue(e,t)}}_freezeAsyncOldProps(){if(!this.oldAsyncProps&&this.oldProps){this.oldAsyncProps=Object.create(this.oldProps);for(let e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}_didAsyncInputValueChange(e,t){let n=this.asyncProps[e];return t===n.resolvedValue||t===n.lastValue?!1:(n.lastValue=t,!0)}_setPropValue(e,t){this._freezeAsyncOldProps();let n=this.asyncProps[e];n&&(t=this._postProcessValue(n,t),n.resolvedValue=t,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount)}_setAsyncPropValue(e,t,n){let s=this.asyncProps[e];s&&n>=s.resolvedLoadCount&&t!==void 0&&(this._freezeAsyncOldProps(),s.resolvedValue=t,s.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}_watchPromise(e,t){let n=this.asyncProps[e];if(n){n.pendingLoadCount++;let s=n.pendingLoadCount;t.then(i=>{this.component&&(i=this._postProcessValue(n,i),this._setAsyncPropValue(e,i,s),this._onResolve(e,i))}).catch(i=>{this._onError(e,i)})}}async _resolveAsyncIterable(e,t){if(e!=="data"){this._setPropValue(e,t);return}let n=this.asyncProps[e];if(!n)return;n.pendingLoadCount++;let s=n.pendingLoadCount,i=[],o=0;for await(let a of t){if(!this.component)return;let{dataTransform:c}=this.component.props;c?i=c(a,i):i=i.concat(a),Object.defineProperty(i,"__diff",{enumerable:!1,value:[{startRow:o,endRow:i.length}]}),o=i.length,this._setAsyncPropValue(e,i,s)}this._onResolve(e,i)}_postProcessValue(e,t){let n=e.type;return n&&this.component&&(n.release&&n.release(e.resolvedValue,n,this.component),n.transform)?n.transform(t,n,this.component):t}_createAsyncPropData(e,t){if(!this.asyncProps[e]){let s=this.component&&this.component.props[at];this.asyncProps[e]={type:s&&s[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}};var Ao=class extends En{constructor({attributeManager:e,layer:t}){super(t),this.attributeManager=e,this.needsRedraw=!0,this.needsUpdate=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}_fetch(e,t){let n=this.layer,s=n?.props.fetch;return s?s(t,{propName:e,layer:n}):super._fetch(e,t)}_onResolve(e,t){let n=this.layer;if(n){let s=n.props.onDataLoad;e==="data"&&s&&s(t,{propName:e,layer:n})}}_onError(e,t){let n=this.layer;n&&n.raiseError(t,`loading ${e} of ${this.layer}`)}};var $E="layer.changeFlag",jE="layer.initialize",HE="layer.update",XE="layer.finalize",YE="layer.matched",ob=2**24-1,qE=Object.freeze([]),KE=st(({oldViewport:r,viewport:e})=>r.equals(e)),At=new Uint8ClampedArray(0),ZE={data:{type:"data",value:qE,async:!0},dataComparator:{type:"function",value:null,optional:!0},_dataDiff:{type:"function",value:r=>r&&r.__diff,optional:!0},dataTransform:{type:"function",value:null,optional:!0},onDataLoad:{type:"function",value:null,optional:!0},onError:{type:"function",value:null,optional:!0},fetch:{type:"function",value:(r,{propName:e,layer:t,loaders:n,loadOptions:s,signal:i})=>{let{resourceManager:o}=t.context;s=s||t.getLoadOptions(),n=n||t.props.loaders,i&&(s={...s,fetch:{...s?.fetch,signal:i}});let a=o.contains(r);return!a&&!s&&(o.add({resourceId:r,data:Er(r,n),persistent:!1}),a=!0),a?o.subscribe({resourceId:r,onChange:c=>t.internalState?.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):Er(r,n,s)}},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},operation:"draw",onHover:{type:"function",value:null,optional:!0},onClick:{type:"function",value:null,optional:!0},onDragStart:{type:"function",value:null,optional:!0},onDrag:{type:"function",value:null,optional:!0},onDragEnd:{type:"function",value:null,optional:!0},coordinateSystem:Y.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{type:"object",value:{},optional:!0,compare:2},loadOptions:{type:"object",value:null,optional:!0,ignore:!0},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,ignore:!0},getPolygonOffset:{type:"function",value:({layerIndex:r})=>[0,-r*100]},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}},So=class extends Is{constructor(){super(...arguments),this.internalState=null,this.lifecycle=kr.NO_STATE,this.parent=null}static get componentName(){return Object.prototype.hasOwnProperty.call(this,"layerName")?this.layerName:""}get root(){let e=this;for(;e.parent;)e=e.parent;return e}toString(){return`${this.constructor.layerName||this.constructor.name}({id: '${this.props.id}'})`}project(e){ie(this.internalState);let t=this.internalState.viewport||this.context.viewport,n=Gh(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,i,o]=us(n,t.pixelProjectionMatrix);return e.length===2?[s,i]:[s,i,o]}unproject(e){return ie(this.internalState),(this.internalState.viewport||this.context.viewport).unproject(e)}projectPosition(e,t){ie(this.internalState);let n=this.internalState.viewport||this.context.viewport;return Rc(e,{viewport:n,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem,...t})}get isComposite(){return!1}get isDrawable(){return!0}setState(e){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,e),this.setNeedsRedraw()}setNeedsRedraw(){this.internalState&&(this.internalState.needsRedraw=!0)}setNeedsUpdate(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}get isLoaded(){return this.internalState?!this.internalState.isAsyncPropLoading():!1}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){let e=this.state;return e&&(e.models||e.model&&[e.model])||[]}setShaderModuleProps(...e){for(let t of this.getModels())t.shaderInputs.setProps(...e)}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}use64bitPositions(){let{coordinateSystem:e}=this.props;return e===Y.DEFAULT||e===Y.LNGLAT||e===Y.CARTESIAN}onHover(e,t){return this.props.onHover&&this.props.onHover(e,t)||!1}onClick(e,t){return this.props.onClick&&this.props.onClick(e,t)||!1}nullPickingColor(){return[0,0,0]}encodePickingColor(e,t=[]){return t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}decodePickingColor(e){ie(e instanceof Uint8Array);let[t,n,s]=e;return t+n*256+s*65536-1}getNumInstances(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&this.state.numInstances!==void 0?this.state.numInstances:Sl(this.props.data)}getStartIndices(){return this.props.startIndices?this.props.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}getBounds(){return this.getAttributeManager()?.getBounds(["positions","instancePositions"])}getShaders(e){e=To(e,{disableWarnings:!0,modules:this.context.defaultShaderModules});for(let t of this.props.extensions)e=To(e,t.getShaders.call(this,t));return e}shouldUpdateState(e){return e.changeFlags.propsOrDataChanged}updateState(e){let t=this.getAttributeManager(),{dataChanged:n}=e.changeFlags;if(n&&t)if(Array.isArray(n))for(let s of n)t.invalidateAll(s);else t.invalidateAll();if(t){let{props:s}=e,i=this.internalState.hasPickingBuffer,o=Number.isInteger(s.highlightedObjectIndex)||Boolean(s.pickable)||s.extensions.some(a=>a.getNeedsPickingBuffer.call(this,a));if(i!==o){this.internalState.hasPickingBuffer=o;let{pickingColors:a,instancePickingColors:c}=t.attributes,l=a||c;l&&(o&&l.constant&&(l.constant=!1,t.invalidate(l.id)),!l.value&&!o&&(l.constant=!0,l.value=[0,0,0]))}}}finalizeState(e){for(let n of this.getModels())n.destroy();let t=this.getAttributeManager();t&&t.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}draw(e){for(let t of this.getModels())t.draw(e.renderPass)}getPickingInfo({info:e,mode:t,sourceLayer:n}){let{index:s}=e;return s>=0&&Array.isArray(this.props.data)&&(e.object=this.props.data[s]),e}raiseError(e,t){t&&(e=new Error(`${t}: ${e.message}`,{cause:e})),this.props.onError?.(e)||this.context?.onError?.(e,this)}getNeedsRedraw(e={clearRedrawFlags:!1}){return this._getNeedsRedraw(e)}needsUpdate(){return this.internalState?this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()):!1}hasUniformTransition(){return this.internalState?.uniformTransitions.active||!1}activateViewport(e){if(!this.internalState)return;let t=this.internalState.viewport;this.internalState.viewport=e,(!t||!KE({oldViewport:t,viewport:e}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(e="all"){let t=this.getAttributeManager();t&&(e==="all"?t.invalidateAll():t.invalidate(e))}updateAttributes(e){let t=!1;for(let n in e)e[n].layoutChanged()&&(t=!0);for(let n of this.getModels())this._setModelAttributes(n,e,t)}_updateAttributes(){let e=this.getAttributeManager();if(!e)return;let t=this.props,n=this.getNumInstances(),s=this.getStartIndices();e.update({data:t.data,numInstances:n,startIndices:s,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this});let i=e.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(i)}_updateAttributeTransition(){let e=this.getAttributeManager();e&&e.updateTransition()}_updateUniformTransition(){let{uniformTransitions:e}=this.internalState;if(e.active){let t=e.update(),n=Object.create(this.props);for(let s in t)Object.defineProperty(n,s,{value:t[s]});return n}return this.props}calculateInstancePickingColors(e,{numInstances:t}){if(e.constant)return;let n=Math.floor(At.length/4);if(this.internalState.usesPickingColorCache=!0,n<t){t>ob&&$.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),At=yt.allocate(At,t,{size:4,copy:!0,maxCount:Math.max(t,ob)});let s=Math.floor(At.length/4),i=[0,0,0];for(let o=n;o<s;o++)this.encodePickingColor(o,i),At[o*4+0]=i[0],At[o*4+1]=i[1],At[o*4+2]=i[2],At[o*4+3]=0}e.value=At.subarray(0,t*4)}_setModelAttributes(e,t,n=!1){if(!Object.keys(t).length)return;if(n){let a=this.getAttributeManager();e.setBufferLayout(a.getBufferLayouts(e)),t=a.getAttributes()}let s=e.userData?.excludeAttributes||{},i={},o={};for(let a in t){if(s[a])continue;let c=t[a].getValue();for(let l in c){let u=c[l];u instanceof W?t[a].settings.isIndexed?e.setIndexBuffer(u):i[l]=u:u&&(o[l]=u)}}e.setAttributes(i),e.setConstantAttributes(o)}disablePickingIndex(e){let t=this.props.data;if(!("attributes"in t)){this._disablePickingIndex(e);return}let{pickingColors:n,instancePickingColors:s}=this.getAttributeManager().attributes,i=n||s,o=i&&t.attributes&&t.attributes[i.id];if(o&&o.value){let a=o.value,c=this.encodePickingColor(e);for(let l=0;l<t.length;l++){let u=i.getVertexOffset(l);a[u]===c[0]&&a[u+1]===c[1]&&a[u+2]===c[2]&&this._disablePickingIndex(l)}}else this._disablePickingIndex(e)}_disablePickingIndex(e){let{pickingColors:t,instancePickingColors:n}=this.getAttributeManager().attributes,s=t||n;if(!s)return;let i=s.getVertexOffset(e),o=s.getVertexOffset(e+1);s.buffer.write(new Uint8Array(o-i),i)}restorePickingColors(){let{pickingColors:e,instancePickingColors:t}=this.getAttributeManager().attributes,n=e||t;n&&(this.internalState.usesPickingColorCache&&n.value.buffer!==At.buffer&&(n.value=At.subarray(0,n.value.length)),n.updateSubBuffer({startOffset:0}))}_initialize(){ie(!this.internalState),ie(Number.isFinite(this.props.coordinateSystem)),he(jE,this);let e=this._getAttributeManager();e&&e.addInstanced({instancePickingColors:{type:"uint8",size:4,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Ao({attributeManager:e,layer:this}),this._clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>($.deprecated("layer.state.attributeManager","layer.getAttributeManager()")(),e)}),this.internalState.uniformTransitions=new bo(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);for(let t of this.props.extensions)t.initializeState.call(this,this.context,t);this.setChangeFlags({dataChanged:"init",propsChanged:"init",viewportChanged:!0,extensionsChanged:!0}),this._update()}_transferState(e){he(YE,this,this===e);let{state:t,internalState:n}=e;this!==e&&(this.internalState=n,this.state=t,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}_update(){let e=this.needsUpdate();if(he(HE,this,e),!e)return;let t=this.props,n=this.context,s=this.internalState,i=n.viewport,o=this._updateUniformTransition();s.propsInTransition=o,n.viewport=s.viewport||i,this.props=o;try{let a=this._getUpdateParams(),c=this.getModels();if(n.device)this.updateState(a);else try{this.updateState(a)}catch{}for(let u of this.props.extensions)u.updateState.call(this,a,u);this.setNeedsRedraw(),this._updateAttributes();let l=this.getModels()[0]!==c[0];this._postUpdate(a,l)}finally{n.viewport=i,this.props=t,this._clearChangeFlags(),s.needsUpdate=!1,s.resetOldProps()}}_finalize(){he(XE,this),this.finalizeState(this.context);for(let e of this.props.extensions)e.finalizeState.call(this,this.context,e)}_drawLayer({renderPass:e,shaderModuleProps:t=null,uniforms:n={},parameters:s={}}){this._updateAttributeTransition();let i=this.props,o=this.context;this.props=this.internalState.propsInTransition||i;try{t&&this.setShaderModuleProps(t);let{getPolygonOffset:a}=this.props,c=a&&a(n)||[0,0];o.device instanceof An&&o.device.setParametersWebGL({polygonOffset:c});for(let l of this.getModels())l.device.type==="webgpu"?l.setParameters({...l.parameters,...s}):l.setParameters(s);if(o.device instanceof An)o.device.withParametersWebGL(s,()=>{let l={renderPass:e,shaderModuleProps:t,uniforms:n,parameters:s,context:o};for(let u of this.props.extensions)u.draw.call(this,l,u);this.draw(l)});else{let l={renderPass:e,shaderModuleProps:t,uniforms:n,parameters:s,context:o};for(let u of this.props.extensions)u.draw.call(this,l,u);this.draw(l)}}finally{this.props=i}}getChangeFlags(){return this.internalState?.changeFlags}setChangeFlags(e){if(!this.internalState)return;let{changeFlags:t}=this.internalState;for(let s in e)if(e[s]){let i=!1;switch(s){case"dataChanged":let o=e[s],a=t[s];o&&Array.isArray(a)&&(t.dataChanged=Array.isArray(o)?a.concat(o):o,i=!0);default:t[s]||(t[s]=e[s],i=!0)}i&&he($E,this,s,e)}let n=Boolean(t.dataChanged||t.updateTriggersChanged||t.propsChanged||t.extensionsChanged);t.propsOrDataChanged=n,t.somethingChanged=n||t.viewportChanged||t.stateChanged}_clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}_diffProps(e,t){let n=eb(e,t);if(n.updateTriggersChanged)for(let s in n.updateTriggersChanged)n.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(n.transitionsChanged)for(let s in n.transitionsChanged)this.internalState.uniformTransitions.add(s,t[s],e[s],e.transitions?.[s]);return this.setChangeFlags(n)}validateProps(){Jx(this.props)}updateAutoHighlight(e){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(e)}_updateAutoHighlight(e){let t={highlightedObjectColor:e.picked?e.color:null},{highlightColor:n}=this.props;e.picked&&typeof n=="function"&&(t.highlightColor=n(e)),this.setShaderModuleProps({picking:t}),this.setNeedsRedraw()}_getAttributeManager(){let e=this.context;return new Sn(e.device,{id:this.props.id,stats:e.stats,timeline:e.timeline})}_postUpdate(e,t){let{props:n,oldProps:s}=e,i=this.state.model;i?.isInstanced&&i.setInstanceCount(this.getNumInstances());let{autoHighlight:o,highlightedObjectIndex:a,highlightColor:c}=n;if(t||s.autoHighlight!==o||s.highlightedObjectIndex!==a||s.highlightColor!==c){let l={};Array.isArray(c)&&(l.highlightColor=c),(t||s.autoHighlight!==o||a!==s.highlightedObjectIndex)&&(l.highlightedObjectColor=Number.isFinite(a)&&a>=0?this.encodePickingColor(a):null),this.setShaderModuleProps({picking:l})}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(e){if(!this.internalState)return!1;let t=!1;t=t||this.internalState.needsRedraw&&this.id;let n=this.getAttributeManager(),s=n?n.getNeedsRedraw(e):!1;if(t=t||s,t)for(let i of this.props.extensions)i.onNeedsRedraw.call(this,i);return this.internalState.needsRedraw=this.internalState.needsRedraw&&!e.clearRedrawFlags,t}_onAsyncPropUpdated(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}};So.defaultProps=ZE;So.layerName="Layer";var Rl=So;var GE="compositeLayer.renderLayers",Il=class extends Rl{get isComposite(){return!0}get isDrawable(){return!1}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(e=>e.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(e){}setState(e){super.setState(e),this.setNeedsUpdate()}getPickingInfo({info:e}){let{object:t}=e;return t&&t.__source&&t.__source.parent&&t.__source.parent.id===this.id&&(e.object=t.__source.object,e.index=t.__source.index),e}filterSubLayer(e){return!0}shouldRenderSubLayer(e,t){return t&&t.length}getSubLayerClass(e,t){let{_subLayerProps:n}=this.props;return n&&n[e]&&n[e].type||t}getSubLayerRow(e,t,n){return e.__source={parent:this,object:t,index:n},e}getSubLayerAccessor(e){if(typeof e=="function"){let t={index:-1,data:this.props.data,target:[]};return(n,s)=>n&&n.__source?(t.index=n.__source.index,e(n.__source.object,t)):e(n,s)}return e}getSubLayerProps(e={}){let{opacity:t,pickable:n,visible:s,parameters:i,getPolygonOffset:o,highlightedObjectIndex:a,autoHighlight:c,highlightColor:l,coordinateSystem:u,coordinateOrigin:f,wrapLongitude:h,positionFormat:d,modelMatrix:m,extensions:y,fetch:_,operation:x,_subLayerProps:E}=this.props,b={id:"",updateTriggers:{},opacity:t,pickable:n,visible:s,parameters:i,getPolygonOffset:o,highlightedObjectIndex:a,autoHighlight:c,highlightColor:l,coordinateSystem:u,coordinateOrigin:f,wrapLongitude:h,positionFormat:d,modelMatrix:m,extensions:y,fetch:_,operation:x},S=E&&e.id&&E[e.id],C=S&&S.updateTriggers,P=e.id||"sublayer";if(S){let B=this.props[at],N=e.type?e.type._propTypes:{};for(let k in S){let F=N[k]||B[k];F&&F.type==="accessor"&&(S[k]=this.getSubLayerAccessor(S[k]))}}Object.assign(b,e,S),b.id=`${this.props.id}-${P}`,b.updateTriggers={all:this.props.updateTriggers?.all,...e.updateTriggers,...C};for(let B of y){let N=B.getSubLayerProps.call(this,B);N&&Object.assign(b,N,{updateTriggers:Object.assign(b.updateTriggers,N.updateTriggers)})}return b}_updateAutoHighlight(e){for(let t of this.getSubLayers())t.updateAutoHighlight(e)}_getAttributeManager(){return null}_postUpdate(e,t){let n=this.internalState.subLayers,s=!n||this.needsUpdate();if(s){let i=this.renderLayers();n=Nr(i,Boolean),this.internalState.subLayers=n}he(GE,this,s,n);for(let i of n)i.parent=this}};Il.layerName="CompositeLayer";var ab=Il;var kd=Math.PI/180;function QE({height:r,focalDistance:e,orbitAxis:t,rotationX:n,rotationOrbit:s,zoom:i}){let o=t==="Z"?[0,0,1]:[0,1,0],a=t==="Z"?[0,-e,0]:[0,0,e],c=new Q().lookAt({eye:a,up:o});c.rotateX(n*kd),t==="Z"?c.rotateZ(s*kd):c.rotateY(s*kd);let l=Math.pow(2,i)/r;return c.scale(l),c}var Pl=class extends $e{constructor(e){let{height:t,projectionMatrix:n,fovy:s=50,orbitAxis:i="Z",target:o=[0,0,0],rotationX:a=0,rotationOrbit:c=0,zoom:l=0}=e,u=n?n[5]/2:rr(s);super({...e,longitude:void 0,viewMatrix:QE({height:t||1,focalDistance:u,orbitAxis:i,rotationX:a,rotationOrbit:c,zoom:l}),fovy:s,focalDistance:u,position:o,zoom:l}),this.target=o,this.orbitAxis=i,this.rotationX=a,this.rotationOrbit=c,this.fovy=s,this.projectedCenter=this.project(this.center)}unproject(e,{topLeft:t=!0}={}){let[n,s,i=this.projectedCenter[2]]=e,o=t?s:this.height-s,[a,c,l]=ot([n,o,i],this.pixelUnprojectionMatrix);return[a,c,l]}panByPosition(e,t,n){let s=this.project(e),i=[this.width/2+s[0]-t[0],this.height/2+s[1]-t[1],this.projectedCenter[2]];return{target:this.unproject(i)}}};Pl.displayName="OrbitViewport";var Cl=Pl;var JE=new Q().lookAt({eye:[0,0,1]});function eR({width:r,height:e,near:t,far:n,padding:s}){let i=-r/2,o=r/2,a=-e/2,c=e/2;if(s){let{left:l=0,right:u=0,top:f=0,bottom:h=0}=s,d=ee((l+r-u)/2,0,r)-r/2,m=ee((f+e-h)/2,0,e)-e/2;i-=d,o-=d,a+=m,c+=m}return new Q().ortho({left:i,right:o,bottom:a,top:c,near:t,far:n})}var Ml=class extends $e{constructor(e){let{width:t,height:n,near:s=.1,far:i=1e3,zoom:o=0,target:a=[0,0,0],padding:c=null,flipY:l=!0}=e,u=e.zoomX??(Array.isArray(o)?o[0]:o),f=e.zoomY??(Array.isArray(o)?o[1]:o),h=Math.min(u,f),d=Math.pow(2,h),m;if(u!==f){let y=Math.pow(2,u),_=Math.pow(2,f);m={unitsPerMeter:[y/d,_/d,1],metersPerUnit:[d/y,d/_,1]}}super({...e,longitude:void 0,position:a,viewMatrix:JE.clone().scale([d,d*(l?-1:1),d]),projectionMatrix:eR({width:t||1,height:n||1,padding:c,near:s,far:i}),zoom:h,distanceScales:m}),this.target=a,this.zoomX=u,this.zoomY=f,this.flipY=l}projectFlat([e,t]){let{unitsPerMeter:n}=this.distanceScales;return[e*n[0],t*n[1]]}unprojectFlat([e,t]){let{metersPerUnit:n}=this.distanceScales;return[e*n[0],t*n[1]]}panByPosition(e,t,n){let s=ot(t,this.pixelUnprojectionMatrix),i=this.projectFlat(e),o=_e.add([],i,_e.negate([],s)),a=_e.add([],this.center,o);return{target:this.unprojectFlat(a)}}};Ml.displayName="OrthographicViewport";var Ol=Ml;var kl=class extends $e{constructor(e){let{longitude:t,latitude:n,modelMatrix:s,bearing:i=0,pitch:o=0,up:a=[0,0,1]}=e,l=new ft({bearing:i,pitch:o===-90?1e-4:90+o}).toVector3().normalize(),u=s?new Q(s).transformAsVector(l):l,f=Number.isFinite(n)?Fi({latitude:n}):0,h=Math.pow(2,f),d=new Q().lookAt({eye:[0,0,0],center:u,up:a}).scale(h);super({...e,zoom:f,viewMatrix:d}),this.latitude=n,this.longitude=t,this.pitch=o,this.bearing=i,this.up=a}};kl.displayName="FirstPersonViewport";var Nl=kl;var Rn=20,cb=500,Eo=class extends ur{constructor(e){let{width:t,height:n,position:s=[0,0,0],bearing:i=0,pitch:o=0,longitude:a=null,latitude:c=null,maxPitch:l=90,minPitch:u=-90,startRotatePos:f,startBearing:h,startPitch:d,startZoomPosition:m,startPanPos:y,startPanPosition:_}=e;super({width:t,height:n,position:s,bearing:i,pitch:o,longitude:a,latitude:c,maxPitch:l,minPitch:u},{startRotatePos:f,startBearing:h,startPitch:d,startZoomPosition:m,startPanPos:y,startPanPosition:_}),this.makeViewport=e.makeViewport}panStart({pos:e}){let{position:t}=this.getViewportProps();return this._getUpdatedState({startPanPos:e,startPanPosition:t})}pan({pos:e}){if(!e)return this;let{startPanPos:t=[0,0],startPanPosition:n=[0,0]}=this.getState(),{width:s,height:i,bearing:o,pitch:a}=this.getViewportProps(),c=cb*(e[0]-t[0])/s,l=cb*(e[1]-t[1])/i,u=new ft({bearing:o,pitch:a}),f=new ft({bearing:o,pitch:-90}),h=u.toVector3().normalize(),d=f.toVector3().cross(h).normalize();return this._getUpdatedState({position:new G(n).add(d.scale(c)).add(h.scale(l))})}panEnd(){return this._getUpdatedState({startPanPos:null,startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:n=0}){let{startRotatePos:s,startBearing:i,startPitch:o}=this.getState(),{width:a,height:c}=this.getViewportProps();if(!s||i===void 0||o===void 0)return this;let l;if(e){let u=(e[0]-s[0])/a,f=(e[1]-s[1])/c;l={bearing:i-u*180,pitch:o-f*90}}else l={bearing:i-t,pitch:o-n};return this._getUpdatedState(l)}rotateEnd(){return this._getUpdatedState({startRotatePos:null,startBearing:null,startPitch:null})}zoomStart(){return this._getUpdatedState({startZoomPosition:this.getViewportProps().position})}zoom({pos:e,scale:t}){let n=this.getViewportProps(),s=this.getState().startZoomPosition||n.position,i=this.makeViewport(n),{projectionMatrix:o,width:a}=i,l=2*Math.atan(1/o[0])*(e[0]/a-.5),u=this.getDirection(!0);return this._move(u.rotateZ({radians:-l}),Math.log2(t)*Rn,s)}zoomEnd(){return this._getUpdatedState({startZoomPosition:null})}moveLeft(e=Rn){let t=this.getDirection(!0);return this._move(t.rotateZ({radians:Math.PI/2}),e)}moveRight(e=Rn){let t=this.getDirection(!0);return this._move(t.rotateZ({radians:-Math.PI/2}),e)}moveUp(e=Rn){let t=this.getDirection(!0);return this._move(t,e)}moveDown(e=Rn){let t=this.getDirection(!0);return this._move(t.negate(),e)}rotateLeft(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch-e})}zoomIn(e=Rn){return this._move(new G(0,0,1),e)}zoomOut(e=Rn){return this._move(new G(0,0,-1),e)}shortestPathFrom(e){let t=e.getViewportProps(),n={...this.getViewportProps()},{bearing:s,longitude:i}=n;return Math.abs(s-t.bearing)>180&&(n.bearing=s<0?s+360:s-360),i!==null&&t.longitude!==null&&Math.abs(i-t.longitude)>180&&(n.longitude=i<0?i+360:i-360),n}_move(e,t,n=this.getViewportProps().position){let s=e.scale(t);return this._getUpdatedState({position:new G(n).add(s)})}getDirection(e=!1){return new ft({bearing:this.getViewportProps().bearing,pitch:e?90:90+this.getViewportProps().pitch}).toVector3().normalize()}_getUpdatedState(e){return new Eo({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...e})}applyConstraints(e){let{pitch:t,maxPitch:n,minPitch:s,longitude:i,bearing:o}=e;return e.pitch=ee(t,s,n),i!==null&&(i<-180||i>180)&&(e.longitude=pn(i+180,360)-180),(o<-180||o>180)&&(e.bearing=pn(o+180,360)-180),e}},In=class extends De{constructor(){super(...arguments),this.ControllerState=Eo,this.transition={transitionDuration:300,transitionInterpolator:new Ae(["position","pitch","bearing"])}}};var Dl=class extends Ne{constructor(e={}){super(e)}getViewportType(){return Nl}get ControllerType(){return In}};Dl.displayName="FirstPersonView";var lb=Dl;var Ro=class extends ur{constructor(e){let{width:t,height:n,rotationX:s=0,rotationOrbit:i=0,target:o=[0,0,0],zoom:a=0,minRotationX:c=-90,maxRotationX:l=90,minZoom:u=-1/0,maxZoom:f=1/0,startPanPosition:h,startRotatePos:d,startRotationX:m,startRotationOrbit:y,startZoomPosition:_,startZoom:x}=e;super({width:t,height:n,rotationX:s,rotationOrbit:i,target:o,zoom:a,minRotationX:c,maxRotationX:l,minZoom:u,maxZoom:f},{startPanPosition:h,startRotatePos:d,startRotationX:m,startRotationOrbit:y,startZoomPosition:_,startZoom:x}),this.makeViewport=e.makeViewport}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){let n=this.getState().startPanPosition||t;if(!n)return this;let i=this.makeViewport(this.getViewportProps()).panByPosition(n,e);return this._getUpdatedState(i)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this.getViewportProps().rotationX,startRotationOrbit:this.getViewportProps().rotationOrbit})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:n=0}){let{startRotatePos:s,startRotationX:i,startRotationOrbit:o}=this.getState(),{width:a,height:c}=this.getViewportProps();if(!s||i===void 0||o===void 0)return this;let l;if(e){let u=(e[0]-s[0])/a,f=(e[1]-s[1])/c;(i<-90||i>90)&&(u*=-1),l={rotationX:i+f*180,rotationOrbit:o+u*180}}else l={rotationX:i+n,rotationOrbit:o+t};return this._getUpdatedState(l)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(e){let t=e.getViewportProps(),n={...this.getViewportProps()},{rotationOrbit:s}=n;return Math.abs(s-t.rotationOrbit)>180&&(n.rotationOrbit=s<0?s+360:s-360),n}zoomStart({pos:e}){return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this.getViewportProps().zoom})}zoom({pos:e,startPos:t,scale:n}){let{startZoom:s,startZoomPosition:i}=this.getState();if(i||(s=this.getViewportProps().zoom,i=this._unproject(t||e)),!i)return this;let o=this._calculateNewZoom({scale:n,startZoom:s}),a=this.makeViewport({...this.getViewportProps(),zoom:o});return this._getUpdatedState({zoom:o,...a.panByPosition(i,e)})}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}zoomOut(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}moveLeft(e=50){return this._panFromCenter([-e,0])}moveRight(e=50){return this._panFromCenter([e,0])}moveUp(e=50){return this._panFromCenter([0,-e])}moveDown(e=50){return this._panFromCenter([0,e])}rotateLeft(e=15){return this._getUpdatedState({rotationOrbit:this.getViewportProps().rotationOrbit-e})}rotateRight(e=15){return this._getUpdatedState({rotationOrbit:this.getViewportProps().rotationOrbit+e})}rotateUp(e=10){return this._getUpdatedState({rotationX:this.getViewportProps().rotationX-e})}rotateDown(e=10){return this._getUpdatedState({rotationX:this.getViewportProps().rotationX+e})}_project(e){return this.makeViewport(this.getViewportProps()).project(e)}_unproject(e){return this.makeViewport(this.getViewportProps()).unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){let{maxZoom:n,minZoom:s}=this.getViewportProps();t===void 0&&(t=this.getViewportProps().zoom);let i=t+Math.log2(e);return ee(i,s,n)}_panFromCenter(e){let{target:t}=this.getViewportProps(),n=this._project(t);return this.pan({startPosition:t,pos:[n[0]+e[0],n[1]+e[1]]})}_getUpdatedState(e){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...e})}applyConstraints(e){let{maxZoom:t,minZoom:n,zoom:s,maxRotationX:i,minRotationX:o,rotationOrbit:a}=e;return e.zoom=Array.isArray(s)?[ee(s[0],n,t),ee(s[1],n,t)]:ee(s,n,t),e.rotationX=ee(e.rotationX,o,i),(a<-180||a>180)&&(e.rotationOrbit=pn(a+180,360)-180),e}},Pn=class extends De{constructor(){super(...arguments),this.ControllerState=Ro,this.transition={transitionDuration:300,transitionInterpolator:new Ae({transitionProps:{compare:["target","zoom","rotationX","rotationOrbit"],required:["target","zoom"]}})}}};var Fl=class extends Ne{constructor(e={}){super(e),this.props.orbitAxis=e.orbitAxis||"Z"}getViewportType(){return Cl}get ControllerType(){return Pn}};Fl.displayName="OrbitView";var ub=Fl;var Nd=class extends Ro{constructor(e){super(e),this.zoomAxis=e.zoomAxis||"all"}_calculateNewZoom({scale:e,startZoom:t}){let{maxZoom:n,minZoom:s}=this.getViewportProps();t===void 0&&(t=this.getViewportProps().zoom);let i=Math.log2(e);if(Array.isArray(t)){let[o,a]=t;switch(this.zoomAxis){case"X":o=ee(o+i,s,n);break;case"Y":a=ee(a+i,s,n);break;default:let c=Math.min(o+i,a+i);c<s&&(i+=s-c),c=Math.max(o+i,a+i),c>n&&(i+=n-c),o+=i,a+=i}return[o,a]}return ee(t+i,s,n)}},Cn=class extends De{constructor(){super(...arguments),this.ControllerState=Nd,this.transition={transitionDuration:300,transitionInterpolator:new Ae(["target","zoom"])},this.dragMode="pan"}_onPanRotate(){return!1}};var Bl=class extends Ne{constructor(e={}){super(e)}getViewportType(){return Ol}get ControllerType(){return Cn}};Bl.displayName="OrthographicView";var fb=Bl;var Dd=class extends Gi{constructor(e){let{startPanPos:t,...n}=e;super(n),t!==void 0&&(this._state.startPanPos=t)}panStart({pos:e}){let{latitude:t,longitude:n,zoom:s}=this.getViewportProps();return this._getUpdatedState({startPanLngLat:[n,t],startPanPos:e,startZoom:s})}pan({pos:e,startPos:t}){let n=this.getState(),s=n.startPanLngLat||this._unproject(t);if(!s)return this;let i=n.startZoom??this.getViewportProps().zoom,o=n.startPanPos||t,a=[s[0],s[1],i],l=this.makeViewport(this.getViewportProps()).panByPosition(a,e,o);return this._getUpdatedState(l)}panEnd(){return this._getUpdatedState({startPanLngLat:null,startPanPos:null,startZoom:null})}zoom({scale:e}){let n=(this.getState().startZoom||this.getViewportProps().zoom)+Math.log2(e);return this._getUpdatedState({zoom:n})}applyConstraints(e){let{longitude:t,latitude:n,maxZoom:s,minZoom:i,zoom:o}=e,a=xn(0),c=xn(n)-a;return e.zoom=ee(o,i+c,s+c),(t<-180||t>180)&&(e.longitude=pn(t+180,360)-180),e.latitude=ee(n,-ze,ze),e}},Mn=class extends De{constructor(){super(...arguments),this.ControllerState=Dd,this.transition={transitionDuration:300,transitionInterpolator:new Ae(["longitude","latitude","zoom"])},this.dragMode="pan"}setProps(e){super.setProps(e),this.dragRotate=!1,this.touchRotate=!1}};var Ll=class extends Ne{constructor(e={}){super(e)}getViewportType(e){return e.zoom>12?Or:xs}get ControllerType(){return Mn}};Ll.displayName="GlobeView";var hb=Ll;var Io=class{static get componentName(){return Object.prototype.hasOwnProperty.call(this,"extensionName")?this.extensionName:""}constructor(e){e&&(this.opts=e)}equals(e){return this===e?!0:this.constructor===e.constructor&&le(this.opts,e.opts,1)}getShaders(e){return null}getSubLayerProps(e){let{defaultProps:t}=e.constructor,n={updateTriggers:{}};for(let s in t)if(s in this.props){let i=t[s],o=this.props[s];n[s]=o,i&&i.type==="accessor"&&(n.updateTriggers[s]=this.props.updateTriggers[s],typeof o=="function"&&(n[s]=this.getSubLayerAccessor(o)))}return n}initializeState(e,t){}updateState(e,t){}onNeedsRedraw(e){}getNeedsPickingBuffer(e){return!1}draw(e,t){}finalizeState(e,t){}};Io.defaultProps={};Io.extensionName="LayerExtension";var db=Io;var Fd={bearing:0,pitch:0,position:[0,0,0]},tR={speed:1.2,curve:1.414},Po=class extends cr{constructor(e={}){super({compare:["longitude","latitude","zoom","bearing","pitch","position"],extract:["width","height","longitude","latitude","zoom","bearing","pitch","position"],required:["width","height","latitude","longitude","zoom"]}),this.opts={...tR,...e}}interpolateProps(e,t,n){let s=Hh(e,t,n,this.opts);for(let i in Fd)s[i]=Qt(e[i]||Fd[i],t[i]||Fd[i],n);return s}getDuration(e,t){let{transitionDuration:n}=t;return n==="auto"&&(n=Xh(e,t,this.opts)),n}};H();var Co=class{constructor(e){this.indexStarts=[0],this.vertexStarts=[0],this.vertexCount=0,this.instanceCount=0;let{attributes:t={}}=e;this.typedArrayManager=yt,this.attributes={},this._attributeDefs=t,this.opts=e,this.updateGeometry(e)}updateGeometry(e){Object.assign(this.opts,e);let{data:t,buffers:n={},getGeometry:s,geometryBuffer:i,positionFormat:o,dataChanged:a,normalize:c=!0}=this.opts;if(this.data=t,this.getGeometry=s,this.positionSize=i&&i.size||(o==="XY"?2:3),this.buffers=n,this.normalize=c,i&&(ie(t.startIndices),this.getGeometry=this.getGeometryFromBuffer(i),c||(n.vertexPositions=i)),this.geometryBuffer=n.vertexPositions,Array.isArray(a))for(let l of a)this._rebuildGeometry(l);else this._rebuildGeometry()}updatePartialGeometry({startRow:e,endRow:t}){this._rebuildGeometry({startRow:e,endRow:t})}getGeometryFromBuffer(e){let t=e.value||e;return ArrayBuffer.isView(t)?_l(t,{size:this.positionSize,offset:e.offset,stride:e.stride,startIndices:this.data.startIndices}):null}_allocate(e,t){let{attributes:n,buffers:s,_attributeDefs:i,typedArrayManager:o}=this;for(let a in i)if(a in s)o.release(n[a]),n[a]=null;else{let c=i[a];c.copy=t,n[a]=o.allocate(n[a],e,c)}}_forEachGeometry(e,t,n){let{data:s,getGeometry:i}=this,{iterable:o,objectInfo:a}=Es(s,t,n);for(let c of o){a.index++;let l=i?i(c,a):null;e(l,a.index)}}_rebuildGeometry(e){if(!this.data)return;let{indexStarts:t,vertexStarts:n,instanceCount:s}=this,{data:i,geometryBuffer:o}=this,{startRow:a=0,endRow:c=1/0}=e||{},l={};if(e||(t=[0],n=[0]),this.normalize||!o)this._forEachGeometry((f,h)=>{let d=f&&this.normalizeGeometry(f);l[h]=d,n[h+1]=n[h]+(d?this.getGeometrySize(d):0)},a,c),s=n[n.length-1];else if(n=i.startIndices,s=n[i.length]||0,ArrayBuffer.isView(o))s=s||o.length/this.positionSize;else if(o instanceof W){let f=this.positionSize*4;s=s||o.byteLength/f}else if(o.buffer){let f=o.stride||this.positionSize*4;s=s||o.buffer.byteLength/f}else if(o.value){let f=o.value,h=o.stride/f.BYTES_PER_ELEMENT||this.positionSize;s=s||f.length/h}this._allocate(s,Boolean(e)),this.indexStarts=t,this.vertexStarts=n,this.instanceCount=s;let u={};this._forEachGeometry((f,h)=>{let d=l[h]||f;u.vertexStart=n[h],u.indexStart=t[h];let m=h<n.length-1?n[h+1]:s;u.geometrySize=m-n[h],u.geometryIndex=h,this.updateGeometryAttributes(d,u)},a,c),this.vertexCount=t[t.length-1]}};var Ul=class{constructor(e){this.map=null,this.width=0,this.height=0,this.props={...e},this._initialize(this.props)}finalize(){this.map?.remove(),this.map=null}setProps(e){let t=this.props,n={...this.props,...e};if(this.props=n,!this.map)return;this._update(t,n)&&this.redraw()}redraw(){let e=this.map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this.map}_initialize(e){let{mapLib:t,container:n}=e;t.accessToken=e.mapboxApiAccessToken||"",this.map=new e.mapLib.Map({container:n,maxZoom:24,...e.mapOptions,...pb(e.viewState),style:e.mapStyle,interactive:!1,trackResize:!1}),Object.defineProperty(n,"offsetWidth",{get:()=>this.width}),Object.defineProperty(n,"clientWidth",{get:()=>this.width}),Object.defineProperty(n,"offsetHeight",{get:()=>this.height}),Object.defineProperty(n,"clientHeight",{get:()=>this.height}),this.map.resize()}_update(e,t){e.mapStyle!==t.mapStyle&&this.map.setStyle(t.mapStyle);let s=e.width!==t.width||e.height!==t.height;s&&(this.width=t.width,this.height=t.height,this.map.resize());let i=e.viewState,o=t.viewState,a=o.latitude!==i.latitude||o.longitude!==i.longitude||o.zoom!==i.zoom||o.pitch!==i.pitch||o.bearing!==i.bearing;return a&&this.map.jumpTo(pb(o)),s||a}};function pb(r){return{center:[r.longitude,r.latitude],zoom:r.zoom,bearing:r.bearing??0,pitch:r.pitch??0}}var mb={position:"absolute",left:0,top:0,width:"100%",height:"100%"};function rR(r){let{container:e=document.body}=r;if(typeof e=="string"&&(e=document.getElementById(e)),!e)throw Error("Deck: container not found");window.getComputedStyle(e).position==="static"&&(e.style.position="relative");let n=document.createElement("div");e.appendChild(n),Object.assign(n.style,mb);let s=document.createElement("canvas");return e.appendChild(s),Object.assign(s.style,mb),{container:e,mapCanvas:n,deckCanvas:s}}var Mo=class extends ml{constructor(e){if(typeof document>"u")throw Error("Deck can only be used in the browser");let{mapCanvas:t,deckCanvas:n}=rR(e),s=e.viewState||e.initialViewState,i=Number.isFinite(s&&s.latitude),{map:o=globalThis.mapboxgl||globalThis.maplibregl}=e;super({canvas:n,...e}),o&&o.Map?this._map=i&&new Ul({...e,width:0,height:0,viewState:s,container:t,mapLib:o}):this._map=o}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"mapStyle"in e&&this._map&&this._map.setProps({mapStyle:e.mapStyle}),super.setProps(e)}_drawLayers(e,t){if(this._map){let n=this.getViewports()[0];n&&this._map.setProps({width:n.width,height:n.height,viewState:n})}super._drawLayers(e,t)}};globalThis.luma=globalThis.luma||{};globalThis.loaders=globalThis.loaders||{};Object.assign(globalThis.luma,Yf);Object.assign(globalThis.loaders,bh);return Tb(nR);})();
|
|
1671
1671
|
return __exports__;
|
|
1672
1672
|
});
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "deck.gl core library",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"version": "9.2.
|
|
6
|
+
"version": "9.2.10",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"gl-matrix": "^3.0.0",
|
|
59
59
|
"mjolnir.js": "^3.0.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "7527990f1bac132b5ce65026a448c6c86a9268cb"
|
|
62
62
|
}
|
|
@@ -250,7 +250,7 @@ export class OrbitState extends ViewState<OrbitState, OrbitStateProps, OrbitStat
|
|
|
250
250
|
// If startZoom state is defined, then use the startZoom state;
|
|
251
251
|
// otherwise assume discrete zooming
|
|
252
252
|
startZoom = this.getViewportProps().zoom;
|
|
253
|
-
startZoomPosition = this._unproject(startPos
|
|
253
|
+
startZoomPosition = this._unproject(startPos || pos);
|
|
254
254
|
}
|
|
255
255
|
if (!startZoomPosition) {
|
|
256
256
|
return this;
|
|
@@ -329,10 +329,13 @@ export class OrbitState extends ViewState<OrbitState, OrbitStateProps, OrbitStat
|
|
|
329
329
|
|
|
330
330
|
/* Private methods */
|
|
331
331
|
|
|
332
|
-
|
|
332
|
+
_project(pos: number[]): number[] {
|
|
333
333
|
const viewport = this.makeViewport(this.getViewportProps());
|
|
334
|
-
|
|
335
|
-
|
|
334
|
+
return viewport.project(pos);
|
|
335
|
+
}
|
|
336
|
+
_unproject(pos: number[]): number[] {
|
|
337
|
+
const viewport = this.makeViewport(this.getViewportProps());
|
|
338
|
+
return viewport.unproject(pos);
|
|
336
339
|
}
|
|
337
340
|
|
|
338
341
|
// Calculates new zoom
|
|
@@ -352,10 +355,11 @@ export class OrbitState extends ViewState<OrbitState, OrbitStateProps, OrbitStat
|
|
|
352
355
|
}
|
|
353
356
|
|
|
354
357
|
_panFromCenter(offset) {
|
|
355
|
-
const {
|
|
358
|
+
const {target} = this.getViewportProps();
|
|
359
|
+
const center = this._project(target);
|
|
356
360
|
return this.pan({
|
|
357
361
|
startPosition: target,
|
|
358
|
-
pos: [
|
|
362
|
+
pos: [center[0] + offset[0], center[1] + offset[1]]
|
|
359
363
|
});
|
|
360
364
|
}
|
|
361
365
|
|