deck.gl 9.1.11 → 9.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dist.dev.js CHANGED
@@ -23553,6 +23553,7 @@ float smoothedge(float edge, float x) {
23553
23553
  };
23554
23554
  var EVENT_HANDLERS = {
23555
23555
  click: "onClick",
23556
+ dblclick: "onClick",
23556
23557
  panstart: "onDragStart",
23557
23558
  panmove: "onDrag",
23558
23559
  panend: "onDragEnd"
@@ -29711,7 +29712,8 @@ ${props.source}` };
29711
29712
  framebuffer: outputBuffer,
29712
29713
  parameters: { viewport: [0, 0, ...texSize] },
29713
29714
  clearColor: clearCanvas ? [0, 0, 0, 0] : false,
29714
- clearDepth: 1
29715
+ clearDepth: 1,
29716
+ clearStencil: false
29715
29717
  });
29716
29718
  this.model.draw(renderPass);
29717
29719
  renderPass.end();
@@ -51271,7 +51273,7 @@ void main(void) {
51271
51273
  fontAtlasManager: new FontAtlasManager()
51272
51274
  };
51273
51275
  if (this.props.maxWidth > 0) {
51274
- log_default.warn("v8.9 breaking change: TextLayer maxWidth is now relative to text size")();
51276
+ log_default.once(1, "v8.9 breaking change: TextLayer maxWidth is now relative to text size")();
51275
51277
  }
51276
51278
  }
51277
51279
  // eslint-disable-next-line complexity
@@ -94778,7 +94780,6 @@ void main() {
94778
94780
  const _framebuffer = device.getParametersWebGL(GLEnum.FRAMEBUFFER_BINDING);
94779
94781
  deck.setProps({ _framebuffer });
94780
94782
  }
94781
- device.getDefaultCanvasContext().resize();
94782
94783
  deck.needsRedraw({ clearRedrawFlags: true });
94783
94784
  if (device instanceof WebGLDevice) {
94784
94785
  device.setParametersWebGL({
@@ -94920,7 +94921,7 @@ void main() {
94920
94921
  }
94921
94922
  deck._drawLayers("mapbox-repaint", {
94922
94923
  viewports: [currentViewport],
94923
- layerFilter: ({ layer: deckLayer }) => layer.id === deckLayer.id || deckLayer.props.operation.includes("terrain"),
94924
+ layerFilter: (params) => (!deck.props.layerFilter || deck.props.layerFilter(params)) && (layer.id === params.layer.id || params.layer.props.operation.includes("terrain")),
94924
94925
  clearStack,
94925
94926
  clearCanvas: false
94926
94927
  });
package/dist.min.js CHANGED
@@ -15,7 +15,7 @@
15
15
  } catch (error) {
16
16
  console.error(error);
17
17
  throw error;
18
- }`}function O_(e,t=!0,r){let n=r||new Set;if(e){if(h3(e))n.add(e);else if(h3(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(let s in e)O_(e[s],t,n)}}return r===void 0?Array.from(n):[]}function h3(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}var L_=()=>{},Es=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&me||typeof ra<"u"&&!me}constructor(t){let{name:r,source:n,url:s}=t;Me(n||s),this.name=r,this.source=n,this.url=s,this.onMessage=L_,this.onError=i=>console.log(i),this.worker=me?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=L_,this.onError=L_,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,r){r=r||O_(t),this.worker.postMessage(t,r)}_getErrorFromErrorEvent(t){let r="Failed to load ";return r+=`worker ${this.name} from ${this.url}. `,t.message&&(r+=`${t.message} in `),t.lineno&&(r+=`:${t.lineno}:${t.colno}`),new Error(r)}_createBrowserWorker(){this._loadableURL=c3({source:this.source,url:this.url});let t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=r=>{r.data?this.onMessage(r.data):this.onError(new Error("No data received"))},t.onerror=r=>{this.onError(this._getErrorFromErrorEvent(r)),this.terminated=!0},t.onmessageerror=r=>console.error(r),t}_createNodeWorker(){let t;if(this.url){let n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;t=new ra(n,{eval:!1})}else if(this.source)t=new ra(this.source,{eval:!0});else throw new Error("no worker");return t.on("message",r=>{this.onMessage(r)}),t.on("error",r=>{this.onError(r)}),t.on("exit",r=>{}),t}};var El=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return Es.isSupported()}constructor(t){this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},t.name!==void 0&&(this.name=t.name),t.maxConcurrency!==void 0&&(this.maxConcurrency=t.maxConcurrency),t.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=t.maxMobileConcurrency),t.reuseWorkers!==void 0&&(this.reuseWorkers=t.reuseWorkers),t.onDebug!==void 0&&(this.onDebug=t.onDebug)}async startJob(t,r=(s,i,o)=>s.done(o),n=(s,i)=>s.error(i)){let s=new Promise(i=>(this.jobQueue.push({name:t,onMessage:r,onError:n,onStart:i}),this));return this._startQueuedJob(),await s}async _startQueuedJob(){if(!this.jobQueue.length)return;let t=this._getAvailableWorker();if(!t)return;let r=this.jobQueue.shift();if(r){this.onDebug({message:"Starting job",name:r.name,workerThread:t,backlog:this.jobQueue.length});let n=new Ml(r.name,t);t.onMessage=s=>r.onMessage(n,s.type,s.payload),t.onError=s=>r.onError(n,s),r.onStart(n);try{await n.result}catch(s){console.error(`Worker exception: ${s}`)}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){!me||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let t=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new Es({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return a3?this.maxMobileConcurrency:this.maxConcurrency}};var xz={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Ri=class{props;workerPools=new Map;static isSupported(){return Es.isSupported()}static getWorkerFarm(t={}){return Ri._workerFarm=Ri._workerFarm||new Ri({}),Ri._workerFarm.setProps(t),Ri._workerFarm}constructor(t){this.props={...xz},this.setProps(t),this.workerPools=new Map}destroy(){for(let t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(let r of this.workerPools.values())r.setProps(this._getWorkerPoolProps())}getWorkerPool(t){let{name:r,source:n,url:s}=t,i=this.workerPools.get(r);return i||(i=new El({name:r,source:n,url:s}),i.setProps(this._getWorkerPoolProps()),this.workerPools.set(r,i)),i}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},bs=Ri;W(bs,"_workerFarm");function N_(e,t={}){let r=t[e.id]||{},n=me?`${e.id}-worker.js`:`${e.id}-worker-node.js`,s=r.workerUrl;if(!s&&e.id==="compression"&&(s=t.workerUrl),t._workerType==="test"&&(me?s=`modules/${e.module}/dist/${n}`:s=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!s){let i=e.version;i==="latest"&&(i=i3);let o=i?`@${i}`:"";s=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${n}`}return Me(s),s}function B_(e,t=Al){Me(e,"no worker provided");let r=e.version;return!(!t||!r)}var F_={};async function an(e,t=null,r={},n=null){return t&&(e=f3(e,t,r,n)),F_[e]=F_[e]||yz(e),await F_[e]}function f3(e,t,r={},n=null){if(!r.useLocalLibraries&&e.startsWith("http"))return e;n=n||e;let s=r.modules||{};return s[n]?s[n]:me?r.CDN?(Me(r.CDN.startsWith("http")),`${r.CDN}/${t}@${Al}/dist/libs/${n}`):Tl?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function yz(e){if(e.endsWith("wasm"))return await Tz(e);if(!me)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(e)}catch(r){return console.error(r),null}if(Tl)return importScripts(e);let t=await Mz(e);return Az(t,e)}function Az(e,t){if(!me){let{requireFromString:n}=globalThis.loaders||{};return n?.(e,t)}if(Tl)return eval.call(globalThis,e),null;let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function Tz(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};return me||!t||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await t(e)}async function Mz(e){let{readFileAsText:t}=globalThis.loaders||{};return me||!t||e.startsWith("http")?await(await fetch(e)).text():await t(e)}function D_(e,t){return!bs.isSupported()||!me&&!t?._nodeWorkers?!1:e.worker&&t?.worker}async function k_(e,t,r,n,s){let i=e.id,o=N_(e,r),c=bs.getWorkerFarm(r).getWorkerPool({name:i,url:o});r=JSON.parse(JSON.stringify(r)),n=JSON.parse(JSON.stringify(n||{}));let l=await c.startJob("process-on-worker",Ez.bind(null,s));return l.postMessage("process",{input:t,options:r,context:n}),await(await l.result).result}async function Ez(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":let{id:s,input:i,options:o}=n;try{let a=await e(i,o);t.postMessage("done",{id:s,result:a})}catch(a){let c=a instanceof Error?a.message:"unknown error";t.postMessage("error",{id:s,error:c})}break;default:console.warn(`parse-with-worker unknown message ${r}`)}}function d3(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?u3(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?u3(e,0,t):""}function u3(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),s="";for(let i=0;i<r;i++)s+=String.fromCharCode(n.getUint8(t+i));return s}function U_(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${d3(e)}"`)}}function z_(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let n=new Uint8Array(e),s=new Uint8Array(t);for(let i=0;i<n.length;++i)if(n[i]!==s[i])return!1;return!0}function V_(...e){return p3(e)}function p3(e){let t=e.map(i=>i instanceof ArrayBuffer?new Uint8Array(i):i),r=t.reduce((i,o)=>i+o.byteLength,0),n=new Uint8Array(r),s=0;for(let i of t)n.set(i,s),s+=i.byteLength;return n.buffer}function bl(...e){let t=e,r=t&&t.length>1&&t[0].constructor||null;if(!r)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');let n=t.reduce((o,a)=>o+a.length,0),s=new r(n),i=0;for(let o of t)s.set(o,i),i+=o.length;return s}function Ii(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function Ss(e,t){return nt(e>=0),nt(t>0),e+(t-1)&~(t-1)}function H_(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let s=e.byteOffset,i=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,s,i)}return t.set(n,r),r+Ss(n.byteLength,4)}async function W_(e){let t=[];for await(let r of e)t.push(r);return V_(...t)}function Sl(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var Oi=class{constructor(t,r){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Sl(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Sl()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var we=class{constructor(t){this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t,r="count"){return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(t=[]){t.forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:n}=t,s=this.stats[r];return s||(t instanceof Oi?s=t:s=new Oi(r,n),this.stats[r]=s),s}};var bz="Queued Requests",Sz="Active Requests",vz="Cancelled Requests",wz="Queued Requests Ever",Cz="Active Requests Ever",Pz={id:"request-scheduler",throttleRequests:!0,maxRequests:6,debounceTime:0},vs=class{props;stats;activeRequestCount=0;requestQueue=[];requestMap=new Map;updateTimer=null;constructor(t={}){this.props={...Pz,...t},this.stats=new we({id:this.props.id}),this.stats.get(bz),this.stats.get(Sz),this.stats.get(vz),this.stats.get(wz),this.stats.get(Cz)}scheduleRequest(t,r=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);let n={handle:t,priority:0,getPriority:r},s=new Promise(i=>(n.resolve=i,n));return this.requestQueue.push(n),this.requestMap.set(t,s),this._issueNewRequests(),s}_issueRequest(t){let{handle:r,resolve:n}=t,s=!1,i=()=>{s||(s=!0,this.requestMap.delete(r),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:i}):Promise.resolve({done:i})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;let t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(t!==0){this._updateAllRequests();for(let r=0;r<t;++r){let n=this.requestQueue.shift();n&&this._issueRequest(n)}}}_updateAllRequests(){let t=this.requestQueue;for(let r=0;r<t.length;++r){let n=t[r];this._updateRequest(n)||(t.splice(r,1),this.requestMap.delete(n.handle),r--)}t.sort((r,n)=>r.priority-n.priority)}_updateRequest(t){return t.priority=t.getPriority(t.handle),t.priority<0?(t.resolve(null),!1):!0}};var Rz="",m3={};function G_(e){for(let t in m3)if(e.startsWith(t)){let r=m3[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${Rz}${e}`),e}function g3(e){return e&&typeof e=="object"&&e.isBuffer}function bd(e){if(g3(e))return e;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}var or={};Nt(or,{dirname:()=>Oz,filename:()=>Iz,join:()=>Lz,resolve:()=>Nz});function _3(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function Iz(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function Oz(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function Lz(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function Nz(...e){let t=[];for(let i=0;i<e.length;i++)t[i]=e[i];let r="",n=!1,s;for(let i=t.length-1;i>=-1&&!n;i--){let o;i>=0?o=t[i]:(s===void 0&&(s=_3()),o=s),o.length!==0&&(r=`${o}/${r}`,n=o.charCodeAt(0)===vl)}return r=Bz(r,!n),n?`/${r}`:r.length>0?r:"."}var vl=47,j_=46;function Bz(e,t){let r="",n=-1,s=0,i,o=!1;for(let a=0;a<=e.length;++a){if(a<e.length)i=e.charCodeAt(a);else{if(i===vl)break;i=vl}if(i===vl){if(!(n===a-1||s===1))if(n!==a-1&&s===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==j_||r.charCodeAt(r.length-2)!==j_){if(r.length>2){let c=r.length-1,l=c;for(;l>=0&&r.charCodeAt(l)!==vl;--l);if(l!==c){r=l===-1?"":r.slice(0,l),n=a,s=0,o=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,s=0,o=!1;continue}}t&&(r.length>0?r+="/..":r="..",o=!0)}else{let c=e.slice(n+1,a);r.length>0?r+=`/${c}`:r=c,o=!1}n=a,s=0}else i===j_&&s!==-1?++s:s=-1}return r}var Sd=class{fetch;loadOptions;_needsRefresh=!0;props;constructor(t){this.props={...t},this.loadOptions={...t.loadOptions},this.fetch=Fz(this.loadOptions)}setProps(t){this.props=Object.assign(this.props,t),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(t=!0){let r=this._needsRefresh;return t&&(this._needsRefresh=!1),r}};function Fz(e){let t=e?.fetch;if(t&&typeof t=="function")return(n,s)=>t(n,s);let r=e?.fetch;return r&&typeof r!="function"?n=>fetch(n,r):n=>fetch(n)}var mr=class extends Sd{};W(mr,"type","template"),W(mr,"testURL",t=>!1);var Dz=e=>typeof e=="boolean",wl=e=>typeof e=="function",Li=e=>e!==null&&typeof e=="object",q_=e=>Li(e)&&e.constructor==={}.constructor;var x3=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",y3=e=>e&&typeof e[Symbol.asyncIterator]=="function";var gr=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var _r=e=>typeof Blob<"u"&&e instanceof Blob,A3=e=>e&&typeof e=="object"&&e.isBuffer;var kz=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||Li(e)&&wl(e.tee)&&wl(e.cancel)&&wl(e.getReader);var Uz=e=>Li(e)&&wl(e.read)&&wl(e.pipe)&&Dz(e.readable),vd=e=>kz(e)||Uz(e);var wd=class extends Error{constructor(t,r){super(t),this.reason=r.reason,this.url=r.url,this.response=r.response}reason;url;response};var zz=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Vz=/^([-\w.]+\/[-\w.+]+)/;function Y_(e,t){return e.toLowerCase()===t.toLowerCase()}function T3(e){let t=Vz.exec(e);return t?t[1]:e}function X_(e){let t=zz.exec(e);return t?t[1]:""}var M3=/\?.*/;function E3(e){let t=e.match(M3);return t&&t[0]}function na(e){return e.replace(M3,"")}function b3(e){if(e.length<50)return e;let t=e.slice(e.length-15);return`${e.substr(0,32)}...${t}`}function Ni(e){return gr(e)?e.url:_r(e)?e.name||"":typeof e=="string"?e:""}function Cl(e){if(gr(e)){let t=e,r=t.headers.get("content-type")||"",n=na(t.url);return T3(r)||X_(n)}return _r(e)?e.type||"":typeof e=="string"?X_(e):""}function S3(e){return gr(e)?e.headers["content-length"]||-1:_r(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function Cd(e){if(gr(e))return e;let t={},r=S3(e);r>=0&&(t["content-length"]=String(r));let n=Ni(e),s=Cl(e);s&&(t["content-type"]=s);let i=await Wz(e);i&&(t["x-first-bytes"]=i),typeof e=="string"&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:n}),o}async function v3(e){if(!e.ok)throw await Hz(e)}async function Hz(e){let t=b3(e.url),r=`Failed to fetch resource (${e.status}) ${e.statusText}: ${t}`;r=r.length>100?`${r.slice(0,100)}...`:r;let n={reason:e.statusText,url:e.url,response:e};try{let s=e.headers.get("Content-Type");n.reason=s?.includes("application/json")?await e.json():e.text()}catch{}return new wd(r,n)}async function Wz(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(n=>{let s=new FileReader;s.onload=i=>n(i?.target?.result),s.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${Gz(r)}`}return null}function Gz(e){let t="",r=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function jz(e){return!qz(e)&&!Yz(e)}function qz(e){return e.startsWith("http:")||e.startsWith("https:")}function Yz(e){return e.startsWith("data:")}async function sa(e,t){if(typeof e=="string"){let r=G_(e);return jz(r)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(r,t):await fetch(r,t)}return await Cd(e)}var $_=new Ke({id:"loaders.gl"}),Pd=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},Rd=class{console;constructor(){this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}};var K_={fetch:null,mimeType:void 0,nothrow:!1,log:new Rd,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:kn,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},w3={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 Z_(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function J_(){let e=Z_();return e.globalOptions=e.globalOptions||{...K_},e.globalOptions}function R3(e,t,r,n){return r=r||[],r=Array.isArray(r)?r:[r],Xz(e,r),Kz(t,e,n)}function Xz(e,t){C3(e,null,K_,w3,t);for(let r of t){let n=e&&e[r.id]||{},s=r.options&&r.options[r.id]||{},i=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};C3(n,r.id,s,i,t)}}function C3(e,t,r,n,s){let i=t||"Top level",o=t?`${t}.`:"";for(let a in e){let c=!t&&Li(e[a]),l=a==="baseUri"&&!t,h=a==="workerUrl"&&t;if(!(a in r)&&!l&&!h){if(a in n)$_.warn(`${i} loader option '${o}${a}' no longer supported, use '${n[a]}'`)();else if(!c){let f=$z(a,s);$_.warn(`${i} loader option '${o}${a}' not recognized. ${f}`)()}}}}function $z(e,t){let r=e.toLowerCase(),n="";for(let s of t)for(let i in s.options){if(e===i)return`Did you mean '${s.id}.${i}'?`;let o=i.toLowerCase();(r.startsWith(o)||o.startsWith(r))&&(n=n||`Did you mean '${s.id}.${i}'?`)}return n}function Kz(e,t,r){let s={...e.options||{}};return Zz(s,r),s.log===null&&(s.log=new Pd),P3(s,J_()),P3(s,t),s}function P3(e,t){for(let r in t)if(r in t){let n=t[r];q_(n)&&q_(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function Zz(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function Pl(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e?.extensions)):!1}function Rl(e){nt(e,"null loader"),nt(Pl(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e?.parseTextSync||e?.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var I3=()=>{let e=Z_();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function Il(e){let t=I3();e=Array.isArray(e)?e:[e];for(let r of e){let n=Rl(r);t.find(s=>n===s)||t.unshift(n)}}function O3(){return I3()}var L3=new Ke({id:"loaders.gl"});var Jz=/\.([^.]+)$/;async function F3(e,t=[],r,n){if(!D3(e))return null;let s=N3(e,t,{...r,nothrow:!0},n);if(s)return s;if(_r(e)&&(e=await e.slice(0,10).arrayBuffer(),s=N3(e,t,r,n)),!s&&!r?.nothrow)throw new Error(k3(e));return s}function N3(e,t=[],r,n){if(!D3(e))return null;if(t&&!Array.isArray(t))return Rl(t);let s=[];t&&(s=s.concat(t)),r?.ignoreRegisteredLoaders||s.push(...O3()),tV(s);let i=Qz(e,s,r,n);if(!i&&!r?.nothrow)throw new Error(k3(e));return i}function Qz(e,t,r,n){let s=Ni(e),i=Cl(e),o=na(s)||n?.url,a=null,c="";return r?.mimeType&&(a=Q_(t,r?.mimeType),c=`match forced by supplied MIME type ${r?.mimeType}`),a=a||eV(t,o),c=c||(a?`matched url ${o}`:""),a=a||Q_(t,i),c=c||(a?`matched MIME type ${i}`:""),a=a||nV(t,e),c=c||(a?`matched initial data ${U3(e)}`:""),r?.fallbackMimeType&&(a=a||Q_(t,r?.fallbackMimeType),c=c||(a?`matched fallback MIME type ${i}`:"")),c&&L3.log(1,`selectLoader selected ${a?.name}: ${c}.`),a}function D3(e){return!(e instanceof Response&&e.status===204)}function k3(e){let t=Ni(e),r=Cl(e),n="No valid loader found (";n+=t?`${or.filename(t)}, `:"no url provided, ",n+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let s=e?U3(e):"";return n+=s?` first bytes: "${s}"`:"first bytes: not available",n+=")",n}function tV(e){for(let t of e)Rl(t)}function eV(e,t){let r=t&&Jz.exec(t),n=r&&r[1];return n?rV(e,n):null}function rV(e,t){t=t.toLowerCase();for(let r of e)for(let n of r.extensions)if(n.toLowerCase()===t)return r;return null}function Q_(e,t){for(let r of e)if(r.mimeTypes?.some(n=>Y_(t,n))||Y_(t,`application/x.${r.id}`))return r;return null}function nV(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(sV(t,r))return r}else if(ArrayBuffer.isView(t)){if(B3(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&B3(t,0,r))return r;return null}function sV(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(n=>e.startsWith(n))}function B3(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(s=>iV(e,t,r,s))}function iV(e,t,r,n){if(n instanceof ArrayBuffer)return z_(n,e,n.byteLength);switch(typeof n){case"function":return n(e);case"string":let s=tx(e,t,n.length);return n===s;default:return!1}}function U3(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?tx(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?tx(e,0,t):""}function tx(e,t,r){if(e.byteLength<t+r)return"";let n=new DataView(e),s="";for(let i=0;i<r;i++)s+=String.fromCharCode(n.getUint8(t+i));return s}function*z3(e,t){let r=t?.chunkSize||262144,n=0,s=new TextEncoder;for(;n<e.length;){let i=Math.min(e.length-n,r),o=e.slice(n,n+i);n+=i,yield s.encode(o)}}function*V3(e,t={}){let{chunkSize:r=262144}=t,n=0;for(;n<e.byteLength;){let s=Math.min(e.byteLength-n,r),i=new ArrayBuffer(s),o=new Uint8Array(e,n,s);new Uint8Array(i).set(o),n+=s,yield i}}async function*H3(e,t){let r=t?.chunkSize||1048576,n=0;for(;n<e.size;){let s=n+r,i=await e.slice(n,s).arrayBuffer();n=s,yield i}}function ex(e,t){return kn?oV(e,t):aV(e,t)}async function*oV(e,t){let r=e.getReader(),n;try{for(;;){let s=n||r.read();t?._streamReadAhead&&(n=r.read());let{done:i,value:o}=await s;if(i)return;yield bd(o)}}catch{r.releaseLock()}}async function*aV(e,t){for await(let r of e)yield bd(r)}function W3(e,t){if(typeof e=="string")return z3(e,t);if(e instanceof ArrayBuffer)return V3(e,t);if(_r(e))return H3(e,t);if(vd(e))return ex(e,t);if(gr(e))return ex(e.body,t);throw new Error("makeIterator")}var G3="Cannot convert supplied data type";function cV(e,t,r){if(t.text&&typeof e=="string")return e;if(A3(e)&&(e=e.buffer),e instanceof ArrayBuffer){let n=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let n=e.buffer,s=e.byteLength||e.length;return(e.byteOffset!==0||s!==n.byteLength)&&(n=n.slice(e.byteOffset,e.byteOffset+s)),n}throw new Error(G3)}async function j3(e,t,r){let n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||n)return cV(e,t,r);if(_r(e)&&(e=await Cd(e)),gr(e)){let s=e;return await v3(s),t.binary?await s.arrayBuffer():await s.text()}if(vd(e)&&(e=W3(e,r)),x3(e)||y3(e))return W_(e);throw new Error(G3)}function Id(e,t){let r=J_(),n=e||r;return typeof n.fetch=="function"?n.fetch:Li(n.fetch)?s=>sa(s,n.fetch):t?.fetch?t?.fetch:sa}function q3(e,t,r){if(r)return r;let n={fetch:Id(t,e),...e};if(n.url){let s=na(n.url);n.baseUrl=s,n.queryString=E3(n.url),n.filename=or.filename(s),n.baseUrl=or.dirname(s)}return Array.isArray(n.loaders)||(n.loaders=null),n}function Y3(e,t){if(e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let n=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...n]:n}return r&&r.length?r:void 0}async function ws(e,t,r,n){t&&!Array.isArray(t)&&!Pl(t)&&(n=void 0,r=t,t=void 0),e=await e,r=r||{};let s=Ni(e),o=Y3(t,n),a=await F3(e,o,r);return a?(r=R3(r,a,o,s),n=q3({url:s,_parse:ws,loaders:o},r,n||null),await lV(a,e,r,n)):null}async function lV(e,t,r,n){if(B_(e),r=yl(e.options,r),gr(t)){let i=t,{ok:o,redirected:a,status:c,statusText:l,type:h,url:f}=i,u=Object.fromEntries(i.headers.entries());n.response={headers:u,ok:o,redirected:a,status:c,statusText:l,type:h,url:f}}t=await j3(t,e,r);let s=e;if(s.parseTextSync&&typeof t=="string")return s.parseTextSync(t,r,n);if(D_(e,r))return await k_(e,t,r,n,ws);if(s.parseText&&typeof t=="string")return await s.parseText(t,r,n);if(s.parse)return await s.parse(t,r,n);throw Me(!s.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function X3(e){switch(e.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function Un(e){let t=1/0,r=1/0,n=1/0,s=-1/0,i=-1/0,o=-1/0,a=e.POSITION?e.POSITION.value:[],c=a&&a.length;for(let l=0;l<c;l+=3){let h=a[l],f=a[l+1],u=a[l+2];t=h<t?h:t,r=f<r?f:r,n=u<n?u:n,s=h>s?h:s,i=f>i?f:i,o=u>o?u:o}return[[t,r,n],[s,i,o]]}function rx(e,t,r){let n=X3(t.value),s=r||$3(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:s}}function $3(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}async function se(e,t,r,n){let s,i;!Array.isArray(t)&&!Pl(t)?(s=[],i=t,n=void 0):(s=t,i=r);let o=Id(i),a=e;return typeof e=="string"&&(a=await o(e)),_r(e)&&(a=await o(e)),Array.isArray(s)?await ws(a,s,i):await ws(a,s,i)}var K3="4.2.1";var hV=globalThis.loaders?.parseImageNode,nx=typeof Image<"u",sx=typeof ImageBitmap<"u",fV=Boolean(hV),ix=kn?!0:fV;function Z3(e){switch(e){case"auto":return sx||nx||ix;case"imagebitmap":return sx;case"image":return nx;case"data":return ix;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function J3(){if(sx)return"imagebitmap";if(nx)return"image";if(ix)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Q3(e){let t=uV(e);if(!t)throw new Error("Not an image");return t}function Ol(e){switch(Q3(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function uV(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var dV=/^data:image\/svg\+xml/,pV=/\.svg((\?|#).*)?$/;function Od(e){return e&&(dV.test(e)||pV.test(e))}function tS(e,t){if(Od(t)){let n=new TextDecoder().decode(e);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 ox(e,t)}function ox(e,t){if(Od(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function Ld(e,t,r){let n=tS(e,r),s=self.URL||self.webkitURL,i=typeof n!="string"&&s.createObjectURL(n);try{return await mV(i||n,t)}finally{i&&s.revokeObjectURL(i)}}async function mV(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,s)=>{try{r.onload=()=>n(r),r.onerror=i=>{let o=i instanceof Error?i.message:"error";s(new Error(o))}}catch(i){s(i)}})}var gV={},eS=!0;async function rS(e,t,r){let n;Od(r)?n=await Ld(e,t,r):n=ox(e,r);let s=t&&t.imagebitmap;return await _V(n,s)}async function _V(e,t=null){if((xV(t)||!eS)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),eS=!1}return await createImageBitmap(e)}function xV(e){for(let t in e||gV)return!1;return!0}function nS(e){return!MV(e,"ftyp",4)||!(e[8]&96)?null:yV(e)}function yV(e){switch(AV(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function AV(e,t,r){return String.fromCharCode(...e.slice(t,r))}function TV(e){return[...e].map(t=>t.charCodeAt(0))}function MV(e,t,r=0){let n=TV(t);for(let s=0;s<n.length;++s)if(n[s]!==e[s+r])return!1;return!0}var cn=!1,Ll=!0;function Bi(e){let t=Nl(e);return bV(t)||wV(t)||SV(t)||vV(t)||EV(t)}function EV(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=nS(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function bV(e){let t=Nl(e);return t.byteLength>=24&&t.getUint32(0,cn)===2303741511?{mimeType:"image/png",width:t.getUint32(16,cn),height:t.getUint32(20,cn)}:null}function SV(e){let t=Nl(e);return t.byteLength>=10&&t.getUint32(0,cn)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,Ll),height:t.getUint16(8,Ll)}:null}function vV(e){let t=Nl(e);return t.byteLength>=14&&t.getUint16(0,cn)===16973&&t.getUint32(2,Ll)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,Ll),height:t.getUint32(22,Ll)}:null}function wV(e){let t=Nl(e);if(!(t.byteLength>=3&&t.getUint16(0,cn)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=CV(),i=2;for(;i+9<t.byteLength;){let o=t.getUint16(i,cn);if(s.has(o))return{mimeType:"image/jpeg",height:t.getUint16(i+5,cn),width:t.getUint16(i+7,cn)};if(!n.has(o))return null;i+=2,i+=t.getUint16(i,cn)}return null}function CV(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Nl(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function sS(e,t){let{mimeType:r}=Bi(e)||{},n=globalThis.loaders?.parseImageNode;return nt(n),await n(e,r)}async function iS(e,t,r){t=t||{};let s=(t.image||{}).type||"auto",{url:i}=r||{},o=PV(s),a;switch(o){case"imagebitmap":a=await rS(e,t,i);break;case"image":a=await Ld(e,t,i);break;case"data":a=await sS(e,t);break;default:nt(!1)}return s==="data"&&(a=Ol(a)),a}function PV(e){switch(e){case"auto":case"data":return J3();default:return Z3(e),e}}var RV=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],IV=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],OV={image:{type:"auto",decode:!0}},ln={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:K3,mimeTypes:IV,extensions:RV,parse:iS,tests:[e=>Boolean(Bi(new DataView(e)))],options:OV};var ax={};function cx(e){if(ax[e]===void 0){let t=kn?NV(e):LV(e);ax[e]=t}return ax[e]}function LV(e){let t=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||t,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(e)}function NV(e){switch(e){case"image/avif":case"image/webp":return BV(e);default:return!0}}function BV(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}var FV=new Ke({id:"deck"}),k=FV;var lx={};function Nd(e){lx=e}function jt(e,t,r,n){k.level>0&&lx[e]&&lx[e].call(null,t,r,n)}function DV(e){let t=e[0],r=e[e.length-1];return t==="{"&&r==="}"||t==="["&&r==="]"}var oS={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:DV,parseTextSync:JSON.parse};function kV(){let e="9.1.11",t=globalThis.deck&&globalThis.deck.VERSION;if(t&&t!==e)throw new Error(`deck.gl - multiple versions detected: ${t} vs ${e}`);return t||(k.log(1,`deck.gl ${e}`)(),globalThis.deck={...globalThis.deck,VERSION:e,version:e,log:k,_registerLoggers:Nd},Il([oS,[ln,{imagebitmap:{premultiplyAlpha:"none"}}]])),e}var Bd=kV();function Fd(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}var hx={number:{type:"number",validate(e,t){return Number.isFinite(e)&&typeof t=="object"&&(t.max===void 0||e<=t.max)&&(t.min===void 0||e>=t.min)}},array:{type:"array",validate(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function cS(e){let t={};for(let[r,n]of Object.entries(e))t[r]=UV(n);return t}function UV(e){let t=aS(e);if(t!=="object")return{value:e,...hx[t],type:t};if(typeof e=="object")return e?e.type!==void 0?{...e,...hx[e.type],type:e.type}:e.value===void 0?{type:"object",value:e}:(t=aS(e.value),{...e,...hx[t],type:t}):{type:"object",value:null};throw new Error("props")}function aS(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":typeof e}var lS=`#ifdef MODULE_LOGDEPTH
18
+ }`}function O_(e,t=!0,r){let n=r||new Set;if(e){if(h3(e))n.add(e);else if(h3(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(let s in e)O_(e[s],t,n)}}return r===void 0?Array.from(n):[]}function h3(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}var L_=()=>{},Es=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&me||typeof ra<"u"&&!me}constructor(t){let{name:r,source:n,url:s}=t;Me(n||s),this.name=r,this.source=n,this.url=s,this.onMessage=L_,this.onError=i=>console.log(i),this.worker=me?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=L_,this.onError=L_,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,r){r=r||O_(t),this.worker.postMessage(t,r)}_getErrorFromErrorEvent(t){let r="Failed to load ";return r+=`worker ${this.name} from ${this.url}. `,t.message&&(r+=`${t.message} in `),t.lineno&&(r+=`:${t.lineno}:${t.colno}`),new Error(r)}_createBrowserWorker(){this._loadableURL=c3({source:this.source,url:this.url});let t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=r=>{r.data?this.onMessage(r.data):this.onError(new Error("No data received"))},t.onerror=r=>{this.onError(this._getErrorFromErrorEvent(r)),this.terminated=!0},t.onmessageerror=r=>console.error(r),t}_createNodeWorker(){let t;if(this.url){let n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;t=new ra(n,{eval:!1})}else if(this.source)t=new ra(this.source,{eval:!0});else throw new Error("no worker");return t.on("message",r=>{this.onMessage(r)}),t.on("error",r=>{this.onError(r)}),t.on("exit",r=>{}),t}};var El=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return Es.isSupported()}constructor(t){this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},t.name!==void 0&&(this.name=t.name),t.maxConcurrency!==void 0&&(this.maxConcurrency=t.maxConcurrency),t.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=t.maxMobileConcurrency),t.reuseWorkers!==void 0&&(this.reuseWorkers=t.reuseWorkers),t.onDebug!==void 0&&(this.onDebug=t.onDebug)}async startJob(t,r=(s,i,o)=>s.done(o),n=(s,i)=>s.error(i)){let s=new Promise(i=>(this.jobQueue.push({name:t,onMessage:r,onError:n,onStart:i}),this));return this._startQueuedJob(),await s}async _startQueuedJob(){if(!this.jobQueue.length)return;let t=this._getAvailableWorker();if(!t)return;let r=this.jobQueue.shift();if(r){this.onDebug({message:"Starting job",name:r.name,workerThread:t,backlog:this.jobQueue.length});let n=new Ml(r.name,t);t.onMessage=s=>r.onMessage(n,s.type,s.payload),t.onError=s=>r.onError(n,s),r.onStart(n);try{await n.result}catch(s){console.error(`Worker exception: ${s}`)}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){!me||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let t=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new Es({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return a3?this.maxMobileConcurrency:this.maxConcurrency}};var xz={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Ri=class{props;workerPools=new Map;static isSupported(){return Es.isSupported()}static getWorkerFarm(t={}){return Ri._workerFarm=Ri._workerFarm||new Ri({}),Ri._workerFarm.setProps(t),Ri._workerFarm}constructor(t){this.props={...xz},this.setProps(t),this.workerPools=new Map}destroy(){for(let t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(let r of this.workerPools.values())r.setProps(this._getWorkerPoolProps())}getWorkerPool(t){let{name:r,source:n,url:s}=t,i=this.workerPools.get(r);return i||(i=new El({name:r,source:n,url:s}),i.setProps(this._getWorkerPoolProps()),this.workerPools.set(r,i)),i}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},bs=Ri;W(bs,"_workerFarm");function N_(e,t={}){let r=t[e.id]||{},n=me?`${e.id}-worker.js`:`${e.id}-worker-node.js`,s=r.workerUrl;if(!s&&e.id==="compression"&&(s=t.workerUrl),t._workerType==="test"&&(me?s=`modules/${e.module}/dist/${n}`:s=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!s){let i=e.version;i==="latest"&&(i=i3);let o=i?`@${i}`:"";s=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${n}`}return Me(s),s}function B_(e,t=Al){Me(e,"no worker provided");let r=e.version;return!(!t||!r)}var F_={};async function an(e,t=null,r={},n=null){return t&&(e=f3(e,t,r,n)),F_[e]=F_[e]||yz(e),await F_[e]}function f3(e,t,r={},n=null){if(!r.useLocalLibraries&&e.startsWith("http"))return e;n=n||e;let s=r.modules||{};return s[n]?s[n]:me?r.CDN?(Me(r.CDN.startsWith("http")),`${r.CDN}/${t}@${Al}/dist/libs/${n}`):Tl?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function yz(e){if(e.endsWith("wasm"))return await Tz(e);if(!me)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(e)}catch(r){return console.error(r),null}if(Tl)return importScripts(e);let t=await Mz(e);return Az(t,e)}function Az(e,t){if(!me){let{requireFromString:n}=globalThis.loaders||{};return n?.(e,t)}if(Tl)return eval.call(globalThis,e),null;let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function Tz(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};return me||!t||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await t(e)}async function Mz(e){let{readFileAsText:t}=globalThis.loaders||{};return me||!t||e.startsWith("http")?await(await fetch(e)).text():await t(e)}function D_(e,t){return!bs.isSupported()||!me&&!t?._nodeWorkers?!1:e.worker&&t?.worker}async function k_(e,t,r,n,s){let i=e.id,o=N_(e,r),c=bs.getWorkerFarm(r).getWorkerPool({name:i,url:o});r=JSON.parse(JSON.stringify(r)),n=JSON.parse(JSON.stringify(n||{}));let l=await c.startJob("process-on-worker",Ez.bind(null,s));return l.postMessage("process",{input:t,options:r,context:n}),await(await l.result).result}async function Ez(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":let{id:s,input:i,options:o}=n;try{let a=await e(i,o);t.postMessage("done",{id:s,result:a})}catch(a){let c=a instanceof Error?a.message:"unknown error";t.postMessage("error",{id:s,error:c})}break;default:console.warn(`parse-with-worker unknown message ${r}`)}}function d3(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?u3(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?u3(e,0,t):""}function u3(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),s="";for(let i=0;i<r;i++)s+=String.fromCharCode(n.getUint8(t+i));return s}function U_(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${d3(e)}"`)}}function z_(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let n=new Uint8Array(e),s=new Uint8Array(t);for(let i=0;i<n.length;++i)if(n[i]!==s[i])return!1;return!0}function V_(...e){return p3(e)}function p3(e){let t=e.map(i=>i instanceof ArrayBuffer?new Uint8Array(i):i),r=t.reduce((i,o)=>i+o.byteLength,0),n=new Uint8Array(r),s=0;for(let i of t)n.set(i,s),s+=i.byteLength;return n.buffer}function bl(...e){let t=e,r=t&&t.length>1&&t[0].constructor||null;if(!r)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');let n=t.reduce((o,a)=>o+a.length,0),s=new r(n),i=0;for(let o of t)s.set(o,i),i+=o.length;return s}function Ii(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function Ss(e,t){return nt(e>=0),nt(t>0),e+(t-1)&~(t-1)}function H_(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let s=e.byteOffset,i=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,s,i)}return t.set(n,r),r+Ss(n.byteLength,4)}async function W_(e){let t=[];for await(let r of e)t.push(r);return V_(...t)}function Sl(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var Oi=class{constructor(t,r){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Sl(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Sl()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var we=class{constructor(t){this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t,r="count"){return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(t=[]){t.forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:n}=t,s=this.stats[r];return s||(t instanceof Oi?s=t:s=new Oi(r,n),this.stats[r]=s),s}};var bz="Queued Requests",Sz="Active Requests",vz="Cancelled Requests",wz="Queued Requests Ever",Cz="Active Requests Ever",Pz={id:"request-scheduler",throttleRequests:!0,maxRequests:6,debounceTime:0},vs=class{props;stats;activeRequestCount=0;requestQueue=[];requestMap=new Map;updateTimer=null;constructor(t={}){this.props={...Pz,...t},this.stats=new we({id:this.props.id}),this.stats.get(bz),this.stats.get(Sz),this.stats.get(vz),this.stats.get(wz),this.stats.get(Cz)}scheduleRequest(t,r=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);let n={handle:t,priority:0,getPriority:r},s=new Promise(i=>(n.resolve=i,n));return this.requestQueue.push(n),this.requestMap.set(t,s),this._issueNewRequests(),s}_issueRequest(t){let{handle:r,resolve:n}=t,s=!1,i=()=>{s||(s=!0,this.requestMap.delete(r),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:i}):Promise.resolve({done:i})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;let t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(t!==0){this._updateAllRequests();for(let r=0;r<t;++r){let n=this.requestQueue.shift();n&&this._issueRequest(n)}}}_updateAllRequests(){let t=this.requestQueue;for(let r=0;r<t.length;++r){let n=t[r];this._updateRequest(n)||(t.splice(r,1),this.requestMap.delete(n.handle),r--)}t.sort((r,n)=>r.priority-n.priority)}_updateRequest(t){return t.priority=t.getPriority(t.handle),t.priority<0?(t.resolve(null),!1):!0}};var Rz="",m3={};function G_(e){for(let t in m3)if(e.startsWith(t)){let r=m3[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${Rz}${e}`),e}function g3(e){return e&&typeof e=="object"&&e.isBuffer}function bd(e){if(g3(e))return e;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}var or={};Nt(or,{dirname:()=>Oz,filename:()=>Iz,join:()=>Lz,resolve:()=>Nz});function _3(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function Iz(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function Oz(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function Lz(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function Nz(...e){let t=[];for(let i=0;i<e.length;i++)t[i]=e[i];let r="",n=!1,s;for(let i=t.length-1;i>=-1&&!n;i--){let o;i>=0?o=t[i]:(s===void 0&&(s=_3()),o=s),o.length!==0&&(r=`${o}/${r}`,n=o.charCodeAt(0)===vl)}return r=Bz(r,!n),n?`/${r}`:r.length>0?r:"."}var vl=47,j_=46;function Bz(e,t){let r="",n=-1,s=0,i,o=!1;for(let a=0;a<=e.length;++a){if(a<e.length)i=e.charCodeAt(a);else{if(i===vl)break;i=vl}if(i===vl){if(!(n===a-1||s===1))if(n!==a-1&&s===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==j_||r.charCodeAt(r.length-2)!==j_){if(r.length>2){let c=r.length-1,l=c;for(;l>=0&&r.charCodeAt(l)!==vl;--l);if(l!==c){r=l===-1?"":r.slice(0,l),n=a,s=0,o=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,s=0,o=!1;continue}}t&&(r.length>0?r+="/..":r="..",o=!0)}else{let c=e.slice(n+1,a);r.length>0?r+=`/${c}`:r=c,o=!1}n=a,s=0}else i===j_&&s!==-1?++s:s=-1}return r}var Sd=class{fetch;loadOptions;_needsRefresh=!0;props;constructor(t){this.props={...t},this.loadOptions={...t.loadOptions},this.fetch=Fz(this.loadOptions)}setProps(t){this.props=Object.assign(this.props,t),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(t=!0){let r=this._needsRefresh;return t&&(this._needsRefresh=!1),r}};function Fz(e){let t=e?.fetch;if(t&&typeof t=="function")return(n,s)=>t(n,s);let r=e?.fetch;return r&&typeof r!="function"?n=>fetch(n,r):n=>fetch(n)}var mr=class extends Sd{};W(mr,"type","template"),W(mr,"testURL",t=>!1);var Dz=e=>typeof e=="boolean",wl=e=>typeof e=="function",Li=e=>e!==null&&typeof e=="object",q_=e=>Li(e)&&e.constructor==={}.constructor;var x3=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",y3=e=>e&&typeof e[Symbol.asyncIterator]=="function";var gr=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var _r=e=>typeof Blob<"u"&&e instanceof Blob,A3=e=>e&&typeof e=="object"&&e.isBuffer;var kz=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||Li(e)&&wl(e.tee)&&wl(e.cancel)&&wl(e.getReader);var Uz=e=>Li(e)&&wl(e.read)&&wl(e.pipe)&&Dz(e.readable),vd=e=>kz(e)||Uz(e);var wd=class extends Error{constructor(t,r){super(t),this.reason=r.reason,this.url=r.url,this.response=r.response}reason;url;response};var zz=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Vz=/^([-\w.]+\/[-\w.+]+)/;function Y_(e,t){return e.toLowerCase()===t.toLowerCase()}function T3(e){let t=Vz.exec(e);return t?t[1]:e}function X_(e){let t=zz.exec(e);return t?t[1]:""}var M3=/\?.*/;function E3(e){let t=e.match(M3);return t&&t[0]}function na(e){return e.replace(M3,"")}function b3(e){if(e.length<50)return e;let t=e.slice(e.length-15);return`${e.substr(0,32)}...${t}`}function Ni(e){return gr(e)?e.url:_r(e)?e.name||"":typeof e=="string"?e:""}function Cl(e){if(gr(e)){let t=e,r=t.headers.get("content-type")||"",n=na(t.url);return T3(r)||X_(n)}return _r(e)?e.type||"":typeof e=="string"?X_(e):""}function S3(e){return gr(e)?e.headers["content-length"]||-1:_r(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function Cd(e){if(gr(e))return e;let t={},r=S3(e);r>=0&&(t["content-length"]=String(r));let n=Ni(e),s=Cl(e);s&&(t["content-type"]=s);let i=await Wz(e);i&&(t["x-first-bytes"]=i),typeof e=="string"&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:n}),o}async function v3(e){if(!e.ok)throw await Hz(e)}async function Hz(e){let t=b3(e.url),r=`Failed to fetch resource (${e.status}) ${e.statusText}: ${t}`;r=r.length>100?`${r.slice(0,100)}...`:r;let n={reason:e.statusText,url:e.url,response:e};try{let s=e.headers.get("Content-Type");n.reason=s?.includes("application/json")?await e.json():e.text()}catch{}return new wd(r,n)}async function Wz(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(n=>{let s=new FileReader;s.onload=i=>n(i?.target?.result),s.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${Gz(r)}`}return null}function Gz(e){let t="",r=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function jz(e){return!qz(e)&&!Yz(e)}function qz(e){return e.startsWith("http:")||e.startsWith("https:")}function Yz(e){return e.startsWith("data:")}async function sa(e,t){if(typeof e=="string"){let r=G_(e);return jz(r)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(r,t):await fetch(r,t)}return await Cd(e)}var $_=new Ke({id:"loaders.gl"}),Pd=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},Rd=class{console;constructor(){this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}};var K_={fetch:null,mimeType:void 0,nothrow:!1,log:new Rd,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:kn,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},w3={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 Z_(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function J_(){let e=Z_();return e.globalOptions=e.globalOptions||{...K_},e.globalOptions}function R3(e,t,r,n){return r=r||[],r=Array.isArray(r)?r:[r],Xz(e,r),Kz(t,e,n)}function Xz(e,t){C3(e,null,K_,w3,t);for(let r of t){let n=e&&e[r.id]||{},s=r.options&&r.options[r.id]||{},i=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};C3(n,r.id,s,i,t)}}function C3(e,t,r,n,s){let i=t||"Top level",o=t?`${t}.`:"";for(let a in e){let c=!t&&Li(e[a]),l=a==="baseUri"&&!t,h=a==="workerUrl"&&t;if(!(a in r)&&!l&&!h){if(a in n)$_.warn(`${i} loader option '${o}${a}' no longer supported, use '${n[a]}'`)();else if(!c){let f=$z(a,s);$_.warn(`${i} loader option '${o}${a}' not recognized. ${f}`)()}}}}function $z(e,t){let r=e.toLowerCase(),n="";for(let s of t)for(let i in s.options){if(e===i)return`Did you mean '${s.id}.${i}'?`;let o=i.toLowerCase();(r.startsWith(o)||o.startsWith(r))&&(n=n||`Did you mean '${s.id}.${i}'?`)}return n}function Kz(e,t,r){let s={...e.options||{}};return Zz(s,r),s.log===null&&(s.log=new Pd),P3(s,J_()),P3(s,t),s}function P3(e,t){for(let r in t)if(r in t){let n=t[r];q_(n)&&q_(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function Zz(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function Pl(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e?.extensions)):!1}function Rl(e){nt(e,"null loader"),nt(Pl(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e?.parseTextSync||e?.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var I3=()=>{let e=Z_();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function Il(e){let t=I3();e=Array.isArray(e)?e:[e];for(let r of e){let n=Rl(r);t.find(s=>n===s)||t.unshift(n)}}function O3(){return I3()}var L3=new Ke({id:"loaders.gl"});var Jz=/\.([^.]+)$/;async function F3(e,t=[],r,n){if(!D3(e))return null;let s=N3(e,t,{...r,nothrow:!0},n);if(s)return s;if(_r(e)&&(e=await e.slice(0,10).arrayBuffer(),s=N3(e,t,r,n)),!s&&!r?.nothrow)throw new Error(k3(e));return s}function N3(e,t=[],r,n){if(!D3(e))return null;if(t&&!Array.isArray(t))return Rl(t);let s=[];t&&(s=s.concat(t)),r?.ignoreRegisteredLoaders||s.push(...O3()),tV(s);let i=Qz(e,s,r,n);if(!i&&!r?.nothrow)throw new Error(k3(e));return i}function Qz(e,t,r,n){let s=Ni(e),i=Cl(e),o=na(s)||n?.url,a=null,c="";return r?.mimeType&&(a=Q_(t,r?.mimeType),c=`match forced by supplied MIME type ${r?.mimeType}`),a=a||eV(t,o),c=c||(a?`matched url ${o}`:""),a=a||Q_(t,i),c=c||(a?`matched MIME type ${i}`:""),a=a||nV(t,e),c=c||(a?`matched initial data ${U3(e)}`:""),r?.fallbackMimeType&&(a=a||Q_(t,r?.fallbackMimeType),c=c||(a?`matched fallback MIME type ${i}`:"")),c&&L3.log(1,`selectLoader selected ${a?.name}: ${c}.`),a}function D3(e){return!(e instanceof Response&&e.status===204)}function k3(e){let t=Ni(e),r=Cl(e),n="No valid loader found (";n+=t?`${or.filename(t)}, `:"no url provided, ",n+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let s=e?U3(e):"";return n+=s?` first bytes: "${s}"`:"first bytes: not available",n+=")",n}function tV(e){for(let t of e)Rl(t)}function eV(e,t){let r=t&&Jz.exec(t),n=r&&r[1];return n?rV(e,n):null}function rV(e,t){t=t.toLowerCase();for(let r of e)for(let n of r.extensions)if(n.toLowerCase()===t)return r;return null}function Q_(e,t){for(let r of e)if(r.mimeTypes?.some(n=>Y_(t,n))||Y_(t,`application/x.${r.id}`))return r;return null}function nV(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(sV(t,r))return r}else if(ArrayBuffer.isView(t)){if(B3(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&B3(t,0,r))return r;return null}function sV(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(n=>e.startsWith(n))}function B3(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(s=>iV(e,t,r,s))}function iV(e,t,r,n){if(n instanceof ArrayBuffer)return z_(n,e,n.byteLength);switch(typeof n){case"function":return n(e);case"string":let s=tx(e,t,n.length);return n===s;default:return!1}}function U3(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?tx(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?tx(e,0,t):""}function tx(e,t,r){if(e.byteLength<t+r)return"";let n=new DataView(e),s="";for(let i=0;i<r;i++)s+=String.fromCharCode(n.getUint8(t+i));return s}function*z3(e,t){let r=t?.chunkSize||262144,n=0,s=new TextEncoder;for(;n<e.length;){let i=Math.min(e.length-n,r),o=e.slice(n,n+i);n+=i,yield s.encode(o)}}function*V3(e,t={}){let{chunkSize:r=262144}=t,n=0;for(;n<e.byteLength;){let s=Math.min(e.byteLength-n,r),i=new ArrayBuffer(s),o=new Uint8Array(e,n,s);new Uint8Array(i).set(o),n+=s,yield i}}async function*H3(e,t){let r=t?.chunkSize||1048576,n=0;for(;n<e.size;){let s=n+r,i=await e.slice(n,s).arrayBuffer();n=s,yield i}}function ex(e,t){return kn?oV(e,t):aV(e,t)}async function*oV(e,t){let r=e.getReader(),n;try{for(;;){let s=n||r.read();t?._streamReadAhead&&(n=r.read());let{done:i,value:o}=await s;if(i)return;yield bd(o)}}catch{r.releaseLock()}}async function*aV(e,t){for await(let r of e)yield bd(r)}function W3(e,t){if(typeof e=="string")return z3(e,t);if(e instanceof ArrayBuffer)return V3(e,t);if(_r(e))return H3(e,t);if(vd(e))return ex(e,t);if(gr(e))return ex(e.body,t);throw new Error("makeIterator")}var G3="Cannot convert supplied data type";function cV(e,t,r){if(t.text&&typeof e=="string")return e;if(A3(e)&&(e=e.buffer),e instanceof ArrayBuffer){let n=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let n=e.buffer,s=e.byteLength||e.length;return(e.byteOffset!==0||s!==n.byteLength)&&(n=n.slice(e.byteOffset,e.byteOffset+s)),n}throw new Error(G3)}async function j3(e,t,r){let n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||n)return cV(e,t,r);if(_r(e)&&(e=await Cd(e)),gr(e)){let s=e;return await v3(s),t.binary?await s.arrayBuffer():await s.text()}if(vd(e)&&(e=W3(e,r)),x3(e)||y3(e))return W_(e);throw new Error(G3)}function Id(e,t){let r=J_(),n=e||r;return typeof n.fetch=="function"?n.fetch:Li(n.fetch)?s=>sa(s,n.fetch):t?.fetch?t?.fetch:sa}function q3(e,t,r){if(r)return r;let n={fetch:Id(t,e),...e};if(n.url){let s=na(n.url);n.baseUrl=s,n.queryString=E3(n.url),n.filename=or.filename(s),n.baseUrl=or.dirname(s)}return Array.isArray(n.loaders)||(n.loaders=null),n}function Y3(e,t){if(e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let n=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...n]:n}return r&&r.length?r:void 0}async function ws(e,t,r,n){t&&!Array.isArray(t)&&!Pl(t)&&(n=void 0,r=t,t=void 0),e=await e,r=r||{};let s=Ni(e),o=Y3(t,n),a=await F3(e,o,r);return a?(r=R3(r,a,o,s),n=q3({url:s,_parse:ws,loaders:o},r,n||null),await lV(a,e,r,n)):null}async function lV(e,t,r,n){if(B_(e),r=yl(e.options,r),gr(t)){let i=t,{ok:o,redirected:a,status:c,statusText:l,type:h,url:f}=i,u=Object.fromEntries(i.headers.entries());n.response={headers:u,ok:o,redirected:a,status:c,statusText:l,type:h,url:f}}t=await j3(t,e,r);let s=e;if(s.parseTextSync&&typeof t=="string")return s.parseTextSync(t,r,n);if(D_(e,r))return await k_(e,t,r,n,ws);if(s.parseText&&typeof t=="string")return await s.parseText(t,r,n);if(s.parse)return await s.parse(t,r,n);throw Me(!s.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function X3(e){switch(e.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function Un(e){let t=1/0,r=1/0,n=1/0,s=-1/0,i=-1/0,o=-1/0,a=e.POSITION?e.POSITION.value:[],c=a&&a.length;for(let l=0;l<c;l+=3){let h=a[l],f=a[l+1],u=a[l+2];t=h<t?h:t,r=f<r?f:r,n=u<n?u:n,s=h>s?h:s,i=f>i?f:i,o=u>o?u:o}return[[t,r,n],[s,i,o]]}function rx(e,t,r){let n=X3(t.value),s=r||$3(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:s}}function $3(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}async function se(e,t,r,n){let s,i;!Array.isArray(t)&&!Pl(t)?(s=[],i=t,n=void 0):(s=t,i=r);let o=Id(i),a=e;return typeof e=="string"&&(a=await o(e)),_r(e)&&(a=await o(e)),Array.isArray(s)?await ws(a,s,i):await ws(a,s,i)}var K3="4.2.1";var hV=globalThis.loaders?.parseImageNode,nx=typeof Image<"u",sx=typeof ImageBitmap<"u",fV=Boolean(hV),ix=kn?!0:fV;function Z3(e){switch(e){case"auto":return sx||nx||ix;case"imagebitmap":return sx;case"image":return nx;case"data":return ix;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function J3(){if(sx)return"imagebitmap";if(nx)return"image";if(ix)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Q3(e){let t=uV(e);if(!t)throw new Error("Not an image");return t}function Ol(e){switch(Q3(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function uV(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var dV=/^data:image\/svg\+xml/,pV=/\.svg((\?|#).*)?$/;function Od(e){return e&&(dV.test(e)||pV.test(e))}function tS(e,t){if(Od(t)){let n=new TextDecoder().decode(e);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 ox(e,t)}function ox(e,t){if(Od(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function Ld(e,t,r){let n=tS(e,r),s=self.URL||self.webkitURL,i=typeof n!="string"&&s.createObjectURL(n);try{return await mV(i||n,t)}finally{i&&s.revokeObjectURL(i)}}async function mV(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,s)=>{try{r.onload=()=>n(r),r.onerror=i=>{let o=i instanceof Error?i.message:"error";s(new Error(o))}}catch(i){s(i)}})}var gV={},eS=!0;async function rS(e,t,r){let n;Od(r)?n=await Ld(e,t,r):n=ox(e,r);let s=t&&t.imagebitmap;return await _V(n,s)}async function _V(e,t=null){if((xV(t)||!eS)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),eS=!1}return await createImageBitmap(e)}function xV(e){for(let t in e||gV)return!1;return!0}function nS(e){return!MV(e,"ftyp",4)||!(e[8]&96)?null:yV(e)}function yV(e){switch(AV(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function AV(e,t,r){return String.fromCharCode(...e.slice(t,r))}function TV(e){return[...e].map(t=>t.charCodeAt(0))}function MV(e,t,r=0){let n=TV(t);for(let s=0;s<n.length;++s)if(n[s]!==e[s+r])return!1;return!0}var cn=!1,Ll=!0;function Bi(e){let t=Nl(e);return bV(t)||wV(t)||SV(t)||vV(t)||EV(t)}function EV(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=nS(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function bV(e){let t=Nl(e);return t.byteLength>=24&&t.getUint32(0,cn)===2303741511?{mimeType:"image/png",width:t.getUint32(16,cn),height:t.getUint32(20,cn)}:null}function SV(e){let t=Nl(e);return t.byteLength>=10&&t.getUint32(0,cn)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,Ll),height:t.getUint16(8,Ll)}:null}function vV(e){let t=Nl(e);return t.byteLength>=14&&t.getUint16(0,cn)===16973&&t.getUint32(2,Ll)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,Ll),height:t.getUint32(22,Ll)}:null}function wV(e){let t=Nl(e);if(!(t.byteLength>=3&&t.getUint16(0,cn)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=CV(),i=2;for(;i+9<t.byteLength;){let o=t.getUint16(i,cn);if(s.has(o))return{mimeType:"image/jpeg",height:t.getUint16(i+5,cn),width:t.getUint16(i+7,cn)};if(!n.has(o))return null;i+=2,i+=t.getUint16(i,cn)}return null}function CV(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Nl(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function sS(e,t){let{mimeType:r}=Bi(e)||{},n=globalThis.loaders?.parseImageNode;return nt(n),await n(e,r)}async function iS(e,t,r){t=t||{};let s=(t.image||{}).type||"auto",{url:i}=r||{},o=PV(s),a;switch(o){case"imagebitmap":a=await rS(e,t,i);break;case"image":a=await Ld(e,t,i);break;case"data":a=await sS(e,t);break;default:nt(!1)}return s==="data"&&(a=Ol(a)),a}function PV(e){switch(e){case"auto":case"data":return J3();default:return Z3(e),e}}var RV=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],IV=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],OV={image:{type:"auto",decode:!0}},ln={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:K3,mimeTypes:IV,extensions:RV,parse:iS,tests:[e=>Boolean(Bi(new DataView(e)))],options:OV};var ax={};function cx(e){if(ax[e]===void 0){let t=kn?NV(e):LV(e);ax[e]=t}return ax[e]}function LV(e){let t=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||t,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(e)}function NV(e){switch(e){case"image/avif":case"image/webp":return BV(e);default:return!0}}function BV(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}var FV=new Ke({id:"deck"}),k=FV;var lx={};function Nd(e){lx=e}function jt(e,t,r,n){k.level>0&&lx[e]&&lx[e].call(null,t,r,n)}function DV(e){let t=e[0],r=e[e.length-1];return t==="{"&&r==="}"||t==="["&&r==="]"}var oS={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:DV,parseTextSync:JSON.parse};function kV(){let e="9.1.13",t=globalThis.deck&&globalThis.deck.VERSION;if(t&&t!==e)throw new Error(`deck.gl - multiple versions detected: ${t} vs ${e}`);return t||(k.log(1,`deck.gl ${e}`)(),globalThis.deck={...globalThis.deck,VERSION:e,version:e,log:k,_registerLoggers:Nd},Il([oS,[ln,{imagebitmap:{premultiplyAlpha:"none"}}]])),e}var Bd=kV();function Fd(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}var hx={number:{type:"number",validate(e,t){return Number.isFinite(e)&&typeof t=="object"&&(t.max===void 0||e<=t.max)&&(t.min===void 0||e>=t.min)}},array:{type:"array",validate(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function cS(e){let t={};for(let[r,n]of Object.entries(e))t[r]=UV(n);return t}function UV(e){let t=aS(e);if(t!=="object")return{value:e,...hx[t],type:t};if(typeof e=="object")return e?e.type!==void 0?{...e,...hx[e.type],type:e.type}:e.value===void 0?{type:"object",value:e}:(t=aS(e.value),{...e,...hx[t],type:t}):{type:"object",value:null};throw new Error("props")}function aS(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":typeof e}var lS=`#ifdef MODULE_LOGDEPTH
19
19
  logdepth_adjustPosition(gl_Position);
20
20
  #endif
21
21
  `,hS=`#ifdef MODULE_MATERIAL
@@ -2097,7 +2097,7 @@ struct FragmentGeometry {
2097
2097
  float smoothedge(float edge, float x) {
2098
2098
  return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);
2099
2099
  }
2100
- `,Bp={name:"geometry",source:GG,vs:jG,fs:qG};var xt;(function(e){e[e.Start=1]="Start",e[e.Move=2]="Move",e[e.End=4]="End",e[e.Cancel=8]="Cancel"})(xt||(xt={}));var Bt;(function(e){e[e.None=0]="None",e[e.Left=1]="Left",e[e.Right=2]="Right",e[e.Up=4]="Up",e[e.Down=8]="Down",e[e.Horizontal=3]="Horizontal",e[e.Vertical=12]="Vertical",e[e.All=15]="All"})(Bt||(Bt={}));var Y;(function(e){e[e.Possible=1]="Possible",e[e.Began=2]="Began",e[e.Changed=4]="Changed",e[e.Ended=8]="Ended",e[e.Recognized=8]="Recognized",e[e.Cancelled=16]="Cancelled",e[e.Failed=32]="Failed"})(Y||(Y={}));var lw="compute",x2="auto",oh="manipulation",ji="none",ah="pan-x",ch="pan-y";function y2(e){if(e.includes(ji))return ji;let t=e.includes(ah),r=e.includes(ch);return t&&r?ji:t||r?t?ah:ch:e.includes(oh)?oh:x2}var lh=class{constructor(t,r){this.actions="",this.manager=t,this.set(r)}set(t){t===lw&&(t=this.compute()),this.manager.element&&(this.manager.element.style.touchAction=t,this.actions=t)}update(){this.set(this.manager.options.touchAction)}compute(){let t=[];for(let r of this.manager.recognizers)r.options.enable&&(t=t.concat(r.getTouchAction()));return y2(t.join(" "))}};function Ca(e){return e.trim().split(/\s+/g)}function Fp(e,t,r){if(e)for(let n of Ca(t))e.addEventListener(n,r,!1)}function Dp(e,t,r){if(e)for(let n of Ca(t))e.removeEventListener(n,r,!1)}function A2(e){return(e.ownerDocument||e).defaultView}function T2(e,t){let r=e;for(;r;){if(r===t)return!0;r=r.parentNode}return!1}function kp(e){let t=e.length;if(t===1)return{x:Math.round(e[0].clientX),y:Math.round(e[0].clientY)};let r=0,n=0,s=0;for(;s<t;)r+=e[s].clientX,n+=e[s].clientY,s++;return{x:Math.round(r/t),y:Math.round(n/t)}}function M2(e){let t=[],r=0;for(;r<e.pointers.length;)t[r]={clientX:Math.round(e.pointers[r].clientX),clientY:Math.round(e.pointers[r].clientY)},r++;return{timeStamp:Date.now(),pointers:t,center:kp(t),deltaX:e.deltaX,deltaY:e.deltaY}}function Up(e,t){let r=t.x-e.x,n=t.y-e.y;return Math.sqrt(r*r+n*n)}function E2(e,t){let r=t.clientX-e.clientX,n=t.clientY-e.clientY;return Math.sqrt(r*r+n*n)}function hw(e,t){let r=t.x-e.x,n=t.y-e.y;return Math.atan2(n,r)*180/Math.PI}function b2(e,t){let r=t.clientX-e.clientX,n=t.clientY-e.clientY;return Math.atan2(n,r)*180/Math.PI}function zp(e,t){return e===t?Bt.None:Math.abs(e)>=Math.abs(t)?e<0?Bt.Left:Bt.Right:t<0?Bt.Up:Bt.Down}function fw(e,t){let r=t.center,n=e.offsetDelta,s=e.prevDelta,i=e.prevInput;return(t.eventType===xt.Start||i?.eventType===xt.End)&&(s=e.prevDelta={x:i?.deltaX||0,y:i?.deltaY||0},n=e.offsetDelta={x:r.x,y:r.y}),{deltaX:s.x+(r.x-n.x),deltaY:s.y+(r.y-n.y)}}function Vp(e,t,r){return{x:t/e||0,y:r/e||0}}function uw(e,t){return E2(t[0],t[1])/E2(e[0],e[1])}function dw(e,t){return b2(t[1],t[0])-b2(e[1],e[0])}function pw(e,t){let r=e.lastInterval||t,n=t.timeStamp-r.timeStamp,s,i,o,a;if(t.eventType!==xt.Cancel&&(n>25||r.velocity===void 0)){let c=t.deltaX-r.deltaX,l=t.deltaY-r.deltaY,h=Vp(n,c,l);i=h.x,o=h.y,s=Math.abs(h.x)>Math.abs(h.y)?h.x:h.y,a=zp(c,l),e.lastInterval=t}else s=r.velocity,i=r.velocityX,o=r.velocityY,a=r.direction;t.velocity=s,t.velocityX=i,t.velocityY=o,t.direction=a}function mw(e,t){let{session:r}=e,{pointers:n}=t,{length:s}=n;r.firstInput||(r.firstInput=M2(t)),s>1&&!r.firstMultiple?r.firstMultiple=M2(t):s===1&&(r.firstMultiple=!1);let{firstInput:i,firstMultiple:o}=r,a=o?o.center:i.center,c=t.center=kp(n);t.timeStamp=Date.now(),t.deltaTime=t.timeStamp-i.timeStamp,t.angle=hw(a,c),t.distance=Up(a,c);let{deltaX:l,deltaY:h}=fw(r,t);t.deltaX=l,t.deltaY=h,t.offsetDirection=zp(t.deltaX,t.deltaY);let f=Vp(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=f.x,t.overallVelocityY=f.y,t.overallVelocity=Math.abs(f.x)>Math.abs(f.y)?f.x:f.y,t.scale=o?uw(o.pointers,n):1,t.rotation=o?dw(o.pointers,n):0,t.maxPointers=r.prevInput?t.pointers.length>r.prevInput.maxPointers?t.pointers.length:r.prevInput.maxPointers:t.pointers.length;let u=e.element;return T2(t.srcEvent.target,u)&&(u=t.srcEvent.target),t.target=u,pw(r,t),t}function gw(e,t,r){let n=r.pointers.length,s=r.changedPointers.length,i=t&xt.Start&&n-s===0,o=t&(xt.End|xt.Cancel)&&n-s===0;r.isFirst=Boolean(i),r.isFinal=Boolean(o),i&&(e.session={}),r.eventType=t;let a=mw(e,r);e.emit("hammer.input",a),e.recognize(a),e.session.prevInput=a}var hh=class{constructor(t){this.evEl="",this.evWin="",this.evTarget="",this.domHandler=r=>{this.manager.options.enable&&this.handler(r)},this.manager=t,this.element=t.element,this.target=t.options.inputTarget||t.element}callback(t,r){gw(this.manager,t,r)}init(){Fp(this.element,this.evEl,this.domHandler),Fp(this.target,this.evTarget,this.domHandler),Fp(A2(this.element),this.evWin,this.domHandler)}destroy(){Dp(this.element,this.evEl,this.domHandler),Dp(this.target,this.evTarget,this.domHandler),Dp(A2(this.element),this.evWin,this.domHandler)}};var XG={pointerdown:xt.Start,pointermove:xt.Move,pointerup:xt.End,pointercancel:xt.Cancel,pointerout:xt.Cancel},$G="pointerdown",KG="pointermove pointerup pointercancel",fh=class extends hh{constructor(t){super(t),this.evEl=$G,this.evWin=KG,this.store=this.manager.session.pointerEvents=[],this.init()}handler(t){let{store:r}=this,n=!1,s=XG[t.type],i=t.pointerType,o=i==="touch",a=r.findIndex(c=>c.pointerId===t.pointerId);s&xt.Start&&(t.buttons||o)?a<0&&(r.push(t),a=r.length-1):s&(xt.End|xt.Cancel)&&(n=!0),!(a<0)&&(r[a]=t,this.callback(s,{pointers:r,changedPointers:[t],eventType:s,pointerType:i,srcEvent:t}),n&&r.splice(a,1))}};var ZG=["","webkit","Moz","MS","ms","o"];function _w(e,t){let r=t[0].toUpperCase()+t.slice(1);for(let n of ZG){let s=n?n+r:t;if(s in e)return s}}var JG=1,xw=2,yw={touchAction:"compute",enable:!0,inputTarget:null,cssProps:{userSelect:"none",userDrag:"none",touchCallout:"none",tapHighlightColor:"rgba(0,0,0,0)"}},uh=class{constructor(t,r){this.options={...yw,...r,cssProps:{...yw.cssProps,...r.cssProps},inputTarget:r.inputTarget||t},this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new fh(this),this.touchAction=new lh(this,this.options.touchAction),this.toggleCssProps(!0)}set(t){return Object.assign(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this}stop(t){this.session.stopped=t?xw:JG}recognize(t){let{session:r}=this;if(r.stopped)return;this.session.prevented&&t.srcEvent.preventDefault();let n,{recognizers:s}=this,{curRecognizer:i}=r;(!i||i&&i.state&Y.Recognized)&&(i=r.curRecognizer=null);let o=0;for(;o<s.length;)n=s[o],r.stopped!==xw&&(!i||n===i||n.canRecognizeWith(i))?n.recognize(t):n.reset(),!i&&n.state&(Y.Began|Y.Changed|Y.Ended)&&(i=r.curRecognizer=n),o++}get(t){let{recognizers:r}=this;for(let n=0;n<r.length;n++)if(r[n].options.event===t)return r[n];return null}add(t){if(Array.isArray(t)){for(let n of t)this.add(n);return this}let r=this.get(t.options.event);return r&&this.remove(r),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t}remove(t){if(Array.isArray(t)){for(let n of t)this.remove(n);return this}let r=typeof t=="string"?this.get(t):t;if(r){let{recognizers:n}=this,s=n.indexOf(r);s!==-1&&(n.splice(s,1),this.touchAction.update())}return this}on(t,r){if(!t||!r)return;let{handlers:n}=this;for(let s of Ca(t))n[s]=n[s]||[],n[s].push(r)}off(t,r){if(!t)return;let{handlers:n}=this;for(let s of Ca(t))r?n[s]&&n[s].splice(n[s].indexOf(r),1):delete n[s]}emit(t,r){let n=this.handlers[t]&&this.handlers[t].slice();if(!n||!n.length)return;let s=r;s.type=t,s.preventDefault=function(){r.srcEvent.preventDefault()};let i=0;for(;i<n.length;)n[i](s),i++}destroy(){this.toggleCssProps(!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}toggleCssProps(t){let{element:r}=this;if(r){for(let[n,s]of Object.entries(this.options.cssProps)){let i=_w(r.style,n);t?(this.oldCssProps[i]=r.style[i],r.style[i]=s):r.style[i]=this.oldCssProps[i]||""}t||(this.oldCssProps={})}}};var QG=1;function Aw(){return QG++}function S2(e){return e&Y.Cancelled?"cancel":e&Y.Ended?"end":e&Y.Changed?"move":e&Y.Began?"start":""}var qn=class{constructor(t){this.options=t,this.id=Aw(),this.state=Y.Possible,this.simultaneous={},this.requireFail=[]}set(t){return Object.assign(this.options,t),this.manager.touchAction.update(),this}recognizeWith(t){if(Array.isArray(t)){for(let s of t)this.recognizeWith(s);return this}let r;if(typeof t=="string"){if(r=this.manager.get(t),!r)throw new Error(`Cannot find recognizer ${t}`)}else r=t;let{simultaneous:n}=this;return n[r.id]||(n[r.id]=r,r.recognizeWith(this)),this}dropRecognizeWith(t){if(Array.isArray(t)){for(let n of t)this.dropRecognizeWith(n);return this}let r;return typeof t=="string"?r=this.manager.get(t):r=t,r&&delete this.simultaneous[r.id],this}requireFailure(t){if(Array.isArray(t)){for(let s of t)this.requireFailure(s);return this}let r;if(typeof t=="string"){if(r=this.manager.get(t),!r)throw new Error(`Cannot find recognizer ${t}`)}else r=t;let{requireFail:n}=this;return n.indexOf(r)===-1&&(n.push(r),r.requireFailure(this)),this}dropRequireFailure(t){if(Array.isArray(t)){for(let n of t)this.dropRequireFailure(n);return this}let r;if(typeof t=="string"?r=this.manager.get(t):r=t,r){let n=this.requireFail.indexOf(r);n>-1&&this.requireFail.splice(n,1)}return this}hasRequireFailures(){return Boolean(this.requireFail.find(t=>t.options.enable))}canRecognizeWith(t){return Boolean(this.simultaneous[t.id])}emit(t){if(!t)return;let{state:r}=this;r<Y.Ended&&this.manager.emit(this.options.event+S2(r),t),this.manager.emit(this.options.event,t),t.additionalEvent&&this.manager.emit(t.additionalEvent,t),r>=Y.Ended&&this.manager.emit(this.options.event+S2(r),t)}tryEmit(t){this.canEmit()?this.emit(t):this.state=Y.Failed}canEmit(){let t=0;for(;t<this.requireFail.length;){if(!(this.requireFail[t].state&(Y.Failed|Y.Possible)))return!1;t++}return!0}recognize(t){let r={...t};if(!this.options.enable){this.reset(),this.state=Y.Failed;return}this.state&(Y.Recognized|Y.Cancelled|Y.Failed)&&(this.state=Y.Possible),this.state=this.process(r),this.state&(Y.Began|Y.Changed|Y.Ended|Y.Cancelled)&&this.tryEmit(r)}getEventNames(){return[this.options.event]}reset(){}};var Yn=class extends qn{attrTest(t){let r=this.options.pointers;return r===0||t.pointers.length===r}process(t){let{state:r}=this,{eventType:n}=t,s=r&(Y.Began|Y.Changed),i=this.attrTest(t);return s&&(n&xt.Cancel||!i)?r|Y.Cancelled:s||i?n&xt.End?r|Y.Ended:r&Y.Began?r|Y.Changed:Y.Began:Y.Failed}};var qi=class extends qn{constructor(t={}){super({enable:!0,event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10,...t}),this.pTime=null,this.pCenter=null,this._timer=null,this._input=null,this.count=0}getTouchAction(){return[oh]}process(t){let{options:r}=this,n=t.pointers.length===r.pointers,s=t.distance<r.threshold,i=t.deltaTime<r.time;if(this.reset(),t.eventType&xt.Start&&this.count===0)return this.failTimeout();if(s&&i&&n){if(t.eventType!==xt.End)return this.failTimeout();let o=this.pTime?t.timeStamp-this.pTime<r.interval:!0,a=!this.pCenter||Up(this.pCenter,t.center)<r.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,!a||!o?this.count=1:this.count+=1,this._input=t,this.count%r.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout(()=>{this.state=Y.Recognized,this.tryEmit(this._input)},r.interval),Y.Began):Y.Recognized}return Y.Failed}failTimeout(){return this._timer=setTimeout(()=>{this.state=Y.Failed},this.options.interval),Y.Failed}reset(){clearTimeout(this._timer)}emit(t){this.state===Y.Recognized&&(t.tapCount=this.count,this.manager.emit(this.options.event,t))}};var tj=["","start","move","end","cancel","up","down","left","right"],Ws=class extends Yn{constructor(t={}){super({enable:!0,pointers:1,event:"pan",threshold:10,direction:Bt.All,...t}),this.pX=null,this.pY=null}getTouchAction(){let{options:{direction:t}}=this,r=[];return t&Bt.Horizontal&&r.push(ch),t&Bt.Vertical&&r.push(ah),r}getEventNames(){return tj.map(t=>this.options.event+t)}directionTest(t){let{options:r}=this,n=!0,{distance:s}=t,{direction:i}=t,o=t.deltaX,a=t.deltaY;return i&r.direction||(r.direction&Bt.Horizontal?(i=o===0?Bt.None:o<0?Bt.Left:Bt.Right,n=o!==this.pX,s=Math.abs(t.deltaX)):(i=a===0?Bt.None:a<0?Bt.Up:Bt.Down,n=a!==this.pY,s=Math.abs(t.deltaY))),t.direction=i,n&&s>r.threshold&&Boolean(i&r.direction)}attrTest(t){return super.attrTest(t)&&(Boolean(this.state&Y.Began)||!(this.state&Y.Began)&&this.directionTest(t))}emit(t){this.pX=t.deltaX,this.pY=t.deltaY;let r=Bt[t.direction].toLowerCase();r&&(t.additionalEvent=this.options.event+r),super.emit(t)}};var ej=["","start","move","end","cancel","in","out"],Pa=class extends Yn{constructor(t={}){super({enable:!0,event:"pinch",threshold:0,pointers:2,...t})}getTouchAction(){return[ji]}getEventNames(){return ej.map(t=>this.options.event+t)}attrTest(t){return super.attrTest(t)&&(Math.abs(t.scale-1)>this.options.threshold||Boolean(this.state&Y.Began))}emit(t){if(t.scale!==1){let r=t.scale<1?"in":"out";t.additionalEvent=this.options.event+r}super.emit(t)}};var pn=class{constructor(t,r,n){this.element=t,this.callback=r,this.options=n}};var Tw=typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.toLowerCase():"",oMt=typeof window<"u"?window:global;var ij=Tw.indexOf("firefox")!==-1,Mw=4.000244140625,oj=40,aj=.25,Hp=class extends pn{constructor(t,r,n){super(t,r,{enable:!0,...n}),this.handleEvent=s=>{if(!this.options.enable)return;let i=s.deltaY;globalThis.WheelEvent&&(ij&&s.deltaMode===globalThis.WheelEvent.DOM_DELTA_PIXEL&&(i/=globalThis.devicePixelRatio),s.deltaMode===globalThis.WheelEvent.DOM_DELTA_LINE&&(i*=oj)),i!==0&&i%Mw===0&&(i=Math.floor(i/Mw)),s.shiftKey&&i&&(i=i*aj),this.callback({type:"wheel",center:{x:s.clientX,y:s.clientY},delta:-i,srcEvent:s,pointerType:"mouse",target:s.target})},t.addEventListener("wheel",this.handleEvent,{passive:!1})}destroy(){this.element.removeEventListener("wheel",this.handleEvent)}enableEventType(t,r){t==="wheel"&&(this.options.enable=r)}};var Ew=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],Wp=class extends pn{constructor(t,r,n){super(t,r,{enable:!0,...n}),this.handleEvent=i=>{this.handleOverEvent(i),this.handleOutEvent(i),this.handleEnterEvent(i),this.handleLeaveEvent(i),this.handleMoveEvent(i)},this.pressed=!1;let{enable:s}=this.options;this.enableMoveEvent=s,this.enableLeaveEvent=s,this.enableEnterEvent=s,this.enableOutEvent=s,this.enableOverEvent=s,Ew.forEach(i=>t.addEventListener(i,this.handleEvent))}destroy(){Ew.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,r){switch(t){case"pointermove":this.enableMoveEvent=r;break;case"pointerover":this.enableOverEvent=r;break;case"pointerout":this.enableOutEvent=r;break;case"pointerenter":this.enableEnterEvent=r;break;case"pointerleave":this.enableLeaveEvent=r;break;default:}}handleOverEvent(t){this.enableOverEvent&&t.type==="mouseover"&&this._emit("pointerover",t)}handleOutEvent(t){this.enableOutEvent&&t.type==="mouseout"&&this._emit("pointerout",t)}handleEnterEvent(t){this.enableEnterEvent&&t.type==="mouseenter"&&this._emit("pointerenter",t)}handleLeaveEvent(t){this.enableLeaveEvent&&t.type==="mouseleave"&&this._emit("pointerleave",t)}handleMoveEvent(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":t.buttons===0&&(this.pressed=!1),this.pressed||this._emit("pointermove",t);break;case"mouseup":this.pressed=!1;break;default:}}_emit(t,r){this.callback({type:t,center:{x:r.clientX,y:r.clientY},srcEvent:r,pointerType:"mouse",target:r.target})}};var bw=["keydown","keyup"],Gp=class extends pn{constructor(t,r,n){super(t,r,{enable:!0,tabIndex:0,...n}),this.handleEvent=s=>{let i=s.target||s.srcElement;i.tagName==="INPUT"&&i.type==="text"||i.tagName==="TEXTAREA"||(this.enableDownEvent&&s.type==="keydown"&&this.callback({type:"keydown",srcEvent:s,key:s.key,target:s.target}),this.enableUpEvent&&s.type==="keyup"&&this.callback({type:"keyup",srcEvent:s,key:s.key,target:s.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,t.tabIndex=this.options.tabIndex,t.style.outline="none",bw.forEach(s=>t.addEventListener(s,this.handleEvent))}destroy(){bw.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,r){t==="keydown"&&(this.enableDownEvent=r),t==="keyup"&&(this.enableUpEvent=r)}};var jp=class extends pn{constructor(t,r,n){super(t,r,n),this.handleEvent=s=>{this.options.enable&&this.callback({type:"contextmenu",center:{x:s.clientX,y:s.clientY},srcEvent:s,pointerType:"mouse",target:s.target})},t.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(t,r){t==="contextmenu"&&(this.options.enable=r)}};var cj={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},lj=0,hj=1,fj=2,uj=1,dj=2,pj=4;function Sw(e){let t=cj[e.srcEvent.type];if(!t)return null;let{buttons:r,button:n}=e.srcEvent,s=!1,i=!1,o=!1;return t===2?(s=Boolean(r&uj),i=Boolean(r&pj),o=Boolean(r&dj)):(s=n===lj,i=n===hj,o=n===fj),{leftButton:s,middleButton:i,rightButton:o}}function vw(e,t){let r=e.center;if(!r)return null;let n=t.getBoundingClientRect(),s=n.width/t.offsetWidth||1,i=n.height/t.offsetHeight||1,o={x:(r.x-n.left-t.clientLeft)/s,y:(r.y-n.top-t.clientTop)/i};return{center:r,offsetCenter:o}}var mj={srcElement:"root",priority:0},qp=class{constructor(t,r){this.handleEvent=n=>{if(this.isEmpty())return;let s=this._normalizeEvent(n),i=n.srcEvent.target;for(;i&&i!==s.rootElement;){if(this._emit(s,i),s.handled)return;i=i.parentNode}this._emit(s,"root")},this.eventManager=t,this.recognizerName=r,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(t,r,n,s=!1,i=!1){let{handlers:o,handlersByElement:a}=this,c={...mj,...n},l=a.get(c.srcElement);l||(l=[],a.set(c.srcElement,l));let h={type:t,handler:r,srcElement:c.srcElement,priority:c.priority};s&&(h.once=!0),i&&(h.passive=!0),o.push(h),this._active=this._active||!h.passive;let f=l.length-1;for(;f>=0&&!(l[f].priority>=h.priority);)f--;l.splice(f+1,0,h)}remove(t,r){let{handlers:n,handlersByElement:s}=this;for(let i=n.length-1;i>=0;i--){let o=n[i];if(o.type===t&&o.handler===r){n.splice(i,1);let a=s.get(o.srcElement);a.splice(a.indexOf(o),1),a.length===0&&s.delete(o.srcElement)}}this._active=n.some(i=>!i.passive)}_emit(t,r){let n=this.handlersByElement.get(r);if(n){let s=!1,i=()=>{t.handled=!0},o=()=>{t.handled=!0,s=!0},a=[];for(let c=0;c<n.length;c++){let{type:l,handler:h,once:f}=n[c];if(h({...t,type:l,stopPropagation:i,stopImmediatePropagation:o}),f&&a.push(n[c]),s)break}for(let c=0;c<a.length;c++){let{type:l,handler:h}=a[c];this.remove(l,h)}}}_normalizeEvent(t){let r=this.eventManager.getElement();return{...t,...Sw(t),...vw(t,r),preventDefault:()=>{t.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:r}}};function gj(e){if("recognizer"in e)return e;let t,r=Array.isArray(e)?[...e]:[e];if(typeof r[0]=="function"){let n=r.shift(),s=r.shift()||{};t=new n(s)}else t=r.shift();return{recognizer:t,recognizeWith:typeof r[0]=="string"?[r[0]]:r[0],requireFailure:typeof r[1]=="string"?[r[1]]:r[1]}}var dh=class{constructor(t=null,r={}){if(this._onBasicInput=n=>{this.manager.emit(n.srcEvent.type,n)},this._onOtherEvent=n=>{this.manager.emit(n.type,n)},this.options={recognizers:[],events:{},touchAction:"compute",tabIndex:0,cssProps:{},...r},this.events=new Map,this.element=t,!!t){this.manager=new uh(t,this.options);for(let n of this.options.recognizers){let{recognizer:s,recognizeWith:i,requireFailure:o}=gj(n);this.manager.add(s),i&&s.recognizeWith(i),o&&s.requireFailure(o)}this.manager.on("hammer.input",this._onBasicInput),this.wheelInput=new Hp(t,this._onOtherEvent,{enable:!1}),this.moveInput=new Wp(t,this._onOtherEvent,{enable:!1}),this.keyInput=new Gp(t,this._onOtherEvent,{enable:!1,tabIndex:r.tabIndex}),this.contextmenuInput=new jp(t,this._onOtherEvent,{enable:!1}),this.on(this.options.events)}}getElement(){return this.element}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy())}on(t,r,n){this._addEventHandler(t,r,n,!1)}once(t,r,n){this._addEventHandler(t,r,n,!0)}watch(t,r,n){this._addEventHandler(t,r,n,!1,!0)}off(t,r){this._removeEventHandler(t,r)}_toggleRecognizer(t,r){let{manager:n}=this;if(!n)return;let s=n.get(t);s&&(s.set({enable:r}),n.touchAction.update()),this.wheelInput?.enableEventType(t,r),this.moveInput?.enableEventType(t,r),this.keyInput?.enableEventType(t,r),this.contextmenuInput?.enableEventType(t,r)}_addEventHandler(t,r,n,s,i){if(typeof t!="string"){n=r;for(let[l,h]of Object.entries(t))this._addEventHandler(l,h,n,s,i);return}let{manager:o,events:a}=this;if(!o)return;let c=a.get(t);if(!c){let l=this._getRecognizerName(t)||t;c=new qp(this,l),a.set(t,c),o&&o.on(t,c.handleEvent)}c.add(t,r,n,s,i),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}_removeEventHandler(t,r){if(typeof t!="string"){for(let[i,o]of Object.entries(t))this._removeEventHandler(i,o);return}let{events:n}=this,s=n.get(t);if(s&&(s.remove(t,r),s.isEmpty())){let{recognizerName:i}=s,o=!1;for(let a of n.values())if(a.recognizerName===i&&!a.isEmpty()){o=!0;break}o||this._toggleRecognizer(i,!1)}}_getRecognizerName(t){return this.manager.recognizers.find(r=>r.getEventNames().includes(t))?.options.event}};var H={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(H,"IDENTITY",{get:()=>(k.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});var fe={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},St={common:0,meters:1,pixels:2},ph={click:"onClick",panstart:"onDragStart",panmove:"onDrag",panend:"onDragEnd"},v2={multipan:[Ws,{threshold:10,direction:Bt.Vertical,pointers:2}],pinch:[Pa,{},null,["multipan"]],pan:[Ws,{threshold:1},["pinch"],["multipan"]],dblclick:[qi,{event:"dblclick",taps:2}],click:[qi,{event:"click"},null,["dblclick"]]},ww={DRAW:"draw",MASK:"mask",TERRAIN:"terrain"};function _j(e,t){if(e===t)return!0;if(Array.isArray(e)){let r=e.length;if(!t||t.length!==r)return!1;for(let n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}return!1}function Ze(e){let t={},r;return n=>{for(let s in n)if(!_j(n[s],t[s])){r=e(n),t=n;break}return r}}var Cw=[0,0,0,0],xj=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],Pw=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],yj=[0,0,0],Rw=[0,0,0],Aj=Ze(Mj);function w2(e,t,r=Rw){r.length<3&&(r=[r[0],r[1],0]);let n=r,s,i=!0;switch(t===H.LNGLAT_OFFSETS||t===H.METER_OFFSETS?s=r:s=e.isGeospatial?[Math.fround(e.longitude),Math.fround(e.latitude),0]:null,e.projectionMode){case fe.WEB_MERCATOR:(t===H.LNGLAT||t===H.CARTESIAN)&&(s=[0,0,0],i=!1);break;case fe.WEB_MERCATOR_AUTO_OFFSET:t===H.LNGLAT?n=s:t===H.CARTESIAN&&(n=[Math.fround(e.center[0]),Math.fround(e.center[1]),0],s=e.unprojectPosition(n),n[0]-=r[0],n[1]-=r[1],n[2]-=r[2]);break;case fe.IDENTITY:n=e.position.map(Math.fround),n[2]=n[2]||0;break;case fe.GLOBE:i=!1,s=null;break;default:i=!1}return{geospatialOrigin:s,shaderCoordinateOrigin:n,offsetMode:i}}function Tj(e,t,r){let{viewMatrixUncentered:n,projectionMatrix:s}=e,{viewMatrix:i,viewProjectionMatrix:o}=e,a=Cw,c=Cw,l=e.cameraPosition,{geospatialOrigin:h,shaderCoordinateOrigin:f,offsetMode:u}=w2(e,t,r);return u&&(c=e.projectPosition(h||f),l=[l[0]-c[0],l[1]-c[1],l[2]-c[2]],c[3]=1,a=He.transformMat4([],c,o),i=n||i,o=qt.multiply([],s,i),o=qt.multiply([],o,xj)),{viewMatrix:i,viewProjectionMatrix:o,projectionCenter:a,originCommon:c,cameraPosCommon:l,shaderCoordinateOrigin:f,geospatialOrigin:h}}function Yp({viewport:e,devicePixelRatio:t=1,modelMatrix:r=null,coordinateSystem:n=H.DEFAULT,coordinateOrigin:s=Rw,autoWrapLongitude:i=!1}){n===H.DEFAULT&&(n=e.isGeospatial?H.LNGLAT:H.CARTESIAN);let o=Aj({viewport:e,devicePixelRatio:t,coordinateSystem:n,coordinateOrigin:s});return o.wrapLongitude=i,o.modelMatrix=r||Pw,o}function Mj({viewport:e,devicePixelRatio:t,coordinateSystem:r,coordinateOrigin:n}){let{projectionCenter:s,viewProjectionMatrix:i,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:c,geospatialOrigin:l}=Tj(e,r,n),h=e.getDistanceScales(),f=[e.width*t,e.height*t],u=He.transformMat4([],[0,0,-e.focalDistance,1],e.projectionMatrix)[3]||1,d={coordinateSystem:r,projectionMode:e.projectionMode,coordinateOrigin:c,commonOrigin:o.slice(0,3),center:s,pseudoMeters:Boolean(e._pseudoMeters),viewportSize:f,devicePixelRatio:t,focalDistance:u,commonUnitsPerMeter:h.unitsPerMeter,commonUnitsPerWorldUnit:h.unitsPerMeter,commonUnitsPerWorldUnit2:yj,scale:e.scale,wrapLongitude:!1,viewProjectionMatrix:i,modelMatrix:Pw,cameraPosition:a};if(l){let p=e.getDistanceScales(l);switch(r){case H.METER_OFFSETS:d.commonUnitsPerWorldUnit=p.unitsPerMeter,d.commonUnitsPerWorldUnit2=p.unitsPerMeter2;break;case H.LNGLAT:case H.LNGLAT_OFFSETS:e._pseudoMeters||(d.commonUnitsPerMeter=p.unitsPerMeter),d.commonUnitsPerWorldUnit=p.unitsPerDegree,d.commonUnitsPerWorldUnit2=p.unitsPerDegree2;break;case H.CARTESIAN:d.commonUnitsPerWorldUnit=[1,1,p.unitsPerMeter[2]],d.commonUnitsPerWorldUnit2=[0,0,p.unitsPerMeter2[2]];break;default:break}}return d}var Ej=Object.keys(H).map(e=>`const COORDINATE_SYSTEM_${e}: i32 = ${H[e]};`).join(""),bj=Object.keys(fe).map(e=>`const PROJECTION_MODE_${e}: i32 = ${fe[e]};`).join(""),Sj=Object.keys(St).map(e=>`const UNIT_${e.toUpperCase()}: i32 = ${St[e]};`).join(""),vj=`${Ej}
2100
+ `,Bp={name:"geometry",source:GG,vs:jG,fs:qG};var xt;(function(e){e[e.Start=1]="Start",e[e.Move=2]="Move",e[e.End=4]="End",e[e.Cancel=8]="Cancel"})(xt||(xt={}));var Bt;(function(e){e[e.None=0]="None",e[e.Left=1]="Left",e[e.Right=2]="Right",e[e.Up=4]="Up",e[e.Down=8]="Down",e[e.Horizontal=3]="Horizontal",e[e.Vertical=12]="Vertical",e[e.All=15]="All"})(Bt||(Bt={}));var Y;(function(e){e[e.Possible=1]="Possible",e[e.Began=2]="Began",e[e.Changed=4]="Changed",e[e.Ended=8]="Ended",e[e.Recognized=8]="Recognized",e[e.Cancelled=16]="Cancelled",e[e.Failed=32]="Failed"})(Y||(Y={}));var lw="compute",x2="auto",oh="manipulation",ji="none",ah="pan-x",ch="pan-y";function y2(e){if(e.includes(ji))return ji;let t=e.includes(ah),r=e.includes(ch);return t&&r?ji:t||r?t?ah:ch:e.includes(oh)?oh:x2}var lh=class{constructor(t,r){this.actions="",this.manager=t,this.set(r)}set(t){t===lw&&(t=this.compute()),this.manager.element&&(this.manager.element.style.touchAction=t,this.actions=t)}update(){this.set(this.manager.options.touchAction)}compute(){let t=[];for(let r of this.manager.recognizers)r.options.enable&&(t=t.concat(r.getTouchAction()));return y2(t.join(" "))}};function Ca(e){return e.trim().split(/\s+/g)}function Fp(e,t,r){if(e)for(let n of Ca(t))e.addEventListener(n,r,!1)}function Dp(e,t,r){if(e)for(let n of Ca(t))e.removeEventListener(n,r,!1)}function A2(e){return(e.ownerDocument||e).defaultView}function T2(e,t){let r=e;for(;r;){if(r===t)return!0;r=r.parentNode}return!1}function kp(e){let t=e.length;if(t===1)return{x:Math.round(e[0].clientX),y:Math.round(e[0].clientY)};let r=0,n=0,s=0;for(;s<t;)r+=e[s].clientX,n+=e[s].clientY,s++;return{x:Math.round(r/t),y:Math.round(n/t)}}function M2(e){let t=[],r=0;for(;r<e.pointers.length;)t[r]={clientX:Math.round(e.pointers[r].clientX),clientY:Math.round(e.pointers[r].clientY)},r++;return{timeStamp:Date.now(),pointers:t,center:kp(t),deltaX:e.deltaX,deltaY:e.deltaY}}function Up(e,t){let r=t.x-e.x,n=t.y-e.y;return Math.sqrt(r*r+n*n)}function E2(e,t){let r=t.clientX-e.clientX,n=t.clientY-e.clientY;return Math.sqrt(r*r+n*n)}function hw(e,t){let r=t.x-e.x,n=t.y-e.y;return Math.atan2(n,r)*180/Math.PI}function b2(e,t){let r=t.clientX-e.clientX,n=t.clientY-e.clientY;return Math.atan2(n,r)*180/Math.PI}function zp(e,t){return e===t?Bt.None:Math.abs(e)>=Math.abs(t)?e<0?Bt.Left:Bt.Right:t<0?Bt.Up:Bt.Down}function fw(e,t){let r=t.center,n=e.offsetDelta,s=e.prevDelta,i=e.prevInput;return(t.eventType===xt.Start||i?.eventType===xt.End)&&(s=e.prevDelta={x:i?.deltaX||0,y:i?.deltaY||0},n=e.offsetDelta={x:r.x,y:r.y}),{deltaX:s.x+(r.x-n.x),deltaY:s.y+(r.y-n.y)}}function Vp(e,t,r){return{x:t/e||0,y:r/e||0}}function uw(e,t){return E2(t[0],t[1])/E2(e[0],e[1])}function dw(e,t){return b2(t[1],t[0])-b2(e[1],e[0])}function pw(e,t){let r=e.lastInterval||t,n=t.timeStamp-r.timeStamp,s,i,o,a;if(t.eventType!==xt.Cancel&&(n>25||r.velocity===void 0)){let c=t.deltaX-r.deltaX,l=t.deltaY-r.deltaY,h=Vp(n,c,l);i=h.x,o=h.y,s=Math.abs(h.x)>Math.abs(h.y)?h.x:h.y,a=zp(c,l),e.lastInterval=t}else s=r.velocity,i=r.velocityX,o=r.velocityY,a=r.direction;t.velocity=s,t.velocityX=i,t.velocityY=o,t.direction=a}function mw(e,t){let{session:r}=e,{pointers:n}=t,{length:s}=n;r.firstInput||(r.firstInput=M2(t)),s>1&&!r.firstMultiple?r.firstMultiple=M2(t):s===1&&(r.firstMultiple=!1);let{firstInput:i,firstMultiple:o}=r,a=o?o.center:i.center,c=t.center=kp(n);t.timeStamp=Date.now(),t.deltaTime=t.timeStamp-i.timeStamp,t.angle=hw(a,c),t.distance=Up(a,c);let{deltaX:l,deltaY:h}=fw(r,t);t.deltaX=l,t.deltaY=h,t.offsetDirection=zp(t.deltaX,t.deltaY);let f=Vp(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=f.x,t.overallVelocityY=f.y,t.overallVelocity=Math.abs(f.x)>Math.abs(f.y)?f.x:f.y,t.scale=o?uw(o.pointers,n):1,t.rotation=o?dw(o.pointers,n):0,t.maxPointers=r.prevInput?t.pointers.length>r.prevInput.maxPointers?t.pointers.length:r.prevInput.maxPointers:t.pointers.length;let u=e.element;return T2(t.srcEvent.target,u)&&(u=t.srcEvent.target),t.target=u,pw(r,t),t}function gw(e,t,r){let n=r.pointers.length,s=r.changedPointers.length,i=t&xt.Start&&n-s===0,o=t&(xt.End|xt.Cancel)&&n-s===0;r.isFirst=Boolean(i),r.isFinal=Boolean(o),i&&(e.session={}),r.eventType=t;let a=mw(e,r);e.emit("hammer.input",a),e.recognize(a),e.session.prevInput=a}var hh=class{constructor(t){this.evEl="",this.evWin="",this.evTarget="",this.domHandler=r=>{this.manager.options.enable&&this.handler(r)},this.manager=t,this.element=t.element,this.target=t.options.inputTarget||t.element}callback(t,r){gw(this.manager,t,r)}init(){Fp(this.element,this.evEl,this.domHandler),Fp(this.target,this.evTarget,this.domHandler),Fp(A2(this.element),this.evWin,this.domHandler)}destroy(){Dp(this.element,this.evEl,this.domHandler),Dp(this.target,this.evTarget,this.domHandler),Dp(A2(this.element),this.evWin,this.domHandler)}};var XG={pointerdown:xt.Start,pointermove:xt.Move,pointerup:xt.End,pointercancel:xt.Cancel,pointerout:xt.Cancel},$G="pointerdown",KG="pointermove pointerup pointercancel",fh=class extends hh{constructor(t){super(t),this.evEl=$G,this.evWin=KG,this.store=this.manager.session.pointerEvents=[],this.init()}handler(t){let{store:r}=this,n=!1,s=XG[t.type],i=t.pointerType,o=i==="touch",a=r.findIndex(c=>c.pointerId===t.pointerId);s&xt.Start&&(t.buttons||o)?a<0&&(r.push(t),a=r.length-1):s&(xt.End|xt.Cancel)&&(n=!0),!(a<0)&&(r[a]=t,this.callback(s,{pointers:r,changedPointers:[t],eventType:s,pointerType:i,srcEvent:t}),n&&r.splice(a,1))}};var ZG=["","webkit","Moz","MS","ms","o"];function _w(e,t){let r=t[0].toUpperCase()+t.slice(1);for(let n of ZG){let s=n?n+r:t;if(s in e)return s}}var JG=1,xw=2,yw={touchAction:"compute",enable:!0,inputTarget:null,cssProps:{userSelect:"none",userDrag:"none",touchCallout:"none",tapHighlightColor:"rgba(0,0,0,0)"}},uh=class{constructor(t,r){this.options={...yw,...r,cssProps:{...yw.cssProps,...r.cssProps},inputTarget:r.inputTarget||t},this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new fh(this),this.touchAction=new lh(this,this.options.touchAction),this.toggleCssProps(!0)}set(t){return Object.assign(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this}stop(t){this.session.stopped=t?xw:JG}recognize(t){let{session:r}=this;if(r.stopped)return;this.session.prevented&&t.srcEvent.preventDefault();let n,{recognizers:s}=this,{curRecognizer:i}=r;(!i||i&&i.state&Y.Recognized)&&(i=r.curRecognizer=null);let o=0;for(;o<s.length;)n=s[o],r.stopped!==xw&&(!i||n===i||n.canRecognizeWith(i))?n.recognize(t):n.reset(),!i&&n.state&(Y.Began|Y.Changed|Y.Ended)&&(i=r.curRecognizer=n),o++}get(t){let{recognizers:r}=this;for(let n=0;n<r.length;n++)if(r[n].options.event===t)return r[n];return null}add(t){if(Array.isArray(t)){for(let n of t)this.add(n);return this}let r=this.get(t.options.event);return r&&this.remove(r),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t}remove(t){if(Array.isArray(t)){for(let n of t)this.remove(n);return this}let r=typeof t=="string"?this.get(t):t;if(r){let{recognizers:n}=this,s=n.indexOf(r);s!==-1&&(n.splice(s,1),this.touchAction.update())}return this}on(t,r){if(!t||!r)return;let{handlers:n}=this;for(let s of Ca(t))n[s]=n[s]||[],n[s].push(r)}off(t,r){if(!t)return;let{handlers:n}=this;for(let s of Ca(t))r?n[s]&&n[s].splice(n[s].indexOf(r),1):delete n[s]}emit(t,r){let n=this.handlers[t]&&this.handlers[t].slice();if(!n||!n.length)return;let s=r;s.type=t,s.preventDefault=function(){r.srcEvent.preventDefault()};let i=0;for(;i<n.length;)n[i](s),i++}destroy(){this.toggleCssProps(!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}toggleCssProps(t){let{element:r}=this;if(r){for(let[n,s]of Object.entries(this.options.cssProps)){let i=_w(r.style,n);t?(this.oldCssProps[i]=r.style[i],r.style[i]=s):r.style[i]=this.oldCssProps[i]||""}t||(this.oldCssProps={})}}};var QG=1;function Aw(){return QG++}function S2(e){return e&Y.Cancelled?"cancel":e&Y.Ended?"end":e&Y.Changed?"move":e&Y.Began?"start":""}var qn=class{constructor(t){this.options=t,this.id=Aw(),this.state=Y.Possible,this.simultaneous={},this.requireFail=[]}set(t){return Object.assign(this.options,t),this.manager.touchAction.update(),this}recognizeWith(t){if(Array.isArray(t)){for(let s of t)this.recognizeWith(s);return this}let r;if(typeof t=="string"){if(r=this.manager.get(t),!r)throw new Error(`Cannot find recognizer ${t}`)}else r=t;let{simultaneous:n}=this;return n[r.id]||(n[r.id]=r,r.recognizeWith(this)),this}dropRecognizeWith(t){if(Array.isArray(t)){for(let n of t)this.dropRecognizeWith(n);return this}let r;return typeof t=="string"?r=this.manager.get(t):r=t,r&&delete this.simultaneous[r.id],this}requireFailure(t){if(Array.isArray(t)){for(let s of t)this.requireFailure(s);return this}let r;if(typeof t=="string"){if(r=this.manager.get(t),!r)throw new Error(`Cannot find recognizer ${t}`)}else r=t;let{requireFail:n}=this;return n.indexOf(r)===-1&&(n.push(r),r.requireFailure(this)),this}dropRequireFailure(t){if(Array.isArray(t)){for(let n of t)this.dropRequireFailure(n);return this}let r;if(typeof t=="string"?r=this.manager.get(t):r=t,r){let n=this.requireFail.indexOf(r);n>-1&&this.requireFail.splice(n,1)}return this}hasRequireFailures(){return Boolean(this.requireFail.find(t=>t.options.enable))}canRecognizeWith(t){return Boolean(this.simultaneous[t.id])}emit(t){if(!t)return;let{state:r}=this;r<Y.Ended&&this.manager.emit(this.options.event+S2(r),t),this.manager.emit(this.options.event,t),t.additionalEvent&&this.manager.emit(t.additionalEvent,t),r>=Y.Ended&&this.manager.emit(this.options.event+S2(r),t)}tryEmit(t){this.canEmit()?this.emit(t):this.state=Y.Failed}canEmit(){let t=0;for(;t<this.requireFail.length;){if(!(this.requireFail[t].state&(Y.Failed|Y.Possible)))return!1;t++}return!0}recognize(t){let r={...t};if(!this.options.enable){this.reset(),this.state=Y.Failed;return}this.state&(Y.Recognized|Y.Cancelled|Y.Failed)&&(this.state=Y.Possible),this.state=this.process(r),this.state&(Y.Began|Y.Changed|Y.Ended|Y.Cancelled)&&this.tryEmit(r)}getEventNames(){return[this.options.event]}reset(){}};var Yn=class extends qn{attrTest(t){let r=this.options.pointers;return r===0||t.pointers.length===r}process(t){let{state:r}=this,{eventType:n}=t,s=r&(Y.Began|Y.Changed),i=this.attrTest(t);return s&&(n&xt.Cancel||!i)?r|Y.Cancelled:s||i?n&xt.End?r|Y.Ended:r&Y.Began?r|Y.Changed:Y.Began:Y.Failed}};var qi=class extends qn{constructor(t={}){super({enable:!0,event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10,...t}),this.pTime=null,this.pCenter=null,this._timer=null,this._input=null,this.count=0}getTouchAction(){return[oh]}process(t){let{options:r}=this,n=t.pointers.length===r.pointers,s=t.distance<r.threshold,i=t.deltaTime<r.time;if(this.reset(),t.eventType&xt.Start&&this.count===0)return this.failTimeout();if(s&&i&&n){if(t.eventType!==xt.End)return this.failTimeout();let o=this.pTime?t.timeStamp-this.pTime<r.interval:!0,a=!this.pCenter||Up(this.pCenter,t.center)<r.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,!a||!o?this.count=1:this.count+=1,this._input=t,this.count%r.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout(()=>{this.state=Y.Recognized,this.tryEmit(this._input)},r.interval),Y.Began):Y.Recognized}return Y.Failed}failTimeout(){return this._timer=setTimeout(()=>{this.state=Y.Failed},this.options.interval),Y.Failed}reset(){clearTimeout(this._timer)}emit(t){this.state===Y.Recognized&&(t.tapCount=this.count,this.manager.emit(this.options.event,t))}};var tj=["","start","move","end","cancel","up","down","left","right"],Ws=class extends Yn{constructor(t={}){super({enable:!0,pointers:1,event:"pan",threshold:10,direction:Bt.All,...t}),this.pX=null,this.pY=null}getTouchAction(){let{options:{direction:t}}=this,r=[];return t&Bt.Horizontal&&r.push(ch),t&Bt.Vertical&&r.push(ah),r}getEventNames(){return tj.map(t=>this.options.event+t)}directionTest(t){let{options:r}=this,n=!0,{distance:s}=t,{direction:i}=t,o=t.deltaX,a=t.deltaY;return i&r.direction||(r.direction&Bt.Horizontal?(i=o===0?Bt.None:o<0?Bt.Left:Bt.Right,n=o!==this.pX,s=Math.abs(t.deltaX)):(i=a===0?Bt.None:a<0?Bt.Up:Bt.Down,n=a!==this.pY,s=Math.abs(t.deltaY))),t.direction=i,n&&s>r.threshold&&Boolean(i&r.direction)}attrTest(t){return super.attrTest(t)&&(Boolean(this.state&Y.Began)||!(this.state&Y.Began)&&this.directionTest(t))}emit(t){this.pX=t.deltaX,this.pY=t.deltaY;let r=Bt[t.direction].toLowerCase();r&&(t.additionalEvent=this.options.event+r),super.emit(t)}};var ej=["","start","move","end","cancel","in","out"],Pa=class extends Yn{constructor(t={}){super({enable:!0,event:"pinch",threshold:0,pointers:2,...t})}getTouchAction(){return[ji]}getEventNames(){return ej.map(t=>this.options.event+t)}attrTest(t){return super.attrTest(t)&&(Math.abs(t.scale-1)>this.options.threshold||Boolean(this.state&Y.Began))}emit(t){if(t.scale!==1){let r=t.scale<1?"in":"out";t.additionalEvent=this.options.event+r}super.emit(t)}};var pn=class{constructor(t,r,n){this.element=t,this.callback=r,this.options=n}};var Tw=typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.toLowerCase():"",oMt=typeof window<"u"?window:global;var ij=Tw.indexOf("firefox")!==-1,Mw=4.000244140625,oj=40,aj=.25,Hp=class extends pn{constructor(t,r,n){super(t,r,{enable:!0,...n}),this.handleEvent=s=>{if(!this.options.enable)return;let i=s.deltaY;globalThis.WheelEvent&&(ij&&s.deltaMode===globalThis.WheelEvent.DOM_DELTA_PIXEL&&(i/=globalThis.devicePixelRatio),s.deltaMode===globalThis.WheelEvent.DOM_DELTA_LINE&&(i*=oj)),i!==0&&i%Mw===0&&(i=Math.floor(i/Mw)),s.shiftKey&&i&&(i=i*aj),this.callback({type:"wheel",center:{x:s.clientX,y:s.clientY},delta:-i,srcEvent:s,pointerType:"mouse",target:s.target})},t.addEventListener("wheel",this.handleEvent,{passive:!1})}destroy(){this.element.removeEventListener("wheel",this.handleEvent)}enableEventType(t,r){t==="wheel"&&(this.options.enable=r)}};var Ew=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],Wp=class extends pn{constructor(t,r,n){super(t,r,{enable:!0,...n}),this.handleEvent=i=>{this.handleOverEvent(i),this.handleOutEvent(i),this.handleEnterEvent(i),this.handleLeaveEvent(i),this.handleMoveEvent(i)},this.pressed=!1;let{enable:s}=this.options;this.enableMoveEvent=s,this.enableLeaveEvent=s,this.enableEnterEvent=s,this.enableOutEvent=s,this.enableOverEvent=s,Ew.forEach(i=>t.addEventListener(i,this.handleEvent))}destroy(){Ew.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,r){switch(t){case"pointermove":this.enableMoveEvent=r;break;case"pointerover":this.enableOverEvent=r;break;case"pointerout":this.enableOutEvent=r;break;case"pointerenter":this.enableEnterEvent=r;break;case"pointerleave":this.enableLeaveEvent=r;break;default:}}handleOverEvent(t){this.enableOverEvent&&t.type==="mouseover"&&this._emit("pointerover",t)}handleOutEvent(t){this.enableOutEvent&&t.type==="mouseout"&&this._emit("pointerout",t)}handleEnterEvent(t){this.enableEnterEvent&&t.type==="mouseenter"&&this._emit("pointerenter",t)}handleLeaveEvent(t){this.enableLeaveEvent&&t.type==="mouseleave"&&this._emit("pointerleave",t)}handleMoveEvent(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":t.buttons===0&&(this.pressed=!1),this.pressed||this._emit("pointermove",t);break;case"mouseup":this.pressed=!1;break;default:}}_emit(t,r){this.callback({type:t,center:{x:r.clientX,y:r.clientY},srcEvent:r,pointerType:"mouse",target:r.target})}};var bw=["keydown","keyup"],Gp=class extends pn{constructor(t,r,n){super(t,r,{enable:!0,tabIndex:0,...n}),this.handleEvent=s=>{let i=s.target||s.srcElement;i.tagName==="INPUT"&&i.type==="text"||i.tagName==="TEXTAREA"||(this.enableDownEvent&&s.type==="keydown"&&this.callback({type:"keydown",srcEvent:s,key:s.key,target:s.target}),this.enableUpEvent&&s.type==="keyup"&&this.callback({type:"keyup",srcEvent:s,key:s.key,target:s.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,t.tabIndex=this.options.tabIndex,t.style.outline="none",bw.forEach(s=>t.addEventListener(s,this.handleEvent))}destroy(){bw.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,r){t==="keydown"&&(this.enableDownEvent=r),t==="keyup"&&(this.enableUpEvent=r)}};var jp=class extends pn{constructor(t,r,n){super(t,r,n),this.handleEvent=s=>{this.options.enable&&this.callback({type:"contextmenu",center:{x:s.clientX,y:s.clientY},srcEvent:s,pointerType:"mouse",target:s.target})},t.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(t,r){t==="contextmenu"&&(this.options.enable=r)}};var cj={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},lj=0,hj=1,fj=2,uj=1,dj=2,pj=4;function Sw(e){let t=cj[e.srcEvent.type];if(!t)return null;let{buttons:r,button:n}=e.srcEvent,s=!1,i=!1,o=!1;return t===2?(s=Boolean(r&uj),i=Boolean(r&pj),o=Boolean(r&dj)):(s=n===lj,i=n===hj,o=n===fj),{leftButton:s,middleButton:i,rightButton:o}}function vw(e,t){let r=e.center;if(!r)return null;let n=t.getBoundingClientRect(),s=n.width/t.offsetWidth||1,i=n.height/t.offsetHeight||1,o={x:(r.x-n.left-t.clientLeft)/s,y:(r.y-n.top-t.clientTop)/i};return{center:r,offsetCenter:o}}var mj={srcElement:"root",priority:0},qp=class{constructor(t,r){this.handleEvent=n=>{if(this.isEmpty())return;let s=this._normalizeEvent(n),i=n.srcEvent.target;for(;i&&i!==s.rootElement;){if(this._emit(s,i),s.handled)return;i=i.parentNode}this._emit(s,"root")},this.eventManager=t,this.recognizerName=r,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(t,r,n,s=!1,i=!1){let{handlers:o,handlersByElement:a}=this,c={...mj,...n},l=a.get(c.srcElement);l||(l=[],a.set(c.srcElement,l));let h={type:t,handler:r,srcElement:c.srcElement,priority:c.priority};s&&(h.once=!0),i&&(h.passive=!0),o.push(h),this._active=this._active||!h.passive;let f=l.length-1;for(;f>=0&&!(l[f].priority>=h.priority);)f--;l.splice(f+1,0,h)}remove(t,r){let{handlers:n,handlersByElement:s}=this;for(let i=n.length-1;i>=0;i--){let o=n[i];if(o.type===t&&o.handler===r){n.splice(i,1);let a=s.get(o.srcElement);a.splice(a.indexOf(o),1),a.length===0&&s.delete(o.srcElement)}}this._active=n.some(i=>!i.passive)}_emit(t,r){let n=this.handlersByElement.get(r);if(n){let s=!1,i=()=>{t.handled=!0},o=()=>{t.handled=!0,s=!0},a=[];for(let c=0;c<n.length;c++){let{type:l,handler:h,once:f}=n[c];if(h({...t,type:l,stopPropagation:i,stopImmediatePropagation:o}),f&&a.push(n[c]),s)break}for(let c=0;c<a.length;c++){let{type:l,handler:h}=a[c];this.remove(l,h)}}}_normalizeEvent(t){let r=this.eventManager.getElement();return{...t,...Sw(t),...vw(t,r),preventDefault:()=>{t.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:r}}};function gj(e){if("recognizer"in e)return e;let t,r=Array.isArray(e)?[...e]:[e];if(typeof r[0]=="function"){let n=r.shift(),s=r.shift()||{};t=new n(s)}else t=r.shift();return{recognizer:t,recognizeWith:typeof r[0]=="string"?[r[0]]:r[0],requireFailure:typeof r[1]=="string"?[r[1]]:r[1]}}var dh=class{constructor(t=null,r={}){if(this._onBasicInput=n=>{this.manager.emit(n.srcEvent.type,n)},this._onOtherEvent=n=>{this.manager.emit(n.type,n)},this.options={recognizers:[],events:{},touchAction:"compute",tabIndex:0,cssProps:{},...r},this.events=new Map,this.element=t,!!t){this.manager=new uh(t,this.options);for(let n of this.options.recognizers){let{recognizer:s,recognizeWith:i,requireFailure:o}=gj(n);this.manager.add(s),i&&s.recognizeWith(i),o&&s.requireFailure(o)}this.manager.on("hammer.input",this._onBasicInput),this.wheelInput=new Hp(t,this._onOtherEvent,{enable:!1}),this.moveInput=new Wp(t,this._onOtherEvent,{enable:!1}),this.keyInput=new Gp(t,this._onOtherEvent,{enable:!1,tabIndex:r.tabIndex}),this.contextmenuInput=new jp(t,this._onOtherEvent,{enable:!1}),this.on(this.options.events)}}getElement(){return this.element}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy())}on(t,r,n){this._addEventHandler(t,r,n,!1)}once(t,r,n){this._addEventHandler(t,r,n,!0)}watch(t,r,n){this._addEventHandler(t,r,n,!1,!0)}off(t,r){this._removeEventHandler(t,r)}_toggleRecognizer(t,r){let{manager:n}=this;if(!n)return;let s=n.get(t);s&&(s.set({enable:r}),n.touchAction.update()),this.wheelInput?.enableEventType(t,r),this.moveInput?.enableEventType(t,r),this.keyInput?.enableEventType(t,r),this.contextmenuInput?.enableEventType(t,r)}_addEventHandler(t,r,n,s,i){if(typeof t!="string"){n=r;for(let[l,h]of Object.entries(t))this._addEventHandler(l,h,n,s,i);return}let{manager:o,events:a}=this;if(!o)return;let c=a.get(t);if(!c){let l=this._getRecognizerName(t)||t;c=new qp(this,l),a.set(t,c),o&&o.on(t,c.handleEvent)}c.add(t,r,n,s,i),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}_removeEventHandler(t,r){if(typeof t!="string"){for(let[i,o]of Object.entries(t))this._removeEventHandler(i,o);return}let{events:n}=this,s=n.get(t);if(s&&(s.remove(t,r),s.isEmpty())){let{recognizerName:i}=s,o=!1;for(let a of n.values())if(a.recognizerName===i&&!a.isEmpty()){o=!0;break}o||this._toggleRecognizer(i,!1)}}_getRecognizerName(t){return this.manager.recognizers.find(r=>r.getEventNames().includes(t))?.options.event}};var H={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(H,"IDENTITY",{get:()=>(k.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});var fe={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},St={common:0,meters:1,pixels:2},ph={click:"onClick",dblclick:"onClick",panstart:"onDragStart",panmove:"onDrag",panend:"onDragEnd"},v2={multipan:[Ws,{threshold:10,direction:Bt.Vertical,pointers:2}],pinch:[Pa,{},null,["multipan"]],pan:[Ws,{threshold:1},["pinch"],["multipan"]],dblclick:[qi,{event:"dblclick",taps:2}],click:[qi,{event:"click"},null,["dblclick"]]},ww={DRAW:"draw",MASK:"mask",TERRAIN:"terrain"};function _j(e,t){if(e===t)return!0;if(Array.isArray(e)){let r=e.length;if(!t||t.length!==r)return!1;for(let n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}return!1}function Ze(e){let t={},r;return n=>{for(let s in n)if(!_j(n[s],t[s])){r=e(n),t=n;break}return r}}var Cw=[0,0,0,0],xj=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],Pw=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],yj=[0,0,0],Rw=[0,0,0],Aj=Ze(Mj);function w2(e,t,r=Rw){r.length<3&&(r=[r[0],r[1],0]);let n=r,s,i=!0;switch(t===H.LNGLAT_OFFSETS||t===H.METER_OFFSETS?s=r:s=e.isGeospatial?[Math.fround(e.longitude),Math.fround(e.latitude),0]:null,e.projectionMode){case fe.WEB_MERCATOR:(t===H.LNGLAT||t===H.CARTESIAN)&&(s=[0,0,0],i=!1);break;case fe.WEB_MERCATOR_AUTO_OFFSET:t===H.LNGLAT?n=s:t===H.CARTESIAN&&(n=[Math.fround(e.center[0]),Math.fround(e.center[1]),0],s=e.unprojectPosition(n),n[0]-=r[0],n[1]-=r[1],n[2]-=r[2]);break;case fe.IDENTITY:n=e.position.map(Math.fround),n[2]=n[2]||0;break;case fe.GLOBE:i=!1,s=null;break;default:i=!1}return{geospatialOrigin:s,shaderCoordinateOrigin:n,offsetMode:i}}function Tj(e,t,r){let{viewMatrixUncentered:n,projectionMatrix:s}=e,{viewMatrix:i,viewProjectionMatrix:o}=e,a=Cw,c=Cw,l=e.cameraPosition,{geospatialOrigin:h,shaderCoordinateOrigin:f,offsetMode:u}=w2(e,t,r);return u&&(c=e.projectPosition(h||f),l=[l[0]-c[0],l[1]-c[1],l[2]-c[2]],c[3]=1,a=He.transformMat4([],c,o),i=n||i,o=qt.multiply([],s,i),o=qt.multiply([],o,xj)),{viewMatrix:i,viewProjectionMatrix:o,projectionCenter:a,originCommon:c,cameraPosCommon:l,shaderCoordinateOrigin:f,geospatialOrigin:h}}function Yp({viewport:e,devicePixelRatio:t=1,modelMatrix:r=null,coordinateSystem:n=H.DEFAULT,coordinateOrigin:s=Rw,autoWrapLongitude:i=!1}){n===H.DEFAULT&&(n=e.isGeospatial?H.LNGLAT:H.CARTESIAN);let o=Aj({viewport:e,devicePixelRatio:t,coordinateSystem:n,coordinateOrigin:s});return o.wrapLongitude=i,o.modelMatrix=r||Pw,o}function Mj({viewport:e,devicePixelRatio:t,coordinateSystem:r,coordinateOrigin:n}){let{projectionCenter:s,viewProjectionMatrix:i,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:c,geospatialOrigin:l}=Tj(e,r,n),h=e.getDistanceScales(),f=[e.width*t,e.height*t],u=He.transformMat4([],[0,0,-e.focalDistance,1],e.projectionMatrix)[3]||1,d={coordinateSystem:r,projectionMode:e.projectionMode,coordinateOrigin:c,commonOrigin:o.slice(0,3),center:s,pseudoMeters:Boolean(e._pseudoMeters),viewportSize:f,devicePixelRatio:t,focalDistance:u,commonUnitsPerMeter:h.unitsPerMeter,commonUnitsPerWorldUnit:h.unitsPerMeter,commonUnitsPerWorldUnit2:yj,scale:e.scale,wrapLongitude:!1,viewProjectionMatrix:i,modelMatrix:Pw,cameraPosition:a};if(l){let p=e.getDistanceScales(l);switch(r){case H.METER_OFFSETS:d.commonUnitsPerWorldUnit=p.unitsPerMeter,d.commonUnitsPerWorldUnit2=p.unitsPerMeter2;break;case H.LNGLAT:case H.LNGLAT_OFFSETS:e._pseudoMeters||(d.commonUnitsPerMeter=p.unitsPerMeter),d.commonUnitsPerWorldUnit=p.unitsPerDegree,d.commonUnitsPerWorldUnit2=p.unitsPerDegree2;break;case H.CARTESIAN:d.commonUnitsPerWorldUnit=[1,1,p.unitsPerMeter[2]],d.commonUnitsPerWorldUnit2=[0,0,p.unitsPerMeter2[2]];break;default:break}}return d}var Ej=Object.keys(H).map(e=>`const COORDINATE_SYSTEM_${e}: i32 = ${H[e]};`).join(""),bj=Object.keys(fe).map(e=>`const PROJECTION_MODE_${e}: i32 = ${fe[e]};`).join(""),Sj=Object.keys(St).map(e=>`const UNIT_${e.toUpperCase()}: i32 = ${St[e]};`).join(""),vj=`${Ej}
2101
2101
  ${bj}
2102
2102
  ${Sj}
2103
2103
 
@@ -2773,7 +2773,7 @@ void main(void) {
2773
2773
  ${r.source}`}),super(t,{id:r.id||Re("clip-space"),...r,vs:Z7,vertexCount:4,geometry:new it({topology:"triangle-strip",vertexCount:4,attributes:{clipSpacePositions:{size:2,value:new Float32Array(cC)},texCoords:{size:2,value:new Float32Array(n)},coordinates:{size:2,value:new Float32Array(n)}}})})}};var br=class{id;matrix=new K;display=!0;position=new D;rotation=new D;scale=new D(1,1,1);userData={};props={};constructor(t={}){let{id:r}=t;this.id=r||Re(this.constructor.name),this._setScenegraphNodeProps(t)}getBounds(){return null}destroy(){}delete(){this.destroy()}setProps(t){return this._setScenegraphNodeProps(t),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(t){return this.position=t,this}setRotation(t){return this.rotation=t,this}setScale(t){return this.scale=t,this}setMatrix(t,r=!0){r?this.matrix.copy(t):this.matrix=t}setMatrixComponents(t){let{position:r,rotation:n,scale:s,update:i=!0}=t;return r&&this.setPosition(r),n&&this.setRotation(n),s&&this.setScale(s),i&&this.updateMatrix(),this}updateMatrix(){let t=this.position,r=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(t),this.matrix.rotateXYZ(r),this.matrix.scale(n),this}update(t={}){let{position:r,rotation:n,scale:s}=t;return r&&this.setPosition(r),n&&this.setRotation(n),s&&this.setScale(s),this.updateMatrix(),this}getCoordinateUniforms(t,r){r=r||this.matrix;let n=new K(t).multiplyRight(r),s=n.invert(),i=s.transpose();return{viewMatrix:t,modelMatrix:r,objectMatrix:r,worldMatrix:n,worldInverseMatrix:s,worldInverseTransposeMatrix:i}}_setScenegraphNodeProps(t){"position"in t&&this.setPosition(t.position),"rotation"in t&&this.setRotation(t.rotation),"scale"in t&&this.setScale(t.scale),"matrix"in t&&this.setMatrix(t.matrix),Object.assign(this.props,t)}};var hr=class extends br{children;constructor(t={}){t=Array.isArray(t)?{children:t}:t;let{children:r=[]}=t;F.assert(r.every(n=>n instanceof br),"every child must an instance of ScenegraphNode"),super(t),this.children=r}getBounds(){let t=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];return this.traverse((r,{worldMatrix:n})=>{let s=r.getBounds();if(!s)return;let[i,o]=s,a=new D(i).add(o).divide([2,2,2]);n.transformAsPoint(a,a);let c=new D(o).subtract(i).divide([2,2,2]);n.transformAsVector(c,c);for(let l=0;l<8;l++){let h=new D(l&1?-1:1,l&2?-1:1,l&4?-1:1).multiply(c).add(a);for(let f=0;f<3;f++)t[0][f]=Math.min(t[0][f],h[f]),t[1][f]=Math.max(t[1][f],h[f])}}),Number.isFinite(t[0][0])?t:null}destroy(){this.children.forEach(t=>t.destroy()),this.removeAll(),super.destroy()}add(...t){for(let r of t)Array.isArray(r)?this.add(...r):this.children.push(r);return this}remove(t){let r=this.children,n=r.indexOf(t);return n>-1&&r.splice(n,1),this}removeAll(){return this.children=[],this}traverse(t,{worldMatrix:r=new K}={}){let n=new K(r).multiplyRight(this.matrix);for(let s of this.children)s instanceof hr?s.traverse(t,{worldMatrix:n}):t(s,{worldMatrix:n})}};var mn=class extends br{model;bounds=null;managedResources;constructor(t){super(t),this.model=t.model,this.managedResources=t.managedResources||[],this.bounds=t.bounds||null,this.setProps(t)}destroy(){this.model&&(this.model.destroy(),this.model=null),this.managedResources.forEach(t=>t.destroy()),this.managedResources=[]}getBounds(){return this.bounds}draw(t){return this.model.draw(t)}};var Zn=class extends it{constructor(t={}){let{id:r=Re("cube-geometry"),indices:n=!0}=t;super(n?{...t,id:r,topology:"triangle-list",indices:{size:1,value:J7},attributes:{...iq,...t.attributes}}:{...t,id:r,topology:"triangle-list",indices:void 0,attributes:{...oq,...t.attributes}})}},J7=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),Q7=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),tq=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),eq=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),rq=new Float32Array([1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,-1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,1,1,1,1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,-1,-1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1]),nq=new Float32Array([1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0]),sq=new Float32Array([1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,1,0,1,0,1]),iq={POSITION:{size:3,value:Q7},NORMAL:{size:3,value:tq},TEXCOORD_0:{size:2,value:eq}},oq={POSITION:{size:3,value:rq},TEXCOORD_0:{size:2,value:nq},COLOR_0:{size:3,value:sq}};var Ch=class extends it{constructor(t={}){let{id:r=Re("sphere-geometry")}=t,{indices:n,attributes:s}=aq(t);super({...t,id:r,topology:"triangle-list",indices:n,attributes:{...s,...t.attributes}})}};function aq(e){let{nlat:t=10,nlong:r=10}=e,i=Math.PI-0,o=0,c=2*Math.PI-o,l=(t+1)*(r+1),h=(_,y,x,A,M)=>e.radius||1,f=new Float32Array(l*3),u=new Float32Array(l*3),d=new Float32Array(l*2),p=l>65535?Uint32Array:Uint16Array,m=new p(t*r*6);for(let _=0;_<=t;_++)for(let y=0;y<=r;y++){let x=y/r,A=_/t,M=y+_*(r+1),E=M*2,w=M*3,v=c*x,b=i*A,T=Math.sin(v),I=Math.cos(v),B=Math.sin(b),N=Math.cos(b),C=I*B,V=N,tt=T*B,J=h(C,V,tt,x,A);f[w+0]=J*C,f[w+1]=J*V,f[w+2]=J*tt,u[w+0]=C,u[w+1]=V,u[w+2]=tt,d[E+0]=x,d[E+1]=1-A}let g=r+1;for(let _=0;_<r;_++)for(let y=0;y<t;y++){let x=(_*t+y)*6;m[x+0]=y*g+_,m[x+1]=y*g+_+1,m[x+2]=(y+1)*g+_,m[x+3]=(y+1)*g+_,m[x+4]=y*g+_+1,m[x+5]=(y+1)*g+_+1}return{indices:{size:1,value:m},attributes:{POSITION:{size:3,value:f},NORMAL:{size:3,value:u},TEXCOORD_0:{size:2,value:d}}}}var cq=`uniform screenUniforms {
2774
2774
  vec2 texSize;
2775
2775
  } screen;
2776
- `,lC={name:"screen",fs:cq,uniformTypes:{texSize:"vec2<f32>"}};var Ph=class extends Xi{constructor(t,r){super(t,r);let{module:n,fs:s,id:i}=r,o={depthWriteEnabled:!1,depthCompare:"always"};this.model=new wh(t,{id:i,fs:s,modules:[n,lC],parameters:o})}render(t){this._renderPass(this.device,t)}delete(){this.model.destroy(),this.model=null}_renderPass(t,r){let{clearCanvas:n,inputBuffer:s,outputBuffer:i}=r,o=[s.width,s.height],a={texSrc:s.colorAttachments[0],texSize:o};this.model.shaderInputs.setProps({screen:a,...r.moduleProps});let c=this.device.beginRenderPass({framebuffer:i,parameters:{viewport:[0,0,...o]},clearColor:n?[0,0,0,0]:!1,clearDepth:1});this.model.draw(c),c.end()}};var Rh=class{constructor(t,r){this.id=`${t.name}-pass`,this.props=r,Dd(t),this.module=t}setup({device:t}){this.passes=lq(t,this.module,this.id)}setProps(t){this.props=t}preRender(){}postRender(t){let r=this.passes,{target:n}=t,s=t.inputBuffer,i=t.swapBuffer;for(let o=0;o<r.length;o++){let a=o===r.length-1,c=n!==void 0&&a;c&&(i=n);let l=!c||Boolean(t.clearCanvas),h={},f=this.module.passes[o].uniforms;h[this.module.name]={...this.props,...f},r[o].render({clearCanvas:l,inputBuffer:s,outputBuffer:i,moduleProps:h});let u=i;i=s,s=u}return s}cleanup(){if(this.passes){for(let t of this.passes)t.delete();this.passes=void 0}}};function lq(e,t,r){return t.passes.map((n,s)=>{let i=uq(t,n),o=`${r}-${s}`;return new Ph(e,{id:o,module:t,fs:i})})}var hC=`#version 300 es
2776
+ `,lC={name:"screen",fs:cq,uniformTypes:{texSize:"vec2<f32>"}};var Ph=class extends Xi{constructor(t,r){super(t,r);let{module:n,fs:s,id:i}=r,o={depthWriteEnabled:!1,depthCompare:"always"};this.model=new wh(t,{id:i,fs:s,modules:[n,lC],parameters:o})}render(t){this._renderPass(this.device,t)}delete(){this.model.destroy(),this.model=null}_renderPass(t,r){let{clearCanvas:n,inputBuffer:s,outputBuffer:i}=r,o=[s.width,s.height],a={texSrc:s.colorAttachments[0],texSize:o};this.model.shaderInputs.setProps({screen:a,...r.moduleProps});let c=this.device.beginRenderPass({framebuffer:i,parameters:{viewport:[0,0,...o]},clearColor:n?[0,0,0,0]:!1,clearDepth:1,clearStencil:!1});this.model.draw(c),c.end()}};var Rh=class{constructor(t,r){this.id=`${t.name}-pass`,this.props=r,Dd(t),this.module=t}setup({device:t}){this.passes=lq(t,this.module,this.id)}setProps(t){this.props=t}preRender(){}postRender(t){let r=this.passes,{target:n}=t,s=t.inputBuffer,i=t.swapBuffer;for(let o=0;o<r.length;o++){let a=o===r.length-1,c=n!==void 0&&a;c&&(i=n);let l=!c||Boolean(t.clearCanvas),h={},f=this.module.passes[o].uniforms;h[this.module.name]={...this.props,...f},r[o].render({clearCanvas:l,inputBuffer:s,outputBuffer:i,moduleProps:h});let u=i;i=s,s=u}return s}cleanup(){if(this.passes){for(let t of this.passes)t.delete();this.passes=void 0}}};function lq(e,t,r){return t.passes.map((n,s)=>{let i=uq(t,n),o=`${r}-${s}`;return new Ph(e,{id:o,module:t,fs:i})})}var hC=`#version 300 es
2777
2777
  uniform sampler2D texSrc;
2778
2778
 
2779
2779
  in vec2 position;
@@ -4450,7 +4450,7 @@ fragColor = vFillColor;
4450
4450
  }
4451
4451
  DECKGL_FILTER_COLOR(fragColor, geometry);
4452
4452
  }
4453
- `;var iK={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,borderRadius:{type:"object",value:0},padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:e=>e.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}},Ff=class extends ut{getShaders(){return super.getShaders({vs:OI,fs:LI,modules:[st,Tt,II]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,type:"unorm8",accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,type:"unorm8",accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(t){super.updateState(t);let{changeFlags:r}=t;r.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:t}){let{billboard:r,sizeScale:n,sizeUnits:s,sizeMinPixels:i,sizeMaxPixels:o,getLineWidth:a}=this.props,{padding:c,borderRadius:l}=this.props;c.length<4&&(c=[c[0],c[1],c[0],c[1]]),Array.isArray(l)||(l=[l,l,l,l]);let h=this.state.model,f={billboard:r,stroked:Boolean(a),borderRadius:l,padding:c,sizeUnits:St[s],sizeScale:n,sizeMinPixels:i,sizeMaxPixels:o};h.shaderInputs.setProps({textBackground:f}),h.draw(this.context.renderPass)}_getModel(){let t=[0,0,1,0,0,1,1,1];return new X(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new it({topology:"triangle-strip",vertexCount:4,attributes:{positions:{size:2,value:new Float32Array(t)}}}),isInstanced:!0})}};Ff.defaultProps=iK;Ff.layerName="TextBackgroundLayer";var Ag=Ff;var NI={start:1,middle:0,end:-1},BI={top:1,center:0,bottom:-1},PA=[0,0,0,255],oK=1,aK={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:PA},getBorderWidth:{type:"accessor",value:0},backgroundBorderRadius:{type:"object",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:xo.characterSet},fontFamily:xo.fontFamily,fontWeight:xo.fontWeight,lineHeight:oK,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:PA},fontSettings:{type:"object",value:{},compare:1},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:e=>e.text},getPosition:{type:"accessor",value:e=>e.position},getColor:{type:"accessor",value:PA},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}},Df=class extends Dt{constructor(){super(...arguments),this.getBoundingRect=(t,r)=>{let{size:[n,s]}=this.transformParagraph(t,r),{fontSize:i}=this.state.fontAtlasManager.props;n/=i,s/=i;let{getTextAnchor:o,getAlignmentBaseline:a}=this.props,c=NI[typeof o=="function"?o(t,r):o],l=BI[typeof a=="function"?a(t,r):a];return[(c-1)*n/2,(l-1)*s/2,n,s]},this.getIconOffsets=(t,r)=>{let{getTextAnchor:n,getAlignmentBaseline:s}=this.props,{x:i,y:o,rowWidth:a,size:[c,l]}=this.transformParagraph(t,r),h=NI[typeof n=="function"?n(t,r):n],f=BI[typeof s=="function"?s(t,r):s],u=i.length,d=new Array(u*2),p=0;for(let m=0;m<u;m++){let g=(1-h)*(c-a[m])/2;d[p++]=(h-1)*c/2+g+i[m],d[p++]=(f-1)*l/2+o[m]}return d}}initializeState(){this.state={styleVersion:0,fontAtlasManager:new Bf},this.props.maxWidth>0&&k.warn("v8.9 breaking change: TextLayer maxWidth is now relative to text size")()}updateState(t){let{props:r,oldProps:n,changeFlags:s}=t;(s.dataChanged||s.updateTriggersChanged&&(s.updateTriggersChanged.all||s.updateTriggersChanged.getText))&&this._updateText(),(this._updateFontAtlas()||r.lineHeight!==n.lineHeight||r.wordBreak!==n.wordBreak||r.maxWidth!==n.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(){let{fontSettings:t,fontFamily:r,fontWeight:n}=this.props,{fontAtlasManager:s,characterSet:i}=this.state,o={...t,characterSet:i,fontFamily:r,fontWeight:n};if(!s.mapping)return s.setProps(o),!0;for(let a in o)if(o[a]!==s.props[a])return s.setProps(o),!0;return!1}_updateText(){let{data:t,characterSet:r}=this.props,n=t.attributes?.getText,{getText:s}=this.props,i=t.startIndices,o,a=r==="auto"&&new Set;if(n&&i){let{texts:c,characterCount:l}=EI({...ArrayBuffer.isView(n)?{value:n}:n,length:t.length,startIndices:i,characterSet:a});o=l,s=(h,{index:f})=>c[f]}else{let{iterable:c,objectInfo:l}=$t(t);i=[0],o=0;for(let h of c){l.index++;let f=Array.from(s(h,l)||"");a&&f.forEach(a.add,a),o+=f.length,i.push(o)}}this.setState({getText:s,startIndices:i,numInstances:o,characterSet:a||r})}transformParagraph(t,r){let{fontAtlasManager:n}=this.state,s=n.mapping,i=this.state.getText,{wordBreak:o,lineHeight:a,maxWidth:c}=this.props,l=i(t,r)||"";return MI(l,a,o,c*n.props.fontSize,s)}renderLayers(){let{startIndices:t,numInstances:r,getText:n,fontAtlasManager:{scale:s,atlas:i,mapping:o},styleVersion:a}=this.state,{data:c,_dataDiff:l,getPosition:h,getColor:f,getSize:u,getAngle:d,getPixelOffset:p,getBackgroundColor:m,getBorderColor:g,getBorderWidth:_,backgroundBorderRadius:y,backgroundPadding:x,background:A,billboard:M,fontSettings:E,outlineWidth:w,outlineColor:v,sizeScale:b,sizeUnits:T,sizeMinPixels:I,sizeMaxPixels:B,transitions:N,updateTriggers:C}=this.props,V=this.getSubLayerClass("characters",xg),tt=this.getSubLayerClass("background",Ag);return[A&&new tt({getFillColor:m,getLineColor:g,getLineWidth:_,borderRadius:y,padding:x,getPosition:h,getSize:u,getAngle:d,getPixelOffset:p,billboard:M,sizeScale:b,sizeUnits:T,sizeMinPixels:I,sizeMaxPixels:B,transitions:N&&{getPosition:N.getPosition,getAngle:N.getAngle,getSize:N.getSize,getFillColor:N.getBackgroundColor,getLineColor:N.getBorderColor,getLineWidth:N.getBorderWidth,getPixelOffset:N.getPixelOffset}},this.getSubLayerProps({id:"background",updateTriggers:{getPosition:C.getPosition,getAngle:C.getAngle,getSize:C.getSize,getFillColor:C.getBackgroundColor,getLineColor:C.getBorderColor,getLineWidth:C.getBorderWidth,getPixelOffset:C.getPixelOffset,getBoundingRect:{getText:C.getText,getTextAnchor:C.getTextAnchor,getAlignmentBaseline:C.getAlignmentBaseline,styleVersion:a}}}),{data:c.attributes&&c.attributes.background?{length:c.length,attributes:c.attributes.background}:c,_dataDiff:l,autoHighlight:!1,getBoundingRect:this.getBoundingRect}),new V({sdf:E.sdf,smoothing:Number.isFinite(E.smoothing)?E.smoothing:xo.smoothing,outlineWidth:w/(E.radius||xo.radius),outlineColor:v,iconAtlas:i,iconMapping:o,getPosition:h,getColor:f,getSize:u,getAngle:d,getPixelOffset:p,billboard:M,sizeScale:b*s,sizeUnits:T,sizeMinPixels:I*s,sizeMaxPixels:B*s,transitions:N&&{getPosition:N.getPosition,getAngle:N.getAngle,getColor:N.getColor,getSize:N.getSize,getPixelOffset:N.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{all:C.getText,getPosition:C.getPosition,getAngle:C.getAngle,getColor:C.getColor,getSize:C.getSize,getPixelOffset:C.getPixelOffset,getIconOffsets:{getTextAnchor:C.getTextAnchor,getAlignmentBaseline:C.getAlignmentBaseline,styleVersion:a}}}),{data:c,_dataDiff:l,startIndices:t,numInstances:r,getIconOffsets:this.getIconOffsets,getIcon:n})]}static set fontAtlasCacheLimit(t){PI(t)}};Df.defaultProps=aK;Df.layerName="TextLayer";var Tg=Df;var kf={circle:{type:ng,props:{filled:"filled",stroked:"stroked",lineWidthMaxPixels:"lineWidthMaxPixels",lineWidthMinPixels:"lineWidthMinPixels",lineWidthScale:"lineWidthScale",lineWidthUnits:"lineWidthUnits",pointRadiusMaxPixels:"radiusMaxPixels",pointRadiusMinPixels:"radiusMinPixels",pointRadiusScale:"radiusScale",pointRadiusUnits:"radiusUnits",pointAntialiasing:"antialiasing",pointBillboard:"billboard",getFillColor:"getFillColor",getLineColor:"getLineColor",getLineWidth:"getLineWidth",getPointRadius:"getRadius"}},icon:{type:Za,props:{iconAtlas:"iconAtlas",iconMapping:"iconMapping",iconSizeMaxPixels:"sizeMaxPixels",iconSizeMinPixels:"sizeMinPixels",iconSizeScale:"sizeScale",iconSizeUnits:"sizeUnits",iconAlphaCutoff:"alphaCutoff",iconBillboard:"billboard",getIcon:"getIcon",getIconAngle:"getAngle",getIconColor:"getColor",getIconPixelOffset:"getPixelOffset",getIconSize:"getSize"}},text:{type:Tg,props:{textSizeMaxPixels:"sizeMaxPixels",textSizeMinPixels:"sizeMinPixels",textSizeScale:"sizeScale",textSizeUnits:"sizeUnits",textBackground:"background",textBackgroundPadding:"backgroundPadding",textFontFamily:"fontFamily",textFontWeight:"fontWeight",textLineHeight:"lineHeight",textMaxWidth:"maxWidth",textOutlineColor:"outlineColor",textOutlineWidth:"outlineWidth",textWordBreak:"wordBreak",textCharacterSet:"characterSet",textBillboard:"billboard",textFontSettings:"fontSettings",getText:"getText",getTextAngle:"getAngle",getTextColor:"getColor",getTextPixelOffset:"getPixelOffset",getTextSize:"getSize",getTextAnchor:"getTextAnchor",getTextAlignmentBaseline:"getAlignmentBaseline",getTextBackgroundColor:"getBackgroundColor",getTextBorderColor:"getBorderColor",getTextBorderWidth:"getBorderWidth"}}},Uf={type:bn,props:{lineWidthUnits:"widthUnits",lineWidthScale:"widthScale",lineWidthMinPixels:"widthMinPixels",lineWidthMaxPixels:"widthMaxPixels",lineJointRounded:"jointRounded",lineCapRounded:"capRounded",lineMiterLimit:"miterLimit",lineBillboard:"billboard",getLineColor:"getColor",getLineWidth:"getWidth"}},Mg={type:ri,props:{extruded:"extruded",filled:"filled",wireframe:"wireframe",elevationScale:"elevationScale",material:"material",_full3d:"_full3d",getElevation:"getElevation",getFillColor:"getFillColor",getLineColor:"getLineColor"}};function rc({type:e,props:t}){let r={};for(let n in t)r[n]=e.defaultProps[t[n]];return r}function Eg(e,t){let{transitions:r,updateTriggers:n}=e.props,s={updateTriggers:{},transitions:r&&{getPosition:r.geometry}};for(let i in t){let o=t[i],a=e.props[i];i.startsWith("get")&&(a=e.getSubLayerAccessor(a),s.updateTriggers[o]=n[i],r&&(s.transitions[o]=r[i])),s[o]=a}return s}function DI(e){if(Array.isArray(e))return e;switch(k.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return k.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}function RA(e,t,r={}){let n={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},{startRow:s=0,endRow:i=e.length}=r;for(let o=s;o<i;o++){let a=e[o],{geometry:c}=a;if(c)if(c.type==="GeometryCollection"){k.assert(Array.isArray(c.geometries),"GeoJSON does not have geometries array");let{geometries:l}=c;for(let h=0;h<l.length;h++){let f=l[h];FI(f,n,t,a,o)}}else FI(c,n,t,a,o)}return n}function FI(e,t,r,n,s){let{type:i,coordinates:o}=e,{pointFeatures:a,lineFeatures:c,polygonFeatures:l,polygonOutlineFeatures:h}=t;if(!lK(i,o)){k.warn(`${i} coordinates are malformed`)();return}switch(i){case"Point":a.push(r({geometry:e},n,s));break;case"MultiPoint":o.forEach(f=>{a.push(r({geometry:{type:"Point",coordinates:f}},n,s))});break;case"LineString":c.push(r({geometry:e},n,s));break;case"MultiLineString":o.forEach(f=>{c.push(r({geometry:{type:"LineString",coordinates:f}},n,s))});break;case"Polygon":l.push(r({geometry:e},n,s)),o.forEach(f=>{h.push(r({geometry:{type:"LineString",coordinates:f}},n,s))});break;case"MultiPolygon":o.forEach(f=>{l.push(r({geometry:{type:"Polygon",coordinates:f}},n,s)),f.forEach(u=>{h.push(r({geometry:{type:"LineString",coordinates:u}},n,s))})});break;default:}}var cK={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function lK(e,t){let r=cK[e];for(k.assert(r,`Unknown GeoJSON type ${e}`);t&&--r>0;)t=t[0];return t&&Number.isFinite(t[0])}function kI(){return{points:{},lines:{},polygons:{},polygonsOutline:{}}}function bg(e){return e.geometry.coordinates}function UI(e,t){let r=kI(),{pointFeatures:n,lineFeatures:s,polygonFeatures:i,polygonOutlineFeatures:o}=e;return r.points.data=n,r.points._dataDiff=t.pointFeatures&&(()=>t.pointFeatures),r.points.getPosition=bg,r.lines.data=s,r.lines._dataDiff=t.lineFeatures&&(()=>t.lineFeatures),r.lines.getPath=bg,r.polygons.data=i,r.polygons._dataDiff=t.polygonFeatures&&(()=>t.polygonFeatures),r.polygons.getPolygon=bg,r.polygonsOutline.data=o,r.polygonsOutline._dataDiff=t.polygonOutlineFeatures&&(()=>t.polygonOutlineFeatures),r.polygonsOutline.getPath=bg,r}function zI(e,t){let r=kI(),{points:n,lines:s,polygons:i}=e,o=uI(e,t);return r.points.data={length:n.positions.value.length/n.positions.size,attributes:{...n.attributes,getPosition:n.positions,instancePickingColors:{size:4,value:o.points}},properties:n.properties,numericProps:n.numericProps,featureIds:n.featureIds},r.lines.data={length:s.pathIndices.value.length-1,startIndices:s.pathIndices.value,attributes:{...s.attributes,getPath:s.positions,instancePickingColors:{size:4,value:o.lines}},properties:s.properties,numericProps:s.numericProps,featureIds:s.featureIds},r.lines._pathType="open",r.polygons.data={length:i.polygonIndices.value.length-1,startIndices:i.polygonIndices.value,attributes:{...i.attributes,getPolygon:i.positions,pickingColors:{size:4,value:o.polygons}},properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},r.polygons._normalize=!1,i.triangles&&(r.polygons.data.attributes.indices=i.triangles.value),r.polygonsOutline.data={length:i.primitivePolygonIndices.value.length-1,startIndices:i.primitivePolygonIndices.value,attributes:{...i.attributes,getPath:i.positions,instancePickingColors:{size:4,value:o.polygons}},properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},r.polygonsOutline._pathType="open",r}var hK=["points","linestrings","polygons"],fK={...rc(kf.circle),...rc(kf.icon),...rc(kf.text),...rc(Uf),...rc(Mg),stroked:!0,filled:!0,extruded:!1,wireframe:!1,_full3d:!1,iconAtlas:{type:"object",value:null},iconMapping:{type:"object",value:{}},getIcon:{type:"accessor",value:e=>e.properties.icon},getText:{type:"accessor",value:e=>e.properties.text},pointType:"circle",getRadius:{deprecatedFor:"getPointRadius"}},zf=class extends Dt{initializeState(){this.state={layerProps:{},features:{},featuresDiff:{}}}updateState({props:t,changeFlags:r}){if(!r.dataChanged)return;let{data:n}=this.props,s=n&&"points"in n&&"polygons"in n&&"lines"in n;this.setState({binary:s}),s?this._updateStateBinary({props:t,changeFlags:r}):this._updateStateJSON({props:t,changeFlags:r})}_updateStateBinary({props:t,changeFlags:r}){let n=zI(t.data,this.encodePickingColor);this.setState({layerProps:n})}_updateStateJSON({props:t,changeFlags:r}){let n=DI(t.data),s=this.getSubLayerRow.bind(this),i={},o={};if(Array.isArray(r.dataChanged)){let c=this.state.features;for(let l in c)i[l]=c[l].slice(),o[l]=[];for(let l of r.dataChanged){let h=RA(n,s,l);for(let f in c)o[f].push(_g({data:i[f],getIndex:u=>u.__source.index,dataRange:l,replace:h[f]}))}}else i=RA(n,s);let a=UI(i,o);this.setState({features:i,featuresDiff:o,layerProps:a})}getPickingInfo(t){let r=super.getPickingInfo(t),{index:n,sourceLayer:s}=r;return r.featureType=hK.find(i=>s.id.startsWith(`${this.id}-${i}-`)),n>=0&&s.id.startsWith(`${this.id}-points-text`)&&this.state.binary&&(r.index=this.props.data.points.globalFeatureIds.value[n]),r}_updateAutoHighlight(t){let r=`${this.id}-points-`,n=t.featureType==="points";for(let s of this.getSubLayers())s.id.startsWith(r)===n&&s.updateAutoHighlight(t)}_renderPolygonLayer(){let{extruded:t,wireframe:r}=this.props,{layerProps:n}=this.state,s="polygons-fill",i=this.shouldRenderSubLayer(s,n.polygons?.data)&&this.getSubLayerClass(s,Mg.type);if(i){let o=Eg(this,Mg.props),a=t&&r;return a||delete o.getLineColor,o.updateTriggers.lineColors=a,new i(o,this.getSubLayerProps({id:s,updateTriggers:o.updateTriggers}),n.polygons)}return null}_renderLineLayers(){let{extruded:t,stroked:r}=this.props,{layerProps:n}=this.state,s="polygons-stroke",i="linestrings",o=!t&&r&&this.shouldRenderSubLayer(s,n.polygonsOutline?.data)&&this.getSubLayerClass(s,Uf.type),a=this.shouldRenderSubLayer(i,n.lines?.data)&&this.getSubLayerClass(i,Uf.type);if(o||a){let c=Eg(this,Uf.props);return[o&&new o(c,this.getSubLayerProps({id:s,updateTriggers:c.updateTriggers}),n.polygonsOutline),a&&new a(c,this.getSubLayerProps({id:i,updateTriggers:c.updateTriggers}),n.lines)]}return null}_renderPointLayers(){let{pointType:t}=this.props,{layerProps:r,binary:n}=this.state,{highlightedObjectIndex:s}=this.props;!n&&Number.isFinite(s)&&(s=r.points.data.findIndex(a=>a.__source.index===s));let i=new Set(t.split("+")),o=[];for(let a of i){let c=`points-${a}`,l=kf[a],h=l&&this.shouldRenderSubLayer(c,r.points?.data)&&this.getSubLayerClass(c,l.type);if(h){let f=Eg(this,l.props),u=r.points;if(a==="text"&&n){let{instancePickingColors:d,...p}=u.data.attributes;u={...u,data:{...u.data,attributes:p}}}o.push(new h(f,this.getSubLayerProps({id:c,updateTriggers:f.updateTriggers,highlightedObjectIndex:s}),u))}}return o}renderLayers(){let{extruded:t}=this.props,r=this._renderPolygonLayer(),n=this._renderLineLayers(),s=this._renderPointLayers();return[!t&&r,n,s,t&&r]}getSubLayerAccessor(t){let{binary:r}=this.state;return!r||typeof t!="function"?super.getSubLayerAccessor(t):(n,s)=>{let{data:i,index:o}=s,a=fI(i,o);return t(a,s)}}};zf.layerName="GeoJsonLayer";zf.defaultProps=fK;var yo=zf;function uK(e){return typeof e=="string"?e.charAt(0).toLowerCase()+e.slice(1):e}function Sg(e){if(Array.isArray(e))return e.map(t=>Sg(t));if(e&&typeof e=="object"){let t={};for(let[r,n]of Object.entries(e))t[uK(r)]=Sg(n);return t}return e}var yO=Dn(xO(),1);function UA(e,t){if(t?._parser&&t._parser!=="fast-xml-parser")throw new Error(t?._parser);let r={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:t?.removeNSPrefix,textNodeName:t?.textNodeName,isArray:(s,i,o,a)=>Boolean(t?.arrayPaths?.some(l=>i===l)),...t?._fastXML},n=TZ(e,r);return t?.uncapitalizeKeys?Sg(n):n}function TZ(e,t){return new yO.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...t}).parse(e)}var MZ="4.2.1",$r={dataType:null,batchType:null,name:"XML",id:"xml",module:"xml",version:MZ,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:EZ,options:{xml:{_parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:async(e,t)=>UA(new TextDecoder().decode(e),{...$r.options.xml,...t?.xml}),parseTextSync:(e,t)=>UA(e,{...$r.options.xml,...t?.xml})};function EZ(e){return e.startsWith("<?xml")}function AO(e,t){let r=$r.parseTextSync?.(e,t),n=r?.ServiceExceptionReport?.ServiceException||r?.["ogc:ServiceExceptionReport"]?.["ogc:ServiceException"];return typeof n=="string"?n:n.value||n.code||"Unknown error"}var bZ="4.2.1",Wf={dataType:null,batchType:null,id:"wms-error",name:"WMS Error",module:"wms",version:bZ,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:SZ,options:{wms:{throwOnError:!1}},parse:async(e,t)=>zA(new TextDecoder().decode(e),t),parseSync:(e,t)=>zA(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>zA(e,t)};function SZ(e){return e.startsWith("<?xml")}function zA(e,t){let r={...Wf.options.wms,...t?.wms},n=AO(e,r),s=r.minimalErrors?n:`WMS Service error: ${n}`;if(r.throwOnError)throw new Error(s);return s}function To(e){return Array.isArray(e)?e:e?[e]:[]}function Gf(e){let t=To(e);return t.length>0&&t.every(r=>typeof r=="string")?t:[]}function jf(e,t=void 0){switch(typeof e){case"number":return e;case"string":return parseFloat(e);default:return}}function wg(e,t=void 0){switch(typeof e){case"number":return e;case"string":return parseInt(e,10);default:return}}function Mo(e){switch(e){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1;default:return!1}}function VA(e,t){let r=$r.parseTextSync?.(e,t),n=r.WMT_MS_Capabilities||r.WMS_Capabilities||r,s=vZ(n);if(t?.inheritedLayerProps)for(let i of s.layers)MO(i,null);return t?.includeRawJSON&&(s.json=n),t?.includeXMLText&&(s.xml=e),s}function vZ(e){let t={version:String(e.version||""),name:String(e.Service?.Name||"unnamed"),title:e.Service?.Title?String(e.Service?.Title):void 0,abstract:e.Service?.Abstract?String(e.Service?.Abstract):void 0,keywords:Gf(e.Service?.KeywordList?.Keyword),fees:e.Service?.Fees?JSON.stringify(e.Service?.Fees):void 0,accessConstraints:e.Service?.AccessConstraints?JSON.stringify(e.Service?.AccessConstraints):void 0,layerLimit:wg(e.Service?.LayerLimit),maxWidth:wg(e.Service?.maxWidth),maxHeight:wg(e.Service?.maxHeight),layers:[],requests:wZ(e.Capability?.Request),exceptions:CZ(e.Exception)},r=To(e.Capability?.Layer);for(let n of r)t.layers.push(TO(n));for(let[n,s]of Object.entries(t))s===void 0&&delete t[n];return t}function wZ(e){let t={};for(let[r,n]of Object.entries(e||{})){let s=Gf(n?.Format);t[r]={mimeTypes:s}}return t}function CZ(e){if(To(e?.Format).length>0)return{mimeTypes:Gf(e)}}function TO(e){let t={title:String(e?.Title||""),name:e?.Name&&String(e?.Name),abstract:e?.Name&&String(e?.Abstract),keywords:Gf(e.KeywordList?.Keyword)},r=e?.CRS||e?.SRS;r&&Array.isArray(r)&&r.every(l=>typeof l=="string")&&(t.crs=r);let n=e?.EX_GeographicBoundingBox&&PZ(e?.EX_GeographicBoundingBox);n&&(t.geographicBoundingBox=n),n=e?.LatLonBoundingBox&&RZ(e?.LatLonBoundingBox),n&&(t.geographicBoundingBox=n);let s=e?.BoundingBox&&IZ(e?.BoundingBox);s&&s.length>0&&(t.boundingBoxes=s);let o=To(e?.Dimension).map(l=>LZ(l));o.length&&(t.dimensions=o),e?.opaque&&(t.opaque=Mo(e?.opaque)),e?.cascaded&&(t.cascaded=Mo(e?.cascaded)),e?.queryable&&(t.queryable=Mo(e?.queryable));let a=To(e?.Layer),c=[];for(let l of a)c.push(TO(l));c.length>0&&(t.layers=c);for(let[l,h]of Object.entries(t))h===void 0&&delete t[l];return t}function PZ(e){let{westBoundLongitude:t,northBoundLatitude:r,eastBoundLongitude:n,southBoundLatitude:s}=e;return[[t,s],[n,r]]}function RZ(e){let{minx:t,miny:r,maxx:n,maxy:s}=e;return[[t,r],[n,s]]}function IZ(e){return To(e).map(r=>OZ(r))}function OZ(e){let{CRS:t,SRS:r,minx:n,miny:s,maxx:i,maxy:o,resx:a,resy:c}=e,l={crs:t||r,boundingBox:[[jf(n),jf(s)],[jf(i),jf(o)]]};return a&&(l.xResolution=a),c&&(l.yResolution=c),l}function LZ(e){let{name:t,units:r,value:n}=e,s={name:t,units:r,extent:n};return e.unitSymbol&&(s.unitSymbol=e.unitSymbol),e.default&&(s.defaultValue=e.default),e.multipleValues&&(s.multipleValues=Mo(e.multipleValues)),e.nearestValue&&(s.nearestValue=Mo(e.nearestValue)),e.current&&(s.current=Mo(e.current)),s}function MO(e,t){t?.geographicBoundingBox&&!e.geographicBoundingBox&&(e.geographicBoundingBox=[...t.geographicBoundingBox]),t?.crs&&!e.crs&&(e.crs=[...t.crs]),t?.boundingBoxes&&!e.boundingBoxes&&(e.boundingBoxes=[...t.boundingBoxes]),t?.dimensions&&!e.dimensions&&(e.dimensions=[...t.dimensions]);for(let r of e.layers||[])MO(r,e)}var NZ="4.2.1",nc={dataType:null,batchType:null,id:"wms-capabilities",name:"WMS Capabilities",module:"wms",version:NZ,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.wms_xml","application/xml","text/xml"],testText:BZ,options:{wms:{}},parse:async(e,t)=>VA(new TextDecoder().decode(e),t?.wms),parseTextSync:(e,t)=>VA(e,t?.wms)};function BZ(e){return e.startsWith("<?xml")}function HA(e,t){let n=($r.parseTextSync?.(e,t)).FeatureInfoResponse?.FIELDS||[];return{features:(Array.isArray(n)?n:[n]).map(i=>FZ(i))}}function FZ(e){return{attributes:e||{},type:"",bounds:{bottom:0,top:0,left:0,right:0}}}var EO={...nc,dataType:null,id:"wms-feature-info",name:"WMS FeatureInfo",parse:async(e,t)=>HA(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>HA(e,t)};function WA(e,t){return $r.parseTextSync?.(e,t)}var bO={...nc,dataType:null,id:"wms-layer-description",name:"WMS DescribeLayer",parse:async(e,t)=>WA(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>WA(e,t)};function SO(e,t){let{type:r="auto"}=e,n=r==="auto"?kZ(e.url,t):DZ(r,t);if(!n)throw new Error("Not a valid image source type");return n.create(e)}function DZ(e,t){for(let r of t)if(r.type===e)return r;return null}function kZ(e,t){for(let r of t)if(r.testURL&&r.testURL(e))return r;return null}var vO={type:"wms",testURL:e=>e.toLowerCase().includes("wms"),create:e=>new GA(e)},GA=class extends mr{url;data;substituteCRS84;flipCRS;wmsParameters;vendorParameters;capabilities=null;constructor(t){super(t),this.url=t.url,this.data=t.url,this.substituteCRS84=t.substituteCRS84??!1,this.flipCRS=["EPSG:4326"],this.wmsParameters={layers:void 0,query_layers:void 0,styles:void 0,version:"1.3.0",crs:"EPSG:4326",format:"image/png",info_format:"text/plain",transparent:void 0,time:void 0,elevation:void 0,...t.wmsParameters},this.vendorParameters=t.vendorParameters||{}}async getMetadata(){let t=await this.getCapabilities();return this.normalizeMetadata(t)}async getImage(t){let{boundingBox:r,bbox:n,...s}=t,i={bbox:r?[...r[0],...r[1]]:n,...s};return await this.getMap(i)}normalizeMetadata(t){return t}async getCapabilities(t,r){let n=this.getCapabilitiesURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();this._checkResponse(s,i);let o=await nc.parse(i,this.loadOptions);return this.capabilities=o,o}async getMap(t,r){let n=this.getMapURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();this._checkResponse(s,i);try{return await ln.parse(i,this.loadOptions)}catch{throw this._parseError(i)}}async getFeatureInfo(t,r){let n=this.getFeatureInfoURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();return this._checkResponse(s,i),await EO.parse(i,this.loadOptions)}async getFeatureInfoText(t,r){let n=this.getFeatureInfoURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();return this._checkResponse(s,i),new TextDecoder().decode(i)}async describeLayer(t,r){let n=this.describeLayerURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();return this._checkResponse(s,i),await bO.parse(i,this.loadOptions)}async getLegendGraphic(t,r){let n=this.getLegendGraphicURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();this._checkResponse(s,i);try{return await ln.parse(i,this.loadOptions)}catch{throw this._parseError(i)}}getCapabilitiesURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("GetCapabilities",n,r)}getMapURL(t,r){t=this._getWMS130Parameters(t);let n={version:this.wmsParameters.version,format:this.wmsParameters.format,transparent:this.wmsParameters.transparent,time:this.wmsParameters.time,elevation:this.wmsParameters.elevation,layers:this.wmsParameters.layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...t};return this._getWMSUrl("GetMap",n,r)}getFeatureInfoURL(t,r){t=this._getWMS130Parameters(t);let{boundingBox:n,bbox:s}=t;t.bbox=n?[...n[0],...n[1]]:s;let i={version:this.wmsParameters.version,info_format:this.wmsParameters.info_format,layers:this.wmsParameters.layers,query_layers:this.wmsParameters.query_layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...t};return this._getWMSUrl("GetFeatureInfo",i,r)}describeLayerURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("DescribeLayer",n,r)}getLegendGraphicURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("GetLegendGraphic",n,r)}_parseWMSUrl(t){let[r,n]=t.split("?"),s=n.split("&"),i={};for(let o of s){let[a,c]=o.split("=");i[a]=c}return{url:r,parameters:i}}_getWMSUrl(t,r,n){let s=this.url,i=!0,o={service:"WMS",version:r.version,request:t,...r,...this.vendorParameters,...n},a=["transparent","time","elevation"];for(let[c,l]of Object.entries(o))(!a.includes(c)||l)&&(s+=i?"?":"&",i=!1,s+=this._getURLParameter(c,l,r));return encodeURI(s)}_getWMS130Parameters(t){let r={...t};return r.srs&&(r.crs=r.crs||r.srs,delete r.srs),r}_getURLParameter(t,r,n){switch(t){case"crs":n.version!=="1.3.0"?t="srs":this.substituteCRS84&&r==="EPSG:4326"&&(r="CRS:84");break;case"srs":n.version==="1.3.0"&&(t="crs");break;case"bbox":let s=this._flipBoundingBox(r,n);s&&(r=s);break;case"x":n.version==="1.3.0"&&(t="i");break;case"y":n.version==="1.3.0"&&(t="j");break;default:}return t=t.toUpperCase(),Array.isArray(r)?`${t}=${r.join(",")}`:`${t}=${r?String(r):""}`}_flipBoundingBox(t,r){if(!Array.isArray(t)||t.length!==4)return null;let n=r.version==="1.3.0"&&this.flipCRS.includes(r.crs||"")&&!(this.substituteCRS84&&r.crs==="EPSG:4326"),s=t;return n?[s[1],s[0],s[3],s[2]]:s}async _fetchArrayBuffer(t){let r=await this.fetch(t),n=await r.arrayBuffer();return this._checkResponse(r,n),n}_checkResponse(t,r){let n=t.headers["content-type"];if(!t.ok||Wf.mimeTypes.includes(n)){let s=yl(this.loadOptions,{wms:{throwOnError:!0}}),i=Wf.parseSync?.(r,s);throw new Error(i)}}_parseError(t){let r=Wf.parseSync?.(t,this.loadOptions);return new Error(r)}};var sc=class extends mr{constructor(t){super(t)}async getMetadata(){throw new Error("ImageSource.getMetadata not implemented")}async getImage(t){let r=this.getGranularParameters(t),n=this.getURLFromTemplate(r),i=await(await this.fetch(n)).arrayBuffer();return await ln.parse(i)}getGranularParameters(t){let[[r,n],[s,i]]=t.boundingBox;return{...t,east:r,north:n,south:i,west:s}}getURLFromTemplate(t){let r=this.props.url;for(let[n,s]of Object.entries(t))r=r.replace(`\${${n}}`,String(s)),r=r.replace(`{${n}}`,String(s));return r}};W(sc,"type","template"),W(sc,"testURL",t=>t.toLowerCase().includes("{"));var jA=class extends sc{data;constructor(t){super(t),this.data=t.url}async getMetadata(){return await this.metadata()}async getImage(t){throw new Error("not implemented")}async metadata(){throw new Error("not implemented")}exportImage(t){throw new Error("not implemented")}metadataURL(t){return`${this.props.url}?f=pjson`}exportImageURL(t){let r=`bbox=${t.bbox[0]},${t.bbox[1]},${t.bbox[2]},${t.bbox[3]}`,n=`size=${t.width},${t.height}`,s={...t,bbox:r,size:n};return delete s.width,delete s.height,this.getUrl("exportImage",s)}getUrl(t,r,n){let s=`${this.props.url}/${t}`,i=!0;for(let[o,a]of Object.entries(r))s+=i?"?":"&",i=!1,Array.isArray(a)?s+=`${o.toUpperCase()}=${a.join(",")}`:s+=`${o.toUpperCase()}=${a?String(a):""}`;return s}async checkResponse(t){if(!t.ok)throw new Error("error")}},wO={type:"arcgis-image-server",testURL:e=>e.toLowerCase().includes("ImageServer"),create:e=>new jA(e)};var UZ=[vO,wO];function qA(e){return SO(e,UZ)}var CO=6378137*Math.PI;function YA(e){let t=Kt(e);return t[0]=(t[0]/256-1)*CO,t[1]=(t[1]/256-1)*CO,t}var zZ={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:()=>{}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:()=>{}},onImageLoad:{type:"function",value:()=>{}},onImageLoadError:{type:"function",compare:!1,value:(e,t)=>console.error(t,e)}},ic=class extends Dt{get isLoaded(){return this.state?.loadCounter===0&&super.isLoaded}shouldUpdateState(){return!0}initializeState(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0}updateState({changeFlags:t,props:r,oldProps:n}){let{viewport:s}=this.context;t.dataChanged||r.serviceType!==n.serviceType?(this.state.imageSource=this._createImageSource(r),this._loadMetadata(),this.debounce(()=>this.loadImage(s,"image source changed"),0)):Q(r.layers,n.layers,1)?t.viewportChanged&&this.debounce(()=>this.loadImage(s,"viewport changed")):this.debounce(()=>this.loadImage(s,"layers changed"),0)}finalizeState(){}renderLayers(){let{bounds:t,image:r,lastRequestParameters:n}=this.state;return r&&new eg({...this.getSubLayerProps({id:"bitmap"}),_imageCoordinateSystem:n.srs==="EPSG:4326"?H.LNGLAT:H.CARTESIAN,bounds:t,image:r})}async getFeatureInfoText(t,r){let{lastRequestParameters:n}=this.state;return n?await this.state.imageSource.getFeatureInfoText?.({...n,query_layers:n.layers,x:t,y:r,info_format:"application/vnd.ogc.gml"}):""}_createImageSource(t){if(t.data instanceof mr)return t.data;if(typeof t.data=="string")return qA({url:t.data,loadOptions:t.loadOptions,type:t.serviceType});throw new Error("invalid image source in props.data")}async _loadMetadata(){let{imageSource:t}=this.state;try{this.state.loadCounter++;let r=await t.getMetadata();this.state.imageSource===t&&this.getCurrentLayer()?.props.onMetadataLoad(r)}catch(r){this.getCurrentLayer()?.props.onMetadataLoadError(r)}finally{this.state.loadCounter--}}async loadImage(t,r){let{layers:n,serviceType:s}=this.props;if(s==="wms"&&n.length===0)return;let i=t.getBounds(),{width:o,height:a}=t,c=this.getRequestId(),{srs:l}=this.props;l==="auto"&&(l=t.resolution?"EPSG:4326":"EPSG:3857");let h={width:o,height:a,boundingBox:[[i[0],i[1]],[i[2],i[3]]],layers:n,crs:l};if(l==="EPSG:3857"){let f=YA([i[0],i[1]]),u=YA([i[2],i[3]]);h.boundingBox=[f,u]}try{this.state.loadCounter++,this.props.onImageLoadStart(c);let f=await this.state.imageSource.getImage(h);this.state.lastRequestId<c&&(this.getCurrentLayer()?.props.onImageLoad(c),this.setState({image:f,bounds:i,lastRequestParameters:h,lastRequestId:c}))}catch(f){this.raiseError(f,"Load image"),this.getCurrentLayer()?.props.onImageLoadError(c,f)}finally{this.state.loadCounter--}}getRequestId(){return this.state._nextRequestId++}debounce(t,r=500){clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout(()=>t(),r)}};ic.layerName="WMSLayer";ic.defaultProps=zZ;var VZ={getHeight:{type:"accessor",value:0},greatCircle:!0},qf=class extends tg{};qf.layerName="GreatCircleLayer";qf.defaultProps=VZ;var PO=qf;var HZ={...ni.defaultProps},Yf=class extends Dt{indexToBounds(){return null}renderLayers(){let{elevationScale:t,extruded:r,wireframe:n,filled:s,stroked:i,lineWidthUnits:o,lineWidthScale:a,lineWidthMinPixels:c,lineWidthMaxPixels:l,lineJointRounded:h,lineMiterLimit:f,lineDashJustified:u,getElevation:d,getFillColor:p,getLineColor:m,getLineWidth:g}=this.props,{updateTriggers:_,material:y,transitions:x}=this.props,A=this.getSubLayerClass("cell",ni),{updateTriggers:M,...E}=this.indexToBounds()||{};return new A({filled:s,wireframe:n,extruded:r,elevationScale:t,stroked:i,lineWidthUnits:o,lineWidthScale:a,lineWidthMinPixels:c,lineWidthMaxPixels:l,lineJointRounded:h,lineMiterLimit:f,lineDashJustified:u,material:y,transitions:x,getElevation:d,getFillColor:p,getLineColor:m,getLineWidth:g},this.getSubLayerProps({id:"cell",updateTriggers:_&&{...M,getElevation:_.getElevation,getFillColor:_.getFillColor,getLineColor:_.getLineColor,getLineWidth:_.getLineWidth}}),E)}};Yf.layerName="GeoCellLayer";Yf.defaultProps=HZ;var Sn=Yf;var Cg=Dn(XA(),1),WZ=3,GZ=30,jZ=2*GZ+1,IO=180/Math.PI;function LO(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function OO(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function NO(e){return[OO(e[0]),OO(e[1])]}function BO(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function FO([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*IO,n*IO]}function DO(e){let t=Cg.default.fromString(e,!0,10).toString(2);for(;t.length<WZ+jZ;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),s=t.substring(3,r),i=s.length/2,o=Cg.default.fromString(n,!0,2).toString(10),a=Cg.default.fromString(s,!0,2).toString(4);for(;a.length<i;)a="0"+a;return`${o}/${a}`}function qZ(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let s=t[0];t[0]=t[1],t[1]=s}}function kO(e){let t=e.split("/"),r=parseInt(t[0],10),n=t[1],s=n.length,i=[0,0],o;for(let a=s-1;a>=0;a--){o=s-a;let c=n[a],l=0,h=0;c==="1"?h=1:c==="2"?(l=1,h=1):c==="3"&&(l=1);let f=Math.pow(2,o-1);qZ(f,i,l,h),i[0]+=f*l,i[1]+=f*h}if(r%2===1){let a=i[0];i[0]=i[1],i[1]=a}return{face:r,ij:i,level:o}}var UO=Dn(XA(),1);function YZ(e){let t=e.padEnd(16,"0");return UO.default.fromString(t,16)}var XZ=100;function $Z({face:e,ij:t,level:r}){let n=[[0,0],[0,1],[1,1],[1,0],[0,0]],s=Math.max(1,Math.ceil(XZ*Math.pow(2,-r))),i=new Float64Array(4*s*2+2),o=0,a=0;for(let c=0;c<4;c++){let l=n[c].slice(0),h=n[c+1],f=(h[0]-l[0])/s,u=(h[1]-l[1])/s;for(let d=0;d<s;d++){l[0]+=f,l[1]+=u;let p=LO(t,r,l),m=NO(p),g=BO(e,m),_=FO(g);Math.abs(_[1])>89.999&&(_[0]=a);let y=_[0]-a;_[0]+=y>180?-360:y<-180?360:0,i[o++]=_[0],i[o++]=_[1],a=_[0]}}return i[o++]=i[0],i[o++]=i[1],i}function KZ(e){if(typeof e=="string"){if(e.indexOf("/")>0)return e;e=YZ(e)}return DO(e.toString())}function zO(e){let t=KZ(e),r=kO(t);return $Z(r)}var ZZ={getS2Token:{type:"accessor",value:e=>e.token}},$f=class extends Sn{indexToBounds(){let{data:t,getS2Token:r}=this.props;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(n,s)=>zO(r(n,s))}}};$f.layerName="S2Layer";$f.defaultProps=ZZ;var VO=$f;var $A=512;function JZ(e,t){let r=0,n=0,s=1<<e.length,i=s/$A;for(let o=0;o<e.length;o++){s>>=1;let a=parseInt(e[o]);a%2&&(r|=s),a>1&&(n|=s)}return[[r/i,$A-n/i],[(r+t)/i,$A-(n+t)/i]]}function HO(e,t=1){let[r,n]=JZ(e,t),[s,i]=Ee(r),[o,a]=Ee(n);return[o,i,o,a,s,a,s,i,o,i]}var QZ={getQuadkey:{type:"accessor",value:e=>e.quadkey}},Kf=class extends Sn{indexToBounds(){let{data:t,extruded:r,getQuadkey:n}=this.props,s=r?.99:1;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(i,o)=>HO(n(i,o),s),updateTriggers:{getPolygon:s}}}};Kf.layerName="QuadkeyLayer";Kf.defaultProps=QZ;var WO=Kf;var Eo=class{constructor(t){this.index=t,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get bbox(){return this._bbox}set bbox(t){this._bbox||(this._bbox=t,"west"in t?this.boundingBox=[[t.west,t.south],[t.east,t.north]]:this.boundingBox=[[t.left,t.top],[t.right,t.bottom]])}get data(){return this.isLoading&&this._loader?this._loader.then(()=>this.data):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return Boolean(this._loader)&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){let t=this.content?this.content.byteLength:0;return Number.isFinite(t)||console.error("byteLength not defined in tile data"),t}async _loadData({getData:t,requestScheduler:r,onLoad:n,onError:s}){let{index:i,id:o,bbox:a,userData:c,zoom:l}=this,h=this._loaderId;this._abortController=new AbortController;let{signal:f}=this._abortController,u=await r.scheduleRequest(this,m=>m.isSelected?1:-1);if(!u){this._isCancelled=!0;return}if(this._isCancelled){u.done();return}let d=null,p;try{d=await t({index:i,id:o,bbox:a,userData:c,zoom:l,signal:f})}catch(m){p=m||!0}finally{u.done()}if(h===this._loaderId){if(this._loader=void 0,this.content=d,this._isCancelled&&!d){this._isLoaded=!1;return}this._isLoaded=!0,this._isCancelled=!1,p?s(p,this):n(this)}}loadData(t){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(t),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){this.isLoaded||(this._isCancelled=!0,this._abortController?.abort())}};var Jt={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var GO=new D,tJ=new D,ii=class{constructor(t=[0,0,0],r=[0,0,0],n){n=n||GO.copy(t).add(r).scale(.5),this.center=new D(n),this.halfDiagonal=new D(r).subtract(this.center),this.minimum=new D(t),this.maximum=new D(r)}clone(){return new ii(this.minimum,this.maximum,this.center)}equals(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}transform(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}intersectPlane(t){let{halfDiagonal:r}=this,n=tJ.from(t.normal),s=r.x*Math.abs(n.x)+r.y*Math.abs(n.y)+r.z*Math.abs(n.z),i=this.center.dot(n)+t.distance;return i-s>0?Jt.INSIDE:i+s<0?Jt.OUTSIDE:Jt.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=GO.from(t).subtract(this.center),{halfDiagonal:n}=this,s=0,i;return i=Math.abs(r.x)-n.x,i>0&&(s+=i*i),i=Math.abs(r.y)-n.y,i>0&&(s+=i*i),i=Math.abs(r.z)-n.z,i>0&&(s+=i*i),s}};var Zf=new D,jO=new D,oi=class{constructor(t=[0,0,0],r=0){this.radius=-0,this.center=new D,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=Zf.from(r),this.center=new D().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new oi(this.center,this.radius)}union(t){let r=this.center,n=this.radius,s=t.center,i=t.radius,o=Zf.copy(s).subtract(r),a=o.magnitude();if(n>=a+i)return this.clone();if(i>=a+n)return t.clone();let c=(n+a+i)*.5;return jO.copy(o).scale((-n+c)/a).add(r),this.center.copy(jO),this.radius=c,this}expand(t){let n=Zf.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=qt.getScaling(Zf,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=Zf.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,i=t.normal.dot(r)+t.distance;return i<-n?Jt.OUTSIDE:i<n?Jt.INTERSECTING:Jt.INSIDE}};var eJ=new D,rJ=new D,Pg=new D,Rg=new D,Ig=new D,nJ=new D,sJ=new D,cs={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},bo=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new D().from(t),this.halfAxes=new zt(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new D(t).len(),new D(r).len(),new D(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),s=new D(t).normalize(),i=new D(r).normalize(),o=new D(n).normalize();return new Vs().fromMatrix3(new zt([...s,...i,...o]))}fromCenterHalfSizeQuaternion(t,r,n){let s=new Vs(n),i=new zt().fromQuaternion(s);return i[0]=i[0]*r[0],i[1]=i[1]*r[0],i[2]=i[2]*r[0],i[3]=i[3]*r[1],i[4]=i[4]*r[1],i[5]=i[5]*r[1],i[6]=i[6]*r[2],i[7]=i[7]*r[2],i[8]=i[8]*r[2],this.center=new D().from(t),this.halfAxes=i,this}clone(){return new bo(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new oi){let r=this.halfAxes,n=r.getColumn(0,Pg),s=r.getColumn(1,Rg),i=r.getColumn(2,Ig),o=eJ.copy(n).add(s).add(i);return t.center.copy(this.center),t.radius=o.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,s=this.halfAxes,i=n.x,o=n.y,a=n.z,c=Math.abs(i*s[cs.COLUMN0ROW0]+o*s[cs.COLUMN0ROW1]+a*s[cs.COLUMN0ROW2])+Math.abs(i*s[cs.COLUMN1ROW0]+o*s[cs.COLUMN1ROW1]+a*s[cs.COLUMN1ROW2])+Math.abs(i*s[cs.COLUMN2ROW0]+o*s[cs.COLUMN2ROW1]+a*s[cs.COLUMN2ROW2]),l=n.dot(r)+t.distance;return l<=-c?Jt.OUTSIDE:l>=c?Jt.INSIDE:Jt.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=rJ.from(t).subtract(this.center),n=this.halfAxes,s=n.getColumn(0,Pg),i=n.getColumn(1,Rg),o=n.getColumn(2,Ig),a=s.magnitude(),c=i.magnitude(),l=o.magnitude();s.normalize(),i.normalize(),o.normalize();let h=0,f;return f=Math.abs(r.dot(s))-a,f>0&&(h+=f*f),f=Math.abs(r.dot(i))-c,f>0&&(h+=f*f),f=Math.abs(r.dot(o))-l,f>0&&(h+=f*f),h}computePlaneDistances(t,r,n=[-0,-0]){let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,o=this.center,a=this.halfAxes,c=a.getColumn(0,Pg),l=a.getColumn(1,Rg),h=a.getColumn(2,Ig),f=nJ.copy(c).add(l).add(h).add(o),u=sJ.copy(f).subtract(t),d=r.dot(u);return s=Math.min(d,s),i=Math.max(d,i),f.copy(o).add(c).add(l).subtract(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),f.copy(o).add(c).subtract(l).add(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),f.copy(o).add(c).subtract(l).subtract(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),o.copy(f).subtract(c).add(l).add(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),o.copy(f).subtract(c).add(l).subtract(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),o.copy(f).subtract(c).subtract(l).add(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),o.copy(f).subtract(c).subtract(l).subtract(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),n[0]=s,n[1]=i,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,Pg);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,Rg);n.transformAsPoint(t);let s=this.halfAxes.getColumn(2,Ig);return s.transformAsPoint(t),this.halfAxes=new zt([...r,...n,...s]),this}getTransform(){throw new Error("not implemented")}};var qO=new D,YO=new D,Kr=class{constructor(t=[0,0,1],r=0){this.normal=new D,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return un(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=qO.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,s){return this.normal.set(t,r,n),un(Ut(this.normal.len(),1)),this.distance=s,this}clone(){return new Kr(this.normal,this.distance)}equals(t){return Ut(this.distance,t.distance)&&Ut(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=YO.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=qO.from(t),s=this.getPointDistance(n),i=YO.copy(this.normal).scale(s);return n.subtract(i).to(r)}};var XO=[new D([1,0,0]),new D([0,1,0]),new D([0,0,1])],$O=new D,iJ=new D,er=class{constructor(t=[]){this.planes=t}fromBoundingSphere(t){this.planes.length=2*XO.length;let r=t.center,n=t.radius,s=0;for(let i of XO){let o=this.planes[s],a=this.planes[s+1];o||(o=this.planes[s]=new Kr),a||(a=this.planes[s+1]=new Kr);let c=$O.copy(i).scale(-n).add(r);o.fromPointNormal(c,i);let l=$O.copy(i).scale(n).add(r),h=iJ.copy(i).negate();a.fromPointNormal(l,h),s+=2}return this}computeVisibility(t){let r=Jt.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case Jt.OUTSIDE:return Jt.OUTSIDE;case Jt.INTERSECTING:r=Jt.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(un(Number.isFinite(r),"parentPlaneMask is required."),r===er.MASK_OUTSIDE||r===er.MASK_INSIDE)return r;let n=er.MASK_INSIDE,s=this.planes;for(let i=0;i<this.planes.length;++i){let o=i<31?1<<i:0;if(i<31&&!(r&o))continue;let a=s[i],c=t.intersectPlane(a);if(c===Jt.OUTSIDE)return er.MASK_OUTSIDE;c===Jt.INTERSECTING&&(n|=o)}return n}};er.MASK_OUTSIDE=4294967295;er.MASK_INSIDE=0;er.MASK_INDETERMINATE=2147483647;var P6t=new D,R6t=new D,I6t=new D,O6t=new D,L6t=new D;var U6t=new D,z6t=new D,V6t=new D,H6t=new D,W6t=new D,G6t=new D,j6t=new D,q6t=new D,Y6t=new D,X6t=new D,$6t=new D,K6t=new D;var vn=new zt,aJ=new zt,cJ=new zt,Og=new zt,KO=new zt;function JA(e,t={}){let r=va.EPSILON20,n=10,s=0,i=0,o=aJ,a=cJ;o.identity(),a.copy(e);let c=r*lJ(a);for(;i<n&&hJ(a)>c;)fJ(a,Og),KO.copy(Og).transpose(),a.multiplyRight(Og),a.multiplyLeft(KO),o.multiplyRight(Og),++s>2&&(++i,s=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=a.toTarget(t.diagonal),t}function lJ(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var KA=[1,0,0],ZA=[2,2,1];function hJ(e){let t=0;for(let r=0;r<3;++r){let n=e[vn.getElementIndex(ZA[r],KA[r])];t+=2*n*n}return Math.sqrt(t)}function fJ(e,t){let r=va.EPSILON15,n=0,s=1;for(let l=0;l<3;++l){let h=Math.abs(e[vn.getElementIndex(ZA[l],KA[l])]);h>n&&(s=l,n=h)}let i=KA[s],o=ZA[s],a=1,c=0;if(Math.abs(e[vn.getElementIndex(o,i)])>r){let l=e[vn.getElementIndex(o,o)],h=e[vn.getElementIndex(i,i)],f=e[vn.getElementIndex(o,i)],u=(l-h)/2/f,d;u<0?d=-1/(-u+Math.sqrt(1+u*u)):d=1/(u+Math.sqrt(1+u*u)),a=1/Math.sqrt(1+d*d),c=d*a}return zt.IDENTITY.to(t),t[vn.getElementIndex(i,i)]=t[vn.getElementIndex(o,o)]=a,t[vn.getElementIndex(o,i)]=c,t[vn.getElementIndex(i,o)]=-c,t}var ai=new D,uJ=new D,dJ=new D,pJ=new D,mJ=new D,gJ=new zt,_J={diagonal:new zt,unitary:new zt};function QA(e,t=new bo){if(!e||e.length===0)return t.halfAxes=new zt([0,0,0,0,0,0,0,0,0]),t.center=new D,t;let r=e.length,n=new D(0,0,0);for(let b of e)n.add(b);let s=1/r;n.multiplyByScalar(s);let i=0,o=0,a=0,c=0,l=0,h=0;for(let b of e){let T=ai.copy(b).subtract(n);i+=T.x*T.x,o+=T.x*T.y,a+=T.x*T.z,c+=T.y*T.y,l+=T.y*T.z,h+=T.z*T.z}i*=s,o*=s,a*=s,c*=s,l*=s,h*=s;let f=gJ;f[0]=i,f[1]=o,f[2]=a,f[3]=o,f[4]=c,f[5]=l,f[6]=a,f[7]=l,f[8]=h;let{unitary:u}=JA(f,_J),d=t.halfAxes.copy(u),p=d.getColumn(0,dJ),m=d.getColumn(1,pJ),g=d.getColumn(2,mJ),_=-Number.MAX_VALUE,y=-Number.MAX_VALUE,x=-Number.MAX_VALUE,A=Number.MAX_VALUE,M=Number.MAX_VALUE,E=Number.MAX_VALUE;for(let b of e)ai.copy(b),_=Math.max(ai.dot(p),_),y=Math.max(ai.dot(m),y),x=Math.max(ai.dot(g),x),A=Math.min(ai.dot(p),A),M=Math.min(ai.dot(m),M),E=Math.min(ai.dot(g),E);p=p.multiplyByScalar(.5*(A+_)),m=m.multiplyByScalar(.5*(M+y)),g=g.multiplyByScalar(.5*(E+x)),t.center.copy(p).add(m).add(g);let w=uJ.set(_-A,y-M,x-E).multiplyByScalar(.5),v=new zt([w[0],0,0,0,w[1],0,0,0,w[2]]);return t.halfAxes.multiplyRight(v),t}var oc=512,ZO=3,JO=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],QO=JO.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),xJ=QO.concat([[.25,.5],[.75,.5]]),ci=class{constructor(t,r,n){this.x=t,this.y=r,this.z=n}get children(){if(!this._children){let t=this.x*2,r=this.y*2,n=this.z+1;this._children=[new ci(t,r,n),new ci(t,r+1,n),new ci(t+1,r,n),new ci(t+1,r+1,n)]}return this._children}update(t){let{viewport:r,cullingVolume:n,elevationBounds:s,minZ:i,maxZ:o,bounds:a,offset:c,project:l}=t,h=this.getBoundingVolume(s,c,l);if(a&&!this.insideBounds(a)||n.computeVisibility(h)<0)return!1;if(!this.childVisible){let{z:u}=this;if(u<o&&u>=i){let d=h.distanceTo(r.cameraPosition)*r.scale/r.height;u+=Math.floor(Math.log2(d))}if(u>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(let u of this.children)u.update(t);return!0}getSelected(t=[]){if(this.selected&&t.push(this),this._children)for(let r of this._children)r.getSelected(t);return t}insideBounds([t,r,n,s]){let i=Math.pow(2,this.z),o=oc/i;return this.x*o<n&&this.y*o<s&&(this.x+1)*o>t&&(this.y+1)*o>r}getBoundingVolume(t,r,n){if(n){let c=this.z<1?xJ:this.z<2?QO:JO,l=[];for(let h of c){let f=Lg(this.x+h[0],this.y+h[1],this.z);f[2]=t[0],l.push(n(f)),t[0]!==t[1]&&(f[2]=t[1],l.push(n(f)))}return QA(l)}let s=Math.pow(2,this.z),i=oc/s,o=this.x*i+r*oc,a=oc-(this.y+1)*i;return new ii([o,a,t[0]],[o+i,a+i,t[1]])}};function tL(e,t,r,n){let s=e instanceof Xr&&e.resolution?e.projectPosition:null,i=Object.values(e.getFrustumPlanes()).map(({normal:d,distance:p})=>new Kr(d.clone().negate(),p)),o=new er(i),a=e.distanceScales.unitsPerMeter[2],c=r&&r[0]*a||0,l=r&&r[1]*a||0,h=e instanceof Pe&&e.pitch<=60?t:0;if(n){let[d,p,m,g]=n,_=Kt([d,g]),y=Kt([m,p]);n=[_[0],oc-_[1],y[0],oc-y[1]]}let f=new ci(0,0,0),u={viewport:e,project:s,cullingVolume:o,elevationBounds:[c,l],minZ:h,maxZ:t,bounds:n,offset:0};if(f.update(u),e instanceof Pe&&e.subViewports&&e.subViewports.length>1){for(u.offset=-1;f.update(u)&&!(--u.offset<-ZO););for(u.offset=1;f.update(u)&&!(++u.offset>ZO););}return f.getSelected()}var ls=512,yJ=[-1/0,-1/0,1/0,1/0],li={type:"object",value:null,validate:(e,t)=>t.optional&&e===null||typeof e=="string"||Array.isArray(e)&&e.every(r=>typeof r=="string"),equal:(e,t)=>{if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;let r=e.length;if(r!==t.length)return!1;for(let n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}};function rL(e,t){let r=[t.transformAsPoint([e[0],e[1]]),t.transformAsPoint([e[2],e[1]]),t.transformAsPoint([e[0],e[3]]),t.transformAsPoint([e[2],e[3]])];return[Math.min(...r.map(s=>s[0])),Math.min(...r.map(s=>s[1])),Math.max(...r.map(s=>s[0])),Math.max(...r.map(s=>s[1]))]}function AJ(e){return Math.abs(e.split("").reduce((t,r)=>(t<<5)-t+r.charCodeAt(0)|0,0))}function wn(e,t){if(!e||!e.length)return null;let{index:r,id:n}=t;if(Array.isArray(e)){let i=AJ(n)%e.length;e=e[i]}let s=e;for(let i of Object.keys(r)){let o=new RegExp(`{${i}}`,"g");s=s.replace(o,String(r[i]))}return Number.isInteger(r.y)&&Number.isInteger(r.z)&&(s=s.replace(/\{-y\}/g,String(Math.pow(2,r.z)-r.y-1))),s}function TJ(e,t,r){let n;if(t&&t.length===2){let[s,i]=t,o=e.getBounds({z:s}),a=e.getBounds({z:i});n=[Math.min(o[0],a[0]),Math.min(o[1],a[1]),Math.max(o[2],a[2]),Math.max(o[3],a[3])]}else n=e.getBounds();return e.isGeospatial?[Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.min(n[2],r[2]),Math.min(n[3],r[3])]:[Math.max(Math.min(n[0],r[2]),r[0]),Math.max(Math.min(n[1],r[3]),r[1]),Math.min(Math.max(n[2],r[0]),r[2]),Math.min(Math.max(n[3],r[1]),r[3])]}function nL({viewport:e,z:t,cullRect:r}){return(e.subViewports||[e]).map(s=>tT(s,t||0,r))}function tT(e,t,r){if(!Array.isArray(t)){let i=r.x-e.x,o=r.y-e.y,{width:a,height:c}=r,l={targetZ:t},h=e.unproject([i,o],l),f=e.unproject([i+a,o],l),u=e.unproject([i,o+c],l),d=e.unproject([i+a,o+c],l);return[Math.min(h[0],f[0],u[0],d[0]),Math.min(h[1],f[1],u[1],d[1]),Math.max(h[0],f[0],u[0],d[0]),Math.max(h[1],f[1],u[1],d[1])]}let n=tT(e,t[0],r),s=tT(e,t[1],r);return[Math.min(n[0],s[0]),Math.min(n[1],s[1]),Math.max(n[2],s[2]),Math.max(n[3],s[3])]}function MJ(e,t,r){return r?rL(e,r).map(s=>s*t/ls):e.map(n=>n*t/ls)}function eT(e,t){return Math.pow(2,e)*ls/t}function Lg(e,t,r){let n=eT(r,ls),s=e/n*360-180,i=Math.PI-2*Math.PI*t/n,o=180/Math.PI*Math.atan(.5*(Math.exp(i)-Math.exp(-i)));return[s,o]}function eL(e,t,r,n){let s=eT(r,n);return[e/s*ls,t/s*ls]}function rT(e,t,r,n,s=ls){if(e.isGeospatial){let[l,h]=Lg(t,r,n),[f,u]=Lg(t+1,r+1,n);return{west:l,north:h,east:f,south:u}}let[i,o]=eL(t,r,n,s),[a,c]=eL(t+1,r+1,n,s);return{left:i,top:o,right:a,bottom:c}}function EJ(e,t,r,n,s){let i=TJ(e,null,n),o=eT(t,r),[a,c,l,h]=MJ(i,o,s),f=[];for(let u=Math.floor(a);u<l;u++)for(let d=Math.floor(c);d<h;d++)f.push({x:u,y:d,z:t});return f}function nT({viewport:e,maxZoom:t,minZoom:r,zRange:n,extent:s,tileSize:i=ls,modelMatrix:o,modelMatrixInverse:a,zoomOffset:c=0}){let l=e.isGeospatial?Math.round(e.zoom+Math.log2(ls/i))+c:Math.ceil(e.zoom)+c;if(typeof r=="number"&&Number.isFinite(r)&&l<r){if(!s)return[];l=r}typeof t=="number"&&Number.isFinite(t)&&l>t&&(l=t);let h=s;return o&&a&&s&&!e.isGeospatial&&(h=rL(s,o)),e.isGeospatial?tL(e,l,n,s):EJ(e,l,i,h||yJ,a)}function sT(e){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)}function iT(e){return Number.isFinite(e.west)&&Number.isFinite(e.north)&&Number.isFinite(e.east)&&Number.isFinite(e.south)}function sL(e){let t={},r;return n=>{for(let s in n)if(!bJ(n[s],t[s])){r=e(n),t=n;break}return r}}function bJ(e,t){if(e===t)return!0;if(Array.isArray(e)){let r=e.length;if(!t||t.length!==r)return!1;for(let n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}return!1}var iL=1,Ng=2,SJ="never",vJ="no-overlap",Jf="best-available",wJ=5,CJ={[Jf]:RJ,[vJ]:IJ,[SJ]:()=>{}},PJ={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{}},So=class{constructor(t){this._getCullBounds=sL(nL),this.opts={...PJ,...t},this.setOptions(this.opts),this.onTileLoad=r=>{this.opts.onTileLoad?.(r),this.opts.maxCacheByteSize!==null&&(this._cacheByteSize+=r.byteLength,this._resizeCache())},this._requestScheduler=new vs({throttleRequests:this.opts.maxRequests>0||this.opts.debounceTime>0,maxRequests:this.opts.maxRequests,debounceTime:this.opts.debounceTime}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._zRange=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new K,this._modelMatrixInverse=new K}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return this._selectedTiles!==null&&this._selectedTiles.every(t=>t.isLoaded)}get needsReload(){return this._selectedTiles!==null&&this._selectedTiles.some(t=>t.needsReload)}setOptions(t){Object.assign(this.opts,t),Number.isFinite(t.maxZoom)&&(this._maxZoom=Math.floor(t.maxZoom)),Number.isFinite(t.minZoom)&&(this._minZoom=Math.ceil(t.minZoom))}finalize(){for(let t of this._cache.values())t.isLoading&&t.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(let t of this._cache.keys()){let r=this._cache.get(t);!this._selectedTiles||!this._selectedTiles.includes(r)?this._cache.delete(t):r.setNeedsReload()}}update(t,{zRange:r,modelMatrix:n}={zRange:null,modelMatrix:null}){let s=n?new K(n):new K,i=!s.equals(this._modelMatrix);if(!this._viewport||!t.equals(this._viewport)||!Ut(this._zRange,r)||i){i&&(this._modelMatrixInverse=s.clone().invert(),this._modelMatrix=s),this._viewport=t,this._zRange=r;let a=this.getTileIndices({viewport:t,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:r,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=a.map(c=>this._getTile(c,!0)),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(a=>this._getTile(a.index,!0)));let o=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),o&&this._frameNumber++,this._frameNumber}isTileVisible(t,r){if(!t.isVisible)return!1;if(r&&this._viewport){let n=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:r}),{bbox:s}=t;for(let[i,o,a,c]of n){let l;if("west"in s)l=s.west<a&&s.east>i&&s.south<c&&s.north>o;else{let h=Math.min(s.top,s.bottom),f=Math.max(s.top,s.bottom);l=s.left<a&&s.right>i&&h<c&&f>o}if(l)return!0}return!1}return!0}getTileIndices({viewport:t,maxZoom:r,minZoom:n,zRange:s,modelMatrix:i,modelMatrixInverse:o}){let{tileSize:a,extent:c,zoomOffset:l}=this.opts;return nT({viewport:t,maxZoom:r,minZoom:n,zRange:s,tileSize:a,extent:c,modelMatrix:i,modelMatrixInverse:o,zoomOffset:l})}getTileId(t){return`${t.x}-${t.y}-${t.z}`}getTileZoom(t){return t.z}getTileMetadata(t){let{tileSize:r}=this.opts;return{bbox:rT(this._viewport,t.x,t.y,t.z,r)}}getParentIndex(t){let r=Math.floor(t.x/2),n=Math.floor(t.y/2),s=t.z-1;return{x:r,y:n,z:s}}updateTileStates(){let t=this.opts.refinementStrategy||Jf,r=new Array(this._cache.size),n=0;for(let s of this._cache.values())r[n++]=s.isVisible,s.isSelected=!1,s.isVisible=!1;for(let s of this._selectedTiles)s.isSelected=!0,s.isVisible=!0;(typeof t=="function"?t:CJ[t])(Array.from(this._cache.values())),n=0;for(let s of this._cache.values())if(r[n++]!==s.isVisible)return!0;return!1}_pruneRequests(){let{maxRequests:t=0}=this.opts,r=[],n=0;for(let s of this._cache.values())s.isLoading&&(n++,!s.isSelected&&!s.isVisible&&r.push(s));for(;t>0&&n>t&&r.length>0;)r.shift().abort(),n--}_rebuildTree(){let{_cache:t}=this;for(let r of t.values())r.parent=null,r.children&&(r.children.length=0);for(let r of t.values()){let n=this._getNearestAncestor(r);r.parent=n,n?.children&&n.children.push(r)}}_resizeCache(){let{_cache:t,opts:r}=this,n=r.maxCacheSize??(r.maxCacheByteSize!==null?1/0:wJ*this.selectedTiles.length),s=r.maxCacheByteSize??1/0;if(t.size>n||this._cacheByteSize>s){for(let[o,a]of t)if(!a.isVisible&&!a.isSelected&&(this._cacheByteSize-=r.maxCacheByteSize!==null?a.byteLength:0,t.delete(o),this.opts.onTileUnload?.(a)),t.size<=n&&this._cacheByteSize<=s)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((o,a)=>o.zoom-a.zoom),this._dirty=!1)}_getTile(t,r){let n=this.getTileId(t),s=this._cache.get(n),i=!1;return!s&&r?(s=new Eo(t),Object.assign(s,this.getTileMetadata(s.index)),Object.assign(s,{id:n,zoom:this.getTileZoom(s.index)}),i=!0,this._cache.set(n,s),this._dirty=!0):s&&s.needsReload&&(i=!0),s&&i&&s.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),s}_getNearestAncestor(t){let{_minZoom:r=0}=this,n=t.index;for(;this.getTileZoom(n)>r;){n=this.getParentIndex(n);let s=this._getTile(n);if(s)return s}return null}};function RJ(e){for(let t of e)t.state=0;for(let t of e)t.isSelected&&!oL(t)&&oT(t);for(let t of e)t.isVisible=Boolean(t.state&Ng)}function IJ(e){for(let r of e)r.state=0;for(let r of e)r.isSelected&&oL(r);let t=Array.from(e).sort((r,n)=>r.zoom-n.zoom);for(let r of t)if(r.isVisible=Boolean(r.state&Ng),r.children&&(r.isVisible||r.state&iL))for(let n of r.children)n.state=iL;else r.isSelected&&oT(r)}function oL(e){let t=e;for(;t;){if(t.isLoaded||t.content)return t.state|=Ng,!0;t=t.parent}return!1}function oT(e){for(let t of e.children)t.isLoaded||t.content?t.state|=Ng:oT(t)}var OJ={TilesetClass:So,data:{type:"data",value:[]},dataComparator:li.equal,renderSubLayers:{type:"function",value:e=>new yo(e)},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:e=>{}},onTileUnload:{type:"function",value:e=>{}},onTileError:{type:"function",value:e=>console.error(e)},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:Jf,zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0},Qf=class extends Dt{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){this.state?.tileset?.finalize()}get isLoaded(){return Boolean(this.state?.tileset?.selectedTiles?.every(t=>t.isLoaded&&t.layers&&t.layers.every(r=>r.isLoaded)))}shouldUpdateState({changeFlags:t}){return t.somethingChanged}updateState({changeFlags:t}){let{tileset:r}=this.state,n=t.propsOrDataChanged||t.updateTriggersChanged,s=t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getTileData);r?n&&(r.setOptions(this._getTilesetOptions()),s?r.reloadAll():r.tiles.forEach(i=>{i.layers=null})):(r=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:r})),this._updateTileset()}_getTilesetOptions(){let{tileSize:t,maxCacheSize:r,maxCacheByteSize:n,refinementStrategy:s,extent:i,maxZoom:o,minZoom:a,maxRequests:c,debounceTime:l,zoomOffset:h}=this.props;return{maxCacheSize:r,maxCacheByteSize:n,maxZoom:o,minZoom:a,tileSize:t,refinementStrategy:s,extent:i,maxRequests:c,debounceTime:l,zoomOffset:h,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){let t=this.state.tileset,{zRange:r,modelMatrix:n}=this.props,s=t.update(this.context.viewport,{zRange:r,modelMatrix:n}),{isLoaded:i}=t,o=this.state.isLoaded!==i,a=this.state.frameNumber!==s;i&&(o||a)&&this._onViewportLoad(),a&&this.setState({frameNumber:s}),this.state.isLoaded=i}_onViewportLoad(){let{tileset:t}=this.state,{onViewportLoad:r}=this.props;r&&r(t.selectedTiles)}_onTileLoad(t){this.props.onTileLoad(t),t.layers=null,this.setNeedsUpdate()}_onTileError(t,r){this.props.onTileError(t),r.layers=null,this.setNeedsUpdate()}_onTileUnload(t){this.props.onTileUnload(t)}getTileData(t){let{data:r,getTileData:n,fetch:s}=this.props,{signal:i}=t;return t.url=typeof r=="string"||Array.isArray(r)?wn(r,t):null,n?n(t):s&&t.url?s(t.url,{propName:"data",layer:this,signal:i}):null}renderSubLayers(t){return this.props.renderSubLayers(t)}getSubLayerPropsByTile(t){return null}getPickingInfo(t){let r=t.sourceLayer,n=r.props.tile,s=t.info;return s.picked&&(s.tile=n),s.sourceTile=n,s.sourceTileSubLayer=r,s}_updateAutoHighlight(t){t.sourceTileSubLayer.updateAutoHighlight(t)}renderLayers(){return this.state.tileset.tiles.map(t=>{let r=this.getSubLayerPropsByTile(t);if(!(!t.isLoaded&&!t.content))if(t.layers)r&&t.layers[0]&&Object.keys(r).some(n=>t.layers[0].props[n]!==r[n])&&(t.layers=t.layers.map(n=>n.clone(r)));else{let n=this.renderSubLayers({...this.props,...this.getSubLayerProps({id:t.id,updateTriggers:this.props.updateTriggers}),data:t.content,_offset:0,tile:t});t.layers=We(n,Boolean).map(s=>s.clone({tile:t,...r}))}return t.layers})}filterSubLayer({layer:t,cullRect:r}){let{tile:n}=t.props;return this.state.tileset.isTileVisible(n,r)}};Qf.defaultProps=OJ;Qf.layerName="TileLayer";var vo=Qf;var aL=`uniform tripsUniforms {
4453
+ `;var iK={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,borderRadius:{type:"object",value:0},padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:e=>e.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}},Ff=class extends ut{getShaders(){return super.getShaders({vs:OI,fs:LI,modules:[st,Tt,II]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,type:"unorm8",accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,type:"unorm8",accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(t){super.updateState(t);let{changeFlags:r}=t;r.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:t}){let{billboard:r,sizeScale:n,sizeUnits:s,sizeMinPixels:i,sizeMaxPixels:o,getLineWidth:a}=this.props,{padding:c,borderRadius:l}=this.props;c.length<4&&(c=[c[0],c[1],c[0],c[1]]),Array.isArray(l)||(l=[l,l,l,l]);let h=this.state.model,f={billboard:r,stroked:Boolean(a),borderRadius:l,padding:c,sizeUnits:St[s],sizeScale:n,sizeMinPixels:i,sizeMaxPixels:o};h.shaderInputs.setProps({textBackground:f}),h.draw(this.context.renderPass)}_getModel(){let t=[0,0,1,0,0,1,1,1];return new X(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new it({topology:"triangle-strip",vertexCount:4,attributes:{positions:{size:2,value:new Float32Array(t)}}}),isInstanced:!0})}};Ff.defaultProps=iK;Ff.layerName="TextBackgroundLayer";var Ag=Ff;var NI={start:1,middle:0,end:-1},BI={top:1,center:0,bottom:-1},PA=[0,0,0,255],oK=1,aK={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:PA},getBorderWidth:{type:"accessor",value:0},backgroundBorderRadius:{type:"object",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:xo.characterSet},fontFamily:xo.fontFamily,fontWeight:xo.fontWeight,lineHeight:oK,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:PA},fontSettings:{type:"object",value:{},compare:1},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:e=>e.text},getPosition:{type:"accessor",value:e=>e.position},getColor:{type:"accessor",value:PA},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}},Df=class extends Dt{constructor(){super(...arguments),this.getBoundingRect=(t,r)=>{let{size:[n,s]}=this.transformParagraph(t,r),{fontSize:i}=this.state.fontAtlasManager.props;n/=i,s/=i;let{getTextAnchor:o,getAlignmentBaseline:a}=this.props,c=NI[typeof o=="function"?o(t,r):o],l=BI[typeof a=="function"?a(t,r):a];return[(c-1)*n/2,(l-1)*s/2,n,s]},this.getIconOffsets=(t,r)=>{let{getTextAnchor:n,getAlignmentBaseline:s}=this.props,{x:i,y:o,rowWidth:a,size:[c,l]}=this.transformParagraph(t,r),h=NI[typeof n=="function"?n(t,r):n],f=BI[typeof s=="function"?s(t,r):s],u=i.length,d=new Array(u*2),p=0;for(let m=0;m<u;m++){let g=(1-h)*(c-a[m])/2;d[p++]=(h-1)*c/2+g+i[m],d[p++]=(f-1)*l/2+o[m]}return d}}initializeState(){this.state={styleVersion:0,fontAtlasManager:new Bf},this.props.maxWidth>0&&k.once(1,"v8.9 breaking change: TextLayer maxWidth is now relative to text size")()}updateState(t){let{props:r,oldProps:n,changeFlags:s}=t;(s.dataChanged||s.updateTriggersChanged&&(s.updateTriggersChanged.all||s.updateTriggersChanged.getText))&&this._updateText(),(this._updateFontAtlas()||r.lineHeight!==n.lineHeight||r.wordBreak!==n.wordBreak||r.maxWidth!==n.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:t}){return t.object=t.index>=0?this.props.data[t.index]:null,t}_updateFontAtlas(){let{fontSettings:t,fontFamily:r,fontWeight:n}=this.props,{fontAtlasManager:s,characterSet:i}=this.state,o={...t,characterSet:i,fontFamily:r,fontWeight:n};if(!s.mapping)return s.setProps(o),!0;for(let a in o)if(o[a]!==s.props[a])return s.setProps(o),!0;return!1}_updateText(){let{data:t,characterSet:r}=this.props,n=t.attributes?.getText,{getText:s}=this.props,i=t.startIndices,o,a=r==="auto"&&new Set;if(n&&i){let{texts:c,characterCount:l}=EI({...ArrayBuffer.isView(n)?{value:n}:n,length:t.length,startIndices:i,characterSet:a});o=l,s=(h,{index:f})=>c[f]}else{let{iterable:c,objectInfo:l}=$t(t);i=[0],o=0;for(let h of c){l.index++;let f=Array.from(s(h,l)||"");a&&f.forEach(a.add,a),o+=f.length,i.push(o)}}this.setState({getText:s,startIndices:i,numInstances:o,characterSet:a||r})}transformParagraph(t,r){let{fontAtlasManager:n}=this.state,s=n.mapping,i=this.state.getText,{wordBreak:o,lineHeight:a,maxWidth:c}=this.props,l=i(t,r)||"";return MI(l,a,o,c*n.props.fontSize,s)}renderLayers(){let{startIndices:t,numInstances:r,getText:n,fontAtlasManager:{scale:s,atlas:i,mapping:o},styleVersion:a}=this.state,{data:c,_dataDiff:l,getPosition:h,getColor:f,getSize:u,getAngle:d,getPixelOffset:p,getBackgroundColor:m,getBorderColor:g,getBorderWidth:_,backgroundBorderRadius:y,backgroundPadding:x,background:A,billboard:M,fontSettings:E,outlineWidth:w,outlineColor:v,sizeScale:b,sizeUnits:T,sizeMinPixels:I,sizeMaxPixels:B,transitions:N,updateTriggers:C}=this.props,V=this.getSubLayerClass("characters",xg),tt=this.getSubLayerClass("background",Ag);return[A&&new tt({getFillColor:m,getLineColor:g,getLineWidth:_,borderRadius:y,padding:x,getPosition:h,getSize:u,getAngle:d,getPixelOffset:p,billboard:M,sizeScale:b,sizeUnits:T,sizeMinPixels:I,sizeMaxPixels:B,transitions:N&&{getPosition:N.getPosition,getAngle:N.getAngle,getSize:N.getSize,getFillColor:N.getBackgroundColor,getLineColor:N.getBorderColor,getLineWidth:N.getBorderWidth,getPixelOffset:N.getPixelOffset}},this.getSubLayerProps({id:"background",updateTriggers:{getPosition:C.getPosition,getAngle:C.getAngle,getSize:C.getSize,getFillColor:C.getBackgroundColor,getLineColor:C.getBorderColor,getLineWidth:C.getBorderWidth,getPixelOffset:C.getPixelOffset,getBoundingRect:{getText:C.getText,getTextAnchor:C.getTextAnchor,getAlignmentBaseline:C.getAlignmentBaseline,styleVersion:a}}}),{data:c.attributes&&c.attributes.background?{length:c.length,attributes:c.attributes.background}:c,_dataDiff:l,autoHighlight:!1,getBoundingRect:this.getBoundingRect}),new V({sdf:E.sdf,smoothing:Number.isFinite(E.smoothing)?E.smoothing:xo.smoothing,outlineWidth:w/(E.radius||xo.radius),outlineColor:v,iconAtlas:i,iconMapping:o,getPosition:h,getColor:f,getSize:u,getAngle:d,getPixelOffset:p,billboard:M,sizeScale:b*s,sizeUnits:T,sizeMinPixels:I*s,sizeMaxPixels:B*s,transitions:N&&{getPosition:N.getPosition,getAngle:N.getAngle,getColor:N.getColor,getSize:N.getSize,getPixelOffset:N.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{all:C.getText,getPosition:C.getPosition,getAngle:C.getAngle,getColor:C.getColor,getSize:C.getSize,getPixelOffset:C.getPixelOffset,getIconOffsets:{getTextAnchor:C.getTextAnchor,getAlignmentBaseline:C.getAlignmentBaseline,styleVersion:a}}}),{data:c,_dataDiff:l,startIndices:t,numInstances:r,getIconOffsets:this.getIconOffsets,getIcon:n})]}static set fontAtlasCacheLimit(t){PI(t)}};Df.defaultProps=aK;Df.layerName="TextLayer";var Tg=Df;var kf={circle:{type:ng,props:{filled:"filled",stroked:"stroked",lineWidthMaxPixels:"lineWidthMaxPixels",lineWidthMinPixels:"lineWidthMinPixels",lineWidthScale:"lineWidthScale",lineWidthUnits:"lineWidthUnits",pointRadiusMaxPixels:"radiusMaxPixels",pointRadiusMinPixels:"radiusMinPixels",pointRadiusScale:"radiusScale",pointRadiusUnits:"radiusUnits",pointAntialiasing:"antialiasing",pointBillboard:"billboard",getFillColor:"getFillColor",getLineColor:"getLineColor",getLineWidth:"getLineWidth",getPointRadius:"getRadius"}},icon:{type:Za,props:{iconAtlas:"iconAtlas",iconMapping:"iconMapping",iconSizeMaxPixels:"sizeMaxPixels",iconSizeMinPixels:"sizeMinPixels",iconSizeScale:"sizeScale",iconSizeUnits:"sizeUnits",iconAlphaCutoff:"alphaCutoff",iconBillboard:"billboard",getIcon:"getIcon",getIconAngle:"getAngle",getIconColor:"getColor",getIconPixelOffset:"getPixelOffset",getIconSize:"getSize"}},text:{type:Tg,props:{textSizeMaxPixels:"sizeMaxPixels",textSizeMinPixels:"sizeMinPixels",textSizeScale:"sizeScale",textSizeUnits:"sizeUnits",textBackground:"background",textBackgroundPadding:"backgroundPadding",textFontFamily:"fontFamily",textFontWeight:"fontWeight",textLineHeight:"lineHeight",textMaxWidth:"maxWidth",textOutlineColor:"outlineColor",textOutlineWidth:"outlineWidth",textWordBreak:"wordBreak",textCharacterSet:"characterSet",textBillboard:"billboard",textFontSettings:"fontSettings",getText:"getText",getTextAngle:"getAngle",getTextColor:"getColor",getTextPixelOffset:"getPixelOffset",getTextSize:"getSize",getTextAnchor:"getTextAnchor",getTextAlignmentBaseline:"getAlignmentBaseline",getTextBackgroundColor:"getBackgroundColor",getTextBorderColor:"getBorderColor",getTextBorderWidth:"getBorderWidth"}}},Uf={type:bn,props:{lineWidthUnits:"widthUnits",lineWidthScale:"widthScale",lineWidthMinPixels:"widthMinPixels",lineWidthMaxPixels:"widthMaxPixels",lineJointRounded:"jointRounded",lineCapRounded:"capRounded",lineMiterLimit:"miterLimit",lineBillboard:"billboard",getLineColor:"getColor",getLineWidth:"getWidth"}},Mg={type:ri,props:{extruded:"extruded",filled:"filled",wireframe:"wireframe",elevationScale:"elevationScale",material:"material",_full3d:"_full3d",getElevation:"getElevation",getFillColor:"getFillColor",getLineColor:"getLineColor"}};function rc({type:e,props:t}){let r={};for(let n in t)r[n]=e.defaultProps[t[n]];return r}function Eg(e,t){let{transitions:r,updateTriggers:n}=e.props,s={updateTriggers:{},transitions:r&&{getPosition:r.geometry}};for(let i in t){let o=t[i],a=e.props[i];i.startsWith("get")&&(a=e.getSubLayerAccessor(a),s.updateTriggers[o]=n[i],r&&(s.transitions[o]=r[i])),s[o]=a}return s}function DI(e){if(Array.isArray(e))return e;switch(k.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return k.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}function RA(e,t,r={}){let n={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},{startRow:s=0,endRow:i=e.length}=r;for(let o=s;o<i;o++){let a=e[o],{geometry:c}=a;if(c)if(c.type==="GeometryCollection"){k.assert(Array.isArray(c.geometries),"GeoJSON does not have geometries array");let{geometries:l}=c;for(let h=0;h<l.length;h++){let f=l[h];FI(f,n,t,a,o)}}else FI(c,n,t,a,o)}return n}function FI(e,t,r,n,s){let{type:i,coordinates:o}=e,{pointFeatures:a,lineFeatures:c,polygonFeatures:l,polygonOutlineFeatures:h}=t;if(!lK(i,o)){k.warn(`${i} coordinates are malformed`)();return}switch(i){case"Point":a.push(r({geometry:e},n,s));break;case"MultiPoint":o.forEach(f=>{a.push(r({geometry:{type:"Point",coordinates:f}},n,s))});break;case"LineString":c.push(r({geometry:e},n,s));break;case"MultiLineString":o.forEach(f=>{c.push(r({geometry:{type:"LineString",coordinates:f}},n,s))});break;case"Polygon":l.push(r({geometry:e},n,s)),o.forEach(f=>{h.push(r({geometry:{type:"LineString",coordinates:f}},n,s))});break;case"MultiPolygon":o.forEach(f=>{l.push(r({geometry:{type:"Polygon",coordinates:f}},n,s)),f.forEach(u=>{h.push(r({geometry:{type:"LineString",coordinates:u}},n,s))})});break;default:}}var cK={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function lK(e,t){let r=cK[e];for(k.assert(r,`Unknown GeoJSON type ${e}`);t&&--r>0;)t=t[0];return t&&Number.isFinite(t[0])}function kI(){return{points:{},lines:{},polygons:{},polygonsOutline:{}}}function bg(e){return e.geometry.coordinates}function UI(e,t){let r=kI(),{pointFeatures:n,lineFeatures:s,polygonFeatures:i,polygonOutlineFeatures:o}=e;return r.points.data=n,r.points._dataDiff=t.pointFeatures&&(()=>t.pointFeatures),r.points.getPosition=bg,r.lines.data=s,r.lines._dataDiff=t.lineFeatures&&(()=>t.lineFeatures),r.lines.getPath=bg,r.polygons.data=i,r.polygons._dataDiff=t.polygonFeatures&&(()=>t.polygonFeatures),r.polygons.getPolygon=bg,r.polygonsOutline.data=o,r.polygonsOutline._dataDiff=t.polygonOutlineFeatures&&(()=>t.polygonOutlineFeatures),r.polygonsOutline.getPath=bg,r}function zI(e,t){let r=kI(),{points:n,lines:s,polygons:i}=e,o=uI(e,t);return r.points.data={length:n.positions.value.length/n.positions.size,attributes:{...n.attributes,getPosition:n.positions,instancePickingColors:{size:4,value:o.points}},properties:n.properties,numericProps:n.numericProps,featureIds:n.featureIds},r.lines.data={length:s.pathIndices.value.length-1,startIndices:s.pathIndices.value,attributes:{...s.attributes,getPath:s.positions,instancePickingColors:{size:4,value:o.lines}},properties:s.properties,numericProps:s.numericProps,featureIds:s.featureIds},r.lines._pathType="open",r.polygons.data={length:i.polygonIndices.value.length-1,startIndices:i.polygonIndices.value,attributes:{...i.attributes,getPolygon:i.positions,pickingColors:{size:4,value:o.polygons}},properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},r.polygons._normalize=!1,i.triangles&&(r.polygons.data.attributes.indices=i.triangles.value),r.polygonsOutline.data={length:i.primitivePolygonIndices.value.length-1,startIndices:i.primitivePolygonIndices.value,attributes:{...i.attributes,getPath:i.positions,instancePickingColors:{size:4,value:o.polygons}},properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},r.polygonsOutline._pathType="open",r}var hK=["points","linestrings","polygons"],fK={...rc(kf.circle),...rc(kf.icon),...rc(kf.text),...rc(Uf),...rc(Mg),stroked:!0,filled:!0,extruded:!1,wireframe:!1,_full3d:!1,iconAtlas:{type:"object",value:null},iconMapping:{type:"object",value:{}},getIcon:{type:"accessor",value:e=>e.properties.icon},getText:{type:"accessor",value:e=>e.properties.text},pointType:"circle",getRadius:{deprecatedFor:"getPointRadius"}},zf=class extends Dt{initializeState(){this.state={layerProps:{},features:{},featuresDiff:{}}}updateState({props:t,changeFlags:r}){if(!r.dataChanged)return;let{data:n}=this.props,s=n&&"points"in n&&"polygons"in n&&"lines"in n;this.setState({binary:s}),s?this._updateStateBinary({props:t,changeFlags:r}):this._updateStateJSON({props:t,changeFlags:r})}_updateStateBinary({props:t,changeFlags:r}){let n=zI(t.data,this.encodePickingColor);this.setState({layerProps:n})}_updateStateJSON({props:t,changeFlags:r}){let n=DI(t.data),s=this.getSubLayerRow.bind(this),i={},o={};if(Array.isArray(r.dataChanged)){let c=this.state.features;for(let l in c)i[l]=c[l].slice(),o[l]=[];for(let l of r.dataChanged){let h=RA(n,s,l);for(let f in c)o[f].push(_g({data:i[f],getIndex:u=>u.__source.index,dataRange:l,replace:h[f]}))}}else i=RA(n,s);let a=UI(i,o);this.setState({features:i,featuresDiff:o,layerProps:a})}getPickingInfo(t){let r=super.getPickingInfo(t),{index:n,sourceLayer:s}=r;return r.featureType=hK.find(i=>s.id.startsWith(`${this.id}-${i}-`)),n>=0&&s.id.startsWith(`${this.id}-points-text`)&&this.state.binary&&(r.index=this.props.data.points.globalFeatureIds.value[n]),r}_updateAutoHighlight(t){let r=`${this.id}-points-`,n=t.featureType==="points";for(let s of this.getSubLayers())s.id.startsWith(r)===n&&s.updateAutoHighlight(t)}_renderPolygonLayer(){let{extruded:t,wireframe:r}=this.props,{layerProps:n}=this.state,s="polygons-fill",i=this.shouldRenderSubLayer(s,n.polygons?.data)&&this.getSubLayerClass(s,Mg.type);if(i){let o=Eg(this,Mg.props),a=t&&r;return a||delete o.getLineColor,o.updateTriggers.lineColors=a,new i(o,this.getSubLayerProps({id:s,updateTriggers:o.updateTriggers}),n.polygons)}return null}_renderLineLayers(){let{extruded:t,stroked:r}=this.props,{layerProps:n}=this.state,s="polygons-stroke",i="linestrings",o=!t&&r&&this.shouldRenderSubLayer(s,n.polygonsOutline?.data)&&this.getSubLayerClass(s,Uf.type),a=this.shouldRenderSubLayer(i,n.lines?.data)&&this.getSubLayerClass(i,Uf.type);if(o||a){let c=Eg(this,Uf.props);return[o&&new o(c,this.getSubLayerProps({id:s,updateTriggers:c.updateTriggers}),n.polygonsOutline),a&&new a(c,this.getSubLayerProps({id:i,updateTriggers:c.updateTriggers}),n.lines)]}return null}_renderPointLayers(){let{pointType:t}=this.props,{layerProps:r,binary:n}=this.state,{highlightedObjectIndex:s}=this.props;!n&&Number.isFinite(s)&&(s=r.points.data.findIndex(a=>a.__source.index===s));let i=new Set(t.split("+")),o=[];for(let a of i){let c=`points-${a}`,l=kf[a],h=l&&this.shouldRenderSubLayer(c,r.points?.data)&&this.getSubLayerClass(c,l.type);if(h){let f=Eg(this,l.props),u=r.points;if(a==="text"&&n){let{instancePickingColors:d,...p}=u.data.attributes;u={...u,data:{...u.data,attributes:p}}}o.push(new h(f,this.getSubLayerProps({id:c,updateTriggers:f.updateTriggers,highlightedObjectIndex:s}),u))}}return o}renderLayers(){let{extruded:t}=this.props,r=this._renderPolygonLayer(),n=this._renderLineLayers(),s=this._renderPointLayers();return[!t&&r,n,s,t&&r]}getSubLayerAccessor(t){let{binary:r}=this.state;return!r||typeof t!="function"?super.getSubLayerAccessor(t):(n,s)=>{let{data:i,index:o}=s,a=fI(i,o);return t(a,s)}}};zf.layerName="GeoJsonLayer";zf.defaultProps=fK;var yo=zf;function uK(e){return typeof e=="string"?e.charAt(0).toLowerCase()+e.slice(1):e}function Sg(e){if(Array.isArray(e))return e.map(t=>Sg(t));if(e&&typeof e=="object"){let t={};for(let[r,n]of Object.entries(e))t[uK(r)]=Sg(n);return t}return e}var yO=Dn(xO(),1);function UA(e,t){if(t?._parser&&t._parser!=="fast-xml-parser")throw new Error(t?._parser);let r={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:t?.removeNSPrefix,textNodeName:t?.textNodeName,isArray:(s,i,o,a)=>Boolean(t?.arrayPaths?.some(l=>i===l)),...t?._fastXML},n=TZ(e,r);return t?.uncapitalizeKeys?Sg(n):n}function TZ(e,t){return new yO.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...t}).parse(e)}var MZ="4.2.1",$r={dataType:null,batchType:null,name:"XML",id:"xml",module:"xml",version:MZ,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:EZ,options:{xml:{_parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:async(e,t)=>UA(new TextDecoder().decode(e),{...$r.options.xml,...t?.xml}),parseTextSync:(e,t)=>UA(e,{...$r.options.xml,...t?.xml})};function EZ(e){return e.startsWith("<?xml")}function AO(e,t){let r=$r.parseTextSync?.(e,t),n=r?.ServiceExceptionReport?.ServiceException||r?.["ogc:ServiceExceptionReport"]?.["ogc:ServiceException"];return typeof n=="string"?n:n.value||n.code||"Unknown error"}var bZ="4.2.1",Wf={dataType:null,batchType:null,id:"wms-error",name:"WMS Error",module:"wms",version:bZ,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:SZ,options:{wms:{throwOnError:!1}},parse:async(e,t)=>zA(new TextDecoder().decode(e),t),parseSync:(e,t)=>zA(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>zA(e,t)};function SZ(e){return e.startsWith("<?xml")}function zA(e,t){let r={...Wf.options.wms,...t?.wms},n=AO(e,r),s=r.minimalErrors?n:`WMS Service error: ${n}`;if(r.throwOnError)throw new Error(s);return s}function To(e){return Array.isArray(e)?e:e?[e]:[]}function Gf(e){let t=To(e);return t.length>0&&t.every(r=>typeof r=="string")?t:[]}function jf(e,t=void 0){switch(typeof e){case"number":return e;case"string":return parseFloat(e);default:return}}function wg(e,t=void 0){switch(typeof e){case"number":return e;case"string":return parseInt(e,10);default:return}}function Mo(e){switch(e){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1;default:return!1}}function VA(e,t){let r=$r.parseTextSync?.(e,t),n=r.WMT_MS_Capabilities||r.WMS_Capabilities||r,s=vZ(n);if(t?.inheritedLayerProps)for(let i of s.layers)MO(i,null);return t?.includeRawJSON&&(s.json=n),t?.includeXMLText&&(s.xml=e),s}function vZ(e){let t={version:String(e.version||""),name:String(e.Service?.Name||"unnamed"),title:e.Service?.Title?String(e.Service?.Title):void 0,abstract:e.Service?.Abstract?String(e.Service?.Abstract):void 0,keywords:Gf(e.Service?.KeywordList?.Keyword),fees:e.Service?.Fees?JSON.stringify(e.Service?.Fees):void 0,accessConstraints:e.Service?.AccessConstraints?JSON.stringify(e.Service?.AccessConstraints):void 0,layerLimit:wg(e.Service?.LayerLimit),maxWidth:wg(e.Service?.maxWidth),maxHeight:wg(e.Service?.maxHeight),layers:[],requests:wZ(e.Capability?.Request),exceptions:CZ(e.Exception)},r=To(e.Capability?.Layer);for(let n of r)t.layers.push(TO(n));for(let[n,s]of Object.entries(t))s===void 0&&delete t[n];return t}function wZ(e){let t={};for(let[r,n]of Object.entries(e||{})){let s=Gf(n?.Format);t[r]={mimeTypes:s}}return t}function CZ(e){if(To(e?.Format).length>0)return{mimeTypes:Gf(e)}}function TO(e){let t={title:String(e?.Title||""),name:e?.Name&&String(e?.Name),abstract:e?.Name&&String(e?.Abstract),keywords:Gf(e.KeywordList?.Keyword)},r=e?.CRS||e?.SRS;r&&Array.isArray(r)&&r.every(l=>typeof l=="string")&&(t.crs=r);let n=e?.EX_GeographicBoundingBox&&PZ(e?.EX_GeographicBoundingBox);n&&(t.geographicBoundingBox=n),n=e?.LatLonBoundingBox&&RZ(e?.LatLonBoundingBox),n&&(t.geographicBoundingBox=n);let s=e?.BoundingBox&&IZ(e?.BoundingBox);s&&s.length>0&&(t.boundingBoxes=s);let o=To(e?.Dimension).map(l=>LZ(l));o.length&&(t.dimensions=o),e?.opaque&&(t.opaque=Mo(e?.opaque)),e?.cascaded&&(t.cascaded=Mo(e?.cascaded)),e?.queryable&&(t.queryable=Mo(e?.queryable));let a=To(e?.Layer),c=[];for(let l of a)c.push(TO(l));c.length>0&&(t.layers=c);for(let[l,h]of Object.entries(t))h===void 0&&delete t[l];return t}function PZ(e){let{westBoundLongitude:t,northBoundLatitude:r,eastBoundLongitude:n,southBoundLatitude:s}=e;return[[t,s],[n,r]]}function RZ(e){let{minx:t,miny:r,maxx:n,maxy:s}=e;return[[t,r],[n,s]]}function IZ(e){return To(e).map(r=>OZ(r))}function OZ(e){let{CRS:t,SRS:r,minx:n,miny:s,maxx:i,maxy:o,resx:a,resy:c}=e,l={crs:t||r,boundingBox:[[jf(n),jf(s)],[jf(i),jf(o)]]};return a&&(l.xResolution=a),c&&(l.yResolution=c),l}function LZ(e){let{name:t,units:r,value:n}=e,s={name:t,units:r,extent:n};return e.unitSymbol&&(s.unitSymbol=e.unitSymbol),e.default&&(s.defaultValue=e.default),e.multipleValues&&(s.multipleValues=Mo(e.multipleValues)),e.nearestValue&&(s.nearestValue=Mo(e.nearestValue)),e.current&&(s.current=Mo(e.current)),s}function MO(e,t){t?.geographicBoundingBox&&!e.geographicBoundingBox&&(e.geographicBoundingBox=[...t.geographicBoundingBox]),t?.crs&&!e.crs&&(e.crs=[...t.crs]),t?.boundingBoxes&&!e.boundingBoxes&&(e.boundingBoxes=[...t.boundingBoxes]),t?.dimensions&&!e.dimensions&&(e.dimensions=[...t.dimensions]);for(let r of e.layers||[])MO(r,e)}var NZ="4.2.1",nc={dataType:null,batchType:null,id:"wms-capabilities",name:"WMS Capabilities",module:"wms",version:NZ,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.wms_xml","application/xml","text/xml"],testText:BZ,options:{wms:{}},parse:async(e,t)=>VA(new TextDecoder().decode(e),t?.wms),parseTextSync:(e,t)=>VA(e,t?.wms)};function BZ(e){return e.startsWith("<?xml")}function HA(e,t){let n=($r.parseTextSync?.(e,t)).FeatureInfoResponse?.FIELDS||[];return{features:(Array.isArray(n)?n:[n]).map(i=>FZ(i))}}function FZ(e){return{attributes:e||{},type:"",bounds:{bottom:0,top:0,left:0,right:0}}}var EO={...nc,dataType:null,id:"wms-feature-info",name:"WMS FeatureInfo",parse:async(e,t)=>HA(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>HA(e,t)};function WA(e,t){return $r.parseTextSync?.(e,t)}var bO={...nc,dataType:null,id:"wms-layer-description",name:"WMS DescribeLayer",parse:async(e,t)=>WA(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>WA(e,t)};function SO(e,t){let{type:r="auto"}=e,n=r==="auto"?kZ(e.url,t):DZ(r,t);if(!n)throw new Error("Not a valid image source type");return n.create(e)}function DZ(e,t){for(let r of t)if(r.type===e)return r;return null}function kZ(e,t){for(let r of t)if(r.testURL&&r.testURL(e))return r;return null}var vO={type:"wms",testURL:e=>e.toLowerCase().includes("wms"),create:e=>new GA(e)},GA=class extends mr{url;data;substituteCRS84;flipCRS;wmsParameters;vendorParameters;capabilities=null;constructor(t){super(t),this.url=t.url,this.data=t.url,this.substituteCRS84=t.substituteCRS84??!1,this.flipCRS=["EPSG:4326"],this.wmsParameters={layers:void 0,query_layers:void 0,styles:void 0,version:"1.3.0",crs:"EPSG:4326",format:"image/png",info_format:"text/plain",transparent:void 0,time:void 0,elevation:void 0,...t.wmsParameters},this.vendorParameters=t.vendorParameters||{}}async getMetadata(){let t=await this.getCapabilities();return this.normalizeMetadata(t)}async getImage(t){let{boundingBox:r,bbox:n,...s}=t,i={bbox:r?[...r[0],...r[1]]:n,...s};return await this.getMap(i)}normalizeMetadata(t){return t}async getCapabilities(t,r){let n=this.getCapabilitiesURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();this._checkResponse(s,i);let o=await nc.parse(i,this.loadOptions);return this.capabilities=o,o}async getMap(t,r){let n=this.getMapURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();this._checkResponse(s,i);try{return await ln.parse(i,this.loadOptions)}catch{throw this._parseError(i)}}async getFeatureInfo(t,r){let n=this.getFeatureInfoURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();return this._checkResponse(s,i),await EO.parse(i,this.loadOptions)}async getFeatureInfoText(t,r){let n=this.getFeatureInfoURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();return this._checkResponse(s,i),new TextDecoder().decode(i)}async describeLayer(t,r){let n=this.describeLayerURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();return this._checkResponse(s,i),await bO.parse(i,this.loadOptions)}async getLegendGraphic(t,r){let n=this.getLegendGraphicURL(t,r),s=await this.fetch(n),i=await s.arrayBuffer();this._checkResponse(s,i);try{return await ln.parse(i,this.loadOptions)}catch{throw this._parseError(i)}}getCapabilitiesURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("GetCapabilities",n,r)}getMapURL(t,r){t=this._getWMS130Parameters(t);let n={version:this.wmsParameters.version,format:this.wmsParameters.format,transparent:this.wmsParameters.transparent,time:this.wmsParameters.time,elevation:this.wmsParameters.elevation,layers:this.wmsParameters.layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...t};return this._getWMSUrl("GetMap",n,r)}getFeatureInfoURL(t,r){t=this._getWMS130Parameters(t);let{boundingBox:n,bbox:s}=t;t.bbox=n?[...n[0],...n[1]]:s;let i={version:this.wmsParameters.version,info_format:this.wmsParameters.info_format,layers:this.wmsParameters.layers,query_layers:this.wmsParameters.query_layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs,...t};return this._getWMSUrl("GetFeatureInfo",i,r)}describeLayerURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("DescribeLayer",n,r)}getLegendGraphicURL(t,r){let n={version:this.wmsParameters.version,...t};return this._getWMSUrl("GetLegendGraphic",n,r)}_parseWMSUrl(t){let[r,n]=t.split("?"),s=n.split("&"),i={};for(let o of s){let[a,c]=o.split("=");i[a]=c}return{url:r,parameters:i}}_getWMSUrl(t,r,n){let s=this.url,i=!0,o={service:"WMS",version:r.version,request:t,...r,...this.vendorParameters,...n},a=["transparent","time","elevation"];for(let[c,l]of Object.entries(o))(!a.includes(c)||l)&&(s+=i?"?":"&",i=!1,s+=this._getURLParameter(c,l,r));return encodeURI(s)}_getWMS130Parameters(t){let r={...t};return r.srs&&(r.crs=r.crs||r.srs,delete r.srs),r}_getURLParameter(t,r,n){switch(t){case"crs":n.version!=="1.3.0"?t="srs":this.substituteCRS84&&r==="EPSG:4326"&&(r="CRS:84");break;case"srs":n.version==="1.3.0"&&(t="crs");break;case"bbox":let s=this._flipBoundingBox(r,n);s&&(r=s);break;case"x":n.version==="1.3.0"&&(t="i");break;case"y":n.version==="1.3.0"&&(t="j");break;default:}return t=t.toUpperCase(),Array.isArray(r)?`${t}=${r.join(",")}`:`${t}=${r?String(r):""}`}_flipBoundingBox(t,r){if(!Array.isArray(t)||t.length!==4)return null;let n=r.version==="1.3.0"&&this.flipCRS.includes(r.crs||"")&&!(this.substituteCRS84&&r.crs==="EPSG:4326"),s=t;return n?[s[1],s[0],s[3],s[2]]:s}async _fetchArrayBuffer(t){let r=await this.fetch(t),n=await r.arrayBuffer();return this._checkResponse(r,n),n}_checkResponse(t,r){let n=t.headers["content-type"];if(!t.ok||Wf.mimeTypes.includes(n)){let s=yl(this.loadOptions,{wms:{throwOnError:!0}}),i=Wf.parseSync?.(r,s);throw new Error(i)}}_parseError(t){let r=Wf.parseSync?.(t,this.loadOptions);return new Error(r)}};var sc=class extends mr{constructor(t){super(t)}async getMetadata(){throw new Error("ImageSource.getMetadata not implemented")}async getImage(t){let r=this.getGranularParameters(t),n=this.getURLFromTemplate(r),i=await(await this.fetch(n)).arrayBuffer();return await ln.parse(i)}getGranularParameters(t){let[[r,n],[s,i]]=t.boundingBox;return{...t,east:r,north:n,south:i,west:s}}getURLFromTemplate(t){let r=this.props.url;for(let[n,s]of Object.entries(t))r=r.replace(`\${${n}}`,String(s)),r=r.replace(`{${n}}`,String(s));return r}};W(sc,"type","template"),W(sc,"testURL",t=>t.toLowerCase().includes("{"));var jA=class extends sc{data;constructor(t){super(t),this.data=t.url}async getMetadata(){return await this.metadata()}async getImage(t){throw new Error("not implemented")}async metadata(){throw new Error("not implemented")}exportImage(t){throw new Error("not implemented")}metadataURL(t){return`${this.props.url}?f=pjson`}exportImageURL(t){let r=`bbox=${t.bbox[0]},${t.bbox[1]},${t.bbox[2]},${t.bbox[3]}`,n=`size=${t.width},${t.height}`,s={...t,bbox:r,size:n};return delete s.width,delete s.height,this.getUrl("exportImage",s)}getUrl(t,r,n){let s=`${this.props.url}/${t}`,i=!0;for(let[o,a]of Object.entries(r))s+=i?"?":"&",i=!1,Array.isArray(a)?s+=`${o.toUpperCase()}=${a.join(",")}`:s+=`${o.toUpperCase()}=${a?String(a):""}`;return s}async checkResponse(t){if(!t.ok)throw new Error("error")}},wO={type:"arcgis-image-server",testURL:e=>e.toLowerCase().includes("ImageServer"),create:e=>new jA(e)};var UZ=[vO,wO];function qA(e){return SO(e,UZ)}var CO=6378137*Math.PI;function YA(e){let t=Kt(e);return t[0]=(t[0]/256-1)*CO,t[1]=(t[1]/256-1)*CO,t}var zZ={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:()=>{}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:()=>{}},onImageLoad:{type:"function",value:()=>{}},onImageLoadError:{type:"function",compare:!1,value:(e,t)=>console.error(t,e)}},ic=class extends Dt{get isLoaded(){return this.state?.loadCounter===0&&super.isLoaded}shouldUpdateState(){return!0}initializeState(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0}updateState({changeFlags:t,props:r,oldProps:n}){let{viewport:s}=this.context;t.dataChanged||r.serviceType!==n.serviceType?(this.state.imageSource=this._createImageSource(r),this._loadMetadata(),this.debounce(()=>this.loadImage(s,"image source changed"),0)):Q(r.layers,n.layers,1)?t.viewportChanged&&this.debounce(()=>this.loadImage(s,"viewport changed")):this.debounce(()=>this.loadImage(s,"layers changed"),0)}finalizeState(){}renderLayers(){let{bounds:t,image:r,lastRequestParameters:n}=this.state;return r&&new eg({...this.getSubLayerProps({id:"bitmap"}),_imageCoordinateSystem:n.srs==="EPSG:4326"?H.LNGLAT:H.CARTESIAN,bounds:t,image:r})}async getFeatureInfoText(t,r){let{lastRequestParameters:n}=this.state;return n?await this.state.imageSource.getFeatureInfoText?.({...n,query_layers:n.layers,x:t,y:r,info_format:"application/vnd.ogc.gml"}):""}_createImageSource(t){if(t.data instanceof mr)return t.data;if(typeof t.data=="string")return qA({url:t.data,loadOptions:t.loadOptions,type:t.serviceType});throw new Error("invalid image source in props.data")}async _loadMetadata(){let{imageSource:t}=this.state;try{this.state.loadCounter++;let r=await t.getMetadata();this.state.imageSource===t&&this.getCurrentLayer()?.props.onMetadataLoad(r)}catch(r){this.getCurrentLayer()?.props.onMetadataLoadError(r)}finally{this.state.loadCounter--}}async loadImage(t,r){let{layers:n,serviceType:s}=this.props;if(s==="wms"&&n.length===0)return;let i=t.getBounds(),{width:o,height:a}=t,c=this.getRequestId(),{srs:l}=this.props;l==="auto"&&(l=t.resolution?"EPSG:4326":"EPSG:3857");let h={width:o,height:a,boundingBox:[[i[0],i[1]],[i[2],i[3]]],layers:n,crs:l};if(l==="EPSG:3857"){let f=YA([i[0],i[1]]),u=YA([i[2],i[3]]);h.boundingBox=[f,u]}try{this.state.loadCounter++,this.props.onImageLoadStart(c);let f=await this.state.imageSource.getImage(h);this.state.lastRequestId<c&&(this.getCurrentLayer()?.props.onImageLoad(c),this.setState({image:f,bounds:i,lastRequestParameters:h,lastRequestId:c}))}catch(f){this.raiseError(f,"Load image"),this.getCurrentLayer()?.props.onImageLoadError(c,f)}finally{this.state.loadCounter--}}getRequestId(){return this.state._nextRequestId++}debounce(t,r=500){clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout(()=>t(),r)}};ic.layerName="WMSLayer";ic.defaultProps=zZ;var VZ={getHeight:{type:"accessor",value:0},greatCircle:!0},qf=class extends tg{};qf.layerName="GreatCircleLayer";qf.defaultProps=VZ;var PO=qf;var HZ={...ni.defaultProps},Yf=class extends Dt{indexToBounds(){return null}renderLayers(){let{elevationScale:t,extruded:r,wireframe:n,filled:s,stroked:i,lineWidthUnits:o,lineWidthScale:a,lineWidthMinPixels:c,lineWidthMaxPixels:l,lineJointRounded:h,lineMiterLimit:f,lineDashJustified:u,getElevation:d,getFillColor:p,getLineColor:m,getLineWidth:g}=this.props,{updateTriggers:_,material:y,transitions:x}=this.props,A=this.getSubLayerClass("cell",ni),{updateTriggers:M,...E}=this.indexToBounds()||{};return new A({filled:s,wireframe:n,extruded:r,elevationScale:t,stroked:i,lineWidthUnits:o,lineWidthScale:a,lineWidthMinPixels:c,lineWidthMaxPixels:l,lineJointRounded:h,lineMiterLimit:f,lineDashJustified:u,material:y,transitions:x,getElevation:d,getFillColor:p,getLineColor:m,getLineWidth:g},this.getSubLayerProps({id:"cell",updateTriggers:_&&{...M,getElevation:_.getElevation,getFillColor:_.getFillColor,getLineColor:_.getLineColor,getLineWidth:_.getLineWidth}}),E)}};Yf.layerName="GeoCellLayer";Yf.defaultProps=HZ;var Sn=Yf;var Cg=Dn(XA(),1),WZ=3,GZ=30,jZ=2*GZ+1,IO=180/Math.PI;function LO(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function OO(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function NO(e){return[OO(e[0]),OO(e[1])]}function BO(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function FO([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*IO,n*IO]}function DO(e){let t=Cg.default.fromString(e,!0,10).toString(2);for(;t.length<WZ+jZ;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),s=t.substring(3,r),i=s.length/2,o=Cg.default.fromString(n,!0,2).toString(10),a=Cg.default.fromString(s,!0,2).toString(4);for(;a.length<i;)a="0"+a;return`${o}/${a}`}function qZ(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let s=t[0];t[0]=t[1],t[1]=s}}function kO(e){let t=e.split("/"),r=parseInt(t[0],10),n=t[1],s=n.length,i=[0,0],o;for(let a=s-1;a>=0;a--){o=s-a;let c=n[a],l=0,h=0;c==="1"?h=1:c==="2"?(l=1,h=1):c==="3"&&(l=1);let f=Math.pow(2,o-1);qZ(f,i,l,h),i[0]+=f*l,i[1]+=f*h}if(r%2===1){let a=i[0];i[0]=i[1],i[1]=a}return{face:r,ij:i,level:o}}var UO=Dn(XA(),1);function YZ(e){let t=e.padEnd(16,"0");return UO.default.fromString(t,16)}var XZ=100;function $Z({face:e,ij:t,level:r}){let n=[[0,0],[0,1],[1,1],[1,0],[0,0]],s=Math.max(1,Math.ceil(XZ*Math.pow(2,-r))),i=new Float64Array(4*s*2+2),o=0,a=0;for(let c=0;c<4;c++){let l=n[c].slice(0),h=n[c+1],f=(h[0]-l[0])/s,u=(h[1]-l[1])/s;for(let d=0;d<s;d++){l[0]+=f,l[1]+=u;let p=LO(t,r,l),m=NO(p),g=BO(e,m),_=FO(g);Math.abs(_[1])>89.999&&(_[0]=a);let y=_[0]-a;_[0]+=y>180?-360:y<-180?360:0,i[o++]=_[0],i[o++]=_[1],a=_[0]}}return i[o++]=i[0],i[o++]=i[1],i}function KZ(e){if(typeof e=="string"){if(e.indexOf("/")>0)return e;e=YZ(e)}return DO(e.toString())}function zO(e){let t=KZ(e),r=kO(t);return $Z(r)}var ZZ={getS2Token:{type:"accessor",value:e=>e.token}},$f=class extends Sn{indexToBounds(){let{data:t,getS2Token:r}=this.props;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(n,s)=>zO(r(n,s))}}};$f.layerName="S2Layer";$f.defaultProps=ZZ;var VO=$f;var $A=512;function JZ(e,t){let r=0,n=0,s=1<<e.length,i=s/$A;for(let o=0;o<e.length;o++){s>>=1;let a=parseInt(e[o]);a%2&&(r|=s),a>1&&(n|=s)}return[[r/i,$A-n/i],[(r+t)/i,$A-(n+t)/i]]}function HO(e,t=1){let[r,n]=JZ(e,t),[s,i]=Ee(r),[o,a]=Ee(n);return[o,i,o,a,s,a,s,i,o,i]}var QZ={getQuadkey:{type:"accessor",value:e=>e.quadkey}},Kf=class extends Sn{indexToBounds(){let{data:t,extruded:r,getQuadkey:n}=this.props,s=r?.99:1;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(i,o)=>HO(n(i,o),s),updateTriggers:{getPolygon:s}}}};Kf.layerName="QuadkeyLayer";Kf.defaultProps=QZ;var WO=Kf;var Eo=class{constructor(t){this.index=t,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get bbox(){return this._bbox}set bbox(t){this._bbox||(this._bbox=t,"west"in t?this.boundingBox=[[t.west,t.south],[t.east,t.north]]:this.boundingBox=[[t.left,t.top],[t.right,t.bottom]])}get data(){return this.isLoading&&this._loader?this._loader.then(()=>this.data):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return Boolean(this._loader)&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){let t=this.content?this.content.byteLength:0;return Number.isFinite(t)||console.error("byteLength not defined in tile data"),t}async _loadData({getData:t,requestScheduler:r,onLoad:n,onError:s}){let{index:i,id:o,bbox:a,userData:c,zoom:l}=this,h=this._loaderId;this._abortController=new AbortController;let{signal:f}=this._abortController,u=await r.scheduleRequest(this,m=>m.isSelected?1:-1);if(!u){this._isCancelled=!0;return}if(this._isCancelled){u.done();return}let d=null,p;try{d=await t({index:i,id:o,bbox:a,userData:c,zoom:l,signal:f})}catch(m){p=m||!0}finally{u.done()}if(h===this._loaderId){if(this._loader=void 0,this.content=d,this._isCancelled&&!d){this._isLoaded=!1;return}this._isLoaded=!0,this._isCancelled=!1,p?s(p,this):n(this)}}loadData(t){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(t),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){this.isLoaded||(this._isCancelled=!0,this._abortController?.abort())}};var Jt={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var GO=new D,tJ=new D,ii=class{constructor(t=[0,0,0],r=[0,0,0],n){n=n||GO.copy(t).add(r).scale(.5),this.center=new D(n),this.halfDiagonal=new D(r).subtract(this.center),this.minimum=new D(t),this.maximum=new D(r)}clone(){return new ii(this.minimum,this.maximum,this.center)}equals(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}transform(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}intersectPlane(t){let{halfDiagonal:r}=this,n=tJ.from(t.normal),s=r.x*Math.abs(n.x)+r.y*Math.abs(n.y)+r.z*Math.abs(n.z),i=this.center.dot(n)+t.distance;return i-s>0?Jt.INSIDE:i+s<0?Jt.OUTSIDE:Jt.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=GO.from(t).subtract(this.center),{halfDiagonal:n}=this,s=0,i;return i=Math.abs(r.x)-n.x,i>0&&(s+=i*i),i=Math.abs(r.y)-n.y,i>0&&(s+=i*i),i=Math.abs(r.z)-n.z,i>0&&(s+=i*i),s}};var Zf=new D,jO=new D,oi=class{constructor(t=[0,0,0],r=0){this.radius=-0,this.center=new D,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=Zf.from(r),this.center=new D().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new oi(this.center,this.radius)}union(t){let r=this.center,n=this.radius,s=t.center,i=t.radius,o=Zf.copy(s).subtract(r),a=o.magnitude();if(n>=a+i)return this.clone();if(i>=a+n)return t.clone();let c=(n+a+i)*.5;return jO.copy(o).scale((-n+c)/a).add(r),this.center.copy(jO),this.radius=c,this}expand(t){let n=Zf.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=qt.getScaling(Zf,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=Zf.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,i=t.normal.dot(r)+t.distance;return i<-n?Jt.OUTSIDE:i<n?Jt.INTERSECTING:Jt.INSIDE}};var eJ=new D,rJ=new D,Pg=new D,Rg=new D,Ig=new D,nJ=new D,sJ=new D,cs={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},bo=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new D().from(t),this.halfAxes=new zt(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new D(t).len(),new D(r).len(),new D(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),s=new D(t).normalize(),i=new D(r).normalize(),o=new D(n).normalize();return new Vs().fromMatrix3(new zt([...s,...i,...o]))}fromCenterHalfSizeQuaternion(t,r,n){let s=new Vs(n),i=new zt().fromQuaternion(s);return i[0]=i[0]*r[0],i[1]=i[1]*r[0],i[2]=i[2]*r[0],i[3]=i[3]*r[1],i[4]=i[4]*r[1],i[5]=i[5]*r[1],i[6]=i[6]*r[2],i[7]=i[7]*r[2],i[8]=i[8]*r[2],this.center=new D().from(t),this.halfAxes=i,this}clone(){return new bo(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new oi){let r=this.halfAxes,n=r.getColumn(0,Pg),s=r.getColumn(1,Rg),i=r.getColumn(2,Ig),o=eJ.copy(n).add(s).add(i);return t.center.copy(this.center),t.radius=o.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,s=this.halfAxes,i=n.x,o=n.y,a=n.z,c=Math.abs(i*s[cs.COLUMN0ROW0]+o*s[cs.COLUMN0ROW1]+a*s[cs.COLUMN0ROW2])+Math.abs(i*s[cs.COLUMN1ROW0]+o*s[cs.COLUMN1ROW1]+a*s[cs.COLUMN1ROW2])+Math.abs(i*s[cs.COLUMN2ROW0]+o*s[cs.COLUMN2ROW1]+a*s[cs.COLUMN2ROW2]),l=n.dot(r)+t.distance;return l<=-c?Jt.OUTSIDE:l>=c?Jt.INSIDE:Jt.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=rJ.from(t).subtract(this.center),n=this.halfAxes,s=n.getColumn(0,Pg),i=n.getColumn(1,Rg),o=n.getColumn(2,Ig),a=s.magnitude(),c=i.magnitude(),l=o.magnitude();s.normalize(),i.normalize(),o.normalize();let h=0,f;return f=Math.abs(r.dot(s))-a,f>0&&(h+=f*f),f=Math.abs(r.dot(i))-c,f>0&&(h+=f*f),f=Math.abs(r.dot(o))-l,f>0&&(h+=f*f),h}computePlaneDistances(t,r,n=[-0,-0]){let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,o=this.center,a=this.halfAxes,c=a.getColumn(0,Pg),l=a.getColumn(1,Rg),h=a.getColumn(2,Ig),f=nJ.copy(c).add(l).add(h).add(o),u=sJ.copy(f).subtract(t),d=r.dot(u);return s=Math.min(d,s),i=Math.max(d,i),f.copy(o).add(c).add(l).subtract(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),f.copy(o).add(c).subtract(l).add(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),f.copy(o).add(c).subtract(l).subtract(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),o.copy(f).subtract(c).add(l).add(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),o.copy(f).subtract(c).add(l).subtract(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),o.copy(f).subtract(c).subtract(l).add(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),o.copy(f).subtract(c).subtract(l).subtract(h),u.copy(f).subtract(t),d=r.dot(u),s=Math.min(d,s),i=Math.max(d,i),n[0]=s,n[1]=i,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,Pg);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,Rg);n.transformAsPoint(t);let s=this.halfAxes.getColumn(2,Ig);return s.transformAsPoint(t),this.halfAxes=new zt([...r,...n,...s]),this}getTransform(){throw new Error("not implemented")}};var qO=new D,YO=new D,Kr=class{constructor(t=[0,0,1],r=0){this.normal=new D,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return un(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=qO.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,s){return this.normal.set(t,r,n),un(Ut(this.normal.len(),1)),this.distance=s,this}clone(){return new Kr(this.normal,this.distance)}equals(t){return Ut(this.distance,t.distance)&&Ut(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=YO.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=qO.from(t),s=this.getPointDistance(n),i=YO.copy(this.normal).scale(s);return n.subtract(i).to(r)}};var XO=[new D([1,0,0]),new D([0,1,0]),new D([0,0,1])],$O=new D,iJ=new D,er=class{constructor(t=[]){this.planes=t}fromBoundingSphere(t){this.planes.length=2*XO.length;let r=t.center,n=t.radius,s=0;for(let i of XO){let o=this.planes[s],a=this.planes[s+1];o||(o=this.planes[s]=new Kr),a||(a=this.planes[s+1]=new Kr);let c=$O.copy(i).scale(-n).add(r);o.fromPointNormal(c,i);let l=$O.copy(i).scale(n).add(r),h=iJ.copy(i).negate();a.fromPointNormal(l,h),s+=2}return this}computeVisibility(t){let r=Jt.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case Jt.OUTSIDE:return Jt.OUTSIDE;case Jt.INTERSECTING:r=Jt.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(un(Number.isFinite(r),"parentPlaneMask is required."),r===er.MASK_OUTSIDE||r===er.MASK_INSIDE)return r;let n=er.MASK_INSIDE,s=this.planes;for(let i=0;i<this.planes.length;++i){let o=i<31?1<<i:0;if(i<31&&!(r&o))continue;let a=s[i],c=t.intersectPlane(a);if(c===Jt.OUTSIDE)return er.MASK_OUTSIDE;c===Jt.INTERSECTING&&(n|=o)}return n}};er.MASK_OUTSIDE=4294967295;er.MASK_INSIDE=0;er.MASK_INDETERMINATE=2147483647;var P6t=new D,R6t=new D,I6t=new D,O6t=new D,L6t=new D;var U6t=new D,z6t=new D,V6t=new D,H6t=new D,W6t=new D,G6t=new D,j6t=new D,q6t=new D,Y6t=new D,X6t=new D,$6t=new D,K6t=new D;var vn=new zt,aJ=new zt,cJ=new zt,Og=new zt,KO=new zt;function JA(e,t={}){let r=va.EPSILON20,n=10,s=0,i=0,o=aJ,a=cJ;o.identity(),a.copy(e);let c=r*lJ(a);for(;i<n&&hJ(a)>c;)fJ(a,Og),KO.copy(Og).transpose(),a.multiplyRight(Og),a.multiplyLeft(KO),o.multiplyRight(Og),++s>2&&(++i,s=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=a.toTarget(t.diagonal),t}function lJ(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var KA=[1,0,0],ZA=[2,2,1];function hJ(e){let t=0;for(let r=0;r<3;++r){let n=e[vn.getElementIndex(ZA[r],KA[r])];t+=2*n*n}return Math.sqrt(t)}function fJ(e,t){let r=va.EPSILON15,n=0,s=1;for(let l=0;l<3;++l){let h=Math.abs(e[vn.getElementIndex(ZA[l],KA[l])]);h>n&&(s=l,n=h)}let i=KA[s],o=ZA[s],a=1,c=0;if(Math.abs(e[vn.getElementIndex(o,i)])>r){let l=e[vn.getElementIndex(o,o)],h=e[vn.getElementIndex(i,i)],f=e[vn.getElementIndex(o,i)],u=(l-h)/2/f,d;u<0?d=-1/(-u+Math.sqrt(1+u*u)):d=1/(u+Math.sqrt(1+u*u)),a=1/Math.sqrt(1+d*d),c=d*a}return zt.IDENTITY.to(t),t[vn.getElementIndex(i,i)]=t[vn.getElementIndex(o,o)]=a,t[vn.getElementIndex(o,i)]=c,t[vn.getElementIndex(i,o)]=-c,t}var ai=new D,uJ=new D,dJ=new D,pJ=new D,mJ=new D,gJ=new zt,_J={diagonal:new zt,unitary:new zt};function QA(e,t=new bo){if(!e||e.length===0)return t.halfAxes=new zt([0,0,0,0,0,0,0,0,0]),t.center=new D,t;let r=e.length,n=new D(0,0,0);for(let b of e)n.add(b);let s=1/r;n.multiplyByScalar(s);let i=0,o=0,a=0,c=0,l=0,h=0;for(let b of e){let T=ai.copy(b).subtract(n);i+=T.x*T.x,o+=T.x*T.y,a+=T.x*T.z,c+=T.y*T.y,l+=T.y*T.z,h+=T.z*T.z}i*=s,o*=s,a*=s,c*=s,l*=s,h*=s;let f=gJ;f[0]=i,f[1]=o,f[2]=a,f[3]=o,f[4]=c,f[5]=l,f[6]=a,f[7]=l,f[8]=h;let{unitary:u}=JA(f,_J),d=t.halfAxes.copy(u),p=d.getColumn(0,dJ),m=d.getColumn(1,pJ),g=d.getColumn(2,mJ),_=-Number.MAX_VALUE,y=-Number.MAX_VALUE,x=-Number.MAX_VALUE,A=Number.MAX_VALUE,M=Number.MAX_VALUE,E=Number.MAX_VALUE;for(let b of e)ai.copy(b),_=Math.max(ai.dot(p),_),y=Math.max(ai.dot(m),y),x=Math.max(ai.dot(g),x),A=Math.min(ai.dot(p),A),M=Math.min(ai.dot(m),M),E=Math.min(ai.dot(g),E);p=p.multiplyByScalar(.5*(A+_)),m=m.multiplyByScalar(.5*(M+y)),g=g.multiplyByScalar(.5*(E+x)),t.center.copy(p).add(m).add(g);let w=uJ.set(_-A,y-M,x-E).multiplyByScalar(.5),v=new zt([w[0],0,0,0,w[1],0,0,0,w[2]]);return t.halfAxes.multiplyRight(v),t}var oc=512,ZO=3,JO=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],QO=JO.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),xJ=QO.concat([[.25,.5],[.75,.5]]),ci=class{constructor(t,r,n){this.x=t,this.y=r,this.z=n}get children(){if(!this._children){let t=this.x*2,r=this.y*2,n=this.z+1;this._children=[new ci(t,r,n),new ci(t,r+1,n),new ci(t+1,r,n),new ci(t+1,r+1,n)]}return this._children}update(t){let{viewport:r,cullingVolume:n,elevationBounds:s,minZ:i,maxZ:o,bounds:a,offset:c,project:l}=t,h=this.getBoundingVolume(s,c,l);if(a&&!this.insideBounds(a)||n.computeVisibility(h)<0)return!1;if(!this.childVisible){let{z:u}=this;if(u<o&&u>=i){let d=h.distanceTo(r.cameraPosition)*r.scale/r.height;u+=Math.floor(Math.log2(d))}if(u>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(let u of this.children)u.update(t);return!0}getSelected(t=[]){if(this.selected&&t.push(this),this._children)for(let r of this._children)r.getSelected(t);return t}insideBounds([t,r,n,s]){let i=Math.pow(2,this.z),o=oc/i;return this.x*o<n&&this.y*o<s&&(this.x+1)*o>t&&(this.y+1)*o>r}getBoundingVolume(t,r,n){if(n){let c=this.z<1?xJ:this.z<2?QO:JO,l=[];for(let h of c){let f=Lg(this.x+h[0],this.y+h[1],this.z);f[2]=t[0],l.push(n(f)),t[0]!==t[1]&&(f[2]=t[1],l.push(n(f)))}return QA(l)}let s=Math.pow(2,this.z),i=oc/s,o=this.x*i+r*oc,a=oc-(this.y+1)*i;return new ii([o,a,t[0]],[o+i,a+i,t[1]])}};function tL(e,t,r,n){let s=e instanceof Xr&&e.resolution?e.projectPosition:null,i=Object.values(e.getFrustumPlanes()).map(({normal:d,distance:p})=>new Kr(d.clone().negate(),p)),o=new er(i),a=e.distanceScales.unitsPerMeter[2],c=r&&r[0]*a||0,l=r&&r[1]*a||0,h=e instanceof Pe&&e.pitch<=60?t:0;if(n){let[d,p,m,g]=n,_=Kt([d,g]),y=Kt([m,p]);n=[_[0],oc-_[1],y[0],oc-y[1]]}let f=new ci(0,0,0),u={viewport:e,project:s,cullingVolume:o,elevationBounds:[c,l],minZ:h,maxZ:t,bounds:n,offset:0};if(f.update(u),e instanceof Pe&&e.subViewports&&e.subViewports.length>1){for(u.offset=-1;f.update(u)&&!(--u.offset<-ZO););for(u.offset=1;f.update(u)&&!(++u.offset>ZO););}return f.getSelected()}var ls=512,yJ=[-1/0,-1/0,1/0,1/0],li={type:"object",value:null,validate:(e,t)=>t.optional&&e===null||typeof e=="string"||Array.isArray(e)&&e.every(r=>typeof r=="string"),equal:(e,t)=>{if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;let r=e.length;if(r!==t.length)return!1;for(let n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}};function rL(e,t){let r=[t.transformAsPoint([e[0],e[1]]),t.transformAsPoint([e[2],e[1]]),t.transformAsPoint([e[0],e[3]]),t.transformAsPoint([e[2],e[3]])];return[Math.min(...r.map(s=>s[0])),Math.min(...r.map(s=>s[1])),Math.max(...r.map(s=>s[0])),Math.max(...r.map(s=>s[1]))]}function AJ(e){return Math.abs(e.split("").reduce((t,r)=>(t<<5)-t+r.charCodeAt(0)|0,0))}function wn(e,t){if(!e||!e.length)return null;let{index:r,id:n}=t;if(Array.isArray(e)){let i=AJ(n)%e.length;e=e[i]}let s=e;for(let i of Object.keys(r)){let o=new RegExp(`{${i}}`,"g");s=s.replace(o,String(r[i]))}return Number.isInteger(r.y)&&Number.isInteger(r.z)&&(s=s.replace(/\{-y\}/g,String(Math.pow(2,r.z)-r.y-1))),s}function TJ(e,t,r){let n;if(t&&t.length===2){let[s,i]=t,o=e.getBounds({z:s}),a=e.getBounds({z:i});n=[Math.min(o[0],a[0]),Math.min(o[1],a[1]),Math.max(o[2],a[2]),Math.max(o[3],a[3])]}else n=e.getBounds();return e.isGeospatial?[Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.min(n[2],r[2]),Math.min(n[3],r[3])]:[Math.max(Math.min(n[0],r[2]),r[0]),Math.max(Math.min(n[1],r[3]),r[1]),Math.min(Math.max(n[2],r[0]),r[2]),Math.min(Math.max(n[3],r[1]),r[3])]}function nL({viewport:e,z:t,cullRect:r}){return(e.subViewports||[e]).map(s=>tT(s,t||0,r))}function tT(e,t,r){if(!Array.isArray(t)){let i=r.x-e.x,o=r.y-e.y,{width:a,height:c}=r,l={targetZ:t},h=e.unproject([i,o],l),f=e.unproject([i+a,o],l),u=e.unproject([i,o+c],l),d=e.unproject([i+a,o+c],l);return[Math.min(h[0],f[0],u[0],d[0]),Math.min(h[1],f[1],u[1],d[1]),Math.max(h[0],f[0],u[0],d[0]),Math.max(h[1],f[1],u[1],d[1])]}let n=tT(e,t[0],r),s=tT(e,t[1],r);return[Math.min(n[0],s[0]),Math.min(n[1],s[1]),Math.max(n[2],s[2]),Math.max(n[3],s[3])]}function MJ(e,t,r){return r?rL(e,r).map(s=>s*t/ls):e.map(n=>n*t/ls)}function eT(e,t){return Math.pow(2,e)*ls/t}function Lg(e,t,r){let n=eT(r,ls),s=e/n*360-180,i=Math.PI-2*Math.PI*t/n,o=180/Math.PI*Math.atan(.5*(Math.exp(i)-Math.exp(-i)));return[s,o]}function eL(e,t,r,n){let s=eT(r,n);return[e/s*ls,t/s*ls]}function rT(e,t,r,n,s=ls){if(e.isGeospatial){let[l,h]=Lg(t,r,n),[f,u]=Lg(t+1,r+1,n);return{west:l,north:h,east:f,south:u}}let[i,o]=eL(t,r,n,s),[a,c]=eL(t+1,r+1,n,s);return{left:i,top:o,right:a,bottom:c}}function EJ(e,t,r,n,s){let i=TJ(e,null,n),o=eT(t,r),[a,c,l,h]=MJ(i,o,s),f=[];for(let u=Math.floor(a);u<l;u++)for(let d=Math.floor(c);d<h;d++)f.push({x:u,y:d,z:t});return f}function nT({viewport:e,maxZoom:t,minZoom:r,zRange:n,extent:s,tileSize:i=ls,modelMatrix:o,modelMatrixInverse:a,zoomOffset:c=0}){let l=e.isGeospatial?Math.round(e.zoom+Math.log2(ls/i))+c:Math.ceil(e.zoom)+c;if(typeof r=="number"&&Number.isFinite(r)&&l<r){if(!s)return[];l=r}typeof t=="number"&&Number.isFinite(t)&&l>t&&(l=t);let h=s;return o&&a&&s&&!e.isGeospatial&&(h=rL(s,o)),e.isGeospatial?tL(e,l,n,s):EJ(e,l,i,h||yJ,a)}function sT(e){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)}function iT(e){return Number.isFinite(e.west)&&Number.isFinite(e.north)&&Number.isFinite(e.east)&&Number.isFinite(e.south)}function sL(e){let t={},r;return n=>{for(let s in n)if(!bJ(n[s],t[s])){r=e(n),t=n;break}return r}}function bJ(e,t){if(e===t)return!0;if(Array.isArray(e)){let r=e.length;if(!t||t.length!==r)return!1;for(let n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}return!1}var iL=1,Ng=2,SJ="never",vJ="no-overlap",Jf="best-available",wJ=5,CJ={[Jf]:RJ,[vJ]:IJ,[SJ]:()=>{}},PJ={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{}},So=class{constructor(t){this._getCullBounds=sL(nL),this.opts={...PJ,...t},this.setOptions(this.opts),this.onTileLoad=r=>{this.opts.onTileLoad?.(r),this.opts.maxCacheByteSize!==null&&(this._cacheByteSize+=r.byteLength,this._resizeCache())},this._requestScheduler=new vs({throttleRequests:this.opts.maxRequests>0||this.opts.debounceTime>0,maxRequests:this.opts.maxRequests,debounceTime:this.opts.debounceTime}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._zRange=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new K,this._modelMatrixInverse=new K}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return this._selectedTiles!==null&&this._selectedTiles.every(t=>t.isLoaded)}get needsReload(){return this._selectedTiles!==null&&this._selectedTiles.some(t=>t.needsReload)}setOptions(t){Object.assign(this.opts,t),Number.isFinite(t.maxZoom)&&(this._maxZoom=Math.floor(t.maxZoom)),Number.isFinite(t.minZoom)&&(this._minZoom=Math.ceil(t.minZoom))}finalize(){for(let t of this._cache.values())t.isLoading&&t.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(let t of this._cache.keys()){let r=this._cache.get(t);!this._selectedTiles||!this._selectedTiles.includes(r)?this._cache.delete(t):r.setNeedsReload()}}update(t,{zRange:r,modelMatrix:n}={zRange:null,modelMatrix:null}){let s=n?new K(n):new K,i=!s.equals(this._modelMatrix);if(!this._viewport||!t.equals(this._viewport)||!Ut(this._zRange,r)||i){i&&(this._modelMatrixInverse=s.clone().invert(),this._modelMatrix=s),this._viewport=t,this._zRange=r;let a=this.getTileIndices({viewport:t,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:r,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=a.map(c=>this._getTile(c,!0)),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(a=>this._getTile(a.index,!0)));let o=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),o&&this._frameNumber++,this._frameNumber}isTileVisible(t,r){if(!t.isVisible)return!1;if(r&&this._viewport){let n=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:r}),{bbox:s}=t;for(let[i,o,a,c]of n){let l;if("west"in s)l=s.west<a&&s.east>i&&s.south<c&&s.north>o;else{let h=Math.min(s.top,s.bottom),f=Math.max(s.top,s.bottom);l=s.left<a&&s.right>i&&h<c&&f>o}if(l)return!0}return!1}return!0}getTileIndices({viewport:t,maxZoom:r,minZoom:n,zRange:s,modelMatrix:i,modelMatrixInverse:o}){let{tileSize:a,extent:c,zoomOffset:l}=this.opts;return nT({viewport:t,maxZoom:r,minZoom:n,zRange:s,tileSize:a,extent:c,modelMatrix:i,modelMatrixInverse:o,zoomOffset:l})}getTileId(t){return`${t.x}-${t.y}-${t.z}`}getTileZoom(t){return t.z}getTileMetadata(t){let{tileSize:r}=this.opts;return{bbox:rT(this._viewport,t.x,t.y,t.z,r)}}getParentIndex(t){let r=Math.floor(t.x/2),n=Math.floor(t.y/2),s=t.z-1;return{x:r,y:n,z:s}}updateTileStates(){let t=this.opts.refinementStrategy||Jf,r=new Array(this._cache.size),n=0;for(let s of this._cache.values())r[n++]=s.isVisible,s.isSelected=!1,s.isVisible=!1;for(let s of this._selectedTiles)s.isSelected=!0,s.isVisible=!0;(typeof t=="function"?t:CJ[t])(Array.from(this._cache.values())),n=0;for(let s of this._cache.values())if(r[n++]!==s.isVisible)return!0;return!1}_pruneRequests(){let{maxRequests:t=0}=this.opts,r=[],n=0;for(let s of this._cache.values())s.isLoading&&(n++,!s.isSelected&&!s.isVisible&&r.push(s));for(;t>0&&n>t&&r.length>0;)r.shift().abort(),n--}_rebuildTree(){let{_cache:t}=this;for(let r of t.values())r.parent=null,r.children&&(r.children.length=0);for(let r of t.values()){let n=this._getNearestAncestor(r);r.parent=n,n?.children&&n.children.push(r)}}_resizeCache(){let{_cache:t,opts:r}=this,n=r.maxCacheSize??(r.maxCacheByteSize!==null?1/0:wJ*this.selectedTiles.length),s=r.maxCacheByteSize??1/0;if(t.size>n||this._cacheByteSize>s){for(let[o,a]of t)if(!a.isVisible&&!a.isSelected&&(this._cacheByteSize-=r.maxCacheByteSize!==null?a.byteLength:0,t.delete(o),this.opts.onTileUnload?.(a)),t.size<=n&&this._cacheByteSize<=s)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((o,a)=>o.zoom-a.zoom),this._dirty=!1)}_getTile(t,r){let n=this.getTileId(t),s=this._cache.get(n),i=!1;return!s&&r?(s=new Eo(t),Object.assign(s,this.getTileMetadata(s.index)),Object.assign(s,{id:n,zoom:this.getTileZoom(s.index)}),i=!0,this._cache.set(n,s),this._dirty=!0):s&&s.needsReload&&(i=!0),s&&i&&s.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),s}_getNearestAncestor(t){let{_minZoom:r=0}=this,n=t.index;for(;this.getTileZoom(n)>r;){n=this.getParentIndex(n);let s=this._getTile(n);if(s)return s}return null}};function RJ(e){for(let t of e)t.state=0;for(let t of e)t.isSelected&&!oL(t)&&oT(t);for(let t of e)t.isVisible=Boolean(t.state&Ng)}function IJ(e){for(let r of e)r.state=0;for(let r of e)r.isSelected&&oL(r);let t=Array.from(e).sort((r,n)=>r.zoom-n.zoom);for(let r of t)if(r.isVisible=Boolean(r.state&Ng),r.children&&(r.isVisible||r.state&iL))for(let n of r.children)n.state=iL;else r.isSelected&&oT(r)}function oL(e){let t=e;for(;t;){if(t.isLoaded||t.content)return t.state|=Ng,!0;t=t.parent}return!1}function oT(e){for(let t of e.children)t.isLoaded||t.content?t.state|=Ng:oT(t)}var OJ={TilesetClass:So,data:{type:"data",value:[]},dataComparator:li.equal,renderSubLayers:{type:"function",value:e=>new yo(e)},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:e=>{}},onTileUnload:{type:"function",value:e=>{}},onTileError:{type:"function",value:e=>console.error(e)},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:Jf,zRange:null,maxRequests:6,debounceTime:0,zoomOffset:0},Qf=class extends Dt{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){this.state?.tileset?.finalize()}get isLoaded(){return Boolean(this.state?.tileset?.selectedTiles?.every(t=>t.isLoaded&&t.layers&&t.layers.every(r=>r.isLoaded)))}shouldUpdateState({changeFlags:t}){return t.somethingChanged}updateState({changeFlags:t}){let{tileset:r}=this.state,n=t.propsOrDataChanged||t.updateTriggersChanged,s=t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getTileData);r?n&&(r.setOptions(this._getTilesetOptions()),s?r.reloadAll():r.tiles.forEach(i=>{i.layers=null})):(r=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:r})),this._updateTileset()}_getTilesetOptions(){let{tileSize:t,maxCacheSize:r,maxCacheByteSize:n,refinementStrategy:s,extent:i,maxZoom:o,minZoom:a,maxRequests:c,debounceTime:l,zoomOffset:h}=this.props;return{maxCacheSize:r,maxCacheByteSize:n,maxZoom:o,minZoom:a,tileSize:t,refinementStrategy:s,extent:i,maxRequests:c,debounceTime:l,zoomOffset:h,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){let t=this.state.tileset,{zRange:r,modelMatrix:n}=this.props,s=t.update(this.context.viewport,{zRange:r,modelMatrix:n}),{isLoaded:i}=t,o=this.state.isLoaded!==i,a=this.state.frameNumber!==s;i&&(o||a)&&this._onViewportLoad(),a&&this.setState({frameNumber:s}),this.state.isLoaded=i}_onViewportLoad(){let{tileset:t}=this.state,{onViewportLoad:r}=this.props;r&&r(t.selectedTiles)}_onTileLoad(t){this.props.onTileLoad(t),t.layers=null,this.setNeedsUpdate()}_onTileError(t,r){this.props.onTileError(t),r.layers=null,this.setNeedsUpdate()}_onTileUnload(t){this.props.onTileUnload(t)}getTileData(t){let{data:r,getTileData:n,fetch:s}=this.props,{signal:i}=t;return t.url=typeof r=="string"||Array.isArray(r)?wn(r,t):null,n?n(t):s&&t.url?s(t.url,{propName:"data",layer:this,signal:i}):null}renderSubLayers(t){return this.props.renderSubLayers(t)}getSubLayerPropsByTile(t){return null}getPickingInfo(t){let r=t.sourceLayer,n=r.props.tile,s=t.info;return s.picked&&(s.tile=n),s.sourceTile=n,s.sourceTileSubLayer=r,s}_updateAutoHighlight(t){t.sourceTileSubLayer.updateAutoHighlight(t)}renderLayers(){return this.state.tileset.tiles.map(t=>{let r=this.getSubLayerPropsByTile(t);if(!(!t.isLoaded&&!t.content))if(t.layers)r&&t.layers[0]&&Object.keys(r).some(n=>t.layers[0].props[n]!==r[n])&&(t.layers=t.layers.map(n=>n.clone(r)));else{let n=this.renderSubLayers({...this.props,...this.getSubLayerProps({id:t.id,updateTriggers:this.props.updateTriggers}),data:t.content,_offset:0,tile:t});t.layers=We(n,Boolean).map(s=>s.clone({tile:t,...r}))}return t.layers})}filterSubLayer({layer:t,cullRect:r}){let{tile:n}=t.props;return this.state.tileset.isTileVisible(n,r)}};Qf.defaultProps=OJ;Qf.layerName="TileLayer";var vo=Qf;var aL=`uniform tripsUniforms {
4454
4454
  bool fadeTrail;
4455
4455
  float trailLength;
4456
4456
  float currentTime;
@@ -5975,7 +5975,7 @@ fragColor.g = outTexture.r / max(1.0, outTexture.a);
5975
5975
  `,T8={name:"weight",vs:yft,uniformTypes:{commonBounds:"vec4<f32>",radiusPixels:"f32",textureWidth:"f32",weightsScale:"f32"}},M8={name:"maxWeight",vs:`uniform maxWeightUniforms {
5976
5976
  float textureSize;
5977
5977
  } maxWeight;
5978
- `,uniformTypes:{textureSize:"f32"}};var Aft=2,vb={format:"rgba8unorm",mipmaps:!1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}},E8=[0,0],Tft={SUM:0,MEAN:1},Mft={getPosition:{type:"accessor",value:e=>e.position},getWeight:{type:"accessor",value:1},intensity:{type:"number",min:0,value:1},radiusPixels:{type:"number",min:1,max:100,value:50},colorRange:vi,threshold:{type:"number",min:0,max:1,value:.05},colorDomain:{type:"array",value:null,optional:!0},aggregation:"SUM",weightsTextureSize:{type:"number",min:128,max:2048,value:2048},debounceTimeout:{type:"number",min:0,max:1e3,value:500}},Eft=["float32-renderable-webgl","texture-blend-float-webgl"],bft={data:{props:["radiusPixels"]}},fd=class extends x8{getShaders(t){let r=[st];return t.modules&&(r=[...r,...t.modules]),super.getShaders({...t,modules:r})}initializeState(){super.initializeAggregationLayer(bft),this.setState({colorDomain:E8}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}shouldUpdateState({changeFlags:t}){return t.somethingChanged}updateState(t){super.updateState(t),this._updateHeatmapState(t)}_updateHeatmapState(t){let{props:r,oldProps:n}=t,s=this._getChangeFlags(t);(s.dataChanged||s.viewportChanged)&&(s.boundsChanged=this._updateBounds(s.dataChanged),this._updateTextureRenderingBounds()),s.dataChanged||s.boundsChanged?(clearTimeout(this.state.updateTimer),this.setState({isWeightMapDirty:!0})):s.viewportZoomChanged&&this._debouncedUpdateWeightmap(),r.colorRange!==n.colorRange&&this._updateColorTexture(t),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:t.context.viewport.zoom})}renderLayers(){let{weightsTexture:t,triPositionBuffer:r,triTexCoordBuffer:n,maxWeightsTexture:s,colorTexture:i,colorDomain:o}=this.state,{updateTriggers:a,intensity:c,threshold:l,aggregation:h}=this.props,f=this.getSubLayerClass("triangle",g8);return new f(this.getSubLayerProps({id:"triangle-layer",updateTriggers:a}),{coordinateSystem:H.DEFAULT,data:{attributes:{positions:r,texCoords:n}},vertexCount:4,maxTexture:s,colorTexture:i,aggregationMode:Tft[h]||0,weightsTexture:t,intensity:c,threshold:l,colorDomain:o})}finalizeState(t){super.finalizeState(t);let{weightsTransform:r,weightsTexture:n,maxWeightTransform:s,maxWeightsTexture:i,triPositionBuffer:o,triTexCoordBuffer:a,colorTexture:c,updateTimer:l}=this.state;r?.destroy(),n?.destroy(),s?.destroy(),i?.destroy(),o?.destroy(),a?.destroy(),c?.destroy(),l&&clearTimeout(l)}_getAttributeManager(){return new dr(this.context.device,{id:this.props.id,stats:this.context.stats})}_getChangeFlags(t){let r={},{dimensions:n}=this.state;r.dataChanged=this.isAttributeChanged()&&"attribute changed"||this.isAggregationDirty(t,{compareAll:!0,dimension:n.data})&&"aggregation is dirty",r.viewportChanged=t.changeFlags.viewportChanged;let{zoom:s}=this.state;return(!t.context.viewport||t.context.viewport.zoom!==s)&&(r.viewportZoomChanged=!0),r}_createTextures(){let{textureSize:t,format:r}=this.state;this.setState({weightsTexture:this.context.device.createTexture({...vb,width:t,height:t,format:r}),maxWeightsTexture:this.context.device.createTexture({...vb,width:1,height:1,format:r})})}_setupAttributes(){this.getAttributeManager().add({positions:{size:3,type:"float64",accessor:"getPosition"},weights:{size:1,accessor:"getWeight"}}),this.setState({positionAttributeName:"positions"})}_setupTextureParams(){let{device:t}=this.context,{weightsTextureSize:r}=this.props,n=Math.min(r,t.limits.maxTextureDimension2D),s=Eft.every(a=>t.features.has(a)),i=s?"rgba32float":"rgba8unorm",o=s?1:1/255;this.setState({textureSize:n,format:i,weightsScale:o}),s||k.warn(`HeatmapLayer: ${this.id} rendering to float texture not supported, falling back to low precision format`)()}_createWeightsTransform(t){let{weightsTransform:r}=this.state,{weightsTexture:n}=this.state,s=this.getAttributeManager();r?.destroy(),r=new qs(this.context.device,{id:`${this.id}-weights-transform`,bufferLayout:s.getBufferLayouts(),vertexCount:1,targetTexture:n,parameters:{depthWriteEnabled:!1,blendColorOperation:"add",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"},topology:"point-list",...t,modules:[...t.modules,T8]}),this.setState({weightsTransform:r})}_setupResources(){this._createTextures();let{device:t}=this.context,{textureSize:r,weightsTexture:n,maxWeightsTexture:s}=this.state,i=this.getShaders({vs:bb,fs:Sb});this._createWeightsTransform(i);let o=this.getShaders({vs:y8,fs:A8,modules:[M8]}),a=new qs(t,{id:`${this.id}-max-weights-transform`,targetTexture:s,...o,vertexCount:r*r,topology:"point-list",parameters:{depthWriteEnabled:!1,blendColorOperation:"max",blendAlphaOperation:"max",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"}}),c={inTexture:n,textureSize:r};a.model.shaderInputs.setProps({maxWeight:c}),this.setState({weightsTexture:n,maxWeightsTexture:s,maxWeightTransform:a,zoom:null,triPositionBuffer:t.createBuffer({byteLength:48}),triTexCoordBuffer:t.createBuffer({byteLength:48})})}updateShaders(t){this._createWeightsTransform({vs:bb,fs:Sb,...t})}_updateMaxWeightValue(){let{maxWeightTransform:t}=this.state;t.run({parameters:{viewport:[0,0,1,1]},clearColor:[0,0,0,0]})}_updateBounds(t=!1){let{viewport:r}=this.context,n=[r.unproject([0,0]),r.unproject([r.width,0]),r.unproject([0,r.height]),r.unproject([r.width,r.height])].map(a=>a.map(Math.fround)),s=c8(n),i={visibleWorldBounds:s,viewportCorners:n},o=!1;if(t||!this.state.worldBounds||!l8(this.state.worldBounds,s)){let a=this._worldToCommonBounds(s),c=this._commonToWorldBounds(a);this.props.coordinateSystem===H.LNGLAT&&(c[1]=Math.max(c[1],-85.051129),c[3]=Math.min(c[3],85.051129),c[0]=Math.max(c[0],-360),c[2]=Math.min(c[2],360));let l=this._worldToCommonBounds(c);i.worldBounds=c,i.normalizedCommonBounds=l,o=!0}return this.setState(i),o}_updateTextureRenderingBounds(){let{triPositionBuffer:t,triTexCoordBuffer:r,normalizedCommonBounds:n,viewportCorners:s}=this.state,{viewport:i}=this.context;t.write(Eb(s,3));let o=s.map(a=>f8(i.projectPosition(a),n));r.write(Eb(o,2))}_updateColorTexture(t){let{colorRange:r}=t.props,{colorTexture:n}=this.state,s=Tb(r,!1,Uint8Array);n&&n?.width===r.length?n.setTexture2DData({data:s}):(n?.destroy(),n=this.context.device.createTexture({...vb,data:s,width:r.length,height:1})),this.setState({colorTexture:n})}_updateWeightmap(){let{radiusPixels:t,colorDomain:r,aggregation:n}=this.props,{worldBounds:s,textureSize:i,weightsScale:o,weightsTexture:a}=this.state,c=this.state.weightsTransform;this.state.isWeightMapDirty=!1;let l=this._worldToCommonBounds(s,{useLayerCoordinateSystem:!0});if(r&&n==="SUM"){let{viewport:x}=this.context,A=x.distanceScales.metersPerUnit[2]*(l[2]-l[0])/i;this.state.colorDomain=r.map(M=>M*A*o)}else this.state.colorDomain=r||E8;let f=this.getAttributeManager().getAttributes(),u=this.getModuleSettings();this._setModelAttributes(c.model,f),c.model.setVertexCount(this.getNumInstances());let d={radiusPixels:t,commonBounds:l,textureWidth:i,weightsScale:o,weightsTexture:a},{viewport:p,devicePixelRatio:m,coordinateSystem:g,coordinateOrigin:_}=u,{modelMatrix:y}=this.props;c.model.shaderInputs.setProps({project:{viewport:p,devicePixelRatio:m,modelMatrix:y,coordinateSystem:g,coordinateOrigin:_},weight:d}),c.run({parameters:{viewport:[0,0,i,i]},clearColor:[0,0,0,0]}),this._updateMaxWeightValue()}_debouncedUpdateWeightmap(t=!1){let{updateTimer:r}=this.state,{debounceTimeout:n}=this.props;t?(r=null,this._updateBounds(!0),this._updateTextureRenderingBounds(),this.setState({isWeightMapDirty:!0})):(this.setState({isWeightMapDirty:!1}),clearTimeout(r),r=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),n)),this.setState({updateTimer:r})}_worldToCommonBounds(t,r={}){let{useLayerCoordinateSystem:n=!1}=r,[s,i,o,a]=t,{viewport:c}=this.context,{textureSize:l}=this.state,{coordinateSystem:h}=this.props,f=n&&(h===H.LNGLAT_OFFSETS||h===H.METER_OFFSETS),u=f?c.projectPosition(this.props.coordinateOrigin):[0,0],d=l*Aft/c.scale,p,m;return n&&!f?(p=this.projectPosition([s,i,0]),m=this.projectPosition([o,a,0])):(p=c.projectPosition([s,i,0]),m=c.projectPosition([o,a,0])),h8([p[0]-u[0],p[1]-u[1],m[0]-u[0],m[1]-u[1]],d,d)}_commonToWorldBounds(t){let[r,n,s,i]=t,{viewport:o}=this.context,a=o.unprojectPosition([r,n]),c=o.unprojectPosition([s,i]);return a.slice(0,2).concat(c.slice(0,2))}};fd.layerName="HeatmapLayer";fd.defaultProps=Mft;var b8=fd;var wb=85.05113;function Pb(e,t,r,n){if(r){if(r.userData._googleMap===e)return r;m_(r)}let s={click:null,rightclick:null,dblclick:null,mousemove:null,mouseout:null},i=new qr({...n,useDevicePixels:n.interleaved?!0:n.useDevicePixels,style:n.interleaved?null:{pointerEvents:"none"},parent:Sft(t,n.style),views:new $s({repeat:!0}),initialViewState:{longitude:0,latitude:0,zoom:1},controller:!1});for(let o in s)s[o]=e.addListener(o,a=>wft(i,o,a));return i.userData._googleMap=e,i.userData._eventListeners=s,i}function Sft(e,t){let r=document.createElement("div");return r.style.position="absolute",Object.assign(r.style,t),"getPanes"in e?e.getPanes()?.overlayLayer.appendChild(r):e.getMap()?.getDiv().appendChild(r),r}function m_(e){let{_eventListeners:t}=e.userData;for(let r in t)t[r]&&t[r].remove();e.finalize()}function S8(e,t){let{width:r,height:n}=v8(e),s=t.getProjection(),i=e.getBounds();if(!i)return{width:r,height:n,left:0,top:0};let o=i.getNorthEast(),a=i.getSouthWest(),c=s.fromLatLngToDivPixel(o),l=s.fromLatLngToDivPixel(a),h=Cb(s,r/2,n/2),f=new google.maps.LatLng(0,h[0]),u=s.fromLatLngToContainerPixel(f),d=s.fromLatLngToDivPixel(f);if(!c||!l||!d||!u)return{width:r,height:n,left:0,top:0};let p=Math.round(d.x-u.x),m=d.y-u.y,g=Cb(s,r/2,0),_=Cb(s,r/2,n),y=h[1],x=h[0];if(Math.abs(y)>wb){y=y>0?wb:-wb;let b=new google.maps.LatLng(y,x),T=s.fromLatLngToContainerPixel(b);m+=T.y-n/2}m=Math.round(m);let M=180*new Vi(g).sub(_).verticalAngle()/Math.PI;M<0&&(M+=360);let E=e.getHeading()||0,w=e.getZoom()-1,v;if(M===0)v=n?(l.y-c.y)/n:1;else if(M===E){let b=new Vi([c.x,c.y]).sub([l.x,l.y]).len(),T=new Vi([r,-n]).len();v=T?b/T:1}return w+=Math.log2(v||1),{width:r,height:n,left:p,top:m,zoom:w,bearing:M,pitch:e.getTilt(),latitude:y,longitude:x}}function Rb(e,t){let{width:r,height:n}=v8(e),{center:s,heading:i,tilt:o,zoom:a}=t.getCameraParams(),c=25,l=n?r/n:1,h=.75,f=3e14,u=new K().perspective({fovy:c*Math.PI/180,aspect:l,near:h,far:f}),d=.5*u[5];return{width:r,height:n,viewState:{altitude:d,bearing:i,latitude:s.lat(),longitude:s.lng(),pitch:o,projectionMatrix:u,repeat:!0,zoom:a-1}}}function v8(e){let t=e.getDiv().firstChild;return{width:t.offsetWidth,height:t.offsetHeight}}function Cb(e,t,r){let n=new google.maps.Point(t,r),s=e.fromContainerPixelToLatLng(n);return[s.lng(),s.lat()]}function vft(e,t){if(e.pixel)return e.pixel;let r=t.getViewports()[0].project([e.latLng.lng(),e.latLng.lat()]);return{x:r[0],y:r[1]}}function wft(e,t,r){if(!e.isInitialized)return;let n={type:t,offsetCenter:vft(r,e),srcEvent:r};switch(t){case"click":case"rightclick":n.type="click",n.tapCount=1,e._onPointerDown(n),e._onEvent(n);break;case"dblclick":n.type="click",n.tapCount=2,e._onEvent(n);break;case"mousemove":n.type="pointermove",e._onPointerMove(n);break;case"mouseout":n.type="pointerleave",e._onPointerMove(n);break;default:return}}var Cft=()=>!1,Pft={depthMask:!0,depthTest:!0,blend:!0,blendFunc:[770,771,1,771],blendEquation:32774};function w8(){}var Rft={interleaved:!0},ud=class{constructor(t){this.props={},this._map=null,this._deck=null,this._overlay=null,this.setProps({...Rft,...t})}setMap(t){if(t===this._map)return;let{VECTOR:r,UNINITIALIZED:n}=google.maps.RenderingType;this._map&&(!t&&this._map.getRenderingType()===r&&this.props.interleaved&&this._overlay.requestRedraw(),this._overlay?.setMap(null),this._map=null),t&&(this._map=t,t.getRenderingType()!==n?this._createOverlay(t):t.addListener("renderingtype_changed",()=>{this._createOverlay(t)}))}setProps(t){if(Object.assign(this.props,t),this._deck){let r=this._deck.getCanvas();if(t.style&&r?.parentElement){let n=r.parentElement.style;Object.assign(n,t.style),t.style=null}this._deck.setProps(t)}}pickObject(t){return this._deck&&this._deck.pickObject(t)}pickMultipleObjects(t){return this._deck&&this._deck.pickMultipleObjects(t)}pickObjects(t){return this._deck&&this._deck.pickObjects(t)}finalize(){this.setMap(null),this._deck&&(m_(this._deck),this._deck=null)}_createOverlay(t){let{interleaved:r}=this.props,{VECTOR:n,UNINITIALIZED:s}=google.maps.RenderingType,i=t.getRenderingType();if(i===s)return;let a=i===n&&google.maps.WebGLOverlayView?google.maps.WebGLOverlayView:google.maps.OverlayView,c=new a;c instanceof google.maps.WebGLOverlayView?(r?(c.onAdd=w8,c.onContextRestored=this._onContextRestored.bind(this),c.onDraw=this._onDrawVectorInterleaved.bind(this)):(c.onAdd=this._onAdd.bind(this),c.onContextRestored=w8,c.onDraw=this._onDrawVectorOverlay.bind(this)),c.onContextLost=this._onContextLost.bind(this)):(c.onAdd=this._onAdd.bind(this),c.draw=this._onDrawRaster.bind(this)),c.onRemove=this._onRemove.bind(this),this._overlay=c,this._overlay.setMap(t)}_onAdd(){this._deck=Pb(this._map,this._overlay,this._deck,this.props)}_onContextRestored({gl:t}){if(!this._map||!this._overlay)return;let r=()=>{this._overlay&&this._overlay.requestRedraw()},n=Pb(this._map,this._overlay,this._deck,{gl:t,_customRender:r,...this.props});this._deck=n;let s=n.animationLoop;s._renderFrame=()=>{let i=t.getParameter(34964);n.device.withParametersWebGL({},()=>{s.props.onRender(s.animationProps)}),t.bindBuffer(34962,i)}}_onContextLost(){this._deck&&(m_(this._deck),this._deck=null)}_onRemove(){this._deck?.setProps({layerFilter:Cft})}_onDrawRaster(){if(!this._deck||!this._map)return;let t=this._deck,{width:r,height:n,left:s,top:i,...o}=S8(this._map,this._overlay),c=t.getCanvas()?.parentElement||t.props.parent;if(c){let h=c.style;h.left=`${s}px`,h.top=`${i}px`}let l=1e4;t.setProps({width:r,height:n,viewState:{altitude:l,...o}}),t.redraw()}_onDrawVectorInterleaved({gl:t,transformer:r}){if(!this._deck||!this._map)return;let n=this._deck;if(n.setProps({...Rb(this._map,r),width:null,height:null}),n.isInitialized){let s=n.device;if(s instanceof Je){let i=s.getParametersWebGL(36006);n.setProps({_framebuffer:i})}s.getDefaultCanvasContext().resize(),n.needsRedraw({clearRedrawFlags:!0}),s instanceof Je&&(s.setParametersWebGL({viewport:[0,0,t.canvas.width,t.canvas.height],scissor:[0,0,t.canvas.width,t.canvas.height],stencilFunc:[519,0,255,519,0,255]}),s.withParametersWebGL(Pft,()=>{n._drawLayers("google-vector",{clearCanvas:!1})}))}}_onDrawVectorOverlay({transformer:t}){if(!this._deck||!this._map)return;let r=this._deck;r.setProps({...Rb(this._map,t)}),r.redraw()}};var Ib=512,Ift=Math.PI/180;function g_({map:e,gl:t,deck:r}){if(e.__deck)return e.__deck;let n=r?.props._customRender,s=r?.props.onLoad,i={...r?.props,_customRender:()=>{e.triggerRepaint(),n?.("")}};i.parameters={...__(e,!0),...i.parameters},i.views||(i.views=dd(e));let o;return(!r||r.props.gl===t)&&(Object.assign(i,{gl:t,width:null,height:null,touchAction:"unset",viewState:ml(e)}),r?.isInitialized?C8(r,e):i.onLoad=()=>{s?.(),C8(o,e)}),r?(o=r,r.setProps(i),r.userData.isExternal=!0):(o=new qr(i),e.on("remove",()=>{Ob(e)})),o.userData.mapboxLayers=new Set,e.__deck=o,e.on("render",()=>{o.isInitialized&&Lft(o,e)}),o}function C8(e,t){let r=()=>{e.isInitialized?Nft(e,t):t.off("move",r)};t.on("move",r)}function Ob(e){e.__deck?.finalize(),e.__deck=null}function __(e,t){let r=t?{depthWriteEnabled:!0,depthCompare:"less-equal",depthBias:0,blend:!0,blendColorSrcFactor:"src-alpha",blendColorDstFactor:"one-minus-src-alpha",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one-minus-src-alpha",blendColorOperation:"add",blendAlphaOperation:"add"}:{};return L8(e)==="globe"&&(r.cullMode="back"),r}function P8(e,t){e.userData.mapboxLayers.add(t),Lb(e)}function R8(e,t){e.userData.mapboxLayers.delete(t),Lb(e)}function I8(e,t){Lb(e)}function O8(e,t,r,n){let{currentViewport:s}=e.userData,i=!1;s||(s=N8(e,t,n),e.userData.currentViewport=s,i=!0),e.isInitialized&&e._drawLayers("mapbox-repaint",{viewports:[s],layerFilter:({layer:o})=>r.id===o.id||o.props.operation.includes("terrain"),clearStack:i,clearCanvas:!1})}function L8(e){let t=e.getProjection?.(),r=t?.type||t?.name;if(r==="globe")return"globe";if(r&&r!=="mercator")throw new Error("Unsupported projection");return"mercator"}function dd(e){return L8(e)==="globe"?new Jm({id:"mapbox"}):new $s({id:"mapbox"})}function ml(e){let{lng:t,lat:r}=e.getCenter(),n={longitude:(t+540)%360-180,latitude:r,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch(),padding:e.getPadding(),repeat:e.getRenderWorldCopies()};return e.getTerrain?.()&&Oft(e,n),n}function Oft(e,t){if(e.getFreeCameraOptions){let{position:r}=e.getFreeCameraOptions();if(!r||r.z===void 0)return;let n=e.transform.height,{longitude:s,latitude:i,pitch:o}=t,a=r.x*Ib,c=(1-r.y)*Ib,l=r.z*Ib,h=Kt([s,i]),f=a-h[0],u=c-h[1],d=Math.sqrt(f*f+u*u),p=o*Ift,m=1.5*n,g=p<.001?m*Math.cos(p)/l:m*Math.sin(p)/d;t.zoom=Math.log2(g);let _=m*Math.cos(p)/g,y=l-_;t.position=[0,0,y/Yi(i)]}else typeof e.transform.elevation=="number"&&(t.position=[0,0,e.transform.elevation])}function N8(e,t,r){let n=ml(t),s=dd(t);r&&(s.props.nearZMultiplier=.2);let i=r?.nearZ??t.transform._nearZ,o=r?.farZ??t.transform._farZ;return Number.isFinite(i)&&(n.nearZ=i/t.transform.height,n.farZ=o/t.transform.height),s.makeViewport({width:e.width,height:e.height,viewState:n})}function Lft(e,t){let{mapboxLayers:r,isExternal:n}=e.userData;if(n){let s=Array.from(r,h=>h.id),o=We(e.props.layers,Boolean).some(h=>h&&!s.includes(h.id)),a=e.getViewports(),c=a.findIndex(h=>h.id==="mapbox"),l=a.length>1||c<0;(o||l)&&(c>=0&&(a=a.slice(),a[c]=N8(e,t)),e._drawLayers("mapbox-repaint",{viewports:a,layerFilter:h=>(!e.props.layerFilter||e.props.layerFilter(h))&&(h.viewport.id!=="mapbox"||!s.includes(h.layer.id)),clearCanvas:!1}))}e.userData.currentViewport=null}function Nft(e,t){e.setProps({viewState:ml(t)}),e.needsRedraw({clearRedrawFlags:!0})}function Lb(e){if(e.userData.isExternal)return;let t=[];e.userData.mapboxLayers.forEach(r=>{let n=r.props.type,s=new n(r.props);t.push(s)}),e.setProps({layers:t})}var pd=class{constructor(t){if(!t.id)throw new Error("Layer must have an unique id");this.id=t.id,this.type="custom",this.renderingMode=t.renderingMode||"3d",this.slot=t.slot,this.map=null,this.deck=null,this.props=t}onAdd(t,r){this.map=t,this.deck=g_({map:t,gl:r,deck:this.props.deck}),P8(this.deck,this)}onRemove(){this.deck&&R8(this.deck,this)}setProps(t){Object.assign(this.props,t,{id:this.id}),this.deck&&I8(this.deck,this)}render(t,r){O8(this.deck,this.map,this,r)}};var Nb="__UNDEFINED__";function md(e,t,r,n){if(!e||!t||!e.style||!e.style._loaded)return;let s=We(n,Boolean);if(r!==n){let a=We(r,Boolean),c=new Set(a.map(l=>l.id));for(let l of s)c.delete(l.id);for(let l of c)e.getLayer(l)&&e.removeLayer(l)}for(let a of s){let c=e.getLayer(a.id);c?(c.implementation||c).setProps(a.props):e.addLayer(new pd({id:a.id,deck:t,slot:a.props.slot}),a.props.beforeId)}let i=e.style._order,o={};for(let a of s){let{beforeId:c}=a.props;(!c||!i.includes(c))&&(c=Nb),o[c]=o[c]||[],o[c].push(a.id)}for(let a in o){let c=o[a],l=a===Nb?i.length:i.indexOf(a),h=a===Nb?void 0:a;for(let f=c.length-1;f>=0;f--){let u=c[f],d=i.indexOf(u);d!==l-1&&(e.moveLayer(u,h),d>l&&l++),l--,h=u}}}var gd=class{constructor(t){this._handleStyleChange=()=>{md(this._map,this._deck,this._props.layers,this._props.layers)},this._updateContainerSize=()=>{if(this._map&&this._container){let{clientWidth:s,clientHeight:i}=this._map.getContainer();Object.assign(this._container.style,{width:`${s}px`,height:`${i}px`})}},this._updateViewState=()=>{let s=this._deck,i=this._map;s&&i&&(s.setProps({views:this._props.views||dd(i),viewState:ml(i)}),s.isInitialized&&s.redraw())},this._handleMouseEvent=s=>{let i=this._deck;if(!i||!i.isInitialized)return;let o={type:s.type,offsetCenter:s.point,srcEvent:s},a=this._lastMouseDownPoint;switch(!s.point&&a&&(o.deltaX=s.originalEvent.clientX-a.clientX,o.deltaY=s.originalEvent.clientY-a.clientY,o.offsetCenter={x:a.x+o.deltaX,y:a.y+o.deltaY}),o.type){case"mousedown":i._onPointerDown(o),this._lastMouseDownPoint={...s.point,clientX:s.originalEvent.clientX,clientY:s.originalEvent.clientY};break;case"dragstart":o.type="panstart",i._onEvent(o);break;case"drag":o.type="panmove",i._onEvent(o);break;case"dragend":o.type="panend",i._onEvent(o);break;case"click":o.tapCount=1,i._onEvent(o);break;case"dblclick":o.type="click",o.tapCount=2,i._onEvent(o);break;case"mousemove":o.type="pointermove",i._onPointerMove(o);break;case"mouseout":o.type="pointerleave",i._onPointerMove(o);break;default:return}};let{interleaved:r=!1,...n}=t;this._interleaved=r,this._props=n}setProps(t){this._interleaved&&t.layers&&md(this._map,this._deck,this._props.layers,t.layers),Object.assign(this._props,t),this._deck&&this._map&&this._deck.setProps({...this._props,parameters:{...__(this._map,this._interleaved),...this._props.parameters}})}onAdd(t){return this._map=t,this._interleaved?this._onAddInterleaved(t):this._onAddOverlaid(t)}_onAddOverlaid(t){let r=document.createElement("div");return Object.assign(r.style,{position:"absolute",left:0,top:0,textAlign:"initial",pointerEvents:"none"}),this._container=r,this._deck=new qr({...this._props,parent:r,parameters:{...__(t,!1),...this._props.parameters},views:this._props.views||dd(t),viewState:ml(t)}),t.on("resize",this._updateContainerSize),t.on("render",this._updateViewState),t.on("mousedown",this._handleMouseEvent),t.on("dragstart",this._handleMouseEvent),t.on("drag",this._handleMouseEvent),t.on("dragend",this._handleMouseEvent),t.on("mousemove",this._handleMouseEvent),t.on("mouseout",this._handleMouseEvent),t.on("click",this._handleMouseEvent),t.on("dblclick",this._handleMouseEvent),this._updateContainerSize(),r}_onAddInterleaved(t){let r=t.painter.context.gl;return r instanceof WebGLRenderingContext&&k.warn("Incompatible basemap library. See: https://deck.gl/docs/api-reference/mapbox/overview#compatibility")(),this._deck=g_({map:t,gl:r,deck:new qr({...this._props,gl:r})}),t.on("styledata",this._handleStyleChange),md(t,this._deck,[],this._props.layers),document.createElement("div")}onRemove(){let t=this._map;t&&(this._interleaved?this._onRemoveInterleaved(t):this._onRemoveOverlaid(t)),this._deck=void 0,this._map=void 0,this._container=void 0}_onRemoveOverlaid(t){t.off("resize",this._updateContainerSize),t.off("render",this._updateViewState),t.off("mousedown",this._handleMouseEvent),t.off("dragstart",this._handleMouseEvent),t.off("drag",this._handleMouseEvent),t.off("dragend",this._handleMouseEvent),t.off("mousemove",this._handleMouseEvent),t.off("mouseout",this._handleMouseEvent),t.off("click",this._handleMouseEvent),t.off("dblclick",this._handleMouseEvent),this._deck?.finalize()}_onRemoveInterleaved(t){t.off("styledata",this._handleStyleChange),md(t,this._deck,this._props.layers,[]),Ob(t)}getDefaultPosition(){return"top-left"}pickObject(t){return yt(this._deck),this._deck.pickObject(t)}pickMultipleObjects(t){return yt(this._deck),this._deck.pickMultipleObjects(t)}pickObjects(t){return yt(this._deck),this._deck.pickObjects(t)}finalize(){this._map&&this._map.removeControl(this)}getCanvas(){return this._map?this._interleaved?this._map.getCanvas():this._deck.getCanvas():null}};var M_,Ft,U8,Bft,Xo,B8,z8,Bb,Ub,Fb,Db,Fft,_d={},V8=[],Dft=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,zb=Array.isArray;function Ci(e,t){for(var r in t)e[r]=t[r];return e}function H8(e){var t=e.parentNode;t&&t.removeChild(e)}function kft(e,t,r){var n,s,i,o={};for(i in t)i=="key"?n=t[i]:i=="ref"?s=t[i]:o[i]=t[i];if(arguments.length>2&&(o.children=arguments.length>3?M_.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)o[i]===void 0&&(o[i]=e.defaultProps[i]);return y_(e,o,n,s,null)}function y_(e,t,r,n,s){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:s??++U8,__i:-1,__u:0};return s==null&&Ft.vnode!=null&&Ft.vnode(i),i}function gl(e){return e.children}function A_(e,t){this.props=e,this.context=t}function $o(e,t){if(t==null)return e.__?$o(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?$o(e):null}function W8(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return W8(e)}}function F8(e){(!e.__d&&(e.__d=!0)&&Xo.push(e)&&!T_.__r++||B8!==Ft.debounceRendering)&&((B8=Ft.debounceRendering)||z8)(T_)}function T_(){var e,t,r,n,s,i,o,a;for(Xo.sort(Bb);e=Xo.shift();)e.__d&&(t=Xo.length,n=void 0,i=(s=(r=e).__v).__e,o=[],a=[],r.__P&&((n=Ci({},s)).__v=s.__v+1,Ft.vnode&&Ft.vnode(n),Vb(r.__P,n,s,r.__n,r.__P.namespaceURI,32&s.__u?[i]:null,o,i??$o(s),!!(32&s.__u),a),n.__v=s.__v,n.__.__k[n.__i]=n,q8(o,n,a),n.__e!=i&&W8(n)),Xo.length>t&&Xo.sort(Bb));T_.__r=0}function G8(e,t,r,n,s,i,o,a,c,l,h){var f,u,d,p,m,g=n&&n.__k||V8,_=t.length;for(r.__d=c,Uft(r,t,g),c=r.__d,f=0;f<_;f++)(d=r.__k[f])!=null&&typeof d!="boolean"&&typeof d!="function"&&(u=d.__i===-1?_d:g[d.__i]||_d,d.__i=f,Vb(e,d,u,s,i,o,a,c,l,h),p=d.__e,d.ref&&u.ref!=d.ref&&(u.ref&&Hb(u.ref,null,d),h.push(d.ref,d.__c||p,d)),m==null&&p!=null&&(m=p),65536&d.__u||u.__k===d.__k?c=j8(d,c,e):typeof d.type=="function"&&d.__d!==void 0?c=d.__d:p&&(c=p.nextSibling),d.__d=void 0,d.__u&=-196609);r.__d=c,r.__e=m}function Uft(e,t,r){var n,s,i,o,a,c=t.length,l=r.length,h=l,f=0;for(e.__k=[],n=0;n<c;n++)o=n+f,(s=e.__k[n]=(s=t[n])==null||typeof s=="boolean"||typeof s=="function"?null:typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?y_(null,s,null,null,null):zb(s)?y_(gl,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?y_(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s)!=null?(s.__=e,s.__b=e.__b+1,a=zft(s,r,o,h),s.__i=a,i=null,a!==-1&&(h--,(i=r[a])&&(i.__u|=131072)),i==null||i.__v===null?(a==-1&&f--,typeof s.type!="function"&&(s.__u|=65536)):a!==o&&(a==o-1?f--:a==o+1?f++:a>o?h>c-o?f+=a-o:f--:a<o&&(a==o-f?f-=a-o:f++),a!==n+f&&(s.__u|=65536))):(i=r[o])&&i.key==null&&i.__e&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=$o(i)),kb(i,i,!1),r[o]=null,h--);if(h)for(n=0;n<l;n++)(i=r[n])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=$o(i)),kb(i,i))}function j8(e,t,r){var n,s;if(typeof e.type=="function"){for(n=e.__k,s=0;n&&s<n.length;s++)n[s]&&(n[s].__=e,t=j8(n[s],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=$o(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function zft(e,t,r,n){var s=e.key,i=e.type,o=r-1,a=r+1,c=t[r];if(c===null||c&&s==c.key&&i===c.type&&!(131072&c.__u))return r;if(n>(c!=null&&!(131072&c.__u)?1:0))for(;o>=0||a<t.length;){if(o>=0){if((c=t[o])&&!(131072&c.__u)&&s==c.key&&i===c.type)return o;o--}if(a<t.length){if((c=t[a])&&!(131072&c.__u)&&s==c.key&&i===c.type)return a;a++}}return-1}function D8(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Dft.test(t)?r:r+"px"}function x_(e,t,r,n,s){var i;t:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||D8(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||D8(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.u=n.u:(r.u=Ub,e.addEventListener(t,i?Db:Fb,i)):e.removeEventListener(t,i?Db:Fb,i);else{if(s=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break t}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function k8(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Ub++;else if(t.t<r.u)return;return r(Ft.event?Ft.event(t):t)}}}function Vb(e,t,r,n,s,i,o,a,c,l){var h,f,u,d,p,m,g,_,y,x,A,M,E,w,v,b,T=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),i=[a=t.__e=r.__e]),(h=Ft.__b)&&h(t);t:if(typeof T=="function")try{if(_=t.props,y="prototype"in T&&T.prototype.render,x=(h=T.contextType)&&n[h.__c],A=h?x?x.props.value:h.__:n,r.__c?g=(f=t.__c=r.__c).__=f.__E:(y?t.__c=f=new T(_,A):(t.__c=f=new A_(_,A),f.constructor=T,f.render=Hft),x&&x.sub(f),f.props=_,f.state||(f.state={}),f.context=A,f.__n=n,u=f.__d=!0,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&T.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Ci({},f.__s)),Ci(f.__s,T.getDerivedStateFromProps(_,f.__s))),d=f.props,p=f.state,f.__v=t,u)y&&T.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&T.getDerivedStateFromProps==null&&_!==d&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(_,A),!f.__e&&(f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(_,f.__s,A)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(f.props=_,f.state=f.__s,f.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(I){I&&(I.__=t)}),M=0;M<f._sb.length;M++)f.__h.push(f._sb[M]);f._sb=[],f.__h.length&&o.push(f);break t}f.componentWillUpdate!=null&&f.componentWillUpdate(_,f.__s,A),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(d,p,m)})}if(f.context=A,f.props=_,f.__P=e,f.__e=!1,E=Ft.__r,w=0,y){for(f.state=f.__s,f.__d=!1,E&&E(t),h=f.render(f.props,f.state,f.context),v=0;v<f._sb.length;v++)f.__h.push(f._sb[v]);f._sb=[]}else do f.__d=!1,E&&E(t),h=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++w<25);f.state=f.__s,f.getChildContext!=null&&(n=Ci(Ci({},n),f.getChildContext())),y&&!u&&f.getSnapshotBeforeUpdate!=null&&(m=f.getSnapshotBeforeUpdate(d,p)),G8(e,zb(b=h!=null&&h.type===gl&&h.key==null?h.props.children:h)?b:[b],t,r,n,s,i,o,a,c,l),f.base=t.__e,t.__u&=-161,f.__h.length&&o.push(f),g&&(f.__E=f.__=null)}catch(I){if(t.__v=null,c||i!=null){for(t.__u|=c?160:32;a&&a.nodeType===8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,t.__e=a}else t.__e=r.__e,t.__k=r.__k;Ft.__e(I,t,r)}else i==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=Vft(r.__e,t,r,n,s,i,o,c,l);(h=Ft.diffed)&&h(t)}function q8(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)Hb(r[n],r[++n],r[++n]);Ft.__c&&Ft.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(i){i.call(s)})}catch(i){Ft.__e(i,s.__v)}})}function Vft(e,t,r,n,s,i,o,a,c){var l,h,f,u,d,p,m,g=r.props,_=t.props,y=t.type;if(y==="svg"?s="http://www.w3.org/2000/svg":y==="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),i!=null){for(l=0;l<i.length;l++)if((d=i[l])&&"setAttribute"in d==!!y&&(y?d.localName===y:d.nodeType===3)){e=d,i[l]=null;break}}if(e==null){if(y===null)return document.createTextNode(_);e=document.createElementNS(s,y,_.is&&_),i=null,a=!1}if(y===null)g===_||a&&e.data===_||(e.data=_);else{if(i=i&&M_.call(e.childNodes),g=r.props||_d,!a&&i!=null)for(g={},l=0;l<e.attributes.length;l++)g[(d=e.attributes[l]).name]=d.value;for(l in g)if(d=g[l],l!="children"){if(l=="dangerouslySetInnerHTML")f=d;else if(l!=="key"&&!(l in _)){if(l=="value"&&"defaultValue"in _||l=="checked"&&"defaultChecked"in _)continue;x_(e,l,null,d,s)}}for(l in _)d=_[l],l=="children"?u=d:l=="dangerouslySetInnerHTML"?h=d:l=="value"?p=d:l=="checked"?m=d:l==="key"||a&&typeof d!="function"||g[l]===d||x_(e,l,d,g[l],s);if(h)a||f&&(h.__html===f.__html||h.__html===e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(f&&(e.innerHTML=""),G8(e,zb(u)?u:[u],t,r,n,y==="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,o,i?i[0]:r.__k&&$o(r,0),a,c),i!=null)for(l=i.length;l--;)i[l]!=null&&H8(i[l]);a||(l="value",p!==void 0&&(p!==e[l]||y==="progress"&&!p||y==="option"&&p!==g[l])&&x_(e,l,p,g[l],s),l="checked",m!==void 0&&m!==e[l]&&x_(e,l,m,g[l],s))}return e}function Hb(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(s){Ft.__e(s,r)}}function kb(e,t,r){var n,s;if(Ft.unmount&&Ft.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Hb(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){Ft.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(s=0;s<n.length;s++)n[s]&&kb(n[s],t,r||typeof e.type!="function");r||e.__e==null||H8(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Hft(e,t,r){return this.constructor(e,r)}function Fn(e,t,r){var n,s,i,o;Ft.__&&Ft.__(e,t),s=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],o=[],Vb(t,e=(!n&&r||t).__k=kft(gl,null,[e]),s||_d,_d,t.namespaceURI,!n&&r?[r]:s?null:t.firstChild?M_.call(t.childNodes):null,i,!n&&r?r:s?s.__e:t.firstChild,n,o),q8(i,e,o)}M_=V8.slice,Ft={__e:function(e,t,r,n){for(var s,i,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(e)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,n||{}),o=s.__d),o)return s.__E=s}catch(a){e=a}throw e}},U8=0,Bft=function(e){return e!=null&&e.constructor==null},A_.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ci({},this.state),typeof e=="function"&&(e=e(Ci({},r),this.props)),e&&Ci(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),F8(this))},A_.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),F8(this))},A_.prototype.render=gl,Xo=[],z8=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Bb=function(e,t){return e.__v.__b-t.__v.__b},T_.__r=0,Ub=0,Fb=k8(!1),Db=k8(!0),Fft=0;var Wft=0,Hie=Array.isArray;function Lt(e,t,r,n,s,i){t||(t={});var o,a,c=t;if("ref"in c)for(a in c={},t)a=="ref"?o=t[a]:c[a]=t[a];var l={type:e,props:c,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Wft,__i:-1,__u:0,__source:s,__self:i};if(typeof e=="function"&&(o=e.defaultProps))for(a in o)c[a]===void 0&&(c[a]=o[a]);return Ft.vnode&&Ft.vnode(l),l}var Gb={};Nt(Gb,{ButtonGroup:()=>Wb,GroupedIconButton:()=>E_,IconButton:()=>Ko});var Ko=e=>{let{className:t,label:r,onClick:n}=e;return Lt("div",{className:"deck-widget-button",children:Lt("button",{className:`deck-widget-icon-button ${t}`,type:"button",onClick:n,title:r,children:Lt("div",{className:"deck-widget-icon"})})})},Wb=e=>{let{children:t,orientation:r}=e;return Lt("div",{className:`deck-widget-button-group ${r}`,children:t})},E_=e=>{let{className:t,label:r,onClick:n}=e;return Lt("button",{className:`deck-widget-icon-button ${t}`,type:"button",onClick:n,title:r,children:Lt("div",{className:"deck-widget-icon"})})};var b_=class{constructor(t){this.id="fullscreen",this.placement="top-left",this.fullscreen=!1,this.id=t.id??this.id,this.placement=t.placement??this.placement,this.props={...t,enterLabel:t.enterLabel??"Enter Fullscreen",exitLabel:t.exitLabel??"Exit Fullscreen",style:t.style??{}}}onAdd({deck:t}){let{style:r,className:n}=this.props,s=document.createElement("div");return s.classList.add("deck-widget","deck-widget-fullscreen"),n&&s.classList.add(n),Qe(s,r),this.deck=t,this.element=s,this.update(),document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this)),s}onRemove(){this.deck=void 0,this.element=void 0,document.removeEventListener("fullscreenchange",this.onFullscreenChange.bind(this))}update(){let{enterLabel:t,exitLabel:r}=this.props,n=this.element;if(!n)return;let s=Lt(Ko,{onClick:this.handleClick.bind(this),label:this.fullscreen?r:t,className:this.fullscreen?"deck-widget-fullscreen-exit":"deck-widget-fullscreen-enter"});Fn(s,n)}setProps(t){this.placement=t.placement??this.placement;let r=this.props,n=this.element;n&&(r.className!==t.className&&(r.className&&n.classList.remove(r.className),t.className&&n.classList.add(t.className)),Q(r.style,t.style,1)||(Mn(n,r.style),Qe(n,t.style))),Object.assign(this.props,t),this.update()}getContainer(){return this.props.container||this.deck?.getCanvas()?.parentElement}onFullscreenChange(){let t=this.fullscreen,r=document.fullscreenElement===this.getContainer();t!==r&&(this.fullscreen=!this.fullscreen),this.update()}async handleClick(){this.fullscreen?await this.exitFullscreen():await this.requestFullscreen(),this.update()}async requestFullscreen(){let t=this.getContainer();t?.requestFullscreen?await t.requestFullscreen({navigationUI:"hide"}):this.togglePseudoFullscreen()}async exitFullscreen(){document.exitFullscreen?await document.exitFullscreen():this.togglePseudoFullscreen()}togglePseudoFullscreen(){this.getContainer()?.classList.toggle("deck-pseudo-fullscreen")}};var S_=class{constructor(t){this.id="compass",this.placement="top-left",this.viewId=null,this.viewports={},this.id=t.id??this.id,this.viewId=t.viewId??this.viewId,this.placement=t.placement??this.placement,this.props={...t,transitionDuration:t.transitionDuration??200,label:t.label??"Reset Compass",style:t.style??{}}}setProps(t){this.placement=t.placement??this.placement,this.viewId=t.viewId??this.viewId;let r=this.props,n=this.element;n&&(r.className!==t.className&&(r.className&&n.classList.remove(r.className),t.className&&n.classList.add(t.className)),Q(r.style,t.style,1)||(Mn(n,r.style),Qe(n,t.style))),Object.assign(this.props,t),this.update()}onViewportChange(t){t.equals(this.viewports[t.id])||(this.viewports[t.id]=t,this.update())}onAdd({deck:t}){let{style:r,className:n}=this.props,s=document.createElement("div");return s.classList.add("deck-widget","deck-widget-compass"),n&&s.classList.add(n),Qe(s,r),this.deck=t,this.element=s,this.update(),s}getRotation(t){return t instanceof Pe?[-t.bearing,t.pitch]:t instanceof Xr?[0,Math.max(-80,Math.min(80,t.latitude))]:[0,0]}update(){let t=this.viewId||Object.values(this.viewports)[0]?.id||"default-view",r=this.viewports[t],[n,s]=this.getRotation(r),i=this.element;if(!i)return;let o=Lt("div",{className:"deck-widget-button",style:{perspective:100},children:Lt("button",{type:"button",onClick:()=>{for(let a of Object.values(this.viewports))this.handleCompassReset(a)},title:this.props.label,style:{transform:`rotateX(${s}deg)`},children:Lt("svg",{fill:"none",width:"100%",height:"100%",viewBox:"0 0 26 26",children:Lt("g",{transform:`rotate(${n},13,13)`,children:[Lt("path",{d:"M10 13.0001L12.9999 5L15.9997 13.0001H10Z",fill:"var(--icon-compass-north-color, #F05C44)"}),Lt("path",{d:"M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z",fill:"var(--icon-compass-south-color, #C2C2CC)"})]})})})});Fn(o,i)}onRemove(){this.deck=void 0,this.element=void 0}handleCompassReset(t){let r=this.viewId||t.id||"default-view";if(t instanceof Pe){let n={...t,bearing:0,...this.getRotation(t)[0]===0?{pitch:0}:{},transitionDuration:this.props.transitionDuration,transitionInterpolator:new is};this.deck._onViewStateChange({viewId:r,viewState:n,interactionState:{}})}}};var Zo=class{constructor(t={}){this.id="zoom",this.placement="top-left",this.viewId=null,this.viewports={},this.id=t.id??this.id,this.viewId=t.viewId??this.viewId,this.placement=t.placement??this.placement,this.props={...Zo.defaultProps,...t}}onAdd({deck:t}){let{style:r,className:n}=this.props,s=document.createElement("div");return s.classList.add("deck-widget","deck-widget-zoom"),n&&s.classList.add(n),Qe(s,r),this.deck=t,this.element=s,this.update(),s}onRemove(){this.deck=void 0,this.element=void 0}setProps(t){this.placement=t.placement??this.placement,this.viewId=t.viewId??this.viewId;let r=this.props,n=this.element;n&&(r.className!==t.className&&(r.className&&n.classList.remove(r.className),t.className&&n.classList.add(t.className)),Q(r.style,t.style,1)||(Mn(n,r.style),Qe(n,t.style))),Object.assign(this.props,t),this.update()}onViewportChange(t){this.viewports[t.id]=t}handleZoom(t,r){let n=this.viewId||t?.id||"default-view",s={...t,zoom:r};this.props.transitionDuration>0&&(s.transitionDuration=this.props.transitionDuration,s.transitionInterpolator="latitude"in s?new is:new ue),this.setViewState(n,s)}handleZoomIn(){for(let t of Object.values(this.viewports))this.handleZoom(t,t.zoom+1)}handleZoomOut(){for(let t of Object.values(this.viewports))this.handleZoom(t,t.zoom-1)}setViewState(t,r){this.deck._onViewStateChange({viewId:t,viewState:r,interactionState:{}})}update(){let t=this.element;if(!t)return;let r=Lt(Wb,{orientation:this.props.orientation,children:[Lt(E_,{onClick:()=>this.handleZoomIn(),label:this.props.zoomInLabel,className:"deck-widget-zoom-in"}),Lt(E_,{onClick:()=>this.handleZoomOut(),label:this.props.zoomOutLabel,className:"deck-widget-zoom-out"})]});Fn(r,t)}};Zo.defaultProps={id:"zoom-widget",style:{},placement:"top-left",className:void 0,orientation:"vertical",transitionDuration:200,zoomInLabel:"Zoom In",zoomOutLabel:"Zoom Out",viewId:void 0};var nn=class{constructor(t){this.id=t.id||"widget",this.props=t}onAdd({deck:t}){this.deck=t;let{style:r,className:n}=this.props,s=this._createRootElement({widgetClassName:this.className,className:n,style:r});return this.element=s,this.onRenderHTML(),this.element}onRemove(){this.deck=void 0,this.element=void 0}setProps(t){let r=this.props,n=this.element;n&&(r.className!==t.className&&(r.className&&n.classList.remove(r.className),t.className&&n.classList.add(t.className)),Q(r.style,t.style,1)||(Mn(n,r.style),Qe(n,t.style))),Object.assign(this.props,t),this.onRenderHTML()}_createRootElement(t){let{widgetClassName:r,className:n,style:s}=t,i=document.createElement("div");return["deck-widget",r,n].filter(o=>typeof o=="string"&&o.length>0).forEach(o=>i.classList.add(o)),Qe(i,s),i}};nn.defaultProps={id:"widget",style:{},className:""};var Jo=class extends nn{constructor(t={}){super({...Jo.defaultProps,...t}),this.className="deck-widget-screenshot",this.placement="top-left",this.placement=t.placement??this.placement}setProps(t){this.placement=t.placement??this.placement,super.setProps(t)}onRenderHTML(){let t=this.element;t&&Fn(Lt(Ko,{className:"deck-widget-camera",label:this.props.label,onClick:this.handleClick.bind(this)}),t)}handleClick(){if(this.props.onCapture){this.props.onCapture(this);return}let t=this.captureScreenToDataURL(this.props.imageFormat);t&&this.downloadDataURL(t,this.props.filename)}captureScreenToDataURL(t){return this.deck?.getCanvas()?.toDataURL(t)}downloadDataURL(t,r){let n=document.createElement("a");n.href=t,n.download=r,n.click()}};Jo.defaultProps={...nn.defaultProps,id:"screenshot",placement:"top-left",label:"Screenshot",filename:"screenshot.png",imageFormat:"image/png",onCapture:void 0};var Qo=class extends nn{constructor(t={}){super({...Qo.defaultProps,...t}),this.className="deck-widget-reset-view",this.placement="top-left",this.placement=t.placement??this.placement}setProps(t){this.placement=t.placement??this.placement,super.setProps(t)}onRenderHTML(){let t=this.element;t&&Fn(Lt(Ko,{className:"deck-widget-reset-focus",label:this.props.label,onClick:this.handleClick.bind(this)}),t)}handleClick(){let t=this.props.initialViewState||this.deck?.props.initialViewState;this.setViewState(t)}setViewState(t){let r=this.props.viewId||t?.id||"default-view",n={...t};this.deck._onViewStateChange({viewId:r,viewState:n,interactionState:{}})}};Qo.defaultProps={...nn.defaultProps,id:"reset-view",placement:"top-left",label:"Reset View",initialViewState:void 0,viewId:void 0};var Gft={"--button-background":"#fff","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},jft={"--button-background":"rgba(18, 18, 20, 1)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},qft={"--button-background":"rgba(255, 255, 255, 0.6)","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"1px solid rgba(255, 255, 255, 0.6)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},Yft={"--button-background":"rgba(18, 18, 20, 0.75)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"1px solid rgba(18, 18, 20, 0.75)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"};var xd=Dn(eu(),1);ac._checkH3Lib=()=>{let e='include the <script src="https://unpkg.com/h3-js@^4.0.0"><\/script> tag before the deck.gl script tag. https://deck.gl/docs/api-reference/geo-layers/h3-hexagon-layer';if(xd){if(xd.polyfill&&!xd.polygonToCells)throw new Error(`Incompatible h3-js version. ${e}`)}else throw new Error(`To use H3 functionality, ${e}`)};return ez(Xft);})();
5978
+ `,uniformTypes:{textureSize:"f32"}};var Aft=2,vb={format:"rgba8unorm",mipmaps:!1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}},E8=[0,0],Tft={SUM:0,MEAN:1},Mft={getPosition:{type:"accessor",value:e=>e.position},getWeight:{type:"accessor",value:1},intensity:{type:"number",min:0,value:1},radiusPixels:{type:"number",min:1,max:100,value:50},colorRange:vi,threshold:{type:"number",min:0,max:1,value:.05},colorDomain:{type:"array",value:null,optional:!0},aggregation:"SUM",weightsTextureSize:{type:"number",min:128,max:2048,value:2048},debounceTimeout:{type:"number",min:0,max:1e3,value:500}},Eft=["float32-renderable-webgl","texture-blend-float-webgl"],bft={data:{props:["radiusPixels"]}},fd=class extends x8{getShaders(t){let r=[st];return t.modules&&(r=[...r,...t.modules]),super.getShaders({...t,modules:r})}initializeState(){super.initializeAggregationLayer(bft),this.setState({colorDomain:E8}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}shouldUpdateState({changeFlags:t}){return t.somethingChanged}updateState(t){super.updateState(t),this._updateHeatmapState(t)}_updateHeatmapState(t){let{props:r,oldProps:n}=t,s=this._getChangeFlags(t);(s.dataChanged||s.viewportChanged)&&(s.boundsChanged=this._updateBounds(s.dataChanged),this._updateTextureRenderingBounds()),s.dataChanged||s.boundsChanged?(clearTimeout(this.state.updateTimer),this.setState({isWeightMapDirty:!0})):s.viewportZoomChanged&&this._debouncedUpdateWeightmap(),r.colorRange!==n.colorRange&&this._updateColorTexture(t),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:t.context.viewport.zoom})}renderLayers(){let{weightsTexture:t,triPositionBuffer:r,triTexCoordBuffer:n,maxWeightsTexture:s,colorTexture:i,colorDomain:o}=this.state,{updateTriggers:a,intensity:c,threshold:l,aggregation:h}=this.props,f=this.getSubLayerClass("triangle",g8);return new f(this.getSubLayerProps({id:"triangle-layer",updateTriggers:a}),{coordinateSystem:H.DEFAULT,data:{attributes:{positions:r,texCoords:n}},vertexCount:4,maxTexture:s,colorTexture:i,aggregationMode:Tft[h]||0,weightsTexture:t,intensity:c,threshold:l,colorDomain:o})}finalizeState(t){super.finalizeState(t);let{weightsTransform:r,weightsTexture:n,maxWeightTransform:s,maxWeightsTexture:i,triPositionBuffer:o,triTexCoordBuffer:a,colorTexture:c,updateTimer:l}=this.state;r?.destroy(),n?.destroy(),s?.destroy(),i?.destroy(),o?.destroy(),a?.destroy(),c?.destroy(),l&&clearTimeout(l)}_getAttributeManager(){return new dr(this.context.device,{id:this.props.id,stats:this.context.stats})}_getChangeFlags(t){let r={},{dimensions:n}=this.state;r.dataChanged=this.isAttributeChanged()&&"attribute changed"||this.isAggregationDirty(t,{compareAll:!0,dimension:n.data})&&"aggregation is dirty",r.viewportChanged=t.changeFlags.viewportChanged;let{zoom:s}=this.state;return(!t.context.viewport||t.context.viewport.zoom!==s)&&(r.viewportZoomChanged=!0),r}_createTextures(){let{textureSize:t,format:r}=this.state;this.setState({weightsTexture:this.context.device.createTexture({...vb,width:t,height:t,format:r}),maxWeightsTexture:this.context.device.createTexture({...vb,width:1,height:1,format:r})})}_setupAttributes(){this.getAttributeManager().add({positions:{size:3,type:"float64",accessor:"getPosition"},weights:{size:1,accessor:"getWeight"}}),this.setState({positionAttributeName:"positions"})}_setupTextureParams(){let{device:t}=this.context,{weightsTextureSize:r}=this.props,n=Math.min(r,t.limits.maxTextureDimension2D),s=Eft.every(a=>t.features.has(a)),i=s?"rgba32float":"rgba8unorm",o=s?1:1/255;this.setState({textureSize:n,format:i,weightsScale:o}),s||k.warn(`HeatmapLayer: ${this.id} rendering to float texture not supported, falling back to low precision format`)()}_createWeightsTransform(t){let{weightsTransform:r}=this.state,{weightsTexture:n}=this.state,s=this.getAttributeManager();r?.destroy(),r=new qs(this.context.device,{id:`${this.id}-weights-transform`,bufferLayout:s.getBufferLayouts(),vertexCount:1,targetTexture:n,parameters:{depthWriteEnabled:!1,blendColorOperation:"add",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"},topology:"point-list",...t,modules:[...t.modules,T8]}),this.setState({weightsTransform:r})}_setupResources(){this._createTextures();let{device:t}=this.context,{textureSize:r,weightsTexture:n,maxWeightsTexture:s}=this.state,i=this.getShaders({vs:bb,fs:Sb});this._createWeightsTransform(i);let o=this.getShaders({vs:y8,fs:A8,modules:[M8]}),a=new qs(t,{id:`${this.id}-max-weights-transform`,targetTexture:s,...o,vertexCount:r*r,topology:"point-list",parameters:{depthWriteEnabled:!1,blendColorOperation:"max",blendAlphaOperation:"max",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"}}),c={inTexture:n,textureSize:r};a.model.shaderInputs.setProps({maxWeight:c}),this.setState({weightsTexture:n,maxWeightsTexture:s,maxWeightTransform:a,zoom:null,triPositionBuffer:t.createBuffer({byteLength:48}),triTexCoordBuffer:t.createBuffer({byteLength:48})})}updateShaders(t){this._createWeightsTransform({vs:bb,fs:Sb,...t})}_updateMaxWeightValue(){let{maxWeightTransform:t}=this.state;t.run({parameters:{viewport:[0,0,1,1]},clearColor:[0,0,0,0]})}_updateBounds(t=!1){let{viewport:r}=this.context,n=[r.unproject([0,0]),r.unproject([r.width,0]),r.unproject([0,r.height]),r.unproject([r.width,r.height])].map(a=>a.map(Math.fround)),s=c8(n),i={visibleWorldBounds:s,viewportCorners:n},o=!1;if(t||!this.state.worldBounds||!l8(this.state.worldBounds,s)){let a=this._worldToCommonBounds(s),c=this._commonToWorldBounds(a);this.props.coordinateSystem===H.LNGLAT&&(c[1]=Math.max(c[1],-85.051129),c[3]=Math.min(c[3],85.051129),c[0]=Math.max(c[0],-360),c[2]=Math.min(c[2],360));let l=this._worldToCommonBounds(c);i.worldBounds=c,i.normalizedCommonBounds=l,o=!0}return this.setState(i),o}_updateTextureRenderingBounds(){let{triPositionBuffer:t,triTexCoordBuffer:r,normalizedCommonBounds:n,viewportCorners:s}=this.state,{viewport:i}=this.context;t.write(Eb(s,3));let o=s.map(a=>f8(i.projectPosition(a),n));r.write(Eb(o,2))}_updateColorTexture(t){let{colorRange:r}=t.props,{colorTexture:n}=this.state,s=Tb(r,!1,Uint8Array);n&&n?.width===r.length?n.setTexture2DData({data:s}):(n?.destroy(),n=this.context.device.createTexture({...vb,data:s,width:r.length,height:1})),this.setState({colorTexture:n})}_updateWeightmap(){let{radiusPixels:t,colorDomain:r,aggregation:n}=this.props,{worldBounds:s,textureSize:i,weightsScale:o,weightsTexture:a}=this.state,c=this.state.weightsTransform;this.state.isWeightMapDirty=!1;let l=this._worldToCommonBounds(s,{useLayerCoordinateSystem:!0});if(r&&n==="SUM"){let{viewport:x}=this.context,A=x.distanceScales.metersPerUnit[2]*(l[2]-l[0])/i;this.state.colorDomain=r.map(M=>M*A*o)}else this.state.colorDomain=r||E8;let f=this.getAttributeManager().getAttributes(),u=this.getModuleSettings();this._setModelAttributes(c.model,f),c.model.setVertexCount(this.getNumInstances());let d={radiusPixels:t,commonBounds:l,textureWidth:i,weightsScale:o,weightsTexture:a},{viewport:p,devicePixelRatio:m,coordinateSystem:g,coordinateOrigin:_}=u,{modelMatrix:y}=this.props;c.model.shaderInputs.setProps({project:{viewport:p,devicePixelRatio:m,modelMatrix:y,coordinateSystem:g,coordinateOrigin:_},weight:d}),c.run({parameters:{viewport:[0,0,i,i]},clearColor:[0,0,0,0]}),this._updateMaxWeightValue()}_debouncedUpdateWeightmap(t=!1){let{updateTimer:r}=this.state,{debounceTimeout:n}=this.props;t?(r=null,this._updateBounds(!0),this._updateTextureRenderingBounds(),this.setState({isWeightMapDirty:!0})):(this.setState({isWeightMapDirty:!1}),clearTimeout(r),r=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),n)),this.setState({updateTimer:r})}_worldToCommonBounds(t,r={}){let{useLayerCoordinateSystem:n=!1}=r,[s,i,o,a]=t,{viewport:c}=this.context,{textureSize:l}=this.state,{coordinateSystem:h}=this.props,f=n&&(h===H.LNGLAT_OFFSETS||h===H.METER_OFFSETS),u=f?c.projectPosition(this.props.coordinateOrigin):[0,0],d=l*Aft/c.scale,p,m;return n&&!f?(p=this.projectPosition([s,i,0]),m=this.projectPosition([o,a,0])):(p=c.projectPosition([s,i,0]),m=c.projectPosition([o,a,0])),h8([p[0]-u[0],p[1]-u[1],m[0]-u[0],m[1]-u[1]],d,d)}_commonToWorldBounds(t){let[r,n,s,i]=t,{viewport:o}=this.context,a=o.unprojectPosition([r,n]),c=o.unprojectPosition([s,i]);return a.slice(0,2).concat(c.slice(0,2))}};fd.layerName="HeatmapLayer";fd.defaultProps=Mft;var b8=fd;var wb=85.05113;function Pb(e,t,r,n){if(r){if(r.userData._googleMap===e)return r;m_(r)}let s={click:null,rightclick:null,dblclick:null,mousemove:null,mouseout:null},i=new qr({...n,useDevicePixels:n.interleaved?!0:n.useDevicePixels,style:n.interleaved?null:{pointerEvents:"none"},parent:Sft(t,n.style),views:new $s({repeat:!0}),initialViewState:{longitude:0,latitude:0,zoom:1},controller:!1});for(let o in s)s[o]=e.addListener(o,a=>wft(i,o,a));return i.userData._googleMap=e,i.userData._eventListeners=s,i}function Sft(e,t){let r=document.createElement("div");return r.style.position="absolute",Object.assign(r.style,t),"getPanes"in e?e.getPanes()?.overlayLayer.appendChild(r):e.getMap()?.getDiv().appendChild(r),r}function m_(e){let{_eventListeners:t}=e.userData;for(let r in t)t[r]&&t[r].remove();e.finalize()}function S8(e,t){let{width:r,height:n}=v8(e),s=t.getProjection(),i=e.getBounds();if(!i)return{width:r,height:n,left:0,top:0};let o=i.getNorthEast(),a=i.getSouthWest(),c=s.fromLatLngToDivPixel(o),l=s.fromLatLngToDivPixel(a),h=Cb(s,r/2,n/2),f=new google.maps.LatLng(0,h[0]),u=s.fromLatLngToContainerPixel(f),d=s.fromLatLngToDivPixel(f);if(!c||!l||!d||!u)return{width:r,height:n,left:0,top:0};let p=Math.round(d.x-u.x),m=d.y-u.y,g=Cb(s,r/2,0),_=Cb(s,r/2,n),y=h[1],x=h[0];if(Math.abs(y)>wb){y=y>0?wb:-wb;let b=new google.maps.LatLng(y,x),T=s.fromLatLngToContainerPixel(b);m+=T.y-n/2}m=Math.round(m);let M=180*new Vi(g).sub(_).verticalAngle()/Math.PI;M<0&&(M+=360);let E=e.getHeading()||0,w=e.getZoom()-1,v;if(M===0)v=n?(l.y-c.y)/n:1;else if(M===E){let b=new Vi([c.x,c.y]).sub([l.x,l.y]).len(),T=new Vi([r,-n]).len();v=T?b/T:1}return w+=Math.log2(v||1),{width:r,height:n,left:p,top:m,zoom:w,bearing:M,pitch:e.getTilt(),latitude:y,longitude:x}}function Rb(e,t){let{width:r,height:n}=v8(e),{center:s,heading:i,tilt:o,zoom:a}=t.getCameraParams(),c=25,l=n?r/n:1,h=.75,f=3e14,u=new K().perspective({fovy:c*Math.PI/180,aspect:l,near:h,far:f}),d=.5*u[5];return{width:r,height:n,viewState:{altitude:d,bearing:i,latitude:s.lat(),longitude:s.lng(),pitch:o,projectionMatrix:u,repeat:!0,zoom:a-1}}}function v8(e){let t=e.getDiv().firstChild;return{width:t.offsetWidth,height:t.offsetHeight}}function Cb(e,t,r){let n=new google.maps.Point(t,r),s=e.fromContainerPixelToLatLng(n);return[s.lng(),s.lat()]}function vft(e,t){if(e.pixel)return e.pixel;let r=t.getViewports()[0].project([e.latLng.lng(),e.latLng.lat()]);return{x:r[0],y:r[1]}}function wft(e,t,r){if(!e.isInitialized)return;let n={type:t,offsetCenter:vft(r,e),srcEvent:r};switch(t){case"click":case"rightclick":n.type="click",n.tapCount=1,e._onPointerDown(n),e._onEvent(n);break;case"dblclick":n.type="click",n.tapCount=2,e._onEvent(n);break;case"mousemove":n.type="pointermove",e._onPointerMove(n);break;case"mouseout":n.type="pointerleave",e._onPointerMove(n);break;default:return}}var Cft=()=>!1,Pft={depthMask:!0,depthTest:!0,blend:!0,blendFunc:[770,771,1,771],blendEquation:32774};function w8(){}var Rft={interleaved:!0},ud=class{constructor(t){this.props={},this._map=null,this._deck=null,this._overlay=null,this.setProps({...Rft,...t})}setMap(t){if(t===this._map)return;let{VECTOR:r,UNINITIALIZED:n}=google.maps.RenderingType;this._map&&(!t&&this._map.getRenderingType()===r&&this.props.interleaved&&this._overlay.requestRedraw(),this._overlay?.setMap(null),this._map=null),t&&(this._map=t,t.getRenderingType()!==n?this._createOverlay(t):t.addListener("renderingtype_changed",()=>{this._createOverlay(t)}))}setProps(t){if(Object.assign(this.props,t),this._deck){let r=this._deck.getCanvas();if(t.style&&r?.parentElement){let n=r.parentElement.style;Object.assign(n,t.style),t.style=null}this._deck.setProps(t)}}pickObject(t){return this._deck&&this._deck.pickObject(t)}pickMultipleObjects(t){return this._deck&&this._deck.pickMultipleObjects(t)}pickObjects(t){return this._deck&&this._deck.pickObjects(t)}finalize(){this.setMap(null),this._deck&&(m_(this._deck),this._deck=null)}_createOverlay(t){let{interleaved:r}=this.props,{VECTOR:n,UNINITIALIZED:s}=google.maps.RenderingType,i=t.getRenderingType();if(i===s)return;let a=i===n&&google.maps.WebGLOverlayView?google.maps.WebGLOverlayView:google.maps.OverlayView,c=new a;c instanceof google.maps.WebGLOverlayView?(r?(c.onAdd=w8,c.onContextRestored=this._onContextRestored.bind(this),c.onDraw=this._onDrawVectorInterleaved.bind(this)):(c.onAdd=this._onAdd.bind(this),c.onContextRestored=w8,c.onDraw=this._onDrawVectorOverlay.bind(this)),c.onContextLost=this._onContextLost.bind(this)):(c.onAdd=this._onAdd.bind(this),c.draw=this._onDrawRaster.bind(this)),c.onRemove=this._onRemove.bind(this),this._overlay=c,this._overlay.setMap(t)}_onAdd(){this._deck=Pb(this._map,this._overlay,this._deck,this.props)}_onContextRestored({gl:t}){if(!this._map||!this._overlay)return;let r=()=>{this._overlay&&this._overlay.requestRedraw()},n=Pb(this._map,this._overlay,this._deck,{gl:t,_customRender:r,...this.props});this._deck=n;let s=n.animationLoop;s._renderFrame=()=>{let i=t.getParameter(34964);n.device.withParametersWebGL({},()=>{s.props.onRender(s.animationProps)}),t.bindBuffer(34962,i)}}_onContextLost(){this._deck&&(m_(this._deck),this._deck=null)}_onRemove(){this._deck?.setProps({layerFilter:Cft})}_onDrawRaster(){if(!this._deck||!this._map)return;let t=this._deck,{width:r,height:n,left:s,top:i,...o}=S8(this._map,this._overlay),c=t.getCanvas()?.parentElement||t.props.parent;if(c){let h=c.style;h.left=`${s}px`,h.top=`${i}px`}let l=1e4;t.setProps({width:r,height:n,viewState:{altitude:l,...o}}),t.redraw()}_onDrawVectorInterleaved({gl:t,transformer:r}){if(!this._deck||!this._map)return;let n=this._deck;if(n.setProps({...Rb(this._map,r),width:null,height:null}),n.isInitialized){let s=n.device;if(s instanceof Je){let i=s.getParametersWebGL(36006);n.setProps({_framebuffer:i})}n.needsRedraw({clearRedrawFlags:!0}),s instanceof Je&&(s.setParametersWebGL({viewport:[0,0,t.canvas.width,t.canvas.height],scissor:[0,0,t.canvas.width,t.canvas.height],stencilFunc:[519,0,255,519,0,255]}),s.withParametersWebGL(Pft,()=>{n._drawLayers("google-vector",{clearCanvas:!1})}))}}_onDrawVectorOverlay({transformer:t}){if(!this._deck||!this._map)return;let r=this._deck;r.setProps({...Rb(this._map,t)}),r.redraw()}};var Ib=512,Ift=Math.PI/180;function g_({map:e,gl:t,deck:r}){if(e.__deck)return e.__deck;let n=r?.props._customRender,s=r?.props.onLoad,i={...r?.props,_customRender:()=>{e.triggerRepaint(),n?.("")}};i.parameters={...__(e,!0),...i.parameters},i.views||(i.views=dd(e));let o;return(!r||r.props.gl===t)&&(Object.assign(i,{gl:t,width:null,height:null,touchAction:"unset",viewState:ml(e)}),r?.isInitialized?C8(r,e):i.onLoad=()=>{s?.(),C8(o,e)}),r?(o=r,r.setProps(i),r.userData.isExternal=!0):(o=new qr(i),e.on("remove",()=>{Ob(e)})),o.userData.mapboxLayers=new Set,e.__deck=o,e.on("render",()=>{o.isInitialized&&Lft(o,e)}),o}function C8(e,t){let r=()=>{e.isInitialized?Nft(e,t):t.off("move",r)};t.on("move",r)}function Ob(e){e.__deck?.finalize(),e.__deck=null}function __(e,t){let r=t?{depthWriteEnabled:!0,depthCompare:"less-equal",depthBias:0,blend:!0,blendColorSrcFactor:"src-alpha",blendColorDstFactor:"one-minus-src-alpha",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one-minus-src-alpha",blendColorOperation:"add",blendAlphaOperation:"add"}:{};return L8(e)==="globe"&&(r.cullMode="back"),r}function P8(e,t){e.userData.mapboxLayers.add(t),Lb(e)}function R8(e,t){e.userData.mapboxLayers.delete(t),Lb(e)}function I8(e,t){Lb(e)}function O8(e,t,r,n){let{currentViewport:s}=e.userData,i=!1;s||(s=N8(e,t,n),e.userData.currentViewport=s,i=!0),e.isInitialized&&e._drawLayers("mapbox-repaint",{viewports:[s],layerFilter:o=>(!e.props.layerFilter||e.props.layerFilter(o))&&(r.id===o.layer.id||o.layer.props.operation.includes("terrain")),clearStack:i,clearCanvas:!1})}function L8(e){let t=e.getProjection?.(),r=t?.type||t?.name;if(r==="globe")return"globe";if(r&&r!=="mercator")throw new Error("Unsupported projection");return"mercator"}function dd(e){return L8(e)==="globe"?new Jm({id:"mapbox"}):new $s({id:"mapbox"})}function ml(e){let{lng:t,lat:r}=e.getCenter(),n={longitude:(t+540)%360-180,latitude:r,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch(),padding:e.getPadding(),repeat:e.getRenderWorldCopies()};return e.getTerrain?.()&&Oft(e,n),n}function Oft(e,t){if(e.getFreeCameraOptions){let{position:r}=e.getFreeCameraOptions();if(!r||r.z===void 0)return;let n=e.transform.height,{longitude:s,latitude:i,pitch:o}=t,a=r.x*Ib,c=(1-r.y)*Ib,l=r.z*Ib,h=Kt([s,i]),f=a-h[0],u=c-h[1],d=Math.sqrt(f*f+u*u),p=o*Ift,m=1.5*n,g=p<.001?m*Math.cos(p)/l:m*Math.sin(p)/d;t.zoom=Math.log2(g);let _=m*Math.cos(p)/g,y=l-_;t.position=[0,0,y/Yi(i)]}else typeof e.transform.elevation=="number"&&(t.position=[0,0,e.transform.elevation])}function N8(e,t,r){let n=ml(t),s=dd(t);r&&(s.props.nearZMultiplier=.2);let i=r?.nearZ??t.transform._nearZ,o=r?.farZ??t.transform._farZ;return Number.isFinite(i)&&(n.nearZ=i/t.transform.height,n.farZ=o/t.transform.height),s.makeViewport({width:e.width,height:e.height,viewState:n})}function Lft(e,t){let{mapboxLayers:r,isExternal:n}=e.userData;if(n){let s=Array.from(r,h=>h.id),o=We(e.props.layers,Boolean).some(h=>h&&!s.includes(h.id)),a=e.getViewports(),c=a.findIndex(h=>h.id==="mapbox"),l=a.length>1||c<0;(o||l)&&(c>=0&&(a=a.slice(),a[c]=N8(e,t)),e._drawLayers("mapbox-repaint",{viewports:a,layerFilter:h=>(!e.props.layerFilter||e.props.layerFilter(h))&&(h.viewport.id!=="mapbox"||!s.includes(h.layer.id)),clearCanvas:!1}))}e.userData.currentViewport=null}function Nft(e,t){e.setProps({viewState:ml(t)}),e.needsRedraw({clearRedrawFlags:!0})}function Lb(e){if(e.userData.isExternal)return;let t=[];e.userData.mapboxLayers.forEach(r=>{let n=r.props.type,s=new n(r.props);t.push(s)}),e.setProps({layers:t})}var pd=class{constructor(t){if(!t.id)throw new Error("Layer must have an unique id");this.id=t.id,this.type="custom",this.renderingMode=t.renderingMode||"3d",this.slot=t.slot,this.map=null,this.deck=null,this.props=t}onAdd(t,r){this.map=t,this.deck=g_({map:t,gl:r,deck:this.props.deck}),P8(this.deck,this)}onRemove(){this.deck&&R8(this.deck,this)}setProps(t){Object.assign(this.props,t,{id:this.id}),this.deck&&I8(this.deck,this)}render(t,r){O8(this.deck,this.map,this,r)}};var Nb="__UNDEFINED__";function md(e,t,r,n){if(!e||!t||!e.style||!e.style._loaded)return;let s=We(n,Boolean);if(r!==n){let a=We(r,Boolean),c=new Set(a.map(l=>l.id));for(let l of s)c.delete(l.id);for(let l of c)e.getLayer(l)&&e.removeLayer(l)}for(let a of s){let c=e.getLayer(a.id);c?(c.implementation||c).setProps(a.props):e.addLayer(new pd({id:a.id,deck:t,slot:a.props.slot}),a.props.beforeId)}let i=e.style._order,o={};for(let a of s){let{beforeId:c}=a.props;(!c||!i.includes(c))&&(c=Nb),o[c]=o[c]||[],o[c].push(a.id)}for(let a in o){let c=o[a],l=a===Nb?i.length:i.indexOf(a),h=a===Nb?void 0:a;for(let f=c.length-1;f>=0;f--){let u=c[f],d=i.indexOf(u);d!==l-1&&(e.moveLayer(u,h),d>l&&l++),l--,h=u}}}var gd=class{constructor(t){this._handleStyleChange=()=>{md(this._map,this._deck,this._props.layers,this._props.layers)},this._updateContainerSize=()=>{if(this._map&&this._container){let{clientWidth:s,clientHeight:i}=this._map.getContainer();Object.assign(this._container.style,{width:`${s}px`,height:`${i}px`})}},this._updateViewState=()=>{let s=this._deck,i=this._map;s&&i&&(s.setProps({views:this._props.views||dd(i),viewState:ml(i)}),s.isInitialized&&s.redraw())},this._handleMouseEvent=s=>{let i=this._deck;if(!i||!i.isInitialized)return;let o={type:s.type,offsetCenter:s.point,srcEvent:s},a=this._lastMouseDownPoint;switch(!s.point&&a&&(o.deltaX=s.originalEvent.clientX-a.clientX,o.deltaY=s.originalEvent.clientY-a.clientY,o.offsetCenter={x:a.x+o.deltaX,y:a.y+o.deltaY}),o.type){case"mousedown":i._onPointerDown(o),this._lastMouseDownPoint={...s.point,clientX:s.originalEvent.clientX,clientY:s.originalEvent.clientY};break;case"dragstart":o.type="panstart",i._onEvent(o);break;case"drag":o.type="panmove",i._onEvent(o);break;case"dragend":o.type="panend",i._onEvent(o);break;case"click":o.tapCount=1,i._onEvent(o);break;case"dblclick":o.type="click",o.tapCount=2,i._onEvent(o);break;case"mousemove":o.type="pointermove",i._onPointerMove(o);break;case"mouseout":o.type="pointerleave",i._onPointerMove(o);break;default:return}};let{interleaved:r=!1,...n}=t;this._interleaved=r,this._props=n}setProps(t){this._interleaved&&t.layers&&md(this._map,this._deck,this._props.layers,t.layers),Object.assign(this._props,t),this._deck&&this._map&&this._deck.setProps({...this._props,parameters:{...__(this._map,this._interleaved),...this._props.parameters}})}onAdd(t){return this._map=t,this._interleaved?this._onAddInterleaved(t):this._onAddOverlaid(t)}_onAddOverlaid(t){let r=document.createElement("div");return Object.assign(r.style,{position:"absolute",left:0,top:0,textAlign:"initial",pointerEvents:"none"}),this._container=r,this._deck=new qr({...this._props,parent:r,parameters:{...__(t,!1),...this._props.parameters},views:this._props.views||dd(t),viewState:ml(t)}),t.on("resize",this._updateContainerSize),t.on("render",this._updateViewState),t.on("mousedown",this._handleMouseEvent),t.on("dragstart",this._handleMouseEvent),t.on("drag",this._handleMouseEvent),t.on("dragend",this._handleMouseEvent),t.on("mousemove",this._handleMouseEvent),t.on("mouseout",this._handleMouseEvent),t.on("click",this._handleMouseEvent),t.on("dblclick",this._handleMouseEvent),this._updateContainerSize(),r}_onAddInterleaved(t){let r=t.painter.context.gl;return r instanceof WebGLRenderingContext&&k.warn("Incompatible basemap library. See: https://deck.gl/docs/api-reference/mapbox/overview#compatibility")(),this._deck=g_({map:t,gl:r,deck:new qr({...this._props,gl:r})}),t.on("styledata",this._handleStyleChange),md(t,this._deck,[],this._props.layers),document.createElement("div")}onRemove(){let t=this._map;t&&(this._interleaved?this._onRemoveInterleaved(t):this._onRemoveOverlaid(t)),this._deck=void 0,this._map=void 0,this._container=void 0}_onRemoveOverlaid(t){t.off("resize",this._updateContainerSize),t.off("render",this._updateViewState),t.off("mousedown",this._handleMouseEvent),t.off("dragstart",this._handleMouseEvent),t.off("drag",this._handleMouseEvent),t.off("dragend",this._handleMouseEvent),t.off("mousemove",this._handleMouseEvent),t.off("mouseout",this._handleMouseEvent),t.off("click",this._handleMouseEvent),t.off("dblclick",this._handleMouseEvent),this._deck?.finalize()}_onRemoveInterleaved(t){t.off("styledata",this._handleStyleChange),md(t,this._deck,this._props.layers,[]),Ob(t)}getDefaultPosition(){return"top-left"}pickObject(t){return yt(this._deck),this._deck.pickObject(t)}pickMultipleObjects(t){return yt(this._deck),this._deck.pickMultipleObjects(t)}pickObjects(t){return yt(this._deck),this._deck.pickObjects(t)}finalize(){this._map&&this._map.removeControl(this)}getCanvas(){return this._map?this._interleaved?this._map.getCanvas():this._deck.getCanvas():null}};var M_,Ft,U8,Bft,Xo,B8,z8,Bb,Ub,Fb,Db,Fft,_d={},V8=[],Dft=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,zb=Array.isArray;function Ci(e,t){for(var r in t)e[r]=t[r];return e}function H8(e){var t=e.parentNode;t&&t.removeChild(e)}function kft(e,t,r){var n,s,i,o={};for(i in t)i=="key"?n=t[i]:i=="ref"?s=t[i]:o[i]=t[i];if(arguments.length>2&&(o.children=arguments.length>3?M_.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)o[i]===void 0&&(o[i]=e.defaultProps[i]);return y_(e,o,n,s,null)}function y_(e,t,r,n,s){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:s??++U8,__i:-1,__u:0};return s==null&&Ft.vnode!=null&&Ft.vnode(i),i}function gl(e){return e.children}function A_(e,t){this.props=e,this.context=t}function $o(e,t){if(t==null)return e.__?$o(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?$o(e):null}function W8(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return W8(e)}}function F8(e){(!e.__d&&(e.__d=!0)&&Xo.push(e)&&!T_.__r++||B8!==Ft.debounceRendering)&&((B8=Ft.debounceRendering)||z8)(T_)}function T_(){var e,t,r,n,s,i,o,a;for(Xo.sort(Bb);e=Xo.shift();)e.__d&&(t=Xo.length,n=void 0,i=(s=(r=e).__v).__e,o=[],a=[],r.__P&&((n=Ci({},s)).__v=s.__v+1,Ft.vnode&&Ft.vnode(n),Vb(r.__P,n,s,r.__n,r.__P.namespaceURI,32&s.__u?[i]:null,o,i??$o(s),!!(32&s.__u),a),n.__v=s.__v,n.__.__k[n.__i]=n,q8(o,n,a),n.__e!=i&&W8(n)),Xo.length>t&&Xo.sort(Bb));T_.__r=0}function G8(e,t,r,n,s,i,o,a,c,l,h){var f,u,d,p,m,g=n&&n.__k||V8,_=t.length;for(r.__d=c,Uft(r,t,g),c=r.__d,f=0;f<_;f++)(d=r.__k[f])!=null&&typeof d!="boolean"&&typeof d!="function"&&(u=d.__i===-1?_d:g[d.__i]||_d,d.__i=f,Vb(e,d,u,s,i,o,a,c,l,h),p=d.__e,d.ref&&u.ref!=d.ref&&(u.ref&&Hb(u.ref,null,d),h.push(d.ref,d.__c||p,d)),m==null&&p!=null&&(m=p),65536&d.__u||u.__k===d.__k?c=j8(d,c,e):typeof d.type=="function"&&d.__d!==void 0?c=d.__d:p&&(c=p.nextSibling),d.__d=void 0,d.__u&=-196609);r.__d=c,r.__e=m}function Uft(e,t,r){var n,s,i,o,a,c=t.length,l=r.length,h=l,f=0;for(e.__k=[],n=0;n<c;n++)o=n+f,(s=e.__k[n]=(s=t[n])==null||typeof s=="boolean"||typeof s=="function"?null:typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?y_(null,s,null,null,null):zb(s)?y_(gl,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?y_(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s)!=null?(s.__=e,s.__b=e.__b+1,a=zft(s,r,o,h),s.__i=a,i=null,a!==-1&&(h--,(i=r[a])&&(i.__u|=131072)),i==null||i.__v===null?(a==-1&&f--,typeof s.type!="function"&&(s.__u|=65536)):a!==o&&(a==o-1?f--:a==o+1?f++:a>o?h>c-o?f+=a-o:f--:a<o&&(a==o-f?f-=a-o:f++),a!==n+f&&(s.__u|=65536))):(i=r[o])&&i.key==null&&i.__e&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=$o(i)),kb(i,i,!1),r[o]=null,h--);if(h)for(n=0;n<l;n++)(i=r[n])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=$o(i)),kb(i,i))}function j8(e,t,r){var n,s;if(typeof e.type=="function"){for(n=e.__k,s=0;n&&s<n.length;s++)n[s]&&(n[s].__=e,t=j8(n[s],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=$o(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function zft(e,t,r,n){var s=e.key,i=e.type,o=r-1,a=r+1,c=t[r];if(c===null||c&&s==c.key&&i===c.type&&!(131072&c.__u))return r;if(n>(c!=null&&!(131072&c.__u)?1:0))for(;o>=0||a<t.length;){if(o>=0){if((c=t[o])&&!(131072&c.__u)&&s==c.key&&i===c.type)return o;o--}if(a<t.length){if((c=t[a])&&!(131072&c.__u)&&s==c.key&&i===c.type)return a;a++}}return-1}function D8(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Dft.test(t)?r:r+"px"}function x_(e,t,r,n,s){var i;t:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||D8(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||D8(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.u=n.u:(r.u=Ub,e.addEventListener(t,i?Db:Fb,i)):e.removeEventListener(t,i?Db:Fb,i);else{if(s=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break t}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function k8(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Ub++;else if(t.t<r.u)return;return r(Ft.event?Ft.event(t):t)}}}function Vb(e,t,r,n,s,i,o,a,c,l){var h,f,u,d,p,m,g,_,y,x,A,M,E,w,v,b,T=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),i=[a=t.__e=r.__e]),(h=Ft.__b)&&h(t);t:if(typeof T=="function")try{if(_=t.props,y="prototype"in T&&T.prototype.render,x=(h=T.contextType)&&n[h.__c],A=h?x?x.props.value:h.__:n,r.__c?g=(f=t.__c=r.__c).__=f.__E:(y?t.__c=f=new T(_,A):(t.__c=f=new A_(_,A),f.constructor=T,f.render=Hft),x&&x.sub(f),f.props=_,f.state||(f.state={}),f.context=A,f.__n=n,u=f.__d=!0,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&T.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Ci({},f.__s)),Ci(f.__s,T.getDerivedStateFromProps(_,f.__s))),d=f.props,p=f.state,f.__v=t,u)y&&T.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&T.getDerivedStateFromProps==null&&_!==d&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(_,A),!f.__e&&(f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(_,f.__s,A)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(f.props=_,f.state=f.__s,f.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(I){I&&(I.__=t)}),M=0;M<f._sb.length;M++)f.__h.push(f._sb[M]);f._sb=[],f.__h.length&&o.push(f);break t}f.componentWillUpdate!=null&&f.componentWillUpdate(_,f.__s,A),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(d,p,m)})}if(f.context=A,f.props=_,f.__P=e,f.__e=!1,E=Ft.__r,w=0,y){for(f.state=f.__s,f.__d=!1,E&&E(t),h=f.render(f.props,f.state,f.context),v=0;v<f._sb.length;v++)f.__h.push(f._sb[v]);f._sb=[]}else do f.__d=!1,E&&E(t),h=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++w<25);f.state=f.__s,f.getChildContext!=null&&(n=Ci(Ci({},n),f.getChildContext())),y&&!u&&f.getSnapshotBeforeUpdate!=null&&(m=f.getSnapshotBeforeUpdate(d,p)),G8(e,zb(b=h!=null&&h.type===gl&&h.key==null?h.props.children:h)?b:[b],t,r,n,s,i,o,a,c,l),f.base=t.__e,t.__u&=-161,f.__h.length&&o.push(f),g&&(f.__E=f.__=null)}catch(I){if(t.__v=null,c||i!=null){for(t.__u|=c?160:32;a&&a.nodeType===8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,t.__e=a}else t.__e=r.__e,t.__k=r.__k;Ft.__e(I,t,r)}else i==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=Vft(r.__e,t,r,n,s,i,o,c,l);(h=Ft.diffed)&&h(t)}function q8(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)Hb(r[n],r[++n],r[++n]);Ft.__c&&Ft.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(i){i.call(s)})}catch(i){Ft.__e(i,s.__v)}})}function Vft(e,t,r,n,s,i,o,a,c){var l,h,f,u,d,p,m,g=r.props,_=t.props,y=t.type;if(y==="svg"?s="http://www.w3.org/2000/svg":y==="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),i!=null){for(l=0;l<i.length;l++)if((d=i[l])&&"setAttribute"in d==!!y&&(y?d.localName===y:d.nodeType===3)){e=d,i[l]=null;break}}if(e==null){if(y===null)return document.createTextNode(_);e=document.createElementNS(s,y,_.is&&_),i=null,a=!1}if(y===null)g===_||a&&e.data===_||(e.data=_);else{if(i=i&&M_.call(e.childNodes),g=r.props||_d,!a&&i!=null)for(g={},l=0;l<e.attributes.length;l++)g[(d=e.attributes[l]).name]=d.value;for(l in g)if(d=g[l],l!="children"){if(l=="dangerouslySetInnerHTML")f=d;else if(l!=="key"&&!(l in _)){if(l=="value"&&"defaultValue"in _||l=="checked"&&"defaultChecked"in _)continue;x_(e,l,null,d,s)}}for(l in _)d=_[l],l=="children"?u=d:l=="dangerouslySetInnerHTML"?h=d:l=="value"?p=d:l=="checked"?m=d:l==="key"||a&&typeof d!="function"||g[l]===d||x_(e,l,d,g[l],s);if(h)a||f&&(h.__html===f.__html||h.__html===e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(f&&(e.innerHTML=""),G8(e,zb(u)?u:[u],t,r,n,y==="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,o,i?i[0]:r.__k&&$o(r,0),a,c),i!=null)for(l=i.length;l--;)i[l]!=null&&H8(i[l]);a||(l="value",p!==void 0&&(p!==e[l]||y==="progress"&&!p||y==="option"&&p!==g[l])&&x_(e,l,p,g[l],s),l="checked",m!==void 0&&m!==e[l]&&x_(e,l,m,g[l],s))}return e}function Hb(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(s){Ft.__e(s,r)}}function kb(e,t,r){var n,s;if(Ft.unmount&&Ft.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Hb(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){Ft.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(s=0;s<n.length;s++)n[s]&&kb(n[s],t,r||typeof e.type!="function");r||e.__e==null||H8(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Hft(e,t,r){return this.constructor(e,r)}function Fn(e,t,r){var n,s,i,o;Ft.__&&Ft.__(e,t),s=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],o=[],Vb(t,e=(!n&&r||t).__k=kft(gl,null,[e]),s||_d,_d,t.namespaceURI,!n&&r?[r]:s?null:t.firstChild?M_.call(t.childNodes):null,i,!n&&r?r:s?s.__e:t.firstChild,n,o),q8(i,e,o)}M_=V8.slice,Ft={__e:function(e,t,r,n){for(var s,i,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(e)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,n||{}),o=s.__d),o)return s.__E=s}catch(a){e=a}throw e}},U8=0,Bft=function(e){return e!=null&&e.constructor==null},A_.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ci({},this.state),typeof e=="function"&&(e=e(Ci({},r),this.props)),e&&Ci(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),F8(this))},A_.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),F8(this))},A_.prototype.render=gl,Xo=[],z8=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Bb=function(e,t){return e.__v.__b-t.__v.__b},T_.__r=0,Ub=0,Fb=k8(!1),Db=k8(!0),Fft=0;var Wft=0,Hie=Array.isArray;function Lt(e,t,r,n,s,i){t||(t={});var o,a,c=t;if("ref"in c)for(a in c={},t)a=="ref"?o=t[a]:c[a]=t[a];var l={type:e,props:c,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Wft,__i:-1,__u:0,__source:s,__self:i};if(typeof e=="function"&&(o=e.defaultProps))for(a in o)c[a]===void 0&&(c[a]=o[a]);return Ft.vnode&&Ft.vnode(l),l}var Gb={};Nt(Gb,{ButtonGroup:()=>Wb,GroupedIconButton:()=>E_,IconButton:()=>Ko});var Ko=e=>{let{className:t,label:r,onClick:n}=e;return Lt("div",{className:"deck-widget-button",children:Lt("button",{className:`deck-widget-icon-button ${t}`,type:"button",onClick:n,title:r,children:Lt("div",{className:"deck-widget-icon"})})})},Wb=e=>{let{children:t,orientation:r}=e;return Lt("div",{className:`deck-widget-button-group ${r}`,children:t})},E_=e=>{let{className:t,label:r,onClick:n}=e;return Lt("button",{className:`deck-widget-icon-button ${t}`,type:"button",onClick:n,title:r,children:Lt("div",{className:"deck-widget-icon"})})};var b_=class{constructor(t){this.id="fullscreen",this.placement="top-left",this.fullscreen=!1,this.id=t.id??this.id,this.placement=t.placement??this.placement,this.props={...t,enterLabel:t.enterLabel??"Enter Fullscreen",exitLabel:t.exitLabel??"Exit Fullscreen",style:t.style??{}}}onAdd({deck:t}){let{style:r,className:n}=this.props,s=document.createElement("div");return s.classList.add("deck-widget","deck-widget-fullscreen"),n&&s.classList.add(n),Qe(s,r),this.deck=t,this.element=s,this.update(),document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this)),s}onRemove(){this.deck=void 0,this.element=void 0,document.removeEventListener("fullscreenchange",this.onFullscreenChange.bind(this))}update(){let{enterLabel:t,exitLabel:r}=this.props,n=this.element;if(!n)return;let s=Lt(Ko,{onClick:this.handleClick.bind(this),label:this.fullscreen?r:t,className:this.fullscreen?"deck-widget-fullscreen-exit":"deck-widget-fullscreen-enter"});Fn(s,n)}setProps(t){this.placement=t.placement??this.placement;let r=this.props,n=this.element;n&&(r.className!==t.className&&(r.className&&n.classList.remove(r.className),t.className&&n.classList.add(t.className)),Q(r.style,t.style,1)||(Mn(n,r.style),Qe(n,t.style))),Object.assign(this.props,t),this.update()}getContainer(){return this.props.container||this.deck?.getCanvas()?.parentElement}onFullscreenChange(){let t=this.fullscreen,r=document.fullscreenElement===this.getContainer();t!==r&&(this.fullscreen=!this.fullscreen),this.update()}async handleClick(){this.fullscreen?await this.exitFullscreen():await this.requestFullscreen(),this.update()}async requestFullscreen(){let t=this.getContainer();t?.requestFullscreen?await t.requestFullscreen({navigationUI:"hide"}):this.togglePseudoFullscreen()}async exitFullscreen(){document.exitFullscreen?await document.exitFullscreen():this.togglePseudoFullscreen()}togglePseudoFullscreen(){this.getContainer()?.classList.toggle("deck-pseudo-fullscreen")}};var S_=class{constructor(t){this.id="compass",this.placement="top-left",this.viewId=null,this.viewports={},this.id=t.id??this.id,this.viewId=t.viewId??this.viewId,this.placement=t.placement??this.placement,this.props={...t,transitionDuration:t.transitionDuration??200,label:t.label??"Reset Compass",style:t.style??{}}}setProps(t){this.placement=t.placement??this.placement,this.viewId=t.viewId??this.viewId;let r=this.props,n=this.element;n&&(r.className!==t.className&&(r.className&&n.classList.remove(r.className),t.className&&n.classList.add(t.className)),Q(r.style,t.style,1)||(Mn(n,r.style),Qe(n,t.style))),Object.assign(this.props,t),this.update()}onViewportChange(t){t.equals(this.viewports[t.id])||(this.viewports[t.id]=t,this.update())}onAdd({deck:t}){let{style:r,className:n}=this.props,s=document.createElement("div");return s.classList.add("deck-widget","deck-widget-compass"),n&&s.classList.add(n),Qe(s,r),this.deck=t,this.element=s,this.update(),s}getRotation(t){return t instanceof Pe?[-t.bearing,t.pitch]:t instanceof Xr?[0,Math.max(-80,Math.min(80,t.latitude))]:[0,0]}update(){let t=this.viewId||Object.values(this.viewports)[0]?.id||"default-view",r=this.viewports[t],[n,s]=this.getRotation(r),i=this.element;if(!i)return;let o=Lt("div",{className:"deck-widget-button",style:{perspective:100},children:Lt("button",{type:"button",onClick:()=>{for(let a of Object.values(this.viewports))this.handleCompassReset(a)},title:this.props.label,style:{transform:`rotateX(${s}deg)`},children:Lt("svg",{fill:"none",width:"100%",height:"100%",viewBox:"0 0 26 26",children:Lt("g",{transform:`rotate(${n},13,13)`,children:[Lt("path",{d:"M10 13.0001L12.9999 5L15.9997 13.0001H10Z",fill:"var(--icon-compass-north-color, #F05C44)"}),Lt("path",{d:"M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z",fill:"var(--icon-compass-south-color, #C2C2CC)"})]})})})});Fn(o,i)}onRemove(){this.deck=void 0,this.element=void 0}handleCompassReset(t){let r=this.viewId||t.id||"default-view";if(t instanceof Pe){let n={...t,bearing:0,...this.getRotation(t)[0]===0?{pitch:0}:{},transitionDuration:this.props.transitionDuration,transitionInterpolator:new is};this.deck._onViewStateChange({viewId:r,viewState:n,interactionState:{}})}}};var Zo=class{constructor(t={}){this.id="zoom",this.placement="top-left",this.viewId=null,this.viewports={},this.id=t.id??this.id,this.viewId=t.viewId??this.viewId,this.placement=t.placement??this.placement,this.props={...Zo.defaultProps,...t}}onAdd({deck:t}){let{style:r,className:n}=this.props,s=document.createElement("div");return s.classList.add("deck-widget","deck-widget-zoom"),n&&s.classList.add(n),Qe(s,r),this.deck=t,this.element=s,this.update(),s}onRemove(){this.deck=void 0,this.element=void 0}setProps(t){this.placement=t.placement??this.placement,this.viewId=t.viewId??this.viewId;let r=this.props,n=this.element;n&&(r.className!==t.className&&(r.className&&n.classList.remove(r.className),t.className&&n.classList.add(t.className)),Q(r.style,t.style,1)||(Mn(n,r.style),Qe(n,t.style))),Object.assign(this.props,t),this.update()}onViewportChange(t){this.viewports[t.id]=t}handleZoom(t,r){let n=this.viewId||t?.id||"default-view",s={...t,zoom:r};this.props.transitionDuration>0&&(s.transitionDuration=this.props.transitionDuration,s.transitionInterpolator="latitude"in s?new is:new ue),this.setViewState(n,s)}handleZoomIn(){for(let t of Object.values(this.viewports))this.handleZoom(t,t.zoom+1)}handleZoomOut(){for(let t of Object.values(this.viewports))this.handleZoom(t,t.zoom-1)}setViewState(t,r){this.deck._onViewStateChange({viewId:t,viewState:r,interactionState:{}})}update(){let t=this.element;if(!t)return;let r=Lt(Wb,{orientation:this.props.orientation,children:[Lt(E_,{onClick:()=>this.handleZoomIn(),label:this.props.zoomInLabel,className:"deck-widget-zoom-in"}),Lt(E_,{onClick:()=>this.handleZoomOut(),label:this.props.zoomOutLabel,className:"deck-widget-zoom-out"})]});Fn(r,t)}};Zo.defaultProps={id:"zoom-widget",style:{},placement:"top-left",className:void 0,orientation:"vertical",transitionDuration:200,zoomInLabel:"Zoom In",zoomOutLabel:"Zoom Out",viewId:void 0};var nn=class{constructor(t){this.id=t.id||"widget",this.props=t}onAdd({deck:t}){this.deck=t;let{style:r,className:n}=this.props,s=this._createRootElement({widgetClassName:this.className,className:n,style:r});return this.element=s,this.onRenderHTML(),this.element}onRemove(){this.deck=void 0,this.element=void 0}setProps(t){let r=this.props,n=this.element;n&&(r.className!==t.className&&(r.className&&n.classList.remove(r.className),t.className&&n.classList.add(t.className)),Q(r.style,t.style,1)||(Mn(n,r.style),Qe(n,t.style))),Object.assign(this.props,t),this.onRenderHTML()}_createRootElement(t){let{widgetClassName:r,className:n,style:s}=t,i=document.createElement("div");return["deck-widget",r,n].filter(o=>typeof o=="string"&&o.length>0).forEach(o=>i.classList.add(o)),Qe(i,s),i}};nn.defaultProps={id:"widget",style:{},className:""};var Jo=class extends nn{constructor(t={}){super({...Jo.defaultProps,...t}),this.className="deck-widget-screenshot",this.placement="top-left",this.placement=t.placement??this.placement}setProps(t){this.placement=t.placement??this.placement,super.setProps(t)}onRenderHTML(){let t=this.element;t&&Fn(Lt(Ko,{className:"deck-widget-camera",label:this.props.label,onClick:this.handleClick.bind(this)}),t)}handleClick(){if(this.props.onCapture){this.props.onCapture(this);return}let t=this.captureScreenToDataURL(this.props.imageFormat);t&&this.downloadDataURL(t,this.props.filename)}captureScreenToDataURL(t){return this.deck?.getCanvas()?.toDataURL(t)}downloadDataURL(t,r){let n=document.createElement("a");n.href=t,n.download=r,n.click()}};Jo.defaultProps={...nn.defaultProps,id:"screenshot",placement:"top-left",label:"Screenshot",filename:"screenshot.png",imageFormat:"image/png",onCapture:void 0};var Qo=class extends nn{constructor(t={}){super({...Qo.defaultProps,...t}),this.className="deck-widget-reset-view",this.placement="top-left",this.placement=t.placement??this.placement}setProps(t){this.placement=t.placement??this.placement,super.setProps(t)}onRenderHTML(){let t=this.element;t&&Fn(Lt(Ko,{className:"deck-widget-reset-focus",label:this.props.label,onClick:this.handleClick.bind(this)}),t)}handleClick(){let t=this.props.initialViewState||this.deck?.props.initialViewState;this.setViewState(t)}setViewState(t){let r=this.props.viewId||t?.id||"default-view",n={...t};this.deck._onViewStateChange({viewId:r,viewState:n,interactionState:{}})}};Qo.defaultProps={...nn.defaultProps,id:"reset-view",placement:"top-left",label:"Reset View",initialViewState:void 0,viewId:void 0};var Gft={"--button-background":"#fff","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},jft={"--button-background":"rgba(18, 18, 20, 1)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},qft={"--button-background":"rgba(255, 255, 255, 0.6)","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"1px solid rgba(255, 255, 255, 0.6)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},Yft={"--button-background":"rgba(18, 18, 20, 0.75)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"1px solid rgba(18, 18, 20, 0.75)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"};var xd=Dn(eu(),1);ac._checkH3Lib=()=>{let e='include the <script src="https://unpkg.com/h3-js@^4.0.0"><\/script> tag before the deck.gl script tag. https://deck.gl/docs/api-reference/geo-layers/h3-hexagon-layer';if(xd){if(xd.polyfill&&!xd.polygonToCells)throw new Error(`Incompatible h3-js version. ${e}`)}else throw new Error(`To use H3 functionality, ${e}`)};return ez(Xft);})();
5979
5979
  /*! Bundled license information:
5980
5980
 
5981
5981
  long/dist/long.js:
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A suite of 3D-enabled data visualization overlays, suitable for react-map-gl",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "version": "9.1.11",
6
+ "version": "9.1.13",
7
7
  "keywords": [
8
8
  "webgl",
9
9
  "visualization",
@@ -39,19 +39,19 @@
39
39
  "prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
40
40
  },
41
41
  "dependencies": {
42
- "@deck.gl/aggregation-layers": "9.1.11",
43
- "@deck.gl/arcgis": "9.1.11",
44
- "@deck.gl/carto": "9.1.11",
45
- "@deck.gl/core": "9.1.11",
46
- "@deck.gl/extensions": "9.1.11",
47
- "@deck.gl/geo-layers": "9.1.11",
48
- "@deck.gl/google-maps": "9.1.11",
49
- "@deck.gl/json": "9.1.11",
50
- "@deck.gl/layers": "9.1.11",
51
- "@deck.gl/mapbox": "9.1.11",
52
- "@deck.gl/mesh-layers": "9.1.11",
53
- "@deck.gl/react": "9.1.11",
54
- "@deck.gl/widgets": "9.1.11",
42
+ "@deck.gl/aggregation-layers": "9.1.13",
43
+ "@deck.gl/arcgis": "9.1.13",
44
+ "@deck.gl/carto": "9.1.13",
45
+ "@deck.gl/core": "9.1.13",
46
+ "@deck.gl/extensions": "9.1.13",
47
+ "@deck.gl/geo-layers": "9.1.13",
48
+ "@deck.gl/google-maps": "9.1.13",
49
+ "@deck.gl/json": "9.1.13",
50
+ "@deck.gl/layers": "9.1.13",
51
+ "@deck.gl/mapbox": "9.1.13",
52
+ "@deck.gl/mesh-layers": "9.1.13",
53
+ "@deck.gl/react": "9.1.13",
54
+ "@deck.gl/widgets": "9.1.13",
55
55
  "@loaders.gl/core": "^4.2.0",
56
56
  "@luma.gl/core": "^9.1.5",
57
57
  "@luma.gl/engine": "^9.1.5"
@@ -72,5 +72,5 @@
72
72
  "optional": true
73
73
  }
74
74
  },
75
- "gitHead": "13816c3da4f7deab1538dbc590d5267349a512e2"
75
+ "gitHead": "2befca58db3a98e84739804f74806f3cbe94ce38"
76
76
  }