815 lines
1.2 MiB
815 lines
1.2 MiB
/*
|
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
if you want to view the source, please visit the github repository of this plugin
|
|
*/
|
|
|
|
var bB=Object.create;var jc=Object.defineProperty;var FB=Object.getOwnPropertyDescriptor;var DB=Object.getOwnPropertyNames;var SB=Object.getPrototypeOf,MB=Object.prototype.hasOwnProperty;var TB=(pe,$)=>()=>($||pe(($={exports:{}}).exports,$),$.exports),UB=(pe,$)=>{for(var J in $)jc(pe,J,{get:$[J],enumerable:!0})},Qp=(pe,$,J,le)=>{if($&&typeof $=="object"||typeof $=="function")for(let D of DB($))!MB.call(pe,D)&&D!==J&&jc(pe,D,{get:()=>$[D],enumerable:!(le=FB($,D))||le.enumerable});return pe};var Xc=(pe,$,J)=>(J=pe!=null?bB(SB(pe)):{},Qp($||!pe||!pe.__esModule?jc(J,"default",{value:pe,enumerable:!0}):J,pe)),LB=pe=>Qp(jc({},"__esModule",{value:!0}),pe);var ll=TB((ju,Xu)=>{(function(pe,$){typeof ju=="object"&&typeof Xu!="undefined"?Xu.exports=$():typeof define=="function"&&define.amd?define($):(pe=typeof globalThis!="undefined"?globalThis:pe||self,pe.maplibregl=$())})(ju,(function(){"use strict";var pe={},$={};function J(D,c,se){if($[D]=se,D==="index"){var Me="var sharedModule = {}; ("+$.shared+")(sharedModule); ("+$.worker+")(sharedModule);",Te={};return $.shared(Te),$.index(pe,Te),typeof window!="undefined"&&pe.setWorkerUrl(window.URL.createObjectURL(new Blob([Me],{type:"text/javascript"}))),pe}}J("shared",["exports"],(function(D){"use strict";function c(r,e,i,o){return new(i||(i=Promise))((function(s,a){function h(p){try{f(o.next(p))}catch(_){a(_)}}function u(p){try{f(o.throw(p))}catch(_){a(_)}}function f(p){var _;p.done?s(p.value):(_=p.value,_ instanceof i?_:new i((function(m){m(_)}))).then(h,u)}f((o=o.apply(r,e||[])).next())}))}function se(r,e){this.x=r,this.y=e}function Me(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Te,Ye;typeof SuppressedError=="function"&&SuppressedError,se.prototype={clone(){return new se(this.x,this.y)},add(r){return this.clone()._add(r)},sub(r){return this.clone()._sub(r)},multByPoint(r){return this.clone()._multByPoint(r)},divByPoint(r){return this.clone()._divByPoint(r)},mult(r){return this.clone()._mult(r)},div(r){return this.clone()._div(r)},rotate(r){return this.clone()._rotate(r)},rotateAround(r,e){return this.clone()._rotateAround(r,e)},matMult(r){return this.clone()._matMult(r)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(r){return this.x===r.x&&this.y===r.y},dist(r){return Math.sqrt(this.distSqr(r))},distSqr(r){let e=r.x-this.x,i=r.y-this.y;return e*e+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(r){return Math.atan2(this.y-r.y,this.x-r.x)},angleWith(r){return this.angleWithSep(r.x,r.y)},angleWithSep(r,e){return Math.atan2(this.x*e-this.y*r,this.x*r+this.y*e)},_matMult(r){let e=r[2]*this.x+r[3]*this.y;return this.x=r[0]*this.x+r[1]*this.y,this.y=e,this},_add(r){return this.x+=r.x,this.y+=r.y,this},_sub(r){return this.x-=r.x,this.y-=r.y,this},_mult(r){return this.x*=r,this.y*=r,this},_div(r){return this.x/=r,this.y/=r,this},_multByPoint(r){return this.x*=r.x,this.y*=r.y,this},_divByPoint(r){return this.x/=r.x,this.y/=r.y,this},_unit(){return this._div(this.mag()),this},_perp(){let r=this.y;return this.y=this.x,this.x=-r,this},_rotate(r){let e=Math.cos(r),i=Math.sin(r),o=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=o,this},_rotateAround(r,e){let i=Math.cos(r),o=Math.sin(r),s=e.y+o*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-o*(this.y-e.y),this.y=s,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:se},se.convert=function(r){if(r instanceof se)return r;if(Array.isArray(r))return new se(+r[0],+r[1]);if(r.x!==void 0&&r.y!==void 0)return new se(+r.x,+r.y);throw new Error("Expected [x, y] or {x, y} point format")};var rt=(function(){if(Ye)return Te;function r(e,i,o,s){this.cx=3*e,this.bx=3*(o-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(s-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=i,this.p2x=o,this.p2y=s}return Ye=1,Te=r,r.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,i){if(i===void 0&&(i=1e-6),e<0)return 0;if(e>1)return 1;for(var o=e,s=0;s<8;s++){var a=this.sampleCurveX(o)-e;if(Math.abs(a)<i)return o;var h=this.sampleCurveDerivativeX(o);if(Math.abs(h)<1e-6)break;o-=a/h}var u=0,f=1;for(o=e,s=0;s<20&&(a=this.sampleCurveX(o),!(Math.abs(a-e)<i));s++)e>a?u=o:f=o,o=.5*(f-u)+u;return o},solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},Te})(),Je=Me(rt);let Qt,Pe;function Lt(){return Qt!=null||(Qt=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Qt}function qe(){if(Pe==null&&(Pe=!1,Lt())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let o=0;o<25;o++){let s=4*o;e.fillStyle=`rgb(${s},${s+1},${s+2})`,e.fillRect(o%5,Math.floor(o/5),1,1)}let i=e.getImageData(0,0,5,5).data;for(let o=0;o<100;o++)if(o%4!=3&&i[o]!==o){Pe=!0;break}}}return Pe||!1}var de=1e-6,dt=typeof Float32Array!="undefined"?Float32Array:Array;function xi(){var r=new dt(9);return dt!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function Tn(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Qo(){var r=new dt(3);return dt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function Co(r){var e=r[0],i=r[1],o=r[2];return Math.sqrt(e*e+i*i+o*o)}function nt(r,e,i){var o=new dt(3);return o[0]=r,o[1]=e,o[2]=i,o}function V(r,e,i){return r[0]=e[0]+i[0],r[1]=e[1]+i[1],r[2]=e[2]+i[2],r}function ee(r,e,i){return r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r}function ie(r,e,i){var o=e[0],s=e[1],a=e[2],h=i[0],u=i[1],f=i[2];return r[0]=s*f-a*u,r[1]=a*h-o*f,r[2]=o*u-s*h,r}var we,Se=Co;function tt(r,e,i){var o=e[0],s=e[1],a=e[2],h=e[3];return r[0]=i[0]*o+i[4]*s+i[8]*a+i[12]*h,r[1]=i[1]*o+i[5]*s+i[9]*a+i[13]*h,r[2]=i[2]*o+i[6]*s+i[10]*a+i[14]*h,r[3]=i[3]*o+i[7]*s+i[11]*a+i[15]*h,r}function Re(){var r=new dt(4);return dt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function et(r,e,i,o){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",a=Math.PI/360;e*=a,o*=a,i*=a;var h=Math.sin(e),u=Math.cos(e),f=Math.sin(i),p=Math.cos(i),_=Math.sin(o),m=Math.cos(o);switch(s){case"xyz":r[0]=h*p*m+u*f*_,r[1]=u*f*m-h*p*_,r[2]=u*p*_+h*f*m,r[3]=u*p*m-h*f*_;break;case"xzy":r[0]=h*p*m-u*f*_,r[1]=u*f*m-h*p*_,r[2]=u*p*_+h*f*m,r[3]=u*p*m+h*f*_;break;case"yxz":r[0]=h*p*m+u*f*_,r[1]=u*f*m-h*p*_,r[2]=u*p*_-h*f*m,r[3]=u*p*m+h*f*_;break;case"yzx":r[0]=h*p*m+u*f*_,r[1]=u*f*m+h*p*_,r[2]=u*p*_-h*f*m,r[3]=u*p*m-h*f*_;break;case"zxy":r[0]=h*p*m-u*f*_,r[1]=u*f*m+h*p*_,r[2]=u*p*_+h*f*m,r[3]=u*p*m-h*f*_;break;case"zyx":r[0]=h*p*m-u*f*_,r[1]=u*f*m+h*p*_,r[2]=u*p*_-h*f*m,r[3]=u*p*m+h*f*_;break;default:throw new Error("Unknown angle order "+s)}return r}function Ke(){var r=new dt(2);return dt!=Float32Array&&(r[0]=0,r[1]=0),r}function st(r,e){var i=new dt(2);return i[0]=r,i[1]=e,i}Qo(),we=new dt(4),dt!=Float32Array&&(we[0]=0,we[1]=0,we[2]=0,we[3]=0),Qo(),nt(1,0,0),nt(0,1,0),Re(),Re(),xi(),Ke();let Ge=8192;function Ft(r,e,i){return e*(Ge/(r.tileSize*Math.pow(2,i-r.tileID.overscaledZ)))}function Dt(r){return r instanceof Error?r:new Error(typeof r=="string"?r:String(r))}function tr(r,e){return(r%e+e)%e}function Ki(r,e,i){return r*(1-i)+e*i}function Mr(r){if(r<=0)return 0;if(r>=1)return 1;let e=r*r,i=e*r;return 4*(r<.5?i:3*(r-e)+i-.75)}function $r(r,e,i,o){let s=new Je(r,e,i,o);return a=>s.solve(a)}let wo=$r(.25,.1,.25,1);function fi(r,e,i){return Math.min(i,Math.max(e,r))}function Un(r,e,i){let o=i-e,s=((r-e)%o+o)%o+e;return s===e?i:s}function ji(r,...e){for(let i of e)for(let o in i)r[o]=i[o];return r}let Eo=1;function Tr(r,e,i){let o={};for(let s in r)o[s]=e.call(this,r[s],s,r);return o}function en(r,e,i){let o={};for(let s in r)e.call(this,r[s],s,r)&&(o[s]=r[s]);return o}function Oe(r){return Array.isArray(r)?r.map(Oe):typeof r=="object"&&r?Tr(r,Oe):r}let Vt={};function ti(r){Vt[r]||(typeof console!="undefined"&&console.warn(r),Vt[r]=!0)}function Ui(r,e,i){return(i.y-r.y)*(e.x-r.x)>(e.y-r.y)*(i.x-r.x)}function ii(r){return typeof WorkerGlobalScope!="undefined"&&r!==void 0&&r instanceof WorkerGlobalScope}let vi=null;function tn(r){return typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap}let GA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function RA(r,e,i,o,s){return c(this,void 0,void 0,(function*(){if(typeof VideoFrame=="undefined")throw new Error("VideoFrame not supported");let a=new VideoFrame(r,{timestamp:0});try{let h=a==null?void 0:a.format;if(!h||!h.startsWith("BGR")&&!h.startsWith("RGB"))throw new Error(`Unrecognized format ${h}`);let u=h.startsWith("BGR"),f=new Uint8ClampedArray(o*s*4);if(yield a.copyTo(f,(function(p,_,m,w,Q){let x=4*Math.max(-_,0),v=(Math.max(0,m)-m)*w*4+x,S=4*w,M=Math.max(0,_),L=Math.max(0,m);return{rect:{x:M,y:L,width:Math.min(p.width,_+w)-M,height:Math.min(p.height,m+Q)-L},layout:[{offset:v,stride:S}]}})(r,e,i,o,s)),u)for(let p=0;p<f.length;p+=4){let _=f[p];f[p]=f[p+2],f[p+2]=_}return f}finally{a.close()}}))}let Ur,Ln;function ms(r,e,i,o){return r.addEventListener(e,i,o),{unsubscribe:()=>{r.removeEventListener(e,i,o)}}}function Lr(r){return r*Math.PI/180}function rn(r){return r/Math.PI*180}let OA={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},NA={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},Bs="AbortError";class Io extends Error{constructor(e=Bs){super(e instanceof Error?e.message:e),this.name=Bs,e instanceof Error&&e.stack&&(this.stack=e.stack)}}function pl(r){return r instanceof Error&&r.name===Bs}function _s(r){if(r.aborted)throw new Io(r.reason)}let kr={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function mr(r){return kr.REGISTERED_PROTOCOLS[r.substring(0,r.indexOf("://"))]}let Xi="global-dispatcher";class kn extends Error{constructor(e,i,o,s){super(`AJAXError: ${i} (${e}): ${o}`),this.status=e,this.statusText=i,this.url=o,this.body=s}}let zA=()=>{var r;return ii(self)?(r=self.worker)===null||r===void 0?void 0:r.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href},nn=function(r,e){return c(this,void 0,void 0,(function*(){var i,o;if(r.url.includes("://")&&!/^https?:|^file:/.test(r.url)){let s=mr(r.url);if(s){let a=yield s(r,e);return a.data||r.type!=="arrayBuffer"?a:ji(a,{data:new ArrayBuffer(0)})}if(ii(self)&&(!((i=self.worker)===null||i===void 0)&&i.actor))return self.worker.actor.sendAsync({type:"GR",data:r,targetMapId:Xi},e)}if(!(s=>{var a;return s.startsWith("file:")||((a=zA())===null||a===void 0?void 0:a.startsWith("file:"))&&!/^\w+:/.test(s)})(r.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return(function(s,a){return c(this,void 0,void 0,(function*(){let h=new Request(s.url,{method:s.method||"GET",body:s.body,credentials:s.credentials,headers:s.headers,cache:s.cache,referrer:zA(),referrerPolicy:s.referrerPolicy,signal:a.signal}),u,f;s.type!=="json"||h.headers.has("Accept")||h.headers.set("Accept","application/json");try{u=yield fetch(h)}catch(_){throw pl(_)?_:new kn(0,Dt(_).message,s.url,new Blob)}if(!u.ok){let _=yield u.blob();throw new kn(u.status,u.statusText,s.url,_)}f=s.type==="arrayBuffer"||s.type==="image"?u.arrayBuffer():s.type==="json"?u.json():u.text();let p=yield f;return _s(a.signal),{data:p,cacheControl:u.headers.get("Cache-Control"),expires:u.headers.get("Expires"),etag:u.headers.get("ETag")}}))})(r,e);if(ii(self)&&(!((o=self.worker)===null||o===void 0)&&o.actor))return self.worker.actor.sendAsync({type:"GR",data:r,mustQueue:!0,targetMapId:Xi},e)}return(function(s,a){return new Promise(((h,u)=>{var f;let p=new XMLHttpRequest;p.open(s.method||"GET",s.url,!0),s.type!=="arrayBuffer"&&s.type!=="image"||(p.responseType="arraybuffer");for(let _ in s.headers)p.setRequestHeader(_,s.headers[_]);s.type==="json"&&(p.responseType="text",!((f=s.headers)===null||f===void 0)&&f.Accept||p.setRequestHeader("Accept","application/json")),p.withCredentials=s.credentials==="include",p.onerror=()=>{u(new Error(p.statusText))},p.onload=()=>{if(!a.signal.aborted)if((p.status>=200&&p.status<300||p.status===0)&&p.response!==null){let _=p.response;if(s.type==="json")try{_=JSON.parse(p.response)}catch(m){return void u(m)}h({data:_,cacheControl:p.getResponseHeader("Cache-Control"),expires:p.getResponseHeader("Expires"),etag:p.getResponseHeader("ETag")})}else{let _=new Blob([p.response],{type:p.getResponseHeader("Content-Type")});u(new kn(p.status,p.statusText,s.url,_))}},a.signal.addEventListener("abort",(()=>{p.abort(),u(new Io(a.signal.reason))})),p.send(s.body)}))})(r,e)}))};function ir(r){if(!r||r.indexOf("://")<=0||r.startsWith("data:image/")||r.startsWith("blob:"))return!0;let e=new URL(r),i=window.location;return e.protocol===i.protocol&&e.host===i.host}function Pn(r,e,i){var o;!((o=i[r])===null||o===void 0)&&o.includes(e)||(i[r]||(i[r]=[]),i[r].push(e))}function on(r,e,i){if(i!=null&&i[r]){let o=i[r].indexOf(e);o!==-1&&i[r].splice(o,1)}}class xo{constructor(e,i={}){ji(this,i),this.type=e}}class Gn extends xo{constructor(e,i={}){super("error",ji({error:e},i))}}class ys{on(e,i){return this._listeners||(this._listeners={}),Pn(e,i,this._listeners),{unsubscribe:()=>{this.off(e,i)}}}off(e,i){return on(e,i,this._listeners),on(e,i,this._oneTimeListeners),this}once(e,i){return i?(this._oneTimeListeners||(this._oneTimeListeners={}),Pn(e,i,this._oneTimeListeners),this):new Promise((o=>this.once(e,o)))}fire(e,i){var o,s;typeof e=="string"&&(e=new xo(e,i||{}));let a=e.type;if(this.listens(a)){e.target=this;let h=!((o=this._listeners)===null||o===void 0)&&o[a]?this._listeners[a].slice():[];for(let p of h)p.call(this,e);let u=!((s=this._oneTimeListeners)===null||s===void 0)&&s[a]?this._oneTimeListeners[a].slice():[];for(let p of u)on(a,p,this._oneTimeListeners),p.call(this,e);let f=this._eventedParent;f&&(ji(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),f.fire(e))}else e instanceof Gn&&console.error(e.error);return this}listens(e){var i,o,s,a,h;return((o=(i=this._listeners)===null||i===void 0?void 0:i[e])===null||o===void 0?void 0:o.length)>0||((a=(s=this._oneTimeListeners)===null||s===void 0?void 0:s[e])===null||a===void 0?void 0:a.length)>0||((h=this._eventedParent)===null||h===void 0?void 0:h.listens(e))}setEventedParent(e,i){return this._eventedParent=e,this._eventedParentData=i,this}}var he={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};let YA=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function KA(r,e){let i={};for(let o in r)o!=="ref"&&(i[o]=r[o]);return YA.forEach((o=>{o in e&&(i[o]=e[o])})),i}function ct(r,e){if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let i=0;i<r.length;i++)if(!ct(r[i],e[i]))return!1;return!0}if(typeof r=="object"&&r!==null&&e!==null){if(typeof e!="object"||Object.keys(r).length!==Object.keys(e).length)return!1;for(let i in r)if(!ct(r[i],e[i]))return!1;return!0}return r===e}function bi(r,e){r.push(e)}function sn(r,e,i){bi(i,{command:"addSource",args:[r,e[r]]})}function fl(r,e,i){bi(e,{command:"removeSource",args:[r]}),i[r]=!0}function ml(r,e,i,o){fl(r,i,o),sn(r,e,i)}function lh(r,e,i){let o;for(o in r[i])if(Object.prototype.hasOwnProperty.call(r[i],o)&&o!=="data"&&!ct(r[i][o],e[i][o]))return!1;for(o in e[i])if(Object.prototype.hasOwnProperty.call(e[i],o)&&o!=="data"&&!ct(r[i][o],e[i][o]))return!1;return!0}function Qs(r,e,i,o,s,a){r=r||{},e=e||{};for(let h in r)Object.prototype.hasOwnProperty.call(r,h)&&(ct(r[h],e[h])||i.push({command:a,args:[o,h,e[h],s]}));for(let h in e)Object.prototype.hasOwnProperty.call(e,h)&&!Object.prototype.hasOwnProperty.call(r,h)&&(ct(r[h],e[h])||i.push({command:a,args:[o,h,e[h],s]}))}function jA(r){return r.id}function Bl(r,e){return r[e.id]=e,r}class Ee{constructor(e,i,o,s){this.message=(e?`${e}: `:"")+o,s&&(this.identifier=s),i!=null&&i.__line__&&(this.line=i.__line__)}}function An(r,...e){for(let i of e)for(let o in i)r[o]=i[o];return r}class ri extends Error{constructor(e,i){super(i),this.message=i,this.key=e}}class XA{constructor(e,i=[]){this.parent=e,this.bindings={};for(let[o,s]of i)this.bindings[o]=s}concat(e){return new XA(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}let Pr={kind:"null"},xe={kind:"number"},ze={kind:"string"},Ze={kind:"boolean"},Li={kind:"color"},Cs={kind:"projectionDefinition"},Br={kind:"object"},je={kind:"value"},vo={kind:"collator"},bo={kind:"formatted"},ws={kind:"padding"},Rn={kind:"colorArray"},Fo={kind:"numberArray"},On={kind:"resolvedImage"},Do={kind:"variableAnchorOffsetCollection"};function ni(r,e){return{kind:"array",itemType:r,N:e}}function ht(r){if(r.kind==="array"){let e=ht(r.itemType);return typeof r.N=="number"?`array<${e}, ${r.N}>`:r.itemType.kind==="value"?"array":`array<${e}>`}return r.kind}let Es=[Pr,xe,ze,Ze,Li,Cs,bo,Br,ni(je),ws,Fo,Rn,On,Do];function Nn(r,e){if(e.kind==="error")return null;if(r.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Nn(r.itemType,e.itemType))&&(typeof r.N!="number"||r.N===e.N))return null}else{if(r.kind===e.kind)return null;if(r.kind==="value"){for(let i of Es)if(!Nn(i,e))return null}}return`Expected ${ht(r)} but found ${ht(e)} instead.`}function So(r,e){return e.some((i=>i.kind===r.kind))}function an(r,e){return e.some((i=>i==="null"?r===null:i==="array"?Array.isArray(r):i==="object"?r&&!Array.isArray(r)&&typeof r=="object":i===typeof r))}function rr(r,e){return r.kind==="array"&&e.kind==="array"?r.itemType.kind===e.itemType.kind&&typeof r.N=="number":r.kind===e.kind}let _l=.96422,ln=.82521,Is=4/29,St=6/29,yl=3*St*St,Ql=St*St*St,Mo=Math.PI/180,Cl=180/Math.PI;function wl(r){return(r%=360)<0&&(r+=360),r}function El([r,e,i,o]){let s,a,h=VA((.2225045*(r=xs(r))+.7168786*(e=xs(e))+.0606169*(i=xs(i)))/1);r===e&&e===i?s=a=h:(s=VA((.4360747*r+.3850649*e+.1430804*i)/_l),a=VA((.0139322*r+.0971045*e+.7141733*i)/ln));let u=116*h-16;return[u<0?0:u,500*(s-h),200*(h-a),o]}function xs(r){return r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function VA(r){return r>Ql?Math.pow(r,1/3):r/yl+Is}function ZA([r,e,i,o]){let s=(r+16)/116,a=isNaN(e)?s:s+e/500,h=isNaN(i)?s:s-i/200;return s=1*JA(s),a=_l*JA(a),h=ln*JA(h),[HA(3.1338561*a-1.6168667*s-.4906146*h),HA(-.9787684*a+1.9161415*s+.033454*h),HA(.0719453*a-.2289914*s+1.4052427*h),o]}function HA(r){return(r=r<=.00304?12.92*r:1.055*Math.pow(r,1/2.4)-.055)<0?0:r>1?1:r}function JA(r){return r>St?r*r*r:yl*(r-Is)}let ch=Object.hasOwn||function(r,e){return Object.prototype.hasOwnProperty.call(r,e)};function To(r,e){return ch(r,e)?r[e]:void 0}function vs(r){return parseInt(r.padEnd(2,r),16)/255}function Il(r,e){return zn(e?r/100:r,0,1)}function zn(r,e,i){return Math.min(Math.max(e,r),i)}function qA(r){return!r.some(Number.isNaN)}let Uo={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Gr(r,e,i){return r+i*(e-r)}function Yn(r,e,i){return r.map(((o,s)=>Gr(o,e[s],i)))}class Ve{constructor(e,i,o,s=1,a=!0){this.r=e,this.g=i,this.b=o,this.a=s,a||(this.r*=s,this.g*=s,this.b*=s,s||this.overwriteGetter("rgb",[e,i,o,s]))}static parse(e){if(e instanceof Ve)return e;if(typeof e!="string")return;let i=(function(o){if((o=o.toLowerCase().trim())==="transparent")return[0,0,0,0];let s=To(Uo,o);if(s){let[h,u,f]=s;return[h/255,u/255,f/255,1]}if(o.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(o)){let h=o.length<6?1:2,u=1;return[vs(o.slice(u,u+=h)),vs(o.slice(u,u+=h)),vs(o.slice(u,u+=h)),vs(o.slice(u,u+h)||"ff")]}if(o.startsWith("rgb")){let h=o.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(h){let[u,f,p,_,m,w,Q,x,v,S,M,L]=h,U=[_||" ",Q||" ",S].join("");if(U===" "||U===" /"||U===",,"||U===",,,"){let k=[p,w,v].join(""),G=k==="%%%"?100:k===""?255:0;if(G){let O=[zn(+f/G,0,1),zn(+m/G,0,1),zn(+x/G,0,1),M?Il(+M,L):1];if(qA(O))return O}}return}}let a=o.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(a){let[h,u,f,p,_,m,w,Q,x]=a,v=[f||" ",_||" ",w].join("");if(v===" "||v===" /"||v===",,"||v===",,,"){let S=[+u,zn(+p,0,100),zn(+m,0,100),Q?Il(+Q,x):1];if(qA(S))return(function([M,L,U,k]){function G(O){let q=(O+M/30)%12,W=L*Math.min(U,1-U);return U-W*Math.max(-1,Math.min(q-3,9-q,1))}return M=wl(M),L/=100,U/=100,[G(0),G(8),G(4),k]})(S)}}})(e);return i?new Ve(...i,!1):void 0}get rgb(){let{r:e,g:i,b:o,a:s}=this,a=s||1/0;return this.overwriteGetter("rgb",[e/a,i/a,o/a,s])}get hcl(){return this.overwriteGetter("hcl",(function(e){let[i,o,s,a]=El(e),h=Math.sqrt(o*o+s*s);return[Math.round(1e4*h)?wl(Math.atan2(s,o)*Cl):NaN,h,i,a]})(this.rgb))}get lab(){return this.overwriteGetter("lab",El(this.rgb))}overwriteGetter(e,i){return Object.defineProperty(this,e,{value:i}),i}toString(){let[e,i,o,s]=this.rgb;return`rgba(${[e,i,o].map((a=>Math.round(255*a))).join(",")},${s})`}static interpolate(e,i,o,s="rgb"){switch(s){case"rgb":{let[a,h,u,f]=Yn(e.rgb,i.rgb,o);return new Ve(a,h,u,f,!1)}case"hcl":{let[a,h,u,f]=e.hcl,[p,_,m,w]=i.hcl,Q,x;if(isNaN(a)||isNaN(p))isNaN(a)?isNaN(p)?Q=NaN:(Q=p,u!==1&&u!==0||(x=_)):(Q=a,m!==1&&m!==0||(x=h));else{let U=p-a;p>a&&U>180?U-=360:p<a&&a-p>180&&(U+=360),Q=a+o*U}let[v,S,M,L]=(function([U,k,G,O]){return U=isNaN(U)?0:U*Mo,ZA([G,Math.cos(U)*k,Math.sin(U)*k,O])})([Q,x!=null?x:Gr(h,_,o),Gr(u,m,o),Gr(f,w,o)]);return new Ve(v,S,M,L,!1)}case"lab":{let[a,h,u,f]=ZA(Yn(e.lab,i.lab,o));return new Ve(a,h,u,f,!1)}}}}Ve.black=new Ve(0,0,0,1),Ve.white=new Ve(1,1,1,1),Ve.transparent=new Ve(0,0,0,0),Ve.red=new Ve(1,0,0,1);class WA{constructor(e,i,o){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=o,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,i){return this.collator.compare(e,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}let hh=["bottom","center","top"];class $A{constructor(e,i,o,s,a,h){this.text=e,this.image=i,this.scale=o,this.fontStack=s,this.textColor=a,this.verticalAlign=h}}class Fi{constructor(e){this.sections=e}static fromString(e){return new Fi([new $A(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some((e=>e.text.length!==0||e.image&&e.image.name.length!==0))}static factory(e){return e instanceof Fi?e:Fi.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map((e=>e.text)).join("")}}class ai{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ai)return e;if(typeof e=="number")return new ai([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let i of e)if(typeof i!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new ai(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,o){return new ai(Yn(e.values,i.values,o))}}class Et{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Et)return e;if(typeof e=="number")return new Et([e]);if(Array.isArray(e)){for(let i of e)if(typeof i!="number")return;return new Et(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,o){return new Et(Yn(e.values,i.values,o))}}class Ne{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ne)return e;if(typeof e=="string"){let o=Ve.parse(e);return o?new Ne([o]):void 0}if(!Array.isArray(e))return;let i=[];for(let o of e){if(typeof o!="string")return;let s=Ve.parse(o);if(!s)return;i.push(s)}return new Ne(i)}toString(){return JSON.stringify(this.values)}static interpolate(e,i,o,s="rgb"){let a=[];if(e.values.length!=i.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${i.values.length}), cannot interpolate.`);for(let h=0;h<e.values.length;h++)a.push(Ve.interpolate(e.values[h],i.values[h],o,s));return new Ne(a)}}class ft extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}let Rr=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class mi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof mi)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let i=0;i<e.length;i+=2){let o=e[i],s=e[i+1];if(typeof o!="string"||!Rr.has(o)||!Array.isArray(s)||s.length!==2||typeof s[0]!="number"||typeof s[1]!="number")return}return new mi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,o){let s=e.values,a=i.values;if(s.length!==a.length)throw new ft(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${i.toString()}`);let h=[];for(let u=0;u<s.length;u+=2){if(s[u]!==a[u])throw new ft(`Cannot interpolate values containing mismatched anchors. from[${u}]: ${s[u]}, to[${u}]: ${a[u]}`);h.push(s[u]);let[f,p]=s[u+1],[_,m]=a[u+1];h.push([Gr(f,_,o),Gr(p,m,o)])}return new mi(h)}}class ki{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new ki({name:e,available:!1}):null}}class Bi{constructor(e,i,o){this.from=e,this.to=i,this.transition=o}static interpolate(e,i,o){return new Bi(e,i,o)}static parse(e){return e instanceof Bi?e:Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number"?new Bi(e[0],e[1],e[2]):typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number"?new Bi(e.from,e.to,e.transition):typeof e=="string"?new Bi(e,e,1):void 0}}function Kn(r,e,i,o){return typeof r=="number"&&r>=0&&r<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof i=="number"&&i>=0&&i<=255?o===void 0||typeof o=="number"&&o>=0&&o<=1?null:`Invalid rgba value [${[r,e,i,o].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof o=="number"?[r,e,i,o]:[r,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Or(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof Bi||r instanceof Ve||r instanceof WA||r instanceof Fi||r instanceof ai||r instanceof Et||r instanceof Ne||r instanceof mi||r instanceof ki)return!0;if(Array.isArray(r)){for(let e of r)if(!Or(e))return!1;return!0}if(typeof r=="object"){for(let e in r)if(!Or(r[e]))return!1;return!0}return!1}function kt(r){if(r===null)return Pr;if(typeof r=="string")return ze;if(typeof r=="boolean")return Ze;if(typeof r=="number")return xe;if(r instanceof Ve)return Li;if(r instanceof Bi)return Cs;if(r instanceof WA)return vo;if(r instanceof Fi)return bo;if(r instanceof ai)return ws;if(r instanceof Et)return Fo;if(r instanceof Ne)return Rn;if(r instanceof mi)return Do;if(r instanceof ki)return On;if(Array.isArray(r)){let e=r.length,i;for(let o of r){let s=kt(o);if(i){if(i===s)continue;i=je;break}i=s}return ni(i||je,e)}return Br}function cn(r){let e=typeof r;return r===null?"":e==="string"||e==="number"||e==="boolean"?String(r):r instanceof Ve||r instanceof Bi||r instanceof Fi||r instanceof ai||r instanceof Et||r instanceof Ne||r instanceof mi||r instanceof ki?r.toString():JSON.stringify(r)}class cr{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(e.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Or(e[1]))return i.error("invalid value");let o=e[1],s=kt(o),a=i.expectedType;return s.kind!=="array"||s.N!==0||!a||a.kind!=="array"||typeof a.N=="number"&&a.N!==0||(s=a),new cr(s,o)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}let bs={string:ze,number:xe,boolean:Ze,object:Br};class Di{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let o,s=1,a=e[0];if(a==="array"){let u,f;if(e.length>2){let p=e[1];if(typeof p!="string"||!(p in bs)||p==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);u=bs[p],s++}else u=je;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);f=e[2],s++}o=ni(u,f)}else{if(!bs[a])throw new Error(`Types doesn't contain name = ${a}`);o=bs[a]}let h=[];for(;s<e.length;s++){let u=i.parse(e[s],s,je);if(!u)return null;h.push(u)}return new Di(o,h)}evaluate(e){for(let i=0;i<this.args.length;i++){let o=this.args[i].evaluate(e);if(!Nn(this.type,kt(o)))return o;if(i===this.args.length-1)throw new ft(`Expected value to be of type ${ht(this.type)}, but found ${ht(kt(o))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}let hn={"to-boolean":Ze,"to-color":Li,"to-number":xe,"to-string":ze};class _r{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let o=e[0];if(!hn[o])throw new Error(`Can't parse ${o} as it is not part of the known types`);if((o==="to-boolean"||o==="to-string")&&e.length!==2)return i.error("Expected one argument.");let s=hn[o],a=[];for(let h=1;h<e.length;h++){let u=i.parse(e[h],h,je);if(!u)return null;a.push(u)}return new _r(s,a)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let i,o;for(let s of this.args){if(i=s.evaluate(e),o=null,i instanceof Ve)return i;if(typeof i=="string"){let a=e.parseColor(i);if(a)return a}else if(Array.isArray(i)&&(o=i.length<3||i.length>4?`Invalid rgba value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:Kn(i[0],i[1],i[2],i[3]),!o))return new Ve(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new ft(o||`Could not parse color from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"padding":{let i;for(let o of this.args){i=o.evaluate(e);let s=ai.parse(i);if(s)return s}throw new ft(`Could not parse padding from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"numberArray":{let i;for(let o of this.args){i=o.evaluate(e);let s=Et.parse(i);if(s)return s}throw new ft(`Could not parse numberArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"colorArray":{let i;for(let o of this.args){i=o.evaluate(e);let s=Ne.parse(i);if(s)return s}throw new ft(`Could not parse colorArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"variableAnchorOffsetCollection":{let i;for(let o of this.args){i=o.evaluate(e);let s=mi.parse(i);if(s)return s}throw new ft(`Could not parse variableAnchorOffsetCollection from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"number":{let i=null;for(let o of this.args){if(i=o.evaluate(e),i===null)return 0;let s=Number(i);if(!isNaN(s))return s}throw new ft(`Could not convert ${JSON.stringify(i)} to number.`)}case"formatted":return Fi.fromString(cn(this.args[0].evaluate(e)));case"resolvedImage":return ki.fromString(cn(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return cn(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}let xl=["Unknown","Point","LineString","Polygon"];class ea{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?xl[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let i=this._parseColorCache.get(e);return i||(i=Ve.parse(e),this._parseColorCache.set(e,i)),i}}class un{constructor(e,i,o=[],s,a=new XA,h=[]){this.registry=e,this.path=o,this.key=o.map((u=>`[${u}]`)).join(""),this.scope=a,this.errors=h,this.expectedType=s,this._isConstant=i}parse(e,i,o,s,a={}){return i?this.concat(i,o,s)._parse(e,a):this._parse(e,a)}_parse(e,i){function o(s,a,h){return h==="assert"?new Di(a,[s]):h==="coerce"?new _r(a,[s]):s}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let s=e[0];if(typeof s!="string")return this.error(`Expression name must be a string, but found ${typeof s} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let a=this.registry[s];if(a){let h=a.parse(e,this);if(!h)return null;if(this.expectedType){let u=this.expectedType,f=h.type;if(u.kind!=="string"&&u.kind!=="number"&&u.kind!=="boolean"&&u.kind!=="object"&&u.kind!=="array"||f.kind!=="value"){if(u.kind==="projectionDefinition"&&["string","array"].includes(f.kind)||["color","formatted","resolvedImage"].includes(u.kind)&&["value","string"].includes(f.kind)||["padding","numberArray"].includes(u.kind)&&["value","number","array"].includes(f.kind)||u.kind==="colorArray"&&["value","string","array"].includes(f.kind)||u.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(f.kind))h=o(h,u,i.typeAnnotation||"coerce");else if(this.checkSubtype(u,f))return null}else h=o(h,u,i.typeAnnotation||"assert")}if(!(h instanceof cr)&&h.type.kind!=="resolvedImage"&&this._isConstant(h)){let u=new ea;try{h=new cr(h.type,h.evaluate(u))}catch(f){return this.error(f.message),null}}return h}return this.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,i,o){let s=typeof e=="number"?this.path.concat(e):this.path,a=o?this.scope.concat(o):this.scope;return new un(this.registry,this._isConstant,s,i||null,a,this.errors)}error(e,...i){let o=`${this.key}${i.map((s=>`[${s}]`)).join("")}`;this.errors.push(new ri(o,e))}checkSubtype(e,i){let o=Nn(e,i);return o&&this.error(o),o}}class mt{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let o=[];for(let a=1;a<e.length-1;a+=2){let h=e[a];if(typeof h!="string")return i.error(`Expected string, but found ${typeof h} instead.`,a);if(/[^a-zA-Z0-9_]/.test(h))return i.error("Variable names must contain only alphanumeric characters or '_'.",a);let u=i.parse(e[a+1],a+1);if(!u)return null;o.push([h,u])}let s=i.parse(e[e.length-1],e.length-1,i.expectedType,o);return s?new mt(o,s):null}outputDefined(){return this.result.outputDefined()}}class jn{constructor(e,i){this.type=i.type,this.name=e,this.boundExpression=i}static parse(e,i){if(e.length!==2||typeof e[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");let o=e[1];return i.scope.has(o)?new jn(o,i.scope.get(o)):i.error(`Unknown variable "${o}". Make sure "${o}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class it{constructor(e,i,o){this.type=e,this.index=i,this.input=o}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let o=i.parse(e[1],1,xe),s=i.parse(e[2],2,ni(i.expectedType||je));return o&&s?new it(s.type.itemType,o,s):null}evaluate(e){let i=this.index.evaluate(e),o=this.input.evaluate(e);if(i<0)throw new ft(`Array index out of bounds: ${i} < 0.`);if(i>=o.length)throw new ft(`Array index out of bounds: ${i} > ${o.length-1}.`);if(i!==Math.floor(i))throw new ft(`Array index must be an integer, but found ${i} instead.`);return o[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class Xe{constructor(e,i){this.type=Ze,this.needle=e,this.haystack=i}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let o=i.parse(e[1],1,je),s=i.parse(e[2],2,je);return o&&s?So(o.type,[Ze,ze,xe,Pr,je])?new Xe(o,s):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${ht(o.type)} instead`):null}evaluate(e){let i=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!o)return!1;if(!an(i,["boolean","string","number","null"]))throw new ft(`Expected first argument to be of type boolean, string, number or null, but found ${ht(kt(i))} instead.`);if(!an(o,["string","array"]))throw new ft(`Expected second argument to be of type array or string, but found ${ht(kt(o))} instead.`);return o.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Xn{constructor(e,i,o){this.type=xe,this.needle=e,this.haystack=i,this.fromIndex=o}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let o=i.parse(e[1],1,je),s=i.parse(e[2],2,je);if(!o||!s)return null;if(!So(o.type,[Ze,ze,xe,Pr,je]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${ht(o.type)} instead`);if(e.length===4){let a=i.parse(e[3],3,xe);return a?new Xn(o,s,a):null}return new Xn(o,s)}evaluate(e){let i=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!an(i,["boolean","string","number","null"]))throw new ft(`Expected first argument to be of type boolean, string, number or null, but found ${ht(kt(i))} instead.`);let s;if(this.fromIndex&&(s=this.fromIndex.evaluate(e)),an(o,["string"])){let a=o.indexOf(i,s);return a===-1?-1:[...o.slice(0,a)].length}if(an(o,["array"]))return o.indexOf(i,s);throw new ft(`Expected second argument to be of type array or string, but found ${ht(kt(o))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class ot{constructor(e,i,o,s,a,h){this.inputType=e,this.type=i,this.input=o,this.cases=s,this.outputs=a,this.otherwise=h}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let o,s;i.expectedType&&i.expectedType.kind!=="value"&&(s=i.expectedType);let a={},h=[];for(let p=2;p<e.length-1;p+=2){let _=e[p],m=e[p+1];Array.isArray(_)||(_=[_]);let w=i.concat(p);if(_.length===0)return w.error("Expected at least one branch label.");for(let x of _){if(typeof x!="number"&&typeof x!="string")return w.error("Branch labels must be numbers or strings.");if(typeof x=="number"&&Math.abs(x)>Number.MAX_SAFE_INTEGER)return w.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof x=="number"&&Math.floor(x)!==x)return w.error("Numeric branch labels must be integer values.");if(o){if(w.checkSubtype(o,kt(x)))return null}else o=kt(x);if(a[String(x)]!==void 0)return w.error("Branch labels must be unique.");a[String(x)]=h.length}let Q=i.parse(m,p,s);if(!Q)return null;s=s||Q.type,h.push(Q)}let u=i.parse(e[1],1,je);if(!u)return null;let f=i.parse(e[e.length-1],e.length-1,s);return f?u.type.kind!=="value"&&i.concat(1).checkSubtype(o,u.type)?null:new ot(o,s,u,a,h,f):null}evaluate(e){let i=this.input.evaluate(e);return(kt(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}}class nr{constructor(e,i,o){this.type=e,this.branches=i,this.otherwise=o}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let o;i.expectedType&&i.expectedType.kind!=="value"&&(o=i.expectedType);let s=[];for(let h=1;h<e.length-1;h+=2){let u=i.parse(e[h],h,Ze);if(!u)return null;let f=i.parse(e[h+1],h+1,o);if(!f)return null;s.push([u,f]),o=o||f.type}let a=i.parse(e[e.length-1],e.length-1,o);if(!a)return null;if(!o)throw new Error("Can't infer output type");return new nr(o,s,a)}evaluate(e){for(let[i,o]of this.branches)if(i.evaluate(e))return o.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[i,o]of this.branches)e(i),e(o);e(this.otherwise)}outputDefined(){return this.branches.every((([e,i])=>i.outputDefined()))&&this.otherwise.outputDefined()}}class Vn{constructor(e,i,o,s){this.type=e,this.input=i,this.beginIndex=o,this.endIndex=s}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let o=i.parse(e[1],1,je),s=i.parse(e[2],2,xe);if(!o||!s)return null;if(!So(o.type,[ni(je),ze,je]))return i.error(`Expected first argument to be of type array or string, but found ${ht(o.type)} instead`);if(e.length===4){let a=i.parse(e[3],3,xe);return a?new Vn(o.type,o,s,a):null}return new Vn(o.type,o,s)}evaluate(e){let i=this.input.evaluate(e),o=this.beginIndex.evaluate(e),s;if(this.endIndex&&(s=this.endIndex.evaluate(e)),an(i,["string"]))return[...i].slice(o,s).join("");if(an(i,["array"]))return i.slice(o,s);throw new ft(`Expected first argument to be of type array or string, but found ${ht(kt(i))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function dn(r,e){let i=r.length-1,o,s,a=0,h=i,u=0;for(;a<=h;)if(u=Math.floor((a+h)/2),o=r[u],s=r[u+1],o<=e){if(u===i||e<s)return u;a=u+1}else{if(!(o>e))throw new ft("Input is not a number.");h=u-1}return 0}class Zn{constructor(e,i,o){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(let[s,a]of o)this.labels.push(s),this.outputs.push(a)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");let o=i.parse(e[1],1,xe);if(!o)return null;let s=[],a=null;i.expectedType&&i.expectedType.kind!=="value"&&(a=i.expectedType);for(let h=1;h<e.length;h+=2){let u=h===1?-1/0:e[h],f=e[h+1],p=h,_=h+1;if(typeof u!="number")return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(s.length&&s[s.length-1][0]>=u)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',p);let m=i.parse(f,_,a);if(!m)return null;a=a||m.type,s.push([u,m])}return new Zn(a,o,s)}evaluate(e){let i=this.labels,o=this.outputs;if(i.length===1)return o[0].evaluate(e);let s=this.input.evaluate(e);if(s<=i[0])return o[0].evaluate(e);let a=i.length;return s>=i[a-1]?o[a-1].evaluate(e):o[dn(i,s)].evaluate(e)}eachChild(e){e(this.input);for(let i of this.outputs)e(i)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function ta(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Fs,vl,bl=(function(){if(vl)return Fs;function r(e,i,o,s){this.cx=3*e,this.bx=3*(o-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(s-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=i,this.p2x=o,this.p2y=s}return vl=1,Fs=r,r.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,i){if(i===void 0&&(i=1e-6),e<0)return 0;if(e>1)return 1;for(var o=e,s=0;s<8;s++){var a=this.sampleCurveX(o)-e;if(Math.abs(a)<i)return o;var h=this.sampleCurveDerivativeX(o);if(Math.abs(h)<1e-6)break;o-=a/h}var u=0,f=1;for(o=e,s=0;s<20&&(a=this.sampleCurveX(o),!(Math.abs(a-e)<i));s++)e>a?u=o:f=o,o=.5*(f-u)+u;return o},solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},Fs})(),Fl=ta(bl);class Rt{constructor(e,i,o,s,a){this.type=e,this.operator=i,this.interpolation=o,this.input=s,this.labels=[],this.outputs=[];for(let[h,u]of a)this.labels.push(h),this.outputs.push(u)}static interpolationFactor(e,i,o,s){let a=0;if(e.name==="exponential")a=Zt(i,e.base,o,s);else if(e.name==="linear")a=Zt(i,1,o,s);else if(e.name==="cubic-bezier"){let h=e.controlPoints;a=new Fl(h[0],h[1],h[2],h[3]).solve(Zt(i,1,o,s))}return a}static parse(e,i){let[o,s,a,...h]=e;if(!Array.isArray(s)||s.length===0)return i.error("Expected an interpolation type expression.",1);if(s[0]==="linear")s={name:"linear"};else if(s[0]==="exponential"){let p=s[1];if(typeof p!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);s={name:"exponential",base:p}}else{if(s[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(s[0])}`,1,0);{let p=s.slice(1);if(p.length!==4||p.some((_=>typeof _!="number"||_<0||_>1)))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);s={name:"cubic-bezier",controlPoints:p}}}if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(a=i.parse(a,2,xe),!a)return null;let u=[],f=null;o!=="interpolate-hcl"&&o!=="interpolate-lab"||i.expectedType==Rn?i.expectedType&&i.expectedType.kind!=="value"&&(f=i.expectedType):f=Li;for(let p=0;p<h.length;p+=2){let _=h[p],m=h[p+1],w=p+3,Q=p+4;if(typeof _!="number")return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',w);if(u.length&&u[u.length-1][0]>=_)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',w);let x=i.parse(m,Q,f);if(!x)return null;f=f||x.type,u.push([_,x])}return rr(f,xe)||rr(f,Cs)||rr(f,Li)||rr(f,ws)||rr(f,Fo)||rr(f,Rn)||rr(f,Do)||rr(f,ni(xe))?new Rt(f,o,s,a,u):i.error(`Type ${ht(f)} is not interpolatable.`)}evaluate(e){let i=this.labels,o=this.outputs;if(i.length===1)return o[0].evaluate(e);let s=this.input.evaluate(e);if(s<=i[0])return o[0].evaluate(e);let a=i.length;if(s>=i[a-1])return o[a-1].evaluate(e);let h=dn(i,s),u=Rt.interpolationFactor(this.interpolation,s,i[h],i[h+1]),f=o[h].evaluate(e),p=o[h+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Gr(f,p,u);case"color":return Ve.interpolate(f,p,u);case"padding":return ai.interpolate(f,p,u);case"colorArray":return Ne.interpolate(f,p,u);case"numberArray":return Et.interpolate(f,p,u);case"variableAnchorOffsetCollection":return mi.interpolate(f,p,u);case"array":return Yn(f,p,u);case"projectionDefinition":return Bi.interpolate(f,p,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return Ve.interpolate(f,p,u,"hcl");case"colorArray":return Ne.interpolate(f,p,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Ve.interpolate(f,p,u,"lab");case"colorArray":return Ne.interpolate(f,p,u,"lab")}}}eachChild(e){e(this.input);for(let i of this.outputs)e(i)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Zt(r,e,i,o){let s=o-i,a=r-i;return s===0?0:e===1?a/s:(Math.pow(e,a)-1)/(Math.pow(e,s)-1)}let Pi={color:Ve.interpolate,number:Gr,padding:ai.interpolate,numberArray:Et.interpolate,colorArray:Ne.interpolate,variableAnchorOffsetCollection:mi.interpolate,array:Yn};class Lo{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let o=null,s=i.expectedType;s&&s.kind!=="value"&&(o=s);let a=[];for(let u of e.slice(1)){let f=i.parse(u,1+a.length,o,void 0,{typeAnnotation:"omit"});if(!f)return null;o=o||f.type,a.push(f)}if(!o)throw new Error("No output type");let h=s&&a.some((u=>Nn(s,u.type)));return new Lo(h?je:o,a)}evaluate(e){let i,o=null,s=0;for(let a of this.args)if(s++,o=a.evaluate(e),o&&o instanceof ki&&!o.available&&(i||(i=o.name),o=null,s===this.args.length&&(o=i)),o!==null)break;return o}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function ko(r,e){return r==="=="||r==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function jt(r,e,i,o){return o.compare(e,i)===0}function gn(r,e,i){let o=r!=="=="&&r!=="!=";return class Cp{constructor(a,h,u){this.type=Ze,this.lhs=a,this.rhs=h,this.collator=u,this.hasUntypedArgument=a.type.kind==="value"||h.type.kind==="value"}static parse(a,h){if(a.length!==3&&a.length!==4)return h.error("Expected two or three arguments.");let u=a[0],f=h.parse(a[1],1,je);if(!f)return null;if(!ko(u,f.type))return h.concat(1).error(`"${u}" comparisons are not supported for type '${ht(f.type)}'.`);let p=h.parse(a[2],2,je);if(!p)return null;if(!ko(u,p.type))return h.concat(2).error(`"${u}" comparisons are not supported for type '${ht(p.type)}'.`);if(f.type.kind!==p.type.kind&&f.type.kind!=="value"&&p.type.kind!=="value")return h.error(`Cannot compare types '${ht(f.type)}' and '${ht(p.type)}'.`);o&&(f.type.kind==="value"&&p.type.kind!=="value"?f=new Di(p.type,[f]):f.type.kind!=="value"&&p.type.kind==="value"&&(p=new Di(f.type,[p])));let _=null;if(a.length===4){if(f.type.kind!=="string"&&p.type.kind!=="string"&&f.type.kind!=="value"&&p.type.kind!=="value")return h.error("Cannot use collator to compare non-string types.");if(_=h.parse(a[3],3,vo),!_)return null}return new Cp(f,p,_)}evaluate(a){let h=this.lhs.evaluate(a),u=this.rhs.evaluate(a);if(o&&this.hasUntypedArgument){let f=kt(h),p=kt(u);if(f.kind!==p.kind||f.kind!=="string"&&f.kind!=="number")throw new ft(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${f.kind}, ${p.kind}) instead.`)}if(this.collator&&!o&&this.hasUntypedArgument){let f=kt(h),p=kt(u);if(f.kind!=="string"||p.kind!=="string")return e(a,h,u)}return this.collator?i(a,h,u,this.collator.evaluate(a)):e(a,h,u)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}}}let ia=gn("==",(function(r,e,i){return e===i}),jt),Dl=gn("!=",(function(r,e,i){return e!==i}),(function(r,e,i,o){return!jt(0,e,i,o)})),uh=gn("<",(function(r,e,i){return e<i}),(function(r,e,i,o){return o.compare(e,i)<0})),Hn=gn(">",(function(r,e,i){return e>i}),(function(r,e,i,o){return o.compare(e,i)>0})),Ds=gn("<=",(function(r,e,i){return e<=i}),(function(r,e,i,o){return o.compare(e,i)<=0})),ra=gn(">=",(function(r,e,i){return e>=i}),(function(r,e,i,o){return o.compare(e,i)>=0}));class Ss{constructor(e,i,o){this.type=vo,this.locale=o,this.caseSensitive=e,this.diacriticSensitive=i}static parse(e,i){if(e.length!==2)return i.error("Expected one argument.");let o=e[1];if(typeof o!="object"||Array.isArray(o))return i.error("Collator options argument must be an object.");let s=i.parse(o["case-sensitive"]!==void 0&&o["case-sensitive"],1,Ze);if(!s)return null;let a=i.parse(o["diacritic-sensitive"]!==void 0&&o["diacritic-sensitive"],1,Ze);if(!a)return null;let h=null;return o.locale&&(h=i.parse(o.locale,1,ze),!h)?null:new Ss(s,a,h)}evaluate(e){return new WA(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class Ms{constructor(e,i,o,s,a,h){this.type=ze,this.number=e,this.locale=i,this.currency=o,this.unit=s,this.minFractionDigits=a,this.maxFractionDigits=h}static parse(e,i){if(e.length!==3)return i.error("Expected two arguments.");let o=i.parse(e[1],1,xe);if(!o)return null;let s=e[2];if(typeof s!="object"||Array.isArray(s))return i.error("NumberFormat options argument must be an object.");let a=null;if(s.locale&&(a=i.parse(s.locale,1,ze),!a))return null;let h=null;if(s.currency&&(h=i.parse(s.currency,1,ze),!h))return null;let u=null;if(s.unit&&(u=i.parse(s.unit,1,ze),!u))return null;if(h&&u)return i.error("NumberFormat options `currency` and `unit` are mutually exclusive");let f=null;if(s["min-fraction-digits"]&&(f=i.parse(s["min-fraction-digits"],1,xe),!f))return null;let p=null;return s["max-fraction-digits"]&&(p=i.parse(s["max-fraction-digits"],1,xe),!p)?null:new Ms(o,a,h,u,f,p)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class pn{constructor(e){this.type=bo,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let o=e[1];if(!Array.isArray(o)&&typeof o=="object")return i.error("First argument must be an image or text section.");let s=[],a=!1;for(let h=1;h<=e.length-1;++h){let u=e[h];if(a&&typeof u=="object"&&!Array.isArray(u)){a=!1;let f=null;if(u["font-scale"]&&(f=i.parse(u["font-scale"],1,xe),!f))return null;let p=null;if(u["text-font"]&&(p=i.parse(u["text-font"],1,ni(ze)),!p))return null;let _=null;if(u["text-color"]&&(_=i.parse(u["text-color"],1,Li),!_))return null;let m=null;if(u["vertical-align"]){if(typeof u["vertical-align"]=="string"&&!hh.includes(u["vertical-align"]))return i.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${u["vertical-align"]}' instead.`);if(m=i.parse(u["vertical-align"],1,ze),!m)return null}let w=s[s.length-1];w.scale=f,w.font=p,w.textColor=_,w.verticalAlign=m}else{let f=i.parse(e[h],1,je);if(!f)return null;let p=f.type.kind;if(p!=="string"&&p!=="value"&&p!=="null"&&p!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,s.push({content:f,scale:null,font:null,textColor:null,verticalAlign:null})}}return new pn(s)}evaluate(e){return new Fi(this.sections.map((i=>{let o=i.content.evaluate(e);return kt(o)===On?new $A("",o,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(e):null):new $A(cn(o),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null,i.verticalAlign?i.verticalAlign.evaluate(e):null)})))}eachChild(e){for(let i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor),i.verticalAlign&&e(i.verticalAlign)}outputDefined(){return!1}}class Jn{constructor(e){this.type=On,this.input=e}static parse(e,i){if(e.length!==2)return i.error("Expected two arguments.");let o=i.parse(e[1],1,ze);return o?new Jn(o):i.error("No image name provided.")}evaluate(e){let i=this.input.evaluate(e),o=ki.fromString(i);return o&&e.availableImages&&(o.available=e.availableImages.indexOf(i)>-1),o}eachChild(e){e(this.input)}outputDefined(){return!1}}class Gi{constructor(e){this.type=xe,this.input=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);let o=i.parse(e[1],1);return o?o.type.kind!=="array"&&o.type.kind!=="string"&&o.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${ht(o.type)} instead.`):new Gi(o):null}evaluate(e){let i=this.input.evaluate(e);if(typeof i=="string")return[...i].length;if(Array.isArray(i))return i.length;throw new ft(`Expected value to be of type string or array, but found ${ht(kt(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}let or=8192;function Ts(r,e){let i=(180+r[0])/360,o=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r[1]*Math.PI/360)))/360,s=Math.pow(2,e.z);return[Math.round(i*s*or),Math.round(o*s*or)]}function na(r,e){let i=Math.pow(2,e.z);return[(s=(r[0]/or+e.x)/i,360*s-180),(o=(r[1]/or+e.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*o)*Math.PI/180))-90)];var o,s}function fn(r,e){r[0]=Math.min(r[0],e[0]),r[1]=Math.min(r[1],e[1]),r[2]=Math.max(r[2],e[0]),r[3]=Math.max(r[3],e[1])}function Po(r,e){return!(r[0]<=e[0]||r[2]>=e[2]||r[1]<=e[1]||r[3]>=e[3])}function dh(r,e,i){let o=r[0]-e[0],s=r[1]-e[1],a=r[0]-i[0],h=r[1]-i[1];return o*h-a*s==0&&o*a<=0&&s*h<=0}function Us(r,e,i,o){return(s=[o[0]-i[0],o[1]-i[1]])[0]*(a=[e[0]-r[0],e[1]-r[1]])[1]-s[1]*a[0]!=0&&!(!Ml(r,e,i,o)||!Ml(i,o,r,e));var s,a}function gh(r,e,i){for(let o of i)for(let s=0;s<o.length-1;++s)if(Us(r,e,o[s],o[s+1]))return!0;return!1}function yr(r,e,i=!1){let o=!1;for(let u of e)for(let f=0;f<u.length-1;f++){if(dh(r,u[f],u[f+1]))return i;(a=u[f])[1]>(s=r)[1]!=(h=u[f+1])[1]>s[1]&&s[0]<(h[0]-a[0])*(s[1]-a[1])/(h[1]-a[1])+a[0]&&(o=!o)}var s,a,h;return o}function ph(r,e){for(let i of e)if(yr(r,i))return!0;return!1}function oa(r,e){for(let i of r)if(!yr(i,e))return!1;for(let i=0;i<r.length-1;++i)if(gh(r[i],r[i+1],e))return!1;return!0}function Sl(r,e){for(let i of e)if(oa(r,i))return!0;return!1}function Ml(r,e,i,o){let s=o[0]-i[0],a=o[1]-i[1],h=(r[0]-i[0])*a-s*(r[1]-i[1]),u=(e[0]-i[0])*a-s*(e[1]-i[1]);return h>0&&u<0||h<0&&u>0}function Ls(r,e,i){let o=[];for(let s=0;s<r.length;s++){let a=[];for(let h=0;h<r[s].length;h++){let u=Ts(r[s][h],i);fn(e,u),a.push(u)}o.push(a)}return o}function Tl(r,e,i){let o=[];for(let s=0;s<r.length;s++){let a=Ls(r[s],e,i);o.push(a)}return o}function Ul(r,e,i,o){if(r[0]<i[0]||r[0]>i[2]){let s=.5*o,a=r[0]-i[0]>s?-o:i[0]-r[0]>s?o:0;a===0&&(a=r[0]-i[2]>s?-o:i[2]-r[0]>s?o:0),r[0]+=a}fn(e,r)}function Ll(r,e,i,o){let s=Math.pow(2,o.z)*or,a=[o.x*or,o.y*or],h=[];for(let u of r)for(let f of u){let p=[f.x+a[0],f.y+a[1]];Ul(p,e,i,s),h.push(p)}return h}function kl(r,e,i,o){let s=Math.pow(2,o.z)*or,a=[o.x*or,o.y*or],h=[];for(let f of r){let p=[];for(let _ of f){let m=[_.x+a[0],_.y+a[1]];fn(e,m),p.push(m)}h.push(p)}if(e[2]-e[0]<=s/2){(u=e)[0]=u[1]=1/0,u[2]=u[3]=-1/0;for(let f of h)for(let p of f)Ul(p,e,i,s)}var u;return h}class mn{constructor(e,i){this.type=Ze,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Or(e[1])){let o=e[1];if(o.type==="FeatureCollection"){let s=[];for(let a of o.features){let{type:h,coordinates:u}=a.geometry;h==="Polygon"&&s.push(u),h==="MultiPolygon"&&s.push(...u)}if(s.length)return new mn(o,{type:"MultiPolygon",coordinates:s})}else if(o.type==="Feature"){let s=o.geometry.type;if(s==="Polygon"||s==="MultiPolygon")return new mn(o,o.geometry)}else if(o.type==="Polygon"||o.type==="MultiPolygon")return new mn(o,o)}return i.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(i,o){let s=[1/0,1/0,-1/0,-1/0],a=[1/0,1/0,-1/0,-1/0],h=i.canonicalID();if(o.type==="Polygon"){let u=Ls(o.coordinates,a,h),f=Ll(i.geometry(),s,a,h);if(!Po(s,a))return!1;for(let p of f)if(!yr(p,u))return!1}if(o.type==="MultiPolygon"){let u=Tl(o.coordinates,a,h),f=Ll(i.geometry(),s,a,h);if(!Po(s,a))return!1;for(let p of f)if(!ph(p,u))return!1}return!0})(e,this.geometries);if(e.geometryType()==="LineString")return(function(i,o){let s=[1/0,1/0,-1/0,-1/0],a=[1/0,1/0,-1/0,-1/0],h=i.canonicalID();if(o.type==="Polygon"){let u=Ls(o.coordinates,a,h),f=kl(i.geometry(),s,a,h);if(!Po(s,a))return!1;for(let p of f)if(!oa(p,u))return!1}if(o.type==="MultiPolygon"){let u=Tl(o.coordinates,a,h),f=kl(i.geometry(),s,a,h);if(!Po(s,a))return!1;for(let p of f)if(!Sl(p,u))return!1}return!0})(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let sa=class{constructor(r=[],e=(i,o)=>i<o?-1:i>o?1:0){if(this.data=r,this.length=this.data.length,this.compare=e,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(r){this.data.push(r),this._up(this.length++)}pop(){if(this.length===0)return;let r=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),r}peek(){return this.data[0]}_up(r){let{data:e,compare:i}=this,o=e[r];for(;r>0;){let s=r-1>>1,a=e[s];if(i(o,a)>=0)break;e[r]=a,r=s}e[r]=o}_down(r){let{data:e,compare:i}=this,o=this.length>>1,s=e[r];for(;r<o;){let a=1+(r<<1),h=a+1;if(h<this.length&&i(e[h],e[a])<0&&(a=h),i(e[a],s)>=0)break;e[r]=e[a],r=a}e[r]=s}};function Aa(r,e,i=0,o=r.length-1,s=fh){for(;o>i;){if(o-i>600){let f=o-i+1,p=e-i+1,_=Math.log(f),m=.5*Math.exp(2*_/3),w=.5*Math.sqrt(_*m*(f-m)/f)*(p-f/2<0?-1:1);Aa(r,e,Math.max(i,Math.floor(e-p*m/f+w)),Math.min(o,Math.floor(e+(f-p)*m/f+w)),s)}let a=r[e],h=i,u=o;for(qn(r,i,e),s(r[o],a)>0&&qn(r,i,o);h<u;){for(qn(r,h,u),h++,u--;s(r[h],a)<0;)h++;for(;s(r[u],a)>0;)u--}s(r[i],a)===0?qn(r,i,u):(u++,qn(r,u,o)),u<=e&&(i=u+1),e<=u&&(o=u-1)}}function qn(r,e,i){let o=r[e];r[e]=r[i],r[i]=o}function fh(r,e){return r<e?-1:r>e?1:0}function ks(r,e){if(r.length<=1)return[r];let i=[],o,s;for(let a of r){let h=Bh(a);h!==0&&(a.area=Math.abs(h),s===void 0&&(s=h<0),s===h<0?(o&&i.push(o),o=[a]):o.push(a))}if(o&&i.push(o),e>1)for(let a=0;a<i.length;a++)i[a].length<=e||(Aa(i[a],e,1,i[a].length-1,mh),i[a]=i[a].slice(0,e));return i}function mh(r,e){return e.area-r.area}function Bh(r){let e=0;for(let i,o,s=0,a=r.length,h=a-1;s<a;h=s++)i=r[s],o=r[h],e+=(o.x-i.x)*(i.y+o.y);return e}let Go=1/298.257223563,Pl=Go*(2-Go),Gl=Math.PI/180;class aa{constructor(e){let i=6378.137*Gl*1e3,o=Math.cos(e*Gl),s=1/(1-Pl*(1-o*o)),a=Math.sqrt(s);this.kx=i*a*o,this.ky=i*a*s*(1-Pl)}distance(e,i){let o=this.wrap(e[0]-i[0])*this.kx,s=(e[1]-i[1])*this.ky;return Math.sqrt(o*o+s*s)}pointOnLine(e,i){let o,s,a,h,u=1/0;for(let f=0;f<e.length-1;f++){let p=e[f][0],_=e[f][1],m=this.wrap(e[f+1][0]-p)*this.kx,w=(e[f+1][1]-_)*this.ky,Q=0;m===0&&w===0||(Q=(this.wrap(i[0]-p)*this.kx*m+(i[1]-_)*this.ky*w)/(m*m+w*w),Q>1?(p=e[f+1][0],_=e[f+1][1]):Q>0&&(p+=m/this.kx*Q,_+=w/this.ky*Q)),m=this.wrap(i[0]-p)*this.kx,w=(i[1]-_)*this.ky;let x=m*m+w*w;x<u&&(u=x,o=p,s=_,a=f,h=Q)}return{point:[o,s],index:a,t:Math.max(0,Math.min(1,h))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function Rl(r,e){return e[0]-r[0]}function Wn(r){return r[1]-r[0]+1}function hr(r,e){return r[1]>=r[0]&&r[1]<e}function la(r,e){if(r[0]>r[1])return[null,null];let i=Wn(r);if(e){if(i===2)return[r,null];let s=Math.floor(i/2);return[[r[0],r[0]+s],[r[0]+s,r[1]]]}if(i===1)return[r,null];let o=Math.floor(i/2)-1;return[[r[0],r[0]+o],[r[0]+o+1,r[1]]]}function ca(r,e){if(!hr(e,r.length))return[1/0,1/0,-1/0,-1/0];let i=[1/0,1/0,-1/0,-1/0];for(let o=e[0];o<=e[1];++o)fn(i,r[o]);return i}function Ps(r){let e=[1/0,1/0,-1/0,-1/0];for(let i of r)for(let o of i)fn(e,o);return e}function ha(r){return r[0]!==-1/0&&r[1]!==-1/0&&r[2]!==1/0&&r[3]!==1/0}function ua(r,e,i){if(!ha(r)||!ha(e))return NaN;let o=0,s=0;return r[2]<e[0]&&(o=e[0]-r[2]),r[0]>e[2]&&(o=r[0]-e[2]),r[1]>e[3]&&(s=r[1]-e[3]),r[3]<e[1]&&(s=e[1]-r[3]),i.distance([0,0],[o,s])}function Bn(r,e,i){let o=i.pointOnLine(e,r);return i.distance(r,o.point)}function da(r,e,i,o,s){let a=Math.min(Bn(r,[i,o],s),Bn(e,[i,o],s)),h=Math.min(Bn(i,[r,e],s),Bn(o,[r,e],s));return Math.min(a,h)}function Ol(r,e,i,o,s){if(!hr(e,r.length)||!hr(o,i.length))return 1/0;let a=1/0;for(let h=e[0];h<e[1];++h){let u=r[h],f=r[h+1];for(let p=o[0];p<o[1];++p){let _=i[p],m=i[p+1];if(Us(u,f,_,m))return 0;a=Math.min(a,da(u,f,_,m,s))}}return a}function _h(r,e,i,o,s){if(!hr(e,r.length)||!hr(o,i.length))return NaN;let a=1/0;for(let h=e[0];h<=e[1];++h)for(let u=o[0];u<=o[1];++u)if(a=Math.min(a,s.distance(r[h],i[u])),a===0)return a;return a}function yh(r,e,i){if(yr(r,e,!0))return 0;let o=1/0;for(let s of e){let a=s[0],h=s[s.length-1];if(a!==h&&(o=Math.min(o,Bn(r,[h,a],i)),o===0))return o;let u=i.pointOnLine(s,r);if(o=Math.min(o,i.distance(r,u.point)),o===0)return o}return o}function Qh(r,e,i,o){if(!hr(e,r.length))return NaN;for(let a=e[0];a<=e[1];++a)if(yr(r[a],i,!0))return 0;let s=1/0;for(let a=e[0];a<e[1];++a){let h=r[a],u=r[a+1];for(let f of i)for(let p=0,_=f.length,m=_-1;p<_;m=p++){let w=f[m],Q=f[p];if(Us(h,u,w,Q))return 0;s=Math.min(s,da(h,u,w,Q,o))}}return s}function Nl(r,e){for(let i of r)for(let o of i)if(yr(o,e,!0))return!0;return!1}function at(r,e,i,o=1/0){let s=Ps(r),a=Ps(e);if(o!==1/0&&ua(s,a,i)>=o)return o;if(Po(s,a)){if(Nl(r,e))return 0}else if(Nl(e,r))return 0;let h=1/0;for(let u of r)for(let f=0,p=u.length,_=p-1;f<p;_=f++){let m=u[_],w=u[f];for(let Q of e)for(let x=0,v=Q.length,S=v-1;x<v;S=x++){let M=Q[S],L=Q[x];if(Us(m,w,M,L))return 0;h=Math.min(h,da(m,w,M,L,i))}}return h}function zl(r,e,i,o,s,a){if(!a)return;let h=ua(ca(o,a),s,i);h<e&&r.push([h,a,[0,0]])}function Gs(r,e,i,o,s,a,h){if(!a||!h)return;let u=ua(ca(o,a),ca(s,h),i);u<e&&r.push([u,a,h])}function Rs(r,e,i,o,s=1/0){let a=Math.min(o.distance(r[0],i[0][0]),s);if(a===0)return a;let h=new sa([[0,[0,r.length-1],[0,0]]],Rl),u=Ps(i);for(;h.length>0;){let f=h.pop();if(f[0]>=a)continue;let p=f[1],_=e?50:100;if(Wn(p)<=_){if(!hr(p,r.length))return NaN;if(e){let m=Qh(r,p,i,o);if(isNaN(m)||m===0)return m;a=Math.min(a,m)}else for(let m=p[0];m<=p[1];++m){let w=yh(r[m],i,o);if(a=Math.min(a,w),a===0)return 0}}else{let m=la(p,e);zl(h,a,o,r,u,m[0]),zl(h,a,o,r,u,m[1])}}return a}function Os(r,e,i,o,s,a=1/0){let h=Math.min(a,s.distance(r[0],i[0]));if(h===0)return h;let u=new sa([[0,[0,r.length-1],[0,i.length-1]]],Rl);for(;u.length>0;){let f=u.pop();if(f[0]>=h)continue;let p=f[1],_=f[2],m=e?50:100,w=o?50:100;if(Wn(p)<=m&&Wn(_)<=w){if(!hr(p,r.length)&&hr(_,i.length))return NaN;let Q;if(e&&o)Q=Ol(r,p,i,_,s),h=Math.min(h,Q);else if(e&&!o){let x=r.slice(p[0],p[1]+1);for(let v=_[0];v<=_[1];++v)if(Q=Bn(i[v],x,s),h=Math.min(h,Q),h===0)return h}else if(!e&&o){let x=i.slice(_[0],_[1]+1);for(let v=p[0];v<=p[1];++v)if(Q=Bn(r[v],x,s),h=Math.min(h,Q),h===0)return h}else Q=_h(r,p,i,_,s),h=Math.min(h,Q)}else{let Q=la(p,e),x=la(_,o);Gs(u,h,s,r,i,Q[0],x[0]),Gs(u,h,s,r,i,Q[0],x[1]),Gs(u,h,s,r,i,Q[1],x[0]),Gs(u,h,s,r,i,Q[1],x[1])}}return h}function ga(r){return r.type==="MultiPolygon"?r.coordinates.map((e=>({type:"Polygon",coordinates:e}))):r.type==="MultiLineString"?r.coordinates.map((e=>({type:"LineString",coordinates:e}))):r.type==="MultiPoint"?r.coordinates.map((e=>({type:"Point",coordinates:e}))):[r]}class _n{constructor(e,i){this.type=xe,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Or(e[1])){let o=e[1];if(o.type==="FeatureCollection")return new _n(o,o.features.map((s=>ga(s.geometry))).flat());if(o.type==="Feature")return new _n(o,ga(o.geometry));if("type"in o&&"coordinates"in o)return new _n(o,ga(o))}return i.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(i,o){let s=i.geometry(),a=s.flat().map((f=>na([f.x,f.y],i.canonical)));if(s.length===0)return NaN;let h=new aa(a[0][1]),u=1/0;for(let f of o){switch(f.type){case"Point":u=Math.min(u,Os(a,!1,[f.coordinates],!1,h,u));break;case"LineString":u=Math.min(u,Os(a,!1,f.coordinates,!0,h,u));break;case"Polygon":u=Math.min(u,Rs(a,!1,f.coordinates,h,u))}if(u===0)return u}return u})(e,this.geometries);if(e.geometryType()==="LineString")return(function(i,o){let s=i.geometry(),a=s.flat().map((f=>na([f.x,f.y],i.canonical)));if(s.length===0)return NaN;let h=new aa(a[0][1]),u=1/0;for(let f of o){switch(f.type){case"Point":u=Math.min(u,Os(a,!0,[f.coordinates],!1,h,u));break;case"LineString":u=Math.min(u,Os(a,!0,f.coordinates,!0,h,u));break;case"Polygon":u=Math.min(u,Rs(a,!0,f.coordinates,h,u))}if(u===0)return u}return u})(e,this.geometries);if(e.geometryType()==="Polygon")return(function(i,o){let s=i.geometry();if(s.length===0||s[0].length===0)return NaN;let a=ks(s,0).map((f=>f.map((p=>p.map((_=>na([_.x,_.y],i.canonical))))))),h=new aa(a[0][0][0][1]),u=1/0;for(let f of o)for(let p of a){switch(f.type){case"Point":u=Math.min(u,Rs([f.coordinates],!1,p,h,u));break;case"LineString":u=Math.min(u,Rs(f.coordinates,!0,p,h,u));break;case"Polygon":u=Math.min(u,at(p,f.coordinates,h,u))}if(u===0)return u}return u})(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Ro{constructor(e){this.type=je,this.key=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);let o=e[1];return o==null?i.error("Global state property must be defined."):typeof o!="string"?i.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Ro(o)}evaluate(e){var i;let o=(i=e.globals)===null||i===void 0?void 0:i.globalState;return o&&Object.keys(o).length!==0?To(o,this.key):null}eachChild(){}outputDefined(){return!1}}let $n={"==":ia,"!=":Dl,">":Hn,"<":uh,">=":ra,"<=":Ds,array:Di,at:it,boolean:Di,case:nr,coalesce:Lo,collator:Ss,format:pn,image:Jn,in:Xe,"index-of":Xn,interpolate:Rt,"interpolate-hcl":Rt,"interpolate-lab":Rt,length:Gi,let:mt,literal:cr,match:ot,number:Di,"number-format":Ms,object:Di,slice:Vn,step:Zn,string:Di,"to-boolean":_r,"to-color":_r,"to-number":_r,"to-string":_r,var:jn,within:mn,distance:_n,"global-state":Ro};class Vi{constructor(e,i,o,s){this.name=e,this.type=i,this._evaluate=o,this.args=s}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,i){let o=e[0],s=Vi.definitions[o];if(!s)return i.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(s)?s[0]:s.type,h=Array.isArray(s)?[[s[1],s[2]]]:s.overloads,u=h.filter((([p])=>!Array.isArray(p)||p.length===e.length-1)),f=null;for(let[p,_]of u){f=new un(i.registry,Ns,i.path,null,i.scope);let m=[],w=!1;for(let Q=1;Q<e.length;Q++){let x=e[Q],v=Array.isArray(p)?p[Q-1]:p.type,S=f.parse(x,1+m.length,v);if(!S){w=!0;break}m.push(S)}if(!w)if(Array.isArray(p)&&p.length!==m.length)f.error(`Expected ${p.length} arguments, but found ${m.length} instead.`);else{for(let Q=0;Q<m.length;Q++){let x=Array.isArray(p)?p[Q]:p.type,v=m[Q];f.concat(Q+1).checkSubtype(x,v.type)}if(f.errors.length===0)return new Vi(o,a,_,m)}}if(u.length===1)i.errors.push(...f.errors);else{let p=(u.length?u:h).map((([m])=>{return w=m,Array.isArray(w)?`(${w.map(ht).join(", ")})`:`(${ht(w.type)}...)`;var w})).join(" | "),_=[];for(let m=1;m<e.length;m++){let w=i.parse(e[m],1+_.length);if(!w)return null;_.push(ht(w.type))}i.error(`Expected arguments of type ${p}, but found (${_.join(", ")}) instead.`)}return null}static register(e,i){Vi.definitions=i;for(let o in i)e[o]=Vi}}function Yl(r,[e,i,o,s]){e=e.evaluate(r),i=i.evaluate(r),o=o.evaluate(r);let a=s?s.evaluate(r):1,h=Kn(e,i,o,a);if(h)throw new ft(h);return new Ve(e/255,i/255,o/255,a,!1)}function Kl(r,e){return r in e}function pa(r,e){let i=e[r];return i===void 0?null:i}function yn(r){return{type:r}}function Ns(r){if(r instanceof jn)return Ns(r.boundExpression);if(r instanceof Vi&&r.name==="error"||r instanceof Ss||r instanceof mn||r instanceof _n||r instanceof Ro)return!1;let e=r instanceof _r||r instanceof Di,i=!0;return r.eachChild((o=>{i=e?i&&Ns(o):i&&o instanceof cr})),!!i&&zs(r)&&Ys(r,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function zs(r){if(r instanceof Vi&&(r.name==="get"&&r.args.length===1||r.name==="feature-state"||r.name==="has"&&r.args.length===1||r.name==="properties"||r.name==="geometry-type"||r.name==="id"||/^filter-/.test(r.name))||r instanceof mn||r instanceof _n)return!1;let e=!0;return r.eachChild((i=>{e&&!zs(i)&&(e=!1)})),e}function Oo(r){if(r instanceof Vi&&r.name==="feature-state")return!1;let e=!0;return r.eachChild((i=>{e&&!Oo(i)&&(e=!1)})),e}function Ys(r,e){if(r instanceof Vi&&e.indexOf(r.name)>=0)return!1;let i=!0;return r.eachChild((o=>{i&&!Ys(o,e)&&(i=!1)})),i}function jl(r){return{result:"success",value:r}}function eo(r){return{result:"error",value:r}}function to(r){return r["property-type"]==="data-driven"||r["property-type"]==="cross-faded-data-driven"}function Xl(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function fa(r){return!!r.expression&&r.expression.interpolated}function He(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}function Ks(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&kt(r)===Br}function Ch(r){return r}function Vl(r,e){let i=r.stops&&typeof r.stops[0][0]=="object",o=i||!(i||r.property!==void 0),s=r.type||(fa(e)?"exponential":"interval"),a=(function(_){switch(_.type){case"color":return Ve.parse;case"padding":return ai.parse;case"numberArray":return Et.parse;case"colorArray":return Ne.parse;default:return null}})(e);if(a&&((r=An({},r)).stops&&(r.stops=r.stops.map((_=>[_[0],a(_[1])]))),r.default=a(r.default?r.default:e.default)),r.colorSpace&&(h=r.colorSpace)!=="rgb"&&h!=="hcl"&&h!=="lab")throw new Error(`Unknown color space: "${r.colorSpace}"`);var h;let u=(function(_){switch(_){case"exponential":return Zl;case"interval":return Eh;case"categorical":return wh;case"identity":return Ih;default:throw new Error(`Unknown function type "${_}"`)}})(s),f,p;if(s==="categorical"){f=Object.create(null);for(let _ of r.stops)f[_[0]]=_[1];p=typeof r.stops[0][0]}if(i){let _={},m=[];for(let x=0;x<r.stops.length;x++){let v=r.stops[x],S=v[0].zoom;_[S]===void 0&&(_[S]={zoom:S,type:r.type,property:r.property,default:r.default,stops:[]},m.push(S)),_[S].stops.push([v[0].value,v[1]])}let w=[];for(let x of m)w.push([_[x].zoom,Vl(_[x],e)]);let Q={name:"linear"};return{kind:"composite",interpolationType:Q,interpolationFactor:Rt.interpolationFactor.bind(void 0,Q),zoomStops:w.map((x=>x[0])),evaluate:({zoom:x},v)=>Zl({stops:w,base:r.base},e,x).evaluate(x,v)}}if(o){let _=s==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:_,interpolationFactor:Rt.interpolationFactor.bind(void 0,_),zoomStops:r.stops.map((m=>m[0])),evaluate:({zoom:m})=>u(r,e,m,f,p)}}return{kind:"source",evaluate(_,m){let w=m&&m.properties?m.properties[r.property]:void 0;return w===void 0?No(r.default,e.default):u(r,e,w,f,p)}}}function No(r,e,i){return r!==void 0?r:e!==void 0?e:i!==void 0?i:void 0}function wh(r,e,i,o,s){return No(typeof i===s?o[i]:void 0,r.default,e.default)}function Eh(r,e,i){if(He(i)!=="number")return No(r.default,e.default);let o=r.stops.length;if(o===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[o-1][0])return r.stops[o-1][1];let s=dn(r.stops.map((a=>a[0])),i);return r.stops[s][1]}function Zl(r,e,i){let o=r.base!==void 0?r.base:1;if(He(i)!=="number")return No(r.default,e.default);let s=r.stops.length;if(s===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[s-1][0])return r.stops[s-1][1];let a=dn(r.stops.map((_=>_[0])),i),h=(function(_,m,w,Q){let x=Q-w,v=_-w;return x===0?0:m===1?v/x:(Math.pow(m,v)-1)/(Math.pow(m,x)-1)})(i,o,r.stops[a][0],r.stops[a+1][0]),u=r.stops[a][1],f=r.stops[a+1][1],p=Pi[e.type]||Ch;return typeof u.evaluate=="function"?{evaluate(..._){let m=u.evaluate.apply(void 0,_),w=f.evaluate.apply(void 0,_);if(m!==void 0&&w!==void 0)return p(m,w,h,r.colorSpace)}}:p(u,f,h,r.colorSpace)}function Ih(r,e,i){switch(e.type){case"color":i=Ve.parse(i);break;case"formatted":i=Fi.fromString(i.toString());break;case"resolvedImage":i=ki.fromString(i.toString());break;case"padding":i=ai.parse(i);break;case"colorArray":i=Ne.parse(i);break;case"numberArray":i=Et.parse(i);break;default:He(i)===e.type||e.type==="enum"&&e.values[i]||(i=void 0)}return No(i,r.default,e.default)}Vi.register($n,{error:[{kind:"error"},[ze],(r,[e])=>{throw new ft(e.evaluate(r))}],typeof:[ze,[je],(r,[e])=>ht(kt(e.evaluate(r)))],"to-rgba":[ni(xe,4),[Li],(r,[e])=>{let[i,o,s,a]=e.evaluate(r).rgb;return[255*i,255*o,255*s,a]}],rgb:[Li,[xe,xe,xe],Yl],rgba:[Li,[xe,xe,xe,xe],Yl],has:{type:Ze,overloads:[[[ze],(r,[e])=>Kl(e.evaluate(r),r.properties())],[[ze,Br],(r,[e,i])=>Kl(e.evaluate(r),i.evaluate(r))]]},get:{type:je,overloads:[[[ze],(r,[e])=>pa(e.evaluate(r),r.properties())],[[ze,Br],(r,[e,i])=>pa(e.evaluate(r),i.evaluate(r))]]},"feature-state":[je,[ze],(r,[e])=>pa(e.evaluate(r),r.featureState||{})],properties:[Br,[],r=>r.properties()],"geometry-type":[ze,[],r=>r.geometryType()],id:[je,[],r=>r.id()],zoom:[xe,[],r=>r.globals.zoom],"heatmap-density":[xe,[],r=>r.globals.heatmapDensity||0],elevation:[xe,[],r=>r.globals.elevation||0],"line-progress":[xe,[],r=>r.globals.lineProgress||0],accumulated:[je,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[xe,yn(xe),(r,e)=>{let i=0;for(let o of e)i+=o.evaluate(r);return i}],"*":[xe,yn(xe),(r,e)=>{let i=1;for(let o of e)i*=o.evaluate(r);return i}],"-":{type:xe,overloads:[[[xe,xe],(r,[e,i])=>e.evaluate(r)-i.evaluate(r)],[[xe],(r,[e])=>-e.evaluate(r)]]},"/":[xe,[xe,xe],(r,[e,i])=>e.evaluate(r)/i.evaluate(r)],"%":[xe,[xe,xe],(r,[e,i])=>e.evaluate(r)%i.evaluate(r)],ln2:[xe,[],()=>Math.LN2],pi:[xe,[],()=>Math.PI],e:[xe,[],()=>Math.E],"^":[xe,[xe,xe],(r,[e,i])=>Math.pow(e.evaluate(r),i.evaluate(r))],sqrt:[xe,[xe],(r,[e])=>Math.sqrt(e.evaluate(r))],log10:[xe,[xe],(r,[e])=>Math.log(e.evaluate(r))/Math.LN10],ln:[xe,[xe],(r,[e])=>Math.log(e.evaluate(r))],log2:[xe,[xe],(r,[e])=>Math.log(e.evaluate(r))/Math.LN2],sin:[xe,[xe],(r,[e])=>Math.sin(e.evaluate(r))],cos:[xe,[xe],(r,[e])=>Math.cos(e.evaluate(r))],tan:[xe,[xe],(r,[e])=>Math.tan(e.evaluate(r))],asin:[xe,[xe],(r,[e])=>Math.asin(e.evaluate(r))],acos:[xe,[xe],(r,[e])=>Math.acos(e.evaluate(r))],atan:[xe,[xe],(r,[e])=>Math.atan(e.evaluate(r))],min:[xe,yn(xe),(r,e)=>Math.min(...e.map((i=>i.evaluate(r))))],max:[xe,yn(xe),(r,e)=>Math.max(...e.map((i=>i.evaluate(r))))],abs:[xe,[xe],(r,[e])=>Math.abs(e.evaluate(r))],round:[xe,[xe],(r,[e])=>{let i=e.evaluate(r);return i<0?-Math.round(-i):Math.round(i)}],floor:[xe,[xe],(r,[e])=>Math.floor(e.evaluate(r))],ceil:[xe,[xe],(r,[e])=>Math.ceil(e.evaluate(r))],"filter-==":[Ze,[ze,je],(r,[e,i])=>r.properties()[e.value]===i.value],"filter-id-==":[Ze,[je],(r,[e])=>r.id()===e.value],"filter-type-==":[Ze,[ze],(r,[e])=>r.geometryType()===e.value],"filter-<":[Ze,[ze,je],(r,[e,i])=>{let o=r.properties()[e.value],s=i.value;return typeof o==typeof s&&o<s}],"filter-id-<":[Ze,[je],(r,[e])=>{let i=r.id(),o=e.value;return typeof i==typeof o&&i<o}],"filter->":[Ze,[ze,je],(r,[e,i])=>{let o=r.properties()[e.value],s=i.value;return typeof o==typeof s&&o>s}],"filter-id->":[Ze,[je],(r,[e])=>{let i=r.id(),o=e.value;return typeof i==typeof o&&i>o}],"filter-<=":[Ze,[ze,je],(r,[e,i])=>{let o=r.properties()[e.value],s=i.value;return typeof o==typeof s&&o<=s}],"filter-id-<=":[Ze,[je],(r,[e])=>{let i=r.id(),o=e.value;return typeof i==typeof o&&i<=o}],"filter->=":[Ze,[ze,je],(r,[e,i])=>{let o=r.properties()[e.value],s=i.value;return typeof o==typeof s&&o>=s}],"filter-id->=":[Ze,[je],(r,[e])=>{let i=r.id(),o=e.value;return typeof i==typeof o&&i>=o}],"filter-has":[Ze,[je],(r,[e])=>e.value in r.properties()],"filter-has-id":[Ze,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[Ze,[ni(ze)],(r,[e])=>e.value.indexOf(r.geometryType())>=0],"filter-id-in":[Ze,[ni(je)],(r,[e])=>e.value.indexOf(r.id())>=0],"filter-in-small":[Ze,[ze,ni(je)],(r,[e,i])=>i.value.indexOf(r.properties()[e.value])>=0],"filter-in-large":[Ze,[ze,ni(je)],(r,[e,i])=>(function(o,s,a,h){for(;a<=h;){let u=a+h>>1;if(s[u]===o)return!0;s[u]>o?h=u-1:a=u+1}return!1})(r.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Ze,overloads:[[[Ze,Ze],(r,[e,i])=>e.evaluate(r)&&i.evaluate(r)],[yn(Ze),(r,e)=>{for(let i of e)if(!i.evaluate(r))return!1;return!0}]]},any:{type:Ze,overloads:[[[Ze,Ze],(r,[e,i])=>e.evaluate(r)||i.evaluate(r)],[yn(Ze),(r,e)=>{for(let i of e)if(i.evaluate(r))return!0;return!1}]]},"!":[Ze,[Ze],(r,[e])=>!e.evaluate(r)],"is-supported-script":[Ze,[ze],(r,[e])=>{let i=r.globals&&r.globals.isSupportedScript;return!i||i(e.evaluate(r))}],upcase:[ze,[ze],(r,[e])=>e.evaluate(r).toUpperCase()],downcase:[ze,[ze],(r,[e])=>e.evaluate(r).toLowerCase()],concat:[ze,yn(je),(r,e)=>e.map((i=>cn(i.evaluate(r)))).join("")],split:[ni(ze),[ze,ze],(r,[e,i])=>e.evaluate(r).split(i.evaluate(r))],join:[ze,[ni(ze),ze],(r,[e,i])=>e.evaluate(r).join(i.evaluate(r))],"resolved-locale":[ze,[vo],(r,[e])=>e.evaluate(r).resolvedLocale()]});class zo{constructor(e,i,o){this.expression=e,this._warningHistory={},this._evaluator=new ea,this._defaultValue=i?(function(s){if(s.type==="color"&&Ks(s.default))return new Ve(0,0,0,0);switch(s.type){case"color":return Ve.parse(s.default)||null;case"padding":return ai.parse(s.default)||null;case"numberArray":return Et.parse(s.default)||null;case"colorArray":return Ne.parse(s.default)||null;case"variableAnchorOffsetCollection":return mi.parse(s.default)||null;case"projectionDefinition":return Bi.parse(s.default)||null;default:return s.default===void 0?null:s.default}})(i):null,this._enumValues=i&&i.type==="enum"?i.values:null,this._globalState=o}evaluateWithoutErrorHandling(e,i,o,s,a,h){return this._globalState&&(e=ro(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=i,this._evaluator.featureState=o,this._evaluator.canonical=s,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=h,this.expression.evaluate(this._evaluator)}evaluate(e,i,o,s,a,h){this._globalState&&(e=ro(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=i||null,this._evaluator.featureState=o||null,this._evaluator.canonical=s,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=h||null;try{let u=this.expression.evaluate(this._evaluator);if(u==null||typeof u=="number"&&u!=u)return this._defaultValue;if(this._enumValues&&!(u in this._enumValues))throw new ft(`Expected value to be one of ${Object.keys(this._enumValues).map((f=>JSON.stringify(f))).join(", ")}, but found ${JSON.stringify(u)} instead.`);return u}catch(u){return this._warningHistory[u.message]||(this._warningHistory[u.message]=!0,typeof console!="undefined"&&console.warn(u.message)),this._defaultValue}}}function js(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in $n}function Yo(r,e,i){let o=new un($n,Ns,[],e?(function(a){let h={color:Li,string:ze,number:xe,enum:ze,boolean:Ze,formatted:bo,padding:ws,numberArray:Fo,colorArray:Rn,projectionDefinition:Cs,resolvedImage:On,variableAnchorOffsetCollection:Do};return a.type==="array"?ni(h[a.value]||je,a.length):h[a.type]})(e):void 0),s=o.parse(r,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return s?jl(new zo(s,e,i)):eo(o.errors)}class Xs{constructor(e,i,o){this.kind=e,this._styleExpression=i,this.isStateDependent=e!=="constant"&&!Oo(i.expression),this.globalStateRefs=io(i.expression),this._globalState=o}evaluateWithoutErrorHandling(e,i,o,s,a,h){return this._globalState&&(e=ro(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,i,o,s,a,h)}evaluate(e,i,o,s,a,h){return this._globalState&&(e=ro(e,this._globalState)),this._styleExpression.evaluate(e,i,o,s,a,h)}}class Vs{constructor(e,i,o,s,a){this.kind=e,this.zoomStops=o,this._styleExpression=i,this.isStateDependent=e!=="camera"&&!Oo(i.expression),this.globalStateRefs=io(i.expression),this.interpolationType=s,this._globalState=a}evaluateWithoutErrorHandling(e,i,o,s,a,h){return this._globalState&&(e=ro(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,i,o,s,a,h)}evaluate(e,i,o,s,a,h){return this._globalState&&(e=ro(e,this._globalState)),this._styleExpression.evaluate(e,i,o,s,a,h)}interpolationFactor(e,i,o){return this.interpolationType?Rt.interpolationFactor(this.interpolationType,e,i,o):0}}function Hl(r,e,i){let o=Yo(r,e,i);if(o.result==="error")return o;let s=o.value.expression,a=zs(s);if(!a&&!to(e))return eo([new ri("","data expressions not supported")]);let h=Ys(s,["zoom"]);if(!h&&!Xl(e))return eo([new ri("","zoom expressions not supported")]);let u=Qn(s);return u||h?u instanceof ri?eo([u]):u instanceof Rt&&!fa(e)?eo([new ri("",'"interpolate" expressions cannot be used with this property')]):jl(u?new Vs(a?"camera":"composite",o.value,u.labels,u instanceof Rt?u.interpolation:void 0,i):new Xs(a?"constant":"source",o.value,i)):eo([new ri("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Zs{constructor(e,i){this._parameters=e,this._specification=i,An(this,Vl(this._parameters,this._specification))}static deserialize(e){return new Zs(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Qn(r){let e=null;if(r instanceof mt)e=Qn(r.result);else if(r instanceof Lo){for(let i of r.args)if(e=Qn(i),e)break}else(r instanceof Zn||r instanceof Rt)&&r.input instanceof Vi&&r.input.name==="zoom"&&(e=r);return e instanceof ri||r.eachChild((i=>{let o=Qn(i);o instanceof ri?e=o:!e&&o?e=new ri("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&o&&e!==o&&(e=new ri("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function io(r,e=new Set){return r instanceof Ro&&e.add(r.key),r.eachChild((i=>{io(i,e)})),e}function ro(r,e){let{zoom:i,heatmapDensity:o,elevation:s,lineProgress:a,isSupportedScript:h,accumulated:u}=r!=null?r:{};return{zoom:i,heatmapDensity:o,elevation:s,lineProgress:a,isSupportedScript:h,accumulated:u,globalState:e}}function ma(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(let e of r.slice(1))if(!ma(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}let xh={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ko(r,e){if(r==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};ma(r)||(r=jo(r));let i=Yo(r,xh,e);if(i.result==="error")throw new Error(i.value.map((o=>`${o.key}: ${o.message}`)).join(", "));return{filter:(o,s,a)=>i.value.evaluate(o,s,{},a),needGeometry:Ba(r),getGlobalStateRefs:()=>io(i.value.expression)}}function vh(r,e){return r<e?-1:r>e?1:0}function Ba(r){if(!Array.isArray(r))return!1;if(r[0]==="within"||r[0]==="distance")return!0;for(let e=1;e<r.length;e++)if(Ba(r[e]))return!0;return!1}function jo(r){if(!r)return!0;let e=r[0];return r.length<=1?e!=="any":e==="=="?_a(r[1],r[2],"=="):e==="!="?Xo(_a(r[1],r[2],"==")):e==="<"||e===">"||e==="<="||e===">="?_a(r[1],r[2],e):e==="any"?(i=r.slice(1),["any"].concat(i.map(jo))):e==="all"?["all"].concat(r.slice(1).map(jo)):e==="none"?["all"].concat(r.slice(1).map(jo).map(Xo)):e==="in"?Jl(r[1],r.slice(2)):e==="!in"?Xo(Jl(r[1],r.slice(2))):e==="has"?ya(r[1]):e!=="!has"||Xo(ya(r[1]));var i}function _a(r,e,i){switch(r){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,r,e]}}function Jl(r,e){if(e.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((i=>typeof i!=typeof e[0]))?["filter-in-large",r,["literal",e.sort(vh)]]:["filter-in-small",r,["literal",e]]}}function ya(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function Xo(r){return["!",r]}function Hs(r){let e=typeof r;if(e==="number"||e==="boolean"||e==="string"||r==null)return JSON.stringify(r);if(Array.isArray(r)){let s="[";for(let a of r)s+=`${Hs(a)},`;return`${s}]`}let i=Object.keys(r).sort(),o="{";for(let s=0;s<i.length;s++)o+=`${JSON.stringify(i[s])}:${Hs(r[i[s]])},`;return`${o}}`}function bh(r){let e="";for(let i of YA)e+=`/${Hs(r[i])}`;return e}function ql(r){let e=r.value;return e?[new Ee(r.key,e,"constants have been deprecated as of v8")]:[]}function Pt(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function Cn(r){if(Array.isArray(r))return r.map(Cn);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){let e={};for(let i in r)e[i]=Cn(r[i]);return e}return Pt(r)}function Si(r){let e=r.key,i=r.value,o=r.valueSpec||{},s=r.objectElementValidators||{},a=r.style,h=r.styleSpec,u=r.validateSpec,f=[],p=He(i);if(p!=="object")return[new Ee(e,i,`object expected, ${p} found`)];for(let _ in i){let m=_.split(".")[0],w=To(o,m)||o["*"],Q;if(To(s,m))Q=s[m];else if(To(o,m)){if(i[_]===void 0)continue;Q=u}else if(s["*"])Q=s["*"];else{if(!o["*"]){f.push(new Ee(e,i[_],`unknown property "${_}"`));continue}Q=u}f=f.concat(Q({key:(e&&`${e}.`)+_,value:i[_],valueSpec:w,style:a,styleSpec:h,object:i,objectKey:_,validateSpec:u},i))}for(let _ in o)s[_]||o[_].required&&o[_].default===void 0&&i[_]===void 0&&f.push(new Ee(e,i,`missing required property "${_}"`));return f}function Js(r){let e=r.value,i=r.valueSpec,o=r.style,s=r.styleSpec,a=r.key,h=r.arrayElementValidator||r.validateSpec;if(He(e)!=="array")return[new Ee(a,e,`array expected, ${He(e)} found`)];if(i.length&&e.length!==i.length)return[new Ee(a,e,`array length ${i.length} expected, length ${e.length} found`)];let u={type:i.value,values:i.values};s.$version<7&&(u.function=i.function),He(i.value)==="object"&&(u=i.value);let f=[];for(let p=0;p<e.length;p++)f=f.concat(h({array:e,arrayIndex:p,value:e[p],valueSpec:u,validateSpec:r.validateSpec,style:o,styleSpec:s,key:`${a}[${p}]`}));return f}function no(r){let e=r.key,i=r.value,o=r.valueSpec,s=He(i);return s==="number"&&i!=i&&(s="NaN"),s!=="number"?[new Ee(e,i,`number expected, ${s} found`)]:"minimum"in o&&i<o.minimum?[new Ee(e,i,`${i} is less than the minimum value ${o.minimum}`)]:"maximum"in o&&i>o.maximum?[new Ee(e,i,`${i} is greater than the maximum value ${o.maximum}`)]:[]}function qs(r){let e=r.valueSpec,i=Pt(r.value.type),o,s,a,h={},u=i!=="categorical"&&r.value.property===void 0,f=!u,p=He(r.value.stops)==="array"&&He(r.value.stops[0])==="array"&&He(r.value.stops[0][0])==="object",_=Si({key:r.key,value:r.value,valueSpec:r.styleSpec.function,validateSpec:r.validateSpec,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(Q){if(i==="identity")return[new Ee(Q.key,Q.value,'identity function may not have a "stops" property')];let x=[],v=Q.value;return x=x.concat(Js({key:Q.key,value:v,valueSpec:Q.valueSpec,validateSpec:Q.validateSpec,style:Q.style,styleSpec:Q.styleSpec,arrayElementValidator:m})),He(v)==="array"&&v.length===0&&x.push(new Ee(Q.key,v,"array must have at least one stop")),x},default:function(Q){return Q.validateSpec({key:Q.key,value:Q.value,valueSpec:e,validateSpec:Q.validateSpec,style:Q.style,styleSpec:Q.styleSpec})}}});return i==="identity"&&u&&_.push(new Ee(r.key,r.value,'missing required property "property"')),i==="identity"||r.value.stops||_.push(new Ee(r.key,r.value,'missing required property "stops"')),i==="exponential"&&r.valueSpec.expression&&!fa(r.valueSpec)&&_.push(new Ee(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(f&&!to(r.valueSpec)?_.push(new Ee(r.key,r.value,"property functions not supported")):u&&!Xl(r.valueSpec)&&_.push(new Ee(r.key,r.value,"zoom functions not supported"))),i!=="categorical"&&!p||r.value.property!==void 0||_.push(new Ee(r.key,r.value,'"property" property is required')),_;function m(Q){let x=[],v=Q.value,S=Q.key;if(He(v)!=="array")return[new Ee(S,v,`array expected, ${He(v)} found`)];if(v.length!==2)return[new Ee(S,v,`array length 2 expected, length ${v.length} found`)];if(p){if(He(v[0])!=="object")return[new Ee(S,v,`object expected, ${He(v[0])} found`)];if(v[0].zoom===void 0)return[new Ee(S,v,"object stop key must have zoom")];if(v[0].value===void 0)return[new Ee(S,v,"object stop key must have value")];if(a&&a>Pt(v[0].zoom))return[new Ee(S,v[0].zoom,"stop zoom values must appear in ascending order")];Pt(v[0].zoom)!==a&&(a=Pt(v[0].zoom),s=void 0,h={}),x=x.concat(Si({key:`${S}[0]`,value:v[0],valueSpec:{zoom:{}},validateSpec:Q.validateSpec,style:Q.style,styleSpec:Q.styleSpec,objectElementValidators:{zoom:no,value:w}}))}else x=x.concat(w({key:`${S}[0]`,value:v[0],validateSpec:Q.validateSpec,style:Q.style,styleSpec:Q.styleSpec},v));return js(Cn(v[1]))?x.concat([new Ee(`${S}[1]`,v[1],"expressions are not allowed in function stops.")]):x.concat(Q.validateSpec({key:`${S}[1]`,value:v[1],valueSpec:e,validateSpec:Q.validateSpec,style:Q.style,styleSpec:Q.styleSpec}))}function w(Q,x){let v=He(Q.value),S=Pt(Q.value),M=Q.value!==null?Q.value:x;if(o){if(v!==o)return[new Ee(Q.key,M,`${v} stop domain type must match previous stop domain type ${o}`)]}else o=v;if(v!=="number"&&v!=="string"&&v!=="boolean")return[new Ee(Q.key,M,"stop domain value must be a number, string, or boolean")];if(v!=="number"&&i!=="categorical"){let L=`number expected, ${v} found`;return to(e)&&i===void 0&&(L+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ee(Q.key,M,L)]}return i!=="categorical"||v!=="number"||isFinite(S)&&Math.floor(S)===S?i!=="categorical"&&v==="number"&&s!==void 0&&S<s?[new Ee(Q.key,M,"stop domain values must appear in ascending order")]:(s=S,i==="categorical"&&S in h?[new Ee(Q.key,M,"stop domain values must be unique")]:(h[S]=!0,[])):[new Ee(Q.key,M,`integer expected, found ${S}`)]}}function Nr(r){let e=(r.expressionContext==="property"?Hl:Yo)(Cn(r.value),r.valueSpec);if(e.result==="error")return e.value.map((o=>new Ee(`${r.key}${o.key}`,r.value,o.message)));let i=e.value.expression||e.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!i.outputDefined())return[new Ee(r.key,r.value,`Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];if(r.expressionContext==="property"&&r.propertyType==="layout"&&!Oo(i))return[new Ee(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter"&&!Oo(i))return[new Ee(r.key,r.value,'"feature-state" data expressions are not supported with filters.')];if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!Ys(i,["zoom","feature-state"]))return[new Ee(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!zs(i))return[new Ee(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Vo(r){let e=r.key,i=r.value,o=He(i);return o!=="string"?[new Ee(e,i,`color expected, ${o} found`)]:Ve.parse(String(i))?[]:[new Ee(e,i,`color expected, "${i}" found`)]}function wn(r){let e=r.key,i=r.value,o=r.valueSpec,s=[];return Array.isArray(o.values)?o.values.indexOf(Pt(i))===-1&&s.push(new Ee(e,i,`expected one of [${o.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(o.values).indexOf(Pt(i))===-1&&s.push(new Ee(e,i,`expected one of [${Object.keys(o.values).join(", ")}], ${JSON.stringify(i)} found`)),s}function oo(r){return ma(Cn(r.value))?Nr(An({},r,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Wl(r)}function Wl(r){let e=r.value,i=r.key;if(He(e)!=="array")return[new Ee(i,e,`array expected, ${He(e)} found`)];let o=r.styleSpec,s,a=[];if(e.length<1)return[new Ee(i,e,"filter array must have at least 1 element")];switch(a=a.concat(wn({key:`${i}[0]`,value:e[0],valueSpec:o.filter_operator,style:r.style,styleSpec:r.styleSpec})),Pt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Pt(e[1])==="$type"&&a.push(new Ee(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&a.push(new Ee(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(s=He(e[1]),s!=="string"&&a.push(new Ee(`${i}[1]`,e[1],`string expected, ${s} found`)));for(let h=2;h<e.length;h++)s=He(e[h]),Pt(e[1])==="$type"?a=a.concat(wn({key:`${i}[${h}]`,value:e[h],valueSpec:o.geometry_type,style:r.style,styleSpec:r.styleSpec})):s!=="string"&&s!=="number"&&s!=="boolean"&&a.push(new Ee(`${i}[${h}]`,e[h],`string, number, or boolean expected, ${s} found`));break;case"any":case"all":case"none":for(let h=1;h<e.length;h++)a=a.concat(Wl({key:`${i}[${h}]`,value:e[h],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":s=He(e[1]),e.length!==2?a.push(new Ee(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):s!=="string"&&a.push(new Ee(`${i}[1]`,e[1],`string expected, ${s} found`))}return a}function $l(r,e){let i=r.key,o=r.validateSpec,s=r.style,a=r.styleSpec,h=r.value,u=r.objectKey,f=a[`${e}_${r.layerType}`];if(!f)return[];let p=u.match(/^(.*)-transition$/);if(e==="paint"&&p&&f[p[1]]&&f[p[1]].transition)return o({key:i,value:h,valueSpec:a.transition,style:s,styleSpec:a});let _=r.valueSpec||f[u];if(!_)return[new Ee(i,h,`unknown property "${u}"`)];let m;if(He(h)==="string"&&to(_)&&!_.tokens&&(m=/^{([^}]+)}$/.exec(h)))return[new Ee(i,h,`"${u}" does not support interpolation syntax
|
|
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(m[1])} }\`.`)];let w=[];return r.layerType==="symbol"&&u==="text-font"&&Ks(Cn(h))&&Pt(h.type)==="identity"&&w.push(new Ee(i,h,'"text-font" does not support identity functions')),w.concat(o({key:r.key,value:h,valueSpec:_,style:s,styleSpec:a,expressionContext:"property",propertyType:e,propertyKey:u}))}function ec(r){return $l(r,"paint")}function tc(r){return $l(r,"layout")}function ic(r){var e,i;let o=[],s=r.value,a=r.key,h=r.style,u=r.styleSpec;if(He(s)!=="object")return[new Ee(a,s,`object expected, ${He(s)} found`)];s.type||s.ref||o.push(new Ee(a,s,'either "type" or "ref" is required'));let f=Pt(s.type),p=Pt(s.ref);if(s.id){let _=Pt(s.id);for(let m=0;m<r.arrayIndex;m++){let w=h.layers[m];Pt(w.id)===_&&o.push(new Ee(a,s.id,`duplicate layer id "${s.id}", previously used at line ${w.id.__line__}`))}}if("ref"in s){let _;["type","source","source-layer","filter","layout"].forEach((m=>{m in s&&o.push(new Ee(a,s[m],`"${m}" is prohibited for ref layers`))})),h.layers.forEach((m=>{Pt(m.id)===p&&(_=m)})),_?_.ref?o.push(new Ee(a,s.ref,"ref cannot reference another ref layer")):f=Pt(_.type):o.push(new Ee(a,s.ref,`ref layer "${p}" not found`))}else if(f!=="background")if(s.source){let _=h.sources&&h.sources[s.source],m=_&&Pt(_.type);_?m==="vector"&&f==="raster"?o.push(new Ee(a,s.source,`layer "${s.id}" requires a raster source`)):m!=="raster-dem"&&f==="hillshade"||m!=="raster-dem"&&f==="color-relief"?o.push(new Ee(a,s.source,`layer "${s.id}" requires a raster-dem source`)):m==="raster"&&f!=="raster"?o.push(new Ee(a,s.source,`layer "${s.id}" requires a vector source`)):m!=="vector"||s["source-layer"]?m==="raster-dem"&&f!=="hillshade"&&f!=="color-relief"?o.push(new Ee(a,s.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):f!=="line"||!s.paint||!s.paint["line-gradient"]||m==="geojson"&&_.lineMetrics||o.push(new Ee(a,s,`layer "${s.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):o.push(new Ee(a,s,`layer "${s.id}" must specify a "source-layer"`)):o.push(new Ee(a,s.source,`source "${s.source}" not found`))}else o.push(new Ee(a,s,'missing required property "source"'));return f==="raster"&&(!((e=s.paint)===null||e===void 0)&&e.resampling)&&(!((i=s.paint)===null||i===void 0)&&i["raster-resampling"])&&o.push(new Ee(a,s.paint,`layer "${s.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),o=o.concat(Si({key:a,value:s,valueSpec:u.layer,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,objectElementValidators:{"*":()=>[],type:()=>r.validateSpec({key:`${a}.type`,value:s.type,valueSpec:u.layer.type,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,object:s,objectKey:"type"}),filter:oo,layout:_=>Si({layer:s,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":m=>tc(An({layerType:f},m))}}),paint:_=>Si({layer:s,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":m=>ec(An({layerType:f},m))}})}})),o}function zr(r){let e=r.value,i=r.key,o=He(e);return o!=="string"?[new Ee(i,e,`string expected, ${o} found`)]:[]}let Qa={promoteId:function({key:r,value:e}){if(He(e)==="string")return zr({key:r,value:e});{let i=[];for(let o in e)i.push(...zr({key:`${r}.${o}`,value:e[o]}));return i}}};function Ca(r){let e=r.value,i=r.key,o=r.styleSpec,s=r.style,a=r.validateSpec;if(!e.type)return[new Ee(i,e,'"type" is required')];let h=Pt(e.type),u;switch(h){case"vector":case"raster":return u=Si({key:i,value:e,valueSpec:o[`source_${h.replace("-","_")}`],style:r.style,styleSpec:o,objectElementValidators:Qa,validateSpec:a}),u;case"raster-dem":return u=(function(f){var p;let _=(p=f.sourceName)!==null&&p!==void 0?p:"",m=f.value,w=f.styleSpec,Q=w.source_raster_dem,x=f.style,v=[],S=He(m);if(m===void 0)return v;if(S!=="object")return v.push(new Ee("source_raster_dem",m,`object expected, ${S} found`)),v;let M=Pt(m.encoding)==="custom",L=["redFactor","greenFactor","blueFactor","baseShift"],U=f.value.encoding?`"${f.value.encoding}"`:"Default";for(let k in m)!M&&L.includes(k)?v.push(new Ee(k,m[k],`In "${_}": "${k}" is only valid when "encoding" is set to "custom". ${U} encoding found`)):Q[k]?v=v.concat(f.validateSpec({key:k,value:m[k],valueSpec:Q[k],validateSpec:f.validateSpec,style:x,styleSpec:w})):v.push(new Ee(k,m[k],`unknown property "${k}"`));return v})({sourceName:i,value:e,style:r.style,styleSpec:o,validateSpec:a}),u;case"geojson":if(u=Si({key:i,value:e,valueSpec:o.source_geojson,style:s,styleSpec:o,validateSpec:a,objectElementValidators:Qa}),e.cluster)for(let f in e.clusterProperties){let[p,_]=e.clusterProperties[f],m=typeof p=="string"?[p,["accumulated"],["get",f]]:p;u.push(...Nr({key:`${i}.${f}.map`,value:_,expressionContext:"cluster-map"})),u.push(...Nr({key:`${i}.${f}.reduce`,value:m,expressionContext:"cluster-reduce"}))}return u;case"video":return Si({key:i,value:e,valueSpec:o.source_video,style:s,validateSpec:a,styleSpec:o});case"image":return Si({key:i,value:e,valueSpec:o.source_image,style:s,validateSpec:a,styleSpec:o});case"canvas":return[new Ee(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return wn({key:`${i}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function Zo(r){let e=r.value,i=r.styleSpec,o=i.light,s=r.style,a=[],h=He(e);if(e===void 0)return a;if(h!=="object")return a=a.concat([new Ee("light",e,`object expected, ${h} found`)]),a;for(let u in e){let f=u.match(/^(.*)-transition$/);a=a.concat(f&&o[f[1]]&&o[f[1]].transition?r.validateSpec({key:u,value:e[u],valueSpec:i.transition,validateSpec:r.validateSpec,style:s,styleSpec:i}):o[u]?r.validateSpec({key:u,value:e[u],valueSpec:o[u],validateSpec:r.validateSpec,style:s,styleSpec:i}):[new Ee(u,e[u],`unknown property "${u}"`)])}return a}function rc(r){let e=r.value,i=r.styleSpec,o=i.sky,s=r.style,a=He(e);if(e===void 0)return[];if(a!=="object")return[new Ee("sky",e,`object expected, ${a} found`)];let h=[];for(let u in e)h=h.concat(o[u]?r.validateSpec({key:u,value:e[u],valueSpec:o[u],style:s,styleSpec:i}):[new Ee(u,e[u],`unknown property "${u}"`)]);return h}function wa(r){let e=r.value,i=r.styleSpec,o=i.terrain,s=r.style,a=[],h=He(e);if(e===void 0)return a;if(h!=="object")return a=a.concat([new Ee("terrain",e,`object expected, ${h} found`)]),a;for(let u in e)a=a.concat(o[u]?r.validateSpec({key:u,value:e[u],valueSpec:o[u],validateSpec:r.validateSpec,style:s,styleSpec:i}):[new Ee(u,e[u],`unknown property "${u}"`)]);return a}function Ea(r){let e=[],i=r.value,o=r.key;if(Array.isArray(i)){let s=[],a=[];for(let h in i)i[h].id&&s.includes(i[h].id)&&e.push(new Ee(o,i,`all the sprites' ids must be unique, but ${i[h].id} is duplicated`)),s.push(i[h].id),i[h].url&&a.includes(i[h].url)&&e.push(new Ee(o,i,`all the sprites' URLs must be unique, but ${i[h].url} is duplicated`)),a.push(i[h].url),e=e.concat(Si({key:`${o}[${h}]`,value:i[h],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:r.validateSpec}));return e}return zr({key:o,value:i})}function nc(r){return!!r&&r.constructor===Object}function Ho(r){return nc(r.value)?[]:[new Ee(r.key,r.value,`object expected, ${He(r.value)} found`)]}let Ia={"*":()=>[],array:Js,boolean:function(r){let e=r.value,i=r.key,o=He(e);return o!=="boolean"?[new Ee(i,e,`boolean expected, ${o} found`)]:[]},number:no,color:Vo,constants:ql,enum:wn,filter:oo,function:qs,layer:ic,object:Si,source:Ca,light:Zo,sky:rc,terrain:wa,projection:function(r){let e=r.value,i=r.styleSpec,o=i.projection,s=r.style,a=He(e);if(e===void 0)return[];if(a!=="object")return[new Ee("projection",e,`object expected, ${a} found`)];let h=[];for(let u in e)h=h.concat(o[u]?r.validateSpec({key:u,value:e[u],valueSpec:o[u],style:s,styleSpec:i}):[new Ee(u,e[u],`unknown property "${u}"`)]);return h},projectionDefinition:function(r){let e=r.key,i=r.value;i=i instanceof String?i.valueOf():i;let o=He(i);return o!=="array"||(function(s){return Array.isArray(s)&&s.length===3&&typeof s[0]=="string"&&typeof s[1]=="string"&&typeof s[2]=="number"})(i)||(function(s){return!!["interpolate","step","literal"].includes(s[0])})(i)?["array","string"].includes(o)?[]:[new Ee(e,i,`projection expected, invalid type "${o}" found`)]:[new Ee(e,i,`projection expected, invalid array ${JSON.stringify(i)} found`)]},string:zr,formatted:function(r){return zr(r).length===0?[]:Nr(r)},resolvedImage:function(r){return zr(r).length===0?[]:Nr(r)},padding:function(r){let e=r.key,i=r.value;if(He(i)==="array"){if(i.length<1||i.length>4)return[new Ee(e,i,`padding requires 1 to 4 values; ${i.length} values found`)];let o={type:"number"},s=[];for(let a=0;a<i.length;a++)s=s.concat(r.validateSpec({key:`${e}[${a}]`,value:i[a],validateSpec:r.validateSpec,valueSpec:o}));return s}return no({key:e,value:i,valueSpec:{}})},numberArray:function(r){let e=r.key,i=r.value;if(He(i)==="array"){let o={type:"number"};if(i.length<1)return[new Ee(e,i,"array length at least 1 expected, length 0 found")];let s=[];for(let a=0;a<i.length;a++)s=s.concat(r.validateSpec({key:`${e}[${a}]`,value:i[a],validateSpec:r.validateSpec,valueSpec:o}));return s}return no({key:e,value:i,valueSpec:{}})},colorArray:function(r){let e=r.key,i=r.value;if(He(i)==="array"){if(i.length<1)return[new Ee(e,i,"array length at least 1 expected, length 0 found")];let o=[];for(let s=0;s<i.length;s++)o=o.concat(Vo({key:`${e}[${s}]`,value:i[s]}));return o}return Vo({key:e,value:i})},variableAnchorOffsetCollection:function(r){let e=r.key,i=r.value,o=He(i),s=r.styleSpec;if(o!=="array"||i.length<1||i.length%2!=0)return[new Ee(e,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let h=0;h<i.length;h+=2)a=a.concat(wn({key:`${e}[${h}]`,value:i[h],valueSpec:s.layout_symbol["text-anchor"]})),a=a.concat(Js({key:`${e}[${h+1}]`,value:i[h+1],valueSpec:{length:2,value:"number"},validateSpec:r.validateSpec,style:r.style,styleSpec:s}));return a},sprite:Ea,state:Ho,fontFaces:function(r){let e=r.key,i=r.value,o=r.validateSpec,s=r.styleSpec,a=r.style;if(!nc(i))return[new Ee(e,i,`object expected, ${He(i)} found`)];let h=[];for(let u in i){let f=i[u],p=He(f);if(p==="string")h.push(...zr({key:`${e}.${u}`,value:f}));else if(p==="array"){let _={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[m,w]of f.entries())h.push(...Si({key:`${e}.${u}[${m}]`,value:w,valueSpec:_,styleSpec:s,style:a,validateSpec:o}))}else h.push(new Ee(`${e}.${u}`,f,`string or array expected, ${p} found`))}return h}};function Jo(r){let e=r.value,i=r.valueSpec,o=r.styleSpec;return r.validateSpec=Jo,i.expression&&Ks(Pt(e))?qs(r):i.expression&&js(Cn(e))?Nr(r):i.type&&Ia[i.type]?Ia[i.type](r):Si(An({},r,{valueSpec:i.type?o[i.type]:i}))}function so(r){let e=r.value,i=r.key,o=zr(r);return o.length||(e.indexOf("{fontstack}")===-1&&o.push(new Ee(i,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&o.push(new Ee(i,e,'"glyphs" url must include a "{range}" token'))),o}function Zi(r,e=he){let i=[];return i=i.concat(Jo({key:"",value:r,valueSpec:e.$root,styleSpec:e,style:r,validateSpec:Jo,objectElementValidators:{glyphs:so,"*":()=>[]}})),r.constants&&(i=i.concat(ql({key:"constants",value:r.constants}))),oc(i)}function sr(r){return function(e){return r(Object.assign({},e,{validateSpec:Jo}))}}function oc(r){return[].concat(r).sort(((e,i)=>e.line-i.line))}function Ar(r){return function(...e){return oc(r.apply(this,e))}}Zi.source=Ar(sr(Ca)),Zi.sprite=Ar(sr(Ea)),Zi.glyphs=Ar(sr(so)),Zi.light=Ar(sr(Zo)),Zi.sky=Ar(sr(rc)),Zi.terrain=Ar(sr(wa)),Zi.state=Ar(sr(Ho)),Zi.layer=Ar(sr(ic)),Zi.filter=Ar(sr(oo)),Zi.paintProperty=Ar(sr(ec)),Zi.layoutProperty=Ar(sr(tc));let Fh={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"};class Dh{constructor(e,i){this._globalState=i,this.setValue(e)}evaluate(){var e;return(e=this._literalValue)!==null&&e!==void 0?e:this._compiledValue.evaluate({})}setValue(e){if(e==null||e==="visible"||e==="none")return this._literalValue=e==="none"?"none":"visible",this._compiledValue=void 0,void(this._globalStateRefs=new Set);let i=Yo(e,Fh,this._globalState);if(i.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,new Error(i.value.map((o=>`${o.key}: ${o.message}`)).join(", "));this._literalValue=void 0,this._compiledValue=i.value,this._globalStateRefs=io(i.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}}let qo=he,ur=Zi,Ri=ur.light,Wo=ur.sky,sc=ur.paintProperty,Sh=ur.layoutProperty;function Ac(r,e){let i=!1;if(e!=null&&e.length)for(let o of e)r.fire(new Gn(new Error(o.message))),i=!0;return i}class Qr{constructor(e,i,o){let s=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let h=new Int32Array(this.arrayBuffer);e=h[0],this.d=(i=h[1])+2*(o=h[2]);for(let f=0;f<this.d*this.d;f++){let p=h[3+f],_=h[3+f+1];s.push(p===_?null:h.subarray(p,_))}let u=h[3+s.length+1];this.keys=h.subarray(h[3+s.length],u),this.bboxes=h.subarray(u),this.insert=this._insertReadonly}else{this.d=i+2*o;for(let h=0;h<this.d*this.d;h++)s.push([]);this.keys=[],this.bboxes=[]}this.n=i,this.extent=e,this.padding=o,this.scale=i/e,this.uid=0;let a=o/i*e;this.min=-a,this.max=e+a}insert(e,i,o,s,a){this._forEachCell(i,o,s,a,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(i),this.bboxes.push(o),this.bboxes.push(s),this.bboxes.push(a)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,i,o,s,a,h){this.cells[a].push(h)}query(e,i,o,s,a){let h=this.min,u=this.max;if(e<=h&&i<=h&&u<=o&&u<=s&&!a)return[...this.keys];{let f=[];return this._forEachCell(e,i,o,s,this._queryCell,f,{},a),f}}_queryCell(e,i,o,s,a,h,u,f){let p=this.cells[a];if(p!==null){let _=this.keys,m=this.bboxes;for(let w of p)if(u[w]===void 0){let Q=4*w;(f?f(m[Q+0],m[Q+1],m[Q+2],m[Q+3]):e<=m[Q+2]&&i<=m[Q+3]&&o>=m[Q+0]&&s>=m[Q+1])?(u[w]=!0,h.push(_[w])):u[w]=!1}}}_forEachCell(e,i,o,s,a,h,u,f){let p=this._convertToCellCoord(e),_=this._convertToCellCoord(i),m=this._convertToCellCoord(o),w=this._convertToCellCoord(s);for(let Q=p;Q<=m;Q++)for(let x=_;x<=w;x++){let v=this.d*x+Q;if((!f||f(this._convertFromCellCoord(Q),this._convertFromCellCoord(x),this._convertFromCellCoord(Q+1),this._convertFromCellCoord(x+1)))&&a.call(this,e,i,o,s,v,h,u,f))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,i=3+this.cells.length+1+1,o=0;for(let h of this.cells)o+=h.length;let s=new Int32Array(i+o+this.keys.length+this.bboxes.length);s[0]=this.extent,s[1]=this.n,s[2]=this.padding;let a=i;for(let h=0;h<e.length;h++){let u=e[h];s[3+h]=a,s.set(u,a),a+=u.length}return s[3+e.length]=a,s.set(this.keys,a),a+=this.keys.length,s[3+e.length+1]=a,s.set(this.bboxes,a),a+=this.bboxes.length,s.buffer}static serialize(e,i){let o=e.toArrayBuffer();return i&&i.push(o),{buffer:o}}static deserialize(e){return new Qr(e.buffer)}}let dr={};function be(r,e,i={}){if(dr[r])throw new Error(`${r} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:r,writeable:!1}),dr[r]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}be("Object",Object),be("Set",Set),be("TransferableGridIndex",Qr),be("Color",Ve),be("Error",Error),be("AJAXError",kn),be("ResolvedImage",ki),be("StylePropertyFunction",Zs),be("StyleExpression",zo,{omit:["_evaluator"]}),be("ZoomDependentExpression",Vs),be("ZoomConstantExpression",Xs),be("CompoundExpression",Vi,{omit:["_evaluate"]});for(let r in $n)$n[r]._classRegistryKey||be(`Expression_${r}`,$n[r]);function ac(r){var e;return r&&typeof ArrayBuffer!="undefined"&&(r instanceof ArrayBuffer||((e=r.constructor)===null||e===void 0?void 0:e.name)==="ArrayBuffer")}function $o(r){return r.$name||r.constructor._classRegistryKey}function lc(r){return!(function(e){if(e===null||typeof e!="object")return!1;let i=$o(e);return i&&i!=="Object"})(r)&&(r==null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||r instanceof Boolean||r instanceof Number||r instanceof String||r instanceof Date||r instanceof RegExp||r instanceof Blob||r instanceof Error||ac(r)||tn(r)||ArrayBuffer.isView(r)||r instanceof ImageData)}function Cr(r,e){if(lc(r))return(ac(r)||tn(r))&&e&&e.push(r),ArrayBuffer.isView(r)&&e&&e.push(r.buffer),r instanceof ImageData&&e&&e.push(r.data.buffer),r;if(Array.isArray(r)){let a=[];for(let h of r)a.push(Cr(h,e));return a}if(typeof r!="object")throw new Error("can't serialize object of type "+typeof r);let i=$o(r);if(!i)throw new Error(`can't serialize object of unregistered class ${r.constructor.name}`);if(!dr[i])throw new Error(`${i} is not registered.`);let{klass:o}=dr[i],s=o.serialize?o.serialize(r,e):{};if(o.serialize){if(s===(e==null?void 0:e[e.length-1]))throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let a in r){if(!r.hasOwnProperty(a)||dr[i].omit.includes(a))continue;let h=r[a];s[a]=dr[i].shallow.includes(a)?h:Cr(h,e)}r instanceof Error&&(s.message=r.message)}if(s.$name)throw new Error("$name property is reserved for worker serialization logic.");return i!=="Object"&&(s.$name=i),s}function es(r){if(lc(r))return r;if(Array.isArray(r))return r.map(es);if(typeof r!="object")throw new Error("can't deserialize object of type "+typeof r);let e=$o(r)||"Object";if(!dr[e])throw new Error(`can't deserialize unregistered class ${e}`);let{klass:i}=dr[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(r);let o=Object.create(i.prototype);for(let s of Object.keys(r)){if(s==="$name")continue;let a=r[s];o[s]=dr[e].shallow.includes(s)?a:es(a)}return o}class xa{constructor(){this.first=!0}update(e,i){let o=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=o,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=o,!0):(this.lastFloorZoom>o?(this.lastIntegerZoom=o+1,this.lastIntegerZoomTime=i):this.lastFloorZoom<o&&(this.lastIntegerZoom=o,this.lastIntegerZoomTime=i),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=o,!0))}}function Mh(r){return/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(r))}function En(r){return/[\u02EA\u02EB\u1100-\u11FF\u1400-\u167F\u18B0-\u18F5\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303F\u3041-\u3096\u309D-\u30FB\u30FD-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFE4\uDFF0-\uDFF6]|[\uD81C-\uD822\uD83D\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD30-\uDEFB]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83C[\uDC00-\uDE00\uDF00-\uDFFF]|\uD83E[\uDD00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(r))}function cc(r){return/\s/u.test(String.fromCodePoint(r))}function va(r){for(let e of r)if(En(e.codePointAt(0)))return!0;return!1}function Ws(r){for(let e of r)if(!$s(e.codePointAt(0)))return!1;return!0}function hc(r){let e=r.map((i=>{try{return new RegExp(`\\p{sc=${i}}`,"u").source}catch(o){return null}})).filter((i=>i));return new RegExp(e.join("|"),"u")}let ba=hc(["Arab","Dupl","Mong","Ougr","Syrc"]);function $s(r){return!ba.test(String.fromCodePoint(r))}function Fa(r){return!(En(r)||(e=r,/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(e))));var e}let uc=hc(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function Da(r){return uc.test(String.fromCodePoint(r))}function dc(r,e){return!(!e&&Da(r)||/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(r)))}function Sa(r){for(let e of r)if(Da(e.codePointAt(0)))return!0;return!1}let wr=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(r){this.pluginStatus=r.pluginStatus,this.pluginURL=r.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(r){if(wr.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=r.applyArabicShaping,this.processBidirectionalText=r.processBidirectionalText,this.processStyledBidirectionalText=r.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(r,e){return c(this,void 0,void 0,(function*(){if(this.isParsed())return this.getState();if(r.pluginStatus!=="loading")return this.setState(r),r;let i=r.pluginURL,o=new Promise((a=>{this.loadScriptResolve=a}));e(i);let s=new Promise((a=>setTimeout((()=>a()),this.TIMEOUT)));if(yield Promise.race([o,s]),this.isParsed()){let a={pluginStatus:"loaded",pluginURL:i};return this.setState(a),a}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${i}`)}))}};class Bt{constructor(e,i){this.isSupportedScript=gc,this.zoom=e,i?(this.now=i.now||0,this.fadeDuration=i.fadeDuration||0,this.zoomHistory=i.zoomHistory||new xa,this.transition=i.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new xa,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,i=e-Math.floor(e),o=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:i+(1-i)*o}:{fromScale:.5,toScale:1,t:1-(1-o)*i}}}function gc(r){return(function(e,i){for(let o of e)if(!dc(o.codePointAt(0),i))return!1;return!0})(r,wr.getRTLTextPluginStatus()==="loaded")}let eA="-transition";class ts{constructor(e,i,o){this.property=e,this.value=i,this.expression=(function(s,a,h){if(Ks(s))return new Zs(s,a);if(js(s)){let u=Hl(s,a,h);if(u.result==="error")throw new Error(u.value.map((f=>`${f.key}: ${f.message}`)).join(", "));return u.value}{let u=s;return a.type==="color"&&typeof s=="string"?u=Ve.parse(s):a.type!=="padding"||typeof s!="number"&&!Array.isArray(s)?a.type!=="numberArray"||typeof s!="number"&&!Array.isArray(s)?a.type!=="colorArray"||typeof s!="string"&&!Array.isArray(s)?a.type==="variableAnchorOffsetCollection"&&Array.isArray(s)?u=mi.parse(s):a.type==="projectionDefinition"&&typeof s=="string"&&(u=Bi.parse(s)):u=Ne.parse(s):u=Et.parse(s):u=ai.parse(s),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>u}}})(i===void 0?e.specification.default:i,e.specification,o)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,i,o){return this.property.possiblyEvaluate(this,e,i,o)}}class Ma{constructor(e,i){this.property=e,this.value=new ts(e,void 0,i)}transitioned(e,i){return new Ua(this.property,this.value,i,ji({},e.transition,this.transition),e.now)}untransitioned(){return new Ua(this.property,this.value,null,{},0)}}class Ta{constructor(e,i){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=i}hasProperty(e){return e in this._properties.defaultTransitionablePropertyValues}getValue(e){return Oe(this._values[e].value.value)}setValue(e,i){Object.hasOwn(this._values,e)||(this._values[e]=new Ma(this._values[e].property,this._globalState)),this._values[e].value=new ts(this._values[e].property,i===null?void 0:Oe(i),this._globalState)}getTransition(e){return Oe(this._values[e].transition)}setTransition(e,i){Object.hasOwn(this._values,e)||(this._values[e]=new Ma(this._values[e].property,this._globalState)),this._values[e].transition=Oe(i)||void 0}serialize(){let e={};for(let i of Object.keys(this._values)){let o=this.getValue(i);o!==void 0&&(e[i]=o);let s=this.getTransition(i);s!==void 0&&(e[`${i}${eA}`]=s)}return e}transitioned(e,i){let o=new pc(this._properties);for(let s of Object.keys(this._values))o._values[s]=this._values[s].transitioned(e,i._values[s]);return o}untransitioned(){let e=new pc(this._properties);for(let i of Object.keys(this._values))e._values[i]=this._values[i].untransitioned();return e}}class Ua{constructor(e,i,o,s,a){this.property=e,this.value=i,this.begin=a+s.delay||0,this.end=this.begin+s.duration||0,e.specification.transition&&(s.delay||s.duration)&&(this.prior=o)}possiblyEvaluate(e,i,o){let s=e.now||0,a=this.value.possiblyEvaluate(e,i,o),h=this.prior;if(h){if(s>this.end)return this.prior=null,a;if(this.value.isDataDriven())return this.prior=null,a;if(s<this.begin)return h.possiblyEvaluate(e,i,o);{let u=(s-this.begin)/(this.end-this.begin);return this.property.interpolate(h.possiblyEvaluate(e,i,o),a,Mr(u))}}return a}}class pc{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,i,o){let s=new is(this._properties);for(let a of Object.keys(this._values))s._values[a]=this._values[a].possiblyEvaluate(e,i,o);return s}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Th{constructor(e,i){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._globalState=i}hasValue(e){return this._values[e].value!==void 0}hasProperty(e){return e in this._properties.defaultPropertyValues}getValue(e){return Oe(this._values[e].value)}setValue(e,i){this._values[e]=new ts(this._values[e].property,i===null?void 0:Oe(i),this._globalState)}serialize(){let e={};for(let i of Object.keys(this._values)){let o=this.getValue(i);o!==void 0&&(e[i]=o)}return e}possiblyEvaluate(e,i,o){let s=new is(this._properties);for(let a of Object.keys(this._values))s._values[a]=this._values[a].possiblyEvaluate(e,i,o);return s}}class ar{constructor(e,i,o){this.property=e,this.value=i,this.parameters=o}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,i,o,s){return this.property.evaluate(this.value,this.parameters,e,i,o,s)}}class is{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class De{constructor(e){this.specification=e}possiblyEvaluate(e,i){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(i)}interpolate(e,i,o){let s=Pi[this.specification.type];return s?s(e,i,o):e}}class Le{constructor(e,i){this.specification=e,this.overrides=i}possiblyEvaluate(e,i,o,s){return new ar(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(i,null,{},o,s)}:e.expression,i)}interpolate(e,i,o){if(e.value.kind!=="constant"||i.value.kind!=="constant")return e;if(e.value.value===void 0||i.value.value===void 0)return new ar(this,{kind:"constant",value:void 0},e.parameters);let s=Pi[this.specification.type];if(s){let a=s(e.value.value,i.value.value,o);return new ar(this,{kind:"constant",value:a},e.parameters)}return e}evaluate(e,i,o,s,a,h){return e.kind==="constant"?e.value:e.evaluate(i,o,s,a,h)}}class Yr extends Le{possiblyEvaluate(e,i,o,s){if(e.value===void 0)return new ar(this,{kind:"constant",value:void 0},i);if(e.expression.kind==="constant"){let a=e.expression.evaluate(i,null,{},o,s),h=e.property.specification.type==="resolvedImage"&&typeof a!="string"?a.name:a,u=this._calculate(h,h,h,i);return new ar(this,{kind:"constant",value:u},i)}if(e.expression.kind==="camera"){let a=this._calculate(e.expression.evaluate({zoom:i.zoom-1}),e.expression.evaluate({zoom:i.zoom}),e.expression.evaluate({zoom:i.zoom+1}),i);return new ar(this,{kind:"constant",value:a},i)}return new ar(this,e.expression,i)}evaluate(e,i,o,s,a,h){if(e.kind==="source"){let u=e.evaluate(i,o,s,a,h);return this._calculate(u,u,u,i)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(i.zoom)-1},o,s),e.evaluate({zoom:Math.floor(i.zoom)},o,s),e.evaluate({zoom:Math.floor(i.zoom)+1},o,s),i):e.value}_calculate(e,i,o,s){return s.zoom>s.zoomHistory.lastIntegerZoom?{from:e,to:i}:{from:o,to:i}}interpolate(e){return e}}class fc{constructor(e){this.specification=e}possiblyEvaluate(e,i,o,s){if(e.value!==void 0){if(e.expression.kind==="constant"){let a=e.expression.evaluate(i,null,{},o,s);return this._calculate(a,a,a,i)}return this._calculate(e.expression.evaluate(new Bt(Math.floor(i.zoom-1),i)),e.expression.evaluate(new Bt(Math.floor(i.zoom),i)),e.expression.evaluate(new Bt(Math.floor(i.zoom+1),i)),i)}}_calculate(e,i,o,s){return s.zoom>s.zoomHistory.lastIntegerZoom?{from:e,to:i}:{from:o,to:i}}interpolate(e){return e}}class Ao{constructor(e){this.specification=e}possiblyEvaluate(e,i,o,s){return!!e.expression.evaluate(i,null,{},o,s)}interpolate(){return!1}}class _i{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let i in e){let o=e[i];o.specification.overridable&&this.overridableProperties.push(i);let s=this.defaultPropertyValues[i]=new ts(o,void 0,void 0),a=this.defaultTransitionablePropertyValues[i]=new Ma(o,void 0);this.defaultTransitioningPropertyValues[i]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=s.possiblyEvaluate({})}}}be("DataDrivenProperty",Le),be("DataConstantProperty",De),be("CrossFadedDataDrivenProperty",Yr),be("CrossFadedProperty",fc),be("ColorRampProperty",Ao);let mc=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",tA=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?";class Hi extends ys{constructor(e,i,o){if(super(),this.id=e.id,this.type=e.type,this._globalState=o,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=(function(s,a){return new Dh(s,a)})(this.visibility,o),e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=Ko(e.filter,o)),i.layout&&(this._unevaluatedLayout=new Th(i.layout,o)),i.paint)){this._transitionablePaint=new Ta(i.paint,o);for(let s in e.paint)this.setPaintProperty(s,e.paint[s],{validate:!1});for(let s in e.layout)this.setLayoutProperty(s,e.layout[s],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new is(i.paint)}}setFilter(e){this.filter=e,this._featureFilter=Ko(e,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){var i;if(e==="visibility")return this.visibility;if(!((i=this._transitionablePaint)===null||i===void 0)&&i.hasProperty(e))throw new Error(e+mc);if(!this._unevaluatedLayout)throw new Error(`Cannot get layout property "${e}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;for(let i of this._visibilityExpression.getGlobalStateRefs())e.add(i);if(this._unevaluatedLayout)for(let i in this._unevaluatedLayout._values){let o=this._unevaluatedLayout._values[i];for(let s of o.getGlobalStateRefs())e.add(s)}for(let i of this._featureFilter.getGlobalStateRefs())e.add(i);return e}getPaintAffectingGlobalStateRefs(){var e;let i=new globalThis.Map;if(this._transitionablePaint)for(let o in this._transitionablePaint._values){let s=this._transitionablePaint._values[o].value;for(let a of s.getGlobalStateRefs()){let h=(e=i.get(a))!==null&&e!==void 0?e:[];h.push({name:o,value:s.value}),i.set(a,h)}}return i}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,i,o={}){var s;if(e==="visibility")return this.visibility=i,this._visibilityExpression.setValue(i),void this.recalculateVisibility();!((s=this._transitionablePaint)===null||s===void 0)&&s.hasProperty(e)?this.fire(new Gn(new Error(e+mc))):i!=null&&this._validate(Sh,`layers.${this.id}.layout.${e}`,e,i,o)||this._unevaluatedLayout.setValue(e,i)}getPaintProperty(e){var i,o;if(e.endsWith(eA)){let s=e.slice(0,-11);if(s==="visibility"||!((i=this._unevaluatedLayout)===null||i===void 0)&&i.hasProperty(s))throw new Error(e+tA);return this._transitionablePaint.getTransition(s)}if(e==="visibility"||!((o=this._unevaluatedLayout)===null||o===void 0)&&o.hasProperty(e))throw new Error(e+tA);return this._transitionablePaint.getValue(e)}setPaintProperty(e,i,o={}){var s;if(e==="visibility"||!((s=this._unevaluatedLayout)===null||s===void 0)&&s.hasProperty(e))return this.fire(new Gn(new Error(e+tA))),!1;if(i!=null&&this._validate(sc,`layers.${this.id}.paint.${e}`,e,i,o))return!1;if(e.endsWith(eA))return this._transitionablePaint.setTransition(e.slice(0,-11),i||void 0),!1;{let a=this._transitionablePaint._values[e],h=a.property.specification["property-type"]==="cross-faded-data-driven",u=a.value.isDataDriven(),f=a.value;this._transitionablePaint.setValue(e,i),this._handleSpecialPaintPropertyUpdate(e);let p=this._transitionablePaint._values[e].value;return p.isDataDriven()||u||h||this._handleOverridablePaintPropertyUpdate(e,f,p)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,i,o){return!1}isHidden(e=this.minzoom,i=!1){return!!(this.minzoom&&e<(i?Math.floor(this.minzoom):this.minzoom))||!!(this.maxzoom&&e>=this.maxzoom)||this._evaluatedVisibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(e,i){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,i)}serialize(){var e,i;let o={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:(e=this._unevaluatedLayout)===null||e===void 0?void 0:e.serialize(),paint:(i=this._transitionablePaint)===null||i===void 0?void 0:i.serialize()};return this.visibility&&(o.layout||(o.layout={}),o.layout.visibility=this.visibility),en(o,((s,a)=>!(s===void 0||a==="layout"&&!Object.keys(s).length||a==="paint"&&!Object.keys(s).length)))}_validate(e,i,o,s,a={}){return(a==null?void 0:a.validate)!==!1&&Ac(this,e.call(ur,{key:i,layerType:this.type,objectKey:o,value:s,styleSpec:he,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let i=this.paint.get(e);if(i instanceof ar&&to(i.property.specification)&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}}let La;var Uh={get paint(){return La=La||new _i({"raster-opacity":new De(he.paint_raster["raster-opacity"]),"raster-hue-rotate":new De(he.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new De(he.paint_raster["raster-brightness-min"]),"raster-brightness-max":new De(he.paint_raster["raster-brightness-max"]),"raster-saturation":new De(he.paint_raster["raster-saturation"]),"raster-contrast":new De(he.paint_raster["raster-contrast"]),resampling:new De(he.paint_raster.resampling),"raster-resampling":new De(he.paint_raster["raster-resampling"]),"raster-fade-duration":new De(he.paint_raster["raster-fade-duration"])})}};class Lh extends Hi{constructor(e,i){super(e,Uh,i)}}let kh={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class rs{constructor(e,i){this._structArray=e,this._pos1=i*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class It{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,i){return e._trim(),i&&(e.isTransferred=!0,i.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let i=Object.create(this.prototype);return i.arrayBuffer=e.arrayBuffer,i.length=e.length,i.capacity=e.arrayBuffer.byteLength/i.bytesPerElement,i._refreshViews(),i}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let i=this.uint8;this._refreshViews(),i&&this.uint8.set(i)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}}function _t(r,e=1){let i=0,o=0;return{members:r.map((s=>{let a=kh[s.type].BYTES_PER_ELEMENT,h=i=Bc(i,Math.max(e,a)),u=s.components||1;return o=Math.max(o,a),i+=a*u,{name:s.name,type:s.type,components:u,offset:h}})),size:Bc(i,Math.max(o,e)),alignment:e}}function Bc(r,e){return Math.ceil(r/e)*e}class ns extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,i)}emplace(e,i,o){let s=2*e;return this.int16[s+0]=i,this.int16[s+1]=o,e}}ns.prototype.bytesPerElement=4,be("StructArrayLayout2i4",ns);class iA extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o){let s=this.length;return this.resize(s+1),this.emplace(s,e,i,o)}emplace(e,i,o,s){let a=3*e;return this.int16[a+0]=i,this.int16[a+1]=o,this.int16[a+2]=s,e}}iA.prototype.bytesPerElement=6,be("StructArrayLayout3i6",iA);class rA extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,s){let a=this.length;return this.resize(a+1),this.emplace(a,e,i,o,s)}emplace(e,i,o,s,a){let h=4*e;return this.int16[h+0]=i,this.int16[h+1]=o,this.int16[h+2]=s,this.int16[h+3]=a,e}}rA.prototype.bytesPerElement=8,be("StructArrayLayout4i8",rA);class nA extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,s,a,h){let u=this.length;return this.resize(u+1),this.emplace(u,e,i,o,s,a,h)}emplace(e,i,o,s,a,h,u){let f=6*e;return this.int16[f+0]=i,this.int16[f+1]=o,this.int16[f+2]=s,this.int16[f+3]=a,this.int16[f+4]=h,this.int16[f+5]=u,e}}nA.prototype.bytesPerElement=12,be("StructArrayLayout2i4i12",nA);class ka extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,s,a,h){let u=this.length;return this.resize(u+1),this.emplace(u,e,i,o,s,a,h)}emplace(e,i,o,s,a,h,u){let f=4*e,p=8*e;return this.int16[f+0]=i,this.int16[f+1]=o,this.uint8[p+4]=s,this.uint8[p+5]=a,this.uint8[p+6]=h,this.uint8[p+7]=u,e}}ka.prototype.bytesPerElement=8,be("StructArrayLayout2i4ub8",ka);class os extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,i)}emplace(e,i,o){let s=2*e;return this.float32[s+0]=i,this.float32[s+1]=o,e}}os.prototype.bytesPerElement=8,be("StructArrayLayout2f8",os);class Er extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o,s,a,h,u,f,p,_){let m=this.length;return this.resize(m+1),this.emplace(m,e,i,o,s,a,h,u,f,p,_)}emplace(e,i,o,s,a,h,u,f,p,_,m){let w=10*e;return this.uint16[w+0]=i,this.uint16[w+1]=o,this.uint16[w+2]=s,this.uint16[w+3]=a,this.uint16[w+4]=h,this.uint16[w+5]=u,this.uint16[w+6]=f,this.uint16[w+7]=p,this.uint16[w+8]=_,this.uint16[w+9]=m,e}}Er.prototype.bytesPerElement=20,be("StructArrayLayout10ui20",Er);class oA extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o,s,a,h,u,f){let p=this.length;return this.resize(p+1),this.emplace(p,e,i,o,s,a,h,u,f)}emplace(e,i,o,s,a,h,u,f,p){let _=8*e;return this.uint16[_+0]=i,this.uint16[_+1]=o,this.uint16[_+2]=s,this.uint16[_+3]=a,this.uint16[_+4]=h,this.uint16[_+5]=u,this.uint16[_+6]=f,this.uint16[_+7]=p,e}}oA.prototype.bytesPerElement=16,be("StructArrayLayout8ui16",oA);class ss extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o,s,a,h,u,f,p,_,m,w){let Q=this.length;return this.resize(Q+1),this.emplace(Q,e,i,o,s,a,h,u,f,p,_,m,w)}emplace(e,i,o,s,a,h,u,f,p,_,m,w,Q){let x=12*e;return this.int16[x+0]=i,this.int16[x+1]=o,this.int16[x+2]=s,this.int16[x+3]=a,this.uint16[x+4]=h,this.uint16[x+5]=u,this.uint16[x+6]=f,this.uint16[x+7]=p,this.int16[x+8]=_,this.int16[x+9]=m,this.int16[x+10]=w,this.int16[x+11]=Q,e}}ss.prototype.bytesPerElement=24,be("StructArrayLayout4i4ui4i24",ss);class sA extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o){let s=this.length;return this.resize(s+1),this.emplace(s,e,i,o)}emplace(e,i,o,s){let a=3*e;return this.float32[a+0]=i,this.float32[a+1]=o,this.float32[a+2]=s,e}}sA.prototype.bytesPerElement=12,be("StructArrayLayout3f12",sA);class As extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint32[1*e+0]=i,e}}As.prototype.bytesPerElement=4,be("StructArrayLayout1ul4",As);class Pa extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o,s,a,h,u,f,p){let _=this.length;return this.resize(_+1),this.emplace(_,e,i,o,s,a,h,u,f,p)}emplace(e,i,o,s,a,h,u,f,p,_){let m=10*e,w=5*e;return this.int16[m+0]=i,this.int16[m+1]=o,this.int16[m+2]=s,this.int16[m+3]=a,this.int16[m+4]=h,this.int16[m+5]=u,this.uint32[w+3]=f,this.uint16[m+8]=p,this.uint16[m+9]=_,e}}Pa.prototype.bytesPerElement=20,be("StructArrayLayout6i1ul2ui20",Pa);class ao extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,s,a,h){let u=this.length;return this.resize(u+1),this.emplace(u,e,i,o,s,a,h)}emplace(e,i,o,s,a,h,u){let f=6*e;return this.int16[f+0]=i,this.int16[f+1]=o,this.int16[f+2]=s,this.int16[f+3]=a,this.int16[f+4]=h,this.int16[f+5]=u,e}}ao.prototype.bytesPerElement=12,be("StructArrayLayout2i2i2i12",ao);class In extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,s,a){let h=this.length;return this.resize(h+1),this.emplace(h,e,i,o,s,a)}emplace(e,i,o,s,a,h){let u=4*e,f=8*e;return this.float32[u+0]=i,this.float32[u+1]=o,this.float32[u+2]=s,this.int16[f+6]=a,this.int16[f+7]=h,e}}In.prototype.bytesPerElement=16,be("StructArrayLayout2f1f2i16",In);class Ga extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,i,o,s,a,h){let u=this.length;return this.resize(u+1),this.emplace(u,e,i,o,s,a,h)}emplace(e,i,o,s,a,h,u){let f=16*e,p=4*e,_=8*e;return this.uint8[f+0]=i,this.uint8[f+1]=o,this.float32[p+1]=s,this.float32[p+2]=a,this.int16[_+6]=h,this.int16[_+7]=u,e}}Ga.prototype.bytesPerElement=16,be("StructArrayLayout2ub2f2i16",Ga);class as extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o){let s=this.length;return this.resize(s+1),this.emplace(s,e,i,o)}emplace(e,i,o,s){let a=3*e;return this.uint16[a+0]=i,this.uint16[a+1]=o,this.uint16[a+2]=s,e}}as.prototype.bytesPerElement=6,be("StructArrayLayout3ui6",as);class xn extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o,s,a,h,u,f,p,_,m,w,Q,x,v,S,M){let L=this.length;return this.resize(L+1),this.emplace(L,e,i,o,s,a,h,u,f,p,_,m,w,Q,x,v,S,M)}emplace(e,i,o,s,a,h,u,f,p,_,m,w,Q,x,v,S,M,L){let U=24*e,k=12*e,G=48*e;return this.int16[U+0]=i,this.int16[U+1]=o,this.uint16[U+2]=s,this.uint16[U+3]=a,this.uint32[k+2]=h,this.uint32[k+3]=u,this.uint32[k+4]=f,this.uint16[U+10]=p,this.uint16[U+11]=_,this.uint16[U+12]=m,this.float32[k+7]=w,this.float32[k+8]=Q,this.uint8[G+36]=x,this.uint8[G+37]=v,this.uint8[G+38]=S,this.uint32[k+10]=M,this.int16[U+22]=L,e}}xn.prototype.bytesPerElement=48,be("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",xn);class Ra extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o,s,a,h,u,f,p,_,m,w,Q,x,v,S,M,L,U,k,G,O,q,W,oe,ne,ue,fe){let ce=this.length;return this.resize(ce+1),this.emplace(ce,e,i,o,s,a,h,u,f,p,_,m,w,Q,x,v,S,M,L,U,k,G,O,q,W,oe,ne,ue,fe)}emplace(e,i,o,s,a,h,u,f,p,_,m,w,Q,x,v,S,M,L,U,k,G,O,q,W,oe,ne,ue,fe,ce){let re=32*e,_e=16*e;return this.int16[re+0]=i,this.int16[re+1]=o,this.int16[re+2]=s,this.int16[re+3]=a,this.int16[re+4]=h,this.int16[re+5]=u,this.int16[re+6]=f,this.int16[re+7]=p,this.uint16[re+8]=_,this.uint16[re+9]=m,this.uint16[re+10]=w,this.uint16[re+11]=Q,this.uint16[re+12]=x,this.uint16[re+13]=v,this.uint16[re+14]=S,this.uint16[re+15]=M,this.uint16[re+16]=L,this.uint16[re+17]=U,this.uint16[re+18]=k,this.uint16[re+19]=G,this.uint16[re+20]=O,this.uint16[re+21]=q,this.uint16[re+22]=W,this.uint32[_e+12]=oe,this.float32[_e+13]=ne,this.float32[_e+14]=ue,this.uint16[re+30]=fe,this.uint16[re+31]=ce,e}}Ra.prototype.bytesPerElement=64,be("StructArrayLayout8i15ui1ul2f2ui64",Ra);class AA extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.float32[1*e+0]=i,e}}AA.prototype.bytesPerElement=4,be("StructArrayLayout1f4",AA);class aA extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o){let s=this.length;return this.resize(s+1),this.emplace(s,e,i,o)}emplace(e,i,o,s){let a=3*e;return this.uint16[6*e+0]=i,this.float32[a+1]=o,this.float32[a+2]=s,e}}aA.prototype.bytesPerElement=12,be("StructArrayLayout1ui2f12",aA);class Oa extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i,o){let s=this.length;return this.resize(s+1),this.emplace(s,e,i,o)}emplace(e,i,o,s){let a=4*e;return this.uint32[2*e+0]=i,this.uint16[a+2]=o,this.uint16[a+3]=s,e}}Oa.prototype.bytesPerElement=8,be("StructArrayLayout1ul2ui8",Oa);class d extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,i)}emplace(e,i,o){let s=2*e;return this.uint16[s+0]=i,this.uint16[s+1]=o,e}}d.prototype.bytesPerElement=4,be("StructArrayLayout2ui4",d);class t extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let i=this.length;return this.resize(i+1),this.emplace(i,e)}emplace(e,i){return this.uint16[1*e+0]=i,e}}t.prototype.bytesPerElement=2,be("StructArrayLayout1ui2",t);class n extends It{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,i,o,s){let a=this.length;return this.resize(a+1),this.emplace(a,e,i,o,s)}emplace(e,i,o,s,a){let h=4*e;return this.float32[h+0]=i,this.float32[h+1]=o,this.float32[h+2]=s,this.float32[h+3]=a,e}}n.prototype.bytesPerElement=16,be("StructArrayLayout4f16",n);class A extends rs{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new se(this.anchorPointX,this.anchorPointY)}}A.prototype.size=20;class l extends Pa{get(e){return new A(this,e)}}be("CollisionBoxArray",l);class g extends rs{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}g.prototype.size=48;class B extends xn{get(e){return new g(this,e)}}be("PlacedSymbolArray",B);class y extends rs{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}y.prototype.size=64;class C extends Ra{get(e){return new y(this,e)}}be("SymbolInstanceArray",C);class E extends AA{getoffsetX(e){return this.float32[1*e+0]}}be("GlyphOffsetArray",E);class I extends iA{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}be("SymbolLineVertexArray",I);class b extends rs{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}b.prototype.size=12;class F extends aA{get(e){return new b(this,e)}}be("TextAnchorOffsetArray",F);class T extends rs{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}T.prototype.size=8;class P extends Oa{get(e){return new T(this,e)}}be("FeatureIndexArray",P);class R extends ns{}class Y extends ns{}class N extends ns{}class K extends nA{}class H extends ka{}class j extends os{}class z extends Er{}class Z extends oA{}class X extends ss{}class te extends sA{}class Ae extends As{}class ae extends ao{}class Be extends Ga{}class me extends as{}class Fe extends d{}let Ie=_t([{name:"a_pos",components:2,type:"Int16"}],4),{members:ge}=Ie;class ve{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,i,o,s){let a=this.segments[this.segments.length-1];return e>ve.MAX_VERTEX_ARRAY_LENGTH&&ti(`Max vertices per segment is ${ve.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${ve.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+e>ve.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==s?this.createNewSegment(i,o,s):a}createNewSegment(e,i,o){let s={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0,vaos:{}};return o!==void 0&&(s.sortKey=o),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(s),s}getOrCreateLatestSegment(e,i,o){return this.prepareSegment(0,e,i,o)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let i in e.vaos)e.vaos[i].destroy()}static simpleSegment(e,i,o,s){return new ve([{vertexOffset:e,primitiveOffset:i,vertexLength:o,primitiveLength:s,vaos:{},sortKey:0}])}}function Ue(r,e){return 256*(r=fi(Math.floor(r),0,255))+fi(Math.floor(e),0,255)}ve.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,be("SegmentVector",ve);let lt=_t([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),Gt=_t([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var gt,Ot,zt,li={exports:{}},Mt={exports:{}},yi={exports:{}},oi=(function(){if(zt)return li.exports;zt=1;var r=(gt||(gt=1,Mt.exports=function(i,o){var s,a,h,u,f,p,_,m;for(a=i.length-(s=3&i.length),h=o,f=3432918353,p=461845907,m=0;m<a;)_=255&i.charCodeAt(m)|(255&i.charCodeAt(++m))<<8|(255&i.charCodeAt(++m))<<16|(255&i.charCodeAt(++m))<<24,++m,h=27492+(65535&(u=5*(65535&(h=(h^=_=(65535&(_=(_=(65535&_)*f+(((_>>>16)*f&65535)<<16)&4294967295)<<15|_>>>17))*p+(((_>>>16)*p&65535)<<16)&4294967295)<<13|h>>>19))+((5*(h>>>16)&65535)<<16)&4294967295))+((58964+(u>>>16)&65535)<<16);switch(_=0,s){case 3:_^=(255&i.charCodeAt(m+2))<<16;case 2:_^=(255&i.charCodeAt(m+1))<<8;case 1:h^=_=(65535&(_=(_=(65535&(_^=255&i.charCodeAt(m)))*f+(((_>>>16)*f&65535)<<16)&4294967295)<<15|_>>>17))*p+(((_>>>16)*p&65535)<<16)&4294967295}return h^=i.length,h=2246822507*(65535&(h^=h>>>16))+((2246822507*(h>>>16)&65535)<<16)&4294967295,h=3266489909*(65535&(h^=h>>>13))+((3266489909*(h>>>16)&65535)<<16)&4294967295,(h^=h>>>16)>>>0}),Mt.exports),e=(Ot||(Ot=1,yi.exports=function(i,o){for(var s,a=i.length,h=o^a,u=0;a>=4;)s=1540483477*(65535&(s=255&i.charCodeAt(u)|(255&i.charCodeAt(++u))<<8|(255&i.charCodeAt(++u))<<16|(255&i.charCodeAt(++u))<<24))+((1540483477*(s>>>16)&65535)<<16),h=1540483477*(65535&h)+((1540483477*(h>>>16)&65535)<<16)^(s=1540483477*(65535&(s^=s>>>24))+((1540483477*(s>>>16)&65535)<<16)),a-=4,++u;switch(a){case 3:h^=(255&i.charCodeAt(u+2))<<16;case 2:h^=(255&i.charCodeAt(u+1))<<8;case 1:h=1540483477*(65535&(h^=255&i.charCodeAt(u)))+((1540483477*(h>>>16)&65535)<<16)}return h=1540483477*(65535&(h^=h>>>13))+((1540483477*(h>>>16)&65535)<<16),(h^=h>>>15)>>>0}),yi.exports);return li.exports=r,li.exports.murmur3=r,li.exports.murmur2=e,li.exports})(),Ht=Me(oi);class ci{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,i,o,s){this.ids.push(Kr(e)),this.positions.push(i,o,s)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let i=Kr(e),o=0,s=this.ids.length-1;for(;o<s;){let h=o+s>>1;this.ids[h]>=i?s=h:o=h+1}let a=[];for(;this.ids[o]===i;)a.push({index:this.positions[3*o],start:this.positions[3*o+1],end:this.positions[3*o+2]}),o++;return a}static serialize(e,i){let o=new Float64Array(e.ids),s=new Uint32Array(e.positions);return jr(o,s,0,o.length-1),i&&i.push(o.buffer,s.buffer),{ids:o,positions:s}}static deserialize(e){let i=new ci;return i.ids=e.ids,i.positions=e.positions,i.indexed=!0,i}}function Kr(r){let e=+r;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Ht(String(r))}function jr(r,e,i,o){for(;i<o;){let s=r[i+o>>1],a=i-1,h=o+1;for(;;){do a++;while(r[a]<s);do h--;while(r[h]>s);if(a>=h)break;Xr(r,a,h),Xr(e,3*a,3*h),Xr(e,3*a+1,3*h+1),Xr(e,3*a+2,3*h+2)}h-i<o-h?(jr(r,e,i,h),i=h+1):(jr(r,e,h+1,o),o=h)}}function Xr(r,e,i){let o=r[e];r[e]=r[i],r[i]=o}be("FeaturePositionMap",ci);class hi{constructor(e,i){this.gl=e.gl,this.location=i}}class Ir extends hi{constructor(e,i){super(e,i),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class Vr extends hi{constructor(e,i){super(e,i),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class lA extends hi{constructor(e,i){super(e,i),this.current=Ve.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}let gr=new Float32Array(16);function pr(r){return[Ue(255*r.r,255*r.g),Ue(255*r.b,255*r.a)]}class Oi{constructor(e,i,o){this.value=e,this.uniformNames=i.map((s=>`u_${s}`)),this.type=o}setUniform(e,i,o){e.set(o.constantOr(this.value))}getBinding(e,i,o){return this.type==="color"?new lA(e,i):new Ir(e,i)}}class Ji{constructor(e,i){this.uniformNames=i.map((o=>`u_${o}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,i){this.pixelRatioFrom=i.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=i.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,i){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,i.y,i.height,i.width]}setUniform(e,i,o,s){let a=null;s==="u_pattern_to"?a=this.patternTo:s==="u_pattern_from"?a=this.patternFrom:s==="u_dasharray_to"?a=this.dashTo:s==="u_dasharray_from"?a=this.dashFrom:s==="u_pixel_ratio_to"?a=this.pixelRatioTo:s==="u_pixel_ratio_from"&&(a=this.pixelRatioFrom),a!==null&&e.set(a)}getBinding(e,i,o){return o.startsWith("u_pattern")||o.startsWith("u_dasharray_")?new Vr(e,i):new Ir(e,i)}}class xt{constructor(e,i,o,s){this.expression=e,this.type=o,this.maxValue=0,this.paintVertexAttributes=i.map((a=>({name:`a_${a}`,type:"Float32",components:o==="color"?2:1,offset:0}))),this.paintVertexArray=new s}populatePaintArray(e,i,o){let s=this.paintVertexArray.length,a=this.expression.evaluate(new Bt(0,o),i,{},o.canonical,[],o.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(s,e,a)}updatePaintArray(e,i,o,s,a){let h=this.expression.evaluate(new Bt(0,a),o,s);this._setPaintValue(e,i,h)}_setPaintValue(e,i,o){if(this.type==="color"){let s=pr(o);for(let a=e;a<i;a++)this.paintVertexArray.emplace(a,s[0],s[1])}else{for(let s=e;s<i;s++)this.paintVertexArray.emplace(s,o);this.maxValue=Math.max(this.maxValue,Math.abs(o))}}upload(e){var i,o;!((i=this.paintVertexArray)===null||i===void 0)&&i.arrayBuffer.byteLength&&(!((o=this.paintVertexBuffer)===null||o===void 0)&&o.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class yt{constructor(e,i,o,s,a,h){this.expression=e,this.uniformNames=i.map((u=>`u_${u}_t`)),this.type=o,this.useIntegerZoom=s,this.zoom=a,this.maxValue=0,this.paintVertexAttributes=i.map((u=>({name:`a_${u}`,type:"Float32",components:o==="color"?4:2,offset:0}))),this.paintVertexArray=new h}populatePaintArray(e,i,o){let s=this.expression.evaluate(new Bt(this.zoom,o),i,{},o.canonical,[],o.formattedSection),a=this.expression.evaluate(new Bt(this.zoom+1,o),i,{},o.canonical,[],o.formattedSection),h=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(h,e,s,a)}updatePaintArray(e,i,o,s,a){let h=this.expression.evaluate(new Bt(this.zoom,a),o,s),u=this.expression.evaluate(new Bt(this.zoom+1,a),o,s);this._setPaintValue(e,i,h,u)}_setPaintValue(e,i,o,s){if(this.type==="color"){let a=pr(o),h=pr(s);for(let u=e;u<i;u++)this.paintVertexArray.emplace(u,a[0],a[1],h[0],h[1])}else{for(let a=e;a<i;a++)this.paintVertexArray.emplace(a,o,s);this.maxValue=Math.max(this.maxValue,Math.abs(o),Math.abs(s))}}upload(e){var i,o;!((i=this.paintVertexArray)===null||i===void 0)&&i.arrayBuffer.byteLength&&(!((o=this.paintVertexBuffer)===null||o===void 0)&&o.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,i){let o=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,s=fi(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);e.set(s)}getBinding(e,i,o){return new Ir(e,i)}}class Yt{constructor(e,i,o,s,a,h){this.expression=e,this.type=i,this.useIntegerZoom=o,this.zoom=s,this.layerId=h,this.zoomInPaintVertexArray=new a,this.zoomOutPaintVertexArray=new a}populatePaintArray(e,i,o){let s=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(s,e,this.getPositionIds(i),o)}updatePaintArray(e,i,o,s,a){this._setPaintValues(e,i,this.getPositionIds(o),a)}_setPaintValues(e,i,o,s){let a=this.getPositions(s);if(!a||!o)return;let h=a[o.min],u=a[o.mid],f=a[o.max];if(h&&u&&f)for(let p=e;p<i;p++)this.emplace(this.zoomInPaintVertexArray,p,u,h),this.emplace(this.zoomOutPaintVertexArray,p,u,f)}upload(e){var i,o;if(!((i=this.zoomInPaintVertexArray)===null||i===void 0)&&i.arrayBuffer.byteLength&&(!((o=this.zoomOutPaintVertexArray)===null||o===void 0)&&o.arrayBuffer.byteLength)){let s=this.getVertexAttributes();this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,s,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,s,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class vt extends Yt{getPositions(e){return e.imagePositions}getPositionIds(e){var i;return(i=e.patterns)===null||i===void 0?void 0:i[this.layerId]}getVertexAttributes(){return lt.members}emplace(e,i,o,s){e.emplace(i,o.tlbr[0],o.tlbr[1],o.tlbr[2],o.tlbr[3],s.tlbr[0],s.tlbr[1],s.tlbr[2],s.tlbr[3],o.pixelRatio,s.pixelRatio)}}class vn extends Yt{getPositions(e){return e.dashPositions}getPositionIds(e){var i;return(i=e.dashes)===null||i===void 0?void 0:i[this.layerId]}getVertexAttributes(){return Gt.members}emplace(e,i,o,s){e.emplace(i,0,o.y,o.height,o.width,0,s.y,s.height,s.width)}}class cA{constructor(e,i,o){this.binders={},this._buffers=[];let s=[];for(let a in e.paint._values){if(!o(a))continue;let h=e.paint.get(a);if(!(h instanceof ar&&to(h.property.specification)))continue;let u=Na(a,e.type),f=h.value,p=h.property.specification.type,_=h.property.useIntegerZoom,m=h.property.specification["property-type"],w=m==="cross-faded"||m==="cross-faded-data-driven";if(f.kind==="constant")this.binders[a]=w?new Ji(f.value,u):new Oi(f.value,u,p),s.push(`/u_${a}`);else if(f.kind==="source"||w){let Q=_c(a,p,"source");this.binders[a]=w?a==="line-dasharray"?new vn(f,p,_,i,Q,e.id):new vt(f,p,_,i,Q,e.id):new xt(f,u,p,Q),s.push(`/a_${a}`)}else{let Q=_c(a,p,"composite");this.binders[a]=new yt(f,u,p,_,i,Q),s.push(`/z_${a}`)}}this.cacheKey=s.sort().join("")}getMaxValue(e){let i=this.binders[e];return i instanceof xt||i instanceof yt?i.maxValue:0}populatePaintArrays(e,i,o){for(let s in this.binders){let a=this.binders[s];(a instanceof xt||a instanceof yt||a instanceof Yt)&&a.populatePaintArray(e,i,o)}}setConstantPatternPositions(e,i){for(let o in this.binders){let s=this.binders[o];s instanceof Ji&&s.setConstantPatternPositions(e,i)}}setConstantDashPositions(e,i){for(let o in this.binders){let s=this.binders[o];s instanceof Ji&&s.setConstantDashPositions(e,i)}}updatePaintArrays(e,i,o,s,a){let h=!1;for(let u in e){let f=i.getPositions(u);for(let p of f){let _=o.feature(p.index);for(let m in this.binders){let w=this.binders[m];if((w instanceof xt||w instanceof yt||w instanceof Yt)&&w.expression.isStateDependent===!0){let Q=s.paint.get(m);w.expression=Q.value,w.updatePaintArray(p.start,p.end,_,e[u],a),h=!0}}}}return h}defines(){let e=[];for(let i in this.binders){let o=this.binders[i];(o instanceof Oi||o instanceof Ji)&&e.push(...o.uniformNames.map((s=>`#define HAS_UNIFORM_${s}`)))}return e}getBinderAttributes(){let e=[];for(let i in this.binders){let o=this.binders[i];if(o instanceof xt||o instanceof yt)for(let s of o.paintVertexAttributes)e.push(s.name);else if(o instanceof Yt){let s=o.getVertexAttributes();for(let a of s)e.push(a.name)}}return e}getBinderUniforms(){let e=[];for(let i in this.binders){let o=this.binders[i];if(o instanceof Oi||o instanceof Ji||o instanceof yt)for(let s of o.uniformNames)e.push(s)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,i){let o=[];for(let s in this.binders){let a=this.binders[s];if(a instanceof Oi||a instanceof Ji||a instanceof yt){for(let h of a.uniformNames)if(i[h]){let u=a.getBinding(e,i[h],h);o.push({name:h,property:s,binding:u})}}}return o}setUniforms(e,i,o,s){for(let{name:a,property:h,binding:u}of i)this.binders[h].setUniform(u,s,o.get(h),a)}updatePaintBuffers(e){this._buffers=[];for(let i in this.binders){let o=this.binders[i];if(e&&o instanceof Yt){let s=e.fromScale===2?o.zoomInPaintVertexBuffer:o.zoomOutPaintVertexBuffer;s&&this._buffers.push(s)}else(o instanceof xt||o instanceof yt)&&o.paintVertexBuffer&&this._buffers.push(o.paintVertexBuffer)}}upload(e){for(let i in this.binders){let o=this.binders[i];(o instanceof xt||o instanceof yt||o instanceof Yt)&&o.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let i=this.binders[e];(i instanceof xt||i instanceof yt||i instanceof Yt)&&i.destroy()}}}class xr{constructor(e,i,o=()=>!0){this.programConfigurations={};for(let s of e)this.programConfigurations[s.id]=new cA(s,i,o);this.needsUpload=!1,this._featureMap=new ci,this._bufferOffset=0}populatePaintArrays(e,i,o,s){for(let a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(e,i,s);i.id!==void 0&&this._featureMap.add(i.id,o,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,i,o,s){for(let a of o)this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(e,this._featureMap,i,a,s)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let i in this.programConfigurations)this.programConfigurations[i].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Na(r,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[r]||[r.replace(`${e}-`,"").replace(/-/g,"_")]}function _c(r,e,i){let o={color:{source:os,composite:n},number:{source:AA,composite:os}},s=(function(a){return{"line-pattern":{source:z,composite:z},"fill-pattern":{source:z,composite:z},"fill-extrusion-pattern":{source:z,composite:z},"line-dasharray":{source:Z,composite:Z}}[a]})(r);return(s==null?void 0:s[i])||o[e][i]}be("ConstantBinder",Oi),be("CrossFadedConstantBinder",Ji),be("SourceExpressionBinder",xt),be("CrossFadedPatternBinder",vt),be("CrossFadedDasharrayBinder",vn),be("CompositeExpressionBinder",yt),be("ProgramConfiguration",cA,{omit:["_buffers"]}),be("ProgramConfigurationSet",xr);let za=Math.pow(2,14)-1,Zr=-za-1;function Hr(r){let e=Ge/r.extent,i=r.loadGeometry();for(let o of i)for(let s of o){let a=Math.round(s.x*e),h=Math.round(s.y*e);s.x=fi(a,Zr,za),s.y=fi(h,Zr,za),(a<s.x||a>s.x+1||h<s.y||h>s.y+1)&&ti("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return i}function Jr(r,e){return{type:r.type,id:r.id,properties:r.properties,geometry:e?Hr(r):[]}}let Ya=-32768;function Ka(r,e,i,o,s){r.emplaceBack(Ya+8*e+o,Ya+8*i+s)}class hA{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new Y,this.indexArray=new me,this.segments=new ve,this.programConfigurations=new xr(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,o){let s=this.layers[0],a=[],h=null,u=!1,f=s.type==="heatmap";if(s.type==="circle"){let _=s;h=_.layout.get("circle-sort-key"),u=!h.isConstant(),f||(f=_.paint.get("circle-pitch-alignment")==="map")}let p=f?i.subdivisionGranularity.circle:1;for(let{feature:_,id:m,index:w,sourceLayerIndex:Q}of e){let x=this.layers[0]._featureFilter.needGeometry,v=Jr(_,x);if(!this.layers[0]._featureFilter.filter(new Bt(this.zoom),v,o))continue;let S=u?h.evaluate(v,{},o):void 0,M={id:m,properties:_.properties,type:_.type,sourceLayerIndex:Q,index:w,geometry:x?v.geometry:Hr(_),patterns:{},sortKey:S};a.push(M)}u&&a.sort(((_,m)=>_.sortKey-m.sortKey));for(let _ of a){let{geometry:m,index:w,sourceLayerIndex:Q}=_,x=e[w].feature;this.addFeature(_,m,w,o,p),i.featureIndex.insert(x,m,w,Q,this.index)}}update(e,i,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:o})}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ge),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,i,o,s,a=1){let h;switch(a){case 1:h=[0,7];break;case 3:h=[0,2,5,7];break;case 5:h=[0,1,3,4,6,7];break;case 7:h=[0,1,2,3,4,5,6,7];break;default:throw new Error(`Invalid circle bucket granularity: ${a}; valid values are 1, 3, 5, 7.`)}let u=h.length;for(let f of i)for(let p of f){let _=p.x,m=p.y;if(_<0||_>=Ge||m<0||m>=Ge)continue;let w=this.segments.prepareSegment(u*u,this.layoutVertexArray,this.indexArray,e.sortKey),Q=w.vertexLength;for(let x=0;x<u;x++)for(let v=0;v<u;v++)Ka(this.layoutVertexArray,_,m,h[v],h[x]);for(let x=0;x<u-1;x++)for(let v=0;v<u-1;v++){let S=Q+x*u+v,M=Q+(x+1)*u+v;this.indexArray.emplaceBack(S,M+1,S+1),this.indexArray.emplaceBack(S,M,M+1)}w.vertexLength+=u*u,w.primitiveLength+=(u-1)*(u-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{imagePositions:{},canonical:s})}}function uA(r,e){for(let i of r)if(dA(e,i))return!0;for(let i of e)if(dA(r,i))return!0;return Ph(r,e)}function yc(r,e,i){return!!dA(r,e)||Gh(e,r,i)}function $u(r,e){if(r.length===1)return td(e,r[0]);for(let i of e)for(let o of i)if(dA(r,o))return!0;for(let i of r)if(td(e,i))return!0;for(let i of e)if(Ph(r,i))return!0;return!1}function Tp(r,e,i){if(r.length>1){if(Ph(r,e))return!0;for(let o of e)if(Gh(o,r,i))return!0}for(let o of r)if(Gh(o,e,i))return!0;return!1}function Ph(r,e){if(r.length===0||e.length===0)return!1;for(let i=0;i<r.length-1;i++){let o=r[i],s=r[i+1];for(let a=0;a<e.length-1;a++)if(Up(o,s,e[a],e[a+1]))return!0}return!1}function Up(r,e,i,o){return Ui(r,i,o)!==Ui(e,i,o)&&Ui(r,e,i)!==Ui(r,e,o)}function Gh(r,e,i){let o=i*i;if(e.length===1)return r.distSqr(e[0])<o;for(let s=1;s<e.length;s++)if(ed(r,e[s-1],e[s])<o)return!0;return!1}function ed(r,e,i){let o=e.distSqr(i);if(o===0)return r.distSqr(e);let s=((r.x-e.x)*(i.x-e.x)+(r.y-e.y)*(i.y-e.y))/o;return r.distSqr(s<0?e:s>1?i:i.sub(e)._mult(s)._add(e))}function td(r,e){let i,o,s,a=!1;for(let h of r){i=h;for(let u=0,f=i.length-1;u<i.length;f=u++)o=i[u],s=i[f],o.y>e.y!=s.y>e.y&&e.x<(s.x-o.x)*(e.y-o.y)/(s.y-o.y)+o.x&&(a=!a)}return a}function dA(r,e){let i=!1;for(let o=0,s=r.length-1;o<r.length;s=o++){let a=r[o],h=r[s];a.y>e.y!=h.y>e.y&&e.x<(h.x-a.x)*(e.y-a.y)/(h.y-a.y)+a.x&&(i=!i)}return i}function Lp(r,e,i){let o=i[0],s=i[2];if(r.x<o.x&&e.x<o.x||r.x>s.x&&e.x>s.x||r.y<o.y&&e.y<o.y||r.y>s.y&&e.y>s.y)return!1;let a=Ui(r,e,i[0]);return a!==Ui(r,e,i[1])||a!==Ui(r,e,i[2])||a!==Ui(r,e,i[3])}function gA(r,e,i){let o=e.paint.get(r).value;return o.kind==="constant"?o.value:i.programConfigurations.get(e.id).getMaxValue(r)}function Qc(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function Cc(r,e,i,o,s){if(!e[0]&&!e[1])return r;let a=se.convert(e)._mult(s);i==="viewport"&&a._rotate(-o);let h=[];for(let u of r)h.push(u.sub(a));return h}function kp(r){let e=[];for(let i=0;i<r.length;i++){let o=r[i],s=e.at(-1);(i===0||s&&!o.equals(s))&&e.push(o)}return e}function Pp({queryGeometry:r,size:e},i){return yc(r,i,e)}function Gp({queryGeometry:r,size:e,transform:i,unwrappedTileID:o,getElevation:s},a){return yc(r,a,e*(i.projectTileCoordinates(a.x,a.y,o,s).signedDistanceFromCamera/i.cameraToCenterDistance))}function Rp({queryGeometry:r,size:e,transform:i,unwrappedTileID:o,getElevation:s},a){let h=i.projectTileCoordinates(a.x,a.y,o,s).signedDistanceFromCamera,u=e*(i.cameraToCenterDistance/h);return yc(r,Rh(a,i,o,s),u)}function Op({queryGeometry:r,size:e,transform:i,unwrappedTileID:o,getElevation:s},a){return yc(r,Rh(a,i,o,s),e)}function id({queryGeometry:r,size:e,transform:i,unwrappedTileID:o,getElevation:s,pitchAlignment:a="map",pitchScale:h="map"},u){let f=a==="map"?h==="map"?Pp:Gp:h==="map"?Rp:Op,p={queryGeometry:r,size:e,transform:i,unwrappedTileID:o,getElevation:s};for(let _ of u)for(let m of _)if(f(p,m))return!0;return!1}function Rh(r,e,i,o){let s=e.projectTileCoordinates(r.x,r.y,i,o).point;return new se((.5*s.x+.5)*e.width,(.5*-s.y+.5)*e.height)}let rd,nd;be("CircleBucket",hA,{omit:["layers"]});var Np={get paint(){return nd=nd||new _i({"circle-radius":new Le(he.paint_circle["circle-radius"]),"circle-color":new Le(he.paint_circle["circle-color"]),"circle-blur":new Le(he.paint_circle["circle-blur"]),"circle-opacity":new Le(he.paint_circle["circle-opacity"]),"circle-translate":new De(he.paint_circle["circle-translate"]),"circle-translate-anchor":new De(he.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new De(he.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new De(he.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Le(he.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Le(he.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Le(he.paint_circle["circle-stroke-opacity"])})},get layout(){return rd=rd||new _i({"circle-sort-key":new Le(he.layout_circle["circle-sort-key"])})}};class zp extends Hi{constructor(e,i){super(e,Np,i)}createBucket(e){return new hA(e)}queryRadius(e){let i=e;return gA("circle-radius",this,i)+gA("circle-stroke-width",this,i)+Qc(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:o,geometry:s,transform:a,pixelsToTileUnits:h,unwrappedTileID:u,getElevation:f}){let p=Cc(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-a.bearingInRadians,h),_=this.paint.get("circle-radius").evaluate(i,o)+this.paint.get("circle-stroke-width").evaluate(i,o),m=this.paint.get("circle-pitch-scale"),w=this.paint.get("circle-pitch-alignment"),Q,x;return w==="map"?(Q=p,x=_*h):(Q=(function(v,S,M,L){return v.map((U=>Rh(U,S,M,L)))})(p,a,u,f),x=_),id({queryGeometry:Q,size:x,transform:a,unwrappedTileID:u,getElevation:f,pitchAlignment:w,pitchScale:m},s)}}class od extends hA{}let sd;be("HeatmapBucket",od,{omit:["layers"]});var Yp={get paint(){return sd=sd||new _i({"heatmap-radius":new Le(he.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Le(he.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new De(he.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Ao(he.paint_heatmap["heatmap-color"]),"heatmap-opacity":new De(he.paint_heatmap["heatmap-opacity"])})}};function Oh(r,{width:e,height:i},o,s){if(s){if(s instanceof Uint8ClampedArray)s=new Uint8Array(s.buffer);else if(s.length!==e*i*o)throw new RangeError(`mismatched image size. expected: ${s.length} but got: ${e*i*o}`)}else s=new Uint8Array(e*i*o);return r.width=e,r.height=i,r.data=s,r}function Ad(r,{width:e,height:i},o){if(e===r.width&&i===r.height)return;let s=Oh({},{width:e,height:i},o);Nh(r,s,{x:0,y:0},{x:0,y:0},{width:Math.min(r.width,e),height:Math.min(r.height,i)},o),r.width=e,r.height=i,r.data=s.data}function Nh(r,e,i,o,s,a){if(s.width===0||s.height===0)return e;if(s.width>r.width||s.height>r.height||i.x>r.width-s.width||i.y>r.height-s.height)throw new RangeError("out of range source coordinates for image copy");if(s.width>e.width||s.height>e.height||o.x>e.width-s.width||o.y>e.height-s.height)throw new RangeError("out of range destination coordinates for image copy");let h=r.data,u=e.data;if(h===u)throw new Error("srcData equals dstData, so image is already copied");for(let f=0;f<s.height;f++){let p=((i.y+f)*r.width+i.x)*a,_=((o.y+f)*e.width+o.x)*a;for(let m=0;m<s.width*a;m++)u[_+m]=h[p+m]}return e}class ja{constructor(e,i){Oh(this,e,1,i)}resize(e){Ad(this,e,1)}clone(){return new ja({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,o,s,a){Nh(e,i,o,s,a,1)}}class Ni{constructor(e,i){Oh(this,e,4,i)}resize(e){Ad(this,e,4)}replace(e,i){i?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Ni({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,o,s,a){Nh(e,i,o,s,a,4)}setPixel(e,i,o){let s=4*(e*this.width+i);this.data[s+0]=Math.round(255*o.r/o.a),this.data[s+1]=Math.round(255*o.g/o.a),this.data[s+2]=Math.round(255*o.b/o.a),this.data[s+3]=Math.round(255*o.a)}}function ad(r){let e=new Uint8Array(r.length);for(let i=0;i<r.length;i+=4){let o=r[i+3];e[i+0]=Math.round(r[i+0]*o/255),e[i+1]=Math.round(r[i+1]*o/255),e[i+2]=Math.round(r[i+2]*o/255),e[i+3]=o}return e}function ld(r){let e={},i=r.resolution||256,o=r.clips?r.clips.length:1,s=r.image||new Ni({width:i,height:o});if(Math.log(i)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${i}`);let a=(h,u,f)=>{e[r.evaluationKey]=f;let p=r.expression.evaluate(e);s.setPixel(h/4/i,u/4,p)};if(r.clips)for(let h=0,u=0;h<o;++h,u+=4*i)for(let f=0,p=0;f<i;f++,p+=4){let _=f/(i-1),{start:m,end:w}=r.clips[h];a(u,p,m*(1-_)+w*_)}else for(let h=0,u=0;h<i;h++,u+=4)a(0,u,h/(i-1));return s}be("AlphaImage",ja),be("RGBAImage",Ni);let zh="big-fb";class Kp extends Hi{createBucket(e){return new od(e)}constructor(e,i){super(e,Yp,i),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=ld({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(zh)&&this.heatmapFbos.delete(zh)}queryRadius(e){return gA("heatmap-radius",this,e)}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:o,geometry:s,transform:a,pixelsToTileUnits:h,unwrappedTileID:u,getElevation:f}){return id({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(i,o)*h,transform:a,unwrappedTileID:u,getElevation:f},s)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&!this.isHidden()}}let cd;var jp={get paint(){return cd=cd||new _i({"hillshade-illumination-direction":new De(he.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new De(he.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new De(he.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new De(he.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new De(he.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new De(he.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new De(he.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new De(he.paint_hillshade["hillshade-method"]),resampling:new De(he.paint_hillshade.resampling)})}};class Xp extends Hi{constructor(e,i){super(e,jp,i),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,i=this.paint.get("hillshade-illumination-altitude").values,o=this.paint.get("hillshade-highlight-color").values,s=this.paint.get("hillshade-shadow-color").values,a=Math.max(e.length,i.length,o.length,s.length);e=e.concat(Array(a-e.length).fill(e.at(-1))),i=i.concat(Array(a-i.length).fill(i.at(-1))),o=o.concat(Array(a-o.length).fill(o.at(-1))),s=s.concat(Array(a-s.length).fill(s.at(-1)));let h=i.map(Lr);return{directionRadians:e.map(Lr),altitudeRadians:h,shadowColor:s,highlightColor:o}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}}let hd;var Vp={get paint(){return hd=hd||new _i({"color-relief-opacity":new De(he["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new Ao(he["paint_color-relief"]["color-relief-color"]),resampling:new De(he["paint_color-relief"].resampling)})}};function ud(r){return"data"in r}class Yh{constructor(e,i,o,s){this.context=e,this.format=o,this.texture=e.gl.createTexture(),this._ownedHandle=this.texture,this.update(i,s)}update(e,i,o){var s;let{width:a,height:h}=e,u=(((s=this.size)===null||s===void 0?void 0:s[0])!==a||this.size[1]!==h)&&!o,{context:f}=this,{gl:p}=f;this.useMipmap=!!(i!=null&&i.useMipmap),p.bindTexture(p.TEXTURE_2D,this.texture),f.pixelStoreUnpackFlipY.set(!1),f.pixelStoreUnpack.set(1);let _=this.format===p.RGBA&&(i==null?void 0:i.premultiply)!==!1;if(u)this.size=[a,h],ud(e)?(f.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(e,_,a,h,p)):(f.pixelStoreUnpackPremultiplyAlpha.set(_),this._uploadDomImage(e,p));else{let{x:m,y:w}=o||{x:0,y:0};ud(e)?(f.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(e,_,m,w,a,h,p)):(f.pixelStoreUnpackPremultiplyAlpha.set(_),this._updateDomImage(e,m,w,p))}this.useMipmap&&this.isSizePowerOfTwo()&&p.generateMipmap(p.TEXTURE_2D),f.pixelStoreUnpackFlipY.setDefault(),f.pixelStoreUnpack.setDefault(),f.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(e,i){i.texImage2D(i.TEXTURE_2D,0,this.format,this.format,i.UNSIGNED_BYTE,e)}_uploadRawData(e,i,o,s,a){let{data:h}=e;i&&h&&(h=ad(h)),a.texImage2D(a.TEXTURE_2D,0,this.format,o,s,0,this.format,a.UNSIGNED_BYTE,h)}_updateDomImage(e,i,o,s){s.texSubImage2D(s.TEXTURE_2D,0,i,o,s.RGBA,s.UNSIGNED_BYTE,e)}_updateRawData(e,i,o,s,a,h,u){let{data:f}=e;i&&f&&(f=ad(f)),u.texSubImage2D(u.TEXTURE_2D,0,o,s,a,h,u.RGBA,u.UNSIGNED_BYTE,f)}bind(e,i,o){let{context:s}=this,{gl:a}=s;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),a.bindTexture(a.TEXTURE_2D,this.texture),o!==a.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(o=a.LINEAR),e!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,o||e),this.filter=e),i!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,i),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,i),this.wrap=i)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}}class dd{constructor(e,i,o,s=1,a=1,h=1,u=0){if(this.uid=e,i.height!==i.width)throw new RangeError("DEM tiles must be square");if(o&&!["mapbox","terrarium","custom"].includes(o))return void ti(`"${o}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=i.height;let f=this.dim=i.height-2;switch(this.data=new Uint32Array(i.data.buffer),o){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=s,this.greenFactor=a,this.blueFactor=h,this.baseShift=u;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let p=0;p<f;p++)this.data[this._idx(-1,p)]=this.data[this._idx(0,p)],this.data[this._idx(f,p)]=this.data[this._idx(f-1,p)],this.data[this._idx(p,-1)]=this.data[this._idx(p,0)],this.data[this._idx(p,f)]=this.data[this._idx(p,f-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(f,-1)]=this.data[this._idx(f-1,0)],this.data[this._idx(-1,f)]=this.data[this._idx(0,f-1)],this.data[this._idx(f,f)]=this.data[this._idx(f-1,f-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let p=0;p<f;p++)for(let _=0;_<f;_++){let m=this.get(p,_);m>this.max&&(this.max=m),m<this.min&&(this.min=m)}}get(e,i){let o=new Uint8Array(this.data.buffer),s=4*this._idx(e,i);return this.unpack(o[s],o[s+1],o[s+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,i){if(e<-1||e>=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${i}, dim: ${this.dim}`);return(i+1)*this.stride+(e+1)}unpack(e,i,o){return e*this.redFactor+i*this.greenFactor+o*this.blueFactor-this.baseShift}pack(e){return gd(e,this.getUnpackVector())}getPixels(){return new Ni({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,i,o){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let s=i*this.dim,a=i*this.dim+this.dim,h=o*this.dim,u=o*this.dim+this.dim;switch(i){case-1:s=a-1;break;case 1:a=s+1}switch(o){case-1:h=u-1;break;case 1:u=h+1}let f=-i*this.dim,p=-o*this.dim;for(let _=h;_<u;_++)for(let m=s;m<a;m++)this.data[this._idx(m,_)]=e.data[this._idx(m+f,_+p)]}}function gd(r,e){let i=e[0],o=e[1],s=e[2],a=e[3],h=Math.min(i,o,s),u=Math.round((r+a)/h);return{r:Math.floor(u*h/i)%256,g:Math.floor(u*h/o)%256,b:Math.floor(u*h/s)%256}}be("DEMData",dd);class Zp extends Hi{constructor(e,i){super(e,Vp,i)}_createColorRamp(e){let i={elevationStops:[],colorStops:[]},o=this._transitionablePaint._values["color-relief-color"].value.expression;if(o instanceof Xs&&o._styleExpression.expression instanceof Rt){this.colorRampExpression=o;let h=o._styleExpression.expression;i.elevationStops=h.labels,i.colorStops=[];for(let u of i.elevationStops)i.colorStops.push(h.evaluate({globals:{elevation:u}}))}if(i.elevationStops.length<1&&(i.elevationStops=[0],i.colorStops=[Ve.transparent]),i.elevationStops.length<2&&(i.elevationStops.push(i.elevationStops[0]+1),i.colorStops.push(i.colorStops[0])),i.elevationStops.length<=e)return i;let s={elevationStops:[],colorStops:[]},a=(i.elevationStops.length-1)/(e-1);for(let h=0;h<i.elevationStops.length-.5;h+=a)s.elevationStops.push(i.elevationStops[Math.round(h)]),s.colorStops.push(i.colorStops[Math.round(h)]);return ti(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${e}, provided: ${i.elevationStops.length}`),s}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(e,i,o){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let s=this._createColorRamp(i),a=new Ni({width:s.colorStops.length,height:1}),h=new Ni({width:s.colorStops.length,height:1});for(let u=0;u<s.elevationStops.length;u++){let f=gd(s.elevationStops[u],o);h.setPixel(0,u,new Ve(f.r/255,f.g/255,f.b/255,1)),a.setPixel(0,u,s.colorStops[u])}return this.colorRampTextures={elevationTexture:new Yh(e,h,e.gl.RGBA),colorTexture:new Yh(e,a,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}}let Hp=_t([{name:"a_pos",components:2,type:"Int16"}],4),{members:Jp}=Hp;function wc(r,e,i){let o=i.patternDependencies,s=!1;for(let a of e){let h=a.paint.get(`${r}-pattern`);h.isConstant()||(s=!0);let u=h.constantOr(null);u&&(s=!0,o[u.to]=!0,o[u.from]=!0)}return s}function Kh(r,e,i,o,s){let{zoom:a}=o,h=s.patternDependencies;for(let u of e){let f=u.paint.get(`${r}-pattern`).value;if(f.kind!=="constant"){let p=f.evaluate({zoom:a-1},i,{},s.availableImages),_=f.evaluate({zoom:a},i,{},s.availableImages),m=f.evaluate({zoom:a+1},i,{},s.availableImages);p=p!=null&&p.name?p.name:p,_=_!=null&&_.name?_.name:_,m=m!=null&&m.name?m.name:m,h[p]=!0,h[_]=!0,h[m]=!0,i.patterns[u.id]={min:p,mid:_,max:m}}}return i}function pd(r,e,i,o,s){let a;if(s===(function(h,u,f,p){let _=0;for(let m=u,w=f-p;m<f;m+=p)_+=(h[w]-h[m])*(h[m+1]+h[w+1]),w=m;return _})(r,e,i,o)>0)for(let h=e;h<i;h+=o)a=_d(h/o|0,r[h],r[h+1],a);else for(let h=i-o;h>=e;h-=o)a=_d(h/o|0,r[h],r[h+1],a);return a&&pA(a,a.next)&&(Ha(a),a=a.next),a}function ls(r,e){if(!r)return r;e||(e=r);let i,o=r;do if(i=!1,o.steiner||!pA(o,o.next)&&Nt(o.prev,o,o.next)!==0)o=o.next;else{if(Ha(o),o=e=o.prev,o===o.next)break;i=!0}while(i||o!==e);return e}function Xa(r,e,i,o,s,a,h){if(!r)return;!h&&a&&(function(f,p,_,m){let w=f;do w.z===0&&(w.z=jh(w.x,w.y,p,_,m)),w.prevZ=w.prev,w.nextZ=w.next,w=w.next;while(w!==f);w.prevZ.nextZ=null,w.prevZ=null,(function(Q){let x,v=1;do{let S,M=Q;Q=null;let L=null;for(x=0;M;){x++;let U=M,k=0;for(let O=0;O<v&&(k++,U=U.nextZ,U);O++);let G=v;for(;k>0||G>0&&U;)k!==0&&(G===0||!U||M.z<=U.z)?(S=M,M=M.nextZ,k--):(S=U,U=U.nextZ,G--),L?L.nextZ=S:Q=S,S.prevZ=L,L=S;M=U}L.nextZ=null,v*=2}while(x>1)})(w)})(r,o,s,a);let u=r;for(;r.prev!==r.next;){let f=r.prev,p=r.next;if(a?Wp(r,o,s,a):qp(r))e.push(f.i,r.i,p.i),Ha(r),r=p.next,u=p.next;else if((r=p)===u){h?h===1?Xa(r=$p(ls(r),e),e,i,o,s,a,2):h===2&&ef(r,e,i,o,s,a):Xa(ls(r),e,i,o,s,a,1);break}}}function qp(r){let e=r.prev,i=r,o=r.next;if(Nt(e,i,o)>=0)return!1;let s=e.x,a=i.x,h=o.x,u=e.y,f=i.y,p=o.y,_=Math.min(s,a,h),m=Math.min(u,f,p),w=Math.max(s,a,h),Q=Math.max(u,f,p),x=o.next;for(;x!==e;){if(x.x>=_&&x.x<=w&&x.y>=m&&x.y<=Q&&Va(s,u,a,f,h,p,x.x,x.y)&&Nt(x.prev,x,x.next)>=0)return!1;x=x.next}return!0}function Wp(r,e,i,o){let s=r.prev,a=r,h=r.next;if(Nt(s,a,h)>=0)return!1;let u=s.x,f=a.x,p=h.x,_=s.y,m=a.y,w=h.y,Q=Math.min(u,f,p),x=Math.min(_,m,w),v=Math.max(u,f,p),S=Math.max(_,m,w),M=jh(Q,x,e,i,o),L=jh(v,S,e,i,o),U=r.prevZ,k=r.nextZ;for(;U&&U.z>=M&&k&&k.z<=L;){if(U.x>=Q&&U.x<=v&&U.y>=x&&U.y<=S&&U!==s&&U!==h&&Va(u,_,f,m,p,w,U.x,U.y)&&Nt(U.prev,U,U.next)>=0||(U=U.prevZ,k.x>=Q&&k.x<=v&&k.y>=x&&k.y<=S&&k!==s&&k!==h&&Va(u,_,f,m,p,w,k.x,k.y)&&Nt(k.prev,k,k.next)>=0))return!1;k=k.nextZ}for(;U&&U.z>=M;){if(U.x>=Q&&U.x<=v&&U.y>=x&&U.y<=S&&U!==s&&U!==h&&Va(u,_,f,m,p,w,U.x,U.y)&&Nt(U.prev,U,U.next)>=0)return!1;U=U.prevZ}for(;k&&k.z<=L;){if(k.x>=Q&&k.x<=v&&k.y>=x&&k.y<=S&&k!==s&&k!==h&&Va(u,_,f,m,p,w,k.x,k.y)&&Nt(k.prev,k,k.next)>=0)return!1;k=k.nextZ}return!0}function $p(r,e){let i=r;do{let o=i.prev,s=i.next.next;!pA(o,s)&&md(o,i,i.next,s)&&Za(o,s)&&Za(s,o)&&(e.push(o.i,i.i,s.i),Ha(i),Ha(i.next),i=r=s),i=i.next}while(i!==r);return ls(i)}function ef(r,e,i,o,s,a){let h=r;do{let u=h.next.next;for(;u!==h.prev;){if(h.i!==u.i&&sf(h,u)){let f=Bd(h,u);return h=ls(h,h.next),f=ls(f,f.next),Xa(h,e,i,o,s,a,0),void Xa(f,e,i,o,s,a,0)}u=u.next}h=h.next}while(h!==r)}function tf(r,e){let i=r.x-e.x;return i===0&&(i=r.y-e.y,i===0)&&(i=(r.next.y-r.y)/(r.next.x-r.x)-(e.next.y-e.y)/(e.next.x-e.x)),i}function rf(r,e){let i=(function(s,a){let h=a,u=s.x,f=s.y,p,_=-1/0;if(pA(s,h))return h;do{if(pA(s,h.next))return h.next;if(f<=h.y&&f>=h.next.y&&h.next.y!==h.y){let v=h.x+(f-h.y)*(h.next.x-h.x)/(h.next.y-h.y);if(v<=u&&v>_&&(_=v,p=h.x<h.next.x?h:h.next,v===u))return p}h=h.next}while(h!==a);if(!p)return null;let m=p,w=p.x,Q=p.y,x=1/0;h=p;do{if(u>=h.x&&h.x>=w&&u!==h.x&&fd(f<Q?u:_,f,w,Q,f<Q?_:u,f,h.x,h.y)){let v=Math.abs(f-h.y)/(u-h.x);Za(h,s)&&(v<x||v===x&&(h.x>p.x||h.x===p.x&&nf(p,h)))&&(p=h,x=v)}h=h.next}while(h!==m);return p})(r,e);if(!i)return e;let o=Bd(i,r);return ls(o,o.next),ls(i,i.next)}function nf(r,e){return Nt(r.prev,r,e.prev)<0&&Nt(e.next,r,r.next)<0}function jh(r,e,i,o,s){return(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-i)*s|0)|r<<8))|r<<4))|r<<2))|r<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-o)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function of(r){let e=r,i=r;do(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next;while(e!==r);return i}function fd(r,e,i,o,s,a,h,u){return(s-h)*(e-u)>=(r-h)*(a-u)&&(r-h)*(o-u)>=(i-h)*(e-u)&&(i-h)*(a-u)>=(s-h)*(o-u)}function Va(r,e,i,o,s,a,h,u){return!(r===h&&e===u)&&fd(r,e,i,o,s,a,h,u)}function sf(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!(function(i,o){let s=i;do{if(s.i!==i.i&&s.next.i!==i.i&&s.i!==o.i&&s.next.i!==o.i&&md(s,s.next,i,o))return!0;s=s.next}while(s!==i);return!1})(r,e)&&(Za(r,e)&&Za(e,r)&&(function(i,o){let s=i,a=!1,h=(i.x+o.x)/2,u=(i.y+o.y)/2;do s.y>u!=s.next.y>u&&s.next.y!==s.y&&h<(s.next.x-s.x)*(u-s.y)/(s.next.y-s.y)+s.x&&(a=!a),s=s.next;while(s!==i);return a})(r,e)&&(Nt(r.prev,r,e.prev)||Nt(r,e.prev,e))||pA(r,e)&&Nt(r.prev,r,r.next)>0&&Nt(e.prev,e,e.next)>0)}function Nt(r,e,i){return(e.y-r.y)*(i.x-e.x)-(e.x-r.x)*(i.y-e.y)}function pA(r,e){return r.x===e.x&&r.y===e.y}function md(r,e,i,o){let s=Ic(Nt(r,e,i)),a=Ic(Nt(r,e,o)),h=Ic(Nt(i,o,r)),u=Ic(Nt(i,o,e));return s!==a&&h!==u||!(s!==0||!Ec(r,i,e))||!(a!==0||!Ec(r,o,e))||!(h!==0||!Ec(i,r,o))||!(u!==0||!Ec(i,e,o))}function Ec(r,e,i){return e.x<=Math.max(r.x,i.x)&&e.x>=Math.min(r.x,i.x)&&e.y<=Math.max(r.y,i.y)&&e.y>=Math.min(r.y,i.y)}function Ic(r){return r>0?1:r<0?-1:0}function Za(r,e){return Nt(r.prev,r,r.next)<0?Nt(r,e,r.next)>=0&&Nt(r,r.prev,e)>=0:Nt(r,e,r.prev)<0||Nt(r,r.next,e)<0}function Bd(r,e){let i=Xh(r.i,r.x,r.y),o=Xh(e.i,e.x,e.y),s=r.next,a=e.prev;return r.next=e,e.prev=r,i.next=s,s.prev=i,o.next=i,i.prev=o,a.next=o,o.prev=a,o}function _d(r,e,i,o){let s=Xh(r,e,i);return o?(s.next=o.next,s.prev=o,o.next.prev=s,o.next=s):(s.prev=s,s.next=s),s}function Ha(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Xh(r,e,i){return{i:r,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class fA{constructor(e,i){if(i>e)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=i}getGranularityForZoomLevel(e){return Math.max(Math.floor(this._baseZoomGranularity/(1<<e)),this._minGranularity,1)}}class xc{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}}xc.noSubdivision=new xc({fill:new fA(0,0),line:new fA(0,0),tile:new fA(0,0),stencil:new fA(0,0),circle:1}),be("SubdivisionGranularityExpression",fA),be("SubdivisionGranularitySetting",xc);let mA=-32768,Ja=32767;class Af{constructor(e,i){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=e,this._granularityCellSize=Ge/e,this._canonical=i}_getKey(e,i){return(e+=32768)<<16|i+32768}_vertexToIndex(e,i){if(e<-32768||i<-32768||e>32767||i>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");let o=0|Math.round(e),s=0|Math.round(i),a=this._getKey(o,s);if(this._vertexDictionary.has(a))return this._vertexDictionary.get(a);let h=this._vertexBuffer.length/2;return this._vertexDictionary.set(a,h),this._vertexBuffer.push(o,s),h}_subdivideTrianglesScanline(e){if(this._granularity<2)return(function(s,a){let h=[];for(let u=0;u<a.length;u+=3){let f=a[u],p=a[u+1],_=a[u+2],m=s[2*f],w=s[2*f+1];(s[2*p]-m)*(s[2*_+1]-w)-(s[2*p+1]-w)*(s[2*_]-m)>0?(h.push(f),h.push(_),h.push(p)):(h.push(f),h.push(p),h.push(_))}return h})(this._vertexBuffer,e);let i=[],o=e.length;for(let s=0;s<o;s+=3){let a=[e[s+0],e[s+1],e[s+2]],h=[this._vertexBuffer[2*e[s+0]+0],this._vertexBuffer[2*e[s+0]+1],this._vertexBuffer[2*e[s+1]+0],this._vertexBuffer[2*e[s+1]+1],this._vertexBuffer[2*e[s+2]+0],this._vertexBuffer[2*e[s+2]+1]],u=1/0,f=1/0,p=-1/0,_=-1/0;for(let v=0;v<3;v++){let S=h[2*v],M=h[2*v+1];u=Math.min(u,S),p=Math.max(p,S),f=Math.min(f,M),_=Math.max(_,M)}if(u===p||f===_)continue;let m=Math.floor(u/this._granularityCellSize),w=Math.ceil(p/this._granularityCellSize),Q=Math.floor(f/this._granularityCellSize),x=Math.ceil(_/this._granularityCellSize);if(m!==w||Q!==x)for(let v=Q;v<x;v++){let S=this._scanlineGenerateVertexRingForCellRow(v,h,a);af(this._vertexBuffer,S,i)}else i.push(...a)}return i}_scanlineGenerateVertexRingForCellRow(e,i,o){let s=e*this._granularityCellSize,a=s+this._granularityCellSize,h=[];for(let u=0;u<3;u++){let f=i[2*u],p=i[2*u+1],_=i[2*(u+1)%6],m=i[(2*(u+1)+1)%6],w=i[2*(u+2)%6],Q=i[(2*(u+2)+1)%6],x=_-f,v=m-p,S=x===0,M=v===0,L=(s-p)/v,U=(a-p)/v,k=Math.min(L,U),G=Math.max(L,U);if(!M&&(k>=1||G<=0)||M&&(p<s||p>a)){m>=s&&m<=a&&h.push(o[(u+1)%3]);continue}!M&&k>0&&h.push(this._vertexToIndex(f+x*k,p+v*k));let O=f+x*Math.max(k,0),q=f+x*Math.min(G,1);S||this._generateIntraEdgeVertices(h,f,p,_,m,O,q),!M&&G<1&&h.push(this._vertexToIndex(f+x*G,p+v*G)),(M||m>=s&&m<=a)&&h.push(o[(u+1)%3]),!M&&(m<=s||m>=a)&&this._generateInterEdgeVertices(h,f,p,_,m,w,Q,q,s,a)}return h}_generateIntraEdgeVertices(e,i,o,s,a,h,u){let f=s-i,p=a-o,_=p===0,m=_?Math.min(i,s):Math.min(h,u),w=_?Math.max(i,s):Math.max(h,u),Q=Math.floor(m/this._granularityCellSize)+1,x=Math.ceil(w/this._granularityCellSize)-1;if(_?i<s:h<u)for(let v=Q;v<=x;v++){let S=v*this._granularityCellSize;e.push(this._vertexToIndex(S,o+p*(S-i)/f))}else for(let v=x;v>=Q;v--){let S=v*this._granularityCellSize;e.push(this._vertexToIndex(S,o+p*(S-i)/f))}}_generateInterEdgeVertices(e,i,o,s,a,h,u,f,p,_){let m=a-o,w=h-s,Q=u-a,x=(p-a)/Q,v=(_-a)/Q,S=Math.min(x,v),M=Math.max(x,v),L=s+w*S,U=Math.floor(Math.min(L,f)/this._granularityCellSize)+1,k=Math.ceil(Math.max(L,f)/this._granularityCellSize)-1,G=f<L,O=Q===0;if(O&&(u===p||u===_))return;if(O||S>=1||M<=0){let W=o-u,oe=h+(i-h)*Math.min((p-u)/W,(_-u)/W);U=Math.floor(Math.min(oe,f)/this._granularityCellSize)+1,k=Math.ceil(Math.max(oe,f)/this._granularityCellSize)-1,G=f<oe}let q=m>0?_:p;if(G)for(let W=U;W<=k;W++)e.push(this._vertexToIndex(W*this._granularityCellSize,q));else for(let W=k;W>=U;W--)e.push(this._vertexToIndex(W*this._granularityCellSize,q))}_generateOutline(e){let i=[];for(let o of e){let s=cs(o,this._granularity,!0),a=this._pointArrayToIndices(s),h=[];for(let u=1;u<a.length;u++)h.push(a[u-1]),h.push(a[u]);i.push(h)}return i}_handlePoles(e){let i=!1,o=!1;this._canonical&&(this._canonical.y===0&&(i=!0),this._canonical.y===(1<<this._canonical.z)-1&&(o=!0)),(i||o)&&this._fillPoles(e,i,o)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let i=0;i<e.length;i+=2){let o=e[i+1];o===mA&&(e[i+1]=-32767),o===Ja&&(e[i+1]=32766)}}_generatePoleQuad(e,i,o,s,a,h){s>a!=(h===mA)?(e.push(i),e.push(o),e.push(this._vertexToIndex(s,h)),e.push(o),e.push(this._vertexToIndex(a,h)),e.push(this._vertexToIndex(s,h))):(e.push(o),e.push(i),e.push(this._vertexToIndex(s,h)),e.push(this._vertexToIndex(a,h)),e.push(o),e.push(this._vertexToIndex(s,h)))}_fillPoles(e,i,o){let s=this._vertexBuffer,a=Ge,h=e.length;for(let u=2;u<h;u+=3){let f=e[u-2],p=e[u-1],_=e[u],m=s[2*f],w=s[2*f+1],Q=s[2*p],x=s[2*p+1],v=s[2*_],S=s[2*_+1];i&&(w===0&&x===0&&this._generatePoleQuad(e,f,p,m,Q,mA),x===0&&S===0&&this._generatePoleQuad(e,p,_,Q,v,mA),S===0&&w===0&&this._generatePoleQuad(e,_,f,v,m,mA)),o&&(w===a&&x===a&&this._generatePoleQuad(e,f,p,m,Q,Ja),x===a&&S===a&&this._generatePoleQuad(e,p,_,Q,v,Ja),S===a&&w===a&&this._generatePoleQuad(e,_,f,v,m,Ja))}}_initializeVertices(e){for(let i=0;i<e.length;i+=2)this._vertexToIndex(e[i],e[i+1])}subdividePolygonInternal(e,i){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:o,holeIndices:s}=(function(u){let f=[],p=[];for(let _ of u)if(_.length!==0){_!==u[0]&&f.push(p.length/2);for(let m of _)p.push(m.x),p.push(m.y)}return{flattened:p,holeIndices:f}})(e),a;this._initializeVertices(o);try{let u=(function(p,_,m=2){let w=_&&_.length,Q=w?_[0]*m:p.length,x=pd(p,0,Q,m,!0),v=[];if(!x||x.next===x.prev)return v;let S,M,L;if(w&&(x=(function(U,k,G,O){let q=[];for(let W=0,oe=k.length;W<oe;W++){let ne=pd(U,k[W]*O,W<oe-1?k[W+1]*O:U.length,O,!1);ne===ne.next&&(ne.steiner=!0),q.push(of(ne))}q.sort(tf);for(let W=0;W<q.length;W++)G=rf(q[W],G);return G})(p,_,x,m)),p.length>80*m){S=p[0],M=p[1];let U=S,k=M;for(let G=m;G<Q;G+=m){let O=p[G],q=p[G+1];O<S&&(S=O),q<M&&(M=q),O>U&&(U=O),q>k&&(k=q)}L=Math.max(U-S,k-M),L=L!==0?32767/L:0}return Xa(x,v,m,S,M,L,0),v})(o,s),f=this._convertIndices(o,u);a=this._subdivideTrianglesScanline(f)}catch(u){console.error(u)}let h=[];return i&&(h=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(a),{verticesFlattened:this._vertexBuffer,indicesTriangles:a,indicesLineList:h}}_convertIndices(e,i){let o=[];for(let s of i)o.push(this._vertexToIndex(e[2*s],e[2*s+1]));return o}_pointArrayToIndices(e){let i=[];for(let o of e)i.push(this._vertexToIndex(o.x,o.y));return i}}function yd(r,e,i,o=!0){return new Af(i,e).subdividePolygonInternal(r,o)}function cs(r,e,i=!1){if(!r||r.length<1)return[];if(r.length<2)return[];let o=r[0],s=r[r.length-1],a=i&&(o.x!==s.x||o.y!==s.y);if(e<2)return a?[...r,r[0]]:[...r];let h=Math.floor(Ge/e),u=[];u.push(new se(r[0].x,r[0].y));let f=r.length,p=a?f:f-1;for(let _=0;_<p;_++){let m=r[_],w=_<f-1?r[_+1]:r[0],Q=m.x,x=m.y,v=w.x,S=w.y,M=Q!==v,L=x!==S;if(!M&&!L)continue;let U=v-Q,k=S-x,G=Math.abs(U),O=Math.abs(k),q=Q,W=x;for(;;){let ne=U>0?(Math.floor(q/h)+1)*h:(Math.ceil(q/h)-1)*h,ue=k>0?(Math.floor(W/h)+1)*h:(Math.ceil(W/h)-1)*h,fe=Math.abs(q-ne),ce=Math.abs(W-ue),re=Math.abs(q-v),_e=Math.abs(W-S),Qe=M?fe/G:Number.POSITIVE_INFINITY,ye=L?ce/O:Number.POSITIVE_INFINITY;if((re<=fe||!M)&&(_e<=ce||!L))break;if(Qe<ye&&M||!L){q=ne,W+=k*Qe;let Ce=new se(q,Math.round(W));u[u.length-1].x===Ce.x&&u[u.length-1].y===Ce.y||u.push(Ce)}else{q+=U*ye,W=ue;let Ce=new se(Math.round(q),W);u[u.length-1].x===Ce.x&&u[u.length-1].y===Ce.y||u.push(Ce)}}let oe=new se(v,S);u[u.length-1].x===oe.x&&u[u.length-1].y===oe.y||u.push(oe)}return u}function af(r,e,i){if(e.length===0)throw new Error("Subdivision vertex ring is empty.");let o=0,s=r[2*e[0]];for(let f=1;f<e.length;f++){let p=r[2*e[f]];p<s&&(s=p,o=f)}let a=e.length,h=o,u=(h+1)%a;for(;;){let f=h-1>=0?h-1:a-1,p=(u+1)%a,_=r[2*e[f]],m=r[2*e[p]],w=r[2*e[h]],Q=r[2*e[h]+1],x=r[2*e[u]+1],v=!1;if(_<m)v=!0;else if(_>m)v=!1;else{let S=x-Q,M=-(r[2*e[u]]-w),L=Q<x?1:-1;((_-w)*S+(r[2*e[f]+1]-Q)*M)*L>((m-w)*S+(r[2*e[p]+1]-Q)*M)*L&&(v=!0)}if(v){let S=e[f],M=e[h],L=e[u];S!==M&&S!==L&&M!==L&&i.push(L,M,S),h--,h<0&&(h=a-1)}else{let S=e[p],M=e[h],L=e[u];S!==M&&S!==L&&M!==L&&i.push(L,M,S),u++,u>=a&&(u=0)}if(f===p)break}}function Qd(r,e,i,o,s,a,h,u,f){let p=s.length/2,_=h&&u&&f;if(p<ve.MAX_VERTEX_ARRAY_LENGTH){let m=e.prepareSegment(p,i,o),w=m.vertexLength;for(let v=0;v<a.length;v+=3)o.emplaceBack(w+a[v],w+a[v+1],w+a[v+2]);let Q,x;m.vertexLength+=p,m.primitiveLength+=a.length/3,_&&(x=h.prepareSegment(p,i,u),Q=x.vertexLength,x.vertexLength+=p);for(let v=0;v<s.length;v+=2)r(s[v],s[v+1]);if(_)for(let v of f){for(let S=1;S<v.length;S+=2)u.emplaceBack(Q+v[S-1],Q+v[S]);x.primitiveLength+=v.length/2}}else(function(m,w,Q,x,v,S){let M=[];for(let O=0;O<x.length/2;O++)M.push(-1);let L={count:0},U=0,k=m.getOrCreateLatestSegment(w,Q),G=k.vertexLength;for(let O=2;O<v.length;O+=3){let q=v[O-2],W=v[O-1],oe=v[O],ne=M[q]<U,ue=M[W]<U,fe=M[oe]<U;k.vertexLength+((ne?1:0)+(ue?1:0)+(fe?1:0))>ve.MAX_VERTEX_ARRAY_LENGTH&&(k=m.createNewSegment(w,Q),U=L.count,ne=!0,ue=!0,fe=!0,G=0);let ce=qa(M,x,S,L,q,ne,k),re=qa(M,x,S,L,W,ue,k),_e=qa(M,x,S,L,oe,fe,k);Q.emplaceBack(G+ce-U,G+re-U,G+_e-U),k.primitiveLength++}})(e,i,o,s,a,r),_&&(function(m,w,Q,x,v,S){let M=[];for(let O=0;O<x.length/2;O++)M.push(-1);let L={count:0},U=0,k=m.getOrCreateLatestSegment(w,Q),G=k.vertexLength;for(let O of v)for(let q=1;q<O.length;q+=2){let W=O[q-1],oe=O[q],ne=M[W]<U,ue=M[oe]<U;k.vertexLength+((ne?1:0)+(ue?1:0))>ve.MAX_VERTEX_ARRAY_LENGTH&&(k=m.createNewSegment(w,Q),U=L.count,ne=!0,ue=!0,G=0);let fe=qa(M,x,S,L,W,ne,k),ce=qa(M,x,S,L,oe,ue,k);Q.emplaceBack(G+fe-U,G+ce-U),k.primitiveLength++}})(h,i,u,s,f,r),e.forceNewSegmentOnNextPrepare(),h==null||h.forceNewSegmentOnNextPrepare()}function qa(r,e,i,o,s,a,h){if(a){let u=o.count;return i(e[2*s],e[2*s+1]),r[s]=o.count,o.count++,h.vertexLength++,u}return r[s]}class Vh{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new N,this.indexArray=new me,this.indexArray2=new Fe,this.programConfigurations=new xr(e.layers,e.zoom),this.segments=new ve,this.segments2=new ve,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,o){this.hasDependencies=wc("fill",this.layers,i);let s=this.layers[0].layout.get("fill-sort-key"),a=!s.isConstant(),h=[];for(let{feature:u,id:f,index:p,sourceLayerIndex:_}of e){let m=this.layers[0]._featureFilter.needGeometry,w=Jr(u,m);if(!this.layers[0]._featureFilter.filter(new Bt(this.zoom),w,o))continue;let Q=a?s.evaluate(w,{},o,i.availableImages):void 0,x={id:f,properties:u.properties,type:u.type,sourceLayerIndex:_,index:p,geometry:m?w.geometry:Hr(u),patterns:{},sortKey:Q};h.push(x)}a&&h.sort(((u,f)=>u.sortKey-f.sortKey));for(let u of h){let{geometry:f,index:p,sourceLayerIndex:_}=u;if(this.hasDependencies){let m=Kh("fill",this.layers,u,{zoom:this.zoom},i);this.patternFeatures.push(m)}else this.addFeature(u,f,p,o,{},i.subdivisionGranularity);i.featureIndex.insert(e[p].feature,f,p,_,this.index)}}update(e,i,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:o})}addFeatures(e,i,o){for(let s of this.patternFeatures)this.addFeature(s,s.geometry,s.index,i,o,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Jp),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,i,o,s,a,h){for(let u of ks(i,500)){let f=yd(u,s,h.fill.getGranularityForZoomLevel(s.z)),p=this.layoutVertexArray;Qd(((_,m)=>{p.emplaceBack(_,m)}),this.segments,this.layoutVertexArray,this.indexArray,f.verticesFlattened,f.indicesTriangles,this.segments2,this.indexArray2,f.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{imagePositions:a,canonical:s})}}let Cd,wd;be("FillBucket",Vh,{omit:["layers","patternFeatures"]});var lf={get paint(){return wd=wd||new _i({"fill-antialias":new De(he.paint_fill["fill-antialias"]),"fill-opacity":new Le(he.paint_fill["fill-opacity"]),"fill-color":new Le(he.paint_fill["fill-color"]),"fill-outline-color":new Le(he.paint_fill["fill-outline-color"]),"fill-translate":new De(he.paint_fill["fill-translate"]),"fill-translate-anchor":new De(he.paint_fill["fill-translate-anchor"]),"fill-pattern":new Yr(he.paint_fill["fill-pattern"])})},get layout(){return Cd=Cd||new _i({"fill-sort-key":new Le(he.layout_fill["fill-sort-key"])})}};class cf extends Hi{constructor(e,i){super(e,lf,i)}recalculate(e,i){super.recalculate(e,i);let o=this.paint._values["fill-outline-color"];o.value.kind==="constant"&&o.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new Vh(e)}queryRadius(){return Qc(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:i,transform:o,pixelsToTileUnits:s}){return $u(Cc(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-o.bearingInRadians,s),i)}isTileClipped(){return!0}}let hf=_t([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),uf=_t([{name:"a_centroid",components:2,type:"Int16"}],4),{members:df}=hf;class Wa{constructor(e,i,o,s,a){this.properties={},this.extent=o,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=s,this._values=a,e.readFields(gf,this,i)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let i=e.readVarint()+e.pos,o=[],s,a=1,h=0,u=0,f=0;for(;e.pos<i;){if(h<=0){let p=e.readVarint();a=7&p,h=p>>3}if(h--,a===1||a===2)u+=e.readSVarint(),f+=e.readSVarint(),a===1&&(s&&o.push(s),s=[]),s&&s.push(new se(u,f));else{if(a!==7)throw new Error(`unknown command ${a}`);s&&s.push(s[0].clone())}}return s&&o.push(s),o}bbox(){let e=this._pbf;e.pos=this._geometry;let i=e.readVarint()+e.pos,o=1,s=0,a=0,h=0,u=1/0,f=-1/0,p=1/0,_=-1/0;for(;e.pos<i;){if(s<=0){let m=e.readVarint();o=7&m,s=m>>3}if(s--,o===1||o===2)a+=e.readSVarint(),h+=e.readSVarint(),a<u&&(u=a),a>f&&(f=a),h<p&&(p=h),h>_&&(_=h);else if(o!==7)throw new Error(`unknown command ${o}`)}return[u,p,f,_]}toGeoJSON(e,i,o){let s=this.extent*Math.pow(2,o),a=this.extent*e,h=this.extent*i,u=this.loadGeometry();function f(w){return[360*(w.x+a)/s-180,360/Math.PI*Math.atan(Math.exp((1-2*(w.y+h)/s)*Math.PI))-90]}function p(w){return w.map(f)}let _;if(this.type===1){let w=[];for(let x of u)w.push(x[0]);let Q=p(w);_=w.length===1?{type:"Point",coordinates:Q[0]}:{type:"MultiPoint",coordinates:Q}}else if(this.type===2){let w=u.map(p);_=w.length===1?{type:"LineString",coordinates:w[0]}:{type:"MultiLineString",coordinates:w}}else{if(this.type!==3)throw new Error("unknown feature type");{let w=Ed(u),Q=[];for(let x of w)Q.push(x.map(p));_=Q.length===1?{type:"Polygon",coordinates:Q[0]}:{type:"MultiPolygon",coordinates:Q}}}let m={type:"Feature",geometry:_,properties:this.properties};return this.id!=null&&(m.id=this.id),m}}function gf(r,e,i){r===1?e.id=i.readVarint():r===2?(function(o,s){let a=o.readVarint()+o.pos;for(;o.pos<a;){let h=s._keys[o.readVarint()],u=s._values[o.readVarint()];s.properties[h]=u}})(i,e):r===3?e.type=i.readVarint():r===4&&(e._geometry=i.pos)}function Ed(r){let e=r.length;if(e<=1)return[r];let i=[],o,s;for(let a=0;a<e;a++){let h=pf(r[a]);h!==0&&(s===void 0&&(s=h<0),s===h<0?(o&&i.push(o),o=[r[a]]):o&&o.push(r[a]))}return o&&i.push(o),i}function pf(r){let e=0;for(let i,o,s=0,a=r.length,h=a-1;s<a;h=s++)i=r[s],o=r[h],e+=(o.x-i.x)*(i.y+o.y);return e}Wa.types=["Unknown","Point","LineString","Polygon"];class ff{constructor(e,i){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(mf,this,i),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let i=this._pbf.readVarint()+this._pbf.pos;return new Wa(this._pbf,i,this.extent,this._keys,this._values)}}function mf(r,e,i){r===15?e.version=i.readVarint():r===1?e.name=i.readString():r===5?e.extent=i.readVarint():r===2?e._features.push(i.pos):r===3?e._keys.push(i.readString()):r===4&&e._values.push((function(o){let s=null,a=o.readVarint()+o.pos;for(;o.pos<a;){let h=o.readVarint()>>3;s=h===1?o.readString():h===2?o.readFloat():h===3?o.readDouble():h===4?o.readVarint64():h===5?o.readVarint():h===6?o.readSVarint():h===7?o.readBoolean():null}if(s==null)throw new Error("unknown feature value");return s})(i))}class Id{constructor(e,i){this.layers=e.readFields(Bf,{},i)}}function Bf(r,e,i){if(r===3){let o=new ff(i,i.readVarint()+i.pos);o.length&&(e[o.name]=o)}}let Zh=Math.pow(2,13);function $a(r,e,i,o,s,a,h,u){r.emplaceBack(e,i,2*Math.floor(o*Zh)+h,s*Zh*2,a*Zh*2,Math.round(u))}class Hh{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new K,this.centroidVertexArray=new R,this.indexArray=new me,this.programConfigurations=new xr(e.layers,e.zoom),this.segments=new ve,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,o){this.features=[],this.hasDependencies=wc("fill-extrusion",this.layers,i);for(let{feature:s,id:a,index:h,sourceLayerIndex:u}of e){let f=this.layers[0]._featureFilter.needGeometry,p=Jr(s,f);if(!this.layers[0]._featureFilter.filter(new Bt(this.zoom),p,o))continue;let _={id:a,sourceLayerIndex:u,index:h,geometry:f?p.geometry:Hr(s),properties:s.properties,type:s.type,patterns:{}};this.hasDependencies?this.features.push(Kh("fill-extrusion",this.layers,_,{zoom:this.zoom},i)):this.addFeature(_,_.geometry,h,o,{},i.subdivisionGranularity),i.featureIndex.insert(s,_.geometry,h,u,this.index,!0)}}addFeatures(e,i,o){for(let s of this.features){let{geometry:a}=s;this.addFeature(s,a,s.index,i,o,e.subdivisionGranularity)}}update(e,i,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:o})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,df),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,uf.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,i,o,s,a,h){for(let u of ks(i,500)){let f={x:0,y:0,sampleCount:0},p=this.layoutVertexArray.length;this.processPolygon(f,s,e,u,h);let _=this.layoutVertexArray.length-p,m=Math.floor(f.x/f.sampleCount),w=Math.floor(f.y/f.sampleCount);for(let Q=0;Q<_;Q++)this.centroidVertexArray.emplaceBack(m,w)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{imagePositions:a,canonical:s})}processPolygon(e,i,o,s,a){if(s.length<1||xd(s[0]))return;for(let m of s)m.length!==0&&_f(e,m);let h={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},u=a.fill.getGranularityForZoomLevel(i.z),f=Wa.types[o.type]==="Polygon";for(let m of s){if(m.length===0||xd(m))continue;let w=cs(m,u,f);this._generateSideFaces(w,h)}if(!f)return;let p=yd(s,i,u,!1),_=this.layoutVertexArray;Qd(((m,w)=>{$a(_,m,w,0,0,1,1,0)}),this.segments,this.layoutVertexArray,this.indexArray,p.verticesFlattened,p.indicesTriangles)}_generateSideFaces(e,i){let o=0;for(let s=1;s<e.length;s++){let a=e[s],h=e[s-1];if(yf(a,h))continue;i.segment.vertexLength+4>ve.MAX_VERTEX_ARRAY_LENGTH&&(i.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let u=a.sub(h)._perp()._unit(),f=h.dist(a);o+f>32768&&(o=0),$a(this.layoutVertexArray,a.x,a.y,u.x,u.y,0,0,o),$a(this.layoutVertexArray,a.x,a.y,u.x,u.y,0,1,o),o+=f,$a(this.layoutVertexArray,h.x,h.y,u.x,u.y,0,0,o),$a(this.layoutVertexArray,h.x,h.y,u.x,u.y,0,1,o);let p=i.segment.vertexLength;this.indexArray.emplaceBack(p,p+2,p+1),this.indexArray.emplaceBack(p+1,p+2,p+3),i.segment.vertexLength+=4,i.segment.primitiveLength+=2}}}function _f(r,e){for(let i=0;i<e.length;i++){let o=e[i];i===e.length-1&&e[0].x===o.x&&e[0].y===o.y||(r.x+=o.x,r.y+=o.y,r.sampleCount++)}}function yf(r,e){return r.x===e.x&&(r.x<0||r.x>Ge)||r.y===e.y&&(r.y<0||r.y>Ge)}function xd(r){return r.every((e=>e.x<0))||r.every((e=>e.x>Ge))||r.every((e=>e.y<0))||r.every((e=>e.y>Ge))}let vd;be("FillExtrusionBucket",Hh,{omit:["layers","features"]});var Qf={get paint(){return vd=vd||new _i({"fill-extrusion-opacity":new De(he["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Le(he["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new De(he["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new De(he["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Yr(he["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Le(he["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Le(he["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new De(he["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Cf extends Hi{constructor(e,i){super(e,Qf,i)}createBucket(e){return new Hh(e)}queryRadius(){return Qc(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:o,geometry:s,transform:a,pixelsToTileUnits:h,pixelPosMatrix:u}){let f=Cc(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-a.bearingInRadians,h),p=this.paint.get("fill-extrusion-height").evaluate(i,o),_=this.paint.get("fill-extrusion-base").evaluate(i,o),m=(function(Q,x){let v=[];for(let S of Q){let M=[S.x,S.y,0,1];tt(M,M,x),v.push(new se(M[0]/M[3],M[1]/M[3]))}return v})(f,u),w=(function(Q,x,v,S){let M=[],L=[],U=S[8]*x,k=S[9]*x,G=S[10]*x,O=S[11]*x,q=S[8]*v,W=S[9]*v,oe=S[10]*v,ne=S[11]*v;for(let ue of Q){let fe=[],ce=[];for(let re of ue){let _e=re.x,Qe=re.y,ye=S[0]*_e+S[4]*Qe+S[12],Ce=S[1]*_e+S[5]*Qe+S[13],ke=S[2]*_e+S[6]*Qe+S[14],$e=S[3]*_e+S[7]*Qe+S[15],At=ke+G,ut=$e+O,gi=ye+q,Tt=Ce+W,Xt=ke+oe,Wt=$e+ne,wt=new se((ye+U)/ut,(Ce+k)/ut);wt.z=At/ut,fe.push(wt);let Ai=new se(gi/Wt,Tt/Wt);Ai.z=Xt/Wt,ce.push(Ai)}M.push(fe),L.push(ce)}return[M,L]})(s,_,p,u);return(function(Q,x,v){let S=1/0;$u(v,x)&&(S=bd(v,x[0]));for(let M=0;M<x.length;M++){let L=x[M],U=Q[M];for(let k=0;k<L.length-1;k++){let G=L[k],O=[G,L[k+1],U[k+1],U[k],G];uA(v,O)&&(S=Math.min(S,bd(v,O)))}}return S!==1/0&&S})(w[0],w[1],m)}}function el(r,e){return r.x*e.x+r.y*e.y}function bd(r,e){if(r.length===1){let i=0,o=e[i++],s;for(;!s||o.equals(s);)if(s=e[i++],!s)return 1/0;for(;i<e.length;i++){let a=e[i],h=r[0],u=s.sub(o),f=a.sub(o),p=h.sub(o),_=el(u,u),m=el(u,f),w=el(f,f),Q=el(p,u),x=el(p,f),v=_*w-m*m,S=(w*Q-m*x)/v,M=(_*x-m*Q)/v,L=o.z*(1-S-M)+s.z*S+a.z*M;if(isFinite(L))return L}return 1/0}{let i=1/0;for(let o of e)i=Math.min(i,o.z);return i}}let Fd=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class vc{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[i,o]=new Uint8Array(e,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");let s=o>>4;if(s!==1)throw new Error(`Got v${s} data when expected v1.`);let a=Fd[15&o];if(!a)throw new Error("Unrecognized array type.");let[h]=new Uint16Array(e,2,1),[u]=new Uint32Array(e,4,1);return new vc(u,h,a,e)}constructor(e,i=64,o=Float64Array,s){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=o,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let a=Fd.indexOf(this.ArrayType),h=2*e*this.ArrayType.BYTES_PER_ELEMENT,u=e*this.IndexArrayType.BYTES_PER_ELEMENT,f=(8-u%8)%8;if(a<0)throw new Error(`Unexpected typed array class: ${o}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+u+f,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+h+u+f),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+u+f,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+a]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){let o=this._pos>>1;return this.ids[o]=o,this.coords[this._pos++]=e,this.coords[this._pos++]=i,o}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Jh(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,o,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:a,coords:h,nodeSize:u}=this,f=[0,a.length-1,0],p=[];for(;f.length;){let _=f.pop()||0,m=f.pop()||0,w=f.pop()||0;if(m-w<=u){for(let S=w;S<=m;S++){let M=h[2*S],L=h[2*S+1];M>=e&&M<=o&&L>=i&&L<=s&&p.push(a[S])}continue}let Q=w+m>>1,x=h[2*Q],v=h[2*Q+1];x>=e&&x<=o&&v>=i&&v<=s&&p.push(a[Q]),(_===0?e<=x:i<=v)&&(f.push(w),f.push(Q-1),f.push(1-_)),(_===0?o>=x:s>=v)&&(f.push(Q+1),f.push(m),f.push(1-_))}return p}within(e,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:s,coords:a,nodeSize:h}=this,u=[0,s.length-1,0],f=[],p=o*o;for(;u.length;){let _=u.pop()||0,m=u.pop()||0,w=u.pop()||0;if(m-w<=h){for(let S=w;S<=m;S++)Sd(a[2*S],a[2*S+1],e,i)<=p&&f.push(s[S]);continue}let Q=w+m>>1,x=a[2*Q],v=a[2*Q+1];Sd(x,v,e,i)<=p&&f.push(s[Q]),(_===0?e-o<=x:i-o<=v)&&(u.push(w),u.push(Q-1),u.push(1-_)),(_===0?e+o>=x:i+o>=v)&&(u.push(Q+1),u.push(m),u.push(1-_))}return f}}function Jh(r,e,i,o,s,a){if(s-o<=i)return;let h=o+s>>1;Dd(r,e,h,o,s,a),Jh(r,e,i,o,h-1,1-a),Jh(r,e,i,h+1,s,1-a)}function Dd(r,e,i,o,s,a){for(;s>o;){if(s-o>600){let p=s-o+1,_=i-o+1,m=Math.log(p),w=.5*Math.exp(2*m/3),Q=.5*Math.sqrt(m*w*(p-w)/p)*(_-p/2<0?-1:1);Dd(r,e,i,Math.max(o,Math.floor(i-_*w/p+Q)),Math.min(s,Math.floor(i+(p-_)*w/p+Q)),a)}let h=e[2*i+a],u=o,f=s;for(tl(r,e,o,i),e[2*s+a]>h&&tl(r,e,o,s);u<f;){for(tl(r,e,u,f),u++,f--;e[2*u+a]<h;)u++;for(;e[2*f+a]>h;)f--}e[2*o+a]===h?tl(r,e,o,f):(f++,tl(r,e,f,s)),f<=i&&(o=f+1),i<=f&&(s=f-1)}}function tl(r,e,i,o){qh(r,i,o),qh(e,2*i,2*o),qh(e,2*i+1,2*o+1)}function qh(r,e,i){let o=r[e];r[e]=r[i],r[i]=o}function Sd(r,e,i,o){let s=r-i,a=e-o;return s*s+a*a}function Wh(r,e,i,o){let s=o,a=e+(i-e>>1),h,u=i-e,f=r[e],p=r[e+1],_=r[i],m=r[i+1];for(let w=e+3;w<i;w+=3){let Q=wf(r[w],r[w+1],f,p,_,m);if(Q>s)h=w,s=Q;else if(Q===s){let x=Math.abs(w-a);x<u&&(h=w,u=x)}}s>o&&(h-e>3&&Wh(r,e,h,o),r[h+2]=s,i-h>3&&Wh(r,h,i,o))}function wf(r,e,i,o,s,a){let h=s-i,u=a-o;if(h!==0||u!==0){let f=((r-i)*h+(e-o)*u)/(h*h+u*u);f>1?(i=s,o=a):f>0&&(i+=h*f,o+=u*f)}return h=r-i,u=e-o,h*h+u*u}function si(r,e,i,o){let s={type:e,geom:i},a={id:r==null?null:r,type:s.type,geometry:s.geom,tags:o,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(s.type){case"Point":case"MultiPoint":il(a,s.geom);break;case"LineString":il(a,s.geom.points);break;case"Polygon":il(a,s.geom[0].points);break;case"MultiLineString":for(let h of s.geom)il(a,h.points);break;case"MultiPolygon":for(let h of s.geom)il(a,h[0].points)}return a}function $h(r){r.points.length>64&&(r.points=new Float64Array(r.points))}function il(r,e){for(let i=0;i<e.length;i+=3)r.minX=Math.min(r.minX,e[i]),r.minY=Math.min(r.minY,e[i+1]),r.maxX=Math.max(r.maxX,e[i]),r.maxY=Math.max(r.maxY,e[i+1])}function eu(r,e){let i=[];switch(r.type){case"FeatureCollection":for(let o=0;o<r.features.length;o++)bc(i,r.features[o],e,o);break;case"Feature":bc(i,r,e);break;default:bc(i,{geometry:r,properties:void 0},e)}return i}function bc(r,e,i,o){if(!e.geometry)return;if(e.geometry.type==="GeometryCollection")return void(function(u,f,p,_,m){for(let w of p.geometries)bc(u,{id:f.id,geometry:w,properties:f.properties},_,m)})(r,e,e.geometry,i,o);let s=e.geometry.coordinates;if(!(s!=null&&s.length))return;let a=(function(u,f,p){var _;return f.promoteId?(_=u.properties)==null?void 0:_[f.promoteId]:f.generateId?p||0:u.id})(e,i,o),h=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2);switch(e.geometry.type){case"Point":return void(function(u,f,p,_){let m=[];m.push(BA(p.coordinates[0]),_A(p.coordinates[1]),0),u.push(si(f,"Point",m,_))})(r,a,e.geometry,e.properties);case"MultiPoint":return void(function(u,f,p,_){let m=[];for(let w of p.coordinates)m.push(BA(w[0]),_A(w[1]),0);u.push(si(f,"MultiPoint",m,_))})(r,a,e.geometry,e.properties);case"LineString":return void(function(u,f,p,_,m){let w={points:[]};tu(p.coordinates,w,_,!1),u.push(si(f,"LineString",w,m))})(r,a,e.geometry,h,e.properties);case"MultiLineString":return void(function(u,f,p,_,m,w){if(m.lineMetrics)for(let Q of p.coordinates){let x={points:[]};tu(Q,x,_,!1),u.push(si(f,"LineString",x,w))}else{let Q=[];iu(p.coordinates,Q,_,!1),u.push(si(f,"MultiLineString",Q,w))}})(r,a,e.geometry,h,i,e.properties);case"Polygon":return void(function(u,f,p,_,m){let w=[];iu(p.coordinates,w,_,!0),u.push(si(f,"Polygon",w,m))})(r,a,e.geometry,h,e.properties);case"MultiPolygon":return void(function(u,f,p,_,m){let w=[];for(let Q of p.coordinates){let x=[];iu(Q,x,_,!0),w.push(x)}u.push(si(f,"MultiPolygon",w,m))})(r,a,e.geometry,h,e.properties);default:throw new Error("Input data is not a valid GeoJSON object.")}}function tu(r,e,i,o){let s,a,h=0;for(let f=0;f<r.length;f++){let p=BA(r[f][0]),_=_A(r[f][1]);e.points.push(p,_,0),f>0&&(h+=o?(s*_-p*a)/2:Math.sqrt(Math.pow(p-s,2)+Math.pow(_-a,2))),s=p,a=_}let u=e.points.length-3;e.points[2]=1,i>0&&Wh(e.points,0,u,i),e.points[u+2]=1,$h(e),e.size=Math.abs(h),e.start=0,e.end=e.size}function iu(r,e,i,o){for(let s=0;s<r.length;s++){let a={points:[]};tu(r[s],a,i,o),e.push(a)}}function BA(r){return r/360+.5}function _A(r){let e=Math.sin(r*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function Fc(r){let e={type:"Feature",geometry:Ef(r),properties:r.tags};return r.id!=null&&(e.id=r.id),e}function Ef(r){let{type:e,geometry:i}=r;switch(e){case"Point":return{type:e,coordinates:Md(i[0],i[1])};case"MultiPoint":return{type:e,coordinates:Dc(i)};case"LineString":return{type:e,coordinates:Dc(i.points)};case"MultiLineString":case"Polygon":return{type:e,coordinates:i.map((o=>Dc(o.points)))};case"MultiPolygon":return{type:e,coordinates:i.map((o=>o.map((s=>Dc(s.points)))))}}}function Dc(r){let e=[];for(let i=0;i<r.length;i+=3)e.push(Md(r[i],r[i+1]));return e}function Md(r,e){return[Td(r),Ud(e)]}function Td(r){return 360*(r-.5)}function Ud(r){let e=(180-360*r)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var Qi;function bn(r,e,i,o,s,a,h,u){if(o/=e,a>=(i/=e)&&h<o)return r;if(h<i||a>=o)return null;let f=[];for(let p of r){let _=s===Qi.X?p.minX:p.minY,m=s===Qi.X?p.maxX:p.maxY;if(_>=i&&m<o)f.push(p);else if(!(m<i||_>=o))switch(p.type){case"Point":case"MultiPoint":If(p,f,i,o,s);continue;case"LineString":xf(p,f,i,o,s,u);continue;case"MultiLineString":vf(p,f,i,o,s);continue;case"Polygon":bf(p,f,i,o,s);continue;case"MultiPolygon":Ff(p,f,i,o,s);continue}}return f.length?f:null}function If(r,e,i,o,s){let a=[];(function(h,u,f,p,_){for(let m=0;m<h.length;m+=3){let w=h[m+_];w>=f&&w<=p&&yA(u,h[m],h[m+1],h[m+2])}})(r.geometry,a,i,o,s),a.length&&e.push(si(r.id,a.length===3?"Point":"MultiPoint",a,r.tags))}function xf(r,e,i,o,s,a){let h=[];if(Ld(r.geometry,h,i,o,s,!1,a.lineMetrics),h.length)if(a.lineMetrics)for(let u of h)e.push(si(r.id,"LineString",u,r.tags));else e.push(h.length>1?si(r.id,"MultiLineString",h,r.tags):si(r.id,"LineString",h[0],r.tags))}function vf(r,e,i,o,s){let a=[];ru(r.geometry,a,i,o,s,!1),a.length&&e.push(a.length!==1?si(r.id,"MultiLineString",a,r.tags):si(r.id,"LineString",a[0],r.tags))}function bf(r,e,i,o,s){let a=[];ru(r.geometry,a,i,o,s,!0),a.length&&e.push(si(r.id,"Polygon",a,r.tags))}function Ff(r,e,i,o,s){let a=[];for(let h of r.geometry){let u=[];ru(h,u,i,o,s,!0),u.length&&a.push(u)}a.length&&e.push(si(r.id,"MultiPolygon",a,r.tags))}function Ld(r,e,i,o,s,a,h){let u=kd(r),f=s===Qi.X?Df:Sf,p,_,m=r.start;for(let S=0;S<r.points.length-3;S+=3){let M=r.points[S],L=r.points[S+1],U=r.points[S+2],k=r.points[S+3],G=r.points[S+4],O=s===Qi.X?M:L,q=s===Qi.X?k:G,W=!1;h&&(p=Math.sqrt(Math.pow(M-k,2)+Math.pow(L-G,2))),O<i?q>i&&(_=f(u,M,L,k,G,i),h&&(u.start=m+p*_)):O>o?q<o&&(_=f(u,M,L,k,G,o),h&&(u.start=m+p*_)):yA(u.points,M,L,U),q<i&&O>=i&&(_=f(u,M,L,k,G,i),W=!0),q>o&&O<=o&&(_=f(u,M,L,k,G,o),W=!0),!a&&W&&(h&&(u.end=m+p*_),e.push(u),u=kd(r)),h&&(m+=p)}let w=r.points.length-3,Q=r.points[w],x=r.points[w+1],v=s===Qi.X?Q:x;v>=i&&v<=o&&yA(u.points,Q,x,r.points[w+2]),w=u.points.length-3,a&&w>=3&&(u.points[w]!==u.points[0]||u.points[w+1]!==u.points[1])&&yA(u.points,u.points[0],u.points[1],u.points[2]),u.points.length&&($h(u),e.push(u))}function kd(r){return{points:[],size:r.size,start:r.start,end:r.end}}function ru(r,e,i,o,s,a){for(let h of r)Ld(h,e,i,o,s,a,!1)}function yA(r,e,i,o){r.push(e,i,o)}function Df(r,e,i,o,s,a){let h=(a-e)/(o-e);return yA(r.points,a,i+(s-i)*h,1),h}function Sf(r,e,i,o,s,a){let h=(a-i)/(s-i);return yA(r.points,e+(o-e)*h,a,1),h}function nu(r,e){let i=e.buffer/e.extent,o=r,s=bn(r,1,-1-i,i,Qi.X,-1,2,e),a=bn(r,1,1-i,2+i,Qi.X,-1,2,e);return(s||a)&&(o=bn(r,1,-i,1+i,Qi.X,-1,2,e)||[],s&&(o=Pd(s,1).concat(o)),a&&(o=o.concat(Pd(a,-1)))),o}function Pd(r,e){let i=[];for(let o of r)switch(o.type){case"Point":case"MultiPoint":{let s=Mf(o.geometry,e);i.push(si(o.id,o.type,s,o.tags));continue}case"LineString":{let s=ou(o.geometry,e);i.push(si(o.id,o.type,s,o.tags));continue}case"MultiLineString":case"Polygon":{let s=[];for(let a of o.geometry)s.push(ou(a,e));i.push(si(o.id,o.type,s,o.tags));continue}case"MultiPolygon":{let s=[];for(let a of o.geometry){let h=[];for(let u of a)h.push(ou(u,e));s.push(h)}i.push(si(o.id,o.type,s,o.tags));continue}}return i}function Mf(r,e){let i=[];for(let o=0;o<r.length;o+=3)i.push(r[o]+e,r[o+1],r[o+2]);return i}function ou(r,e){let i={points:[],size:r.size};r.start!==void 0&&(i.start=r.start,i.end=r.end);for(let o=0;o<r.points.length;o+=3)i.points.push(r.points[o]+e,r.points[o+1],r.points[o+2]);return $h(i),i}function Tf(r,e,i){var a,h;let o=!!e.newGeometry,s=e.removeAllProperties||((a=e.removeProperties)==null?void 0:a.length)>0||((h=e.addOrUpdateProperties)==null?void 0:h.length)>0;if(o){let u=r[0],f=eu({type:"FeatureCollection",features:[{type:"Feature",id:u.id,geometry:e.newGeometry,properties:s?Gd(u.tags,e):u.tags}]},i);return f=nu(f,i),f}if(s){let u=[];for(let f of r){let p={...f};p.tags=Gd(p.tags,e),u.push(p)}return u}return r}function Gd(r,e){if(e.removeAllProperties)return{};let i={...r||{}};if(e.removeProperties)for(let o of e.removeProperties)delete i[o];if(e.addOrUpdateProperties)for(let{key:o,value:s}of e.addOrUpdateProperties)i[o]=s;return i}(function(r){r[r.X=0]="X",r[r.Y=1]="Y"})(Qi||(Qi={}));let su={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:r=>r};class Uf{constructor(e){this.options=Object.assign(Object.create(su),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(e){let i=[];for(let o of e){if(!o.geometry)continue;let[s,a]=o.geometry.coordinates,[h,u]=[BA(s),_A(a)];i.push({id:o.id,type:"Point",geometry:[h,u],tags:o.properties})}this.createIndex(i)}initialize(e){let i=[];for(let o of e)o.type==="Point"&&i.push(o);this.createIndex(i)}updateIndex(e,i,o){this.options=Object.assign(Object.create(su),o.clusterOptions),this.initialize(e)}createIndex(e){let{log:i,minZoom:o,maxZoom:s}=this.options;i&&console.time("total time");let a=`prepare ${e.length} points`;i&&console.time(a),this.points=e;let h=[];for(let f=0;f<e.length;f++){let p=e[f];if(!(p!=null&&p.geometry))continue;let[_,m]=p.geometry;_=Math.fround(_),m=Math.fround(m),h.push(_,m,1/0,f,-1,1),this.options.reduce&&h.push(0)}let u=this.trees[s+1]=this.createTree(h);i&&console.timeEnd(a);for(let f=s;f>=o;f--){let p=Date.now();u=this.trees[f]=this.createTree(this.cluster(u,f)),i&&console.log("z%d: %d clusters in %dms",f,u.numItems,Date.now()-p)}i&&console.timeEnd("total time")}getClusters(e,i){return this.getClustersInternal(e,i).map((o=>Fc(o)))}getClustersInternal(e,i){let o=((e[0]+180)%360+360)%360-180,s=Math.max(-90,Math.min(90,e[1])),a=e[2]===180?180:((e[2]+180)%360+360)%360-180,h=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)o=-180,a=180;else if(o>a){let m=this.getClustersInternal([o,s,180,h],i),w=this.getClustersInternal([-180,s,a,h],i);return m.concat(w)}let u=this.trees[this.limitZoom(i)],f=u.range(BA(o),_A(h),BA(a),_A(s)),p=u.flatData,_=[];for(let m of f){let w=this.stride*m;_.push(p[w+5]>1?Lf(p,w,this.clusterProps):this.points[p[w+3]])}return _}getChildren(e){let i=this.getOriginId(e),o=this.getOriginZoom(e),s=new Error("No cluster with the specified id: "+e),a=this.trees[o];if(!a)throw s;let h=a.flatData;if(i*this.stride>=h.length)throw s;let u=this.options.radius/(this.options.extent*Math.pow(2,o-1)),f=a.within(h[i*this.stride],h[i*this.stride+1],u),p=[];for(let _ of f){let m=_*this.stride;h[m+4]===e&&p.push(h[m+5]>1?kf(h,m,this.clusterProps):Fc(this.points[h[m+3]]))}if(p.length===0)throw s;return p}getLeaves(e,i,o){let s=[];return this.appendLeaves(s,e,i=i||10,o=o||0,0),s}getTile(e,i,o){let s=this.trees[this.limitZoom(e)];if(!s)return null;let a=Math.pow(2,e),{extent:h,radius:u}=this.options,f=u/h,p=(o-f)/a,_=(o+1+f)/a,m={transformed:!0,features:[],source:null,x:i,y:o,z:e};return this.addTileFeatures(s.range((i-f)/a,p,(i+1+f)/a,_),s.flatData,i,o,a,m),i===0&&this.addTileFeatures(s.range(1-f/a,p,1,_),s.flatData,a,o,a,m),i===a-1&&this.addTileFeatures(s.range(0,p,f/a,_),s.flatData,-1,o,a,m),m}getClusterExpansionZoom(e){return this.getOriginZoom(e)}appendLeaves(e,i,o,s,a){let h=this.getChildren(i);for(let u of h){let f=u.properties;if(f!=null&&f.cluster?a+f.point_count<=s?a+=f.point_count:a=this.appendLeaves(e,f.cluster_id,o,s,a):a<s?a++:e.push(u),e.length===o)break}return a}createTree(e){let i=new vc(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let o=0;o<e.length;o+=this.stride)i.add(e[o],e[o+1]);return i.finish(),i.flatData=e,i.data=null,i}addTileFeatures(e,i,o,s,a,h){for(let u of e){let f=u*this.stride,p=i[f+5]>1,_,m,w;if(p)_=Au(i,f,this.clusterProps),m=i[f],w=i[f+1];else{let v=this.points[i[f+3]];_=v.tags,[m,w]=v.geometry}let Q={type:1,geometry:[[Math.round(this.options.extent*(m*a-o)),Math.round(this.options.extent*(w*a-s))]],tags:_},x;x=p||this.options.generateId?i[f+3]:this.points[i[f+3]].id,x!==void 0&&(Q.id=x),h.features.push(Q)}}limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}cluster(e,i){let{radius:o,extent:s,reduce:a,minPoints:h}=this.options,u=o/(s*Math.pow(2,i)),f=e.flatData,p=[],_=this.stride;for(let m=0;m<f.length;m+=_){if(f[m+2]<=i)continue;f[m+2]=i;let w=f[m],Q=f[m+1],x=e.within(f[m],f[m+1],u),v=f[m+5],S=v;for(let M of x){let L=M*_;f[L+2]>i&&(S+=f[L+5])}if(S>v&&S>=h){let M,L=w*v,U=Q*v,k=-1,G=(m/_<<5)+(i+1)+this.points.length;for(let O of x){let q=O*_;if(f[q+2]<=i)continue;f[q+2]=i;let W=f[q+5];L+=f[q]*W,U+=f[q+1]*W,f[q+4]=G,a&&(M||(M=this.map(f,m,!0),k=this.clusterProps.length,this.clusterProps.push(M)),a(M,this.map(f,q)))}f[m+4]=G,p.push(L/S,U/S,1/0,G,-1,S),a&&p.push(k)}else{for(let M=0;M<_;M++)p.push(f[m+M]);if(S>1)for(let M of x){let L=M*_;if(!(f[L+2]<=i)){f[L+2]=i;for(let U=0;U<_;U++)p.push(f[L+U])}}}}return p}getOriginId(e){return e-this.points.length>>5}getOriginZoom(e){return(e-this.points.length)%32}map(e,i,o){if(e[i+5]>1){let h=this.clusterProps[e[i+6]];return o?Object.assign({},h):h}let s=this.points[e[i+3]].tags,a=this.options.map(s);return o&&a===s?Object.assign({},a):a}}function Lf(r,e,i){return{id:r[e+3],type:"Point",tags:Au(r,e,i),geometry:[r[e],r[e+1]]}}function kf(r,e,i){return{type:"Feature",id:r[e+3],properties:Au(r,e,i),geometry:{type:"Point",coordinates:[Td(r[e]),Ud(r[e+1])]}}}function Au(r,e,i){let o=r[e+5],s=o>=1e4?`${Math.round(o/1e3)}k`:o>=1e3?Math.round(o/100)/10+"k":o,a=r[e+6],h=a===-1?{}:Object.assign({},i[a]);return Object.assign(h,{cluster:!0,cluster_id:r[e+3],point_count:o,point_count_abbreviated:s})}let au="geojsonvt_clip_start",lu="geojsonvt_clip_end";function Rd(r,e,i,o,s){let a=e===s.maxZoom?0:s.tolerance/((1<<e)*s.extent),h={transformed:!1,features:[],source:null,x:i,y:o,z:e,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:r.length};for(let u of r)Pf(h,u,a,s);return h}function Pf(r,e,i,o){switch(r.minX=Math.min(r.minX,e.minX),r.minY=Math.min(r.minY,e.minY),r.maxX=Math.max(r.maxX,e.maxX),r.maxY=Math.max(r.maxY,e.maxY),e.type){case"Point":case"MultiPoint":return void(function(s,a){let h=[];for(let f=0;f<a.geometry.length;f+=3)h.push(a.geometry[f],a.geometry[f+1]),s.numPoints++,s.numSimplified++;if(!h.length)return;let u={type:1,tags:a.tags||null,geometry:h};a.id!==null&&(u.id=a.id),s.features.push(u)})(r,e);case"LineString":return void(function(s,a,h,u){let f=[];if(cu(f,a.geometry,s,h,!1,!1),!f.length)return;let p=a.tags||null;if(u.lineMetrics){p={};for(let m in a.tags)p[m]=a.tags[m];p[au]=a.geometry.start/a.geometry.size,p[lu]=a.geometry.end/a.geometry.size}let _={type:2,tags:p,geometry:f};a.id!==null&&(_.id=a.id),s.features.push(_)})(r,e,i,o);case"MultiLineString":case"Polygon":return void(function(s,a,h){let u=[];for(let p=0;p<a.geometry.length;p++)cu(u,a.geometry[p],s,h,a.type==="Polygon",p===0);if(!u.length)return;let f={type:a.type==="Polygon"?3:2,tags:a.tags||null,geometry:u};a.id!==null&&(f.id=a.id),s.features.push(f)})(r,e,i);case"MultiPolygon":return void(function(s,a,h){let u=[];for(let p=0;p<a.geometry.length;p++){let _=a.geometry[p];for(let m=0;m<_.length;m++)cu(u,_[m],s,h,!0,m===0)}if(!u.length)return;let f={type:3,tags:a.tags||null,geometry:u};a.id!==null&&(f.id=a.id),s.features.push(f)})(r,e,i)}}function cu(r,e,i,o,s,a){let h=o*o;if(o>0&&e.size<(s?h:o))return void(i.numPoints+=e.points.length/3);let u=[];for(let f=0;f<e.points.length;f+=3)(o===0||e.points[f+2]>h)&&(i.numSimplified++,u.push(e.points[f],e.points[f+1])),i.numPoints++;s&&(function(f,p){let _=0;for(let m=0,w=f.length,Q=w-2;m<w;Q=m,m+=2)_+=(f[m]-f[Q])*(f[m+1]+f[Q+1]);if(_>0===p)for(let m=0,w=f.length;m<w/2;m+=2){let Q=f[m],x=f[m+1];f[m]=f[w-2-m],f[m+1]=f[w-1-m],f[w-2-m]=Q,f[w-1-m]=x}})(u,a),r.push(u)}function Od(r,e){if(r.transformed)return r;let i=1<<r.z,o=r.x,s=r.y;for(let a of r.features)a.type===1?Gf(a,e,i,o,s):Rf(a,e,i,o,s);return r.transformed=!0,r}function Gf(r,e,i,o,s){let a=r,h=r.geometry,u=[];for(let f=0;f<h.length;f+=2)u.push(Nd(h[f],h[f+1],e,i,o,s));return a.geometry=u,a}function Rf(r,e,i,o,s){let a=r,h=r.geometry,u=[];for(let f of h){let p=[];for(let _=0;_<f.length;_+=2)p.push(Nd(f[_],f[_+1],e,i,o,s));u.push(p)}return a.geometry=u,a}function Nd(r,e,i,o,s,a){return[Math.round(i*(r*o-s)),Math.round(i*(e*o-a))]}class Of{constructor(e){this.options=e,this.total=0,this.stats={},this.tiles={},this.tileCoords=[],this.stats={},this.total=0}initialize(e){this.splitTile(e,0,0,0),this.options.debug&&(e.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}updateIndex(e,i,o){o.debug>1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(i),o.debug>1&&console.timeEnd("invalidating");let[s,a,h]=[0,0,0],u=Rd(e,s,a,h,o);u.source=e;let f=Sc(s,a,h);if(this.tiles[f]=u,this.tileCoords.push({z:s,x:a,y:h,id:f}),o.debug){let p=`z${s}`;this.stats[p]=(this.stats[p]||0)+1,this.total++}}getClusterExpansionZoom(e){return null}getChildren(e){return null}getLeaves(e,i,o){return null}getTile(e,i,o){let{extent:s,debug:a}=this.options,h=1<<e,u=Sc(e,i=i+h&h-1,o);if(this.tiles[u])return Od(this.tiles[u],s);a>1&&console.log("drilling down to z%d-%d-%d",e,i,o);let f,p=e,_=i,m=o;for(;!f&&p>0;)p--,_>>=1,m>>=1,f=this.tiles[Sc(p,_,m)];return f!=null&&f.source?(a>1&&(console.log("found parent tile z%d-%d-%d",p,_,m),console.time("drilling down")),this.splitTile(f.source,p,_,m,e,i,o),a>1&&console.timeEnd("drilling down"),this.tiles[u]?Od(this.tiles[u],s):null):null}splitTile(e,i,o,s,a,h,u){let f=[e,i,o,s],p=this.options,_=p.debug;for(;f.length;){s=f.pop(),o=f.pop(),i=f.pop(),e=f.pop();let m=1<<i,w=Sc(i,o,s),Q=this.tiles[w];if(!Q&&(_>1&&console.time("creation"),Q=this.tiles[w]=Rd(e,i,o,s,p),this.tileCoords.push({z:i,x:o,y:s,id:w}),_)){_>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",i,o,s,Q.numFeatures,Q.numPoints,Q.numSimplified),console.timeEnd("creation"));let W=`z${i}`;this.stats[W]=(this.stats[W]||0)+1,this.total++}if(Q.source=e,a==null){if(i===p.indexMaxZoom||Q.numPoints<=p.indexMaxPoints)continue}else{if(i===p.maxZoom||i===a)continue;if(a!=null){let W=a-i;if(o!==h>>W||s!==u>>W)continue}}if(Q.source=null,!e.length)continue;_>1&&console.time("clipping");let x=.5*p.buffer/p.extent,v=.5-x,S=.5+x,M=1+x,L=null,U=null,k=null,G=null,O=bn(e,m,o-x,o+S,Qi.X,Q.minX,Q.maxX,p),q=bn(e,m,o+v,o+M,Qi.X,Q.minX,Q.maxX,p);O&&(L=bn(O,m,s-x,s+S,Qi.Y,Q.minY,Q.maxY,p),U=bn(O,m,s+v,s+M,Qi.Y,Q.minY,Q.maxY,p)),q&&(k=bn(q,m,s-x,s+S,Qi.Y,Q.minY,Q.maxY,p),G=bn(q,m,s+v,s+M,Qi.Y,Q.minY,Q.maxY,p)),_>1&&console.timeEnd("clipping"),f.push(L||[],i+1,2*o,2*s),f.push(U||[],i+1,2*o,2*s+1),f.push(k||[],i+1,2*o+1,2*s),f.push(G||[],i+1,2*o+1,2*s+1)}}invalidateTiles(e){if(!e.length)return;let i=this.options,{debug:o}=i,s=1/0,a=-1/0,h=1/0,u=-1/0;for(let _ of e)s=Math.min(s,_.minX),a=Math.max(a,_.maxX),h=Math.min(h,_.minY),u=Math.max(u,_.maxY);let f=i.buffer/i.extent,p=new Set;for(let _ in this.tiles){let m=this.tiles[_],w=1<<m.z,Q=(m.x-f)/w,x=(m.x+1+f)/w,v=(m.y-f)/w,S=(m.y+1+f)/w;if(a<Q||s>=x||u<v||h>=S)continue;let M=!1;for(let L of e)if(L.maxX>=Q&&L.minX<x&&L.maxY>=v&&L.minY<S){M=!0;break}if(M){if(o){o>1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",m.z,m.x,m.y,m.numFeatures,m.numPoints,m.numSimplified);let L=`z${m.z}`;this.stats[L]=(this.stats[L]||0)-1,this.total--}delete this.tiles[_],p.add(_)}}p.size&&(this.tileCoords=this.tileCoords.filter((_=>!p.has(_.id))))}}function Sc(r,e,i){return 32*((1<<r)*i+e)+r}let Nf={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,cluster:!1,clusterOptions:su,debug:0},zf=_t([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Yf}=zf,Kf=_t([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:jf}=Kf,Xf=Math.cos(Math.PI/180*37.5),zd=Math.pow(2,14)/.5;class hu{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((i=>i.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let i of this.layers)this.gradients[i.id]={};this.layoutVertexArray=new H,this.layoutVertexArray2=new j,this.indexArray=new me,this.programConfigurations=new xr(e.layers,e.zoom),this.segments=new ve,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((i=>i.isStateDependent())).map((i=>i.id))}populate(e,i,o){this.hasDependencies=wc("line",this.layers,i)||this.hasLineDasharray(this.layers);let s=this.layers[0].layout.get("line-sort-key"),a=!s.isConstant(),h=[];for(let{feature:u,id:f,index:p,sourceLayerIndex:_}of e){let m=this.layers[0]._featureFilter.needGeometry,w=Jr(u,m);if(!this.layers[0]._featureFilter.filter(new Bt(this.zoom),w,o))continue;let Q=a?s.evaluate(w,{},o):void 0,x={id:f,properties:u.properties,type:u.type,sourceLayerIndex:_,index:p,geometry:m?w.geometry:Hr(u),patterns:{},dashes:{},sortKey:Q};h.push(x)}a&&h.sort(((u,f)=>u.sortKey-f.sortKey));for(let u of h){let{geometry:f,index:p,sourceLayerIndex:_}=u;this.hasDependencies?(wc("line",this.layers,i)?Kh("line",this.layers,u,{zoom:this.zoom},i):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,u,this.zoom,i),this.patternFeatures.push(u)):this.addFeature(u,f,p,o,{},{},i.subdivisionGranularity),i.featureIndex.insert(e[p].feature,f,p,_,this.index)}}update(e,i,o,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,i,this.stateDependentLayers,{imagePositions:o,dashPositions:s})}addFeatures(e,i,o,s){for(let a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,i,o,s,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,jf)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Yf),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.hasOwn(e.properties,au)&&Object.hasOwn(e.properties,lu))return{start:+e.properties[au],end:+e.properties[lu]}}addFeature(e,i,o,s,a,h,u){let f=this.layers[0].layout,p=f.get("line-join").evaluate(e,{}),_=f.get("line-cap").evaluate(e,{}),m=f.get("line-miter-limit").evaluate(e,{}),w=f.get("line-round-limit").evaluate(e,{});this.lineClips=this.lineFeatureClips(e);for(let Q of i)this.addLine(Q,e,p,_,m,w,s,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{imagePositions:a,dashPositions:h,canonical:s})}addLine(e,i,o,s,a,h,u,f){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e=cs(e,u?f.line.getGranularityForZoomLevel(u.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let U=0;U<e.length-1;U++)this.totalDistance+=e[U].dist(e[U+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let p=Wa.types[i.type]==="Polygon",_=e.length;for(;_>=2&&e[_-1].equals(e[_-2]);)_--;let m=0;for(;m<_-1&&e[m].equals(e[m+1]);)m++;if(_<(p?3:2))return;o==="bevel"&&(a=1.05);let w=this.overscaling<=16?122880/(512*this.overscaling):0,Q=this.segments.prepareSegment(10*_,this.layoutVertexArray,this.indexArray),x,v,S,M,L;this.e1=this.e2=-1,p&&(x=e[_-2],L=e[m].sub(x)._unit()._perp());for(let U=m;U<_;U++){if(S=U===_-1?p?e[m+1]:void 0:e[U+1],S&&e[U].equals(S))continue;L&&(M=L),x&&(v=x),x=e[U],L=S?S.sub(x)._unit()._perp():M,M||(M=L);let k=M.add(L);k.x===0&&k.y===0||k._unit();let G=M.x*L.x+M.y*L.y,O=k.x*L.x+k.y*L.y,q=O!==0?1/O:1/0,W=2*Math.sqrt(2-2*O),oe=O<Xf&&v&&S,ne=M.x*L.y-M.y*L.x>0;if(oe&&U>m){let ce=x.dist(v);if(ce>2*w){let re=x.sub(x.sub(v)._mult(w/ce)._round());this.updateDistance(v,re),this.addCurrentVertex(re,M,0,0,Q),v=re}}let ue=v&&S,fe=ue?o:p?"butt":s;if(ue&&fe==="round"&&(q<h?fe="miter":q<=2&&(fe="fakeround")),fe==="miter"&&q>a&&(fe="bevel"),fe==="bevel"&&(q>2&&(fe="flipbevel"),q<a&&(fe="miter")),v&&this.updateDistance(v,x),fe==="miter")k._mult(q),this.addCurrentVertex(x,k,0,0,Q);else if(fe==="flipbevel"){if(q>100)k=L.mult(-1);else{let ce=q*M.add(L).mag()/M.sub(L).mag();k._perp()._mult(ce*(ne?-1:1))}this.addCurrentVertex(x,k,0,0,Q),this.addCurrentVertex(x,k.mult(-1),0,0,Q)}else if(fe==="bevel"||fe==="fakeround"){let ce=-Math.sqrt(q*q-1),re=ne?ce:0,_e=ne?0:ce;if(v&&this.addCurrentVertex(x,M,re,_e,Q),fe==="fakeround"){let Qe=Math.round(180*W/Math.PI/20);for(let ye=1;ye<Qe;ye++){let Ce=ye/Qe;if(Ce!==.5){let $e=Ce-.5;Ce+=Ce*$e*(Ce-1)*((1.0904+G*(G*(3.55645-1.43519*G)-3.2452))*$e*$e+(.848013+G*(.215638*G-1.06021)))}let ke=L.sub(M)._mult(Ce)._add(M)._unit()._mult(ne?-1:1);this.addHalfVertex(x,ke.x,ke.y,!1,ne,0,Q)}}S&&this.addCurrentVertex(x,L,-re,-_e,Q)}else if(fe==="butt")this.addCurrentVertex(x,k,0,0,Q);else if(fe==="square"){let ce=v?1:-1;this.addCurrentVertex(x,k,ce,ce,Q)}else fe==="round"&&(v&&(this.addCurrentVertex(x,M,0,0,Q),this.addCurrentVertex(x,M,1,1,Q,!0)),S&&(this.addCurrentVertex(x,L,-1,-1,Q,!0),this.addCurrentVertex(x,L,0,0,Q)));if(oe&&U<_-1){let ce=x.dist(S);if(ce>2*w){let re=x.add(S.sub(x)._mult(w/ce)._round());this.updateDistance(x,re),this.addCurrentVertex(re,L,0,0,Q),x=re}}}}addCurrentVertex(e,i,o,s,a,h=!1){let u=i.y*s-i.x,f=-i.y-i.x*s;this.addHalfVertex(e,i.x+i.y*o,i.y-i.x*o,h,!1,o,a),this.addHalfVertex(e,u,f,h,!0,-s,a),this.distance>zd/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,i,o,s,a,h))}addHalfVertex({x:e,y:i},o,s,a,h,u,f){let p=.5*(this.lineClips?this.scaledDistance*(zd-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(a?1:0),(i<<1)+(h?1:0),Math.round(63*o)+128,Math.round(63*s)+128,1+(u===0?0:u<0?-1:1)|(63&p)<<2,p>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let _=f.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,_,this.e2),f.primitiveLength++),h?this.e2=_:this.e1=_}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,i){this.distance+=e.dist(i),this.updateScaledDistance()}hasLineDasharray(e){for(let i of e){let o=i.paint.get("line-dasharray");if(o&&!o.isConstant())return!0}return!1}addLineDashDependencies(e,i,o,s){for(let a of e){let h=a.paint.get("line-dasharray");if(!h||h.value.kind==="constant")continue;let u=a.layout.get("line-cap").evaluate(i,{})==="round",f={dasharray:h.value.evaluate({zoom:o-1},i,{}),round:u},p={dasharray:h.value.evaluate({zoom:o},i,{}),round:u},_={dasharray:h.value.evaluate({zoom:o+1},i,{}),round:u},m=`${f.dasharray.join(",")},${f.round}`,w=`${p.dasharray.join(",")},${p.round}`,Q=`${_.dasharray.join(",")},${_.round}`;s.dashDependencies[m]=f,s.dashDependencies[w]=p,s.dashDependencies[Q]=_,i.dashes[a.id]={min:m,mid:w,max:Q}}}}let Yd,Kd;be("LineBucket",hu,{omit:["layers","patternFeatures"]});var jd={get paint(){return Kd=Kd||new _i({"line-opacity":new Le(he.paint_line["line-opacity"]),"line-color":new Le(he.paint_line["line-color"]),"line-translate":new De(he.paint_line["line-translate"]),"line-translate-anchor":new De(he.paint_line["line-translate-anchor"]),"line-width":new Le(he.paint_line["line-width"]),"line-gap-width":new Le(he.paint_line["line-gap-width"]),"line-offset":new Le(he.paint_line["line-offset"]),"line-blur":new Le(he.paint_line["line-blur"]),"line-dasharray":new Yr(he.paint_line["line-dasharray"]),"line-pattern":new Yr(he.paint_line["line-pattern"]),"line-gradient":new Ao(he.paint_line["line-gradient"])})},get layout(){return Yd=Yd||new _i({"line-cap":new Le(he.layout_line["line-cap"]),"line-join":new Le(he.layout_line["line-join"]),"line-miter-limit":new Le(he.layout_line["line-miter-limit"]),"line-round-limit":new Le(he.layout_line["line-round-limit"]),"line-sort-key":new Le(he.layout_line["line-sort-key"])})}};class Vf extends Le{possiblyEvaluate(e,i){return i=new Bt(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),super.possiblyEvaluate(e,i)}evaluate(e,i,o,s){return i=ji({},i,{zoom:Math.floor(i.zoom)}),super.evaluate(e,i,o,s)}}let Mc;class Zf extends Hi{constructor(e,i){super(e,jd,i),this.gradientVersion=0,Mc||(Mc=new Vf(jd.paint.properties["line-width"].specification),Mc.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let i=this.gradientExpression();this.stepInterpolant=!!(function(o){return o._styleExpression!==void 0})(i)&&i._styleExpression.expression instanceof Zn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,i){super.recalculate(e,i),this.paint._values["line-floorwidth"]=Mc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new hu(e)}queryRadius(e){let i=e,o=Xd(gA("line-width",this,i),gA("line-gap-width",this,i)),s=gA("line-offset",this,i);return o/2+Math.abs(s)+Qc(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:i,featureState:o,geometry:s,transform:a,pixelsToTileUnits:h}){let u=Cc(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-a.bearingInRadians,h),f=h/2*Xd(this.paint.get("line-width").evaluate(i,o),this.paint.get("line-gap-width").evaluate(i,o)),p=this.paint.get("line-offset").evaluate(i,o);return p&&(s=(function(_,m){let w=[];for(let Q of _){let x=kp(Q),v=[];for(let S=0;S<x.length;S++){let M=x[S],L=x[S-1],U=x[S+1],k=S===0?new se(0,0):M.sub(L)._unit()._perp(),G=S===x.length-1?new se(0,0):U.sub(M)._unit()._perp(),O=k._add(G)._unit(),q=O.x*G.x+O.y*G.y;q!==0&&O._mult(1/q),v.push(O._mult(m)._add(M))}w.push(v)}return w})(s,p*h)),(function(_,m,w){for(let Q of m){if(_.length>=3){for(let x of Q)if(dA(_,x))return!0}if(Tp(_,Q,w))return!0}return!1})(u,s,f)}isTileClipped(){return!0}}function Xd(r,e){return e>0?e+2*r:r}let Hf=_t([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Jf=_t([{name:"a_projected_pos",components:3,type:"Float32"}],4);_t([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let qf=_t([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);_t([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let Vd=_t([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Wf=_t([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function $f(r,e,i){let o=e.layout.get("text-transform").evaluate(i,{});return o==="uppercase"?r=r.toLocaleUpperCase():o==="lowercase"&&(r=r.toLocaleLowerCase()),wr.applyArabicShaping&&(r=wr.applyArabicShaping(r)),r}function em(r,e,i){for(let o of r.sections)o.text=$f(o.text,e,i);return r}_t([{name:"triangle",components:3,type:"Uint16"}]),_t([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),_t([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),_t([{type:"Float32",name:"offsetX"}]),_t([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),_t([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var Jt=24;let rl={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u22EF":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"},tm={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},im={40:!0};function Zd(r,e,i,o,s,a){if("fontStack"in e){let h=i[e.fontStack],u=h==null?void 0:h[r];return u?u.metrics.advance*e.scale+s:0}{let h=o[e.imageName];return h?h.displaySize[0]*e.scale*Jt/a+s:0}}function Hd(r,e,i,o){let s=Math.pow(r-e,2);return o?r<e?s/2:2*s:s+Math.abs(i)*i}function rm(r,e,i){let o=0;return r===10&&(o-=1e4),i&&(o+=150),r!==40&&r!==65288||(o+=50),e!==41&&e!==65289||(o+=50),o}function Jd(r,e,i,o,s,a){let h=null,u=Hd(e,i,s,a);for(let f of o){let p=Hd(e-f.x,i,s,a)+f.badness;p<=u&&(h=f,u=p)}return{index:r,x:e,priorBreak:h,badness:u}}function qd(r){return r?qd(r.priorBreak).concat(r.index):[]}class QA{constructor(e="",i=[],o=[]){this.text=e,this.sections=i,this.sectionIndex=o,this.imageSectionID=null}static fromFeature(e,i){let o=new QA;for(let s of e.sections)s.image?o.addImageSection(s):o.addTextSection(s,i);return o}length(){return[...this.text].length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}verticalizePunctuation(){this.text=(function(e){let i="",o={premature:!0,value:void 0},s=e[Symbol.iterator](),a=s.next(),h=e[Symbol.iterator]();h.next();let u=h.next();for(;!a.done;)i+=!u.done&&Fa(u.value.codePointAt(0))&&!rl[u.value]||!o.premature&&Fa(o.value.codePointAt(0))&&!rl[o.value]||!rl[a.value]?a.value:rl[a.value],o={value:a.value,premature:!1},a=s.next(),u=h.next();return i})(this.text)}hasZeroWidthSpaces(){return this.text.includes("\u200B")}trim(){let e=this.text.match(/^\s*/),i=e?e[0].length:0,o=this.text.match(/\S\s*$/),s=o?o[0].length-1:0;this.text=this.text.substring(i,this.text.length-s),this.sectionIndex=this.sectionIndex.slice(i,this.sectionIndex.length-s)}substring(e,i){let o=[...this.text].slice(e,i).join(""),s=this.sectionIndex.slice(e,i);return new QA(o,this.sections,s)}toCodeUnitIndex(e){return[...this.text].slice(0,e).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,i)=>Math.max(e,this.sections[i].scale)),0)}getMaxImageSize(e){let i=0,o=0;for(let s=0;s<this.length();s++){let a=this.getSection(s);if("imageName"in a){let h=e[a.imageName];if(!h)continue;let u=h.displaySize;i=Math.max(i,u[0]),o=Math.max(o,u[1])}}return{maxImageWidth:i,maxImageHeight:o}}addTextSection(e,i){this.text+=e.text,this.sections.push({scale:e.scale||1,verticalAlign:e.verticalAlign||"bottom",fontStack:e.fontStack||i});let o=this.sections.length-1;this.sectionIndex.push(...[...e.text].map((()=>o)))}addImageSection(e){let i=e.image?e.image.name:"";if(i.length===0)return void ti("Can't add FormattedSection with an empty image.");let o=this.getNextImageSectionCharCode();o?(this.text+=String.fromCharCode(o),this.sections.push({scale:1,verticalAlign:e.verticalAlign||"bottom",imageName:i}),this.sectionIndex.push(this.sections.length-1)):ti("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,i,o,s,a){let h=[],u=this.determineAverageLineWidth(e,i,o,s,a),f=this.hasZeroWidthSpaces(),p=0,_=0,m=this.text[Symbol.iterator](),w=m.next(),Q=this.text[Symbol.iterator]();Q.next();let x=Q.next(),v=this.text[Symbol.iterator]();v.next(),v.next();let S=v.next();for(;!w.done;){let M=this.getSection(_),L=w.value.codePointAt(0);if(cc(L)||(p+=Zd(L,M,o,s,e,a)),!x.done){let U=Mh(L),k=x.value.codePointAt(0);(tm[L]||U||"imageName"in M||!S.done&&im[k])&&h.push(Jd(_+1,p,u,h,rm(L,k,U&&f),!1))}_++,w=m.next(),x=Q.next(),S=v.next()}return qd(Jd(this.length(),p,u,h,0,!0))}determineAverageLineWidth(e,i,o,s,a){let h=0,u=0;for(let f of this.text){let p=this.getSection(u);h+=Zd(f.codePointAt(0),p,o,s,e,a),u++}return h/Math.max(1,Math.ceil(h/i))}}let uu=4294967296,Wd=1/uu,$d=typeof TextDecoder=="undefined"?null:new TextDecoder("utf-8");class Tc{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,i,o=this.length){for(;this.pos<o;){let s=this.readVarint(),a=s>>3,h=this.pos;this.type=7&s,e(a,i,this),this.pos===h&&this.skip(s)}return i}readMessage(e,i){return this.readFields(e,i,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*uu;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*uu;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let i=this.buf,o,s;return s=i[this.pos++],o=127&s,s<128?o:(s=i[this.pos++],o|=(127&s)<<7,s<128?o:(s=i[this.pos++],o|=(127&s)<<14,s<128?o:(s=i[this.pos++],o|=(127&s)<<21,s<128?o:(s=i[this.pos],o|=(15&s)<<28,(function(a,h,u){let f=u.buf,p,_;if(_=f[u.pos++],p=(112&_)>>4,_<128||(_=f[u.pos++],p|=(127&_)<<3,_<128)||(_=f[u.pos++],p|=(127&_)<<10,_<128)||(_=f[u.pos++],p|=(127&_)<<17,_<128)||(_=f[u.pos++],p|=(127&_)<<24,_<128)||(_=f[u.pos++],p|=(1&_)<<31,_<128))return CA(a,p,h);throw new Error("Expected varint not more than 10 bytes")})(o,e,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){let e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,i=this.pos;return this.pos=e,e-i>=12&&$d?$d.decode(this.buf.subarray(i,e)):(function(o,s,a){let h="",u=s;for(;u<a;){let f=o[u],p,_,m,w=null,Q=f>239?4:f>223?3:f>191?2:1;if(u+Q>a)break;Q===1?f<128&&(w=f):Q===2?(p=o[u+1],(192&p)==128&&(w=(31&f)<<6|63&p,w<=127&&(w=null))):Q===3?(p=o[u+1],_=o[u+2],(192&p)==128&&(192&_)==128&&(w=(15&f)<<12|(63&p)<<6|63&_,(w<=2047||w>=55296&&w<=57343)&&(w=null))):Q===4&&(p=o[u+1],_=o[u+2],m=o[u+3],(192&p)==128&&(192&_)==128&&(192&m)==128&&(w=(15&f)<<18|(63&p)<<12|(63&_)<<6|63&m,(w<=65535||w>=1114112)&&(w=null))),w===null?(w=65533,Q=1):w>65535&&(w-=65536,h+=String.fromCharCode(w>>>10&1023|55296),w=56320|1023&w),h+=String.fromCharCode(w),u+=Q}return h})(this.buf,i,e)}readBytes(){let e=this.readVarint()+this.pos,i=this.buf.subarray(this.pos,e);return this.pos=e,i}readPackedVarint(e=[],i){let o=this.readPackedEnd();for(;this.pos<o;)e.push(this.readVarint(i));return e}readPackedSVarint(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}skip(e){let i=7&e;if(i===0)for(;this.buf[this.pos++]>127;);else if(i===2)this.pos=this.readVarint()+this.pos;else if(i===5)this.pos+=4;else{if(i!==1)throw new Error(`Unimplemented type: ${i}`);this.pos+=8}}writeTag(e,i){this.writeVarint(e<<3|i)}realloc(e){let i=this.length||16;for(;i<this.pos+e;)i*=2;if(i!==this.length){let o=new Uint8Array(i);o.set(this.buf),this.buf=o,this.dataView=new DataView(o.buffer),this.length=i}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Wd),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Wd),!0),this.pos+=8}writeVarint(e){(e=+e||0)>268435455||e<0?(function(i,o){let s,a;if(i>=0?(s=i%4294967296|0,a=i/4294967296|0):(s=~(-i%4294967296),a=~(-i/4294967296),4294967295^s?s=s+1|0:(s=0,a=a+1|0)),i>=18446744073709552e3||i<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");o.realloc(10),(function(h,u,f){f.buf[f.pos++]=127&h|128,h>>>=7,f.buf[f.pos++]=127&h|128,h>>>=7,f.buf[f.pos++]=127&h|128,h>>>=7,f.buf[f.pos++]=127&h|128,f.buf[f.pos]=127&(h>>>=7)})(s,0,o),(function(h,u){let f=(7&h)<<4;u.buf[u.pos++]|=f|((h>>>=3)?128:0),h&&(u.buf[u.pos++]=127&h|((h>>>=7)?128:0),h&&(u.buf[u.pos++]=127&h|((h>>>=7)?128:0),h&&(u.buf[u.pos++]=127&h|((h>>>=7)?128:0),h&&(u.buf[u.pos++]=127&h|((h>>>=7)?128:0),h&&(u.buf[u.pos++]=127&h)))))})(a,o)})(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))}writeSVarint(e){this.writeVarint(e<0?2*-e-1:2*e)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(4*e.length),this.pos++;let i=this.pos;this.pos=(function(s,a,h){for(let u,f,p=0;p<a.length;p++){if(u=a.charCodeAt(p),u>55295&&u<57344){if(!f){u>56319||p+1===a.length?(s[h++]=239,s[h++]=191,s[h++]=189):f=u;continue}if(u<56320){s[h++]=239,s[h++]=191,s[h++]=189,f=u;continue}u=f-55296<<10|u-56320|65536,f=null}else f&&(s[h++]=239,s[h++]=191,s[h++]=189,f=null);u<128?s[h++]=u:(u<2048?s[h++]=u>>6|192:(u<65536?s[h++]=u>>12|224:(s[h++]=u>>18|240,s[h++]=u>>12&63|128),s[h++]=u>>6&63|128),s[h++]=63&u|128)}return h})(this.buf,e,this.pos);let o=this.pos-i;o>=128&&eg(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){let i=e.length;this.writeVarint(i),this.realloc(i);for(let o=0;o<i;o++)this.buf[this.pos++]=e[o]}writeRawMessage(e,i){this.pos++;let o=this.pos;e(i,this);let s=this.pos-o;s>=128&&eg(o,s,this),this.pos=o-1,this.writeVarint(s),this.pos+=s}writeMessage(e,i,o){this.writeTag(e,2),this.writeRawMessage(i,o)}writePackedVarint(e,i){i.length&&this.writeMessage(e,nm,i)}writePackedSVarint(e,i){i.length&&this.writeMessage(e,om,i)}writePackedBoolean(e,i){i.length&&this.writeMessage(e,am,i)}writePackedFloat(e,i){i.length&&this.writeMessage(e,sm,i)}writePackedDouble(e,i){i.length&&this.writeMessage(e,Am,i)}writePackedFixed32(e,i){i.length&&this.writeMessage(e,lm,i)}writePackedSFixed32(e,i){i.length&&this.writeMessage(e,cm,i)}writePackedFixed64(e,i){i.length&&this.writeMessage(e,hm,i)}writePackedSFixed64(e,i){i.length&&this.writeMessage(e,um,i)}writeBytesField(e,i){this.writeTag(e,2),this.writeBytes(i)}writeFixed32Field(e,i){this.writeTag(e,5),this.writeFixed32(i)}writeSFixed32Field(e,i){this.writeTag(e,5),this.writeSFixed32(i)}writeFixed64Field(e,i){this.writeTag(e,1),this.writeFixed64(i)}writeSFixed64Field(e,i){this.writeTag(e,1),this.writeSFixed64(i)}writeVarintField(e,i){this.writeTag(e,0),this.writeVarint(i)}writeSVarintField(e,i){this.writeTag(e,0),this.writeSVarint(i)}writeStringField(e,i){this.writeTag(e,2),this.writeString(i)}writeFloatField(e,i){this.writeTag(e,5),this.writeFloat(i)}writeDoubleField(e,i){this.writeTag(e,1),this.writeDouble(i)}writeBooleanField(e,i){this.writeVarintField(e,+i)}}function CA(r,e,i){return i?4294967296*e+(r>>>0):4294967296*(e>>>0)+(r>>>0)}function eg(r,e,i){let o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(o);for(let s=i.pos-1;s>=r;s--)i.buf[s+o]=i.buf[s]}function nm(r,e){for(let i=0;i<r.length;i++)e.writeVarint(r[i])}function om(r,e){for(let i=0;i<r.length;i++)e.writeSVarint(r[i])}function sm(r,e){for(let i=0;i<r.length;i++)e.writeFloat(r[i])}function Am(r,e){for(let i=0;i<r.length;i++)e.writeDouble(r[i])}function am(r,e){for(let i=0;i<r.length;i++)e.writeBoolean(r[i])}function lm(r,e){for(let i=0;i<r.length;i++)e.writeFixed32(r[i])}function cm(r,e){for(let i=0;i<r.length;i++)e.writeSFixed32(r[i])}function hm(r,e){for(let i=0;i<r.length;i++)e.writeFixed64(r[i])}function um(r,e){for(let i=0;i<r.length;i++)e.writeSFixed64(r[i])}function dm(r,e,i){r===1&&i.readMessage(gm,e)}function gm(r,e,i){if(r===3){let{id:o,bitmap:s,width:a,height:h,left:u,top:f,advance:p}=i.readMessage(pm,{});e.push({id:o,bitmap:new ja({width:a+6,height:h+6},s),metrics:{width:a,height:h,left:u,top:f,advance:p}})}}function pm(r,e,i){r===1?e.id=i.readVarint():r===2?e.bitmap=i.readBytes():r===3?e.width=i.readVarint():r===4?e.height=i.readVarint():r===5?e.left=i.readSVarint():r===6?e.top=i.readSVarint():r===7&&(e.advance=i.readVarint())}function tg(r){let e=0,i=0;for(let h of r)e+=h.w*h.h,i=Math.max(i,h.w);r.sort(((h,u)=>u.h-h.h));let o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}],s=0,a=0;for(let h of r)for(let u=o.length-1;u>=0;u--){let f=o[u];if(!(h.w>f.w||h.h>f.h)){if(h.x=f.x,h.y=f.y,a=Math.max(a,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===f.w&&h.h===f.h){let p=o.pop();p&&u<o.length&&(o[u]=p)}else h.h===f.h?(f.x+=h.w,f.w-=h.w):h.w===f.w?(f.y+=h.h,f.h-=h.h):(o.push({x:f.x+h.w,y:f.y,w:f.w-h.w,h:h.h}),f.y+=h.h,f.h-=h.h);break}}return{w:s,h:a,fill:e/(s*a)||0}}class du{constructor(e,{pixelRatio:i,version:o,stretchX:s,stretchY:a,content:h,textFitWidth:u,textFitHeight:f}){this.paddedRect=e,this.pixelRatio=i,this.stretchX=s,this.stretchY=a,this.content=h,this.version=o,this.textFitWidth=u,this.textFitHeight=f}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class ig{constructor(e,i){let o={},s={};this.haveRenderCallbacks=[];let a=[];this.addImages(e,o,a),this.addImages(i,s,a);let{w:h,h:u}=tg(a),f=new Ni({width:h||1,height:u||1});for(let p in e){let _=e[p],m=o[p].paddedRect;Ni.copy(_.data,f,{x:0,y:0},{x:m.x+1,y:m.y+1},_.data)}for(let p in i){let _=i[p],m=s[p].paddedRect,w=m.x+1,Q=m.y+1,x=_.data.width,v=_.data.height;Ni.copy(_.data,f,{x:0,y:0},{x:w,y:Q},_.data),Ni.copy(_.data,f,{x:0,y:v-1},{x:w,y:Q-1},{width:x,height:1}),Ni.copy(_.data,f,{x:0,y:0},{x:w,y:Q+v},{width:x,height:1}),Ni.copy(_.data,f,{x:x-1,y:0},{x:w-1,y:Q},{width:1,height:v}),Ni.copy(_.data,f,{x:0,y:0},{x:w+x,y:Q},{width:1,height:v})}this.image=f,this.iconPositions=o,this.patternPositions=s}addImages(e,i,o){for(let s in e){let a=e[s],h={x:0,y:0,w:a.data.width+2,h:a.data.height+2};o.push(h),i[s]=new du(h,a),a.hasRenderCallback&&this.haveRenderCallbacks.push(s)}}patchUpdatedImages(e,i){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let o in e.updatedImages)this.patchUpdatedImage(this.iconPositions[o],e.getImage(o),i),this.patchUpdatedImage(this.patternPositions[o],e.getImage(o),i)}patchUpdatedImage(e,i,o){if(!e||!i||e.version===i.version)return;e.version=i.version;let[s,a]=e.tl;o.update(i.data,void 0,{x:s,y:a})}}var lo;function Uc(r,e,i,o,s,a,h,u,f,p,_,m,w,Q,x){let v=QA.fromFeature(r,s),S;m===D.ax.vertical&&v.verticalizePunctuation();let M=v.determineLineBreaks(p,a,e,o,Q),{processBidirectionalText:L,processStyledBidirectionalText:U}=wr;if(L&&v.sections.length===1){S=[],M=M.map((q=>v.toCodeUnitIndex(q)));let O=L(v.toString(),M);for(let q of O){let W=[...q].map((()=>0));S.push(new QA(q,v.sections,W))}}else if(U){S=[],M=M.map((oe=>v.toCodeUnitIndex(oe)));let O=0,q=[];for(let oe of v.text)q.push(...Array(oe.length).fill(v.sectionIndex[O])),O++;let W=U(v.text,q,M);for(let oe of W){let ne=[],ue="";for(let fe of oe[0])ne.push(oe[1][ue.length]),ue+=fe;S.push(new QA(oe[0],v.sections,ne))}}else S=(function(O,q){let W=[],oe=0;for(let ne of q)W.push(O.substring(oe,ne)),oe=ne;return oe<O.length()&&W.push(O.substring(oe,O.length())),W})(v,M);let k=[],G={positionedLines:k,text:v.toString(),top:_[1],bottom:_[1],left:_[0],right:_[0],writingMode:m,iconsInText:!1,verticalizable:!1};return(function(O,q,W,oe,ne,ue,fe,ce,re,_e,Qe,ye){let Ce=0,ke=0,$e=0,At=0,ut=ce==="right"?1:ce==="left"?0:.5,gi=Jt/ye,Tt=0;for(let wt of ne){wt.trim();let Ai=wt.getMaxScale(),wi={positionedGlyphs:[],lineOffset:0};O.positionedLines[Tt]=wi;let Ei=wi.positionedGlyphs,zi=0;if(!wt.length()){ke+=ue,++Tt;continue}let pi=fm(oe,wt,gi),Yi=0;for(let $t of wt.text){let bt=wt.getSection(Yi),Kt=$t.codePointAt(0),Ut=mm(re,Qe,Kt),ei={glyph:Kt,imageName:null,x:Ce,y:ke+-17,vertical:Ut,scale:1,fontStack:"",sectionIndex:wt.getSectionIndex(Yi),metrics:null,rect:null},Sn;if("fontStack"in bt){if(Sn=Bm(bt,Kt,Ut,pi,q,W),!Sn)continue;ei.fontStack=bt.fontStack}else{if(O.iconsInText=!0,bt.scale*=gi,Sn=_m(bt,Ut,Ai,pi,oe),!Sn)continue;zi=Math.max(zi,Sn.imageOffset),ei.imageName=bt.imageName}let{rect:Fr,metrics:al,baselineOffset:mo}=Sn;ei.y+=mo,ei.scale=bt.scale,ei.metrics=al,ei.rect=Fr,Ei.push(ei),Ut?(O.verticalizable=!0,Ce+=("imageName"in bt?al.advance:Jt)*bt.scale+_e):Ce+=al.advance*bt.scale+_e,Yi++}Ei.length!==0&&($e=Math.max(Ce-_e,$e),ym(Ei,0,Ei.length-1,ut)),Ce=0,wi.lineOffset=Math.max(zi,(Ai-1)*Jt);let fr=ue*Ai+zi;ke+=fr,At=Math.max(fr,At),++Tt}let{horizontalAlign:Xt,verticalAlign:Wt}=gu(fe);(function(wt,Ai,wi,Ei,zi,pi,Yi,fr,$t){let bt=(Ai-wi)*zi,Kt=0;Kt=pi!==Yi?-fr*Ei- -17:-Ei*$t*Yi+.5*Yi;for(let Ut of wt)for(let ei of Ut.positionedGlyphs)ei.x+=bt,ei.y+=Kt})(O.positionedLines,ut,Xt,Wt,$e,At,ue,ke,ne.length),O.top+=-Wt*ke,O.bottom=O.top+ke,O.left+=-Xt*$e,O.right=O.left+$e})(G,e,i,o,S,h,u,f,m,p,w,x),!(function(O){for(let q of O)if(q.positionedGlyphs.length!==0)return!1;return!0})(k)&&G}function gu(r){let e=.5,i=.5;switch(r){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(r){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function fm(r,e,i){let o=e.getMaxScale()*Jt,{maxImageWidth:s,maxImageHeight:a}=e.getMaxImageSize(r),h=Math.max(o,a*i);return{verticalLineContentWidth:Math.max(o,s*i),horizontalLineContentHeight:h}}function rg(r){switch(r){case"top":return 0;case"center":return .5;default:return 1}}function mm(r,e,i){return!(r===D.ax.horizontal||!e&&!En(i)||e&&(cc(i)||(o=i,/\p{sc=Arab}/u.test(String.fromCodePoint(o)))));var o}function Bm(r,e,i,o,s,a){let h=a[r.fontStack],u=(function(p,_,m,w){if(p!=null&&p.rect)return p;let Q=_[m.fontStack],x=Q==null?void 0:Q[w];return x?{rect:null,metrics:x.metrics}:null})(h==null?void 0:h[e],s,r,e);if(u===null)return null;let f;if(i)f=o.verticalLineContentWidth-r.scale*Jt;else{let p=rg(r.verticalAlign);f=(o.horizontalLineContentHeight-r.scale*Jt)*p}return{rect:u.rect,metrics:u.metrics,baselineOffset:f}}function _m(r,e,i,o,s){let a=s[r.imageName];if(!a)return null;let h=a.paddedRect,u=a.displaySize,f={width:u[0],height:u[1],left:1,top:-3,advance:e?u[1]:u[0]},p;if(e)p=o.verticalLineContentWidth-u[1]*r.scale;else{let _=rg(r.verticalAlign);p=(o.horizontalLineContentHeight-u[1]*r.scale)*_}return{rect:h,metrics:f,baselineOffset:p,imageOffset:(e?u[0]:u[1])*r.scale-Jt*i}}function ym(r,e,i,o){if(o===0)return;let s=r[i],a=(r[i].x+s.metrics.advance*s.scale)*o;for(let h=e;h<=i;h++)r[h].x-=a}function Qm(r,e,i){let{horizontalAlign:o,verticalAlign:s}=gu(i),a=e[0]-r.displaySize[0]*o,h=e[1]-r.displaySize[1]*s;return{image:r,top:h,bottom:h+r.displaySize[1],left:a,right:a+r.displaySize[0]}}function ng(r){var e,i;let o=r.left,s=r.top,a=r.right-o,h=r.bottom-s,u=(e=r.image.textFitWidth)!==null&&e!==void 0?e:"stretchOrShrink",f=(i=r.image.textFitHeight)!==null&&i!==void 0?i:"stretchOrShrink",p=(r.image.content[2]-r.image.content[0])/(r.image.content[3]-r.image.content[1]);if(f==="proportional"){if(u==="stretchOnly"&&a/h<p||u==="proportional"){let _=Math.ceil(h*p);o*=_/a,a=_}}else if(u==="proportional"&&f==="stretchOnly"&&p!==0&&a/h>p){let _=Math.ceil(a/p);s*=_/h,h=_}return{x1:o,y1:s,x2:o+a,y2:s+h}}function og(r,e,i,o,s,a){let h=r.image,u;if(h.content){let S=h.content,M=h.pixelRatio||1;u=[S[0]/M,S[1]/M,h.displaySize[0]-S[2]/M,h.displaySize[1]-S[3]/M]}let f=e.left*a,p=e.right*a,_,m,w,Q;i==="width"||i==="both"?(Q=s[0]+f-o[3],m=s[0]+p+o[1]):(Q=s[0]+(f+p-h.displaySize[0])/2,m=Q+h.displaySize[0]);let x=e.top*a,v=e.bottom*a;return i==="height"||i==="both"?(_=s[1]+x-o[0],w=s[1]+v+o[2]):(_=s[1]+(x+v-h.displaySize[1])/2,w=_+h.displaySize[1]),{image:h,top:_,right:m,bottom:w,left:Q,collisionPadding:u}}be("ImagePosition",du),be("ImageAtlas",ig),D.ax=void 0,(lo=D.ax||(D.ax={}))[lo.none=0]="none",lo[lo.horizontal=1]="horizontal",lo[lo.vertical=2]="vertical",lo[lo.horizontalOnly=3]="horizontalOnly";let Fn=128,co=32640;function sg(r,e){let{expression:i}=e;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new Bt(r+1))};if(i.kind==="source")return{kind:"source"};{let{zoomStops:o,interpolationType:s}=i,a=0;for(;a<o.length&&o[a]<=r;)a++;a=Math.max(0,a-1);let h=a;for(;h<o.length&&o[h]<r+1;)h++;h=Math.min(o.length-1,h);let u=o[a],f=o[h];return i.kind==="composite"?{kind:"composite",minZoom:u,maxZoom:f,interpolationType:s}:{kind:"camera",minZoom:u,maxZoom:f,minSize:i.evaluate(new Bt(u)),maxSize:i.evaluate(new Bt(f)),interpolationType:s}}}function pu(r,e,i){let o="never",s=r.get(e);return s?o=s:r.get(i)&&(o="always"),o}let Cm=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Lc(r,e,i,o,s,a,h,u,f,p,_,m,w){let Q=u?Math.min(co,Math.round(u[0])):0,x=u?Math.min(co,Math.round(u[1])):0;r.emplaceBack(e,i,Math.round(32*o),Math.round(32*s),a,h,(Q<<1)+(f?1:0),x,16*p,16*_,256*m,256*w)}function fu(r,e,i){r.emplaceBack(e.x,e.y,i),r.emplaceBack(e.x,e.y,i),r.emplaceBack(e.x,e.y,i),r.emplaceBack(e.x,e.y,i)}function wm(r){for(let e of r.sections)if(Sa(e.text))return!0;return!1}class mu{constructor(e){this.layoutVertexArray=new X,this.indexArray=new me,this.programConfigurations=e,this.segments=new ve,this.dynamicLayoutVertexArray=new te,this.opacityVertexArray=new Ae,this.hasVisibleVertices=!1,this.placedSymbolArray=new B}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,i,o,s){this.isEmpty()||(o&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Hf.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,i),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Jf.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Cm,!0),this.opacityVertexBuffer.itemSize=1),(o||s)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}be("SymbolBuffers",mu);class Bu{constructor(e,i,o){this.layoutVertexArray=new e,this.layoutAttributes=i,this.indexArray=new o,this.segments=new ve,this.collisionVertexArray=new Be}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,qf.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}be("CollisionBuffers",Bu);class wA{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((h=>h.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=sg(this.zoom,i["text-size"]),this.iconSizeData=sg(this.zoom,i["icon-size"]);let o=this.layers[0].layout,s=o.get("symbol-sort-key"),a=o.get("symbol-z-order");this.canOverlap=pu(o,"text-overlap","text-allow-overlap")!=="never"||pu(o,"icon-overlap","icon-allow-overlap")!=="never"||o.get("text-ignore-placement")||o.get("icon-ignore-placement"),this.sortFeaturesByKey=a!=="viewport-y"&&!s.isConstant(),this.sortFeaturesByY=(a==="viewport-y"||a==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,o.get("symbol-placement")==="point"&&(this.writingModes=o.get("text-writing-mode").map((h=>D.ax[h]))),this.stateDependentLayerIds=this.layers.filter((h=>h.isStateDependent())).map((h=>h.id)),this.sourceID=e.sourceID}createArrays(){this.text=new mu(new xr(this.layers,this.zoom,(e=>e.startsWith("text")))),this.icon=new mu(new xr(this.layers,this.zoom,(e=>e.startsWith("icon")))),this.glyphOffsetArray=new E,this.lineVertexArray=new I,this.symbolInstances=new C,this.textAnchorOffsets=new F}calculateGlyphDependencies(e,i,o,s,a){for(let h of e)if(i[h.codePointAt(0)]=!0,(o||s)&&a){let u=rl[h];u&&(i[u.codePointAt(0)]=!0)}}populate(e,i,o){var s;let a=this.layers[0],h=a.layout,u=h.get("text-font"),f=h.get("text-field"),p=h.get("icon-image"),_=(f.value.kind!=="constant"||f.value.value instanceof Fi&&!f.value.value.isEmpty()||f.value.value.toString().length>0)&&(u.value.kind!=="constant"||u.value.value.length>0),m=p.value.kind!=="constant"||!!p.value.value||Object.keys(p.parameters).length>0,w=h.get("symbol-sort-key");if(this.features=[],!_&&!m)return;let Q=i.iconDependencies,x=i.glyphDependencies,v=i.availableImages,S=new Bt(this.zoom);for(let{feature:M,id:L,index:U,sourceLayerIndex:k}of e){let G=a._featureFilter.needGeometry,O=Jr(M,G);if(!a._featureFilter.filter(S,O,o))continue;let q,W;if(G||(O.geometry=Hr(M)),_){let ne=a.getValueAndResolveTokens("text-field",O,o,v),ue=Fi.factory(ne);this.hasRTLText||(this.hasRTLText=wm(ue)),(!this.hasRTLText||wr.getRTLTextPluginStatus()==="unavailable"||this.hasRTLText&&wr.isParsed())&&(q=em(ue,a,O))}if(m){let ne=a.getValueAndResolveTokens("icon-image",O,o,v);W=ne instanceof ki?ne:ki.fromString(ne)}if(!q&&!W)continue;let oe=this.sortFeaturesByKey?w.evaluate(O,{},o):void 0;if(this.features.push({id:L,text:q,icon:W,index:U,sourceLayerIndex:k,geometry:O.geometry,properties:M.properties,type:Wa.types[M.type],sortKey:oe}),W&&(Q[W.name]=!0),q){let ne=u.evaluate(O,{},o).join(","),ue=h.get("text-rotation-alignment")!=="viewport"&&h.get("symbol-placement")!=="point";this.allowVerticalPlacement=(s=this.writingModes)===null||s===void 0?void 0:s.includes(D.ax.vertical);for(let fe of q.sections)if(fe.image)Q[fe.image.name]=!0;else{let ce=va(q.toString()),re=fe.fontStack||ne;x[re]||(x[re]={}),this.calculateGlyphDependencies(fe.text,x[re],ue,this.allowVerticalPlacement,ce)}}}h.get("symbol-placement")==="line"&&(this.features=(function(M){let L={},U={},k=[],G=0;function O(ne){k.push(M[ne]),G++}function q(ne,ue,fe){let ce=U[ne];return delete U[ne],U[ue]=ce,k[ce].geometry[0].pop(),k[ce].geometry[0]=k[ce].geometry[0].concat(fe[0]),ce}function W(ne,ue,fe){let ce=L[ue];return delete L[ue],L[ne]=ce,k[ce].geometry[0].shift(),k[ce].geometry[0]=fe[0].concat(k[ce].geometry[0]),ce}function oe(ne,ue,fe){let ce=fe?ue[0][ue[0].length-1]:ue[0][0];return`${ne}:${ce.x}:${ce.y}`}for(let ne=0;ne<M.length;ne++){let ue=M[ne],fe=ue.geometry,ce=ue.text?ue.text.toString():null;if(!ce){O(ne);continue}let re=oe(ce,fe),_e=oe(ce,fe,!0);if(re in U&&_e in L&&U[re]!==L[_e]){let Qe=W(re,_e,fe),ye=q(re,_e,k[Qe].geometry);delete L[re],delete U[_e],U[oe(ce,k[ye].geometry,!0)]=ye,k[Qe].geometry=null}else re in U?q(re,_e,fe):_e in L?W(re,_e,fe):(O(ne),L[re]=G-1,U[_e]=G-1)}return k.filter((ne=>ne.geometry))})(this.features)),this.sortFeaturesByKey&&this.features.sort(((M,L)=>M.sortKey-L.sortKey))}update(e,i,o){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,i,this.layers,{imagePositions:o}),this.icon.programConfigurations.updatePaintArrays(e,i,this.layers,{imagePositions:o}))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,i){let o=this.lineVertexArray.length;if(e.segment!==void 0){let s=e.dist(i[e.segment+1]),a=e.dist(i[e.segment]),h={};for(let u=e.segment+1;u<i.length;u++)h[u]={x:i[u].x,y:i[u].y,tileUnitDistanceFromAnchor:s},u<i.length-1&&(s+=i[u+1].dist(i[u]));for(let u=e.segment||0;u>=0;u--)h[u]={x:i[u].x,y:i[u].y,tileUnitDistanceFromAnchor:a},u>0&&(a+=i[u-1].dist(i[u]));for(let u=0;u<i.length;u++){let f=h[u];this.lineVertexArray.emplaceBack(f.x,f.y,f.tileUnitDistanceFromAnchor)}}return{lineStartIndex:o,lineLength:this.lineVertexArray.length-o}}addSymbols(e,i,o,s,a,h,u,f,p,_,m,w){let Q=e.indexArray,x=e.layoutVertexArray,v=e.segments.prepareSegment(4*i.length,x,Q,this.canOverlap?h.sortKey:void 0),S=this.glyphOffsetArray.length,M=v.vertexLength,L=this.allowVerticalPlacement&&u===D.ax.vertical?Math.PI/2:0,U=h.text&&h.text.sections;for(let k=0;k<i.length;k++){let{tl:G,tr:O,bl:q,br:W,tex:oe,pixelOffsetTL:ne,pixelOffsetBR:ue,minFontScaleX:fe,minFontScaleY:ce,glyphOffset:re,isSDF:_e,sectionIndex:Qe}=i[k],ye=v.vertexLength,Ce=re[1];Lc(x,f.x,f.y,G.x,Ce+G.y,oe.x,oe.y,o,_e,ne.x,ne.y,fe,ce),Lc(x,f.x,f.y,O.x,Ce+O.y,oe.x+oe.w,oe.y,o,_e,ue.x,ne.y,fe,ce),Lc(x,f.x,f.y,q.x,Ce+q.y,oe.x,oe.y+oe.h,o,_e,ne.x,ue.y,fe,ce),Lc(x,f.x,f.y,W.x,Ce+W.y,oe.x+oe.w,oe.y+oe.h,o,_e,ue.x,ue.y,fe,ce),fu(e.dynamicLayoutVertexArray,f,L),Q.emplaceBack(ye,ye+2,ye+1),Q.emplaceBack(ye+1,ye+2,ye+3),v.vertexLength+=4,v.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(re[0]),k!==i.length-1&&Qe===i[k+1].sectionIndex||e.programConfigurations.populatePaintArrays(x.length,h,h.index,{imagePositions:{},canonical:w,formattedSection:U==null?void 0:U[Qe]})}e.placedSymbolArray.emplaceBack(f.x,f.y,S,this.glyphOffsetArray.length-S,M,p,_,f.segment,o?o[0]:0,o?o[1]:0,s[0],s[1],u,0,!1,0,m)}_addCollisionDebugVertex(e,i,o,s,a,h){return i.emplaceBack(0,0),e.emplaceBack(o.x,o.y,s,a,Math.round(h.x),Math.round(h.y))}addCollisionDebugVertices(e,i,o,s,a,h,u){let f=a.segments.prepareSegment(4,a.layoutVertexArray,a.indexArray),p=f.vertexLength,_=a.layoutVertexArray,m=a.collisionVertexArray,w=u.anchorX,Q=u.anchorY;this._addCollisionDebugVertex(_,m,h,w,Q,new se(e,i)),this._addCollisionDebugVertex(_,m,h,w,Q,new se(o,i)),this._addCollisionDebugVertex(_,m,h,w,Q,new se(o,s)),this._addCollisionDebugVertex(_,m,h,w,Q,new se(e,s)),f.vertexLength+=4;let x=a.indexArray;x.emplaceBack(p,p+1),x.emplaceBack(p+1,p+2),x.emplaceBack(p+2,p+3),x.emplaceBack(p+3,p),f.primitiveLength+=4}addDebugCollisionBoxes(e,i,o,s){for(let a=e;a<i;a++){let h=this.collisionBoxArray.get(a);this.addCollisionDebugVertices(h.x1,h.y1,h.x2,h.y2,s?this.textCollisionBox:this.iconCollisionBox,h.anchorPoint,o)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Bu(ae,Vd.members,Fe),this.iconCollisionBox=new Bu(ae,Vd.members,Fe);for(let e=0;e<this.symbolInstances.length;e++){let i=this.symbolInstances.get(e);this.addDebugCollisionBoxes(i.textBoxStartIndex,i.textBoxEndIndex,i,!0),this.addDebugCollisionBoxes(i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i,!0),this.addDebugCollisionBoxes(i.iconBoxStartIndex,i.iconBoxEndIndex,i,!1),this.addDebugCollisionBoxes(i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex,i,!1)}}_deserializeCollisionBoxesForSymbol(e,i,o,s,a,h,u,f,p){let _={};for(let m=i;m<o;m++){let w=e.get(m);_.textBox={x1:w.x1,y1:w.y1,x2:w.x2,y2:w.y2,anchorPointX:w.anchorPointX,anchorPointY:w.anchorPointY},_.textFeatureIndex=w.featureIndex;break}for(let m=s;m<a;m++){let w=e.get(m);_.verticalTextBox={x1:w.x1,y1:w.y1,x2:w.x2,y2:w.y2,anchorPointX:w.anchorPointX,anchorPointY:w.anchorPointY},_.verticalTextFeatureIndex=w.featureIndex;break}for(let m=h;m<u;m++){let w=e.get(m);_.iconBox={x1:w.x1,y1:w.y1,x2:w.x2,y2:w.y2,anchorPointX:w.anchorPointX,anchorPointY:w.anchorPointY},_.iconFeatureIndex=w.featureIndex;break}for(let m=f;m<p;m++){let w=e.get(m);_.verticalIconBox={x1:w.x1,y1:w.y1,x2:w.x2,y2:w.y2,anchorPointX:w.anchorPointX,anchorPointY:w.anchorPointY},_.verticalIconFeatureIndex=w.featureIndex;break}return _}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let i=0;i<this.symbolInstances.length;i++){let o=this.symbolInstances.get(i);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,o.textBoxStartIndex,o.textBoxEndIndex,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o.iconBoxStartIndex,o.iconBoxEndIndex,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,i){let o=e.placedSymbolArray.get(i),s=o.vertexStartIndex+4*o.numGlyphs;for(let a=o.vertexStartIndex;a<s;a+=4)e.indexArray.emplaceBack(a,a+2,a+1),e.indexArray.emplaceBack(a+1,a+2,a+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let i=Math.sin(e),o=Math.cos(e),s=[],a=[],h=[];for(let u=0;u<this.symbolInstances.length;++u){h.push(u);let f=this.symbolInstances.get(u);s.push(0|Math.round(i*f.anchorX+o*f.anchorY)),a.push(f.featureIndex)}return h.sort(((u,f)=>s[u]-s[f]||a[f]-a[u])),h}addToSortKeyRanges(e,i){let o=this.sortKeyRanges[this.sortKeyRanges.length-1];(o==null?void 0:o.sortKey)===i?o.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:i,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let i of this.symbolInstanceIndexes){let o=this.symbolInstances.get(i);this.featureSortOrder.push(o.featureIndex);let s=[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex];for(let a=0;a<s.length;a++){let h=s[a];h>=0&&s.indexOf(h)===a&&this.addIndicesForPlacedSymbol(this.text,h)}o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,o.verticalPlacedTextSymbolIndex),o.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.placedIconSymbolIndex),o.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Ag,ag;be("SymbolBucket",wA,{omit:["layers","collisionBoxArray","features","compareText"]}),wA.MAX_GLYPHS=65535,wA.addDynamicAttributes=fu;var _u={get paint(){return ag=ag||new _i({"icon-opacity":new Le(he.paint_symbol["icon-opacity"]),"icon-color":new Le(he.paint_symbol["icon-color"]),"icon-halo-color":new Le(he.paint_symbol["icon-halo-color"]),"icon-halo-width":new Le(he.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Le(he.paint_symbol["icon-halo-blur"]),"icon-translate":new De(he.paint_symbol["icon-translate"]),"icon-translate-anchor":new De(he.paint_symbol["icon-translate-anchor"]),"text-opacity":new Le(he.paint_symbol["text-opacity"]),"text-color":new Le(he.paint_symbol["text-color"],{runtimeType:Li,getOverride:r=>r.textColor,hasOverride:r=>!!r.textColor}),"text-halo-color":new Le(he.paint_symbol["text-halo-color"]),"text-halo-width":new Le(he.paint_symbol["text-halo-width"]),"text-halo-blur":new Le(he.paint_symbol["text-halo-blur"]),"text-translate":new De(he.paint_symbol["text-translate"]),"text-translate-anchor":new De(he.paint_symbol["text-translate-anchor"])})},get layout(){return Ag=Ag||new _i({"symbol-placement":new De(he.layout_symbol["symbol-placement"]),"symbol-spacing":new De(he.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new De(he.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Le(he.layout_symbol["symbol-sort-key"]),"symbol-z-order":new De(he.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new De(he.layout_symbol["icon-allow-overlap"]),"icon-overlap":new De(he.layout_symbol["icon-overlap"]),"icon-ignore-placement":new De(he.layout_symbol["icon-ignore-placement"]),"icon-optional":new De(he.layout_symbol["icon-optional"]),"icon-rotation-alignment":new De(he.layout_symbol["icon-rotation-alignment"]),"icon-size":new Le(he.layout_symbol["icon-size"]),"icon-text-fit":new De(he.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new De(he.layout_symbol["icon-text-fit-padding"]),"icon-image":new Le(he.layout_symbol["icon-image"]),"icon-rotate":new Le(he.layout_symbol["icon-rotate"]),"icon-padding":new Le(he.layout_symbol["icon-padding"]),"icon-keep-upright":new De(he.layout_symbol["icon-keep-upright"]),"icon-offset":new Le(he.layout_symbol["icon-offset"]),"icon-anchor":new Le(he.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new De(he.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new De(he.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new De(he.layout_symbol["text-rotation-alignment"]),"text-field":new Le(he.layout_symbol["text-field"]),"text-font":new Le(he.layout_symbol["text-font"]),"text-size":new Le(he.layout_symbol["text-size"]),"text-max-width":new Le(he.layout_symbol["text-max-width"]),"text-line-height":new De(he.layout_symbol["text-line-height"]),"text-letter-spacing":new Le(he.layout_symbol["text-letter-spacing"]),"text-justify":new Le(he.layout_symbol["text-justify"]),"text-radial-offset":new Le(he.layout_symbol["text-radial-offset"]),"text-variable-anchor":new De(he.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Le(he.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Le(he.layout_symbol["text-anchor"]),"text-max-angle":new De(he.layout_symbol["text-max-angle"]),"text-writing-mode":new De(he.layout_symbol["text-writing-mode"]),"text-rotate":new Le(he.layout_symbol["text-rotate"]),"text-padding":new De(he.layout_symbol["text-padding"]),"text-keep-upright":new De(he.layout_symbol["text-keep-upright"]),"text-transform":new Le(he.layout_symbol["text-transform"]),"text-offset":new Le(he.layout_symbol["text-offset"]),"text-allow-overlap":new De(he.layout_symbol["text-allow-overlap"]),"text-overlap":new De(he.layout_symbol["text-overlap"]),"text-ignore-placement":new De(he.layout_symbol["text-ignore-placement"]),"text-optional":new De(he.layout_symbol["text-optional"])})}};class lg{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Pr,this.defaultValue=e}evaluate(e){if(e.formattedSection){let i=this.defaultValue.property.overrides;if(i!=null&&i.hasOverride(e.formattedSection))return i.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}be("FormatSectionOverride",lg,{omit:["defaultValue"]});class kc extends Hi{constructor(e,i){super(e,_u,i)}recalculate(e,i){if(super.recalculate(e,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let o=this.layout.get("text-writing-mode");if(o){let s=[];for(let a of o)s.includes(a)||s.push(a);this.layout._values["text-writing-mode"]=s}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,i,o,s){let a=this.layout.get(e).evaluate(i,{},o,s),h=this._unevaluatedLayout._values[e];return h.isDataDriven()||js(h.value)||!a?a:(function(u,f){return f.replace(/{([^{}]+)}/g,((p,_)=>u&&_ in u?String(u[_]):""))})(i.properties,a)}createBucket(e){return new wA(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of _u.paint.overridableProperties){if(!kc.hasPaintOverride(this.layout,e))continue;let i=this.paint.get(e),o=new lg(i),s=new zo(o,i.property.specification),a=null;a=i.value.kind==="constant"||i.value.kind==="source"?new Xs("source",s):new Vs("composite",s,i.value.zoomStops),this.paint._values[e]=new ar(i.property,a,i.parameters)}}_handleOverridablePaintPropertyUpdate(e,i,o){return!(!this.layout||i.isDataDriven()||o.isDataDriven())&&kc.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,i){let o=e.get("text-field"),s=_u.paint.properties[i],a=!1,h=u=>{var f;for(let p of u)if(!((f=s.overrides)===null||f===void 0)&&f.hasOverride(p))return void(a=!0)};if(o.value.kind==="constant"&&o.value.value instanceof Fi)h(o.value.value.sections);else if(o.value.kind==="source"||o.value.kind==="composite"){let u=p=>{a||(p instanceof cr&&kt(p.value)===bo?h(p.value.sections):p instanceof pn?h(p.sections):p.eachChild(u))},f=o.value;f._styleExpression&&u(f._styleExpression.expression)}return a}}let cg;var Em={get paint(){return cg=cg||new _i({"background-color":new De(he.paint_background["background-color"]),"background-pattern":new fc(he.paint_background["background-pattern"]),"background-opacity":new De(he.paint_background["background-opacity"])})}};class Im extends Hi{constructor(e,i){super(e,Em,i)}}class xm extends Hi{constructor(e,i){super(e,{},i),this.onAdd=o=>{this.implementation.onAdd&&this.implementation.onAdd(o,o.painter.context.gl)},this.onRemove=o=>{this.implementation.onRemove&&this.implementation.onRemove(o,o.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class vm{constructor(e){this._methodToThrottle=e,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var e;this._triggered||(this._triggered=!0,(e=this._channel)===null||e===void 0||e.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let bm={once:!0},yu=63710088e-1;class ho{constructor(e,i){if(isNaN(e)||isNaN(i))throw new Error(`Invalid LngLat object: (${e}, ${i})`);if(this.lng=+e,this.lat=+i,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new ho(Un(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let i=Math.PI/180,o=this.lat*i,s=e.lat*i,a=Math.sin(o)*Math.sin(s)+Math.cos(o)*Math.cos(s)*Math.cos((e.lng-this.lng)*i);return yu*Math.acos(Math.min(a,1))}static convert(e){if(e instanceof ho)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new ho(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new ho(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}let hg=2*Math.PI*yu;function ug(r){return hg*Math.cos(r*Math.PI/180)}function dg(r){return(180+r)/360}function gg(r){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360}function pg(r,e){return r/ug(e)}function fg(r){return 360*r-180}function Pc(r){return 360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90}function mg(r,e){return r*ug(Pc(e))}class nl{constructor(e,i,o=0){this.x=+e,this.y=+i,this.z=+o}static fromLngLat(e,i=0){let o=ho.convert(e);return new nl(dg(o.lng),gg(o.lat),pg(i,o.lat))}toLngLat(){return new ho(fg(this.x),Pc(this.y))}toAltitude(){return mg(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/hg*(e=Pc(this.y),1/Math.cos(e*Math.PI/180));var e}}function Bg(r,e,i){var o=2*Math.PI*6378137/256/Math.pow(2,i);return[r*o-2*Math.PI*6378137/2,e*o-2*Math.PI*6378137/2]}class Qu{constructor(e,i,o){if(!(function(s,a,h){return!(s<0||s>25||h<0||h>=Math.pow(2,s)||a<0||a>=Math.pow(2,s))})(e,i,o))throw new Error(`x=${i}, y=${o}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=i,this.y=o,this.key=EA(0,e,e,i,o)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,i,o){let s=(h=this.y,u=this.z,f=Bg(256*(a=this.x),256*(h=Math.pow(2,u)-h-1),u),p=Bg(256*(a+1),256*(h+1),u),f[0]+","+f[1]+","+p[0]+","+p[1]);var a,h,u,f,p;let _=(function(m,w,Q){let x="";for(let v=m;v>0;v--){let S=1<<v-1;x+=(w&S?1:0)+(Q&S?2:0)}return x})(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(o==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,i>1?"@2x":"").replace(/{quadkey}/g,_).replace(/{bbox-epsg-3857}/g,s)}isChildOf(e){let i=this.z-e.z;return i>0&&e.x===this.x>>i&&e.y===this.y>>i}getTilePoint(e){let i=Math.pow(2,this.z);return new se((e.x*i-this.x)*Ge,(e.y*i-this.y)*Ge)}toString(){return`${this.z}/${this.x}/${this.y}`}}class _g{constructor(e,i){this.wrap=e,this.canonical=i,this.key=EA(e,i.z,i.z,i.x,i.y)}}class qi{constructor(e,i,o,s,a){if(this.terrainRttPosMatrix32f=null,e<o)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${o}`);this.overscaledZ=e,this.wrap=i,this.canonical=new Qu(o,+s,+a),this.key=EA(i,e,o,s,a)}clone(){return new qi(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-e;return e>this.canonical.z?new qi(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new qi(e,this.wrap,e,this.canonical.x>>i,this.canonical.y>>i)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,i){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let o=this.canonical.z-e;return e>this.canonical.z?EA(this.wrap*+i,e,this.canonical.z,this.canonical.x,this.canonical.y):EA(this.wrap*+i,e,e,this.canonical.x>>o,this.canonical.y>>o)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;let i=this.canonical.z-e.canonical.z;return!(i<0)&&e.canonical.x===this.canonical.x>>i&&e.canonical.y===this.canonical.y>>i}children(e){if(this.overscaledZ>=e)return[new qi(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let i=this.canonical.z+1,o=2*this.canonical.x,s=2*this.canonical.y;return[new qi(i,this.wrap,i,o,s),new qi(i,this.wrap,i,o+1,s),new qi(i,this.wrap,i,o,s+1),new qi(i,this.wrap,i,o+1,s+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new qi(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new qi(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new _g(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new nl(e.x-this.wrap,e.y))}normalizeCoordinates(e,i,o=8192){if(e>=0&&e<o&&i>=0&&i<o)return{tileID:this,x:e,y:i};let s=Math.floor(e/o),a=Math.floor(i/o),h=e-s*o,u=i-a*o,f=this.canonical.z,p=1<<f,_=this.canonical.y+a;if(_<0||_>=p)return null;let m=this.canonical.x+s,w=this.wrap;return m<0?(w-=Math.ceil(-m/p),m=(m%p+p)%p):m>=p&&(w+=Math.floor(m/p),m%=p),{tileID:new qi(this.overscaledZ,w,f,m,_),x:h,y:u}}}function EA(r,e,i,o,s){(r*=2)<0&&(r=-1*r-1);let a=1<<i;return(a*a*r+a*s+o).toString(36)+i.toString(36)+e.toString(36)}be("CanonicalTileID",Qu),be("OverscaledTileID",qi,{omit:["terrainRttPosMatrix32f"]});class hs{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let i=new hs;return i.extend(e(new se(this.minX,this.minY))),i.extend(e(new se(this.maxX,this.minY))),i.extend(e(new se(this.minX,this.maxY))),i.extend(e(new se(this.maxX,this.maxY))),i}static fromPoints(e){let i=new hs;for(let o of e)i.extend(o);return i}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}}class yg{constructor(e){this._stringToNumber={},this._numberToString=[];for(let i=0;i<e.length;i++){let o=e[i];this._stringToNumber[o]=i,this._numberToString[i]=o}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class Qg{constructor(e,i,o,s,a){this.type="Feature",this._vectorTileFeature=e,this._x=o,this._y=s,this._z=i,this.properties=e.properties,this.id=a}projectPoint(e,i,o,s){return[360*(e.x+i)/s-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+o)/s)*Math.PI))-90]}projectLine(e,i,o,s){return e.map((a=>this.projectPoint(a,i,o,s)))}get geometry(){if(this._geometry)return this._geometry;let e=this._vectorTileFeature,i=e.extent*Math.pow(2,this._z),o=e.extent*this._x,s=e.extent*this._y,a=e.loadGeometry();switch(e.type){case 1:{let h=[];for(let f of a)h.push(f[0]);let u=this.projectLine(h,o,s,i);this._geometry=h.length===1?{type:"Point",coordinates:u[0]}:{type:"MultiPoint",coordinates:u};break}case 2:{let h=a.map((u=>this.projectLine(u,o,s,i)));this._geometry=h.length===1?{type:"LineString",coordinates:h[0]}:{type:"MultiLineString",coordinates:h};break}case 3:{let h=Ed(a),u=[];for(let f of h)u.push(f.map((p=>this.projectLine(p,o,s,i))));this._geometry=u.length===1?{type:"Polygon",coordinates:u[0]}:{type:"MultiPolygon",coordinates:u};break}default:throw new Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let i in this)i!=="_geometry"&&i!=="_vectorTileFeature"&&i!=="_x"&&i!=="_y"&&i!=="_z"&&(e[i]=this[i]);return e}}class IA{constructor(e,i,o){this._name=e,this.dataBuffer=i,typeof o=="number"?this._size=o:(this.nullabilityBuffer=o,this._size=o.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){var i;return((i=this.nullabilityBuffer)==null?void 0:i.get(e))||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}}class Gc extends IA{}class Cu extends Gc{getValueFromBuffer(e){return this.dataBuffer[e]}}class wu extends Gc{getValueFromBuffer(e){return this.dataBuffer[e]}}class Cg extends IA{constructor(e,i,o,s){super(e,i,s),this.delta=o}}class Eu extends Cg{constructor(e,i,o,s){super(e,Int32Array.of(i),o,s)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}}class Iu extends IA{constructor(e,i,o,s){super(e,s?Int32Array.of(i):Uint32Array.of(i),o)}getValueFromBuffer(e){return this.dataBuffer[0]}}class Fm{constructor(e,i,o,s,a=4096){this._name=e,this._geometryVector=i,this._idVector=o,this._propertyVectors=s,this._extent=a}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors}getPropertyVector(e){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this._propertyVectors.map((i=>[i.name,i])))),this.propertyVectorsMap.get(e)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let e=[],i=this.geometryVector.getGeometries();for(let o=0;o<this.numFeatures;o++){let s;if(this.idVector){let u=this.idVector.getValue(o);s=this.containsMaxSafeIntegerValues(this.idVector)&&u!==null?Number(u):u}let a={coordinates:i[o],type:this.geometryVector.geometryType(o)},h={};for(let u of this.propertyVectors){if(!u)continue;let f=u.name,p=u.getValue(o);p!==null&&(h[f]=p)}e.push({id:s,geometry:a,properties:h})}return e}containsMaxSafeIntegerValues(e){return e instanceof Cu||e instanceof Iu||e instanceof Eu||e instanceof wu}}class wg{constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}increment(){return this.value++}add(e){this.value+=e}}var We,uo;(function(r){r.NONE="NONE",r.DELTA="DELTA",r.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",r.RLE="RLE",r.MORTON="MORTON",r.PDE="PDE"})(We||(We={})),(function(r){r.NONE="NONE",r.FAST_PFOR="FAST_PFOR",r.VARINT="VARINT",r.ALP="ALP"})(uo||(uo={}));let xu=new Uint32Array(33);xu[0]=0;for(let r=1;r<=32;r++)xu[r]=r===32?4294967295:4294967295>>>32-r;let vu=xu,Dn=256;function bu(r,e){return r-r%e}function Dm(r){let e=r>>>0;return((255&e)<<24|(65280&e)<<8|e>>>8&65280|e>>>24&255)>>>0}let Fu=(function(){if(!Number.isFinite(65536))return 65536;let r=bu(Math.floor(65536),Dn);return r===0?Dn:r})(),Sm=3*Fu/Dn+Fu|0;function Eg(){let r=new Uint8Array(Sm);return{dataToBePacked:new Array(33),dataPointers:new Int32Array(33),byteContainer:r,byteContainerI32:new Int32Array(r.buffer,r.byteOffset,r.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function Mm(r,e,i,o,s){switch(s){case 1:(function(a,h,u,f){let p=f,_=h;for(let m=0;m<8;m++){let w=a[_++]>>>0;u[p++]=w>>>0&1,u[p++]=w>>>1&1,u[p++]=w>>>2&1,u[p++]=w>>>3&1,u[p++]=w>>>4&1,u[p++]=w>>>5&1,u[p++]=w>>>6&1,u[p++]=w>>>7&1,u[p++]=w>>>8&1,u[p++]=w>>>9&1,u[p++]=w>>>10&1,u[p++]=w>>>11&1,u[p++]=w>>>12&1,u[p++]=w>>>13&1,u[p++]=w>>>14&1,u[p++]=w>>>15&1,u[p++]=w>>>16&1,u[p++]=w>>>17&1,u[p++]=w>>>18&1,u[p++]=w>>>19&1,u[p++]=w>>>20&1,u[p++]=w>>>21&1,u[p++]=w>>>22&1,u[p++]=w>>>23&1,u[p++]=w>>>24&1,u[p++]=w>>>25&1,u[p++]=w>>>26&1,u[p++]=w>>>27&1,u[p++]=w>>>28&1,u[p++]=w>>>29&1,u[p++]=w>>>30&1,u[p++]=w>>>31&1}})(r,e,i,o);break;case 2:(function(a,h,u,f){let p=f,_=h;for(let m=0;m<8;m++){let w=a[_++]>>>0,Q=a[_++]>>>0;u[p++]=w>>>0&3,u[p++]=w>>>2&3,u[p++]=w>>>4&3,u[p++]=w>>>6&3,u[p++]=w>>>8&3,u[p++]=w>>>10&3,u[p++]=w>>>12&3,u[p++]=w>>>14&3,u[p++]=w>>>16&3,u[p++]=w>>>18&3,u[p++]=w>>>20&3,u[p++]=w>>>22&3,u[p++]=w>>>24&3,u[p++]=w>>>26&3,u[p++]=w>>>28&3,u[p++]=w>>>30&3,u[p++]=Q>>>0&3,u[p++]=Q>>>2&3,u[p++]=Q>>>4&3,u[p++]=Q>>>6&3,u[p++]=Q>>>8&3,u[p++]=Q>>>10&3,u[p++]=Q>>>12&3,u[p++]=Q>>>14&3,u[p++]=Q>>>16&3,u[p++]=Q>>>18&3,u[p++]=Q>>>20&3,u[p++]=Q>>>22&3,u[p++]=Q>>>24&3,u[p++]=Q>>>26&3,u[p++]=Q>>>28&3,u[p++]=Q>>>30&3}})(r,e,i,o);break;case 3:(function(a,h,u,f){let p=f,_=h;for(let m=0;m<8;m++){let w=a[_++]>>>0,Q=a[_++]>>>0,x=a[_++]>>>0;u[p++]=w>>>0&7,u[p++]=w>>>3&7,u[p++]=w>>>6&7,u[p++]=w>>>9&7,u[p++]=w>>>12&7,u[p++]=w>>>15&7,u[p++]=w>>>18&7,u[p++]=w>>>21&7,u[p++]=w>>>24&7,u[p++]=w>>>27&7,u[p++]=7&(w>>>30|(1&Q)<<2),u[p++]=Q>>>1&7,u[p++]=Q>>>4&7,u[p++]=Q>>>7&7,u[p++]=Q>>>10&7,u[p++]=Q>>>13&7,u[p++]=Q>>>16&7,u[p++]=Q>>>19&7,u[p++]=Q>>>22&7,u[p++]=Q>>>25&7,u[p++]=Q>>>28&7,u[p++]=7&(Q>>>31|(3&x)<<1),u[p++]=x>>>2&7,u[p++]=x>>>5&7,u[p++]=x>>>8&7,u[p++]=x>>>11&7,u[p++]=x>>>14&7,u[p++]=x>>>17&7,u[p++]=x>>>20&7,u[p++]=x>>>23&7,u[p++]=x>>>26&7,u[p++]=x>>>29&7}})(r,e,i,o);break;case 4:(function(a,h,u,f){let p=f,_=h;for(let m=0;m<8;m++){let w=a[_++]>>>0,Q=a[_++]>>>0,x=a[_++]>>>0,v=a[_++]>>>0;u[p++]=w>>>0&15,u[p++]=w>>>4&15,u[p++]=w>>>8&15,u[p++]=w>>>12&15,u[p++]=w>>>16&15,u[p++]=w>>>20&15,u[p++]=w>>>24&15,u[p++]=w>>>28&15,u[p++]=Q>>>0&15,u[p++]=Q>>>4&15,u[p++]=Q>>>8&15,u[p++]=Q>>>12&15,u[p++]=Q>>>16&15,u[p++]=Q>>>20&15,u[p++]=Q>>>24&15,u[p++]=Q>>>28&15,u[p++]=x>>>0&15,u[p++]=x>>>4&15,u[p++]=x>>>8&15,u[p++]=x>>>12&15,u[p++]=x>>>16&15,u[p++]=x>>>20&15,u[p++]=x>>>24&15,u[p++]=x>>>28&15,u[p++]=v>>>0&15,u[p++]=v>>>4&15,u[p++]=v>>>8&15,u[p++]=v>>>12&15,u[p++]=v>>>16&15,u[p++]=v>>>20&15,u[p++]=v>>>24&15,u[p++]=v>>>28&15}})(r,e,i,o);break;case 5:(function(a,h,u,f){let p=f,_=h;for(let m=0;m<8;m++){let w=a[_++]>>>0,Q=a[_++]>>>0,x=a[_++]>>>0,v=a[_++]>>>0,S=a[_++]>>>0;u[p++]=w>>>0&31,u[p++]=w>>>5&31,u[p++]=w>>>10&31,u[p++]=w>>>15&31,u[p++]=w>>>20&31,u[p++]=w>>>25&31,u[p++]=31&(w>>>30|(7&Q)<<2),u[p++]=Q>>>3&31,u[p++]=Q>>>8&31,u[p++]=Q>>>13&31,u[p++]=Q>>>18&31,u[p++]=Q>>>23&31,u[p++]=31&(Q>>>28|(1&x)<<4),u[p++]=x>>>1&31,u[p++]=x>>>6&31,u[p++]=x>>>11&31,u[p++]=x>>>16&31,u[p++]=x>>>21&31,u[p++]=x>>>26&31,u[p++]=31&(x>>>31|(15&v)<<1),u[p++]=v>>>4&31,u[p++]=v>>>9&31,u[p++]=v>>>14&31,u[p++]=v>>>19&31,u[p++]=v>>>24&31,u[p++]=31&(v>>>29|(3&S)<<3),u[p++]=S>>>2&31,u[p++]=S>>>7&31,u[p++]=S>>>12&31,u[p++]=S>>>17&31,u[p++]=S>>>22&31,u[p++]=S>>>27&31}})(r,e,i,o);break;case 6:(function(a,h,u,f){let p=f,_=h;for(let m=0;m<8;m++){let w=a[_++]>>>0,Q=a[_++]>>>0,x=a[_++]>>>0,v=a[_++]>>>0,S=a[_++]>>>0,M=a[_++]>>>0;u[p++]=w>>>0&63,u[p++]=w>>>6&63,u[p++]=w>>>12&63,u[p++]=w>>>18&63,u[p++]=w>>>24&63,u[p++]=63&(w>>>30|(15&Q)<<2),u[p++]=Q>>>4&63,u[p++]=Q>>>10&63,u[p++]=Q>>>16&63,u[p++]=Q>>>22&63,u[p++]=63&(Q>>>28|(3&x)<<4),u[p++]=x>>>2&63,u[p++]=x>>>8&63,u[p++]=x>>>14&63,u[p++]=x>>>20&63,u[p++]=x>>>26&63,u[p++]=v>>>0&63,u[p++]=v>>>6&63,u[p++]=v>>>12&63,u[p++]=v>>>18&63,u[p++]=v>>>24&63,u[p++]=63&(v>>>30|(15&S)<<2),u[p++]=S>>>4&63,u[p++]=S>>>10&63,u[p++]=S>>>16&63,u[p++]=S>>>22&63,u[p++]=63&(S>>>28|(3&M)<<4),u[p++]=M>>>2&63,u[p++]=M>>>8&63,u[p++]=M>>>14&63,u[p++]=M>>>20&63,u[p++]=M>>>26&63}})(r,e,i,o);break;case 7:(function(a,h,u,f){let p=f,_=h;for(let m=0;m<8;m++){let w=a[_++]>>>0,Q=a[_++]>>>0,x=a[_++]>>>0,v=a[_++]>>>0,S=a[_++]>>>0,M=a[_++]>>>0,L=a[_++]>>>0;u[p++]=w>>>0&127,u[p++]=w>>>7&127,u[p++]=w>>>14&127,u[p++]=w>>>21&127,u[p++]=127&(w>>>28|(7&Q)<<4),u[p++]=Q>>>3&127,u[p++]=Q>>>10&127,u[p++]=Q>>>17&127,u[p++]=Q>>>24&127,u[p++]=127&(Q>>>31|(63&x)<<1),u[p++]=x>>>6&127,u[p++]=x>>>13&127,u[p++]=x>>>20&127,u[p++]=127&(x>>>27|(3&v)<<5),u[p++]=v>>>2&127,u[p++]=v>>>9&127,u[p++]=v>>>16&127,u[p++]=v>>>23&127,u[p++]=127&(v>>>30|(31&S)<<2),u[p++]=S>>>5&127,u[p++]=S>>>12&127,u[p++]=S>>>19&127,u[p++]=127&(S>>>26|(1&M)<<6),u[p++]=M>>>1&127,u[p++]=M>>>8&127,u[p++]=M>>>15&127,u[p++]=M>>>22&127,u[p++]=127&(M>>>29|(15&L)<<3),u[p++]=L>>>4&127,u[p++]=L>>>11&127,u[p++]=L>>>18&127,u[p++]=L>>>25&127}})(r,e,i,o);break;case 8:(function(a,h,u,f){let p=f,_=h;for(let m=0;m<8;m++){let w=a[_++]>>>0,Q=a[_++]>>>0,x=a[_++]>>>0,v=a[_++]>>>0,S=a[_++]>>>0,M=a[_++]>>>0,L=a[_++]>>>0,U=a[_++]>>>0;u[p++]=w>>>0&255,u[p++]=w>>>8&255,u[p++]=w>>>16&255,u[p++]=w>>>24&255,u[p++]=Q>>>0&255,u[p++]=Q>>>8&255,u[p++]=Q>>>16&255,u[p++]=Q>>>24&255,u[p++]=x>>>0&255,u[p++]=x>>>8&255,u[p++]=x>>>16&255,u[p++]=x>>>24&255,u[p++]=v>>>0&255,u[p++]=v>>>8&255,u[p++]=v>>>16&255,u[p++]=v>>>24&255,u[p++]=S>>>0&255,u[p++]=S>>>8&255,u[p++]=S>>>16&255,u[p++]=S>>>24&255,u[p++]=M>>>0&255,u[p++]=M>>>8&255,u[p++]=M>>>16&255,u[p++]=M>>>24&255,u[p++]=L>>>0&255,u[p++]=L>>>8&255,u[p++]=L>>>16&255,u[p++]=L>>>24&255,u[p++]=U>>>0&255,u[p++]=U>>>8&255,u[p++]=U>>>16&255,u[p++]=U>>>24&255}})(r,e,i,o);break;case 16:(function(a,h,u,f){let p=f,_=h;for(let m=0;m<128;m++){let w=a[_++]>>>0;u[p++]=65535&w,u[p++]=w>>>16&65535}})(r,e,i,o);break;default:(function(a,h,u,f,p){let _=vu[p]>>>0,m=h,w=0,Q=a[m]>>>0,x=f;for(let v=0;v<8;v++){for(let S=0;S<32;S++)if(w+p<=32)u[x+S]=Q>>>w&_,w+=p,w===32&&(w=0,m++,S!==31&&(Q=a[m]>>>0));else{let M=32-w,L=Q>>>w;m++,Q=a[m]>>>0;let U=p-M;u[x+S]=(L|(Q&-1>>>32-U>>>0)<<M)&_,w=U}x+=32,w=0,v<7&&(Q=a[m]>>>0)}})(r,e,i,o,s)}return e+(s<<3)|0}function Tm(r,e,i,o){if(i+2>e)throw new Error(`FastPFOR decode: byteContainer underflow at block=${o} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${i}, byteSize=${e})`);let s=r[i++],a=r[i++];if(s>32)throw new Error(`FastPFOR decode: invalid bitWidth=${s} at block=${o} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:s,exceptionCount:a,bytePosIn:i}}function Um(r,e,i,o,s,a,h,u,f){let{maxBits:p,exceptionBitWidth:_,bytePosIn:m}=(function(S,M,L,U,k,G){if(L+1>M)throw new Error(`FastPFOR decode: exception header underflow at block=${G} (need 1 byte for maxBits, bytePos=${L}, byteSize=${M})`);let O=S[L++];if(O<U||O>32)throw new Error(`FastPFOR decode: invalid maxBits=${O} at block=${G} (bitWidth=${U}, expected ${U}..32)`);let q=O-U|0;if(q<1||q>32)throw new Error(`FastPFOR decode: invalid exceptionBitWidth=${q} at block=${G} (bitWidth=${U}, maxBits=${O})`);if(L+k>M)throw new Error(`FastPFOR decode: exception positions underflow at block=${G} (need=${k}, have=${M-L})`);return{maxBits:O,exceptionBitWidth:q,bytePosIn:L}})(s,a,h,i,o,f);if(h=m,_===1){let S=1<<i;for(let M=0;M<o;M=M+1|0)r[s[h++]+e|0]|=S;return h}let w=u.dataToBePacked[_];if(!w)throw new Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${_} (bitWidth=${i}, maxBits=${p}) at block ${f}`);let Q=u.dataPointers,x=0|Q[_],v=0|u.exceptionSizes[_];if(x+o>v)throw new Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${_} (ptr=${x}, need ${o}, size=${v}) at block ${f}`);for(let S=0;S<o;S=S+1|0){let M=s[h++],L=0|w[x++];r[M+e|0]|=L<<i}return Q[_]=x,h}function Lm(r,e,i,o,s,a){let h=0|i,u=0|r[h];if(u<=0||h+u>r.length-1)throw new Error(`FastPFOR decode: invalid whereMeta=${u} at pageStart=${h} (expected > 0 and pageStart+whereMeta < encoded.length=${r.length})`);let f=h+1|0,p=h+u|0,_=r[p]>>>0,m=_+3>>>2,w=p+1,Q=w+m;if(Q>=r.length)throw new Error(`FastPFOR decode: invalid byteSize=${_} (metaInts=${m}, pageStart=${h}, packedEnd=${p}, byteContainerStart=${w}) causes bitmapPos=${Q} out of bounds (encoded.length=${r.length})`);let x=(function(M,L,U,k){k.byteContainer.length<U&&(k.byteContainer=new Uint8Array(2*U),k.byteContainerI32=void 0);let G=k.byteContainer,O=U>>>2;if(3&G.byteOffset)for(let W=0;W<O;W=W+1|0){let oe=0|M[L+W|0],ne=W<<2;G[ne]=255&oe,G[ne+1|0]=oe>>>8&255,G[ne+2|0]=oe>>>16&255,G[ne+3|0]=oe>>>24&255}else{let W=k.byteContainerI32;(!W||W.buffer!==G.buffer||W.byteOffset!==G.byteOffset||W.length<O)&&(W=k.byteContainerI32=new Int32Array(G.buffer,G.byteOffset,G.byteLength>>>2)),W.set(M.subarray(L,L+O))}let q=3&U;if(q>0){let W=0|M[L+O|0],oe=O<<2;for(let ne=0;ne<q;ne=ne+1|0)G[oe+ne|0]=W>>>(ne<<3)&255}return G})(r,w,_,a),v=_,S=(function(M,L,U){let k=0|M[L++],G=U.dataToBePacked;for(let O=2;O<=32;O=O+1|0){if(!(k>>>O-1&1))continue;if(L>=M.length)throw new Error(`FastPFOR decode: truncated exception stream header (bitWidth=${O}, streamWordIndex=${L}, needWords=1, availableWords=${M.length-L}, encodedWords=${M.length})`);let q=M[L++]>>>0,W=bu(q+31,32),oe=q*O+31>>>5;if(L+oe>M.length)throw new Error(`FastPFOR decode: truncated exception stream (bitWidth=${O}, size=${q}, streamWordIndex=${L}, needWords=${oe}, availableWords=${M.length-L}, encodedWords=${M.length})`);let ne=G[O];(!ne||ne.length<W)&&(ne=G[O]=new Uint32Array(W));let ue=0;for(;ue<q;ue=ue+32|0)km(M,L,ne,ue,O),L=L+O|0;L=L-((ue-q|0)*O>>>5)|0,U.exceptionSizes[O]=q}return L})(r,Q,a);return a.dataPointers.fill(0),(function(M,L,U,k,G,O,q,W,oe,ne){let ue=0|U,fe=0;for(let ce=0;ce<q;ce=ce+1|0){let re=Tm(W,oe,fe,ce);fe=re.bytePosIn;let _e=re.bitWidth,Qe=re.exceptionCount,ye=O+ce*Dn|0;switch(_e){case 0:G.fill(0,ye,ye+Dn);break;case 32:for(let Ce=0;Ce<Dn;Ce=Ce+1|0)G[ye+Ce|0]=0|M[ue+Ce|0];ue=ue+Dn|0;break;default:ue=Mm(M,ue,G,ye,_e)}Qe>0&&(fe=Um(G,ye,_e,Qe,W,oe,fe,ne,ce))}if(ue!==k)throw new Error(`FastPFOR decode: packed region mismatch (pageStart=${L}, packedStart=${U}, consumedPackedEnd=${ue}, expectedPackedEnd=${k}, packedWords=${k-U}, encoded.length=${M.length})`)})(r,h,f,p,e,0|o,s/Dn|0,x,v,a),S}function km(r,e,i,o,s){switch(s){case 2:return void(function(p,_,m,w){let Q=w,x=p[_]>>>0,v=p[_+1]>>>0;m[Q++]=x>>>0&3,m[Q++]=x>>>2&3,m[Q++]=x>>>4&3,m[Q++]=x>>>6&3,m[Q++]=x>>>8&3,m[Q++]=x>>>10&3,m[Q++]=x>>>12&3,m[Q++]=x>>>14&3,m[Q++]=x>>>16&3,m[Q++]=x>>>18&3,m[Q++]=x>>>20&3,m[Q++]=x>>>22&3,m[Q++]=x>>>24&3,m[Q++]=x>>>26&3,m[Q++]=x>>>28&3,m[Q++]=x>>>30&3,m[Q++]=v>>>0&3,m[Q++]=v>>>2&3,m[Q++]=v>>>4&3,m[Q++]=v>>>6&3,m[Q++]=v>>>8&3,m[Q++]=v>>>10&3,m[Q++]=v>>>12&3,m[Q++]=v>>>14&3,m[Q++]=v>>>16&3,m[Q++]=v>>>18&3,m[Q++]=v>>>20&3,m[Q++]=v>>>22&3,m[Q++]=v>>>24&3,m[Q++]=v>>>26&3,m[Q++]=v>>>28&3,m[Q]=v>>>30&3})(r,e,i,o);case 3:return void(function(p,_,m,w){let Q=w,x=p[_]>>>0,v=p[_+1]>>>0,S=p[_+2]>>>0;m[Q++]=x>>>0&7,m[Q++]=x>>>3&7,m[Q++]=x>>>6&7,m[Q++]=x>>>9&7,m[Q++]=x>>>12&7,m[Q++]=x>>>15&7,m[Q++]=x>>>18&7,m[Q++]=x>>>21&7,m[Q++]=x>>>24&7,m[Q++]=x>>>27&7,m[Q++]=7&(x>>>30|(1&v)<<2),m[Q++]=v>>>1&7,m[Q++]=v>>>4&7,m[Q++]=v>>>7&7,m[Q++]=v>>>10&7,m[Q++]=v>>>13&7,m[Q++]=v>>>16&7,m[Q++]=v>>>19&7,m[Q++]=v>>>22&7,m[Q++]=v>>>25&7,m[Q++]=v>>>28&7,m[Q++]=7&(v>>>31|(3&S)<<1),m[Q++]=S>>>2&7,m[Q++]=S>>>5&7,m[Q++]=S>>>8&7,m[Q++]=S>>>11&7,m[Q++]=S>>>14&7,m[Q++]=S>>>17&7,m[Q++]=S>>>20&7,m[Q++]=S>>>23&7,m[Q++]=S>>>26&7,m[Q]=S>>>29&7})(r,e,i,o);case 4:return void(function(p,_,m,w){let Q=w,x=p[_]>>>0,v=p[_+1]>>>0,S=p[_+2]>>>0,M=p[_+3]>>>0;m[Q++]=x>>>0&15,m[Q++]=x>>>4&15,m[Q++]=x>>>8&15,m[Q++]=x>>>12&15,m[Q++]=x>>>16&15,m[Q++]=x>>>20&15,m[Q++]=x>>>24&15,m[Q++]=x>>>28&15,m[Q++]=v>>>0&15,m[Q++]=v>>>4&15,m[Q++]=v>>>8&15,m[Q++]=v>>>12&15,m[Q++]=v>>>16&15,m[Q++]=v>>>20&15,m[Q++]=v>>>24&15,m[Q++]=v>>>28&15,m[Q++]=S>>>0&15,m[Q++]=S>>>4&15,m[Q++]=S>>>8&15,m[Q++]=S>>>12&15,m[Q++]=S>>>16&15,m[Q++]=S>>>20&15,m[Q++]=S>>>24&15,m[Q++]=S>>>28&15,m[Q++]=M>>>0&15,m[Q++]=M>>>4&15,m[Q++]=M>>>8&15,m[Q++]=M>>>12&15,m[Q++]=M>>>16&15,m[Q++]=M>>>20&15,m[Q++]=M>>>24&15,m[Q]=M>>>28&15})(r,e,i,o);case 5:return void(function(p,_,m,w){let Q=w,x=p[_]>>>0,v=p[_+1]>>>0,S=p[_+2]>>>0,M=p[_+3]>>>0,L=p[_+4]>>>0;m[Q++]=x>>>0&31,m[Q++]=x>>>5&31,m[Q++]=x>>>10&31,m[Q++]=x>>>15&31,m[Q++]=x>>>20&31,m[Q++]=x>>>25&31,m[Q++]=31&(x>>>30|(7&v)<<2),m[Q++]=v>>>3&31,m[Q++]=v>>>8&31,m[Q++]=v>>>13&31,m[Q++]=v>>>18&31,m[Q++]=v>>>23&31,m[Q++]=31&(v>>>28|(1&S)<<4),m[Q++]=S>>>1&31,m[Q++]=S>>>6&31,m[Q++]=S>>>11&31,m[Q++]=S>>>16&31,m[Q++]=S>>>21&31,m[Q++]=S>>>26&31,m[Q++]=31&(S>>>31|(15&M)<<1),m[Q++]=M>>>4&31,m[Q++]=M>>>9&31,m[Q++]=M>>>14&31,m[Q++]=M>>>19&31,m[Q++]=M>>>24&31,m[Q++]=31&(M>>>29|(3&L)<<3),m[Q++]=L>>>2&31,m[Q++]=L>>>7&31,m[Q++]=L>>>12&31,m[Q++]=L>>>17&31,m[Q++]=L>>>22&31,m[Q]=L>>>27&31})(r,e,i,o);case 6:return void(function(p,_,m,w){let Q=w,x=p[_]>>>0,v=p[_+1]>>>0,S=p[_+2]>>>0,M=p[_+3]>>>0,L=p[_+4]>>>0,U=p[_+5]>>>0;m[Q++]=x>>>0&63,m[Q++]=x>>>6&63,m[Q++]=x>>>12&63,m[Q++]=x>>>18&63,m[Q++]=x>>>24&63,m[Q++]=63&(x>>>30|(15&v)<<2),m[Q++]=v>>>4&63,m[Q++]=v>>>10&63,m[Q++]=v>>>16&63,m[Q++]=v>>>22&63,m[Q++]=63&(v>>>28|(3&S)<<4),m[Q++]=S>>>2&63,m[Q++]=S>>>8&63,m[Q++]=S>>>14&63,m[Q++]=S>>>20&63,m[Q++]=S>>>26&63,m[Q++]=M>>>0&63,m[Q++]=M>>>6&63,m[Q++]=M>>>12&63,m[Q++]=M>>>18&63,m[Q++]=M>>>24&63,m[Q++]=63&(M>>>30|(15&L)<<2),m[Q++]=L>>>4&63,m[Q++]=L>>>10&63,m[Q++]=L>>>16&63,m[Q++]=L>>>22&63,m[Q++]=63&(L>>>28|(3&U)<<4),m[Q++]=U>>>2&63,m[Q++]=U>>>8&63,m[Q++]=U>>>14&63,m[Q++]=U>>>20&63,m[Q]=U>>>26&63})(r,e,i,o);case 7:return void(function(p,_,m,w){let Q=w,x=p[_]>>>0,v=p[_+1]>>>0,S=p[_+2]>>>0,M=p[_+3]>>>0,L=p[_+4]>>>0,U=p[_+5]>>>0,k=p[_+6]>>>0;m[Q++]=x>>>0&127,m[Q++]=x>>>7&127,m[Q++]=x>>>14&127,m[Q++]=x>>>21&127,m[Q++]=127&(x>>>28|(7&v)<<4),m[Q++]=v>>>3&127,m[Q++]=v>>>10&127,m[Q++]=v>>>17&127,m[Q++]=v>>>24&127,m[Q++]=127&(v>>>31|(63&S)<<1),m[Q++]=S>>>6&127,m[Q++]=S>>>13&127,m[Q++]=S>>>20&127,m[Q++]=127&(S>>>27|(3&M)<<5),m[Q++]=M>>>2&127,m[Q++]=M>>>9&127,m[Q++]=M>>>16&127,m[Q++]=M>>>23&127,m[Q++]=127&(M>>>30|(31&L)<<2),m[Q++]=L>>>5&127,m[Q++]=L>>>12&127,m[Q++]=L>>>19&127,m[Q++]=127&(L>>>26|(1&U)<<6),m[Q++]=U>>>1&127,m[Q++]=U>>>8&127,m[Q++]=U>>>15&127,m[Q++]=U>>>22&127,m[Q++]=127&(U>>>29|(15&k)<<3),m[Q++]=k>>>4&127,m[Q++]=k>>>11&127,m[Q++]=k>>>18&127,m[Q]=k>>>25&127})(r,e,i,o);case 8:return void(function(p,_,m,w){let Q=w,x=p[_]>>>0,v=p[_+1]>>>0,S=p[_+2]>>>0,M=p[_+3]>>>0,L=p[_+4]>>>0,U=p[_+5]>>>0,k=p[_+6]>>>0,G=p[_+7]>>>0;m[Q++]=x>>>0&255,m[Q++]=x>>>8&255,m[Q++]=x>>>16&255,m[Q++]=x>>>24&255,m[Q++]=v>>>0&255,m[Q++]=v>>>8&255,m[Q++]=v>>>16&255,m[Q++]=v>>>24&255,m[Q++]=S>>>0&255,m[Q++]=S>>>8&255,m[Q++]=S>>>16&255,m[Q++]=S>>>24&255,m[Q++]=M>>>0&255,m[Q++]=M>>>8&255,m[Q++]=M>>>16&255,m[Q++]=M>>>24&255,m[Q++]=L>>>0&255,m[Q++]=L>>>8&255,m[Q++]=L>>>16&255,m[Q++]=L>>>24&255,m[Q++]=U>>>0&255,m[Q++]=U>>>8&255,m[Q++]=U>>>16&255,m[Q++]=U>>>24&255,m[Q++]=k>>>0&255,m[Q++]=k>>>8&255,m[Q++]=k>>>16&255,m[Q++]=k>>>24&255,m[Q++]=G>>>0&255,m[Q++]=G>>>8&255,m[Q++]=G>>>16&255,m[Q]=G>>>24&255})(r,e,i,o);case 9:return void(function(p,_,m,w){let Q=w,x=p[_]>>>0,v=p[_+1]>>>0,S=p[_+2]>>>0,M=p[_+3]>>>0,L=p[_+4]>>>0,U=p[_+5]>>>0,k=p[_+6]>>>0,G=p[_+7]>>>0,O=p[_+8]>>>0;m[Q++]=x>>>0&511,m[Q++]=x>>>9&511,m[Q++]=x>>>18&511,m[Q++]=511&(x>>>27|(15&v)<<5),m[Q++]=v>>>4&511,m[Q++]=v>>>13&511,m[Q++]=v>>>22&511,m[Q++]=511&(v>>>31|(255&S)<<1),m[Q++]=S>>>8&511,m[Q++]=S>>>17&511,m[Q++]=511&(S>>>26|(7&M)<<6),m[Q++]=M>>>3&511,m[Q++]=M>>>12&511,m[Q++]=M>>>21&511,m[Q++]=511&(M>>>30|(127&L)<<2),m[Q++]=L>>>7&511,m[Q++]=L>>>16&511,m[Q++]=511&(L>>>25|(3&U)<<7),m[Q++]=U>>>2&511,m[Q++]=U>>>11&511,m[Q++]=U>>>20&511,m[Q++]=511&(U>>>29|(63&k)<<3),m[Q++]=k>>>6&511,m[Q++]=k>>>15&511,m[Q++]=511&(k>>>24|(1&G)<<8),m[Q++]=G>>>1&511,m[Q++]=G>>>10&511,m[Q++]=G>>>19&511,m[Q++]=511&(G>>>28|(31&O)<<4),m[Q++]=O>>>5&511,m[Q++]=O>>>14&511,m[Q]=O>>>23&511})(r,e,i,o);case 10:return void(function(p,_,m,w){let Q=w,x=p[_]>>>0,v=p[_+1]>>>0,S=p[_+2]>>>0,M=p[_+3]>>>0,L=p[_+4]>>>0,U=p[_+5]>>>0,k=p[_+6]>>>0,G=p[_+7]>>>0,O=p[_+8]>>>0,q=p[_+9]>>>0;m[Q++]=x>>>0&1023,m[Q++]=x>>>10&1023,m[Q++]=x>>>20&1023,m[Q++]=1023&(x>>>30|(255&v)<<2),m[Q++]=v>>>8&1023,m[Q++]=v>>>18&1023,m[Q++]=1023&(v>>>28|(63&S)<<4),m[Q++]=S>>>6&1023,m[Q++]=S>>>16&1023,m[Q++]=1023&(S>>>26|(15&M)<<6),m[Q++]=M>>>4&1023,m[Q++]=M>>>14&1023,m[Q++]=1023&(M>>>24|(3&L)<<8),m[Q++]=L>>>2&1023,m[Q++]=L>>>12&1023,m[Q++]=L>>>22&1023,m[Q++]=U>>>0&1023,m[Q++]=U>>>10&1023,m[Q++]=U>>>20&1023,m[Q++]=1023&(U>>>30|(255&k)<<2),m[Q++]=k>>>8&1023,m[Q++]=k>>>18&1023,m[Q++]=1023&(k>>>28|(63&G)<<4),m[Q++]=G>>>6&1023,m[Q++]=G>>>16&1023,m[Q++]=1023&(G>>>26|(15&O)<<6),m[Q++]=O>>>4&1023,m[Q++]=O>>>14&1023,m[Q++]=1023&(O>>>24|(3&q)<<8),m[Q++]=q>>>2&1023,m[Q++]=q>>>12&1023,m[Q]=q>>>22&1023})(r,e,i,o);case 11:return void(function(p,_,m,w){let Q=w,x=p[_]>>>0,v=p[_+1]>>>0,S=p[_+2]>>>0,M=p[_+3]>>>0,L=p[_+4]>>>0,U=p[_+5]>>>0,k=p[_+6]>>>0,G=p[_+7]>>>0,O=p[_+8]>>>0,q=p[_+9]>>>0,W=p[_+10]>>>0;m[Q++]=x>>>0&2047,m[Q++]=x>>>11&2047,m[Q++]=2047&(x>>>22|(1&v)<<10),m[Q++]=v>>>1&2047,m[Q++]=v>>>12&2047,m[Q++]=2047&(v>>>23|(3&S)<<9),m[Q++]=S>>>2&2047,m[Q++]=S>>>13&2047,m[Q++]=2047&(S>>>24|(7&M)<<8),m[Q++]=M>>>3&2047,m[Q++]=M>>>14&2047,m[Q++]=2047&(M>>>25|(15&L)<<7),m[Q++]=L>>>4&2047,m[Q++]=L>>>15&2047,m[Q++]=2047&(L>>>26|(31&U)<<6),m[Q++]=U>>>5&2047,m[Q++]=U>>>16&2047,m[Q++]=2047&(U>>>27|(63&k)<<5),m[Q++]=k>>>6&2047,m[Q++]=k>>>17&2047,m[Q++]=2047&(k>>>28|(127&G)<<4),m[Q++]=G>>>7&2047,m[Q++]=G>>>18&2047,m[Q++]=2047&(G>>>29|(255&O)<<3),m[Q++]=O>>>8&2047,m[Q++]=O>>>19&2047,m[Q++]=2047&(O>>>30|(511&q)<<2),m[Q++]=q>>>9&2047,m[Q++]=q>>>20&2047,m[Q++]=2047&(q>>>31|(1023&W)<<1),m[Q++]=W>>>10&2047,m[Q]=W>>>21&2047})(r,e,i,o);case 12:return void(function(p,_,m,w){let Q=w,x=p[_]>>>0,v=p[_+1]>>>0,S=p[_+2]>>>0,M=p[_+3]>>>0,L=p[_+4]>>>0,U=p[_+5]>>>0,k=p[_+6]>>>0,G=p[_+7]>>>0,O=p[_+8]>>>0,q=p[_+9]>>>0,W=p[_+10]>>>0,oe=p[_+11]>>>0;m[Q++]=x>>>0&4095,m[Q++]=x>>>12&4095,m[Q++]=4095&(x>>>24|(15&v)<<8),m[Q++]=v>>>4&4095,m[Q++]=v>>>16&4095,m[Q++]=4095&(v>>>28|(255&S)<<4),m[Q++]=S>>>8&4095,m[Q++]=S>>>20&4095,m[Q++]=M>>>0&4095,m[Q++]=M>>>12&4095,m[Q++]=4095&(M>>>24|(15&L)<<8),m[Q++]=L>>>4&4095,m[Q++]=L>>>16&4095,m[Q++]=4095&(L>>>28|(255&U)<<4),m[Q++]=U>>>8&4095,m[Q++]=U>>>20&4095,m[Q++]=k>>>0&4095,m[Q++]=k>>>12&4095,m[Q++]=4095&(k>>>24|(15&G)<<8),m[Q++]=G>>>4&4095,m[Q++]=G>>>16&4095,m[Q++]=4095&(G>>>28|(255&O)<<4),m[Q++]=O>>>8&4095,m[Q++]=O>>>20&4095,m[Q++]=q>>>0&4095,m[Q++]=q>>>12&4095,m[Q++]=4095&(q>>>24|(15&W)<<8),m[Q++]=W>>>4&4095,m[Q++]=W>>>16&4095,m[Q++]=4095&(W>>>28|(255&oe)<<4),m[Q++]=oe>>>8&4095,m[Q]=oe>>>20&4095})(r,e,i,o);case 16:return void(function(p,_,m,w){let Q=w,x=p[_]>>>0,v=p[_+1]>>>0,S=p[_+2]>>>0,M=p[_+3]>>>0,L=p[_+4]>>>0,U=p[_+5]>>>0,k=p[_+6]>>>0,G=p[_+7]>>>0,O=p[_+8]>>>0,q=p[_+9]>>>0,W=p[_+10]>>>0,oe=p[_+11]>>>0,ne=p[_+12]>>>0,ue=p[_+13]>>>0,fe=p[_+14]>>>0,ce=p[_+15]>>>0;m[Q++]=x>>>0&65535,m[Q++]=x>>>16&65535,m[Q++]=v>>>0&65535,m[Q++]=v>>>16&65535,m[Q++]=S>>>0&65535,m[Q++]=S>>>16&65535,m[Q++]=M>>>0&65535,m[Q++]=M>>>16&65535,m[Q++]=L>>>0&65535,m[Q++]=L>>>16&65535,m[Q++]=U>>>0&65535,m[Q++]=U>>>16&65535,m[Q++]=k>>>0&65535,m[Q++]=k>>>16&65535,m[Q++]=G>>>0&65535,m[Q++]=G>>>16&65535,m[Q++]=O>>>0&65535,m[Q++]=O>>>16&65535,m[Q++]=q>>>0&65535,m[Q++]=q>>>16&65535,m[Q++]=W>>>0&65535,m[Q++]=W>>>16&65535,m[Q++]=oe>>>0&65535,m[Q++]=oe>>>16&65535,m[Q++]=ne>>>0&65535,m[Q++]=ne>>>16&65535,m[Q++]=ue>>>0&65535,m[Q++]=ue>>>16&65535,m[Q++]=fe>>>0&65535,m[Q++]=fe>>>16&65535,m[Q++]=ce>>>0&65535,m[Q]=ce>>>16&65535})(r,e,i,o);case 32:for(let p=0;p<32;p=p+1|0)i[o+p|0]=0|r[e+p|0];return}let a=vu[s]>>>0,h=e,u=0,f=r[h]>>>0;for(let p=0;p<32;p++)if(u+s<=32)i[o+p]=f>>>u&a,u+=s,u===32&&(u=0,h++,p!==31&&(f=r[h]>>>0));else{let _=32-u,m=f>>>u;h++,f=r[h]>>>0,i[o+p]=(m|(f&vu[s-_]>>>0)<<_)&a,u=s-_}}function Ci(r,e,i){let o=new Uint32Array(i),s=0,a=e.get();for(let h=0;h<o.length;h++){let u=r[a++],f=127&u;u<128||(u=r[a++],f|=(127&u)<<7,u<128||(u=r[a++],f|=(127&u)<<14,u<128||(u=r[a++],f|=(127&u)<<21,u<128||(u=r[a++],f|=(15&u)<<28)))),o[s++]=f}return e.set(a),o}function xA(r,e,i){let o=new BigUint64Array(i);for(let s=0;s<o.length;s++)o[s]=Pm(r,e);return o}function Pm(r,e){let i=BigInt(0),o=0,s=e.get();for(;s<r.length;){let a=r[s++];if(i|=BigInt(127&a)<<BigInt(o),!(128&a))break;if(o+=7,o>=64)throw new Error("Varint too long")}return e.set(s),i}function Gm(r,e){let i,o;return o=r[e.get()],e.increment(),i=127&o,o<128?i:(o=r[e.get()],e.increment(),i|=(127&o)<<7,o<128?i:(o=r[e.get()],e.increment(),i|=(127&o)<<14,o<128?i:(o=r[e.get()],e.increment(),i|=(127&o)<<21,o<128?i:(o=r[e.get()],i|=(15&o)<<28,(function(s,a,h){let u,f;if(f=a[h.get()],h.increment(),u=(112&f)>>4,f<128||(f=a[h.get()],h.increment(),u|=(127&f)<<3,f<128)||(f=a[h.get()],h.increment(),u|=(127&f)<<10,f<128)||(f=a[h.get()],h.increment(),u|=(127&f)<<17,f<128)||(f=a[h.get()],h.increment(),u|=(127&f)<<24,f<128)||(f=a[h.get()],h.increment(),u|=(1&f)<<31,f<128))return 4294967296*u+(s>>>0);throw new Error("Expected varint not more than 10 bytes")})(i,r,e)))))}function pt(r){return r>>>1^-(1&r)}function Mi(r){return r>>BigInt(1)^-(BigInt(1)&r)}function vA(r){return r%2==1?(r+1)/-2:r/2}function Du(r,e,i){if(i===void 0){i=0;for(let a=0;a<e;a++)i+=r[a]}let o=new Uint32Array(i),s=0;for(let a=0;a<e;a++){let h=r[a];o.fill(r[a+e],s,s+h),s+=h}return o}function Su(r,e,i){if(i===void 0){i=0;for(let a=0;a<e;a++)i+=Number(r[a])}let o=new BigUint64Array(i),s=0;for(let a=0;a<e;a++){let h=Number(r[a]);o.fill(r[a+e],s,s+h),s+=h}return o}function Ig(r,e,i){let o=new Float64Array(i),s=0;for(let a=0;a<e;a++){let h=r[a];o.fill(r[a+e],s,s+h),s+=h}return o}function xg(r){let e=new Int32Array(r.length);e[0]=pt(r[0]);let i=r.length/4*4,o=1;if(i>=4)for(;o<i-4;o+=4){let s=r[o+1],a=r[o+2],h=r[o+3];e[o]=pt(r[o])+e[o-1],e[o+1]=pt(s)+e[o],e[o+2]=pt(a)+e[o+1],e[o+3]=pt(h)+e[o+2]}for(;o!==r.length;++o)e[o]=pt(r[o])+e[o-1];return e}function vg(r){let e=new BigInt64Array(r.length);e[0]=Mi(r[0]);let i=r.length/4*4,o=1;if(i>=4)for(;o<i-4;o+=4){let s=r[o+1],a=r[o+2],h=r[o+3];e[o]=Mi(r[o])+e[o-1],e[o+1]=Mi(s)+e[o],e[o+2]=Mi(a)+e[o+1],e[o+3]=Mi(h)+e[o+2]}for(;o!==e.length;++o)e[o]=Mi(r[o])+e[o-1];return e}function Mu(r){let e=r.length/4*4,i=1;if(e>=4)for(let o=r[0];i<e-4;i+=4)o=r[i]+=o,o=r[i+1]+=o,o=r[i+2]+=o,o=r[i+3]+=o;for(;i!==r.length;)r[i]+=r[i-1],++i}var ui,vr,us,Wi,Ct,qt,bg,go;function Ti(r,e){let i=(function(o,s){let a=o[s.get()],h=Object.values(ui)[a>>4],u=null;switch(h){case ui.DATA:u={dictionaryType:Object.values(vr)[15&a]};break;case ui.OFFSET:u={offsetType:Object.values(us)[15&a]};break;case ui.LENGTH:u={lengthType:Object.values(Wi)[15&a]}}s.increment();let f=o[s.get()],p=Object.values(We)[f>>5],_=Object.values(We)[f>>2&7],m=Object.values(uo)[3&f];s.increment();let w=Ci(o,s,2),Q=w[0];return{physicalStreamType:h,logicalStreamType:u,logicalLevelTechnique1:p,logicalLevelTechnique2:_,physicalLevelTechnique:m,numValues:Q,byteLength:w[1],decompressedCount:Q}})(r,e);return i.logicalLevelTechnique1===We.MORTON?(function(o,s,a){let h=Ci(s,a,2);return{physicalStreamType:o.physicalStreamType,logicalStreamType:o.logicalStreamType,logicalLevelTechnique1:o.logicalLevelTechnique1,logicalLevelTechnique2:o.logicalLevelTechnique2,physicalLevelTechnique:o.physicalLevelTechnique,numValues:o.numValues,byteLength:o.byteLength,decompressedCount:o.decompressedCount,numBits:h[0],coordinateShift:h[1]}})(i,r,e):We.RLE!==i.logicalLevelTechnique1&&We.RLE!==i.logicalLevelTechnique2||uo.NONE===i.physicalLevelTechnique?i:(function(o,s,a){let h=Ci(s,a,2);return{physicalStreamType:o.physicalStreamType,logicalStreamType:o.logicalStreamType,logicalLevelTechnique1:o.logicalLevelTechnique1,logicalLevelTechnique2:o.logicalLevelTechnique2,physicalLevelTechnique:o.physicalLevelTechnique,numValues:o.numValues,byteLength:o.byteLength,decompressedCount:h[1],runs:h[0],numRleValues:h[1]}})(i,r,e)}(function(r){r.PRESENT="PRESENT",r.DATA="DATA",r.OFFSET="OFFSET",r.LENGTH="LENGTH"})(ui||(ui={})),(function(r){r.NONE="NONE",r.SINGLE="SINGLE",r.SHARED="SHARED",r.VERTEX="VERTEX",r.MORTON="MORTON",r.FSST="FSST"})(vr||(vr={})),(function(r){r.VERTEX="VERTEX",r.INDEX="INDEX",r.STRING="STRING",r.KEY="KEY"})(us||(us={})),(function(r){r.VAR_BINARY="VAR_BINARY",r.GEOMETRIES="GEOMETRIES",r.PARTS="PARTS",r.RINGS="RINGS",r.TRIANGLES="TRIANGLES",r.SYMBOL="SYMBOL",r.DICTIONARY="DICTIONARY"})(Wi||(Wi={})),(function(r){r[r.FLAT=0]="FLAT",r[r.CONST=1]="CONST",r[r.SEQUENCE=2]="SEQUENCE",r[r.DICTIONARY=3]="DICTIONARY",r[r.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(Ct||(Ct={}));class br{constructor(e,i){this.values=e,this._size=i}get(e){let i=Math.floor(e/8);return(this.values[i]>>e%8&1)==1}set(e,i){let o=Math.floor(e/8);this.values[o]=this.values[o]|(i?1:0)<<e%8}getInt(e){let i=Math.floor(e/8);return this.values[i]>>e%8&1}size(){return this._size}getBuffer(){return this.values}}function bA(r,e,i){if(!e)return r;let o=e.size(),s=new r.constructor(o),a=0;for(let h=0;h<o;h++)s[h]=e.get(h)?r[a++]:i;return s}function Tu(r,e,i,o,s){return(function(a,h,u,f){let p;switch(h.logicalLevelTechnique1){case We.DELTA:if(h.logicalLevelTechnique2===We.RLE){let _=h;if(!f)return(function(m,w,Q){let x=new Int32Array(Q),v=0,S=0;for(let M=0;M<w;M++){let L=m[M],U=pt(m[M+w]);for(let k=0;k<L;k++)S+=U,x[v++]=S}return x})(a,_.runs,_.numRleValues);p=xg(a=Du(a,_.runs,_.numRleValues))}else p=xg(a);break;case We.RLE:p=(function(_,m,w){if(w===void 0){w=0;for(let v=0;v<m;v++)w+=_[v]}let Q=new Int32Array(w),x=0;for(let v=0;v<m;v++){let S=_[v],M=_[v+m];M=pt(M),Q.fill(M,x,x+S),x+=S}return Q})(a,h.runs,h.numRleValues);break;case We.MORTON:Mu(a),p=new Int32Array(a);break;case We.COMPONENTWISE_DELTA:p=(function(_){if(_.length<2)return new Int32Array(_);let m=new Int32Array(_.length);m[0]=pt(_[0]),m[1]=pt(_[1]);let w=_.length/4*4,Q=2;if(w>=4)for(;Q<w-4;Q+=4){let x=_[Q+1],v=_[Q+2],S=_[Q+3];m[Q]=pt(_[Q])+m[Q-2],m[Q+1]=pt(x)+m[Q-1],m[Q+2]=pt(v)+m[Q],m[Q+3]=pt(S)+m[Q+1]}for(;Q!==_.length;Q+=2)m[Q]=pt(_[Q])+m[Q-2],m[Q+1]=pt(_[Q+1])+m[Q-1];return m})(a);break;case We.NONE:p=(function(_){let m=new Int32Array(_.length);for(let w=0;w<_.length;w++)m[w]=pt(_[w]);return m})(a);break;default:throw new Error(`The specified Logical level technique is not supported: ${h.logicalLevelTechnique1}`)}return f?bA(p,f,0):p})(FA(r,e,i),i,0,s)}function $i(r,e,i,o,s){return(function(a,h,u,f){let p;switch(h.logicalLevelTechnique1){case We.DELTA:p=(function(_){let m=new Uint32Array(_.length);m[0]=pt(_[0])>>>0;for(let w=1;w<_.length;w++)m[w]=m[w-1]+pt(_[w])>>>0;return m})(h.logicalLevelTechnique2===We.RLE?Du(a,h.runs,h.numRleValues):a);break;case We.RLE:p=Du(a,h.runs,h.numRleValues);break;case We.MORTON:Mu(a),p=a;break;case We.COMPONENTWISE_DELTA:p=(function(_){if(_.length<2)return new Uint32Array(_);let m=new Uint32Array(_.length);m[0]=pt(_[0])>>>0,m[1]=pt(_[1])>>>0;for(let w=2;w<_.length;w+=2)m[w]=m[w-2]+pt(_[w])>>>0,m[w+1]=m[w-1]+pt(_[w+1])>>>0;return m})(a);break;case We.NONE:p=a;break;default:throw new Error(`The specified Logical level technique is not supported: ${h.logicalLevelTechnique1}`)}return f?bA(p,f,0):p})(FA(r,e,i),i,0,s)}function po(r,e,i){return(function(o,s){if(s.logicalLevelTechnique1===We.DELTA&&s.logicalLevelTechnique2===We.NONE)return(function(a){let h=new Int32Array(a.length+1);h[0]=0,h[1]=pt(a[0]);let u=h[1];for(let f=2;f!==h.length;++f)u+=pt(a[f-1]),h[f]=h[f-1]+u;return new Uint32Array(h)})(o);if(s.logicalLevelTechnique1===We.RLE&&s.logicalLevelTechnique2===We.NONE)return(function(a,h,u){let f=new Uint32Array(u+1);f[0]=0;let p=1,_=f[0];for(let m=0;m<h;m++){let w=a[m],Q=a[m+h];for(let x=p;x<p+w;x++)f[x]=Q+_,_=f[x];p+=w}return f})(o,s.runs,s.numRleValues);if(s.logicalLevelTechnique1===We.NONE&&s.logicalLevelTechnique2===We.NONE){(function(h){let u=0;for(let f=0;f<h.length;f++)h[f]+=u,u=h[f]})(o);let a=new Uint32Array(s.numValues+1);return a[0]=0,a.set(o,1),a}if(s.logicalLevelTechnique1===We.DELTA&&s.logicalLevelTechnique2===We.RLE){let a=(function(h,u,f){let p=new Int32Array(f+1);p[0]=0;let _=1,m=p[0];for(let w=0;w<u;w++){let Q=h[w],x=h[w+u];x=pt(x);for(let v=_;v<_+Q;v++)p[v]=x+m,m=p[v];_+=Q}return p})(o,s.runs,s.numRleValues);return Mu(a),new Uint32Array(a)}throw new Error("Only delta encoding is supported for transforming length to offset streams yet.")})(FA(r,e,i),i)}function FA(r,e,i){let o=i.physicalLevelTechnique;switch(o){case uo.FAST_PFOR:return(function(s,a,h,u){return(function(f,p,_,m,w){let Q=m.get();if(3&_)throw new Error(`FastPFOR: invalid encodedByteLength=${_} at offset=${Q} (encodedBytes.length=${f.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let x=_>>>2,v=(function(M,L){if(L<=M.encodedWords.length)return M.encodedWords;let U=new Uint32Array(Math.max(16,2*L));return M.encodedWords=U,U})(w,x);(function(M,L,U,k){if(L<0||U<0||L+U>M.length)throw new RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${L}, byteLength=${U}, bytes.length=${M.length})`);let G=Math.floor(U/4),O=U%4!=0,q=O?G+1:G;if(k.length<q)throw new RangeError(`decodeBigEndianInt32sInto: out.length=${k.length} < ${q}`);if(G>0){let W=M.byteOffset+L;if(3&W)for(let oe=0;oe<G;oe++){let ne=L+4*oe;k[oe]=M[ne]<<24|M[ne+1]<<16|M[ne+2]<<8|M[ne+3]}else{let oe=new Uint32Array(M.buffer,W,G);for(let ne=0;ne<G;ne++)k[ne]=0|Dm(oe[ne])}}if(O){let W=L+4*G,oe=U-4*G,ne=0;for(let ue=0;ue<oe;ue++)ne|=M[W+ue]<<24-8*ue;k[G]=0|ne}})(f,Q,_,v);let S=(function(M,L,U){let k=0,G=0,O=new Uint32Array(L),q=U!=null?U:Eg();if(M.length>0){let W=0|M[k];if(k=k+1|0,255&W)throw new Error(`FastPFOR decode: invalid alignedLength=${W} (expected multiple of 256)`);if(G+W>O.length)throw new Error(`FastPFOR decode: output buffer too small (outPos=${G}, alignedLength=${W}, out.length=${O.length})`);k=(function(oe,ne,ue,fe,ce,re){let _e=fe+bu(ce,Dn),Qe=fe,ye=ue;for(;Qe!==_e;){let Ce=Math.min(Fu,_e-Qe);ye=Lm(oe,ne,ye,Qe,Ce,re),Qe=Qe+Ce|0}return ye})(M,O,k,G,W,q),G=G+W|0}return(function(W,oe,ne,ue,fe,ce){if(ce===0)return oe;let re=0,_e=oe,Qe=oe+ne,ye=fe,Ce=fe,ke=fe+ce,$e=0,At=0;for(;_e<Qe&&Ce<ke;){let ut=W[_e]>>>re&255;if(re+=8,_e+=re>>>5,re&=31,$e|=(127&ut)<<At,128&ut)ue[Ce++]=0|$e,$e=0,At=0;else if(At+=7,At>28)throw new Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${At}, partial=${$e}, decoded=${Ce-ye}/${ce}, inPos=${_e}, inEnd=${Qe})`)}if(Ce!==ke)throw new Error(`FastPFOR VByte: truncated stream (decoded=${Ce-ye}, expected=${ce}, consumedWords=${_e-oe}/${ne}, vbyteStart=${oe}, vbyteEnd=${Qe})`)})(M,k,M.length-k|0,O,G,L-G|0),O})(v.subarray(0,x),p,w.decoderWorkspace);return m.add(_),S})(s,a,h,u,(function(f=16){if(f<0)throw new RangeError(`initialEncodedWordCapacity must be >= 0, got ${f}`);let p=Math.max(16,0|f);return{encodedWords:new Uint32Array(p),decoderWorkspace:Eg()}})(h>>>2))})(r,i.numValues,i.byteLength,e);case uo.VARINT:return Ci(r,e,i.numValues);case uo.NONE:{let s=e.get();e.add(i.byteLength);let a=r.subarray(s,e.get());return new Uint32Array(a)}default:throw new Error(`Specified physicalLevelTechnique ${o} is not supported (yet).`)}}function Uu(r,e,i){let o=FA(r,e,i);return o.length===1?o[0]:(function(s){return s[1]})(o)}function Fg(r,e,i){return(function(o){if(o.length===2){let s=pt(o[1]);return[s,s]}return[pt(o[2]),pt(o[3])]})(FA(r,e,i))}function Dg(r,e,i){return(function(o){if(o.length===2){let s=Mi(o[1]);return[s,s]}return[Mi(o[2]),Mi(o[3])]})(xA(r,e,i.numValues))}function Sg(r,e,i,o){return(function(s,a,h){let u;switch(a.logicalLevelTechnique1){case We.DELTA:u=(function(f){let p=new BigUint64Array(f.length);p[0]=BigInt.asUintN(64,Mi(f[0]));for(let _=1;_<f.length;_++)p[_]=BigInt.asUintN(64,p[_-1]+Mi(f[_]));return p})(a.logicalLevelTechnique2===We.RLE?Su(s,a.runs,a.numRleValues):s);break;case We.RLE:u=Su(s,a.runs,a.numRleValues);break;case We.NONE:u=s;break;default:throw new Error(`The specified Logical level technique is not supported: ${a.logicalLevelTechnique1}`)}return h?bA(u,h,BigInt(0)):u})(xA(r,e,i.numValues),i,o)}function Mg(r,e,i){let o=xA(r,e,i.numValues);return o.length===1?o[0]:(function(s){return s[1]})(o)}function Rc(r,e,i,o,s="int32"){let a=r.logicalLevelTechnique1;if(a===We.RLE)return r.runs===1?Ct.CONST:Ct.FLAT;if(a!==We.DELTA||r.logicalLevelTechnique2!==We.RLE)return r.numValues===1?Ct.CONST:Ct.FLAT;let h=e instanceof br?e.size():e;if(r.numRleValues!==h)return Ct.FLAT;if(r.runs===1)return Ct.SEQUENCE;if(r.runs!==2)return r.numValues===1?Ct.CONST:Ct.FLAT;let u=o.get();if(r.physicalLevelTechnique===uo.VARINT)return(function(_,m,w){let Q=new wg(m.get());if(w==="int64"){let v=xA(_,Q,4);return v[2]===BigInt(2)&&v[3]===BigInt(2)}let x=Ci(_,Q,4);return x[2]===2&&x[3]===2})(i,o,s)?Ct.SEQUENCE:r.numValues===1?Ct.CONST:Ct.FLAT;let f=o.get(),p=new Int32Array(i.buffer,i.byteOffset+f,4);return o.set(u),p[2]===2&&p[3]===2?Ct.SEQUENCE:r.numValues===1?Ct.CONST:Ct.FLAT}class Tg extends Gc{getValueFromBuffer(e){return this.dataBuffer[e]}}class Ug extends Cg{constructor(e,i,o,s){super(e,BigInt64Array.of(i),o,s)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}}function Lu(r,e,i){return{x:Lg(r,e)-i,y:Lg(r>>1,e)-i}}function Lg(r,e){let i=0;for(let o=0;o<e;o++)i|=(r&1<<2*o)>>o;return i}function DA(r,e,i,o,s,a,h){return r===go.MORTON?(function(u,f,p,_,m,w){let Q=new Array(m?_+1:_);for(let x=0;x<_;x++){let v=Lu(u[f[p+x]],w.numBits,w.coordinateShift);Q[x]=new se(v.x,v.y)}return m&&(Q[Q.length-1]=Q[0]),Q})(e,i,o,s,a,h):(function(u,f,p,_,m){let w=new Array(m?_+1:_);for(let Q=0;Q<2*_;Q+=2){let x=2*f[p+Q/2];w[Q/2]=new se(u[x],u[x+1])}return m&&(w[w.length-1]=w[0]),w})(e,i,o,s,a)}function SA(r,e,i,o){let s=new Array(o?i+1:i);for(let a=0;a<2*i;a+=2)s[a/2]=new se(r[e+a],r[e+a+1]);return o&&(s[s.length-1]=s[0]),s}(function(r){r[r.POINT=0]="POINT",r[r.LINESTRING=1]="LINESTRING",r[r.POLYGON=2]="POLYGON",r[r.MULTIPOINT=3]="MULTIPOINT",r[r.MULTILINESTRING=4]="MULTILINESTRING",r[r.MULTIPOLYGON=5]="MULTIPOLYGON"})(qt||(qt={})),(function(r){r[r.POINT=0]="POINT",r[r.LINESTRING=1]="LINESTRING",r[r.POLYGON=2]="POLYGON"})(bg||(bg={})),(function(r){r[r.MORTON=0]="MORTON",r[r.VEC_2=1]="VEC_2",r[r.VEC_3=2]="VEC_3"})(go||(go={}));class kg{constructor(e,i,o,s,a){this._vertexBufferType=e,this._topologyVector=i,this._vertexOffsets=o,this._vertexBuffer=s,this._mortonSettings=a}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(e){let i=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[i],this.vertexBuffer[i+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){let o=Lu(this.vertexBuffer[this.vertexOffsets[e]],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[o.x,o.y]}let i=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[i],this.vertexBuffer[i+1]]}getGeometries(){return(function(e){let i=new Array(e.numGeometries),o=1,s=1,a=1,h=0,u=0,f=0,p=e.mortonSettings,_=e.topologyVector,m=_.geometryOffsets,w=_.partOffsets,Q=_.ringOffsets,x=e.vertexOffsets,v=!x||x.length===0,S=e.containsPolygonGeometry(),M=e.vertexBuffer;for(let L=0;L<e.numGeometries;L++)switch(e.geometryType(L)){case qt.POINT:{let U,k;if(v)U=M[u++],k=M[u++];else if(e.vertexBufferType===go.MORTON){let G=Lu(M[x[f++]],p.numBits,p.coordinateShift);U=G.x,k=G.y}else{let G=2*x[f++];U=M[G],k=M[G+1]}i[h++]=[[new se(U,k)]],m&&a++,w&&o++,Q&&s++}break;case qt.MULTIPOINT:{let U=m[a]-m[a-1];a++;let k=new Array(U);if(v)for(let G=0;G<U;G++){let O=M[u++],q=M[u++];k[G]=new se(O,q)}else for(let G=0;G<U;G++){let O=2*x[f++];k[G]=new se(M[O],M[O+1])}i[h++]=k.map((G=>[G])),o+=U,s+=U}break;case qt.LINESTRING:{let U,k;S?(U=Q[s]-Q[s-1],s++):U=w[o]-w[o-1],o++,v?(k=SA(M,u,U,!1),u+=2*U):(k=DA(e.vertexBufferType,M,x,f,U,!1,p),f+=U),i[h++]=[k],m&&a++}break;case qt.POLYGON:{let U=w[o]-w[o-1];o++;let k=new Array(U-1),G,O=Q[s]-Q[s-1];if(s++,v){G=SA(M,u,O,!0),u+=2*O;for(let q=0;q<k.length;q++)O=Q[s]-Q[s-1],s++,k[q]=SA(M,u,O,!0),u+=2*O}else{G=DA(e.vertexBufferType,M,x,f,O,!0,p),f+=O;for(let q=0;q<k.length;q++)O=Q[s]-Q[s-1],s++,k[q]=DA(e.vertexBufferType,M,x,f,O,!0,p),f+=O}i[h++]=[G].concat(k),m&&a++}break;case qt.MULTILINESTRING:{let U=m[a]-m[a-1];a++;let k=new Array(U);for(let G=0;G<U;G++){let O;if(S?(O=Q[s]-Q[s-1],s++):O=w[o]-w[o-1],o++,v)k[G]=SA(M,u,O,!1),u+=2*O;else{let q=DA(e.vertexBufferType,M,x,f,O,!1,p);k[G]=q,f+=O}}i[h++]=k}break;case qt.MULTIPOLYGON:{let U=m[a]-m[a-1];a++;let k=new Array(U);for(let G=0;G<U;G++){let O=w[o]-w[o-1],q;o++;let W=new Array(O-1),oe=Q[s]-Q[s-1];s++,v?(q=SA(M,u,oe,!0),u+=2*oe):(q=DA(e.vertexBufferType,M,x,f,oe,!0,p),f+=oe);for(let ne=0;ne<W.length;ne++){let ue=Q[s]-Q[s-1];s++,v?(W[ne]=SA(M,u,ue,!0),u+=2*ue):(W[ne]=DA(e.vertexBufferType,M,x,f,ue,!0,p),f+=ue)}k[G]=[q].concat(W)}i[h++]=k.flat()}break;default:throw new Error("The specified geometry type is currently not supported.")}return i})(this)}get mortonSettings(){return this._mortonSettings}}class Pg extends kg{constructor(e,i,o,s,a,h,u){super(o,s,a,h,u),this._numGeometries=e,this._geometryType=i}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===qt.POLYGON||this._geometryType===qt.MULTIPOLYGON}containsSingleGeometryType(){return!0}}class Gg extends kg{constructor(e,i,o,s,a,h){super(e,o,s,a,h),this._geometryTypes=i}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let e=0;e<this.numGeometries;e++)if(this.geometryType(e)===qt.POLYGON||this.geometryType(e)===qt.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}}class Rg{constructor(e,i,o,s){this._triangleOffsets=e,this._indexBuffer=i,this._vertexBuffer=o,this._topologyVector=s}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw new Error("Cannot convert GpuVector to coordinates without topology information");let e=new Array(this.numGeometries),i=this._topologyVector,o=i.partOffsets,s=i.ringOffsets,a=i.geometryOffsets,h=0,u=1,f=1,p=1;for(let _=0;_<this.numGeometries;_++)switch(this.geometryType(_)){case qt.POLYGON:{let m=o[u]-o[u-1];u++;let w=[];for(let Q=0;Q<m;Q++){let x=s[f]-s[f-1];f++;let v=[];for(let S=0;S<x;S++){let M=this._vertexBuffer[h++],L=this._vertexBuffer[h++];v.push(new se(M,L))}v.length>0&&v.push(v[0]),w.push(v)}e[_]=w,a&&p++}break;case qt.MULTIPOLYGON:{let m=a[p]-a[p-1];p++;let w=[];for(let Q=0;Q<m;Q++){let x=o[u]-o[u-1];u++;for(let v=0;v<x;v++){let S=s[f]-s[f-1];f++;let M=[];for(let L=0;L<S;L++){let U=this._vertexBuffer[h++],k=this._vertexBuffer[h++];M.push(new se(U,k))}M.length>0&&M.push(M[0]),w.push(M)}}e[_]=w}}return e}[Symbol.iterator](){return null}}function Og(r,e,i,o,s,a){return new Rm(r,e,i,o,s,a)}class Rm extends Rg{constructor(e,i,o,s,a,h){super(o,s,a,h),this._numGeometries=e,this._geometryType=i}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}}function Ng(r,e,i,o,s){return new Om(r,e,i,o,s)}class Om extends Rg{constructor(e,i,o,s,a){super(i,o,s,a),this._geometryTypes=e}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}}function Nm(r,e,i,o,s){let a=Ti(r,i),h,u,f,p;if(Rc(a,o,r,i)===Ct.CONST){let L=Uu(r,i,a),U,k,G,O;for(let q=0;q<e-1;q++){let W=Ti(r,i);switch(W.physicalStreamType){case ui.LENGTH:switch(W.logicalStreamType.lengthType){case Wi.GEOMETRIES:U=po(r,i,W);break;case Wi.PARTS:k=po(r,i,W);break;case Wi.RINGS:G=po(r,i,W);break;case Wi.TRIANGLES:O=po(r,i,W)}break;case ui.OFFSET:switch(W.logicalStreamType.offsetType){case us.VERTEX:h=$i(r,i,W);break;case us.INDEX:p=$i(r,i,W)}break;case ui.DATA:vr.VERTEX===W.logicalStreamType.dictionaryType?u=Tu(r,i,W):(f={numBits:W.numBits,coordinateShift:W.coordinateShift},u=$i(r,i,W))}}return p?U!==void 0||k!==void 0?Og(o,L,O,p,u,{geometryOffsets:U,partOffsets:k,ringOffsets:G}):Og(o,L,O,p,u):f===void 0?(function(q,W,oe,ne,ue){return new Pg(q,W,go.VEC_2,oe,ne,ue)})(o,L,{geometryOffsets:U,partOffsets:k,ringOffsets:G},h,u):(function(q,W,oe,ne,ue,fe){return new Pg(q,W,go.MORTON,oe,ne,ue,fe)})(o,L,{geometryOffsets:U,partOffsets:k,ringOffsets:G},h,u,f)}let _=$i(r,i,a),m,w,Q,x,v,S,M;for(let L=0;L<e-1;L++){let U=Ti(r,i);switch(U.physicalStreamType){case ui.LENGTH:switch(U.logicalStreamType.lengthType){case Wi.GEOMETRIES:m=$i(r,i,U);break;case Wi.PARTS:w=$i(r,i,U);break;case Wi.RINGS:Q=$i(r,i,U);break;case Wi.TRIANGLES:x=po(r,i,U)}break;case ui.OFFSET:switch(U.logicalStreamType.offsetType){case us.VERTEX:h=$i(r,i,U);break;case us.INDEX:p=$i(r,i,U)}break;case ui.DATA:vr.VERTEX===U.logicalStreamType.dictionaryType?u=Tu(r,i,U):(f={numBits:U.numBits,coordinateShift:U.coordinateShift},u=$i(r,i,U))}}return m?(v=ku(_,m,2),w&&Q?(S=zg(_,v,w,!1),M=(function(L,U,k,G){let O=new Uint32Array(k[k.length-1]+1),q=0;O[0]=q;let W=1,oe=1,ne=0;for(let ue=0;ue<L.length;ue++){let fe=L[ue],ce=U[ue+1]-U[ue];if(fe!==0&&fe!==3)for(let re=0;re<ce;re++){let _e=k[W]-k[W-1];W++;for(let Qe=0;Qe<_e;Qe++)q=O[oe++]=q+G[ne++]}else for(let re=0;re<ce;re++)O[oe++]=++q,W++}return O})(_,v,S,Q)):w&&(S=(function(L,U,k){let G=new Uint32Array(U[U.length-1]+1),O=0;G[0]=O;let q=1,W=0;for(let oe=0;oe<L.length;oe++){let ne=L[oe],ue=U[oe+1]-U[oe];if(ne===4||ne===1)for(let fe=0;fe<ue;fe++)O=G[q++]=O+k[W++];else for(let fe=0;fe<ue;fe++)G[q++]=++O}return G})(_,v,w))):w&&Q?(S=ku(_,w,1),M=zg(_,S,Q,!0)):w&&(S=ku(_,w,0)),p&&!S?Ng(_,x,p,u):p?Ng(_,x,p,u,{geometryOffsets:v,partOffsets:S,ringOffsets:M}):f===void 0?(function(L,U,k,G){return new Gg(go.VEC_2,L,U,k,G)})(_,{geometryOffsets:v,partOffsets:S,ringOffsets:M},h,u):(function(L,U,k,G,O){return new Gg(go.MORTON,L,U,k,G,O)})(_,{geometryOffsets:v,partOffsets:S,ringOffsets:M},h,u,f)}function ku(r,e,i){let o=new Uint32Array(r.length+1),s=0;o[0]=s;let a=0;for(let h=0;h<r.length;h++)s=o[h+1]=s+(r[h]>i?e[a++]:1);return o}function zg(r,e,i,o){let s=new Uint32Array(e[e.length-1]+1),a=0;s[0]=a;let h=1,u=0;for(let f=0;f<r.length;f++){let p=r[f],_=e[f+1]-e[f];if(p===5||p===2||o&&(p===4||p===1))for(let m=0;m<_;m++)a=s[h++]=a+i[u++];else for(let m=0;m<_;m++)s[h++]=++a}return s}class zm extends IA{constructor(e,i,o){super(e,i.getBuffer(),o),this.dataVector=i}getValueFromBuffer(e){return this.dataVector.get(e)}}class Ym extends Gc{getValueFromBuffer(e){return this.dataBuffer[e]}}class Yg extends IA{constructor(e,i,o,s){super(e,s?BigInt64Array.of(i):BigUint64Array.of(i),o)}getValueFromBuffer(e){return this.dataBuffer[0]}}function ol(r,e,i,o,s){let a=(function(h,u,f,p){let _=new Uint8Array(u),m=0,w=p.get()+f;for(;m<u&&!(p.get()>=w);){let Q=h[p.increment()];if(Q<=127){let x=Q+3,v=h[p.increment()],S=Math.min(m+x,u);_.fill(v,m,S),m=S}else{let x=256-Q;for(let v=0;v<x&&m<u;v++)_[m++]=h[p.increment()]}}return p.set(w),_})(r,Math.ceil(e/8),i,o);return s?(function(h,u,f){if(!f)return h;let p=f.size(),_=new br(h,u),m=new br(new Uint8Array(Math.ceil(p/8)),p),w=0;for(let Q=0;Q<p;Q++){let x=!!f.get(Q)&&_.get(w++);m.set(Q,x)}return m.getBuffer()})(a,e,s):a}let Km=new TextDecoder;function Pu(r,e,i){return i-e>=12?Km.decode(r.subarray(e,i)):(function(o,s,a){let h="",u=s;for(;u<a;){let f=o[u],p,_,m,w=null,Q=f>239?4:f>223?3:f>191?2:1;if(u+Q>a)break;Q===1?f<128&&(w=f):Q===2?(p=o[u+1],(192&p)==128&&(w=(31&f)<<6|63&p,w<=127&&(w=null))):Q===3?(p=o[u+1],_=o[u+2],(192&p)==128&&(192&_)==128&&(w=(15&f)<<12|(63&p)<<6|63&_,(w<=2047||w>=55296&&w<=57343)&&(w=null))):Q===4&&(p=o[u+1],_=o[u+2],m=o[u+3],(192&p)==128&&(192&_)==128&&(192&m)==128&&(w=(15&f)<<18|(63&p)<<12|(63&_)<<6|63&m,(w<=65535||w>=1114112)&&(w=null))),w===null?(w=65533,Q=1):w>65535&&(w-=65536,h+=String.fromCharCode(w>>>10&1023|55296),w=56320|1023&w),h+=String.fromCharCode(w),u+=Q}return h})(r,e,i)}class Gu extends IA{constructor(e,i,o,s){super(e,o,s),this.offsetBuffer=i}}class Kg extends Gu{constructor(e,i,o,s){super(e,i,o,s!=null?s:i.length-1)}getValueFromBuffer(e){return Pu(this.dataBuffer,this.offsetBuffer[e],this.offsetBuffer[e+1])}}class MA extends Gu{constructor(e,i,o,s,a){super(e,o,s,a!=null?a:i.length),this.indexBuffer=i,this.indexBuffer=i}getValueFromBuffer(e){let i=this.indexBuffer[e];return Pu(this.dataBuffer,this.offsetBuffer[i],this.offsetBuffer[i+1])}}class jg extends Gu{constructor(e,i,o,s,a,h,u){super(e,o,s,u),this.indexBuffer=i,this.symbolOffsetBuffer=a,this.symbolTableBuffer=h}getValueFromBuffer(e){this.decodedDictionary==null&&(this.symbolLengthBuffer==null&&(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),this.decodedDictionary=(function(o,s,a){let h=[],u=new Array(s.length).fill(0);for(let f=1;f<s.length;f++)u[f]=u[f-1]+s[f-1];for(let f=0;f<a.length;f++)if(a[f]===255)h.push(a[++f]);else{let p=s[a[f]],_=u[a[f]];for(let m=0;m<p;m++)h.push(o[_+m])}return new Uint8Array(h)})(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));let i=this.indexBuffer[e];return Pu(this.decodedDictionary,this.offsetBuffer[i],this.offsetBuffer[i+1])}offsetToLengthBuffer(e){let i=new Uint32Array(e.length-1),o=e[0];for(let s=1;s<e.length;s++){let a=e[s];i[s-1]=a-o,o=a}return i}}function jm(r,e,i,o,s,a){return i.type==="scalarType"?(function(h,u,f,p,_,m){let w=null;if(h===0)return null;if(m.nullable){let x=Ti(u,f),v=x.numValues,S=f.get(),M=ol(u,v,x.byteLength,f);f.set(S+x.byteLength),w=new br(M,x.numValues)}let Q=w!=null?w:p;switch(_.physicalType){case 4:case 3:return(function(x,v,S,M,L){let U=Ti(x,v),k=Rc(U,L,x,v),G=M.physicalType===3;if(k===Ct.FLAT){let q=sl(L)?L:void 0,W=G?Tu(x,v,U,0,q):$i(x,v,U,0,q);return new Cu(S.name,W,L)}if(k===Ct.SEQUENCE){let q=Fg(x,v,U);return new Eu(S.name,q[0],q[1],U.numRleValues)}let O=G?(function(q,W,oe){let ne=FA(q,W,oe);return ne.length===1?pt(ne[0]):(function(ue){return pt(ue[1])})(ne)})(x,v,U):Uu(x,v,U);return new Iu(S.name,O,L,G)})(u,f,m,_,Q);case 9:return(function(x,v,S,M,L){var ue,fe;let U=null,k=null,G=null,O=null,q=null,W=L!=null?L:null,oe=null,ne=null;for(let ce=0;ce<M;ce++){let re=Ti(v,S);switch(re.physicalStreamType){case ui.PRESENT:{let _e=ol(v,re.numValues,re.byteLength,S),Qe=new br(_e,re.numValues);W=L!=null?L:Qe;break}case ui.OFFSET:k=$i(v,S,re,0,W);break;case ui.LENGTH:{let _e=po(v,S,re);Wi.DICTIONARY===re.logicalStreamType.lengthType?U=_e:Wi.SYMBOL===re.logicalStreamType.lengthType?O=_e:oe=_e;break}case ui.DATA:{let _e=v.subarray(S.get(),S.get()+re.byteLength);S.add(re.byteLength);let Qe=re.logicalStreamType.dictionaryType;vr.FSST===Qe?q=_e:vr.SINGLE===Qe||vr.SHARED===Qe?G=_e:vr.NONE===Qe&&(ne=_e);break}}}return(fe=(ue=(function(ce,re,_e,Qe,ye,Ce,ke){return re?new jg(ce,_e,Qe,ye,Ce,re,ke):null})(x,q,k,U,G,O,W))!=null?ue:(function(ce,re,_e,Qe,ye){return re?ye?new MA(ce,_e,Qe,re,ye):new MA(ce,_e,Qe,re):null})(x,G,k,U,W))!=null?fe:(function(ce,re,_e,Qe,ye){if(!re||!_e)return null;if(Qe)return ye?new MA(ce,Qe,re,_e,ye):new MA(ce,Qe,re,_e);if(ye&&ye.size()!==re.length-1){let Ce=new Uint32Array(ye.size()),ke=0;for(let $e=0;$e<ye.size();$e++)Ce[$e]=ye.get($e)?ke++:0;return new MA(ce,Ce,re,_e,ye)}return ye?new Kg(ce,re,_e,ye):new Kg(ce,re,_e)})(x,oe,ne,k,W)})(m.name,u,f,m.nullable?h-1:h,w);case 0:return(function(x,v,S,M,L){let U=Ti(x,v),k=U.numValues,G=v.get(),O=sl(L)?L:void 0,q=ol(x,k,U.byteLength,v,O);v.set(G+U.byteLength);let W=new br(q,k);return new zm(S.name,W,L)})(u,f,m,0,Q);case 6:case 5:return(function(x,v,S,M,L){let U=Ti(x,v),k=Rc(U,M,x,v,"int64"),G=L.physicalType===5;if(k===Ct.FLAT){let q=sl(M)?M:void 0,W=G?(function(oe,ne,ue,fe){return(function(ce,re,_e){let Qe;switch(re.logicalLevelTechnique1){case We.DELTA:if(re.logicalLevelTechnique2===We.RLE){let ye=re;if(!_e)return(function(Ce,ke,$e){let At=new BigInt64Array($e),ut=0,gi=BigInt(0);for(let Tt=0;Tt<ke;Tt++){let Xt=Number(Ce[Tt]),Wt=Mi(Ce[Tt+ke]);for(let wt=0;wt<Xt;wt++)gi+=Wt,At[ut++]=gi}return At})(ce,ye.runs,ye.numRleValues);Qe=vg(ce=Su(ce,ye.runs,ye.numRleValues))}else Qe=vg(ce);break;case We.RLE:Qe=(function(ye,Ce,ke){if(ke===void 0){ke=0;for(let ut=0;ut<Ce;ut++)ke+=Number(ye[ut])}let $e=new BigInt64Array(ke),At=0;for(let ut=0;ut<Ce;ut++){let gi=Number(ye[ut]),Tt=ye[ut+Ce];Tt=Mi(Tt),$e.fill(Tt,At,At+gi),At+=gi}return $e})(ce,re.runs,re.numRleValues);break;case We.NONE:Qe=(function(ye){let Ce=new BigInt64Array(ye.length);for(let ke=0;ke<ye.length;ke++)Ce[ke]=Mi(ye[ke]);return Ce})(ce);break;default:throw new Error(`The specified Logical level technique is not supported: ${re.logicalLevelTechnique1}`)}return _e?bA(Qe,_e,BigInt(0)):Qe})(xA(oe,ne,ue.numValues),ue,fe)})(x,v,U,q):Sg(x,v,U,q);return new Tg(S.name,W,M)}if(k===Ct.SEQUENCE){let q=Dg(x,v,U);return new Ug(S.name,q[0],q[1],U.numRleValues)}let O=G?(function(q,W,oe){let ne=xA(q,W,oe.numValues);return ne.length===1?Mi(ne[0]):(function(ue){return Mi(ue[1])})(ne)})(x,v,U):Mg(x,v,U);return new Yg(S.name,O,M,G)})(u,f,m,Q,_);case 7:return(function(x,v,S,M){let L=Ti(x,v),U=sl(M)?M:void 0,k=(function(G,O,q,W){let oe=O.get(),ne=oe+q*Float32Array.BYTES_PER_ELEMENT,ue=new Uint8Array(G.subarray(oe,ne)).buffer,fe=new Float32Array(ue);return O.set(ne),W?bA(fe,W,0):fe})(x,v,L.numValues,U);return new Ym(S.name,k,M)})(u,f,m,Q);case 8:return(function(x,v,S,M){let L=Ti(x,v),U=sl(M)?M:void 0,k=(function(G,O,q,W){let oe=O.get(),ne=oe+q*Float64Array.BYTES_PER_ELEMENT,ue=new Uint8Array(G.subarray(oe,ne)).buffer,fe=new Float64Array(ue);return O.set(ne),W?bA(fe,W,0):fe})(x,v,L.numValues,U);return new wu(S.name,k,M)})(u,f,m,Q);default:throw new Error(`The specified data type for the field is currently not supported: ${_}`)}})(o,r,e,s,i.scalarType,i):o===0?null:(function(h,u,f,p){let _=null,m=null,w=null,Q=null,x=!1;for(;!x;){let L=Ti(h,u);switch(L.physicalStreamType){case ui.LENGTH:Wi.DICTIONARY===L.logicalStreamType.lengthType?_=po(h,u,L):w=po(h,u,L);break;case ui.DATA:vr.SINGLE===L.logicalStreamType.dictionaryType||vr.SHARED===L.logicalStreamType.dictionaryType?(m=h.subarray(u.get(),u.get()+L.byteLength),x=!0):Q=h.subarray(u.get(),u.get()+L.byteLength),u.add(L.byteLength)}}let v=f.complexType.children,S=[],M=0;for(let L of v){let U=Ci(h,u,1)[0];if(U===0)continue;let k=L.name?`${f.name}${L.name}`:f.name;if(U!==2||L.type!=="scalarField"||L.scalarField.physicalType!==9)throw new Error("Currently only optional string fields are implemented for a struct.");let G=Ti(h,u),O=ol(h,G.numValues,G.byteLength,u),q=Ti(h,u),W=$i(h,u,q,0,q.decompressedCount!==p?new br(O,G.numValues):void 0);S[M++]=Q?new jg(k,W,_,m,w,Q,new br(O,G.numValues)):new MA(k,W,_,m,new br(O,G.numValues))}return S})(r,e,i,s)}function sl(r){return r instanceof br}function Xg(r){switch(r){case 0:case 1:case 2:case 3:{let e={};e.nullable=!!(1&r),e.columnScope=0;let i={type:"logicalType",logicalType:0};return i.longID=!!(2&r),e.scalarType=i,e.type="scalarType",e}case 4:{let e={nullable:!1,columnScope:0},i={type:"physicalType",physicalType:0};return e.type="complexType",e.complexType=i,e}case 30:{let e={nullable:!1,columnScope:0},i={type:"physicalType",physicalType:1};return e.type="complexType",e.complexType=i,e}default:return(function(e){let i;switch(e){case 10:case 11:i=0;break;case 12:case 13:i=1;break;case 14:case 15:i=2;break;case 16:case 17:i=3;break;case 18:case 19:i=4;break;case 20:case 21:i=5;break;case 22:case 23:i=6;break;case 24:case 25:i=7;break;case 26:case 27:i=8;break;case 28:case 29:i=9;break;default:return null}let o={};o.nullable=!!(1&e),o.columnScope=0;let s={type:"physicalType"};return s.physicalType=i,o.type="scalarType",o.scalarType=s,o})(r)}}function Vg(r){return r>=10}function Zg(r){return r===30}function Xm(r){if(r.type==="scalarType"){let e=r.scalarType;if(e.type==="physicalType")switch(e.physicalType){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:default:return!1;case 9:return!0}if(e.type==="logicalType")return!1}else if(r.type==="complexType"){let e=r.complexType;if(e.type==="physicalType")switch(e.physicalType){case 0:case 1:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",r),!1}function Vm(r){var e;return r.type==="complexType"&&((e=r.complexType)==null?void 0:e.type)==="physicalType"&&r.complexType.physicalType===0}let Zm=new TextDecoder;function Ru(r,e){let i=Ci(r,e,1)[0];if(i===0)return"";let o=e.get(),s=r.subarray(o,o+i);return e.add(i),Zm.decode(s)}function Hg(r,e){let i=Ci(r,e,1)[0]>>>0;if(i<10||i>30)throw new Error(`Unsupported field type code ${i}. Supported: 10-29(scalars), 30(STRUCT)`);let o=Xg(i);if(Vg(i)&&(o.name=Ru(r,e)),Zg(i)){let s=Ci(r,e,1)[0]>>>0;o.complexType.children=new Array(s);for(let a=0;a<s;a++)o.complexType.children[a]=Hg(r,e)}return(function(s){return{name:s.name,nullable:s.nullable,scalarField:s.scalarType,complexField:s.complexType,type:s.type==="scalarType"?"scalarField":"complexField"}})(o)}function Hm(r,e){let i=Ci(r,e,1)[0]>>>0,o=Xg(i);if(!o)throw new Error(`Unsupported column type code ${i}. Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT)`);if(Vg(i)?o.name=Ru(r,e):i>=0&&i<=3?o.name="id":i===4&&(o.name="geometry"),Zg(i)){let s=Ci(r,e,1)[0]>>>0,a=o.complexType;a.children=new Array(s);for(let h=0;h<s;h++)a.children[h]=Hg(r,e)}return o}function Jm(r,e){let i={featureTables:[]},o={};o.name=Ru(r,e);let s=Ci(r,e,1)[0]>>>0,a=Ci(r,e,1)[0]>>>0;o.columns=new Array(a);for(let h=0;h<a;h++)o.columns[h]=Hm(r,e);return i.featureTables.push(o),[i,s]}function qm(r,e,i,o,s,a,h=!1){let u=e.scalarType;if(!u||u.type!=="logicalType"||u.logicalType!==0)throw new Error(`ID column must be a logical ID scalar type: ${o}`);let f=u.longID?6:4,p=typeof a=="number"?void 0:a,_=Rc(s,a,r,i,f===6?"int64":"int32");if(f===4)switch(_){case Ct.FLAT:{let m=$i(r,i,s,0,p);return new Cu(o,m,a)}case Ct.SEQUENCE:{let m=Fg(r,i,s);return new Eu(o,m[0],m[1],s.numRleValues)}case Ct.CONST:{let m=Uu(r,i,s);return new Iu(o,m,a,!1)}}switch(_){case Ct.FLAT:{if(h){let w=(function(Q,x,v){let S=(function(M,L,U){let k=new Float64Array(U);for(let G=0;G<U;G++)k[G]=Gm(M,L);return k})(Q,x,v.numValues);return(function(M,L){switch(L.logicalLevelTechnique1){case We.DELTA:return L.logicalLevelTechnique2===We.RLE&&(M=Ig(M,L.runs,L.numRleValues)),(function(U){U[0]=vA(U[0]);let k=U.length/4*4,G=1;if(k>=4)for(;G<k-4;G+=4){let O=U[G+1],q=U[G+2],W=U[G+3];U[G]=vA(U[G])+U[G-1],U[G+1]=vA(O)+U[G],U[G+2]=vA(q)+U[G+1],U[G+3]=vA(W)+U[G+2]}for(;G!==U.length;++G)U[G]=vA(U[G])+U[G-1]})(M),M;case We.RLE:return(function(U,k){return Ig(U,k.runs,k.numRleValues)})(M,L);case We.NONE:return M;default:throw new Error(`The specified Logical level technique is not supported: ${L.logicalLevelTechnique1}`)}})(S,v)})(r,i,s);return new wu(o,w,a)}let m=Sg(r,i,s,p);return new Tg(o,m,a)}case Ct.SEQUENCE:{let m=Dg(r,i,s);return new Ug(o,m[0],m[1],s.numRleValues)}case Ct.CONST:{let m=Mg(r,i,s);return new Yg(o,m,a,!1)}}throw new Error("Vector type not supported for id column.")}class Wm{constructor(e,i){var o;switch(this._featureData=e,this.properties=this._featureData.properties||{},(o=this._featureData.geometry)===null||o===void 0?void 0:o.type){case qt.POINT:case qt.MULTIPOINT:this.type=1;break;case qt.LINESTRING:case qt.MULTILINESTRING:this.type=2;break;case qt.POLYGON:case qt.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=i,this.id=Number(this._featureData.id)}loadGeometry(){let e=[];for(let i of this._featureData.geometry.coordinates){let o=[];for(let s of i)o.push(new se(s.x,s.y));e.push(o)}return e}}class $m{constructor(e){this.features=[],this.featureTable=e,this.name=e.name,this.extent=e.extent,this.version=2,this.features=e.getFeatures(),this.length=this.features.length}feature(e){return new Wm(this.features[e],this.extent)}}class Jg{constructor(e){this.layers={};let i=(function(o,s,a=!0){var p;let h=new wg(0),u=[];for(;h.get()<o.length;){let _=Ci(o,h,1)[0]>>>0,m=h.get()+_;if(m>o.length)throw new Error(`Block overruns tile: ${m} > ${o.length}`);if(Ci(o,h,1)[0]>>>0!=1){h.set(m);continue}let[w,Q]=Jm(o,h),x=w.featureTables[0],v=null,S=null,M=[],L=0;for(let k of x.columns){let G=k.name;if((f=k).type==="scalarType"&&((p=f.scalarType)==null?void 0:p.type)==="logicalType"&&f.scalarType.logicalType===0){let O=null;if(k.nullable){let W=Ti(o,h),oe=h.get(),ne=ol(o,W.numValues,W.byteLength,h);h.set(oe+W.byteLength),O=new br(ne,W.numValues)}let q=Ti(o,h);L=O?O.size():q.decompressedCount,v=qm(o,k,h,G,q,O!=null?O:L,a)}else if(Vm(k)){let O=Ci(o,h,1)[0];if(L===0){let q=h.get();L=Ti(o,h).decompressedCount,h.set(q)}S=Nm(o,O,h,L)}else{let O=Xm(k)?Ci(o,h,1)[0]:1;if(O===0)continue;let q=jm(o,h,k,O,L);if(q)if(Array.isArray(q))for(let W of q)M.push(W);else M.push(q)}}let U=new Fm(x.name,S,v,M,Q);u.push(U),h.set(m)}var f;return u})(new Uint8Array(e));this.layers=i.reduce(((o,s)=>Object.assign(Object.assign({},o),{[s.name]:new $m(s)})),{})}}class eB{constructor(e,i){this.feature=e,this.type=e.type,this.properties=e.tags?e.tags:{},this.extent=i,"id"in e&&(typeof e.id=="string"?this.id=parseInt(e.id,10):typeof e.id!="number"||isNaN(e.id)||(this.id=e.id))}loadGeometry(){let e=[],i=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(let o of i){let s=[];for(let a of o)s.push(new se(a[0],a[1]));e.push(s)}return e}}let Al="_geojsonTileLayer";function tB(r,e,i=""){e.writeVarintField(15,r.version||1),e.writeStringField(1,r.name||""),e.writeVarintField(5,r.extent||4096);let o={jsonPrefix:i,keys:[],values:[],keycache:{},valuecache:{}};for(let h=0;h<r.length;h++)o.feature=r.feature(h),e.writeMessage(2,iB,o);let s=o.keys;for(let h of s)e.writeStringField(3,h);let a=o.values;for(let h of a)e.writeMessage(4,oB,h)}function iB(r,e){if(!r.feature)return;let i=r.feature;i.id!==void 0&&e.writeVarintField(1,i.id),e.writeMessage(2,rB,r),e.writeVarintField(3,i.type),e.writeMessage(4,nB,i)}function rB(r,e){var i;for(let o in(i=r.feature)==null?void 0:i.properties){let s=r.feature.properties[o],a=r.keycache[o];if(s==null)continue;a===void 0&&(r.keys.push(o),a=r.keys.length-1,r.keycache[o]=a),e.writeVarint(a),typeof s!="string"&&typeof s!="boolean"&&typeof s!="number"&&(s=r.jsonPrefix+JSON.stringify(s));let h=typeof s+":"+s,u=r.valuecache[h];u===void 0&&(r.values.push(s),u=r.values.length-1,r.valuecache[h]=u),e.writeVarint(u)}}function Ou(r,e){return(e<<3)+(7&r)}function qg(r){return r<<1^r>>31}function nB(r,e){let i=r.loadGeometry(),o=r.type,s=0,a=0;for(let h of i){let u=1;o===1&&(u=h.length),e.writeVarint(Ou(1,u));let f=o===3?h.length-1:h.length;for(let p=0;p<f;p++){p===1&&o!==1&&e.writeVarint(Ou(2,f-1));let _=h[p].x-s,m=h[p].y-a;e.writeVarint(qg(_)),e.writeVarint(qg(m)),s+=_,a+=m}r.type===3&&e.writeVarint(Ou(7,1))}}function oB(r,e){let i=typeof r;i==="string"?e.writeStringField(1,r):i==="boolean"?e.writeBooleanField(7,r):i==="number"&&(r%1!=0?e.writeDoubleField(3,r):r<0?e.writeSVarintField(6,r):e.writeVarintField(5,r))}class Wg{constructor(e,i){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Qr(Ge,16,0),this.grid3D=new Qr(Ge,16,0),this.featureIndexArray=new P,this.promoteId=i}insert(e,i,o,s,a,h){let u=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(o,s,a);let f=h?this.grid3D:this.grid;for(let p of i){let _=[1/0,1/0,-1/0,-1/0];for(let m of p)_[0]=Math.min(_[0],m.x),_[1]=Math.min(_[1],m.y),_[2]=Math.max(_[2],m.x),_[3]=Math.max(_[3],m.y);_[0]<Ge&&_[1]<Ge&&_[2]>=0&&_[3]>=0&&f.insert(u,_[0],_[1],_[2],_[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=this.encoding!=="mlt"?new Id(new Tc(this.rawTileData)).layers:new Jg(this.rawTileData).layers,this.sourceLayerCoder=new yg(this.vtLayers?Object.keys(this.vtLayers).sort():[Al])),this.vtLayers}query(e,i,o,s){this.loadVTLayers();let a=e.params,h=Ge/e.tileSize/e.scale,u=Ko(a.filter,a.globalState),f=e.queryGeometry,p=e.queryPadding*h,_=hs.fromPoints(f),m=this.grid.query(_.minX-p,_.minY-p,_.maxX+p,_.maxY+p),w=hs.fromPoints(e.cameraQueryGeometry).expandBy(p),Q=this.grid3D.query(w.minX,w.minY,w.maxX,w.maxY,((S,M,L,U)=>(function(k,G,O,q,W){for(let ne of k)if(G<=ne.x&&O<=ne.y&&q>=ne.x&&W>=ne.y)return!0;let oe=[new se(G,O),new se(G,W),new se(q,W),new se(q,O)];if(k.length>2){for(let ne of oe)if(dA(k,ne))return!0}for(let ne=0;ne<k.length-1;ne++)if(Lp(k[ne],k[ne+1],oe))return!0;return!1})(e.cameraQueryGeometry,S-p,M-p,L+p,U+p)));for(let S of Q)m.push(S);m.sort(sB);let x={},v;for(let S of m){if(S===v)continue;v=S;let M=this.featureIndexArray.get(S),L=null;this.loadMatchingFeature(x,M.bucketIndex,M.sourceLayerIndex,M.featureIndex,u,a.layers,a.availableImages,i,o,s,((U,k,G)=>(L||(L=Hr(U)),k.queryIntersectsFeature({queryGeometry:f,feature:U,featureState:G,geometry:L,zoom:this.z,transform:e.transform,pixelsToTileUnits:h,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation}))))}return x}loadMatchingFeature(e,i,o,s,a,h,u,f,p,_,m){let w=this.bucketLayerIDs[i];if(h&&!w.some((S=>h.has(S))))return;let Q=this.sourceLayerCoder.decode(o),x=this.vtLayers[Q].feature(s);if(a.needGeometry){let S=Jr(x,!0);if(!a.filter(new Bt(this.tileID.overscaledZ),S,this.tileID.canonical))return}else if(!a.filter(new Bt(this.tileID.overscaledZ),x))return;let v=this.getId(x,Q);for(let S of w){if(h&&!h.has(S))continue;let M=f[S];if(!M)continue;let L={};v&&_&&(L=_.getState(M.sourceLayer||Al,v));let U=ji({},p[S]);U.paint=$g(U.paint,M.paint,x,L,u),U.layout=$g(U.layout,M.layout,x,L,u);let k=!m||m(x,M,L);if(!k)continue;let G=new Qg(x,this.z,this.x,this.y,v);G.layer=U;let O=e[S];O===void 0&&(O=e[S]=[]),O.push({featureIndex:s,feature:G,intersectionZ:k})}}lookupSymbolFeatures(e,i,o,s,a,h,u,f){let p={};this.loadVTLayers();let _=Ko(a.filterSpec,a.globalState);for(let m of e)this.loadMatchingFeature(p,o,s,m,_,h,u,f,i);return p}hasLayer(e){for(let i of this.bucketLayerIDs)for(let o of i)if(e===o)return!0;return!1}getId(e,i){var o;let s=e.id;return this.promoteId&&(s=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[i]],typeof s=="boolean"&&(s=Number(s)),s===void 0&&(!((o=e.properties)===null||o===void 0)&&o.cluster)&&this.promoteId&&(s=Number(e.properties.cluster_id))),s}}function $g(r,e,i,o,s){return Tr(r,((a,h)=>{let u=e instanceof is?e.get(h):null;return u!=null&&u.evaluate?u.evaluate(i,o,s):u}))}function sB(r,e){return e-r}function ep(r,e,i,o,s){let a=[];for(let h of r){let u;for(let f=0;f<h.length-1;f++){let p=h[f],_=h[f+1];p.x<e&&_.x<e||(p.x<e?p=new se(e,p.y+(e-p.x)/(_.x-p.x)*(_.y-p.y))._round():_.x<e&&(_=new se(e,p.y+(e-p.x)/(_.x-p.x)*(_.y-p.y))._round()),p.y<i&&_.y<i||(p.y<i?p=new se(p.x+(i-p.y)/(_.y-p.y)*(_.x-p.x),i)._round():_.y<i&&(_=new se(p.x+(i-p.y)/(_.y-p.y)*(_.x-p.x),i)._round()),p.x>=o&&_.x>=o||(p.x>=o?p=new se(o,p.y+(o-p.x)/(_.x-p.x)*(_.y-p.y))._round():_.x>=o&&(_=new se(o,p.y+(o-p.x)/(_.x-p.x)*(_.y-p.y))._round()),p.y>=s&&_.y>=s||(p.y>=s?p=new se(p.x+(s-p.y)/(_.y-p.y)*(_.x-p.x),s)._round():_.y>=s&&(_=new se(p.x+(s-p.y)/(_.y-p.y)*(_.x-p.x),s)._round()),u&&p.equals(u[u.length-1])||(u=[p],a.push(u)),u.push(_)))))}}return a}function tp(r,e,i,o,s){switch(e){case 1:return(function(a,h,u,f){let p=[];for(let _ of a)for(let m of _){let w=f===0?m.x:m.y;w>=h&&w<=u&&p.push([m])}return p})(r,i,o,s);case 2:return ip(r,i,o,s,!1);case 3:return ip(r,i,o,s,!0)}return[]}function AB(r,e,i,o,s){let a=o===0?aB:lB,h=[],u=[];for(let _=0;_<r.length-1;_++){let m=r[_],w=r[_+1],Q=o===0?m.x:m.y,x=o===0?w.x:w.y,v=!1;Q<e?x>e&&h.push(a(m,w,e)):Q>i?x<i&&h.push(a(m,w,i)):h.push(m),x<e&&Q>=e&&(h.push(a(m,w,e)),v=!0),x>i&&Q<=i&&(h.push(a(m,w,i)),v=!0),!s&&v&&(u.push(h),h=[])}let f=r.length-1,p=o===0?r[f].x:r[f].y;return p>=e&&p<=i&&h.push(r[f]),s&&h.length>0&&!h[0].equals(h[h.length-1])&&h.push(new se(h[0].x,h[0].y)),h.length>0&&u.push(h),u}function ip(r,e,i,o,s){let a=[];for(let h of r){let u=AB(h,e,i,o,s);u.length>0&&a.push(...u)}return a}function aB(r,e,i){return new se(i,r.y+(i-r.x)/(e.x-r.x)*(e.y-r.y))}function lB(r,e,i){return new se(r.x+(i-r.y)/(e.y-r.y)*(e.x-r.x),i)}be("FeatureIndex",Wg,{omit:["rawTileData","sourceLayerCoder"]});class fo extends se{constructor(e,i,o,s){super(e,i),this.angle=o,s!==void 0&&(this.segment=s)}clone(){return new fo(this.x,this.y,this.angle,this.segment)}}function rp(r,e,i,o,s){if(e.segment===void 0||i===0)return!0;let a=e,h=e.segment+1,u=0;for(;u>-i/2;){if(h--,h<0)return!1;u-=r[h].dist(a),a=r[h]}u+=r[h].dist(r[h+1]),h++;let f=[],p=0;for(;u<i/2;){let _=r[h],m=r[h+1];if(!m)return!1;let w=r[h-1].angleTo(_)-_.angleTo(m);for(w=Math.abs((w+3*Math.PI)%(2*Math.PI)-Math.PI),f.push({distance:u,angleDelta:w}),p+=w;u-f[0].distance>o;)p-=f.shift().angleDelta;if(p>s)return!1;h++,u+=_.dist(m)}return!0}function np(r){let e=0;for(let i=0;i<r.length-1;i++)e+=r[i].dist(r[i+1]);return e}function op(r,e,i){return r?.6*e*i:0}function sp(r,e){return Math.max(r?r.right-r.left:0,e?e.right-e.left:0)}function cB(r,e,i,o,s,a){let h=op(i,s,a),u=sp(i,o)*a,f=0,p=np(r)/2;for(let _=0;_<r.length-1;_++){let m=r[_],w=r[_+1],Q=m.dist(w);if(f+Q>p){let x=(p-f)/Q,v=Pi.number(m.x,w.x,x),S=Pi.number(m.y,w.y,x),M=new fo(v,S,w.angleTo(m),_);return M._round(),!h||rp(r,M,u,h,e)?M:void 0}f+=Q}}function hB(r,e,i,o,s,a,h,u,f){let p=op(o,a,h),_=sp(o,s),m=_*h,w=r[0].x===0||r[0].x===f||r[0].y===0||r[0].y===f;return e-m<e/4&&(e=m+e/4),Ap(r,w?e/2*u%e:(_/2+2*a)*h*u%e,e,p,i,m,w,!1,f)}function Ap(r,e,i,o,s,a,h,u,f){let p=a/2,_=np(r),m=0,w=e-i,Q=[];for(let x=0;x<r.length-1;x++){let v=r[x],S=r[x+1],M=v.dist(S),L=S.angleTo(v);for(;w+i<m+M;){w+=i;let U=(w-m)/M,k=Pi.number(v.x,S.x,U),G=Pi.number(v.y,S.y,U);if(k>=0&&k<f&&G>=0&&G<f&&w-p>=0&&w+p<=_){let O=new fo(k,G,L,x);O._round(),o&&!rp(r,O,a,o,s)||Q.push(O)}}m+=M}return u||Q.length||h||(Q=Ap(r,m/2,i,o,s,a,h,!0,f)),Q}function ap(r,e,i,o){let s=[],a=r.image,h=a.pixelRatio,u=a.paddedRect.w-2,f=a.paddedRect.h-2,p={x1:r.left,y1:r.top,x2:r.right,y2:r.bottom},_=a.stretchX||[[0,u]],m=a.stretchY||[[0,f]],w=(re,_e)=>re+_e[1]-_e[0],Q=_.reduce(w,0),x=m.reduce(w,0),v=u-Q,S=f-x,M=0,L=Q,U=0,k=x,G=0,O=v,q=0,W=S;if(a.content&&o){let re=a.content,_e=re[2]-re[0],Qe=re[3]-re[1];(a.textFitWidth||a.textFitHeight)&&(p=ng(r)),M=Oc(_,0,re[0]),U=Oc(m,0,re[1]),L=Oc(_,re[0],re[2]),k=Oc(m,re[1],re[3]),G=re[0]-M,q=re[1]-U,O=_e-L,W=Qe-k}let oe=p.x1,ne=p.y1,ue=p.x2-oe,fe=p.y2-ne,ce=(re,_e,Qe,ye)=>{let Ce=Nc(re.stretch-M,L,ue,oe),ke=zc(re.fixed-G,O,re.stretch,Q),$e=Nc(_e.stretch-U,k,fe,ne),At=zc(_e.fixed-q,W,_e.stretch,x),ut=Nc(Qe.stretch-M,L,ue,oe),gi=zc(Qe.fixed-G,O,Qe.stretch,Q),Tt=Nc(ye.stretch-U,k,fe,ne),Xt=zc(ye.fixed-q,W,ye.stretch,x),Wt=new se(Ce,$e),wt=new se(ut,$e),Ai=new se(ut,Tt),wi=new se(Ce,Tt),Ei=new se(ke/h,At/h),zi=new se(gi/h,Xt/h),pi=e*Math.PI/180;if(pi){let $t=Math.sin(pi),bt=Math.cos(pi),Kt=[bt,-$t,$t,bt];Wt._matMult(Kt),wt._matMult(Kt),wi._matMult(Kt),Ai._matMult(Kt)}let Yi=re.stretch+re.fixed,fr=_e.stretch+_e.fixed;return{tl:Wt,tr:wt,bl:wi,br:Ai,tex:{x:a.paddedRect.x+1+Yi,y:a.paddedRect.y+1+fr,w:Qe.stretch+Qe.fixed-Yi,h:ye.stretch+ye.fixed-fr},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Ei,pixelOffsetBR:zi,minFontScaleX:O/h/ue,minFontScaleY:W/h/fe,isSDF:i}};if(o&&(a.stretchX||a.stretchY)){let re=lp(_,v,Q),_e=lp(m,S,x);for(let Qe=0;Qe<re.length-1;Qe++){let ye=re[Qe],Ce=re[Qe+1];for(let ke=0;ke<_e.length-1;ke++)s.push(ce(ye,_e[ke],Ce,_e[ke+1]))}}else s.push(ce({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:u+1},{fixed:0,stretch:f+1}));return s}function Oc(r,e,i){let o=0;for(let s of r)o+=Math.max(e,Math.min(i,s[1]))-Math.max(e,Math.min(i,s[0]));return o}function lp(r,e,i){let o=[{fixed:-1,stretch:0}];for(let[s,a]of r){let h=o[o.length-1];o.push({fixed:s-h.stretch,stretch:h.stretch}),o.push({fixed:s-h.stretch,stretch:h.stretch+(a-s)})}return o.push({fixed:e+1,stretch:i}),o}function Nc(r,e,i,o){return r/e*i+o}function zc(r,e,i,o){return r-e*i/o}be("Anchor",fo);class Yc{constructor(e,i,o,s,a,h,u,f,p,_){var m;if(this.boxStartIndex=e.length,p){let w=h.top,Q=h.bottom,x=h.collisionPadding;x&&(w-=x[1],Q+=x[3]);let v=Q-w;v>0&&(v=Math.max(10,v),this.circleDiameter=v)}else{let w=!((m=h.image)===null||m===void 0)&&m.content&&(h.image.textFitWidth||h.image.textFitHeight)?ng(h):{x1:h.left,y1:h.top,x2:h.right,y2:h.bottom};w.y1=w.y1*u-f[0],w.y2=w.y2*u+f[2],w.x1=w.x1*u-f[3],w.x2=w.x2*u+f[1];let Q=h.collisionPadding;if(Q&&(w.x1-=Q[0]*u,w.y1-=Q[1]*u,w.x2+=Q[2]*u,w.y2+=Q[3]*u),_){let x=new se(w.x1,w.y1),v=new se(w.x2,w.y1),S=new se(w.x1,w.y2),M=new se(w.x2,w.y2),L=_*Math.PI/180;x._rotate(L),v._rotate(L),S._rotate(L),M._rotate(L),w.x1=Math.min(x.x,v.x,S.x,M.x),w.x2=Math.max(x.x,v.x,S.x,M.x),w.y1=Math.min(x.y,v.y,S.y,M.y),w.y2=Math.max(x.y,v.y,S.y,M.y)}e.emplaceBack(i.x,i.y,w.x1,w.y1,w.x2,w.y2,o,s,a)}this.boxEndIndex=e.length}}class uB{constructor(e=[],i=(o,s)=>o<s?-1:o>s?1:0){if(this.data=e,this.length=this.data.length,this.compare=i,this.length>0)for(let o=(this.length>>1)-1;o>=0;o--)this._down(o)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],i=this.data.pop();return--this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:i,compare:o}=this,s=i[e];for(;e>0;){let a=e-1>>1,h=i[a];if(o(s,h)>=0)break;i[e]=h,e=a}i[e]=s}_down(e){let{data:i,compare:o}=this,s=this.length>>1,a=i[e];for(;e<s;){let h=1+(e<<1),u=h+1;if(u<this.length&&o(i[u],i[h])<0&&(h=u),o(i[h],a)>=0)break;i[e]=i[h],e=h}i[e]=a}}function dB(r,e=1){let i=hs.fromPoints(r[0]),o=Math.min(i.width(),i.height()),s=o/2,a=new uB([],gB),{minX:h,minY:u,maxX:f,maxY:p}=i;if(o===0)return new se(h,u);for(let w=h;w<f;w+=o)for(let Q=u;Q<p;Q+=o)a.push(new TA(w+s,Q+s,s,r));let _=(function(w){let Q=0,x=0,v=0,S=w[0];for(let M=0,L=S.length,U=L-1;M<L;U=M++){let k=S[M],G=S[U],O=k.x*G.y-G.x*k.y;x+=(k.x+G.x)*O,v+=(k.y+G.y)*O,Q+=3*O}return new TA(x/Q,v/Q,0,w)})(r),m=_;for(;a.length;){let w=a.pop();(w.d>m.d||!m.d)&&(m=w),w.max-m.d<=e||(s=w.h/2,a.push(new TA(w.p.x-s,w.p.y-s,s,r)),a.push(new TA(w.p.x+s,w.p.y-s,s,r)),a.push(new TA(w.p.x-s,w.p.y+s,s,r)),a.push(new TA(w.p.x+s,w.p.y+s,s,r)))}return _.d>0&&m.d-_.d<=e?_.p:m.p}function gB(r,e){return e.max-r.max}class TA{constructor(e,i,o,s){this.p=new se(e,i),this.h=o,this.d=(function(a,h){let u=!1,f=1/0;for(let p of h)for(let _=0,m=p.length,w=m-1;_<m;w=_++){let Q=p[_],x=p[w];Q.y>a.y!=x.y>a.y&&a.x<(x.x-Q.x)*(a.y-Q.y)/(x.y-Q.y)+Q.x&&(u=!u),f=Math.min(f,ed(a,Q,x))}return(u?1:-1)*Math.sqrt(f)})(this.p,s),this.max=this.d+this.h*Math.SQRT2}}var di;D.aM=void 0,(di=D.aM||(D.aM={}))[di.center=1]="center",di[di.left=2]="left",di[di.right=3]="right",di[di.top=4]="top",di[di.bottom=5]="bottom",di[di["top-left"]=6]="top-left",di[di["top-right"]=7]="top-right",di[di["bottom-left"]=8]="bottom-left",di[di["bottom-right"]=9]="bottom-right";let Nu=Number.POSITIVE_INFINITY;function cp(r,e){return e[1]!==Nu?(function(i,o,s){let a=0,h=0;switch(o=Math.abs(o),s=Math.abs(s),i){case"top-right":case"top-left":case"top":h=s-7;break;case"bottom-right":case"bottom-left":case"bottom":h=7-s}switch(i){case"top-right":case"bottom-right":case"right":a=-o;break;case"top-left":case"bottom-left":case"left":a=o}return[a,h]})(r,e[0],e[1]):(function(i,o){let s=0,a=0;o<0&&(o=0);let h=o/Math.SQRT2;switch(i){case"top-right":case"top-left":a=h-7;break;case"bottom-right":case"bottom-left":a=7-h;break;case"bottom":a=7-o;break;case"top":a=o-7}switch(i){case"top-right":case"bottom-right":s=-h;break;case"top-left":case"bottom-left":s=h;break;case"left":s=o;break;case"right":s=-o}return[s,a]})(r,e[0])}function hp(r,e,i){var o;let s=r.layout,a=(o=s.get("text-variable-anchor-offset"))===null||o===void 0?void 0:o.evaluate(e,{},i);if(a){let u=a.values,f=[];for(let p=0;p<u.length;p+=2){let _=f[p]=u[p],m=u[p+1].map((w=>w*Jt));_.startsWith("top")?m[1]-=7:_.startsWith("bottom")&&(m[1]+=7),f[p+1]=m}return new mi(f)}let h=s.get("text-variable-anchor");if(h){let u;u=r._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[s.get("text-radial-offset").evaluate(e,{},i)*Jt,Nu]:s.get("text-offset").evaluate(e,{},i).map((p=>p*Jt));let f=[];for(let p of h)f.push(p,cp(p,u));return new mi(f)}return null}function zu(r){switch(r){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function pB(r,e,i,o,s,a,h,u,f,p,_,m){let w=a.textMaxSize.evaluate(e,{});w===void 0&&(w=h);let Q=r.layers[0].layout,x=Q.get("icon-offset").evaluate(e,{},_),v=dp(i.horizontal),S=h/24,M=r.tilePixelRatio*S,L=r.tilePixelRatio*w/24,U=r.tilePixelRatio*u,k=r.tilePixelRatio*Q.get("symbol-spacing"),G=Q.get("text-padding")*r.tilePixelRatio,O=(function(Qe,ye,Ce,ke=1){let $e=Qe.get("icon-padding").evaluate(ye,{},Ce),At=$e==null?void 0:$e.values;return[At[0]*ke,At[1]*ke,At[2]*ke,At[3]*ke]})(Q,e,_,r.tilePixelRatio),q=Q.get("text-max-angle")/180*Math.PI,W=Q.get("text-rotation-alignment")!=="viewport"&&Q.get("symbol-placement")!=="point",oe=Q.get("icon-rotation-alignment")==="map"&&Q.get("symbol-placement")!=="point",ne=Q.get("symbol-placement"),ue=k/2,fe=Q.get("icon-text-fit"),ce;o&&fe!=="none"&&(r.allowVerticalPlacement&&i.vertical&&(ce=og(o,i.vertical,fe,Q.get("icon-text-fit-padding"),x,S)),v&&(o=og(o,v,fe,Q.get("icon-text-fit-padding"),x,S)));let re=_?m.line.getGranularityForZoomLevel(_.z):1,_e=(Qe,ye)=>{ye.x<0||ye.x>=Ge||ye.y<0||ye.y>=Ge||(function(Ce,ke,$e,At,ut,gi,Tt,Xt,Wt,wt,Ai,wi,Ei,zi,pi,Yi,fr,$t,bt,Kt,Ut,ei,Sn,Fr,al){let mo=Ce.addToLineVertexArray(ke,$e),ds,UA,LA,kA,gp=0,pp=0,fp=0,mp=0,Yu=-1,Ku=-1,Mn={},Bp=Ht("");if(Ce.allowVerticalPlacement&&At.vertical){let Ii=Xt.layout.get("text-rotate").evaluate(Ut,{},Fr)+90;LA=new Yc(Wt,ke,wt,Ai,wi,At.vertical,Ei,zi,pi,Ii),Tt&&(kA=new Yc(Wt,ke,wt,Ai,wi,Tt,fr,$t,pi,Ii))}if(ut){let Ii=Xt.layout.get("icon-rotate").evaluate(Ut,{}),lr=Xt.layout.get("icon-text-fit")!=="none",gs=ap(ut,Ii,Sn,lr),Sr=Tt?ap(Tt,Ii,Sn,lr):void 0;UA=new Yc(Wt,ke,wt,Ai,wi,ut,fr,$t,!1,Ii),gp=4*gs.length;let ps=Ce.iconSizeData,qr=null;ps.kind==="source"?(qr=[Fn*Xt.layout.get("icon-size").evaluate(Ut,{})],qr[0]>co&&ti(`${Ce.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):ps.kind==="composite"&&(qr=[Fn*ei.compositeIconSizes[0].evaluate(Ut,{},Fr),Fn*ei.compositeIconSizes[1].evaluate(Ut,{},Fr)],(qr[0]>co||qr[1]>co)&&ti(`${Ce.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),Ce.addSymbols(Ce.icon,gs,qr,Kt,bt,Ut,D.ax.none,ke,mo.lineStartIndex,mo.lineLength,-1,Fr),Yu=Ce.icon.placedSymbolArray.length-1,Sr&&(pp=4*Sr.length,Ce.addSymbols(Ce.icon,Sr,qr,Kt,bt,Ut,D.ax.vertical,ke,mo.lineStartIndex,mo.lineLength,-1,Fr),Ku=Ce.icon.placedSymbolArray.length-1)}let _p=Object.keys(At.horizontal);for(let Ii of _p){let lr=At.horizontal[Ii];if(!ds){Bp=Ht(lr.text);let Sr=Xt.layout.get("text-rotate").evaluate(Ut,{},Fr);ds=new Yc(Wt,ke,wt,Ai,wi,lr,Ei,zi,pi,Sr)}let gs=lr.positionedLines.length===1;if(fp+=up(Ce,ke,lr,gi,Xt,pi,Ut,Yi,mo,At.vertical?D.ax.horizontal:D.ax.horizontalOnly,gs?_p:[Ii],Mn,Yu,ei,Fr),gs)break}At.vertical&&(mp+=up(Ce,ke,At.vertical,gi,Xt,pi,Ut,Yi,mo,D.ax.vertical,["vertical"],Mn,Ku,ei,Fr));let mB=ds?ds.boxStartIndex:Ce.collisionBoxArray.length,BB=ds?ds.boxEndIndex:Ce.collisionBoxArray.length,_B=LA?LA.boxStartIndex:Ce.collisionBoxArray.length,yB=LA?LA.boxEndIndex:Ce.collisionBoxArray.length,QB=UA?UA.boxStartIndex:Ce.collisionBoxArray.length,CB=UA?UA.boxEndIndex:Ce.collisionBoxArray.length,wB=kA?kA.boxStartIndex:Ce.collisionBoxArray.length,EB=kA?kA.boxEndIndex:Ce.collisionBoxArray.length,Dr=-1,Kc=(Ii,lr)=>Ii!=null&&Ii.circleDiameter?Math.max(Ii.circleDiameter,lr):lr;Dr=Kc(ds,Dr),Dr=Kc(LA,Dr),Dr=Kc(UA,Dr),Dr=Kc(kA,Dr);let yp=Dr>-1?1:0;yp&&(Dr*=al/Jt),Ce.glyphOffsetArray.length>=wA.MAX_GLYPHS&&ti("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ut.sortKey!==void 0&&Ce.addToSortKeyRanges(Ce.symbolInstances.length,Ut.sortKey);let IB=hp(Xt,Ut,Fr),[xB,vB]=(function(Ii,lr){let gs=Ii.length,Sr=lr==null?void 0:lr.values;if((Sr==null?void 0:Sr.length)>0)for(let ps=0;ps<Sr.length;ps+=2){let qr=Sr[ps+1];Ii.emplaceBack(D.aM[Sr[ps]],qr[0],qr[1])}return[gs,Ii.length]})(Ce.textAnchorOffsets,IB);Ce.symbolInstances.emplaceBack(ke.x,ke.y,Mn.right>=0?Mn.right:-1,Mn.center>=0?Mn.center:-1,Mn.left>=0?Mn.left:-1,Mn.vertical||-1,Yu,Ku,Bp,mB,BB,_B,yB,QB,CB,wB,EB,wt,fp,mp,gp,pp,yp,0,Ei,Dr,xB,vB)})(r,ye,Qe,i,o,s,ce,r.layers[0],r.collisionBoxArray,e.index,e.sourceLayerIndex,r.index,M,[G,G,G,G],W,f,U,O,oe,x,e,a,p,_,h)};if(ne==="line")for(let Qe of ep(e.geometry,0,0,Ge,Ge)){let ye=cs(Qe,re),Ce=hB(ye,k,q,i.vertical||v,o,24,L,r.overscaling,Ge);for(let ke of Ce)v&&fB(r,v.text,ue,ke)||_e(ye,ke)}else if(ne==="line-center"){for(let Qe of e.geometry)if(Qe.length>1){let ye=cs(Qe,re),Ce=cB(ye,q,i.vertical||v,o,24,L);Ce&&_e(ye,Ce)}}else if(e.type==="Polygon")for(let Qe of ks(e.geometry,0)){let ye=dB(Qe,16);_e(cs(Qe[0],re,!0),new fo(ye.x,ye.y,0))}else if(e.type==="LineString")for(let Qe of e.geometry){let ye=cs(Qe,re);_e(ye,new fo(ye[0].x,ye[0].y,0))}else if(e.type==="Point")for(let Qe of e.geometry)for(let ye of Qe)_e([ye],new fo(ye.x,ye.y,0))}function up(r,e,i,o,s,a,h,u,f,p,_,m,w,Q,x){let v=(function(L,U,k,G,O,q,W,oe){let ne=G.layout.get("text-rotate").evaluate(q,{})*Math.PI/180,ue=[];for(let fe of U.positionedLines)for(let ce of fe.positionedGlyphs){if(!ce.rect)continue;let re=ce.rect||{},_e=4,Qe=!0,ye=1,Ce=0,ke=(O||oe)&&ce.vertical,$e=ce.metrics.advance*ce.scale/2;if(oe&&U.verticalizable&&(Ce=fe.lineOffset/2-(ce.imageName?-(Jt-ce.metrics.width*ce.scale)/2:(ce.scale-1)*Jt)),ce.imageName){let $t=W[ce.imageName];Qe=$t.sdf,ye=$t.pixelRatio,_e=1/ye}let At=O?[ce.x+$e,ce.y]:[0,0],ut=O?[0,0]:[ce.x+$e+k[0],ce.y+k[1]-Ce],gi=[0,0];ke&&(gi=ut,ut=[0,0]);let Tt=ce.metrics.isDoubleResolution?2:1,Xt=(ce.metrics.left-_e)*ce.scale-$e+ut[0],Wt=(-ce.metrics.top-_e)*ce.scale+ut[1],wt=Xt+re.w/Tt*ce.scale/ye,Ai=Wt+re.h/Tt*ce.scale/ye,wi=new se(Xt,Wt),Ei=new se(wt,Wt),zi=new se(Xt,Ai),pi=new se(wt,Ai);if(ke){let $t=new se(-$e,$e- -17),bt=-Math.PI/2,Kt=12-$e,Ut=new se(22-Kt,-(ce.imageName?Kt:0)),ei=new se(...gi);wi._rotateAround(bt,$t)._add(Ut)._add(ei),Ei._rotateAround(bt,$t)._add(Ut)._add(ei),zi._rotateAround(bt,$t)._add(Ut)._add(ei),pi._rotateAround(bt,$t)._add(Ut)._add(ei)}if(ne){let $t=Math.sin(ne),bt=Math.cos(ne),Kt=[bt,-$t,$t,bt];wi._matMult(Kt),Ei._matMult(Kt),zi._matMult(Kt),pi._matMult(Kt)}let Yi=new se(0,0),fr=new se(0,0);ue.push({tl:wi,tr:Ei,bl:zi,br:pi,tex:re,writingMode:U.writingMode,glyphOffset:At,sectionIndex:ce.sectionIndex,isSDF:Qe,pixelOffsetTL:Yi,pixelOffsetBR:fr,minFontScaleX:0,minFontScaleY:0})}return ue})(0,i,u,s,a,h,o,r.allowVerticalPlacement),S=r.textSizeData,M=null;S.kind==="source"?(M=[Fn*s.layout.get("text-size").evaluate(h,{})],M[0]>co&&ti(`${r.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):S.kind==="composite"&&(M=[Fn*Q.compositeTextSizes[0].evaluate(h,{},x),Fn*Q.compositeTextSizes[1].evaluate(h,{},x)],(M[0]>co||M[1]>co)&&ti(`${r.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),r.addSymbols(r.text,v,M,u,a,h,p,e,f.lineStartIndex,f.lineLength,w,x);for(let L of _)m[L]=r.text.placedSymbolArray.length-1;return 4*v.length}function dp(r){for(let e in r)return r[e];return null}function fB(r,e,i,o){let s=r.compareText;if(e in s){let a=s[e];for(let h=a.length-1;h>=0;h--)if(o.dist(a[h])<i)return!0}else s[e]=[];return s[e].push(o),!1}D.$=pl,D.A=dt,D.B=eA,D.C=Ac,D.D=De,D.E=ys,D.F=ur,D.G=function([r,e,i]){return e+=90,e*=Math.PI/180,i*=Math.PI/180,{x:r*Math.cos(e)*Math.sin(i),y:r*Math.sin(e)*Math.sin(i),z:r*Math.cos(i)}},D.H=Pi,D.I=du,D.J=Bt,D.K=Wo,D.L=function(r){if(vi==null){let e=r.navigator?r.navigator.userAgent:null;vi=!!r.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return vi},D.M=Xi,D.N=class{constructor(r,e){this.target=r,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new vm((()=>this.process())),this.subscription=ms(this.target,"message",(i=>this.receive(i)),!1),this.globalScope=ii(self)?r:window}registerMessageHandler(r,e){this.messageHandlers[r]=e}unregisterMessageHandler(r){delete this.messageHandlers[r]}sendAsync(r,e){return new Promise(((i,o)=>{let s=Math.round(1e18*Math.random()).toString(36).substring(0,10),a=e?ms(e.signal,"abort",(()=>{a==null||a.unsubscribe(),delete this.resolveRejects[s];let f={id:s,type:"<cancel>",origin:location.origin,targetMapId:r.targetMapId,sourceMapId:this.mapId};this.target.postMessage(f)}),bm):null;this.resolveRejects[s]={resolve:f=>{a==null||a.unsubscribe(),i(f)},reject:f=>{a==null||a.unsubscribe(),o(f)}};let h=[],u=Object.assign(Object.assign({},r),{id:s,sourceMapId:this.mapId,origin:location.origin,data:Cr(r.data,h)});this.target.postMessage(u,{transfer:h})}))}receive(r){let e=r.data,i=e.id,o=["file://","resource://android","null"],s=[e.origin,location.origin],a=e.origin===location.origin,h=s.some((u=>o.includes(u)));if((a||h)&&(!e.targetMapId||this.mapId===e.targetMapId)){if(e.type==="<cancel>"){delete this.tasks[i];let u=this.abortControllers[i];return delete this.abortControllers[i],void(u&&u.abort())}if(ii(self)||e.mustQueue)return this.tasks[i]=e,this.taskQueue.push(i),void this.invoker.trigger();this.processTask(i,e)}}process(){if(this.taskQueue.length===0)return;let r=this.taskQueue.shift(),e=this.tasks[r];delete this.tasks[r],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(r,e)}processTask(r,e){return c(this,void 0,void 0,(function*(){if(e.type==="<response>"){let s=this.resolveRejects[r];return delete this.resolveRejects[r],s?void(e.error?s.reject(Dt(es(e.error))):s.resolve(es(e.data))):void 0}if(!this.messageHandlers[e.type])return void this.completeTask(r,new Error(`Could not find a registered handler for ${e.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let i=es(e.data),o=new AbortController;this.abortControllers[r]=o;try{let s=yield this.messageHandlers[e.type](e.sourceMapId,i,o);this.completeTask(r,null,s)}catch(s){this.completeTask(r,Dt(s))}}))}completeTask(r,e,i){let o=[];delete this.abortControllers[r];let s={id:r,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?Cr(e):null,data:Cr(i,o)};this.target.postMessage(s,{transfer:o})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},D.O=function(){var r=new dt(16);return dt!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r},D.P=se,D.Q=function(r,e,i){var o,s,a,h,u,f,p,_,m,w,Q,x,v=i[0],S=i[1],M=i[2];return e===r?(r[12]=e[0]*v+e[4]*S+e[8]*M+e[12],r[13]=e[1]*v+e[5]*S+e[9]*M+e[13],r[14]=e[2]*v+e[6]*S+e[10]*M+e[14],r[15]=e[3]*v+e[7]*S+e[11]*M+e[15]):(s=e[1],a=e[2],h=e[3],u=e[4],f=e[5],p=e[6],_=e[7],m=e[8],w=e[9],Q=e[10],x=e[11],r[0]=o=e[0],r[1]=s,r[2]=a,r[3]=h,r[4]=u,r[5]=f,r[6]=p,r[7]=_,r[8]=m,r[9]=w,r[10]=Q,r[11]=x,r[12]=o*v+u*S+m*M+e[12],r[13]=s*v+f*S+w*M+e[13],r[14]=a*v+p*S+Q*M+e[14],r[15]=h*v+_*S+x*M+e[15]),r},D.R=Ni,D.S=function(r,e,i){var o=i[0],s=i[1],a=i[2];return r[0]=e[0]*o,r[1]=e[1]*o,r[2]=e[2]*o,r[3]=e[3]*o,r[4]=e[4]*s,r[5]=e[5]*s,r[6]=e[6]*s,r[7]=e[7]*s,r[8]=e[8]*a,r[9]=e[9]*a,r[10]=e[10]*a,r[11]=e[11]*a,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},D.T=Yh,D.U=function(r,e,i){var o=e[0],s=e[1],a=e[2],h=e[3],u=e[4],f=e[5],p=e[6],_=e[7],m=e[8],w=e[9],Q=e[10],x=e[11],v=e[12],S=e[13],M=e[14],L=e[15],U=i[0],k=i[1],G=i[2],O=i[3];return r[0]=U*o+k*u+G*m+O*v,r[1]=U*s+k*f+G*w+O*S,r[2]=U*a+k*p+G*Q+O*M,r[3]=U*h+k*_+G*x+O*L,r[4]=(U=i[4])*o+(k=i[5])*u+(G=i[6])*m+(O=i[7])*v,r[5]=U*s+k*f+G*w+O*S,r[6]=U*a+k*p+G*Q+O*M,r[7]=U*h+k*_+G*x+O*L,r[8]=(U=i[8])*o+(k=i[9])*u+(G=i[10])*m+(O=i[11])*v,r[9]=U*s+k*f+G*w+O*S,r[10]=U*a+k*p+G*Q+O*M,r[11]=U*h+k*_+G*x+O*L,r[12]=(U=i[12])*o+(k=i[13])*u+(G=i[14])*m+(O=i[15])*v,r[13]=U*s+k*f+G*w+O*S,r[14]=U*a+k*p+G*Q+O*M,r[15]=U*h+k*_+G*x+O*L,r},D.V=function(r,e){let i={};for(let o of e)o in r&&(i[o]=r[o]);return i},D.W=ho,D.X=Un,D.Y=gg,D.Z=dg,D._=c,D.a=Io,D.a$=function(r){var e=new dt(3);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e},D.a0=Lt,D.a1=qe,D.a2=RA,D.a3=qi,D.a4=fg,D.a5=Pc,D.a6=Ge,D.a7=nl,D.a8=hs,D.a9=25,D.aA=function(r){var e=r[0],i=r[1];return Math.sqrt(e*e+i*i)},D.aB=function(r){return r[0]=0,r[1]=0,r},D.aC=function(r,e,i){return r[0]=e[0]*i,r[1]=e[1]*i,r},D.aD=fu,D.aE=tt,D.aF=function(r,e,i,o){let s=e.y-r.y,a=e.x-r.x,h=o.y-i.y,u=o.x-i.x,f=h*a-u*s;if(f===0)return null;let p=(u*(r.y-i.y)-h*(r.x-i.x))/f;return new se(r.x+p*a,r.y+p*s)},D.aG=ep,D.aH=uA,D.aI=function(r){let e=1/0,i=1/0,o=-1/0,s=-1/0;for(let a of r)e=Math.min(e,a.x),i=Math.min(i,a.y),o=Math.max(o,a.x),s=Math.max(s,a.y);return[e,i,o,s]},D.aJ=Jt,D.aK=Ft,D.aL=function(r,e,i,o,s=!1){if(!i[0]&&!i[1])return[0,0];let a=s?o==="map"?-r.bearingInRadians:0:o==="viewport"?r.bearingInRadians:0;if(a){let h=Math.sin(a),u=Math.cos(a);i=[i[0]*u-i[1]*h,i[0]*h+i[1]*u]}return[s?i[0]:Ft(e,i[0],r.zoom),s?i[1]:Ft(e,i[1],r.zoom)]},D.aN=pu,D.aO=zu,D.aP=gu,D.aQ=r=>r.type==="symbol",D.aR=vc,D.aS=_t,D.aT=xc,D.aU=R,D.aV=ve,D.aW=me,D.aX=rn,D.aY=mg,D.aZ=ee,D.a_=V,D.aa=Qu,D.ab=r=>{let e=window.document.createElement("video");return e.muted=!0,new Promise((i=>{e.onloadstart=()=>{i(e)};for(let o of r){let s=window.document.createElement("source");ir(o)||(e.crossOrigin="Anonymous"),s.src=o,e.appendChild(s)}}))},D.ac=Ee,D.ad=function(){return Eo++},D.ae=l,D.af=wA,D.ag=Al,D.ah=Ko,D.ai=Jr,D.aj=Qg,D.ak=function(r){let e={};if(r.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((i,o,s,a)=>{let h=s||a;return e[o]=!h||h.toLowerCase(),""})),e["max-age"]){let i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e},D.al=fi,D.am=85.051129,D.an=Lr,D.ao=function(r){return Math.pow(2,r)},D.ap=Tn,D.aq=pg,D.ar=function(r){return Math.log(r)/Math.LN2},D.as=function(r){var e=r[0],i=r[1];return e*e+i*i},D.at=function(r){if(!r.length)return new Set;let e=Math.max(...r.map((f=>f.canonical.z))),i=1/0,o=-1/0,s=1/0,a=-1/0,h=[];for(let f of r){let{x:p,y:_,z:m}=f.canonical,w=Math.pow(2,e-m),Q=p*w,x=_*w;h.push({id:f,x:Q,y:x}),Q<i&&(i=Q),Q>o&&(o=Q),x<s&&(s=x),x>a&&(a=x)}let u=new Set;for(let f of h)f.x!==i&&f.x!==o&&f.y!==s&&f.y!==a||u.add(f.id);return u},D.au=function(r,e){let i=Math.abs(2*r.wrap)-+(r.wrap<0),o=Math.abs(2*e.wrap)-+(e.wrap<0);return r.overscaledZ-e.overscaledZ||o-i||e.canonical.y-r.canonical.y||e.canonical.x-r.canonical.x},D.av=class{constructor(r,e){this.max=r,this.onRemove=e,this.reset()}reset(){for(let r in this.data)for(let e of this.data[r])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(r,e,i){let o=r.wrapped().key;this.data[o]===void 0&&(this.data[o]=[]);let s={value:e,timeout:void 0};if(i!==void 0&&(s.timeout=setTimeout((()=>{this.remove(r,s)}),i)),this.data[o].push(s),this.order.push(o),this.order.length>this.max){let a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this}has(r){return r.wrapped().key in this.data}getAndRemove(r){return this.has(r)?this._getAndRemoveByKey(r.wrapped().key):null}_getAndRemoveByKey(r){let e=this.data[r].shift();return e.timeout&&clearTimeout(e.timeout),this.data[r].length===0&&delete this.data[r],this.order.splice(this.order.indexOf(r),1),e.value}getByKey(r){let e=this.data[r];return e?e[0].value:null}get(r){return this.has(r)?this.data[r.wrapped().key][0].value:null}remove(r,e){if(!this.has(r))return this;let i=r.wrapped().key,o=e===void 0?0:this.data[i].indexOf(e),s=this.data[i][o];return this.data[i].splice(o,1),s.timeout&&clearTimeout(s.timeout),this.data[i].length===0&&delete this.data[i],this.onRemove(s.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(r){for(this.max=r;this.order.length>this.max;){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(r){let e=[];for(let i in this.data)for(let o of this.data[i])r(o.value)||e.push(o);for(let i of e)this.remove(i.value.tileID,i)}},D.aw=function(r,e){let i=0,o=0;if(r.kind==="constant")o=r.layoutSize;else if(r.kind!=="source"){let{interpolationType:s,minZoom:a,maxZoom:h}=r,u=s?fi(Rt.interpolationFactor(s,e,a,h),0,1):0;r.kind==="camera"?o=Pi.number(r.minSize,r.maxSize,u):i=u}return{uSizeT:i,uSize:o}},D.ay=function(r,{uSize:e,uSizeT:i},{lowerSize:o,upperSize:s}){return r.kind==="source"?o/Fn:r.kind==="composite"?Pi.number(o/Fn,s/Fn,i):e},D.az=Ke,D.b=tn,D.b$=lA,D.b0=function(r,e,i){return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],r},D.b1=function(r,e){var i=e[0],o=e[1],s=e[2],a=i*i+o*o+s*s;return a>0&&(a=1/Math.sqrt(a)),r[0]=e[0]*a,r[1]=e[1]*a,r[2]=e[2]*a,r},D.b2=ie,D.b3=function(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]},D.b4=function(r,e,i){return r[0]=e[0]*i[0],r[1]=e[1]*i[1],r[2]=e[2]*i[2],r[3]=e[3]*i[3],r},D.b5=Co,D.b6=function(r,e,i){let o=e[0]*i[0]+e[1]*i[1]+e[2]*i[2];return o===0?null:(-(r[0]*i[0]+r[1]*i[1]+r[2]*i[2])-i[3])/o},D.b7=Se,D.b8=function(r,e,i){return r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r[3]=e[3]*i,r},D.b9=function(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]},D.bA=et,D.bB=function(r,e,i){var o=i[0],s=i[1],a=i[2],h=i[3],u=e[0],f=e[1],p=e[2],_=s*p-a*f,m=a*u-o*p,w=o*f-s*u;return r[0]=u+h*(_+=_)+s*(w+=w)-a*(m+=m),r[1]=f+h*m+a*_-o*w,r[2]=p+h*w+o*m-s*_,r},D.bC=function(r,e,i){let o=(s=[r[0],r[1],r[2],e[0],e[1],e[2],i[0],i[1],i[2]])[0]*((_=s[8])*(h=s[4])-(u=s[5])*(p=s[7]))+s[1]*(-_*(a=s[3])+u*(f=s[6]))+s[2]*(p*a-h*f);var s,a,h,u,f,p,_;if(o===0)return null;let m=ie([],[e[0],e[1],e[2]],[i[0],i[1],i[2]]),w=ie([],[i[0],i[1],i[2]],[r[0],r[1],r[2]]),Q=ie([],[r[0],r[1],r[2]],[e[0],e[1],e[2]]),x=ee([],m,-r[3]);return V(x,x,ee([],w,-e[3])),V(x,x,ee([],Q,-i[3])),ee(x,x,1/o),x},D.bD=yu,D.bE=function(){return new Float64Array(4)},D.bF=function(r,e,i,o){var s=[],a=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],a[0]=s[0]*Math.cos(o)-s[1]*Math.sin(o),a[1]=s[0]*Math.sin(o)+s[1]*Math.cos(o),a[2]=s[2],r[0]=a[0]+i[0],r[1]=a[1]+i[1],r[2]=a[2]+i[2],r},D.bG=function(r,e,i,o){var s=[],a=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],a[0]=s[0],a[1]=s[1]*Math.cos(o)-s[2]*Math.sin(o),a[2]=s[1]*Math.sin(o)+s[2]*Math.cos(o),r[0]=a[0]+i[0],r[1]=a[1]+i[1],r[2]=a[2]+i[2],r},D.bH=function(r,e,i,o){var s=[],a=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],a[0]=s[2]*Math.sin(o)+s[0]*Math.cos(o),a[1]=s[1],a[2]=s[2]*Math.cos(o)-s[0]*Math.sin(o),r[0]=a[0]+i[0],r[1]=a[1]+i[1],r[2]=a[2]+i[2],r},D.bI=function(r,e,i){var o=Math.sin(i),s=Math.cos(i),a=e[0],h=e[1],u=e[2],f=e[3],p=e[8],_=e[9],m=e[10],w=e[11];return e!==r&&(r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=a*s-p*o,r[1]=h*s-_*o,r[2]=u*s-m*o,r[3]=f*s-w*o,r[8]=a*o+p*s,r[9]=h*o+_*s,r[10]=u*o+m*s,r[11]=f*o+w*s,r},D.bJ=function(r,e){let i=tr(r,360),o=tr(e,360),s=o-i,a=o>i?s-360:s+360;return Math.abs(s)<Math.abs(a)?s:a},D.bK=function(r){return r[0]=0,r[1]=0,r[2]=0,r},D.bL=function(r,e,i,o){let s=Math.sqrt(r*r+e*e),a=Math.sqrt(i*i+o*o);r/=s,e/=s,i/=a,o/=a;let h=Math.acos(r*i+e*o);return-e*i+r*o>0?h:-h},D.bM=function(r,e){let i=tr(r,2*Math.PI),o=tr(e,2*Math.PI);return Math.min(Math.abs(i-o),Math.abs(i-o+2*Math.PI),Math.abs(i-o-2*Math.PI))},D.bN=function(){let r={},e=he.$version;for(let i in he.$root){let o=he.$root[i];if(o.required){let s=null;s=i==="version"?e:o.type==="array"?[]:{},s!=null&&(r[i]=s)}}return r},D.bO=zA,D.bP=xa,D.bQ=function r(e,i){if(Array.isArray(e)){if(!Array.isArray(i)||e.length!==i.length)return!1;for(let o=0;o<e.length;o++)if(!r(e[o],i[o]))return!1;return!0}if(typeof e=="object"&&e!==null&&i!==null){if(typeof i!="object"||Object.keys(e).length!==Object.keys(i).length)return!1;for(let o in e)if(!r(e[o],i[o]))return!1;return!0}return e===i},D.bR=_s,D.bS=function(r){r=r.slice();let e=Object.create(null);for(let i=0;i<r.length;i++)e[r[i].id]=r[i];for(let i=0;i<r.length;i++)"ref"in r[i]&&(r[i]=KA(r[i],e[r[i].ref]));return r},D.bT=function(r,e){if(r.type==="custom")return new xm(r,e);switch(r.type){case"background":return new Im(r,e);case"circle":return new zp(r,e);case"color-relief":return new Zp(r,e);case"fill":return new cf(r,e);case"fill-extrusion":return new Cf(r,e);case"heatmap":return new Kp(r,e);case"hillshade":return new Xp(r,e);case"line":return new Zf(r,e);case"raster":return new Lh(r,e);case"symbol":return new kc(r,e)}},D.bU=r=>r.type==="raster",D.bV=Oe,D.bW=function(r,e){if(!r)return[{command:"setStyle",args:[e]}];let i=[];try{if(!ct(r.version,e.version))return[{command:"setStyle",args:[e]}];ct(r.center,e.center)||i.push({command:"setCenter",args:[e.center]}),ct(r.state,e.state)||i.push({command:"setGlobalState",args:[e.state]}),ct(r.centerAltitude,e.centerAltitude)||i.push({command:"setCenterAltitude",args:[e.centerAltitude]}),ct(r.zoom,e.zoom)||i.push({command:"setZoom",args:[e.zoom]}),ct(r.bearing,e.bearing)||i.push({command:"setBearing",args:[e.bearing]}),ct(r.pitch,e.pitch)||i.push({command:"setPitch",args:[e.pitch]}),ct(r.roll,e.roll)||i.push({command:"setRoll",args:[e.roll]}),ct(r.sprite,e.sprite)||i.push({command:"setSprite",args:[e.sprite]}),ct(r.glyphs,e.glyphs)||i.push({command:"setGlyphs",args:[e.glyphs]}),ct(r.transition,e.transition)||i.push({command:"setTransition",args:[e.transition]}),ct(r.light,e.light)||i.push({command:"setLight",args:[e.light]}),ct(r.terrain,e.terrain)||i.push({command:"setTerrain",args:[e.terrain]}),ct(r.sky,e.sky)||i.push({command:"setSky",args:[e.sky]}),ct(r.projection,e.projection)||i.push({command:"setProjection",args:[e.projection]});let o={},s=[];(function(h,u,f,p){let _;for(_ in u=u||{},h=h||{})Object.prototype.hasOwnProperty.call(h,_)&&(Object.prototype.hasOwnProperty.call(u,_)||fl(_,f,p));for(_ in u)Object.prototype.hasOwnProperty.call(u,_)&&(Object.prototype.hasOwnProperty.call(h,_)?ct(h[_],u[_])||(h[_].type==="geojson"&&u[_].type==="geojson"&&lh(h,u,_)?bi(f,{command:"setGeoJSONSourceData",args:[_,u[_].data]}):ml(_,u,f,p)):sn(_,u,f))})(r.sources,e.sources,s,o);let a=[];r.layers&&r.layers.forEach((h=>{"source"in h&&o[h.source]?i.push({command:"removeLayer",args:[h.id]}):a.push(h)})),i=i.concat(s),(function(h,u,f){u=u||[];let p=(h=h||[]).map(jA),_=u.map(jA),m=h.reduce(Bl,{}),w=u.reduce(Bl,{}),Q=p.slice(),x=Object.create(null),v,S,M,L,U;for(let k=0,G=0;k<p.length;k++)v=p[k],Object.prototype.hasOwnProperty.call(w,v)?G++:(bi(f,{command:"removeLayer",args:[v]}),Q.splice(Q.indexOf(v,G),1));for(let k=0,G=0;k<_.length;k++)v=_[_.length-1-k],Q[Q.length-1-k]!==v&&(Object.prototype.hasOwnProperty.call(m,v)?(bi(f,{command:"removeLayer",args:[v]}),Q.splice(Q.lastIndexOf(v,Q.length-G),1)):G++,L=Q[Q.length-k],bi(f,{command:"addLayer",args:[w[v],L]}),Q.splice(Q.length-k,0,v),x[v]=!0);for(let k=0;k<_.length;k++)if(v=_[k],S=m[v],M=w[v],!x[v]&&!ct(S,M))if(ct(S.source,M.source)&&ct(S["source-layer"],M["source-layer"])&&ct(S.type,M.type)){for(U in Qs(S.layout,M.layout,f,v,null,"setLayoutProperty"),Qs(S.paint,M.paint,f,v,null,"setPaintProperty"),ct(S.filter,M.filter)||bi(f,{command:"setFilter",args:[v,M.filter]}),ct(S.minzoom,M.minzoom)&&ct(S.maxzoom,M.maxzoom)||bi(f,{command:"setLayerZoomRange",args:[v,M.minzoom,M.maxzoom]}),S)Object.prototype.hasOwnProperty.call(S,U)&&U!=="layout"&&U!=="paint"&&U!=="filter"&&U!=="metadata"&&U!=="minzoom"&&U!=="maxzoom"&&(U.indexOf("paint.")===0?Qs(S[U],M[U],f,v,U.slice(6),"setPaintProperty"):ct(S[U],M[U])||bi(f,{command:"setLayerProperty",args:[v,U,M[U]]}));for(U in M)Object.prototype.hasOwnProperty.call(M,U)&&!Object.prototype.hasOwnProperty.call(S,U)&&U!=="layout"&&U!=="paint"&&U!=="filter"&&U!=="metadata"&&U!=="minzoom"&&U!=="maxzoom"&&(U.indexOf("paint.")===0?Qs(S[U],M[U],f,v,U.slice(6),"setPaintProperty"):ct(S[U],M[U])||bi(f,{command:"setLayerProperty",args:[v,U,M[U]]}))}else bi(f,{command:"removeLayer",args:[v]}),L=Q[Q.lastIndexOf(v)+1],bi(f,{command:"addLayer",args:[M,L]})})(a,e.layers,i)}catch(o){console.warn("Unable to compute style diff:",o),i=[{command:"setStyle",args:[e]}]}return i},D.bX=function(r){let e=[],i=r.id;return i===void 0&&e.push({message:`layers.${i}: missing required property "id"`}),r.render===void 0&&e.push({message:`layers.${i}: missing required method "render"`}),r.renderingMode&&r.renderingMode!=="2d"&&r.renderingMode!=="3d"&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},D.bY=Tr,D.bZ=en,D.b_=class extends hi{constructor(r,e){super(r,e),this.current=0}set(r){this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))}},D.ba=_g,D.bb=EA,D.bc=function(r,e,i,o,s){var a=1/Math.tan(e/2);if(r[0]=a/i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,s!=null&&s!==1/0){var h=1/(o-s);r[10]=(s+o)*h,r[14]=2*s*o*h}else r[10]=-1,r[14]=-2*o;return r},D.bd=function(r){var e=new dt(16);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e},D.be=function(r,e,i){var o=Math.sin(i),s=Math.cos(i),a=e[0],h=e[1],u=e[2],f=e[3],p=e[4],_=e[5],m=e[6],w=e[7];return e!==r&&(r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=a*s+p*o,r[1]=h*s+_*o,r[2]=u*s+m*o,r[3]=f*s+w*o,r[4]=p*s-a*o,r[5]=_*s-h*o,r[6]=m*s-u*o,r[7]=w*s-f*o,r},D.bf=function(r,e,i){var o=Math.sin(i),s=Math.cos(i),a=e[4],h=e[5],u=e[6],f=e[7],p=e[8],_=e[9],m=e[10],w=e[11];return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[4]=a*s+p*o,r[5]=h*s+_*o,r[6]=u*s+m*o,r[7]=f*s+w*o,r[8]=p*s-a*o,r[9]=_*s-h*o,r[10]=m*s-u*o,r[11]=w*s-f*o,r},D.bg=function(r,e){var i=e[0],o=e[1],s=e[2],a=e[3],h=e[4],u=e[5],f=e[6],p=e[7],_=e[8],m=e[9],w=e[10],Q=e[11],x=e[12],v=e[13],S=e[14],M=e[15],L=i*u-o*h,U=i*f-s*h,k=i*p-a*h,G=o*f-s*u,O=o*p-a*u,q=s*p-a*f,W=_*v-m*x,oe=_*S-w*x,ne=_*M-Q*x,ue=m*S-w*v,fe=m*M-Q*v,ce=w*M-Q*S,re=L*ce-U*fe+k*ue+G*ne-O*oe+q*W;return re?(r[0]=(u*ce-f*fe+p*ue)*(re=1/re),r[1]=(s*fe-o*ce-a*ue)*re,r[2]=(v*q-S*O+M*G)*re,r[3]=(w*O-m*q-Q*G)*re,r[4]=(f*ne-h*ce-p*oe)*re,r[5]=(i*ce-s*ne+a*oe)*re,r[6]=(S*k-x*q-M*U)*re,r[7]=(_*q-w*k+Q*U)*re,r[8]=(h*fe-u*ne+p*W)*re,r[9]=(o*ne-i*fe-a*W)*re,r[10]=(x*O-v*k+M*L)*re,r[11]=(m*k-_*O-Q*L)*re,r[12]=(u*oe-h*ue-f*W)*re,r[13]=(i*ue-o*oe+s*W)*re,r[14]=(v*U-x*G-S*L)*re,r[15]=(_*G-m*U+w*L)*re,r):null},D.bh=function(){let r=new Float32Array(16);return Tn(r),r},D.bi=function(){let r=new Float64Array(16);return Tn(r),r},D.bj=function(){return new Float64Array(16)},D.bk=function(r,e,i){let o=new Float64Array(4);return et(o,r,e-90,i),o},D.bl=function(r,e,i,o){var s,a,h,u,f,p=e[0],_=e[1],m=e[2],w=e[3],Q=i[0],x=i[1],v=i[2],S=i[3];return(a=p*Q+_*x+m*v+w*S)<0&&(a=-a,Q=-Q,x=-x,v=-v,S=-S),1-a>de?(s=Math.acos(a),h=Math.sin(s),u=Math.sin((1-o)*s)/h,f=Math.sin(o*s)/h):(u=1-o,f=o),r[0]=u*p+f*Q,r[1]=u*_+f*x,r[2]=u*m+f*v,r[3]=u*w+f*S,r},D.bm=function(r){let e=new Float64Array(9);var i,o,s,a,h,u,f,p,_,m,w,Q,x,v,S,M,L,U;m=(s=(o=r)[0])*(f=s+s),w=(a=o[1])*f,x=(h=o[2])*f,v=h*(p=a+a),M=(u=o[3])*f,L=u*p,U=u*(_=h+h),(i=e)[0]=1-(Q=a*p)-(S=h*_),i[3]=w-U,i[6]=x+L,i[1]=w+U,i[4]=1-m-S,i[7]=v-M,i[2]=x-L,i[5]=v+M,i[8]=1-m-Q;let k=rn(-Math.asin(fi(e[2],-1,1))),G,O;return Math.hypot(e[5],e[8])<.001?(G=0,O=-rn(Math.atan2(e[3],e[4]))):(G=rn(e[5]===0&&e[8]===0?0:Math.atan2(e[5],e[8])),O=rn(e[1]===0&&e[0]===0?0:Math.atan2(e[1],e[0]))),{roll:G,pitch:k+90,bearing:O}},D.bn=function(r,e){return r.roll==e.roll&&r.pitch==e.pitch&&r.bearing==e.bearing},D.bo=Ve,D.bp=Ir,D.bq=mA,D.br=Ja,D.bs=fA,D.bt=Ki,D.bu=Mr,D.bv=Bi,D.bw=function(r,e,i,o,s){return Ki(o,s,fi((r-e)/(i-e),0,1))},D.bx=function(r,e,i,o){return r[0]=e[0]+i[0]*o,r[1]=e[1]+i[1]*o,r[2]=e[2]+i[2]*o,r},D.by=tr,D.bz=function(){return new Float64Array(3)},D.c=kr,D.c$=Yo,D.c0=class extends hi{constructor(r,e){super(r,e),this.current=gr}set(r){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(let e=1;e<16;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}}},D.c1=Vr,D.c2=class extends hi{constructor(r,e){super(r,e),this.current=[0,0,0]}set(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2]))}},D.c3=class extends hi{constructor(r,e){super(r,e),this.current=[0,0]}set(r){r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1]))}},D.c4=xi,D.c5=function(r,e){var i=Math.sin(e),o=Math.cos(e);return r[0]=o,r[1]=i,r[2]=0,r[3]=-i,r[4]=o,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r},D.c6=function(r,e,i){var o=e[0],s=e[1],a=e[2];return r[0]=o*i[0]+s*i[3]+a*i[6],r[1]=o*i[1]+s*i[4]+a*i[7],r[2]=o*i[2]+s*i[5]+a*i[8],r},D.c7=function(r,e,i,o,s,a,h){var u=1/(e-i),f=1/(o-s),p=1/(a-h);return r[0]=-2*u,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*f,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*p,r[11]=0,r[12]=(e+i)*u,r[13]=(s+o)*f,r[14]=(h+a)*p,r[15]=1,r},D.c8=class extends hi{constructor(r,e){super(r,e),this.current=new Array}set(r){if(r!=this.current){this.current=r;let e=new Float32Array(4*r.length);for(let i=0;i<r.length;i++)e[4*i]=r[i].r,e[4*i+1]=r[i].g,e[4*i+2]=r[i].b,e[4*i+3]=r[i].a;this.gl.uniform4fv(this.location,e)}}},D.c9=class extends hi{constructor(r,e){super(r,e),this.current=new Array}set(r){if(r!=this.current){this.current=r;let e=new Float32Array(r);this.gl.uniform1fv(this.location,e)}}},D.cA=function(r,e){return OA[e]&&"touches"in r},D.cB=function(r){return OA[r]||NA[r]},D.cC=function(r,e,i){var o=e[0],s=e[1];return r[0]=i[0]*o+i[4]*s+i[12],r[1]=i[1]*o+i[5]*s+i[13],r},D.cD=function(r,e){let{x:i,y:o}=nl.fromLngLat(e);return!(r<0||r>25||o<0||o>=1||i<0||i>=1)},D.cE=function(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},D.cF=class extends iA{},D.cG=kn,D.cH=function(r,e){kr.REGISTERED_PROTOCOLS[r]=e},D.cI=function(r){delete kr.REGISTERED_PROTOCOLS[r]},D.cJ=function(r,e){let i={};for(let s=0;s<r.length;s++){let a=e&&e[r[s].id]||bh(r[s]);e&&(e[r[s].id]=a);let h=i[a];h||(h=i[a]=[]),h.push(r[s])}let o=[];for(let s in i)o.push(i[s]);return o},D.cK=be,D.cL=yg,D.cM=Wg,D.cN=ig,D.cO=function(r){var e,i;r.bucket.createArrays(),r.bucket.tilePixelRatio=Ge/(512*r.bucket.overscaling),r.bucket.compareText={},r.bucket.iconsNeedLinear=!1;let o=r.bucket.layers[0],s=o.layout,a=o._unevaluatedLayout._values,h={layoutIconSize:a["icon-size"].possiblyEvaluate(new Bt(r.bucket.zoom+1),r.canonical),layoutTextSize:a["text-size"].possiblyEvaluate(new Bt(r.bucket.zoom+1),r.canonical),textMaxSize:a["text-size"].possiblyEvaluate(new Bt(18))};if(r.bucket.textSizeData.kind==="composite"){let{minZoom:m,maxZoom:w}=r.bucket.textSizeData;h.compositeTextSizes=[a["text-size"].possiblyEvaluate(new Bt(m),r.canonical),a["text-size"].possiblyEvaluate(new Bt(w),r.canonical)]}if(r.bucket.iconSizeData.kind==="composite"){let{minZoom:m,maxZoom:w}=r.bucket.iconSizeData;h.compositeIconSizes=[a["icon-size"].possiblyEvaluate(new Bt(m),r.canonical),a["icon-size"].possiblyEvaluate(new Bt(w),r.canonical)]}let u=s.get("text-line-height")*Jt,f=s.get("text-rotation-alignment")!=="viewport"&&s.get("symbol-placement")!=="point",p=s.get("text-keep-upright"),_=s.get("text-size");for(let m of r.bucket.features){let w=s.get("text-font").evaluate(m,{},r.canonical).join(","),Q=_.evaluate(m,{},r.canonical),x=h.layoutTextSize.evaluate(m,{},r.canonical),v=h.layoutIconSize.evaluate(m,{},r.canonical),S={horizontal:{},vertical:void 0},M=m.text,L,U=[0,0];if(M){let O=M.toString(),q=s.get("text-letter-spacing").evaluate(m,{},r.canonical)*Jt,W=Ws(O)?q:0,oe=s.get("text-anchor").evaluate(m,{},r.canonical),ne=hp(o,m,r.canonical);if(!ne){let re=s.get("text-radial-offset").evaluate(m,{},r.canonical);U=re?cp(oe,[re*Jt,Nu]):s.get("text-offset").evaluate(m,{},r.canonical).map((_e=>_e*Jt))}let ue=f?"center":s.get("text-justify").evaluate(m,{},r.canonical),fe=s.get("symbol-placement")==="point"?s.get("text-max-width").evaluate(m,{},r.canonical)*Jt:1/0,ce=()=>{r.bucket.allowVerticalPlacement&&va(O)&&(S.vertical=Uc(M,r.glyphMap,r.glyphPositions,r.imagePositions,w,fe,u,oe,"left",W,U,D.ax.vertical,!0,x,Q))};if(!f&&ne){let re=new Set;if(ue==="auto")for(let Qe=0;Qe<ne.values.length;Qe+=2)re.add(zu(ne.values[Qe]));else re.add(ue);let _e=!1;for(let Qe of re)if(!S.horizontal[Qe])if(_e)S.horizontal[Qe]=S.horizontal[0];else{let ye=Uc(M,r.glyphMap,r.glyphPositions,r.imagePositions,w,fe,u,"center",Qe,W,U,D.ax.horizontal,!1,x,Q);ye&&(S.horizontal[Qe]=ye,_e=ye.positionedLines.length===1)}ce()}else{ue==="auto"&&(ue=zu(oe));let re=Uc(M,r.glyphMap,r.glyphPositions,r.imagePositions,w,fe,u,oe,ue,W,U,D.ax.horizontal,!1,x,Q);re&&(S.horizontal[ue]=re),ce(),va(O)&&f&&p&&(S.vertical=Uc(M,r.glyphMap,r.glyphPositions,r.imagePositions,w,fe,u,oe,ue,W,U,D.ax.vertical,!1,x,Q))}}let k=!1;if(!((e=m.icon)===null||e===void 0)&&e.name){let O=r.imageMap[m.icon.name];O&&(L=Qm(r.imagePositions[m.icon.name],s.get("icon-offset").evaluate(m,{},r.canonical),s.get("icon-anchor").evaluate(m,{},r.canonical)),k=!!O.sdf,r.bucket.sdfIcons===void 0?r.bucket.sdfIcons=k:r.bucket.sdfIcons!==k&&ti("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(O.pixelRatio!==r.bucket.pixelRatio||s.get("icon-rotate").constantOr(1)!==0)&&(r.bucket.iconsNeedLinear=!0))}let G=dp(S.horizontal)||S.vertical;(i=r.bucket).iconsInText||(i.iconsInText=!!G&&G.iconsInText),(G||L)&&pB(r.bucket,m,S,L,r.imageMap,h,x,v,U,k,r.canonical,r.subdivisionGranularity)}r.showCollisionBoxes&&r.bucket.generateCollisionDebugBuffers()},D.cP=Vh,D.cQ=Hh,D.cR=hu,D.cS=function(r,e=""){let i=new Tc;return(function(o,s,a=""){for(let h in o.layers)s.writeMessage(3,((u,f)=>tB(u,f,a)),o.layers[h])})(r,i,e),i.finish()},D.cT=function(r,e,i,o,s,a){let h=tp(r,e,i,s,0);return h=tp(h,e,o,a,1),h},D.cU=class{constructor(r){this.maxEntries=r,this.map=new Map}get(r){let e=this.map.get(r);return e!==void 0&&(this.map.delete(r),this.map.set(r,e)),e}set(r,e){if(this.map.has(r))this.map.delete(r);else if(this.map.size>=this.maxEntries){let i=this.map.keys().next().value;this.map.delete(i)}this.map.set(r,e)}clear(){this.map.clear()}},D.cV=Id,D.cW=Tc,D.cX=Jg,D.cY=function(r,e,i,o,s){return c(this,void 0,void 0,(function*(){if(qe())try{return yield RA(r,e,i,o,s)}catch(a){}return(function(a,h,u,f,p){let _=a.width,m=a.height;Ur&&Ln||(Ur=new OffscreenCanvas(_,m),Ln=Ur.getContext("2d",{willReadFrequently:!0})),Ur.width=_,Ur.height=m,Ln.drawImage(a,0,0,_,m);let w=Ln.getImageData(h,u,f,p);return Ln.clearRect(0,0,_,m),w.data})(r,e,i,o,s)}))},D.cZ=dd,D.c_=class{constructor(r,e){this.layers={[Al]:this},this.name=Al,this.version=e?e.version:1,this.extent=e?e.extent:4096,this.length=r.length,this.features=r}feature(r){return new eB(this.features[r],this.extent)}},D.ca=class extends In{},D.cb=Wf,D.cc=class extends as{},D.cd=zh,D.ce=function(r){return r<=1?1:Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))},D.cf=ld,D.cg=function(r,e,i){var o=e[0],s=e[1],a=e[2],h=i[3]*o+i[7]*s+i[11]*a+i[15];return r[0]=(i[0]*o+i[4]*s+i[8]*a+i[12])/(h=h||1),r[1]=(i[1]*o+i[5]*s+i[9]*a+i[13])/h,r[2]=(i[2]*o+i[6]*s+i[10]*a+i[14])/h,r},D.ch=class extends rA{},D.ci=class extends t{},D.cj=function(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]&&r[8]===e[8]&&r[9]===e[9]&&r[10]===e[10]&&r[11]===e[11]&&r[12]===e[12]&&r[13]===e[13]&&r[14]===e[14]&&r[15]===e[15]},D.ck=function(r,e){var i=r[0],o=r[1],s=r[2],a=r[3],h=r[4],u=r[5],f=r[6],p=r[7],_=r[8],m=r[9],w=r[10],Q=r[11],x=r[12],v=r[13],S=r[14],M=r[15],L=e[0],U=e[1],k=e[2],G=e[3],O=e[4],q=e[5],W=e[6],oe=e[7],ne=e[8],ue=e[9],fe=e[10],ce=e[11],re=e[12],_e=e[13],Qe=e[14],ye=e[15];return Math.abs(i-L)<=de*Math.max(1,Math.abs(i),Math.abs(L))&&Math.abs(o-U)<=de*Math.max(1,Math.abs(o),Math.abs(U))&&Math.abs(s-k)<=de*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(a-G)<=de*Math.max(1,Math.abs(a),Math.abs(G))&&Math.abs(h-O)<=de*Math.max(1,Math.abs(h),Math.abs(O))&&Math.abs(u-q)<=de*Math.max(1,Math.abs(u),Math.abs(q))&&Math.abs(f-W)<=de*Math.max(1,Math.abs(f),Math.abs(W))&&Math.abs(p-oe)<=de*Math.max(1,Math.abs(p),Math.abs(oe))&&Math.abs(_-ne)<=de*Math.max(1,Math.abs(_),Math.abs(ne))&&Math.abs(m-ue)<=de*Math.max(1,Math.abs(m),Math.abs(ue))&&Math.abs(w-fe)<=de*Math.max(1,Math.abs(w),Math.abs(fe))&&Math.abs(Q-ce)<=de*Math.max(1,Math.abs(Q),Math.abs(ce))&&Math.abs(x-re)<=de*Math.max(1,Math.abs(x),Math.abs(re))&&Math.abs(v-_e)<=de*Math.max(1,Math.abs(v),Math.abs(_e))&&Math.abs(S-Qe)<=de*Math.max(1,Math.abs(S),Math.abs(Qe))&&Math.abs(M-ye)<=de*Math.max(1,Math.abs(M),Math.abs(ye))},D.cl=function(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},D.cm=r=>r.type==="circle",D.cn=r=>r.type==="heatmap",D.co=r=>r.type==="line",D.cp=r=>r.type==="fill",D.cq=r=>r.type==="fill-extrusion",D.cr=r=>r.type==="hillshade",D.cs=r=>r.type==="color-relief",D.ct=r=>r.type==="background",D.cu=r=>r.type==="custom",D.cv=$r,D.cw=function(r,e,i){if(e<=0)return r;let o=1/e;return i===void 0||Math.abs(i)<1e-10?Math.round(r*o)/o:(i>0?Math.ceil(r*o-1e-9):Math.floor(r*o+1e-10))/o},D.cx=function(r,e,i){let o=st(e.x-i.x,e.y-i.y),s=st(r.x-i.x,r.y-i.y);var a,h;return rn(Math.atan2(o[0]*s[1]-o[1]*s[0],(a=o)[0]*(h=s)[0]+a[1]*h[1]))},D.cy=wo,D.cz=function(r,e){var i;if(!NA[e])return!1;let o=r==null?void 0:r.target,s=((i=o==null?void 0:o.ownerDocument)===null||i===void 0?void 0:i.defaultView)||window;return r instanceof s.MouseEvent||r instanceof s.WheelEvent},D.d=Dt,D.d0=class{constructor(r,e){let i=(e=this.options=Object.assign({},Nf,e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let o=eu(r,e);i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles")),o=nu(o,e),e.updateable&&(this.source=o),this.initializeIndex(o,e)}initializeIndex(r,e){this.tileIndex=e.cluster?new Uf(e.clusterOptions):new Of(e),r.length&&this.tileIndex.initialize(r)}getTile(r,e,i){return e=+e,i=+i,(r=+r)<0||r>24?null:this.tileIndex.getTile(r,e,i)}updateData(r,e){let i=this.options;if(!i.updateable)throw new Error("to update tile geojson `updateable` option must be set to true");let{affected:o,source:s}=(function(a,h,u){let f=(function(_,m){var w,Q;return _?{removeAll:_.removeAll,remove:new Set(_.remove||[]),add:new Map((w=_.add)==null?void 0:w.map((x=>[m.promoteId?x.properties[m.promoteId]:x.id,x]))),update:new Map((Q=_.update)==null?void 0:Q.map((x=>[x.id,x])))}:{remove:new Set,add:new Map,update:new Map}})(h,u),p=[];if(f.removeAll&&(p=a,a=[]),f.remove.size||f.add.size){let _=[];for(let m of a)(f.remove.has(m.id)||f.add.has(m.id))&&_.push(m);if(_.length){p.push(..._);let m=new Set(_.map((w=>w.id)));a=a.filter((w=>!m.has(w.id)))}if(f.add.size){let m=eu({type:"FeatureCollection",features:Array.from(f.add.values())},u);m=nu(m,u),p.push(...m),a.push(...m)}}if(f.update.size){let _=new Map,m=[];for(let w of a)f.update.has(w.id)?_.set(w.id,[..._.get(w.id)||[],w]):m.push(w);for(let[w,Q]of f.update){let x=_.get(w);if(!x||x.length===0)continue;let v=Tf(x,Q,u);p.push(...x,...v),m.push(...v)}a=m}return{affected:p,source:a}})(this.source,r,i);e&&({affected:o,source:s}=this.filterUpdate(s,o,e)),o.length&&(this.source=s,this.tileIndex.updateIndex(s,o,i))}filterUpdate(r,e,i){let o=new Set;for(let s of r)s.id!=null&&(i(Fc(s))||(e.push(s),o.add(s.id)));return{affected:e,source:r=r.filter((s=>!o.has(s.id)))}}getData(){if(!this.options.updateable)throw new Error("to retrieve data the `updateable` option must be set to true");return{type:"FeatureCollection",features:this.source.map((r=>Fc(r)))}}updateClusterOptions(r,e){let i=this.options.cluster;this.options.cluster=r,this.options.clusterOptions=e,i!=r?this.initializeIndex(this.source,this.options):this.tileIndex.updateIndex(this.source,[],this.options)}getClusterExpansionZoom(r){return this.tileIndex.getClusterExpansionZoom(r)}getClusterChildren(r){return this.tileIndex.getChildren(r)}getClusterLeaves(r,e,i){return this.tileIndex.getLeaves(r,e,i)}},D.d1=wr,D.e=ji,D.f=ir,D.g=mr,D.h=r=>c(void 0,void 0,void 0,(function*(){if(r.byteLength===0)return createImageBitmap(new ImageData(1,1));let e=new Blob([new Uint8Array(r)],{type:"image/png"});try{return createImageBitmap(e)}catch(i){throw new Error(`Could not load image because of ${Dt(i).message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),D.i=ii,D.j=r=>new Promise(((e,i)=>{let o=new Image;o.onload=()=>{e(o),URL.revokeObjectURL(o.src),o.onload=null,window.requestAnimationFrame((()=>o.src=GA))},o.onerror=()=>i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let s=new Blob([new Uint8Array(r)],{type:"image/png"});o.src=r.byteLength?URL.createObjectURL(s):GA})),D.k=(r,e)=>nn(ji(r,{type:"json"}),e),D.l=Gn,D.m=nn,D.n=xo,D.o=(r,e)=>nn(ji(r,{type:"arrayBuffer"}),e),D.p=tg,D.q=function(r){return new Tc(r).readFields(dm,[])},D.r=function(r){return/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(r))},D.s=ms,D.t=ja,D.u=_i,D.v=qo,D.w=ti,D.x=he,D.y=Ta,D.z=Ri})),J("worker",["./shared"],(function(D){"use strict";class c{constructor(V,ee){this.keyCache={},V&&this.replace(V,ee)}replace(V,ee){this._layerConfigs={},this._layers={},this.update(V,[],ee)}update(V,ee,ie){for(let Se of V){this._layerConfigs[Se.id]=Se;let tt=this._layers[Se.id]=D.bT(Se,ie);tt._featureFilter=D.ah(tt.filter,ie),this.keyCache[Se.id]&&delete this.keyCache[Se.id]}for(let Se of ee)delete this.keyCache[Se],delete this._layerConfigs[Se],delete this._layers[Se];this.familiesBySource={};let we=D.cJ(Object.values(this._layerConfigs),this.keyCache);for(let Se of we){let tt=Se.map((Ft=>this._layers[Ft.id])),Re=tt[0];if(Re.isHidden())continue;let et=Re.source||"",Ke=this.familiesBySource[et];Ke||(Ke=this.familiesBySource[et]={});let st=Re.sourceLayer||D.ag,Ge=Ke[st];Ge||(Ge=Ke[st]=[]),Ge.push(tt)}}}class se{constructor(V){let ee={},ie=[];for(let Re in V){let et=V[Re],Ke=ee[Re]={};for(let st in et){let Ge=et[+st];if(!Ge||Ge.bitmap.width===0||Ge.bitmap.height===0)continue;let Ft={x:0,y:0,w:Ge.bitmap.width+2,h:Ge.bitmap.height+2};ie.push(Ft),Ke[st]={rect:Ft,metrics:Ge.metrics}}}let{w:we,h:Se}=D.p(ie),tt=new D.t({width:we||1,height:Se||1});for(let Re in V){let et=V[Re];for(let Ke in et){let st=et[+Ke];if(!st||st.bitmap.width===0||st.bitmap.height===0)continue;let Ge=ee[Re][Ke].rect;D.t.copy(st.bitmap,tt,{x:0,y:0},{x:Ge.x+1,y:Ge.y+1},st.bitmap)}}this.image=tt,this.positions=ee}}D.cK("GlyphAtlas",se);class Me{constructor(V){this.tileID=new D.a3(V.tileID.overscaledZ,V.tileID.wrap,V.tileID.canonical.z,V.tileID.canonical.x,V.tileID.canonical.y),this.uid=V.uid,this.zoom=V.zoom,this.pixelRatio=V.pixelRatio,this.tileSize=V.tileSize,this.source=V.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=V.showCollisionBoxes,this.collectResourceTiming=!!V.collectResourceTiming,this.returnDependencies=!!V.returnDependencies,this.promoteId=V.promoteId,this.inFlightDependencies=[]}parse(V,ee,ie,we,Se){return D._(this,void 0,void 0,(function*(){this.status="parsing",this.data=V,this.collisionBoxArray=new D.ae;let tt=new D.cL(Object.keys(V.layers).sort()),Re=new D.cM(this.tileID,this.promoteId);Re.bucketLayerIDs=[];let et={},Ke={featureIndex:Re,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:ie,subdivisionGranularity:Se},st=ee.familiesBySource[this.source];for(let Oe in st){let Vt=V.layers[Oe];if(!Vt)continue;Vt.version===1&&D.w(`Vector tile source "${this.source}" layer "${Oe}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let ti=tt.encode(Oe),Ui=[];for(let ii=0;ii<Vt.length;ii++){let vi=Vt.feature(ii),tn=Re.getId(vi,Oe);Ui.push({feature:vi,id:tn,index:ii,sourceLayerIndex:ti})}for(let ii of st[Oe]){let vi=ii[0];vi.source!==this.source&&D.w(`layer.source = ${vi.source} does not equal this.source = ${this.source}`),vi.isHidden(this.zoom,!0)||(Te(ii,this.zoom,ie),(et[vi.id]=vi.createBucket({index:Re.bucketLayerIDs.length,layers:ii,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ti,sourceID:this.source})).populate(Ui,Ke,this.tileID.canonical),Re.bucketLayerIDs.push(ii.map((tn=>tn.id))))}}let Ge=D.bY(Ke.glyphDependencies,(Oe=>Object.keys(Oe).map(Number)));for(let Oe of this.inFlightDependencies)Oe==null||Oe.abort();this.inFlightDependencies=[];let Ft=Promise.resolve({});if(Object.keys(Ge).length){let Oe=new AbortController;this.inFlightDependencies.push(Oe),Ft=we.sendAsync({type:"GG",data:{stacks:Ge,source:this.source,tileID:this.tileID,type:"glyphs"}},Oe)}let Dt=Object.keys(Ke.iconDependencies),tr=Promise.resolve({});if(Dt.length){let Oe=new AbortController;this.inFlightDependencies.push(Oe),tr=we.sendAsync({type:"GI",data:{icons:Dt,source:this.source,tileID:this.tileID,type:"icons"}},Oe)}let Ki=Object.keys(Ke.patternDependencies),Mr=Promise.resolve({});if(Ki.length){let Oe=new AbortController;this.inFlightDependencies.push(Oe),Mr=we.sendAsync({type:"GI",data:{icons:Ki,source:this.source,tileID:this.tileID,type:"patterns"}},Oe)}let $r=Ke.dashDependencies,wo=Promise.resolve({});if(Object.keys($r).length){let Oe=new AbortController;this.inFlightDependencies.push(Oe),wo=we.sendAsync({type:"GDA",data:{dashes:$r}},Oe)}let[fi,Un,ji,Eo]=yield Promise.all([Ft,tr,Mr,wo]),Tr=new se(fi),en=new D.cN(Un,ji);for(let Oe in et){let Vt=et[Oe];Vt instanceof D.af?(Te(Vt.layers,this.zoom,ie),D.cO({bucket:Vt,glyphMap:fi,glyphPositions:Tr.positions,imageMap:Un,imagePositions:en.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:Ke.subdivisionGranularity})):Vt.hasDependencies&&(Vt instanceof D.cP||Vt instanceof D.cQ||Vt instanceof D.cR)&&(Te(Vt.layers,this.zoom,ie),Vt.addFeatures(Ke,this.tileID.canonical,en.patternPositions,Eo))}return this.status="done",{buckets:Object.values(et).filter((Oe=>!Oe.isEmpty())),featureIndex:Re,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Tr.image,imageAtlas:en,dashPositions:Eo,glyphMap:this.returnDependencies?fi:null,iconMap:this.returnDependencies?Un:null,glyphPositions:this.returnDependencies?Tr.positions:null}}))}}function Te(nt,V,ee){let ie=new D.J(V);for(let we of nt)we.recalculate(ie,ee)}class Ye{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(V,ee){this.loading[V]=ee}finishLoading(V){delete this.loading[V]}abort(V){let ee=this.loading[V];ee!=null&&ee.abort&&(ee.abort.abort(),delete this.loading[V])}setParsing(V,ee){this.parsing[V]=ee}consumeParsing(V){let ee=this.parsing[V];if(ee)return delete this.parsing[V],ee}clearParsing(V){delete this.parsing[V]}markLoaded(V,ee){this.loaded[V]=ee}getLoaded(V){let ee=this.loaded[V];if(ee)return ee}removeLoaded(V){delete this.loaded[V]}clearLoaded(){this.loaded={}}}class rt{constructor(V){this.start=`${V}#start`,this.end=`${V}#end`,this.measure=V,performance.mark(this.start)}finish(){performance.mark(this.end);let V=performance.getEntriesByName(this.measure);return V.length===0&&(performance.measure(this.measure,this.start,this.end),V=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),V}}class Je{constructor(V,ee,ie,we,Se){this.type=V,this.properties=ie||{},this.extent=Se,this.pointsArray=ee,this.id=we}loadGeometry(){return this.pointsArray.map((V=>V.map((ee=>new D.P(ee.x,ee.y)))))}}class Qt{constructor(V,ee,ie){this.version=2,this._myFeatures=V,this.name=ee,this.length=V.length,this.extent=ie}feature(V){return this._myFeatures[V]}}class Pe{constructor(){this.layers={}}addLayer(V){this.layers[V.name]=V}}function Lt(nt){let V=D.cS(nt);return V.byteOffset===0&&V.byteLength===V.buffer.byteLength||(V=new Uint8Array(V)),{vectorTile:nt,rawData:V.buffer}}function qe(nt,V,ee){let{extent:ie}=nt,we=Math.pow(2,ee.z-V.z),Se=(ee.x-V.x*we)*ie,tt=(ee.y-V.y*we)*ie,Re=[];for(let et=0;et<nt.length;et++){let Ke=nt.feature(et),st=Ke.loadGeometry();for(let Ft of st)for(let Dt of Ft)Dt.x=Dt.x*we-Se,Dt.y=Dt.y*we-tt;let Ge=128;st=D.cT(st,Ke.type,-Ge,-Ge,ie+Ge,ie+Ge),st.length!==0&&Re.push(new Je(Ke.type,st,Ke.properties,Ke.id,ie))}return new Qt(Re,nt.name,ie)}class de{constructor(V,ee,ie){this.actor=V,this.layerIndex=ee,this.availableImages=ie,this.tileState=new Ye,this.overzoomedTileResultCache=new D.cU(1e3)}loadVectorTile(V,ee){try{return{vectorTile:V.encoding!=="mlt"?new D.cV(new D.cW(ee)):new D.cX(ee),rawData:ee}}catch(ie){let we=new Uint8Array(ee),Se=`Unable to parse the tile at ${V.request.url}, `;throw Se+=we[0]===31&&we[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${D.d(ie).message}`,new Error(Se)}}loadTile(V){return D._(this,void 0,void 0,(function*(){let{uid:ee,overzoomParameters:ie}=V;ie&&(V.request=ie.overzoomRequest);let we=this._startRequestTiming(V),Se=new Me(V);this.tileState.startLoading(ee,Se);let tt=new AbortController;Se.abort=tt;try{let Re=yield D.o(V.request,tt);if(V.etag&&V.etag===Re.etag)return this.tileState.finishLoading(ee),this._getEtagUnmodifiedResult(Re,we);let et=this.loadVectorTile(V,Re.data);if(this.tileState.finishLoading(ee),!et)return null;let{vectorTile:Ke,rawData:st}=et;ie&&({vectorTile:Ke,rawData:st}=this._getOverzoomTile(V,Ke));let Ge=this._getExpiryData(Re),Ft=this._finishRequestTiming(we);Se.vectorTile=Ke,this.tileState.markLoaded(ee,Se);let Dt={rawData:st,cacheControl:Ge,resourceTiming:Ft};this.tileState.setParsing(ee,Dt);try{return yield this._parseWorkerTile(Se,V,Dt)}finally{this.tileState.clearParsing(ee)}}catch(Re){throw this.tileState.finishLoading(ee),Se.status="done",this.tileState.markLoaded(ee,Se),Re}}))}_getEtagUnmodifiedResult(V,ee){let ie=this._getExpiryData(V),we=this._finishRequestTiming(ee);return D.e({etagUnmodified:!0},ie,we)}_parseWorkerTile(V,ee,ie){return D._(this,void 0,void 0,(function*(){let we=yield V.parse(V.vectorTile,this.layerIndex,this.availableImages,this.actor,ee.subdivisionGranularity);if(ie){let{rawData:Se,cacheControl:tt,resourceTiming:Re}=ie;we=D.e({rawTileData:Se.slice(0),encoding:ee.encoding},we,tt,Re)}return we}))}_getExpiryData({expires:V,cacheControl:ee,etag:ie}){let we={};return V&&(we.expires=V),ee&&(we.cacheControl=ee),ie&&(we.etag=ie),we}_startRequestTiming(V){var ee;if(!((ee=V.request)===null||ee===void 0)&&ee.collectResourceTiming)return new rt(V.request.url)}_finishRequestTiming(V){let ee=V==null?void 0:V.finish();return ee?{resourceTiming:JSON.parse(JSON.stringify(ee))}:{}}_getOverzoomTile(V,ee){var ie;let{tileID:we,source:Se,overzoomParameters:tt}=V,{maxZoomTileID:Re}=tt,et=`${Re.key}_${we.key}_${(ie=V.request)===null||ie===void 0?void 0:ie.url}`,Ke=this.overzoomedTileResultCache.get(et);if(Ke)return Ke;let st=new Pe,Ge=this.layerIndex.familiesBySource[Se];for(let Dt in Ge){let tr=ee.layers[Dt];if(!tr)continue;let Ki=qe(tr,Re,we.canonical);Ki.length>0&&st.addLayer(Ki)}let Ft=Lt(st);return this.overzoomedTileResultCache.set(et,Ft),Ft}reloadTile(V){return D._(this,void 0,void 0,(function*(){let ee=V.uid,ie=this.tileState.getLoaded(ee);if(!ie)throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");if(ie.showCollisionBoxes=V.showCollisionBoxes,ie.status==="parsing"){let we=this.tileState.consumeParsing(ee);return yield this._parseWorkerTile(ie,V,we)}if(ie.status==="done"&&ie.vectorTile)return yield this._parseWorkerTile(ie,V)}))}abortTile(V){return D._(this,void 0,void 0,(function*(){this.tileState.abort(V.uid)}))}removeTile(V){return D._(this,void 0,void 0,(function*(){this.tileState.removeLoaded(V.uid)}))}}class dt{constructor(){this.loaded={}}loadTile(V){return D._(this,void 0,void 0,(function*(){let{uid:ee,encoding:ie,rawImageData:we,redFactor:Se,greenFactor:tt,blueFactor:Re,baseShift:et}=V,Ke=we.width+2,st=we.height+2,Ge=D.b(we)?new D.R({width:Ke,height:st},yield D.cY(we,-1,-1,Ke,st)):we,Ft=new D.cZ(ee,Ge,ie,Se,tt,Re,et);return this.loaded||(this.loaded={}),this.loaded[ee]=Ft,Ft}))}removeTile(V){let ee=this.loaded,ie=V.uid;ee!=null&&ee[ie]&&delete ee[ie]}}class xi{constructor(V,ee,ie,we=Tn){this.actor=V,this.layerIndex=ee,this.availableImages=ie,this.tileState=new Ye,this._createGeoJSONIndex=we}loadVectorTile(V){if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let{z:ee,x:ie,y:we}=V.tileID.canonical,Se=this._geoJSONIndex.getTile(ee,ie,we);return Se?Lt(new D.c_(Se.features,{version:2,extent:D.a6})):null}loadTile(V){return D._(this,void 0,void 0,(function*(){let{uid:ee}=V,ie=new Me(V);ie.abort=new AbortController;try{let we=this.loadVectorTile(V);if(!we)return null;let{vectorTile:Se,rawData:tt}=we;ie.vectorTile=Se,this.tileState.markLoaded(ee,ie);let Re={rawData:tt};this.tileState.setParsing(ee,Re);try{return yield this._parseWorkerTile(ie,V,Re)}finally{this.tileState.clearParsing(ee)}}catch(we){throw ie.status="done",this.tileState.markLoaded(ee,ie),we}}))}_reloadLoadedTile(V){return D._(this,void 0,void 0,(function*(){let ee=V.uid,ie=this.tileState.getLoaded(ee);if(!ie)throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");if(ie.showCollisionBoxes=V.showCollisionBoxes,ie.status==="parsing"){let we=this.tileState.consumeParsing(ee);return yield this._parseWorkerTile(ie,V,we)}if(ie.status==="done"&&ie.vectorTile)return yield this._parseWorkerTile(ie,V)}))}_parseWorkerTile(V,ee,ie){return D._(this,void 0,void 0,(function*(){let we=yield V.parse(V.vectorTile,this.layerIndex,this.availableImages,this.actor,ee.subdivisionGranularity);if(ie){let{rawData:Se}=ie;we=D.e({rawTileData:Se.slice(0),encoding:"mvt"},we)}return we}))}abortTile(V){return D._(this,void 0,void 0,(function*(){this.tileState.abort(V.uid)}))}removeTile(V){return D._(this,void 0,void 0,(function*(){this.tileState.removeLoaded(V.uid)}))}loadData(V){return D._(this,void 0,void 0,(function*(){var ee;(ee=this._pendingRequest)===null||ee===void 0||ee.abort();let ie=this._startRequestTiming(V);this._pendingRequest=new AbortController;try{yield this.loadAndProcessGeoJSON(V,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let we={};return V.request&&(we.data=V.data),this._finishRequestTiming(ie,V,we),we}catch(we){if(delete this._pendingRequest,!D.$(we))throw we;return{abandoned:!0}}}))}_startRequestTiming(V){var ee;if(!((ee=V.request)===null||ee===void 0)&&ee.collectResourceTiming)return new rt(V.request.url)}_finishRequestTiming(V,ee,ie){let we=V==null?void 0:V.finish();we&&(ie.resourceTiming={[ee.source]:JSON.parse(JSON.stringify(we))})}reloadTile(V){return this.tileState.getLoaded(V.uid)?this._reloadLoadedTile(V):this.loadTile(V)}loadAndProcessGeoJSON(V,ee){return D._(this,void 0,void 0,(function*(){var ie;if(V.request&&(V.data=(yield D.k(V.request,ee)).data),V.data)return V.data=this._filterGeoJSON(V.data,V.filter),void(this._geoJSONIndex=this._createGeoJSONIndex(V.data,V));if(V.dataDiff)return(ie=this._geoJSONIndex)!==null&&ie!==void 0||(this._geoJSONIndex=this._createGeoJSONIndex({type:"FeatureCollection",features:[]},V)),void this._geoJSONIndex.updateData(V.dataDiff,this._getFilterPredicate(V.filter));if(V.updateCluster&&this._geoJSONIndex.updateClusterOptions(V.geojsonVtOptions.cluster,Qo(V)),this._geoJSONIndex==null)throw new Error(`Input data given to '${V.source}' is not a valid GeoJSON object.`)}))}_filterGeoJSON(V,ee){if(V.type!=="FeatureCollection")return V;let ie=this._getFilterPredicate(ee);return ie?{type:"FeatureCollection",features:V.features.filter((we=>ie(we)))}:V}_getFilterPredicate(V){if(typeof V!="boolean"&&!(V!=null&&V.length))return;let ee=D.c$(V,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ee.result==="error")throw new Error(ee.value.map((ie=>`${ie.key}: ${ie.message}`)).join(", "));return ie=>ee.value.evaluate({zoom:0},ie)}removeSource(V){return D._(this,void 0,void 0,(function*(){var ee;(ee=this._pendingRequest)===null||ee===void 0||ee.abort()}))}getClusterExpansionZoom(V){return this._geoJSONIndex.getClusterExpansionZoom(V.clusterId)}getClusterChildren(V){return this._geoJSONIndex.getClusterChildren(V.clusterId)}getClusterLeaves(V){return this._geoJSONIndex.getClusterLeaves(V.clusterId,V.limit,V.offset)}}function Tn(nt,V){let ee=D.e(V.geojsonVtOptions||{},{updateable:!0,clusterOptions:Qo(V)});return new D.d0(nt,ee)}function Qo({geojsonVtOptions:nt,clusterProperties:V}){if(!V||!nt.clusterOptions)return nt.clusterOptions;let ee={},ie={},we={accumulated:null,zoom:0},Se={properties:null},tt=Object.keys(V);for(let Re of tt){let[et,Ke]=V[Re],st=D.c$(Ke),Ge=D.c$(typeof et=="string"?[et,["accumulated"],["get",Re]]:et);ee[Re]=st.value,ie[Re]=Ge.value}return nt.clusterOptions.map=Re=>{Se.properties=Re;let et={};for(let Ke of tt)et[Ke]=ee[Ke].evaluate(we,Se);return et},nt.clusterOptions.reduce=(Re,et)=>{Se.properties=et;for(let Ke of tt)we.accumulated=Re[Ke],Re[Ke]=ie[Ke].evaluate(we,Se)},nt.clusterOptions}class Co{constructor(V){this.self=V,this.actor=new D.N(V),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(ee,ie)=>{if(this.externalWorkerSourceTypes[ee])throw new Error(`Worker source with name "${ee}" already registered.`);this.externalWorkerSourceTypes[ee]=ie},this.self.addProtocol=D.cH,this.self.removeProtocol=D.cI,this.self.registerRTLTextPlugin=ee=>{D.d1.setMethods(ee)},this.self.makeRequest=D.m,this.actor.registerMessageHandler("LDT",((ee,ie)=>this._getDEMWorkerSource(ee,ie.source).loadTile(ie))),this.actor.registerMessageHandler("RDT",((ee,ie)=>D._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(ee,ie.source).removeTile(ie)})))),this.actor.registerMessageHandler("GCEZ",((ee,ie)=>D._(this,void 0,void 0,(function*(){return this._getWorkerSource(ee,ie.type,ie.source).getClusterExpansionZoom(ie)})))),this.actor.registerMessageHandler("GCC",((ee,ie)=>D._(this,void 0,void 0,(function*(){return this._getWorkerSource(ee,ie.type,ie.source).getClusterChildren(ie)})))),this.actor.registerMessageHandler("GCL",((ee,ie)=>D._(this,void 0,void 0,(function*(){return this._getWorkerSource(ee,ie.type,ie.source).getClusterLeaves(ie)})))),this.actor.registerMessageHandler("LD",((ee,ie)=>this._getWorkerSource(ee,ie.type,ie.source).loadData(ie))),this.actor.registerMessageHandler("LT",((ee,ie)=>this._getWorkerSource(ee,ie.type,ie.source).loadTile(ie))),this.actor.registerMessageHandler("RT",((ee,ie)=>this._getWorkerSource(ee,ie.type,ie.source).reloadTile(ie))),this.actor.registerMessageHandler("AT",((ee,ie)=>this._getWorkerSource(ee,ie.type,ie.source).abortTile(ie))),this.actor.registerMessageHandler("RMT",((ee,ie)=>this._getWorkerSource(ee,ie.type,ie.source).removeTile(ie))),this.actor.registerMessageHandler("RS",((ee,ie)=>D._(this,void 0,void 0,(function*(){var we,Se;if(!(!((Se=(we=this.workerSources[ee])===null||we===void 0?void 0:we[ie.type])===null||Se===void 0)&&Se[ie.source]))return;let tt=this.workerSources[ee][ie.type][ie.source];delete this.workerSources[ee][ie.type][ie.source],tt.removeSource!==void 0&&tt.removeSource(ie)})))),this.actor.registerMessageHandler("RM",(ee=>D._(this,void 0,void 0,(function*(){delete this.layerIndexes[ee],delete this.availableImages[ee],delete this.workerSources[ee],delete this.demWorkerSources[ee],this.globalStates.delete(ee)})))),this.actor.registerMessageHandler("SR",((ee,ie)=>D._(this,void 0,void 0,(function*(){this.referrer=ie})))),this.actor.registerMessageHandler("SRPS",((ee,ie)=>this._syncRTLPluginState(ee,ie))),this.actor.registerMessageHandler("IS",((ee,ie)=>D._(this,void 0,void 0,(function*(){this.self.importScripts(ie)})))),this.actor.registerMessageHandler("SI",((ee,ie)=>this._setImages(ee,ie))),this.actor.registerMessageHandler("UL",((ee,ie)=>D._(this,void 0,void 0,(function*(){this._getLayerIndex(ee).update(ie.layers,ie.removedIds,this._getGlobalState(ee))})))),this.actor.registerMessageHandler("UGS",((ee,ie)=>D._(this,void 0,void 0,(function*(){let we=this._getGlobalState(ee);for(let Se in ie)we[Se]=ie[Se]})))),this.actor.registerMessageHandler("SL",((ee,ie)=>D._(this,void 0,void 0,(function*(){this._getLayerIndex(ee).replace(ie,this._getGlobalState(ee))}))))}_getGlobalState(V){let ee=this.globalStates.get(V);return ee||(ee={},this.globalStates.set(V,ee)),ee}_setImages(V,ee){return D._(this,void 0,void 0,(function*(){this.availableImages[V]=ee;for(let ie in this.workerSources[V]){let we=this.workerSources[V][ie];for(let Se in we)we[Se].availableImages=ee}}))}_syncRTLPluginState(V,ee){return D._(this,void 0,void 0,(function*(){return yield D.d1.syncState(ee,this.self.importScripts)}))}_getAvailableImages(V){let ee=this.availableImages[V];return ee||(ee=[]),ee}_getLayerIndex(V){let ee=this.layerIndexes[V];return ee||(ee=this.layerIndexes[V]=new c),ee}_getWorkerSource(V,ee,ie){var we,Se;if((we=this.workerSources)[V]||(we[V]={}),(Se=this.workerSources[V])[ee]||(Se[ee]={}),!this.workerSources[V][ee][ie]){let tt={sendAsync:(Re,et)=>(Re.targetMapId=V,this.actor.sendAsync(Re,et))};switch(ee){case"vector":this.workerSources[V][ee][ie]=new de(tt,this._getLayerIndex(V),this._getAvailableImages(V));break;case"geojson":this.workerSources[V][ee][ie]=new xi(tt,this._getLayerIndex(V),this._getAvailableImages(V));break;default:this.workerSources[V][ee][ie]=new this.externalWorkerSourceTypes[ee](tt,this._getLayerIndex(V),this._getAvailableImages(V))}}return this.workerSources[V][ee][ie]}_getDEMWorkerSource(V,ee){var ie,we;return(ie=this.demWorkerSources)[V]||(ie[V]={}),(we=this.demWorkerSources[V])[ee]||(we[ee]=new dt),this.demWorkerSources[V][ee]}}return D.i(self)&&(self.worker=new Co(self)),Co})),J("index",["exports","./shared"],(function(D,c){"use strict";var se="5.24.0";function Me(){var d=new c.A(4);return c.A!=Float32Array&&(d[1]=0,d[2]=0),d[0]=1,d[3]=1,d}let Te,Ye,rt,Je={frame(d,t,n,A){let l=A||window,g=l.requestAnimationFrame((y=>{B(),t(y)})),{unsubscribe:B}=c.s(d.signal,"abort",(()=>{B(),l.cancelAnimationFrame(g),n(new c.a(d.signal.reason))}),!1)},frameAsync(d,t){return new Promise(((n,A)=>{this.frame(d,n,A,t)}))},getImageData(d,t=0){return this.getImageCanvasContext(d).getImageData(-t,-t,d.width+2*t,d.height+2*t)},getImageCanvasContext(d){let t=window.document.createElement("canvas"),n=t.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("failed to create canvas 2d context");return t.width=d.width,t.height=d.height,n.drawImage(d,0,0,d.width,d.height),n},resolveURL:d=>(Te||(Te=document.createElement("a")),Te.href=d,Te.href),hardwareConcurrency:typeof navigator!="undefined"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return rt!==void 0?rt:!!matchMedia&&(Ye!=null||(Ye=matchMedia("(prefers-reduced-motion: reduce)")),Ye.matches)},set prefersReducedMotion(d){rt=d}},Qt=new class{constructor(){this._frozenAt=null}getCurrentTime(){return this._frozenAt!==null?this._frozenAt:performance.now()}setNow(d){this._frozenAt=d}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}};function Pe(){return Qt.getCurrentTime()}var Lt,qe;class de{static create(t,n,A){let l=window.document.createElement(t);return n!==void 0&&(l.className=n),A&&A.appendChild(l),l}static createNS(t,n){return window.document.createElementNS(t,n)}static disableDrag(){de.docStyle&&de.selectProp&&(de.userSelect=de.docStyle[de.selectProp],de.docStyle[de.selectProp]="none")}static enableDrag(){de.docStyle&&de.selectProp&&(de.docStyle[de.selectProp]=de.userSelect)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",de.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",de.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",de.suppressClickInternal,!0)}),0)}static getScale(t){let n=t.getBoundingClientRect();return{x:n.width/t.offsetWidth||1,y:n.height/t.offsetHeight||1,boundingClientRect:n}}static getPoint(t,n,A){let l=n.boundingClientRect;return new c.P((A.clientX-l.left)/n.x-t.clientLeft,(A.clientY-l.top)/n.y-t.clientTop)}static mousePos(t,n){let A=de.getScale(t);return de.getPoint(t,A,n)}static touchPos(t,n){let A=[],l=de.getScale(t);for(let g of n)A.push(de.getPoint(t,l,g));return A}static sanitize(t){let n=new DOMParser().parseFromString(t,"text/html").body||document.createElement("body"),A=n.querySelectorAll("script");for(let l of A)l.remove();return de.clean(n),n.innerHTML}static isPossiblyDangerous(t,n){let A=n.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(t)||!A.includes("javascript:")&&!A.includes("data:"))||!!t.startsWith("on")||void 0}static clean(t){let n=t.children;for(let A of n)de.removeAttributes(A),de.clean(A)}static removeAttributes(t){for(let{name:n,value:A}of t.attributes)de.isPossiblyDangerous(n,A)&&t.removeAttribute(n)}}de.docStyle=typeof window!="undefined"&&((Lt=window.document)===null||Lt===void 0?void 0:Lt.documentElement.style),de.selectProp=!de.docStyle||"userSelect"in de.docStyle?"userSelect":"webkitUserSelect",(function(d){let t,n,A,l;d.resetRequestQueue=()=>{t=[],n=0,A=0,l={}},d.addThrottleControl=C=>{let E=A++;return l[E]=C,E},d.removeThrottleControl=C=>{delete l[C],B()},d.getImage=(C,E,I=!0)=>new Promise(((b,F)=>{C.headers||(C.headers={}),C.headers.accept="image/webp,*/*",c.e(C,{type:"image"}),t.push({abortController:E,requestParameters:C,supportImageRefresh:I,state:"queued",onError:T=>{F(T)},onSuccess:T=>{b(T)}}),B()}));let g=C=>c._(this,void 0,void 0,(function*(){C.state="running";let{requestParameters:E,supportImageRefresh:I,onError:b,onSuccess:F,abortController:T}=C,P=I===!1&&!c.i(self)&&!c.g(E.url)&&(!E.headers||Object.keys(E.headers).reduce(((N,K)=>N&&K==="accept"),!0));n++;let R=P?y(E,T):c.m(E,T);try{let N=yield R;delete C.abortController,C.state="completed",N.data instanceof HTMLImageElement||c.b(N.data)?F(N):N.data&&F({data:yield(Y=N.data,typeof createImageBitmap=="function"?c.h(Y):c.j(Y)),cacheControl:N.cacheControl,expires:N.expires})}catch(N){delete C.abortController,b(c.d(N))}finally{n--,B()}var Y})),B=()=>{let C=(()=>{for(let E of Object.keys(l))if(l[E]())return!0;return!1})()?c.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:c.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let E=n;E<C&&t.length>0;E++){let I=t.shift();I.abortController.signal.aborted?E--:g(I)}},y=(C,E)=>new Promise(((I,b)=>{let F=new Image,T=C.url,P=C.credentials;P&&P==="include"?F.crossOrigin="use-credentials":(P&&P==="same-origin"||!c.f(T))&&(F.crossOrigin="anonymous"),E.signal.addEventListener("abort",(()=>{F.src="",b(new c.a(E.signal.reason))})),F.fetchPriority="high",F.onload=()=>{F.onerror=F.onload=null,I({data:F})},F.onerror=()=>{F.onerror=F.onload=null,E.signal.aborted||b(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},F.src=T}))})(qe||(qe={})),qe.resetRequestQueue();class dt{constructor(t){this._transformRequestFn=t!=null?t:null}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function xi(d){let t=[];if(typeof d=="string")t.push({id:"default",url:d});else if(d&&d.length>0){let n=[];for(let{id:A,url:l}of d){let g=`${A}${l}`;n.includes(g)||(n.push(g),t.push({id:A,url:l}))}}return t}function Tn(d,t,n){try{let A=new URL(d);return A.pathname+=`${t}${n}`,A.toString()}catch(A){throw new Error(`Invalid sprite URL "${d}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function Qo(d){let{userImage:t}=d;return!(!(t!=null&&t.render)||!t.render()||(d.data.replace(new Uint8Array(t.data.buffer)),0))}class Co extends c.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new c.R({width:1,height:1}),this.dirty=!0}destroy(){this.atlasTexture&&(this.atlasTexture.destroy(),this.atlasTexture=null);for(let t of Object.keys(this.images))this.removeImage(t);this.patterns={},this.atlasImage=new c.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(let{ids:n,promiseResolve:A}of this.requestors)A(this._getImagesForIds(n));this.requestors=[]}}getImage(t){let n=this.images[t];if(n&&!n.data&&n.spriteData){let A=n.spriteData;n.data=new c.R({width:A.width,height:A.height},A.context.getImageData(A.x,A.y,A.width,A.height).data),n.spriteData=null}return n}addImage(t,n){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,n)&&(this.images[t]=n)}_validate(t,n){let A=!0,l=n.data||n.spriteData;return this._validateStretch(n.stretchX,l==null?void 0:l.width)||(this.fire(new c.l(new Error(`Image "${t}" has invalid "stretchX" value`))),A=!1),this._validateStretch(n.stretchY,l==null?void 0:l.height)||(this.fire(new c.l(new Error(`Image "${t}" has invalid "stretchY" value`))),A=!1),this._validateContent(n.content,n)||(this.fire(new c.l(new Error(`Image "${t}" has invalid "content" value`))),A=!1),A}_validateStretch(t,n){if(!t)return!0;let A=0;for(let l of t){if(l[0]<A||l[1]<l[0]||n<l[1])return!1;A=l[1]}return!0}_validateContent(t,n){if(!t)return!0;if(t.length!==4)return!1;let A=n.spriteData,l=(A==null?void 0:A.width)||n.data.width,g=(A==null?void 0:A.height)||n.data.height;return!(t[0]<0||l<t[0]||t[1]<0||g<t[1]||t[2]<0||l<t[2]||t[3]<0||g<t[3]||t[2]<t[0]||!(t[3]>=t[1]))}updateImage(t,n,A=!0){let l=this.getImage(t);if(A&&(l.data.width!==n.data.width||l.data.height!==n.data.height))throw new Error(`size mismatch between old image (${l.data.width}x${l.data.height}) and new image (${n.data.width}x${n.data.height}).`);n.version=l.version+1,this.images[t]=n,this.updatedImages[t]=!0}removeImage(t){var n;let A=this.images[t];delete this.images[t],delete this.patterns[t],!((n=A.userImage)===null||n===void 0)&&n.onRemove&&A.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t){return new Promise(((n,A)=>{let l=!0;if(!this.isLoaded())for(let g of t)this.images[g]||(l=!1);this.isLoaded()||l?n(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:n})}))}_getImagesForIds(t){var n;let A={};for(let l of t){let g=this.getImage(l);g||(this.fire(new c.n("styleimagemissing",{id:l})),g=this.getImage(l)),g?A[l]={data:g.data.clone(),pixelRatio:g.pixelRatio,sdf:g.sdf,version:g.version,stretchX:g.stretchX,stretchY:g.stretchY,content:g.content,textFitWidth:g.textFitWidth,textFitHeight:g.textFitHeight,hasRenderCallback:!!(!((n=g.userImage)===null||n===void 0)&&n.render)}:c.w(`Image "${l}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return A}getPixelSize(){let{width:t,height:n}=this.atlasImage;return{width:t,height:n}}getPattern(t){let n=this.patterns[t],A=this.getImage(t);if(!A)return null;if(n&&n.position.version===A.version)return n.position;if(n)n.position.version=A.version;else{let l={w:A.data.width+2,h:A.data.height+2,x:0,y:0},g=new c.I(l,A);this.patterns[t]={bin:l,position:g}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){let n=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new c.T(t,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){let t=[];for(let g in this.patterns)t.push(this.patterns[g].bin);let{w:n,h:A}=c.p(t),l=this.atlasImage;l.resize({width:n||1,height:A||1});for(let g in this.patterns){let{bin:B}=this.patterns[g],y=B.x+1,C=B.y+1,E=this.getImage(g).data,I=E.width,b=E.height;c.R.copy(E,l,{x:0,y:0},{x:y,y:C},{width:I,height:b}),c.R.copy(E,l,{x:0,y:b-1},{x:y,y:C-1},{width:I,height:1}),c.R.copy(E,l,{x:0,y:0},{x:y,y:C+b},{width:I,height:1}),c.R.copy(E,l,{x:I-1,y:0},{x:y-1,y:C},{width:1,height:b}),c.R.copy(E,l,{x:0,y:0},{x:y+I,y:C},{width:1,height:b})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(let n of t){if(this.callbackDispatchedThisFrame[n])continue;this.callbackDispatchedThisFrame[n]=!0;let A=this.getImage(n);A||c.w(`Image with ID: "${n}" was not found`),Qo(A)&&this.updateImage(n,A)}}cloneImages(){let t={};for(let n in this.images){let A=this.images[n];t[n]=Object.assign(Object.assign({},A),{data:A.data?A.data.clone():null})}return t}}let nt=1e20,V=new Float64Array(256);for(let d=0;d<256;d++){let t=.5-Math.pow(d/255,.45454545454545453);V[d]=t*Math.abs(t)}function ee(d,t,n,A,l,g,B,y,C){for(let E=t;E<t+A;E++)ie(d,n*g+E,g,l,B,y,C);for(let E=n;E<n+l;E++)ie(d,E*g+t,1,A,B,y,C)}function ie(d,t,n,A,l,g,B){g[0]=0,B[0]=-nt,B[1]=nt,l[0]=d[t];for(let y=1,C=0,E=0;y<A;y++){l[y]=d[t+y*n];let I=y*y;do{let b=g[C];E=(l[y]-l[b]+I-b*b)/(y-b)/2}while(E<=B[C]&&--C>-1);C++,g[C]=y,B[C]=E,B[C+1]=nt}for(let y=0,C=0;y<A;y++){for(;B[C+1]<y;)C++;let E=g[C],I=y-E;d[t+y*n]=l[E]+I*I}}V[255]=-nt;let we=c.v.layout_symbol["text-font"].default.join(",");class Se{constructor(t,n,A){this.requestManager=t,this.localIdeographFontFamily=n,this.entries={},this.lang=A}setURL(t){this.url=t}getGlyphs(t){return c._(this,void 0,void 0,(function*(){let n=[];for(let g in t)for(let B of t[g])n.push(this._getAndCacheGlyphsPromise(g,B));let A=yield Promise.all(n),l={};for(let{stack:g,id:B,glyph:y}of A)l[g]||(l[g]={}),l[g][B]=y&&{id:y.id,bitmap:y.bitmap.clone(),metrics:y.metrics};return l}))}_getAndCacheGlyphsPromise(t,n){return c._(this,void 0,void 0,(function*(){var A,l;(A=(l=this.entries)[t])!==null&&A!==void 0||(l[t]={glyphs:{},requests:{},ranges:{}});let g=this.entries[t],B=g.glyphs[n];return B!==void 0?{stack:t,id:n,glyph:B}:!this.url||this._charUsesLocalIdeographFontFamily(n)?(B=g.glyphs[n]=this._drawGlyph(g,t,n),{stack:t,id:n,glyph:B}):yield this._downloadAndCacheRangePromise(t,n)}))}_downloadAndCacheRangePromise(t,n){return c._(this,void 0,void 0,(function*(){var A;let l=this.entries[t],g=Math.floor(n/256);if(l.ranges[g])return{stack:t,id:n,glyph:null};(A=l.requests)[g]||(A[g]=Se.loadGlyphRange(t,g,this.url,this.requestManager));try{let B=yield l.requests[g];for(let y in B)l.glyphs[+y]=B[+y];return l.ranges[g]=!0,{stack:t,id:n,glyph:B[n]||null}}catch(B){let y=l.glyphs[n]=this._drawGlyph(l,t,n);return this._warnOnMissingGlyphRange(y,g,n,c.d(B)),{stack:t,id:n,glyph:y}}}))}_warnOnMissingGlyphRange(t,n,A,l){let g=256*n,B=g+255,y=A.toString(16).padStart(4,"0").toUpperCase();c.w(`Unable to load glyph range ${n}, ${g}-${B}. Rendering codepoint U+${y} locally instead. ${l}`)}_charUsesLocalIdeographFontFamily(t){return!!this.localIdeographFontFamily&&c.r(t)}_drawGlyph(t,n,A){let l=n===we&&this.localIdeographFontFamily!==""&&this._charUsesLocalIdeographFontFamily(A),g=l?"ideographTinySDF":"tinySDF";t[g]||(t[g]=this._createTinySDF(l?this.localIdeographFontFamily:n));let B=t[g].draw(String.fromCodePoint(A)),y=/^\p{gc=Cf}+$/u.test(String.fromCodePoint(A));return{id:A,bitmap:new c.t({width:B.width||60,height:B.height||60},B.data),metrics:{width:y?0:B.glyphWidth/2||24,height:B.glyphHeight/2||24,left:B.glyphLeft/2+.5||0,top:B.glyphTop/2-27.5||-8,advance:y?0:B.glyphAdvance/2||24,isDoubleResolution:!0}}}_createTinySDF(t){let n=t?t.split(","):[];n.push("sans-serif");let A=n.map((l=>/[-\w]+/.test(l)?l:`'${CSS.escape(l)}'`)).join(",");return new Se.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:A,fontWeight:this._fontWeight(n[0]),fontStyle:this._fontStyle(n[0]),lang:this.lang})}_fontStyle(t){return/italic/i.test(t)?"italic":/oblique/i.test(t)?"oblique":"normal"}_fontWeight(t){let n={thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950},A;for(let[l,g]of Object.entries(n))new RegExp(`\\b${l}\\b`,"i").test(t)&&(A=`${g}`);return A}destroy(){for(let t in this.entries){let n=this.entries[t];n.tinySDF=null,n.ideographTinySDF=null,n.glyphs={},n.requests={},n.ranges={}}this.entries={}}}Se.loadGlyphRange=function(d,t,n,A){return c._(this,void 0,void 0,(function*(){let l=256*t,g=l+255,B=yield A.transformRequest(n.replace("{fontstack}",d).replace("{range}",`${l}-${g}`),"Glyphs"),y=yield c.o(B,new AbortController);if(!(y!=null&&y.data))throw new Error(`Could not load glyph range. range: ${t}, ${l}-${g}`);let C={};for(let E of c.q(y.data))C[E.id]=E;return C}))},Se.TinySDF=class{constructor({fontSize:d=24,buffer:t=3,radius:n=8,cutoff:A=.25,fontFamily:l="sans-serif",fontWeight:g="normal",fontStyle:B="normal",lang:y=null}={}){this.buffer=t,this.radius=n,this.cutoff=A,this.lang=y;let C=this.size=d+4*t,E=this._createCanvas(C),I=this.ctx=E.getContext("2d",{willReadFrequently:!0});I.font=`${B} ${g} ${d}px ${l}`,I.textBaseline="alphabetic",I.textAlign="left",I.fillStyle="black",this.gridOuter=new Float64Array(C*C),this.gridInner=new Float64Array(C*C),this.f=new Float64Array(C),this.z=new Float64Array(C+1),this.v=new Uint16Array(C)}_createCanvas(d){if(typeof OffscreenCanvas!="undefined")return new OffscreenCanvas(d,d);let t=document.createElement("canvas");return t.width=t.height=d,t}draw(d){let{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:A,actualBoundingBoxLeft:l,actualBoundingBoxRight:g}=this.ctx.measureText(d),B=Math.ceil(n),y=Math.floor(l),C=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(g)-y)),E=Math.max(0,Math.min(this.size-this.buffer,B+Math.ceil(A))),I=C+2*this.buffer,b=E+2*this.buffer,F=Math.max(I*b,0),T=new Uint8ClampedArray(F),P={data:T,width:I,height:b,glyphWidth:C,glyphHeight:E,glyphTop:B,glyphLeft:y,glyphAdvance:t};if(C===0||E===0)return P;let{ctx:R,buffer:Y,gridInner:N,gridOuter:K}=this;this.lang&&(R.lang=this.lang),R.clearRect(Y,Y,C,E),R.fillText(d,Y-y,Y+B);let H=R.getImageData(Y,Y,C,E);K.fill(nt,0,F),N.fill(0,0,F);let j=3;for(let X=0;X<E;X++){let te=(X+Y)*I+Y;for(let Ae=0;Ae<C;Ae++,j+=4,te++){let ae=H.data[j];if(ae===0)continue;let Be=V[ae];K[te]=Math.max(0,Be),N[te]=Math.max(0,-Be)}}ee(K,0,0,I,b,I,this.f,this.v,this.z),ee(N,Y,Y,C,E,I,this.f,this.v,this.z);let z=255/this.radius,Z=255*(1-this.cutoff);for(let X=0;X<F;X++){let te=Math.sqrt(K[X])-Math.sqrt(N[X]);T[X]=Math.round(Z-z*te)}return P}};class tt{constructor(){this.specification=c.x.light.position}possiblyEvaluate(t,n){return c.G(t.expression.evaluate(n))}interpolate(t,n,A){return{x:c.H.number(t.x,n.x,A),y:c.H.number(t.y,n.y,A),z:c.H.number(t.z,n.z,A)}}}let Re;class et extends c.E{constructor(t){super(),Re||(Re=new c.u({anchor:new c.D(c.x.light.anchor),position:new tt,color:new c.D(c.x.light.color),intensity:new c.D(c.x.light.intensity)})),this._transitionable=new c.y(Re,void 0),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,n={}){if(!this._validate(c.z,t,n))for(let A in t){let l=t[A];A.endsWith(c.B)?this._transitionable.setTransition(A.slice(0,-c.B.length),l):this._transitionable.setValue(A,l)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,n,A){return(A==null?void 0:A.validate)!==!1&&c.C(this,t.call(c.F,{value:n,style:{glyphs:!0,sprite:!0},styleSpec:c.x}))}}let Ke=new c.u({"sky-color":new c.D(c.x.sky["sky-color"]),"horizon-color":new c.D(c.x.sky["horizon-color"]),"fog-color":new c.D(c.x.sky["fog-color"]),"fog-ground-blend":new c.D(c.x.sky["fog-ground-blend"]),"horizon-fog-blend":new c.D(c.x.sky["horizon-fog-blend"]),"sky-horizon-blend":new c.D(c.x.sky["sky-horizon-blend"]),"atmosphere-blend":new c.D(c.x.sky["atmosphere-blend"])});class st extends c.E{constructor(t){super(),this._transitionable=new c.y(Ke,void 0),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new c.J(0))}setSky(t,n={}){if(!this._validate(c.K,t,n)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(let A in t){let l=t[A];A.endsWith(c.B)?this._transitionable.setTransition(A.slice(0,-c.B.length),l):this._transitionable.setValue(A,l)}}}getSky(){return this._transitionable.serialize()}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,n,A={}){return(A==null?void 0:A.validate)!==!1&&c.C(this,t.call(c.F,c.e({value:n,style:{glyphs:!0,sprite:!0},styleSpec:c.x})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class Ge{constructor(t,n){this.width=t,this.height=n,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,n){var A;let l=t.join(",")+String(n);return(A=this.dashEntry)[l]||(A[l]=this.addDash(t,n)),this.dashEntry[l]}getDashRanges(t,n,A){let l=[],g=t.length%2==1?-t[t.length-1]*A:0,B=t[0]*A,y=!0;l.push({left:g,right:B,isDash:y,zeroLength:t[0]===0});let C=t[0];for(let E=1;E<t.length;E++){y=!y;let I=t[E];g=C*A,C+=I,B=C*A,l.push({left:g,right:B,isDash:y,zeroLength:I===0})}return l}addRoundDash(t,n,A){let l=n/2;for(let g=-A;g<=A;g++){let B=this.width*(this.nextRow+A+g),y=0,C=t[y];for(let E=0;E<this.width;E++){E/C.right>1&&(C=t[++y]);let I=Math.abs(E-C.left),b=Math.abs(E-C.right),F=Math.min(I,b),T,P=g/A*(l+1);if(C.isDash){let R=l-Math.abs(P);T=Math.sqrt(F*F+R*R)}else T=l-Math.sqrt(F*F+P*P);this.data[B+E]=Math.max(0,Math.min(255,T+128))}}}addRegularDash(t){for(let y=t.length-1;y>=0;--y){let C=t[y],E=t[y+1];C.zeroLength?t.splice(y,1):E&&E.isDash===C.isDash&&(E.left=C.left,t.splice(y,1))}let n=t[0],A=t[t.length-1];n.isDash===A.isDash&&(n.left=A.left-this.width,A.right=n.right+this.width);let l=this.width*this.nextRow,g=0,B=t[g];for(let y=0;y<this.width;y++){y/B.right>1&&(B=t[++g]);let C=Math.abs(y-B.left),E=Math.abs(y-B.right),I=Math.min(C,E);this.data[l+y]=Math.max(0,Math.min(255,(B.isDash?I:-I)+128))}}addDash(t,n){let A=n?7:0,l=2*A+1;if(this.nextRow+l>this.height)return c.w("LineAtlas out of space"),null;let g=0;for(let y of t)g+=y;if(g!==0){let y=this.width/g,C=this.getDashRanges(t,this.width,y);n?this.addRoundDash(C,y,A):this.addRegularDash(C)}let B={y:this.nextRow+A,height:2*A,width:g};return this.nextRow+=l,this.dirty=!0,B}bind(t){let n=t.gl;this.texture?(n.bindTexture(n.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,n.texSubImage2D(n.TEXTURE_2D,0,0,0,this.width,this.height,n.ALPHA,n.UNSIGNED_BYTE,this.data))):(this.texture=n.createTexture(),n.bindTexture(n.TEXTURE_2D,this.texture),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,this.width,this.height,0,n.ALPHA,n.UNSIGNED_BYTE,this.data))}}let Ft="maplibre_preloaded_worker_pool";class Dt{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<Dt.workerCount;)this.workers.push(new Worker(c.c.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){if(delete this.active[t],this.numActive()===0){for(let n of this.workers)n.terminate();this.workers=null}}isPreloaded(){return!!this.active[Ft]}numActive(){return Object.keys(this.active).length}}let tr=Math.floor(Je.hardwareConcurrency/2),Ki,Mr;function $r(){return Ki||(Ki=new Dt),Ki}Dt.workerCount=c.L(globalThis)?Math.max(Math.min(tr,3),1):1;class wo{constructor(t,n){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=n;let A=this.workerPool.acquire(n);for(let l=0;l<A.length;l++){let g=new c.N(A[l],n);g.name=`Worker ${l}`,this.actors.push(g)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,n){let A=[];for(let l of this.actors)A.push(l.sendAsync({type:t,data:n}));return Promise.all(A)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){for(let n of this.actors)n.remove();this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,n){for(let A of this.actors)A.registerMessageHandler(t,n)}unregisterMessageHandler(t){for(let n of this.actors)n.unregisterMessageHandler(t)}}function fi(){return Mr||(Mr=new wo($r(),c.M),Mr.registerMessageHandler("GR",((d,t,n)=>c.m(t,n)))),Mr}function Un(d,t){let n=c.O();return c.Q(n,n,[1,1,0]),c.S(n,n,[.5*d.width,.5*d.height,1]),d.calculatePosMatrix?c.U(n,n,d.calculatePosMatrix(t.toUnwrapped())):n}function ji(d,t,n,A,l,g,B){var y;let C=(function(F,T,P){if(F)for(let R of F){let Y=T[R];if((Y==null?void 0:Y.source)===P&&Y.type==="fill-extrusion")return!0}else for(let R in T){let Y=T[R];if(Y.source===P&&Y.type==="fill-extrusion")return!0}return!1})((y=l==null?void 0:l.layers)!==null&&y!==void 0?y:null,t,d.id),E=g.maxPitchScaleFactor(),I=d.tilesIn(A,E,C);I.sort(Eo);let b=[];for(let F of I)b.push({wrappedTileID:F.tileID.wrapped().key,queryResults:F.tile.queryRenderedFeatures(t,n,d.getState(),F.queryGeometry,F.cameraQueryGeometry,F.scale,l,g,E,Un(g,F.tileID),B?(T,P)=>B(F.tileID,T,P):void 0)});return(function(F,T){for(let P in F)for(let R of F[P])Tr(R,T);return F})((function(F){let T={},P={};for(let{queryResults:R,wrappedTileID:Y}of F){P[Y]||(P[Y]={});let N=P[Y];for(let K in R){let H=R[K];N[K]||(N[K]={});let j=N[K];T[K]||(T[K]=[]);for(let z of H)j[z.featureIndex]||(j[z.featureIndex]=!0,T[K].push(z))}}return T})(b),d)}function Eo(d,t){let n=d.tileID,A=t.tileID;return n.overscaledZ-A.overscaledZ||n.canonical.y-A.canonical.y||n.wrap-A.wrap||n.canonical.x-A.canonical.x}function Tr(d,t){let n=d.feature,A=t.getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=A}function en(d,t,n,A){return c._(this,void 0,void 0,(function*(){let l=d;if(d.url?l=(yield c.k(yield t.transformRequest(d.url,"Source"),n)).data:yield Je.frameAsync(n,A),!l)return null;let g=c.V(c.e(l,d),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in l&&l.vector_layers&&(g.vectorLayerIds=l.vector_layers.map((B=>B.id))),g}))}class Oe{constructor(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof c.W?new c.W(t.lng,t.lat):c.W.convert(t),this}setSouthWest(t){return this._sw=t instanceof c.W?new c.W(t.lng,t.lat):c.W.convert(t),this}extend(t){let n=this._sw,A=this._ne,l,g;if(t instanceof c.W)l=t,g=t;else{if(!(t instanceof Oe))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(Oe.convert(t)):this.extend(c.W.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(c.W.convert(t)):this;if(l=t._sw,g=t._ne,!l||!g)return this}return n||A?(n.lng=Math.min(l.lng,n.lng),n.lat=Math.min(l.lat,n.lat),A.lng=Math.max(g.lng,A.lng),A.lat=Math.max(g.lat,A.lat)):(this._sw=new c.W(l.lng,l.lat),this._ne=new c.W(g.lng,g.lat)),this}getCenter(){return new c.W((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new c.W(this.getWest(),this.getNorth())}getSouthEast(){return new c.W(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){let{lng:n,lat:A}=c.W.convert(t),l=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=A&&A<=this._ne.lat&&l}intersects(t){if(!((t=Oe.convert(t)).getNorth()>=this.getSouth()&&t.getSouth()<=this.getNorth()))return!1;let n=Math.abs(this.getEast()-this.getWest()),A=Math.abs(t.getEast()-t.getWest());if(n>=360||A>=360)return!0;let l=c.X(this.getWest(),-180,180),g=c.X(this.getEast(),-180,180),B=c.X(t.getWest(),-180,180),y=c.X(t.getEast(),-180,180),C=l>g,E=B>y;return!(!C||!E)||(C?y>=l||B<=g:E?g>=B||l<=y:B<=g&&y>=l)}static convert(t){return t instanceof Oe?t:t&&new Oe(t)}static fromLngLat(t,n=0){let A=360*n/40075017,l=A/Math.cos(Math.PI/180*t.lat);return new Oe(new c.W(t.lng-l,t.lat-A),new c.W(t.lng+l,t.lat+A))}adjustAntiMeridian(){let t=new c.W(this._sw.lng,this._sw.lat),n=new c.W(this._ne.lng,this._ne.lat);return new Oe(t,t.lng>n.lng?new c.W(n.lng+360,n.lat):n)}}class Vt{constructor(t,n,A){this.bounds=Oe.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=A||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){let n=Math.pow(2,t.z),A=Math.floor(c.Z(this.bounds.getWest())*n),l=Math.floor(c.Y(this.bounds.getNorth())*n),g=Math.ceil(c.Z(this.bounds.getEast())*n),B=Math.ceil(c.Y(this.bounds.getSouth())*n);return t.x>=A&&t.x<g&&t.y>=l&&t.y<B}}class ti extends c.E{constructor(t,n,A,l){if(super(),this.id=t,this.dispatcher=A,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,c.e(this,c.V(n,["url","scheme","tileSize","promoteId","encoding"])),this._options=c.e({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(l)}load(){return c._(this,arguments,void 0,(function*(t=!1){this._loaded=!1,this.fire(new c.n("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let n=yield en(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,n&&(c.e(this,n),n.bounds&&(this.tileBounds=new Vt(n.bounds,this.minzoom,this.maxzoom)),this.fire(new c.n("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.n("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:t})))}catch(n){this._tileJSONRequest=null,this._loaded=!0,c.$(n)||this.fire(new c.l(c.d(n)))}}))}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.abort(),t(),this.load(!0)}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return c.e({},this._options)}loadTile(t){return c._(this,void 0,void 0,(function*(){let n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),A={request:yield this.map._requestManager.transformRequest(n,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:yield this._getOverzoomParameters(t),etag:t.etag};A.request.collectResourceTiming=this._collectResourceTiming;let l="RT";if(t.actor&&t.state!=="expired"){if(t.state==="loading")return new Promise(((g,B)=>{t.reloadPromise={resolve:g,reject:B}}))}else t.actor=this.dispatcher.getActor(),l="LT";t.abortController=new AbortController;try{let g=yield t.actor.sendAsync({type:l,data:A},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,g);let B={};return g!=null&&g.etagUnmodified&&(B.unmodified=!0),B}catch(g){if(delete t.abortController,t.aborted)return;if(g&&g.status!==404)throw g;this._afterTileLoadWorkerResponse(t,null)}}))}_getOverzoomParameters(t){return c._(this,void 0,void 0,(function*(){if(t.tileID.canonical.z<=this.maxzoom||this.map._zoomLevelsToOverscale===void 0)return;let n=t.tileID.scaledTo(this.maxzoom).canonical,A=n.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:n,overzoomRequest:yield this.map._requestManager.transformRequest(A,"Tile")}}))}_afterTileLoadWorkerResponse(t,n){if(n!=null&&n.resourceTiming&&(t.resourceTiming=n.resourceTiming),n&&this.map._refreshExpiredTiles&&t.setExpiryData(n),t.etag=n==null?void 0:n.etag,t.loadVectorData(n,this.map.painter),t.reloadPromise){let A=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(A.resolve).catch(A.reject)}}abortTile(t){return c._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}unloadTile(t){return c._(this,void 0,void 0,(function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class Ui extends c.E{constructor(t,n,A,l){super(),this.id=t,this.dispatcher=A,this.setEventedParent(l),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=c.e({type:"raster"},n),c.e(this,c.V(n,["url","scheme","tileSize"]))}load(){return c._(this,arguments,void 0,(function*(t=!1){this._loaded=!1,this.fire(new c.n("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let n=yield en(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,n&&(c.e(this,n),n.bounds&&(this.tileBounds=new Vt(n.bounds,this.minzoom,this.maxzoom)),this.fire(new c.n("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.n("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:t})))}catch(n){this._tileJSONRequest=null,this._loaded=!0,c.$(n)||this.fire(new c.l(c.d(n)))}}))}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load(!0)}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}serialize(){return c.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return c._(this,void 0,void 0,(function*(){let n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{let A=yield qe.getImage(yield this.map._requestManager.transformRequest(n,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(A!=null&&A.data){this.map._refreshExpiredTiles&&(A.cacheControl||A.expires)&&t.setExpiryData({cacheControl:A.cacheControl,expires:A.expires});let l=this.map.painter.context,g=l.gl,B=A.data;t.texture=this.map.painter.getTileTexture(B.width),t.texture?t.texture.update(B,{useMipmap:!0}):(t.texture=new c.T(l,B,g.RGBA,{useMipmap:!0}),t.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE,g.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(A){if(delete t.abortController,t.aborted)t.state="unloaded";else if(A)throw t.state="errored",A}}))}abortTile(t){return c._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)}))}unloadTile(t){return c._(this,void 0,void 0,(function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)}))}hasTransition(){return!1}}class ii extends Ui{constructor(t,n,A,l){super(t,n,A,l),this.type="raster-dem",this.maxzoom=22,this._options=c.e({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox",this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(t){return c._(this,void 0,void 0,(function*(){let n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),A=yield this.map._requestManager.transformRequest(n,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{let l=yield qe.getImage(A,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(l!=null&&l.data){let g=l.data;this.map._refreshExpiredTiles&&(l.cacheControl||l.expires)&&t.setExpiryData({cacheControl:l.cacheControl,expires:l.expires});let B=c.b(g)&&c.a0()?g:yield this.readImageNow(g),y={type:this.type,uid:t.uid,source:this.id,rawImageData:B,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(t.actor&&t.state!=="expired"&&t.state!=="reloading")return;t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor()),t.dem=yield t.actor.sendAsync({type:"LDT",data:y}),t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}catch(l){if(delete t.abortController,t.aborted)t.state="unloaded";else if(l)throw t.state="errored",l}}))}readImageNow(t){return c._(this,void 0,void 0,(function*(){if(typeof VideoFrame!="undefined"&&c.a1()){let n=t.width+2,A=t.height+2;try{return new c.R({width:n,height:A},yield c.a2(t,-1,-1,n,A))}catch(l){}}return Je.getImageData(t,1)}))}_getNeighboringTiles(t){let n=t.canonical,A=Math.pow(2,n.z),l=(n.x-1+A)%A,g=n.x===0?t.wrap-1:t.wrap,B=(n.x+1+A)%A,y=n.x+1===A?t.wrap+1:t.wrap,C={};return C[new c.a3(t.overscaledZ,g,n.z,l,n.y).key]={backfilled:!1},C[new c.a3(t.overscaledZ,y,n.z,B,n.y).key]={backfilled:!1},n.y>0&&(C[new c.a3(t.overscaledZ,g,n.z,l,n.y-1).key]={backfilled:!1},C[new c.a3(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},C[new c.a3(t.overscaledZ,y,n.z,B,n.y-1).key]={backfilled:!1}),n.y+1<A&&(C[new c.a3(t.overscaledZ,g,n.z,l,n.y+1).key]={backfilled:!1},C[new c.a3(t.overscaledZ,t.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},C[new c.a3(t.overscaledZ,y,n.z,B,n.y+1).key]={backfilled:!1}),C}unloadTile(t){return c._(this,void 0,void 0,(function*(){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&(yield t.actor.sendAsync({type:"RDT",data:{type:this.type,uid:t.uid,source:this.id}}))}))}}function vi(d,t){return t?d.properties[t]:d.id}function tn(d,t){let n={id:d.id};if(t.removeAllProperties&&(delete d.removeProperties,delete d.addOrUpdateProperties,delete t.removeProperties),t.removeProperties)for(let A of t.removeProperties){let l=d.addOrUpdateProperties.findIndex((g=>g.key===A));l>-1&&d.addOrUpdateProperties.splice(l,1)}return(d.removeAllProperties||t.removeAllProperties)&&(n.removeAllProperties=!0),(d.removeProperties||t.removeProperties)&&(n.removeProperties=[...d.removeProperties||[],...t.removeProperties||[]]),(d.addOrUpdateProperties||t.addOrUpdateProperties)&&(n.addOrUpdateProperties=[...d.addOrUpdateProperties||[],...t.addOrUpdateProperties||[]]),(d.newGeometry||t.newGeometry)&&(n.newGeometry=t.newGeometry||d.newGeometry),n}function GA(d){var t,n;if(!d)return{};let A={};return A.removeAll=d.removeAll,A.remove=new Set(d.remove||[]),A.add=new Map((t=d.add)===null||t===void 0?void 0:t.map((l=>[l.id,l]))),A.update=new Map((n=d.update)===null||n===void 0?void 0:n.map((l=>[l.id,l]))),A}function RA(d){return d&&d.length!==0?typeof d[0]=="number"?[d]:d.flatMap((t=>RA(t))):[]}function Ur(d){return d.type==="GeometryCollection"?d.geometries.flatMap((t=>Ur(t))):RA(d.coordinates)}function Ln(d){let t=new Oe,n;switch(d.type){case"FeatureCollection":n=d.features.flatMap((A=>Ur(A.geometry)));break;case"Feature":n=Ur(d.geometry);break;default:n=Ur(d)}if(n.length===0)return t;for(let A of n){let[l,g]=A;t.extend([l,g])}return t}class ms extends c.E{constructor(t,n,A,l){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._isUpdatingWorker=!1,this._pendingWorkerUpdate={data:n.data},this.actor=A.getActor(),this.setEventedParent(l),this._data=typeof n.data=="string"?{url:n.data}:{geojson:n.data},this._options=c.e({},n),this._collectResourceTiming=n.collectResourceTiming,n.maxzoom!==void 0&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId,n.clusterMaxZoom!==void 0&&this.maxzoom<=n.clusterMaxZoom&&c.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${n.clusterMaxZoom}".`),this.workerOptions=c.e({source:this.id,geojsonVtOptions:{buffer:this._pixelsToTileUnits(n.buffer!==void 0?n.buffer:128),tolerance:this._pixelsToTileUnits(n.tolerance!==void 0?n.tolerance:.375),extent:c.a6,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1,promoteId:typeof n.promoteId=="string"?n.promoteId:void 0,cluster:n.cluster||!1,clusterOptions:{maxZoom:this._getClusterMaxZoom(n.clusterMaxZoom),minPoints:Math.max(2,n.clusterMinPoints||2),extent:c.a6,radius:this._pixelsToTileUnits(n.clusterRadius||50),log:!1,generateId:n.generateId||!1}},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions)}_hasPendingWorkerUpdate(){return this._pendingWorkerUpdate.data!==void 0||this._pendingWorkerUpdate.diff!==void 0||this._pendingWorkerUpdate.updateCluster}_pixelsToTileUnits(t){return t*(c.a6/this.tileSize)}_getClusterMaxZoom(t){let n=t?Math.round(t):this.maxzoom-1;return Number.isInteger(t)||t===void 0||c.w(`Integer expected for option 'clusterMaxZoom': provided value "${t}" rounded to "${n}"`),n}load(){return c._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(t){this.map=t,this.load()}setData(t,n){this._data=typeof t=="string"?{url:t}:{geojson:t},this._pendingWorkerUpdate={data:t};let A=this._updateWorkerData();return n?A:this}updateData(t,n){this._pendingWorkerUpdate.diff=(function(l,g){if(!l)return g||{};if(!g)return l||{};let B=GA(l),y=GA(g);(function(E,I){I.removeAll&&(E.add.clear(),E.update.clear(),E.remove.clear(),I.remove.clear());for(let b of I.remove)E.add.delete(b),E.update.delete(b);for(let[b,F]of I.update){let T=E.update.get(b);T&&(I.update.set(b,tn(T,F)),E.update.delete(b))}})(B,y);let C={};if((B.removeAll||y.removeAll)&&(C.removeAll=!0),C.remove=new Set([...B.remove,...y.remove]),C.add=new Map([...B.add,...y.add]),C.update=new Map([...B.update,...y.update]),C.remove.size&&C.add.size)for(let E of C.add.keys())C.remove.delete(E);return(function(E){let I={};return E.removeAll&&(I.removeAll=E.removeAll),E.remove&&(I.remove=Array.from(E.remove)),E.add&&(I.add=Array.from(E.add.values())),E.update&&(I.update=Array.from(E.update.values())),I})(C)})(this._pendingWorkerUpdate.diff,t);let A=this._updateWorkerData();return n?A:this}getData(){return c._(this,void 0,void 0,(function*(){return this._data.url&&(yield this.once("data")),this._data.geojson?this._data.geojson:{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}}))}getBounds(){return c._(this,void 0,void 0,(function*(){return Ln(yield this.getData())}))}setClusterOptions(t){return this.workerOptions.geojsonVtOptions.cluster=t.cluster,t.clusterRadius!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.radius=this._pixelsToTileUnits(t.clusterRadius)),t.clusterMaxZoom!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.maxZoom=this._getClusterMaxZoom(t.clusterMaxZoom)),this._pendingWorkerUpdate.updateCluster=!0,this._updateWorkerData(),this}getClusterExpansionZoom(t){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:t,source:this.id}})}getClusterChildren(t){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:t,source:this.id}})}getClusterLeaves(t,n,A){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:n,offset:A}})}_updateWorkerData(){return c._(this,void 0,void 0,(function*(){if(this._isUpdatingWorker)return;if(!this._hasPendingWorkerUpdate())return void c.w(`No pending worker updates for GeoJSONSource ${this.id}.`);let{data:t,diff:n,updateCluster:A}=this._pendingWorkerUpdate,l=this._getLoadGeoJSONParameters(t,n,A);t!==void 0?this._pendingWorkerUpdate.data=void 0:n?this._pendingWorkerUpdate.diff=void 0:A&&(this._pendingWorkerUpdate.updateCluster=void 0),yield this._dispatchWorkerUpdate(l)}))}_getLoadGeoJSONParameters(t,n,A){return c._(this,void 0,void 0,(function*(){let l=c.e({type:this.type},this.workerOptions);return typeof t=="string"?(l.request=yield this.map._requestManager.transformRequest(Je.resolveURL(t),"Source"),l.request.collectResourceTiming=this._collectResourceTiming,l):t!==void 0?(l.data=t,l):n?(l.dataDiff=n,l):A?(l.updateCluster=!0,l):void 0}))}_dispatchWorkerUpdate(t){return c._(this,void 0,void 0,(function*(){this._isUpdatingWorker=!0,this.fire(new c.n("dataloading",{dataType:"source"}));try{let n=yield t,A=yield this.actor.sendAsync({type:"LD",data:n});if(this._isUpdatingWorker=!1,this._removed||A.abandoned)return void this.fire(new c.n("dataabort",{dataType:"source"}));A.data&&(this._data={geojson:A.data});let l=this._applyDiffToSource(n.dataDiff),g=this._getShouldReloadTileOptions(l),B={dataType:"source"};this._applyResourceTiming(B,A),this.fire(new c.n("data",Object.assign(Object.assign({},B),{sourceDataType:"metadata"}))),this.fire(new c.n("data",Object.assign(Object.assign({},B),{sourceDataType:"content",shouldReloadTileOptions:g})))}catch(n){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new c.n("dataabort",{dataType:"source"}));this.fire(new c.l(c.d(n)))}finally{this._hasPendingWorkerUpdate()&&this._updateWorkerData()}}))}_applyResourceTiming(t,n){var A;if(!this._collectResourceTiming)return;let l=(A=n.resourceTiming)===null||A===void 0?void 0:A[this.id];if(!l)return;let g=l.slice(0);g!=null&&g.length&&c.e(t,{resourceTiming:g})}_applyDiffToSource(t){if(!t)return;let n=typeof this.promoteId=="string"?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){let l=(function(g,B){let y=new Map;if(g==null||g.type==null)return y;if(g.type==="Feature"){let C=vi(g,B);return C==null?void 0:(y.set(C,g),y)}if(g.type==="FeatureCollection"){let C=new Set;for(let E of g.features){let I=vi(E,B);if(I==null||C.has(I))return;C.add(I),y.set(I,E)}return y}})(this._data.geojson,n);if(!l)throw new Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:l}}if(!this._data.updateable)return;let A=(function(l,g,B){var y,C;let E=[];if(g.removeAll)l.clear();else if(g.remove)for(let I of g.remove){let b=l.get(I);b&&(E.push(b.geometry),l.delete(I))}if(g.add)for(let I of g.add){let b=vi(I,B);if(b==null)continue;let F=l.get(b);F&&E.push(F.geometry),E.push(I.geometry),l.set(b,I)}if(g.update)for(let I of g.update){let b=l.get(I.id);if(!b)continue;let F=!!I.newGeometry,T=I.removeAllProperties||((y=I.removeProperties)===null||y===void 0?void 0:y.length)>0||((C=I.addOrUpdateProperties)===null||C===void 0?void 0:C.length)>0;if(!F&&!T)continue;E.push(b.geometry);let P=Object.assign({},b);if(l.set(I.id,P),F&&(E.push(I.newGeometry),P.geometry=I.newGeometry),T){if(P.properties=I.removeAllProperties?{}:Object.assign({},P.properties||{}),I.removeProperties)for(let R of I.removeProperties)delete P.properties[R];if(I.addOrUpdateProperties)for(let{key:R,value:Y}of I.addOrUpdateProperties)P.properties[R]=Y}}return E})(this._data.updateable,t,n);return t.removeAll||this._options.cluster?void 0:A}_getShouldReloadTileOptions(t){if(t)return{affectedBounds:t.filter(Boolean).map((n=>Ln(n)))}}shouldReloadTile(t,{affectedBounds:n}){if(t.state==="loading")return!0;if(t.state==="unloaded")return!1;let{buffer:A,extent:l}=this.workerOptions.geojsonVtOptions,g=(function({x:B,y,z:C},E=0){let I=c.a4((B-E)/Math.pow(2,C)),b=c.a5((y+1+E)/Math.pow(2,C)),F=c.a4((B+1+E)/Math.pow(2,C)),T=c.a5((y-E)/Math.pow(2,C));return new Oe([I,b],[F,T])})(t.tileID.canonical,A/l);for(let B of n)if(g.intersects(B))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(t){return c._(this,void 0,void 0,(function*(){let n=t.actor?"RT":"LT";t.actor=this.actor;let A={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};t.abortController=new AbortController;let l=yield this.actor.sendAsync({type:n,data:A},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(l,this.map.painter,n==="RT")}))}abortTile(t){return c._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0}))}unloadTile(t){return c._(this,void 0,void 0,(function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}})}))}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return c.e({},this._options,{type:this.type,data:this._data.updateable?{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}}class Lr extends c.E{constructor(t,n,A,l){super(),this.flippedWindingOrder=!1,this.id=t,this.dispatcher=A,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(l),this.options=n}load(t){return c._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new c.n("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let n=yield qe.getImage(yield this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,n!=null&&n.data&&(this.image=n.data,t&&(this.coordinates=t),this._finishLoading())}catch(n){this._request=null,this._loaded=!0,c.$(n)||this.fire(new c.l(c.d(n)))}}))}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally((()=>this.texture=null)),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new c.n("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;let n=t.map(c.a7.fromLngLat);var A;return this.tileID=(function(l){let g=c.a8.fromPoints(l),B=g.width(),y=g.height(),C=Math.max(B,y),E=Math.max(0,Math.floor(-Math.log(C)/Math.LN2)),I=Math.pow(2,E);return new c.aa(E,Math.floor((g.minX+g.maxX)/2*I),Math.floor((g.minY+g.maxY)/2*I))})(n),this.terrainTileRanges=this._getOverlappingTileRanges(n),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=n.map((l=>this.tileID.getTilePoint(l)._round())),this.flippedWindingOrder=((A=this.tileCoords)[1].x-A[0].x)*(A[2].y-A[0].y)-(A[1].y-A[0].y)*(A[2].x-A[0].x)<0,this.fire(new c.n("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let t=this.map.painter.context,n=t.gl;this.texture||(this.texture=new c.T(t,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let A=!1;for(let l in this.tiles){let g=this.tiles[l];g.state!=="loaded"&&(g.state="loaded",g.texture=this.texture,A=!0)}A&&this.fire(new c.n("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return c._(this,void 0,void 0,(function*(){var n;!((n=this.tileID)===null||n===void 0)&&n.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(t){let{minX:n,minY:A,maxX:l,maxY:g}=c.a8.fromPoints(t),B={};for(let y=0;y<=c.a9;y++){let C=Math.pow(2,y),E=Math.floor(n*C),I=Math.floor(A*C),b=Math.floor(l*C),F=Math.floor(g*C),T=(E%C+C)%C,P=b%C,R=Math.floor(E/C),Y=Math.floor(b/C);B[y]={minWrap:R,maxWrap:Y,minTileXWrapped:T,maxTileXWrapped:P,minTileY:I,maxTileY:F}}return B}}class rn extends Lr{constructor(t,n,A,l){super(t,n,A,l),this._onPlayingHandler=()=>{var g;(g=this.map)===null||g===void 0||g.triggerRepaint()},this.roundZoom=!0,this.type="video",this.options=n}load(){return c._(this,void 0,void 0,(function*(){this._loaded=!1;let t=this.options;this.urls=[];for(let n of t.urls)this.urls.push((yield this.map._requestManager.transformRequest(n,"Source")).url);try{let n=yield c.ab(this.urls);if(this._loaded=!0,!n)return;this.video=n,this.video.loop=!0,this.video.addEventListener("playing",this._onPlayingHandler),this.map&&this.video.play(),this._finishLoading()}catch(n){this.fire(new c.l(c.d(n)))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){let n=this.video.seekable;t<n.start(0)||t>n.end(0)?this.fire(new c.l(new c.ac(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}onRemove(){super.onRemove(),this.video&&(this.video.removeEventListener("playing",this._onPlayingHandler),this.video.pause())}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let t=this.map.painter.context,n=t.gl;this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new c.T(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let A=!1;for(let l in this.tiles){let g=this.tiles[l];g.state!=="loaded"&&(g.state="loaded",g.texture=this.texture,A=!0)}A&&this.fire(new c.n("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class OA extends Lr{constructor(t,n,A,l){super(t,n,A,l),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some((g=>!Array.isArray(g)||g.length!==2||g.some((B=>typeof B!="number"))))||this.fire(new c.l(new c.ac(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new c.l(new c.ac(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new c.l(new c.ac(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new c.l(new c.ac(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new c.l(new c.ac(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){return c._(this,void 0,void 0,(function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new c.l(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}))}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let n=this.map.painter.context,A=n.gl;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new c.T(n,this.canvas,A.RGBA,{premultiply:!0}),this.texture.bind(A.LINEAR,A.CLAMP_TO_EDGE));let l=!1;for(let g in this.tiles){let B=this.tiles[g];B.state!=="loaded"&&(B.state="loaded",B.texture=this.texture,l=!0)}l&&this.fire(new c.n("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}let NA={},Bs=d=>{switch(d){case"geojson":return ms;case"image":return Lr;case"raster":return Ui;case"raster-dem":return ii;case"vector":return ti;case"video":return rn;case"canvas":return OA}return NA[d]},Io="RTLPluginLoaded";class pl extends c.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=fi()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch((n=>{throw this.status="error",n}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return c._(this,arguments,void 0,(function*(n,A=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=Je.resolveURL(n),!this.url)throw new Error(`requested url ${n} is invalid`);if(this.status==="unavailable"){if(!A)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()}))}_requestImport(){return c._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new c.n(Io))}))}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let _s=null;function kr(){return _s||(_s=new pl),_s}var mr,Xi;(function(d){d[d.Base=0]="Base",d[d.Parent=1]="Parent"})(mr||(mr={})),(function(d){d[d.Departing=0]="Departing",d[d.Incoming=1]="Incoming"})(Xi||(Xi={}));class kn{constructor(t,n){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=t,this.uid=c.ad(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state="loading"}isRenderable(t){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(t||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:t,fadingDirection:n,fadingParentID:A,fadeEndTime:l}){this.resetFadeLogic(),this.fadingRole=t,this.fadingDirection=n,this.fadingParentID=A,this.fadeEndTime=l}setSelfFadeLogic(t){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=t}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=Pe(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,n,A){if((t==null?void 0:t.etagUnmodified)!==!0)if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestEncoding=t.encoding,this.latestFeatureIndex.rawTileData=t.rawTileData,this.latestFeatureIndex.encoding=t.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=(function(l,g){let B={};if(!g)return B;for(let y of l){let C=y.layerIds.map((E=>g.getLayer(E))).filter(Boolean);if(C.length!==0){y.layers=C,y.stateDependentLayerIds&&(y.stateDependentLayers=y.stateDependentLayerIds.map((E=>C.filter((I=>I.id===E))[0])));for(let E of C)B[E.id]=y}}return B})(t.buckets,n==null?void 0:n.style),this.hasSymbolBuckets=!1;for(let l in this.buckets){let g=this.buckets[l];if(g instanceof c.af){if(this.hasSymbolBuckets=!0,!A)break;g.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let l in this.buckets){let g=this.buckets[l];if(g instanceof c.af&&g.hasRTLText){this.hasRTLText=!0,kr().lazyLoad();break}}this.queryPadding=0;for(let l in this.buckets){let g=this.buckets[l];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(l).queryRadius(g))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),this.dashPositions=t.dashPositions}else this.collisionBoxArray=new c.ae;else this.state="loaded"}unloadVectorData(){for(let t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.imageAtlas=null,this.dashPositions=null,this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(let A in this.buckets){let l=this.buckets[A];l.uploadPending()&&l.upload(t)}let n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new c.T(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new c.T(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,A,l,g,B,y,C,E,I,b){var F;return!((F=this.latestFeatureIndex)===null||F===void 0)&&F.rawTileData?this.latestFeatureIndex.query({queryGeometry:l,cameraQueryGeometry:g,scale:B,tileSize:this.tileSize,pixelPosMatrix:I,transform:C,params:y,queryPadding:this.queryPadding*E,getElevation:b},t,n,A):{}}querySourceFeatures(t,n){let A=this.latestFeatureIndex;if(!(A!=null&&A.rawTileData))return;let l=A.loadVTLayers(),g=n!=null&&n.sourceLayer?n.sourceLayer:"",B=l[c.ag]||l[g];if(!B)return;let y=c.ah(n==null?void 0:n.filter,n==null?void 0:n.globalState),{z:C,x:E,y:I}=this.tileID.canonical,b={z:C,x:E,y:I};for(let F=0;F<B.length;F++){let T=B.feature(F);if(y.needGeometry){let Y=c.ai(T,!0);if(!y.filter(new c.J(this.tileID.overscaledZ),Y,this.tileID.canonical))continue}else if(!y.filter(new c.J(this.tileID.overscaledZ),T))continue;let P=A.getId(T,g),R=new c.aj(T,C,E,I,P);R.tile=b,t.push(R)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){let n=this.expirationTime;if(t.cacheControl){let A=c.ak(t.cacheControl);A["max-age"]&&(this.expirationTime=Date.now()+1e3*A["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){let A=Date.now(),l=!1;if(this.expirationTime>A)l=!1;else if(n)if(this.expirationTime<n)l=!0;else{let g=this.expirationTime-n;g?this.expirationTime=A+Math.max(g,3e4):l=!0}else l=!0;l?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(t,n){var A,l,g;if(!(!((A=this.latestFeatureIndex)===null||A===void 0)&&A.rawTileData)||Object.keys(t).length===0)return;let B=this.latestFeatureIndex.loadVTLayers();for(let y in this.buckets){if(!n.style.hasLayer(y))continue;let C=this.buckets[y],E=C.layers[0].sourceLayer||c.ag,I=B[E],b=t[E];if(!I||!b||Object.keys(b).length===0)continue;C.update(b,I,((l=this.imageAtlas)===null||l===void 0?void 0:l.patternPositions)||{},this.dashPositions||{});let F=(g=n==null?void 0:n.style)===null||g===void 0?void 0:g.getLayer(y);F&&(this.queryPadding=Math.max(this.queryPadding,F.queryRadius(C)))}}holdingForSymbolFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Pe()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(t){this.symbolFadeHoldUntil=Pe()+t}setDependencies(t,n){let A={};for(let l of n)A[l]=!0;this.dependencies[t]=A}hasDependency(t,n){for(let A of t){let l=this.dependencies[A];if(l){for(let g of n)if(l[g])return!0}}return!1}}class zA{constructor(){this.state={},this.stateChanges={},this.deletedStates={},this.revision=0}updateState(t,n,A){var l,g,B,y,C;let E=String(n);if((y=this.stateChanges)[t]||(y[t]={}),(C=this.stateChanges[t])[E]||(C[E]={}),c.e(this.stateChanges[t][E],A),this.deletedStates[t]===null){this.deletedStates[t]={};for(let I in this.state[t])I!==E&&(this.deletedStates[t][I]=null)}else if(((l=this.deletedStates[t])===null||l===void 0?void 0:l[E])===null){this.deletedStates[t][E]={};for(let I in this.state[t][E])A[I]||(this.deletedStates[t][E][I]=null)}else for(let I in A)((B=(g=this.deletedStates[t])===null||g===void 0?void 0:g[E])===null||B===void 0?void 0:B[I])===null&&delete this.deletedStates[t][E][I]}removeFeatureState(t,n,A){var l,g,B;if(this.deletedStates[t]===null)return;let y=String(n);if((g=this.deletedStates)[t]||(g[t]={}),A&&n!==void 0)this.deletedStates[t][y]!==null&&((B=this.deletedStates[t])[y]||(B[y]={}),this.deletedStates[t][y][A]=null);else if(n!==void 0)if(!((l=this.stateChanges[t])===null||l===void 0)&&l[y])for(A in this.deletedStates[t][y]={},this.stateChanges[t][y])this.deletedStates[t][y][A]=null;else this.deletedStates[t][y]=null;else this.deletedStates[t]=null}getState(t,n){let A=String(n),l=c.e({},(this.state[t]||{})[A],(this.stateChanges[t]||{})[A]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){let g=this.deletedStates[t][n];if(g===null)return{};for(let B in g)delete l[B]}return l}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){var A,l,g;let B={};for(let y in this.stateChanges){(A=this.state)[y]||(A[y]={});let C={};for(let E in this.stateChanges[y])(l=this.state[y])[E]||(l[E]={}),c.e(this.state[y][E],this.stateChanges[y][E]),C[E]=this.state[y][E];B[y]=C}for(let y in this.deletedStates){(g=this.state)[y]||(g[y]={});let C={};if(this.deletedStates[y]===null)for(let E in this.state[y])C[E]={},this.state[y][E]={};else for(let E in this.deletedStates[y]){if(this.deletedStates[y][E]===null)this.state[y][E]={};else for(let I of Object.keys(this.deletedStates[y][E]))delete this.state[y][E][I];C[E]=this.state[y][E]}B[y]||(B[y]={}),c.e(B[y],C)}this.stateChanges={},this.deletedStates={},Object.keys(B).length!==0&&(this.revision++,t.setFeatureState(B,n))}}let nn=89.25;function ir(d,t){let n=c.al(t.lat,-c.am,c.am);return new c.P(c.Z(t.lng)*d,c.Y(n)*d)}function Pn(d,t){return new c.a7(t.x/d,t.y/d).toLngLat()}function on(d){return d.cameraToCenterDistance*Math.min(.85*Math.tan(c.an(90-d.pitch)),Math.tan(c.an(nn-d.pitch)))}function xo(d,t){let n=d.canonical,A=t/c.ao(n.z),l=n.x+Math.pow(2,n.z)*d.wrap,g=c.ap(new Float64Array(16));return c.Q(g,g,[l*A,n.y*A,0]),c.S(g,g,[A/c.a6,A/c.a6,1]),g}function Gn(d,t,n,A,l){let g=c.a7.fromLngLat(d,t),B=l*c.aq(1,d.lat),{x:y,y:C,z:E}=ys(n,A);return new c.a7(g.x+B*-y,g.y+B*-C,g.z+B*-E)}function ys(d,t){let n=c.an(d),A=c.an(t),l=Math.cos(-n),g=Math.sin(n);return{x:g*Math.sin(A),y:-g*Math.cos(A),z:l}}function he(d,t,n){let A=t.intersectsFrustum(d);if(!n||A===0)return A;let l=t.intersectsPlane(n);return l===0?0:A===2&&l===2?2:1}function YA(d,t,n){let A=0,l=(n-t)/10;for(let g=0;g<10;g++)A+=l*Math.pow(Math.cos(t+(g+.5)/10*(n-t)),d);return A}function KA(d,t){return function(n,A,l,g,B){let y=2*((d-1)/c.ar(Math.cos(c.an(nn-B))/Math.cos(c.an(nn)))-1),C=Math.acos(l/g),E=2*YA(y-1,0,c.an(B/2)),I=Math.min(c.an(nn),C+c.an(B/2)),b=YA(y-1,Math.min(I,C-c.an(B/2)),I),F=Math.atan(A/l),T=Math.hypot(A,l),P=n;return P+=c.ar(g/T/Math.max(.5,Math.cos(c.an(B/2)))),P+=y*c.ar(Math.cos(F))/2,P-=c.ar(Math.max(1,b/E/t))/2,P}}let ct=KA(9.314,3);function bi(d,t){let n=(t.roundZoom?Math.round:Math.floor)(d.zoom+c.ar(d.tileSize/t.tileSize));return Math.max(0,n)}function sn(d,t){let n=d.getCameraFrustum(),A=d.getClippingPlane(),l=d.screenPointToMercatorCoordinate(d.getCameraPoint()),g=c.a7.fromLngLat(d.center,d.elevation);l.z=g.z+Math.cos(d.pitchInRadians)*d.cameraToCenterDistance/d.worldSize;let B=d.getCoveringTilesDetailsProvider(),y=B.allowVariableZoom(d,t),C=bi(d,t),E=t.minzoom||0,I=t.maxzoom!==void 0?t.maxzoom:d.maxZoom,b=Math.min(Math.max(0,C),I),F=Math.pow(2,b),T=[F*l.x,F*l.y,0],P=[F*g.x,F*g.y,0],R=Math.hypot(g.x-l.x,g.y-l.y),Y=Math.abs(g.z-l.z),N=Math.hypot(R,Y),K=z=>({zoom:0,x:0,y:0,wrap:z,fullyVisible:!1}),H=[],j=[];if(d.renderWorldCopies&&B.allowWorldCopies())for(let z=1;z<=3;z++)H.push(K(-z)),H.push(K(z));for(H.push(K(0));H.length>0;){let z=H.pop(),Z=z.x,X=z.y,te=z.fullyVisible,Ae={x:Z,y:X,z:z.zoom},ae=B.getTileBoundingVolume(Ae,z.wrap,d.elevation,t);if(!te){let Ie=he(n,ae,A);if(Ie===0)continue;te=Ie===2}let Be=B.distanceToTile2d(l.x,l.y,Ae,ae),me=C;y&&(me=(t.calculateTileZoom||ct)(d.zoom+c.ar(d.tileSize/t.tileSize),Be,Y,N,d.fov)),me=(t.roundZoom?Math.round:Math.floor)(me),me=Math.max(0,me);let Fe=Math.min(me,I);if(z.wrap=B.getWrap(g,Ae,z.wrap),z.zoom>=Fe){if(z.zoom<E)continue;let Ie=b-z.zoom,ge=T[0]-.5-(Z<<Ie),ve=T[1]-.5-(X<<Ie),Ue=t.reparseOverscaled?Math.max(z.zoom,me):z.zoom;j.push({tileID:new c.a3(z.zoom===I?Ue:z.zoom,z.wrap,z.zoom,Z,X),distanceSq:c.as([P[0]-.5-Z,P[1]-.5-X]),tileDistanceToCamera:Math.sqrt(ge*ge+ve*ve)})}else for(let Ie=0;Ie<4;Ie++)H.push({zoom:z.zoom+1,x:(Z<<1)+Ie%2,y:(X<<1)+(Ie>>1),wrap:z.wrap,fullyVisible:te})}return j.sort(((z,Z)=>z.distanceSq-Z.distanceSq)).map((z=>z.tileID))}let fl=c.a8.fromPoints([new c.P(0,0),new c.P(c.a6,c.a6)]);function ml(d){return d==="raster"||d==="image"||d==="video"}function lh(d,t,n,A,l,g,B){if(!t.hasData())return!1;let{tileID:y,fadingRole:C,fadingDirection:E,fadingParentID:I}=t;if(C===mr.Base&&E===Xi.Incoming&&I)return n[I.key]=I,!0;let b=Math.max(y.overscaledZ-l,g);for(let F=y.overscaledZ-1;F>=b;F--){let T=y.scaledTo(F),P=d.getLoadedTile(T);if(P)return t.setCrossFadeLogic({fadingRole:mr.Base,fadingDirection:Xi.Incoming,fadingParentID:P.tileID,fadeEndTime:A+B}),P.setCrossFadeLogic({fadingRole:mr.Parent,fadingDirection:Xi.Departing,fadeEndTime:A+B}),n[T.key]=T,!0}return!1}function Qs(d,t,n,A,l,g){if(!t.hasData())return!1;let B=t.tileID.children(l),y=jA(d,t,B,n,A,l,g);if(y)return!0;for(let C of B)jA(d,t,C.children(l),n,A,l,g)&&(y=!0);return y}function jA(d,t,n,A,l,g,B){if(n[0].overscaledZ>=g)return!1;let y=!1;for(let C of n){let E=d.getLoadedTile(C);if(!E)continue;let{fadingRole:I,fadingDirection:b,fadingParentID:F}=E;I===mr.Base&&b===Xi.Departing&&F||(E.setCrossFadeLogic({fadingRole:mr.Base,fadingDirection:Xi.Departing,fadingParentID:t.tileID,fadeEndTime:l+B}),t.setCrossFadeLogic({fadingRole:mr.Parent,fadingDirection:Xi.Incoming,fadeEndTime:l+B})),A[C.key]=C,y=!0}return y}function Bl(d,t,n,A){let l=d.tileID;return!!d.selfFading||!d.hasData()&&!!t.has(l)&&(d.setSelfFadeLogic(n+A),!0)}function Ee(d,t){var n;d.needsHillshadePrepare=!0,d.needsTerrainPrepare=!0;let A=t.tileID.canonical.x-d.tileID.canonical.x,l=t.tileID.canonical.y-d.tileID.canonical.y,g=Math.pow(2,d.tileID.canonical.z),B=t.tileID.key;A===0&&l===0||Math.abs(l)>1||(Math.abs(A)>1&&(Math.abs(A+g)===1?A+=g:Math.abs(A-g)===1&&(A-=g)),t.dem&&d.dem&&(d.dem.backfillBorder(t.dem,A,l),!((n=d.neighboringTiles)===null||n===void 0)&&n[B]&&(d.neighboringTiles[B].backfilled=!0)))}class An{constructor(){this._tiles={}}handleWrapJump(t){let n={};for(let A in this._tiles){let l=this._tiles[A];l.tileID=l.tileID.unwrapTo(l.tileID.wrap+t),n[l.tileID.key]=l}this._tiles=n}setFeatureState(t,n){for(let A in this._tiles)this._tiles[A].setFeatureState(t,n)}getAllTiles(){return Object.values(this._tiles)}getAllIds(t=!1){return t?Object.values(this._tiles).map((n=>n.tileID)).sort(c.au).map((n=>n.key)):Object.keys(this._tiles)}getTileById(t){return this._tiles[t]}setTile(t,n){this._tiles[t]=n}deleteTileById(t){delete this._tiles[t]}getLoadedTile(t){let n=this.getTileById(t.key);return n!=null&&n.hasData()?n:null}isIdRenderable(t,n=!1){var A;return(A=this.getTileById(t))===null||A===void 0?void 0:A.isRenderable(n)}getRenderableIds(t=0,n){let A=[];for(let l of this.getAllIds())this.isIdRenderable(l,n)&&A.push(this.getTileById(l));return n?A.sort(((l,g)=>{let B=l.tileID,y=g.tileID,C=new c.P(B.canonical.x,B.canonical.y)._rotate(-t),E=new c.P(y.canonical.x,y.canonical.y)._rotate(-t);return B.overscaledZ-y.overscaledZ||E.y-C.y||E.x-C.x})).map((l=>l.tileID.key)):A.map((l=>l.tileID)).sort(c.au).map((l=>l.key))}}class ri extends c.E{constructor(t,n,A){super(),this.id=t,this.dispatcher=A,this.on("data",(l=>{this._dataHandler(l)})),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((l,g,B,y)=>{let C=new(Bs(g.type))(l,g,B,y);if(C.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${C.id}`);return C})(t,n,A,this),this._inViewTiles=new An,this._outOfViewCache=new c.av(0,(l=>this._unloadTile(l))),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new zA,this._didEmitContent=!1,this._updated=!1}onAdd(t){var n;this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,!((n=this._source)===null||n===void 0)&&n.onAdd&&this._source.onAdd(t)}onRemove(t){var n;for(let A of this._inViewTiles.getAllTiles())A.unloadVectorData();this.clearTiles(),!((n=this._source)===null||n===void 0)&&n.onRemove&&this._source.onRemove(t),this._inViewTiles=new An}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let t of this._inViewTiles.getAllTiles())if(t.state!=="loaded"&&t.state!=="errored")return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;let t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,n,A){return c._(this,void 0,void 0,(function*(){try{let l=yield this._source.loadTile(t);this._tileLoaded(t,n,A,l)}catch(l){t.state="errored",l.status!==404?this._source.fire(new c.l(c.d(l),{tile:t})):this.update(this.transform,this.terrain)}}))}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new c.n("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null);for(let n of this._inViewTiles.getAllTiles())n.upload(t),n.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(t){var n;return this._inViewTiles.getRenderableIds((n=this.transform)===null||n===void 0?void 0:n.bearingInRadians,t)}hasRenderableParent(t){let n=t.overscaledZ-1;if(n>=this._source.minzoom){let A=this.getLoadedTile(t.scaledTo(n));if(A)return this._inViewTiles.isIdRenderable(A.tileID.key)}return!1}reload(t,n=void 0){if(this._paused)this._shouldReloadOnResume=!0;else{this._outOfViewCache.reset();for(let A of this._inViewTiles.getAllIds()){let l=this._inViewTiles.getTileById(A);n&&!this._source.shouldReloadTile(l,n)||(t?this._reloadTile(A,"expired"):l.state!=="errored"&&this._reloadTile(A,"reloading"))}}}_reloadTile(t,n){return c._(this,void 0,void 0,(function*(){let A=this._inViewTiles.getTileById(t);A&&(A.state!=="loading"&&(A.state=n),yield this._loadTile(A,t,n))}))}_tileLoaded(t,n,A,l){t.timeAdded=Pe(),t.selfFading&&(t.fadeEndTime=t.timeAdded+this._rasterFadeDuration),A==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),l!=null&&l.unmodified||(this.getSource().type==="raster-dem"&&t.dem&&(function(g,B){var y,C,E;let I=B.getRenderableIds();for(let b of I){if(!(!((y=g.neighboringTiles)===null||y===void 0)&&y[b]))continue;let F=B.getTileById(b);g.neighboringTiles[b].backfilled||Ee(g,F),!((E=(C=F.neighboringTiles)===null||C===void 0?void 0:C[g.tileID.key])===null||E===void 0)&&E.backfilled||Ee(F,g)}})(t,this._inViewTiles),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new c.n("data",{dataType:"source",tile:t,coord:t.tileID})))}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._inViewTiles.getTileById(t)}_retainLoadedChildren(t,n){let A=this._getLoadedDescendents(n),l=new Set;for(let g of n){let B=A[g.key];if(!(B!=null&&B.length)){l.add(g);continue}let y=g.overscaledZ+ri.maxOverzooming,C=B.filter((b=>b.tileID.overscaledZ<=y));if(!C.length){l.add(g);continue}let E=Math.min(...C.map((b=>b.tileID.overscaledZ))),I=C.filter((b=>b.tileID.overscaledZ===E)).map((b=>b.tileID));for(let b of I)t[b.key]=b;this._areDescendentsComplete(I,E,g.overscaledZ)||l.add(g)}return l}_getLoadedDescendents(t){var n;let A={};for(let l of this._inViewTiles.getAllTiles().filter((g=>g.hasData())))for(let g of t)l.tileID.isChildOf(g)&&(A[n=g.key]||(A[n]=[]),A[g.key].push(l));return A}_areDescendentsComplete(t,n,A){return t.length===1&&t[0].isOverscaled()?t[0].overscaledZ===n:Math.pow(4,n-A)===t.length}getLoadedTile(t){return this._inViewTiles.getLoadedTile(t)}updateCacheSize(t){let n=Math.ceil(t.width/this._source.tileSize)+1,A=Math.ceil(t.height/this._source.tileSize)+1,l=Math.floor(n*A*(this._maxTileCacheZoomLevels===null?c.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),g=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,l):l;this._outOfViewCache.setMaxSize(g)}handleWrapJump(t){let n=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);this._prevLng=t,n&&(this._inViewTiles.handleWrapJump(n),this._resetTileReloadTimers())}update(t,n){if(!this._sourceLoaded||this._paused)return;let A;this.transform=t,this.terrain=n,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?A=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((C=>new c.a3(C.canonical.z,C.wrap,C.canonical.z,C.canonical.x,C.canonical.y))):(A=sn(t,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.type==="vector"&&this.map._zoomLevelsToOverscale!==void 0?t.maxZoom-this.map._zoomLevelsToOverscale:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(A=A.filter((C=>this._source.hasTile(C))))):A=[],this.usedForTerrain&&(A=this._addTerrainIdealTiles(A));let l=A.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,l&&this.fire(new c.n("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let g=bi(t,this._source),B=this._updateRetainedTiles(A,g),y=ml(this._source.type);y&&this._rasterFadeDuration>0&&!n&&(function(C,E,I,b,F,T,P){let R=Pe(),Y=c.at(E);for(let N of E){let K=C.getTileById(N.key);K.fadingDirection!==Xi.Departing&&K.fadeOpacity!==0||K.resetFadeLogic(),lh(C,K,I,R,b,F,P)||Qs(C,K,I,R,T,P)||Bl(K,Y,R,P)||K.resetFadeLogic()}})(this._inViewTiles,A,B,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),y?this._cleanUpRasterTiles(B):this._cleanUpVectorTiles(B)}_cleanUpRasterTiles(t){for(let n of this._inViewTiles.getAllIds())t[n]||this._removeTile(n)}_cleanUpVectorTiles(t){for(let n of this._inViewTiles.getAllIds()){let A=this._inViewTiles.getTileById(n);t[n]?A.clearSymbolFadeHold():A.hasSymbolBuckets?A.holdingForSymbolFade()?A.symbolFadeFinished()&&this._removeTile(n):A.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(n)}}_addTerrainIdealTiles(t){let n=[];for(let A of t)if(A.canonical.z>this._source.minzoom){let l=A.scaledTo(A.canonical.z-1);n.push(l);let g=A.scaledTo(Math.max(this._source.minzoom,Math.min(A.canonical.z,5)));n.push(g)}return t.concat(n)}releaseSymbolFadeTiles(){for(let t of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(t).holdingForSymbolFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){var A;let l=new Set;for(let E of t)this._addTile(E).hasData()||l.add(E);let g=t.reduce(((E,I)=>(E[I.key]=I,E)),{}),B=this._retainLoadedChildren(g,l),y={},C=Math.max(n-ri.maxUnderzooming,this._source.minzoom);for(let E of B){let I=this._inViewTiles.getTileById(E.key),b=I==null?void 0:I.wasRequested();for(let F=E.overscaledZ-1;F>=C;--F){let T=E.scaledTo(F);if(y[T.key])break;if(y[T.key]=!0,I=this.getTile(T),!I&&b&&(I=this._addTile(T)),I){let P=I.hasData();if((P||!(!((A=this.map)===null||A===void 0)&&A.cancelPendingTileRequestsWhileZooming)||b)&&(g[T.key]=T),b=I.wasRequested(),P)break}}}return g}_addTile(t){let n=this._inViewTiles.getTileById(t.key);if(n)return n;n=this._outOfViewCache.getAndRemove(t),n&&(n.resetFadeLogic(),this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null));let A=n;return n||(n=new kn(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,t.key,n.state)),n.uses++,this._inViewTiles.setTile(t.key,n),A||this._source.fire(new c.n("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){this._clearTileReloadTimer(t);let A=n.getExpiryTimeout();A&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),A))}_clearTileReloadTimer(t){let n=this._timers[t];n&&(clearTimeout(n),delete this._timers[t])}_resetTileReloadTimers(){for(let t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(let t of this._inViewTiles.getAllIds()){let n=this._inViewTiles.getTileById(t);this._setTileReloadTimer(t,n)}}refreshTiles(t){for(let n of this._inViewTiles.getAllIds()){let A=this._inViewTiles.getTileById(n);(this._inViewTiles.isIdRenderable(n)||A.state=="errored")&&t.some((l=>l.equals(A.tileID.canonical)))&&this._reloadTile(n,"expired")}}_removeTile(t){let n=this._inViewTiles.getTileById(t);n&&(n.uses--,this._inViewTiles.deleteTileById(t),this._clearTileReloadTimer(t),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._outOfViewCache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}_dataHandler(t){t.dataType==="source"&&(t.sourceDataType!=="metadata"?t.sourceDataType==="content"&&this._sourceLoaded&&!this._paused&&(this.reload(t.sourceDataChanged,t.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0):this._sourceLoaded=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let t of this._inViewTiles.getAllIds())this._removeTile(t);this._outOfViewCache.reset()}tilesIn(t,n,A){let l=[],g=this.transform;if(!g)return l;let B=g.getCoveringTilesDetailsProvider().allowWorldCopies(),y=A?g.getCameraQueryGeometry(t):t,C=T=>g.screenPointToMercatorCoordinate(T,this.terrain),E=this.transformBbox(t,C,!B),I=this.transformBbox(y,C,!B),b=this.getIds(),F=c.a8.fromPoints(I);for(let T of b){let P=this._inViewTiles.getTileById(T);if(P.holdingForSymbolFade())continue;let R=B?[P.tileID]:[P.tileID.unwrapTo(-1),P.tileID.unwrapTo(0)],Y=Math.pow(2,g.zoom-P.tileID.overscaledZ),N=n*P.queryPadding*c.a6/P.tileSize/Y;for(let K of R){let H=F.map((j=>K.getTilePoint(new c.a7(j.x,j.y))));if(H.expandBy(N),H.intersects(fl)){let j=E.map((Z=>K.getTilePoint(Z))),z=I.map((Z=>K.getTilePoint(Z)));l.push({tile:P,tileID:B?K:K.unwrapTo(0),queryGeometry:j,cameraQueryGeometry:z,scale:Y})}}}return l}transformBbox(t,n,A){let l=t.map(n);if(A){let g=c.a8.fromPoints(t);g.shrinkBy(.001*Math.min(g.width(),g.height()));let B=g.map(n);c.a8.fromPoints(l).covers(B)||(l=l.map((y=>y.x>.5?new c.a7(y.x-1,y.y,y.z):y)))}return l}getVisibleCoordinates(t){let n=this.getRenderableIds(t).map((A=>this._inViewTiles.getTileById(A).tileID));return this.transform&&this.transform.populateCache(n),n}hasTransition(){return!!this._source.hasTransition()||ml(this._source.type)&&(function(t,n){if(n<=0)return!1;let A=Pe();for(let l of t.getAllTiles())if(l.fadeEndTime>=A)return!0;return!1})(this._inViewTiles,this._rasterFadeDuration)}setRasterFadeDuration(t){this._rasterFadeDuration=t}setFeatureState(t,n,A){t||(t=c.ag),this._state.updateState(t,n,A)}removeFeatureState(t,n,A){t||(t=c.ag),this._state.removeFeatureState(t,n,A)}getFeatureState(t,n){return t||(t=c.ag),this._state.getState(t,n)}setDependencies(t,n,A){let l=this._inViewTiles.getTileById(t);l&&l.setDependencies(n,A)}reloadTilesForDependencies(t,n){for(let A of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(A).hasDependency(t,n)&&this._reloadTile(A,"reloading");this._outOfViewCache.filter((A=>!A.hasDependency(t,n)))}areTilesLoaded(){for(let t of this._inViewTiles.getAllTiles())if(t.state!=="loaded"&&t.state!=="errored")return!1;return!0}}ri.maxUnderzooming=10,ri.maxOverzooming=3;class XA{constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let A=1;A<this.points.length;A++)this._distances[A]=this._distances[A-1]+this.points[A].dist(this.points[A-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(n||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(this.points.length===1)return this.points[0];t=c.al(t,0,1);let n=1,A=this._distances[n],l=t*this.paddedLength+this.padding;for(;A<l&&n<this._distances.length;)A=this._distances[++n];let g=n-1,B=this._distances[g],y=A-B,C=y>0?(l-B)/y:0;return this.points[g].mult(1-C).add(this.points[n].mult(C))}}function Pr(d,t){let n=!0;return d==="always"||d!=="never"&&t!=="never"||(n=!1),n}class xe{constructor(t,n,A){let l=this.boxCells=[],g=this.circleCells=[];this.xCellCount=Math.ceil(t/A),this.yCellCount=Math.ceil(n/A);for(let B=0;B<this.xCellCount*this.yCellCount;B++)l.push([]),g.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=n,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/n,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,n,A,l,g){this._forEachCell(n,A,l,g,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(n),this.bboxes.push(A),this.bboxes.push(l),this.bboxes.push(g)}insertCircle(t,n,A,l){this._forEachCell(n-l,A-l,n+l,A+l,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(n),this.circles.push(A),this.circles.push(l)}_insertBoxCell(t,n,A,l,g,B){this.boxCells[g].push(B)}_insertCircleCell(t,n,A,l,g,B){this.circleCells[g].push(B)}_query(t,n,A,l,g,B,y){if(A<0||t>this.width||l<0||n>this.height)return[];let C=[];if(t<=0&&n<=0&&this.width<=A&&this.height<=l){if(g)return[{key:null,x1:t,y1:n,x2:A,y2:l}];for(let E=0;E<this.boxKeys.length;E++)C.push({key:this.boxKeys[E],x1:this.bboxes[4*E],y1:this.bboxes[4*E+1],x2:this.bboxes[4*E+2],y2:this.bboxes[4*E+3]});for(let E=0;E<this.circleKeys.length;E++){let I=this.circles[3*E],b=this.circles[3*E+1],F=this.circles[3*E+2];C.push({key:this.circleKeys[E],x1:I-F,y1:b-F,x2:I+F,y2:b+F})}}else this._forEachCell(t,n,A,l,this._queryCell,C,{hitTest:g,overlapMode:B,seenUids:{box:{},circle:{}}},y);return C}query(t,n,A,l){return this._query(t,n,A,l,!1,null)}hitTest(t,n,A,l,g,B){return this._query(t,n,A,l,!0,g,B).length>0}hitTestCircle(t,n,A,l,g){let B=t-A,y=t+A,C=n-A,E=n+A;if(y<0||B>this.width||E<0||C>this.height)return!1;let I=[];return this._forEachCell(B,C,y,E,this._queryCellCircle,I,{hitTest:!0,overlapMode:l,circle:{x:t,y:n,radius:A},seenUids:{box:{},circle:{}}},g),I.length>0}_queryCell(t,n,A,l,g,B,y,C){let{seenUids:E,hitTest:I,overlapMode:b}=y,F=this.boxCells[g],T=1e-6;if(F!==null){let R=this.bboxes;for(let Y of F)if(!E.box[Y]){E.box[Y]=!0;let N=4*Y,K=this.boxKeys[Y];if(t<=R[N+2]+T&&n<=R[N+3]+T&&A>=R[N+0]-T&&l>=R[N+1]-T&&(!C||C(K))&&(!I||!Pr(b,K.overlapMode))&&(B.push({key:K,x1:R[N],y1:R[N+1],x2:R[N+2],y2:R[N+3]}),I))return!0}}let P=this.circleCells[g];if(P!==null){let R=this.circles;for(let Y of P)if(!E.circle[Y]){E.circle[Y]=!0;let N=3*Y,K=this.circleKeys[Y];if(this._circleAndRectCollide(R[N],R[N+1],R[N+2],t,n,A,l)&&(!C||C(K))&&(!I||!Pr(b,K.overlapMode))){let H=R[N],j=R[N+1],z=R[N+2];if(B.push({key:K,x1:H-z,y1:j-z,x2:H+z,y2:j+z}),I)return!0}}}return!1}_queryCellCircle(t,n,A,l,g,B,y,C){let{circle:E,seenUids:I,overlapMode:b}=y,F=this.boxCells[g];if(F!==null){let P=this.bboxes;for(let R of F)if(!I.box[R]){I.box[R]=!0;let Y=4*R,N=this.boxKeys[R];if(this._circleAndRectCollide(E.x,E.y,E.radius,P[Y+0],P[Y+1],P[Y+2],P[Y+3])&&(!C||C(N))&&!Pr(b,N.overlapMode))return B.push(!0),!0}}let T=this.circleCells[g];if(T!==null){let P=this.circles;for(let R of T)if(!I.circle[R]){I.circle[R]=!0;let Y=3*R,N=this.circleKeys[R];if(this._circlesCollide(P[Y],P[Y+1],P[Y+2],E.x,E.y,E.radius)&&(!C||C(N))&&!Pr(b,N.overlapMode))return B.push(!0),!0}}}_forEachCell(t,n,A,l,g,B,y,C){let E=this._convertToXCellCoord(t),I=this._convertToYCellCoord(n),b=this._convertToXCellCoord(A),F=this._convertToYCellCoord(l);for(let T=E;T<=b;T++)for(let P=I;P<=F;P++)if(g.call(this,t,n,A,l,this.xCellCount*P+T,B,y,C))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,n,A,l,g,B){let y=l-t,C=g-n,E=A+B;return E*E>y*y+C*C}_circleAndRectCollide(t,n,A,l,g,B,y){let C=(B-l)/2,E=Math.abs(t-(l+C));if(E>C+A)return!1;let I=(y-g)/2,b=Math.abs(n-(g+I));if(b>I+A)return!1;if(E<=C||b<=I)return!0;let F=E-C,T=b-I;return F*F+T*T<=A*A}}function ze(d,t){let n=1/(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]),A=1/(t[8]*t[8]+t[9]*t[9]+t[10]*t[10]),l=t[0]*n,g=t[4]*n,B=t[8]*A,y=t[1]*n,C=t[5]*n,E=t[9]*A,I=t[2]*n,b=t[6]*n,F=t[10]*A;d[0]=l,d[1]=g,d[2]=B,d[4]=y,d[5]=C,d[6]=E,d[8]=I,d[9]=b,d[10]=F;let T=t[12],P=t[13],R=t[14];return d[12]=-l*T-y*P-I*R,d[13]=-g*T-C*P-b*R,d[14]=-B*T-E*P-F*R,d[3]=0,d[7]=0,d[11]=0,d[15]=1,d}let Ze=c.O();function Li(d,t,n){let A=c.O();if(!d){let{vecSouth:b,vecEast:F}=Br(t),T=Me();T[0]=F[0],T[1]=F[1],T[2]=b[0],T[3]=b[1],l=T,(I=(B=(g=T)[0])*(E=g[3])-(C=g[2])*(y=g[1]))&&(l[0]=E*(I=1/I),l[1]=-y*I,l[2]=-C*I,l[3]=B*I),A[0]=T[0],A[1]=T[1],A[4]=T[2],A[5]=T[3]}var l,g,B,y,C,E,I;return c.S(A,A,[1/n,1/n,1]),A}function Cs(d,t,n,A){if(d){let l=c.O();if(!t){let{vecSouth:g,vecEast:B}=Br(n);l[0]=B[0],l[1]=B[1],l[4]=g[0],l[5]=g[1]}return c.S(l,l,[A,A,1]),l}return n.pixelsToClipSpaceMatrix}function Br(d){let t=Math.cos(d.rollInRadians),n=Math.sin(d.rollInRadians),A=Math.cos(d.pitchInRadians),l=Math.cos(d.bearingInRadians),g=Math.sin(d.bearingInRadians),B=c.az();B[0]=-l*A*n-g*t,B[1]=-g*A*n+l*t;let y=c.aA(B);y<1e-9?c.aB(B):c.aC(B,B,1/y);let C=c.az();C[0]=l*A*t-g*n,C[1]=g*A*t+l*n;let E=c.aA(C);return E<1e-9?c.aB(C):c.aC(C,C,1/E),{vecEast:C,vecSouth:B}}function je(d,t,n,A){let l;A?(l=[d,t,A(d,t),1],c.aE(l,l,n)):(l=[d,t,0,1],Is(l,l,n));let g=l[3];return{point:new c.P(l[0]/g,l[1]/g),signedDistanceFromCamera:g,isOccluded:!1}}function vo(d,t){return .5+d/t*.5}function bo(d,t){return d.x>=-t[0]&&d.x<=t[0]&&d.y>=-t[1]&&d.y<=t[1]}function ws(d,t,n,A,l,g,B,y,C,E,I,b,F){let T=n?d.textSizeData:d.iconSizeData,P=c.aw(T,t.transform.zoom),R=[256/t.width*2+1,256/t.height*2+1],Y=n?d.text.dynamicLayoutVertexArray:d.icon.dynamicLayoutVertexArray;Y.clear();let N=d.lineVertexArray,K=n?d.text.placedSymbolArray:d.icon.placedSymbolArray,H=t.transform.width/t.transform.height,j=!1;for(let z=0;z<K.length;z++){let Z=K.get(z);if(Z.hidden||Z.writingMode===c.ax.vertical&&!j){ln(Z.numGlyphs,Y);continue}j=!1;let X=new c.P(Z.anchorX,Z.anchorY),te={getElevation:F,pitchedLabelPlaneMatrix:A,lineVertexArray:N,pitchWithMap:g,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:t.transform,tileAnchorPoint:X,unwrappedTileID:C,width:E,height:I,translation:b},Ae=Nn(Z.anchorX,Z.anchorY,te);if(!bo(Ae.point,R)){ln(Z.numGlyphs,Y);continue}let ae=vo(t.transform.cameraToCenterDistance,Ae.signedDistanceFromCamera),Be=c.ay(T,P,Z),me=g?Be*t.transform.getPitchedTextCorrection(Z.anchorX,Z.anchorY,C)/ae:Be*ae,Fe=On({projectionContext:te,pitchedLabelPlaneMatrixInverse:l,symbol:Z,fontSize:me,flip:!1,keepUpright:B,glyphOffsetArray:d.glyphOffsetArray,dynamicLayoutVertexArray:Y,aspectRatio:H,rotateToLine:y});j=Fe.useVertical,(Fe.notEnoughRoom||j||Fe.needsFlipping&&On({projectionContext:te,pitchedLabelPlaneMatrixInverse:l,symbol:Z,fontSize:me,flip:!0,keepUpright:B,glyphOffsetArray:d.glyphOffsetArray,dynamicLayoutVertexArray:Y,aspectRatio:H,rotateToLine:y}).notEnoughRoom)&&ln(Z.numGlyphs,Y)}n?d.text.dynamicLayoutVertexBuffer.updateData(Y):d.icon.dynamicLayoutVertexBuffer.updateData(Y)}function Rn(d,t,n,A,l,g,B,y){let C=g.glyphStartIndex+g.numGlyphs,E=g.lineStartIndex,I=g.lineStartIndex+g.lineLength,b=t.getoffsetX(g.glyphStartIndex),F=t.getoffsetX(C-1),T=rr(d*b,n,A,l,g.segment,E,I,y,B);if(!T)return null;let P=rr(d*F,n,A,l,g.segment,E,I,y,B);return P?y.projectionCache.anyProjectionOccluded?null:{first:T,last:P}:null}function Fo(d,t,n,A){return d===c.ax.horizontal&&Math.abs(n.y-t.y)>Math.abs(n.x-t.x)*A?{useVertical:!0}:(d===c.ax.vertical?t.y<n.y:t.x>n.x)?{needsFlipping:!0}:null}function On(d){let{projectionContext:t,pitchedLabelPlaneMatrixInverse:n,symbol:A,fontSize:l,flip:g,keepUpright:B,glyphOffsetArray:y,dynamicLayoutVertexArray:C,aspectRatio:E,rotateToLine:I}=d,b=l/24,F=A.lineOffsetX*b,T=A.lineOffsetY*b,P;if(A.numGlyphs>1){let R=A.glyphStartIndex+A.numGlyphs,Y=A.lineStartIndex,N=A.lineStartIndex+A.lineLength,K=Rn(b,y,F,T,g,A,I,t);if(!K)return{notEnoughRoom:!0};let H=Es(K.first.point.x,K.first.point.y,t,n),j=Es(K.last.point.x,K.last.point.y,t,n);if(B&&!g){let z=Fo(A.writingMode,H,j,E);if(z)return z}P=[K.first];for(let z=A.glyphStartIndex+1;z<R-1;z++){let Z=rr(b*y.getoffsetX(z),F,T,g,A.segment,Y,N,t,I);if(!Z)return{notEnoughRoom:!0};P.push(Z)}P.push(K.last)}else{if(B&&!g){let Y=ht(t.tileAnchorPoint.x,t.tileAnchorPoint.y,t).point,N=A.lineStartIndex+A.segment+1,K=new c.P(t.lineVertexArray.getx(N),t.lineVertexArray.gety(N)),H=ht(K.x,K.y,t),j=H.signedDistanceFromCamera>0?H.point:Do(t.tileAnchorPoint,K,Y,1,t),z=Es(Y.x,Y.y,t,n),Z=Es(j.x,j.y,t,n),X=Fo(A.writingMode,z,Z,E);if(X)return X}let R=rr(b*y.getoffsetX(A.glyphStartIndex),F,T,g,A.segment,A.lineStartIndex,A.lineStartIndex+A.lineLength,t,I);if(!R||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};P=[R]}for(let R of P)c.aD(C,R.point,R.angle);return{}}function Do(d,t,n,A,l){let g=d.add(d.sub(t)._unit()),B=ht(g.x,g.y,l).point,y=n.sub(B);return n.add(y._mult(A/y.mag()))}function ni(d,t,n){let A=t.projectionCache;if(A.projections[d])return A.projections[d];let l=new c.P(t.lineVertexArray.getx(d),t.lineVertexArray.gety(d)),g=ht(l.x,l.y,t);if(g.signedDistanceFromCamera>0)return A.projections[d]=g.point,A.anyProjectionOccluded||(A.anyProjectionOccluded=g.isOccluded),g.point;let B=d-n.direction;return Do(n.distanceFromAnchor===0?t.tileAnchorPoint:new c.P(t.lineVertexArray.getx(B),t.lineVertexArray.gety(B)),l,n.previousVertex,n.absOffsetX-n.distanceFromAnchor+1,t)}function ht(d,t,n){let A=d+n.translation[0],l=t+n.translation[1],g;return n.pitchWithMap?(g=je(A,l,n.pitchedLabelPlaneMatrix,n.getElevation),g.isOccluded=!1):(g=n.transform.projectTileCoordinates(A,l,n.unwrappedTileID,n.getElevation),g.point.x=(.5*g.point.x+.5)*n.width,g.point.y=(.5*-g.point.y+.5)*n.height),g}function Es(d,t,n,A){if(n.pitchWithMap){let l=[d,t,0,1];return c.aE(l,l,A),n.transform.projectTileCoordinates(l[0]/l[3],l[1]/l[3],n.unwrappedTileID,n.getElevation).point}return{x:d/n.width*2-1,y:1-t/n.height*2}}function Nn(d,t,n){return n.transform.projectTileCoordinates(d,t,n.unwrappedTileID,n.getElevation)}function So(d,t,n){return d._unit()._perp()._mult(t*n)}function an(d,t,n,A,l,g,B,y,C){if(y.projectionCache.offsets[d])return y.projectionCache.offsets[d];let E=n.add(t);if(d+C.direction<A||d+C.direction>=l)return y.projectionCache.offsets[d]=E,E;let I=ni(d+C.direction,y,C),b=So(I.sub(n),B,C.direction),F=n.add(b),T=I.add(b);return y.projectionCache.offsets[d]=c.aF(g,E,F,T)||E,y.projectionCache.offsets[d]}function rr(d,t,n,A,l,g,B,y,C){let E=A?d-t:d+t,I=E>0?1:-1,b=0;A&&(I*=-1,b=Math.PI),I<0&&(b+=Math.PI);let F,T=I>0?g+l:g+l+1;y.projectionCache.cachedAnchorPoint?F=y.projectionCache.cachedAnchorPoint:(F=ht(y.tileAnchorPoint.x,y.tileAnchorPoint.y,y).point,y.projectionCache.cachedAnchorPoint=F);let P,R,Y=F,N=F,K=0,H=0,j=Math.abs(E),z=[],Z;for(;K+H<=j;){if(T+=I,T<g||T>=B)return null;K+=H,N=Y,R=P;let Ae={absOffsetX:j,direction:I,distanceFromAnchor:K,previousVertex:N};if(Y=ni(T,y,Ae),n===0)z.push(N),Z=Y.sub(N);else{let ae,Be=Y.sub(N);ae=Be.mag()===0?So(ni(T+I,y,Ae).sub(Y),n,I):So(Be,n,I),R||(R=N.add(ae)),P=an(T,ae,Y,g,B,R,n,y,Ae),z.push(R),Z=P.sub(R)}H=Z.mag()}let X=Z._mult((j-K)/H)._add(R||N),te=b+Math.atan2(Y.y-N.y,Y.x-N.x);return z.push(X),{point:X,angle:C?te:0,path:z}}let _l=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ln(d,t){for(let n=0;n<d;n++){let A=t.length;t.resize(A+4),t.float32.set(_l,3*A)}}function Is(d,t,n){let A=t[0],l=t[1];return d[0]=n[0]*A+n[4]*l+n[12],d[1]=n[1]*A+n[5]*l+n[13],d[3]=n[3]*A+n[7]*l+n[15],d}let St=100;class yl{constructor(t,n=new xe(t.width+200,t.height+200,25),A=new xe(t.width+200,t.height+200,25)){this.transform=t,this.grid=n,this.ignoredGrid=A,this.pitchFactor=Math.cos(t.pitch*Math.PI/180)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+St,this.screenBottomBoundary=t.height+St,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,n,A,l,g,B,y,C,E,I,b,F){let T=this.projectAndGetPerspectiveRatio(t.anchorPointX+C[0],t.anchorPointY+C[1],g,I,F),P=A*T.perspectiveRatio,R;if(B||y)R=this._projectCollisionBox(t,P,l,g,B,y,C,T,I,b,F);else{let Z=T.x+(b?b.x*P:0),X=T.y+(b?b.y*P:0);R={allPointsOccluded:!1,box:[Z+t.x1*P,X+t.y1*P,Z+t.x2*P,X+t.y2*P]}}let[Y,N,K,H]=R.box,j=B?R.allPointsOccluded:T.isOccluded,z=j;return z||(z=T.perspectiveRatio<this.perspectiveRatioCutoff),z||(z=!this.isInsideGrid(Y,N,K,H)),z||n!=="always"&&this.grid.hitTest(Y,N,K,H,n,E)?{box:[Y,N,K,H],placeable:!1,offscreen:!1,occluded:j}:{box:[Y,N,K,H],placeable:!0,offscreen:this.isOffscreen(Y,N,K,H),occluded:j}}placeCollisionCircles(t,n,A,l,g,B,y,C,E,I,b,F,T,P){let R=[],Y=new c.P(n.anchorX,n.anchorY),N=this.getPerspectiveRatio(Y.x,Y.y,B,P),K=(E?g*this.transform.getPitchedTextCorrection(n.anchorX,n.anchorY,B)/N:g*N)/c.aJ,H={getElevation:P,pitchedLabelPlaneMatrix:y,lineVertexArray:A,pitchWithMap:E,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:Y,unwrappedTileID:B,width:this.transform.width,height:this.transform.height,translation:T},j=Rn(K,l,n.lineOffsetX*K,n.lineOffsetY*K,!1,n,!1,H),z=!1,Z=!1,X=!0;if(j){let te=.5*b*N+F,Ae=new c.P(-100,-100),ae=new c.P(this.screenRightBoundary,this.screenBottomBoundary),Be=new XA,me=j.first,Fe=j.last,Ie=[];for(let Ue=me.path.length-1;Ue>=1;Ue--)Ie.push(me.path[Ue]);for(let Ue=1;Ue<Fe.path.length;Ue++)Ie.push(Fe.path[Ue]);let ge=2.5*te;if(E){let Ue=this.projectPathToScreenSpace(Ie,H);Ie=Ue.some((lt=>lt.signedDistanceFromCamera<=0))?[]:Ue.map((lt=>lt.point))}let ve=[];if(Ie.length>0){let Ue=Ie[0].clone(),lt=Ie[0].clone();for(let Gt=1;Gt<Ie.length;Gt++)Ue.x=Math.min(Ue.x,Ie[Gt].x),Ue.y=Math.min(Ue.y,Ie[Gt].y),lt.x=Math.max(lt.x,Ie[Gt].x),lt.y=Math.max(lt.y,Ie[Gt].y);ve=Ue.x>=Ae.x&<.x<=ae.x&&Ue.y>=Ae.y&<.y<=ae.y?[Ie]:lt.x<Ae.x||Ue.x>ae.x||lt.y<Ae.y||Ue.y>ae.y?[]:c.aG([Ie],Ae.x,Ae.y,ae.x,ae.y)}for(let Ue of ve){Be.reset(Ue,.25*te);let lt=0;lt=Be.length<=.5*te?1:Math.ceil(Be.paddedLength/ge)+1;for(let Gt=0;Gt<lt;Gt++){let gt=Gt/Math.max(lt-1,1),Ot=Be.lerp(gt),zt=Ot.x+St,li=Ot.y+St;R.push(zt,li,te,0);let Mt=zt-te,yi=li-te,oi=zt+te,Ht=li+te;if(X&&(X=this.isOffscreen(Mt,yi,oi,Ht)),Z||(Z=this.isInsideGrid(Mt,yi,oi,Ht)),t!=="always"&&this.grid.hitTestCircle(zt,li,te,t,I)&&(z=!0,!C))return{circles:[],offscreen:!1,collisionDetected:z}}}}return{circles:!C&&z||!Z||N<this.perspectiveRatioCutoff?[]:R,offscreen:X,collisionDetected:z}}projectPathToScreenSpace(t,n){let A=(function(l,g){let B=Ze;return(function(y,C){let E=1/(C[0]*C[5]-C[1]*C[4]);y[0]=C[5]*E,y[1]=-C[1]*E,y[2]=0,y[3]=0,y[4]=-C[4]*E,y[5]=C[0]*E,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1/C[10],y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1/C[15]})(B,g.pitchedLabelPlaneMatrix),l.map((y=>{let C=je(y.x,y.y,B,g.getElevation),E=g.transform.projectTileCoordinates(C.point.x,C.point.y,g.unwrappedTileID,g.getElevation);return E.point.x=(.5*E.point.x+.5)*g.width,E.point.y=(.5*-E.point.y+.5)*g.height,E}))})(t,n);return(function(l){let g=0,B=0,y=0,C=0;for(let E=0;E<l.length;E++)l[E].isOccluded?(y=E+1,C=0):(C++,C>B&&(B=C,g=y));return l.slice(g,g+B)})(A)}queryRenderedSymbols(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let n=[],A=new c.a8;for(let b of t){let F=new c.P(b.x+St,b.y+St);A.extend(F),n.push(F)}let{minX:l,minY:g,maxX:B,maxY:y}=A,C=this.grid.query(l,g,B,y).concat(this.ignoredGrid.query(l,g,B,y)),E={},I={};for(let b of C){let F=b.key;if(E[F.bucketInstanceId]===void 0&&(E[F.bucketInstanceId]={}),E[F.bucketInstanceId][F.featureIndex])continue;let T=[new c.P(b.x1,b.y1),new c.P(b.x2,b.y1),new c.P(b.x2,b.y2),new c.P(b.x1,b.y2)];c.aH(n,T)&&(E[F.bucketInstanceId][F.featureIndex]=!0,I[F.bucketInstanceId]===void 0&&(I[F.bucketInstanceId]=[]),I[F.bucketInstanceId].push(F.featureIndex))}return I}insertCollisionBox(t,n,A,l,g,B){(A?this.ignoredGrid:this.grid).insert({bucketInstanceId:l,featureIndex:g,collisionGroupID:B,overlapMode:n},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,n,A,l,g,B){let y=A?this.ignoredGrid:this.grid,C={bucketInstanceId:l,featureIndex:g,collisionGroupID:B,overlapMode:n};for(let E=0;E<t.length;E+=4)y.insertCircle(C,t[E],t[E+1],t[E+2])}projectAndGetPerspectiveRatio(t,n,A,l,g){if(g){let B;l?(B=[t,n,l(t,n),1],c.aE(B,B,g)):(B=[t,n,0,1],Is(B,B,g));let y=B[3];return{x:(B[0]/y+1)/2*this.transform.width+St,y:(-B[1]/y+1)/2*this.transform.height+St,perspectiveRatio:.5+this.transform.cameraToCenterDistance/y*.5,isOccluded:!1,signedDistanceFromCamera:y}}{let B=this.transform.projectTileCoordinates(t,n,A,l);return{x:(B.point.x+1)/2*this.transform.width+St,y:(1-B.point.y)/2*this.transform.height+St,perspectiveRatio:.5+this.transform.cameraToCenterDistance/B.signedDistanceFromCamera*.5,isOccluded:B.isOccluded,signedDistanceFromCamera:B.signedDistanceFromCamera}}}getPerspectiveRatio(t,n,A,l){let g=this.transform.projectTileCoordinates(t,n,A,l);return .5+this.transform.cameraToCenterDistance/g.signedDistanceFromCamera*.5}isOffscreen(t,n,A,l){return A<St||t>=this.screenRightBoundary||l<St||n>this.screenBottomBoundary}isInsideGrid(t,n,A,l){return A>=0&&t<this.gridRightBoundary&&l>=0&&n<this.gridBottomBoundary}getViewportMatrix(){let t=c.ap([]);return c.Q(t,t,[-100,-100,0]),t}_projectCollisionBox(t,n,A,l,g,B,y,C,E,I,b){let F=1,T=0,P=0,R=1,Y=t.anchorPointX+y[0],N=t.anchorPointY+y[1];if(B&&!g){let Ie=this.projectAndGetPerspectiveRatio(Y+1,N,l,E,b),ge=Ie.x-C.x,ve=Math.atan((Ie.y-C.y)/ge)+(ge<0?Math.PI:0),Ue=Math.sin(ve),lt=Math.cos(ve);F=lt,T=Ue,P=-Ue,R=lt}else if(!B&&g){let Ie=Br(this.transform);F=Ie.vecEast[0],T=Ie.vecEast[1],P=Ie.vecSouth[0],R=Ie.vecSouth[1]}let K=C.x,H=C.y,j=n;g&&(K=Y,H=N,j=Math.pow(2,-(this.transform.zoom-A.overscaledZ)),j*=this.transform.getPitchedTextCorrection(Y,N,l),I||(j*=c.al(.5+C.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),I&&(K+=F*I.x*j+P*I.y*j,H+=T*I.x*j+R*I.y*j);let z=t.x1*j,Z=t.x2*j,X=(z+Z)/2,te=t.y1*j,Ae=t.y2*j,ae=(te+Ae)/2,Be=[{offsetX:z,offsetY:te},{offsetX:X,offsetY:te},{offsetX:Z,offsetY:te},{offsetX:Z,offsetY:ae},{offsetX:Z,offsetY:Ae},{offsetX:X,offsetY:Ae},{offsetX:z,offsetY:Ae},{offsetX:z,offsetY:ae}],me=[];for(let{offsetX:Ie,offsetY:ge}of Be)me.push(new c.P(K+F*Ie+P*ge,H+T*Ie+R*ge));let Fe=!1;if(g){let Ie=me.map((ge=>this.projectAndGetPerspectiveRatio(ge.x,ge.y,l,E,b)));Fe=Ie.some((ge=>!ge.isOccluded)),me=Ie.map((ge=>new c.P(ge.x,ge.y)))}else Fe=!0;return{box:c.aI(me),allPointsOccluded:!Fe}}}class Ql{constructor(t,n,A,l){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?n:-n))):l&&A?1:0,this.placed=A}isHidden(){return this.opacity===0&&!this.placed}}class Mo{constructor(t,n,A,l,g){this.text=new Ql(t?t.text:null,n,A,g),this.icon=new Ql(t?t.icon:null,n,l,g)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Cl{constructor(t,n,A){this.text=t,this.icon=n,this.skipFade=A}}class wl{constructor(t,n,A,l,g){this.bucketInstanceId=t,this.featureIndex=n,this.sourceLayerIndex=A,this.bucketIndex=l,this.tileID=g}}class El{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){let n=++this.maxGroupID;this.collisionGroups[t]={ID:n,predicate:A=>A.collisionGroupID===n}}return this.collisionGroups[t]}}function xs(d,t,n,A,l){let{horizontalAlign:g,verticalAlign:B}=c.aP(d);return new c.P(-(g-.5)*t+A[0]*l,-(B-.5)*n+A[1]*l)}class VA{constructor(t,n,A,l,g){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new yl(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=A,this.retainedQueryData={},this.collisionGroups=new El(l),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=g,g&&(g.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){let n=this.terrain;return n?(A,l)=>n.getElevation(t,A,l):null}getBucketParts(t,n,A,l){let g=A.getBucket(n),B=A.latestFeatureIndex;if(!g||!B||n.id!==g.layerIds[0])return;let y=A.collisionBoxArray,C=g.layers[0].layout,E=g.layers[0].paint,I=Math.pow(2,this.transform.zoom-A.tileID.overscaledZ),b=A.tileSize/c.a6,F=A.tileID.toUnwrapped(),T=C.get("text-rotation-alignment")==="map",P=c.aK(A,1,this.transform.zoom),R=c.aL(this.collisionIndex.transform,A,E.get("text-translate"),E.get("text-translate-anchor")),Y=c.aL(this.collisionIndex.transform,A,E.get("icon-translate"),E.get("icon-translate-anchor")),N=Li(T,this.transform,P);this.retainedQueryData[g.bucketInstanceId]=new wl(g.bucketInstanceId,B,g.sourceLayerIndex,g.index,A.tileID);let K={bucket:g,layout:C,translationText:R,translationIcon:Y,unwrappedTileID:F,pitchedLabelPlaneMatrix:N,scale:I,textPixelRatio:b,holdingForFade:A.holdingForSymbolFade(),collisionBoxArray:y,partiallyEvaluatedTextSize:c.aw(g.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(g.sourceID)};if(l)for(let H of g.sortKeyRanges){let{sortKey:j,symbolInstanceStart:z,symbolInstanceEnd:Z}=H;t.push({sortKey:j,symbolInstanceStart:z,symbolInstanceEnd:Z,parameters:K})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:g.symbolInstances.length,parameters:K})}attemptAnchorPlacement(t,n,A,l,g,B,y,C,E,I,b,F,T,P,R,Y,N,K,H,j){var z,Z,X;let te=c.aM[t.textAnchor],Ae=[t.textOffset0,t.textOffset1],ae=xs(te,A,l,Ae,g),Be=this.collisionIndex.placeCollisionBox(n,F,C,E,I,y,B,Y,b.predicate,H,ae,j);if((!K||this.collisionIndex.placeCollisionBox(K,F,C,E,I,y,B,N,b.predicate,H,ae,j).placeable)&&Be.placeable){let me;if(!((z=this.prevPlacement)===null||z===void 0)&&z.variableOffsets[T.crossTileID]&&(!((X=(Z=this.prevPlacement)===null||Z===void 0?void 0:Z.placements[T.crossTileID])===null||X===void 0)&&X.text)&&(me=this.prevPlacement.variableOffsets[T.crossTileID].anchor),T.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[T.crossTileID]={textOffset:Ae,width:A,height:l,anchor:te,textBoxScale:g,prevAnchor:me},this.markUsedJustification(P,te,T,R),P.allowVerticalPlacement&&(this.markUsedOrientation(P,R,T),this.placedOrientations[T.crossTileID]=R),{shift:ae,placedGlyphBoxes:Be}}}placeLayerBucketPart(t,n,A){let{bucket:l,layout:g,translationText:B,translationIcon:y,unwrappedTileID:C,pitchedLabelPlaneMatrix:E,textPixelRatio:I,holdingForFade:b,collisionBoxArray:F,partiallyEvaluatedTextSize:T,collisionGroup:P}=t.parameters,R=g.get("text-optional"),Y=g.get("icon-optional"),N=c.aN(g,"text-overlap","text-allow-overlap"),K=N==="always",H=c.aN(g,"icon-overlap","icon-allow-overlap"),j=H==="always",z=g.get("text-rotation-alignment")==="map",Z=g.get("text-pitch-alignment")==="map",X=g.get("icon-text-fit")!=="none",te=g.get("symbol-z-order")==="viewport-y",Ae=K&&(j||!l.hasIconData()||Y),ae=j&&(K||!l.hasTextData()||R);!l.collisionArrays&&F&&l.deserializeCollisionBoxes(F);let Be=this.retainedQueryData[l.bucketInstanceId].tileID,me=this._getTerrainElevationFunc(Be),Fe=this.transform.getFastPathSimpleProjectionMatrix(Be),Ie=(ge,ve,Ue)=>{var lt,Gt;if(n[ge.crossTileID])return;if(b)return void(this.placements[ge.crossTileID]=new Cl(!1,!1,!1));let gt=!1,Ot=!1,zt=!0,li=null,Mt={box:null,placeable:!1,offscreen:null,occluded:!1},yi={placeable:!1},oi=null,Ht=null,ci=null,Kr=0,jr=0,Xr=0;ve.textFeatureIndex?Kr=ve.textFeatureIndex:ge.useRuntimeCollisionCircles&&(Kr=ge.featureIndex),ve.verticalTextFeatureIndex&&(jr=ve.verticalTextFeatureIndex);let hi=ve.textBox;if(hi){let gr=xt=>{let yt=c.ax.horizontal;if(l.allowVerticalPlacement&&!xt&&this.prevPlacement){let Yt=this.prevPlacement.placedOrientations[ge.crossTileID];Yt&&(this.placedOrientations[ge.crossTileID]=Yt,yt=Yt,this.markUsedOrientation(l,yt,ge))}return yt},pr=(xt,yt)=>{if(l.allowVerticalPlacement&&ge.numVerticalGlyphVertices>0&&ve.verticalTextBox){for(let Yt of l.writingModes)if(Yt===c.ax.vertical?(Mt=yt(),yi=Mt):Mt=xt(),Mt==null?void 0:Mt.placeable)break}else Mt=xt()},Oi=ge.textAnchorOffsetStartIndex,Ji=ge.textAnchorOffsetEndIndex;if(Ji===Oi){let xt=(yt,Yt)=>{let vt=this.collisionIndex.placeCollisionBox(yt,N,I,Be,C,Z,z,B,P.predicate,me,void 0,Fe);return vt!=null&&vt.placeable&&(this.markUsedOrientation(l,Yt,ge),this.placedOrientations[ge.crossTileID]=Yt),vt};pr((()=>xt(hi,c.ax.horizontal)),(()=>{let yt=ve.verticalTextBox;return l.allowVerticalPlacement&&ge.numVerticalGlyphVertices>0&&yt?xt(yt,c.ax.vertical):{box:null,offscreen:null}})),gr(Mt==null?void 0:Mt.placeable)}else{let xt=c.aM[(Gt=(lt=this.prevPlacement)===null||lt===void 0?void 0:lt.variableOffsets[ge.crossTileID])===null||Gt===void 0?void 0:Gt.anchor],yt=(vt,vn,cA)=>{let xr=vt.x2-vt.x1,Na=vt.y2-vt.y1,_c=ge.textBoxScale,za=X&&H==="never"?vn:null,Zr=null,Hr=N==="never"?1:2,Jr="never";xt&&Hr++;for(let Ya=0;Ya<Hr;Ya++){for(let Ka=Oi;Ka<Ji;Ka++){let hA=l.textAnchorOffsets.get(Ka);if(xt&&hA.textAnchor!==xt)continue;let uA=this.attemptAnchorPlacement(hA,vt,xr,Na,_c,z,Z,I,Be,C,P,Jr,ge,l,cA,B,y,za,me);if(uA&&(Zr=uA.placedGlyphBoxes,Zr==null?void 0:Zr.placeable))return gt=!0,li=uA.shift,Zr}xt?xt=null:Jr=N}return A&&!Zr&&(Zr={box:this.collisionIndex.placeCollisionBox(hi,"always",I,Be,C,Z,z,B,P.predicate,me,void 0,Fe).box,offscreen:!1,placeable:!1,occluded:!1}),Zr};pr((()=>yt(hi,ve.iconBox,c.ax.horizontal)),(()=>{let vt=ve.verticalTextBox;return l.allowVerticalPlacement&&!(Mt!=null&&Mt.placeable)&&ge.numVerticalGlyphVertices>0&&vt?yt(vt,ve.verticalIconBox,c.ax.vertical):{box:null,occluded:!0,offscreen:null}})),Mt&&(gt=Mt.placeable,zt=Mt.offscreen);let Yt=gr(Mt==null?void 0:Mt.placeable);if(!gt&&this.prevPlacement){let vt=this.prevPlacement.variableOffsets[ge.crossTileID];vt&&(this.variableOffsets[ge.crossTileID]=vt,this.markUsedJustification(l,vt.anchor,ge,Yt))}}}if(oi=Mt,gt=oi==null?void 0:oi.placeable,zt=oi==null?void 0:oi.offscreen,ge.useRuntimeCollisionCircles&&ge.centerJustifiedTextSymbolIndex>=0){let gr=l.text.placedSymbolArray.get(ge.centerJustifiedTextSymbolIndex),pr=c.ay(l.textSizeData,T,gr),Oi=g.get("text-padding");Ht=this.collisionIndex.placeCollisionCircles(N,gr,l.lineVertexArray,l.glyphOffsetArray,pr,C,E,A,Z,P.predicate,ge.collisionCircleDiameter,Oi,B,me),Ht.circles.length&&Ht.collisionDetected&&!A&&c.w("Collisions detected, but collision boxes are not shown"),gt=K||Ht.circles.length>0&&!Ht.collisionDetected,zt&&(zt=Ht.offscreen)}if(ve.iconFeatureIndex&&(Xr=ve.iconFeatureIndex),ve.iconBox){let gr=pr=>this.collisionIndex.placeCollisionBox(pr,H,I,Be,C,Z,z,y,P.predicate,me,X&&li?li:void 0,Fe);yi&&yi.placeable&&ve.verticalIconBox?(ci=gr(ve.verticalIconBox),Ot=ci.placeable):(ci=gr(ve.iconBox),Ot=ci.placeable),zt&&(zt=ci.offscreen)}let Ir=R||ge.numHorizontalGlyphVertices===0&&ge.numVerticalGlyphVertices===0,Vr=Y||ge.numIconVertices===0;Ir||Vr?Vr?Ir||Ot&&(Ot=gt):gt=Ot&>:Ot=gt=Ot&>let lA=Ot&&ci.placeable;if(gt&&oi.placeable&&this.collisionIndex.insertCollisionBox(oi.box,N,g.get("text-ignore-placement"),l.bucketInstanceId,yi&&yi.placeable&&jr?jr:Kr,P.ID),lA&&this.collisionIndex.insertCollisionBox(ci.box,H,g.get("icon-ignore-placement"),l.bucketInstanceId,Xr,P.ID),Ht&>&&this.collisionIndex.insertCollisionCircles(Ht.circles,N,g.get("text-ignore-placement"),l.bucketInstanceId,Kr,P.ID),A&&this.storeCollisionData(l.bucketInstanceId,Ue,ve,oi,ci,Ht),ge.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(l.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[ge.crossTileID]=new Cl((gt||Ae)&&!(oi!=null&&oi.occluded),(Ot||ae)&&!(ci!=null&&ci.occluded),zt||l.justReloaded),n[ge.crossTileID]=!0};if(te){if(t.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let ge=l.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let ve=ge.length-1;ve>=0;--ve){let Ue=ge[ve];Ie(l.symbolInstances.get(Ue),l.collisionArrays[Ue],Ue)}}else for(let ge=t.symbolInstanceStart;ge<t.symbolInstanceEnd;ge++)Ie(l.symbolInstances.get(ge),l.collisionArrays[ge],ge);l.justReloaded=!1}storeCollisionData(t,n,A,l,g,B){if(A.textBox||A.iconBox){let y,C;this.collisionBoxArrays.has(t)?y=this.collisionBoxArrays.get(t):(y=new Map,this.collisionBoxArrays.set(t,y)),y.has(n)?C=y.get(n):(C={text:null,icon:null},y.set(n,C)),A.textBox&&(C.text=l.box),A.iconBox&&(C.icon=g.box)}if(B){let y=this.collisionCircleArrays[t];y===void 0&&(y=this.collisionCircleArrays[t]=[]);for(let C=0;C<B.circles.length;C+=4)y.push(B.circles[C+0]-St),y.push(B.circles[C+1]-St),y.push(B.circles[C+2]),y.push(B.collisionDetected?1:0)}}markUsedJustification(t,n,A,l){let g;g=l===c.ax.vertical?A.verticalPlacedTextSymbolIndex:{left:A.leftJustifiedTextSymbolIndex,center:A.centerJustifiedTextSymbolIndex,right:A.rightJustifiedTextSymbolIndex}[c.aO(n)];let B=[A.leftJustifiedTextSymbolIndex,A.centerJustifiedTextSymbolIndex,A.rightJustifiedTextSymbolIndex,A.verticalPlacedTextSymbolIndex];for(let y of B)y>=0&&(t.text.placedSymbolArray.get(y).crossTileID=g>=0&&y!==g?0:A.crossTileID)}markUsedOrientation(t,n,A){let l=n===c.ax.horizontal||n===c.ax.horizontalOnly?n:0,g=n===c.ax.vertical?n:0,B=[A.leftJustifiedTextSymbolIndex,A.centerJustifiedTextSymbolIndex,A.rightJustifiedTextSymbolIndex];for(let y of B)t.text.placedSymbolArray.get(y).placedOrientation=l;A.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(A.verticalPlacedTextSymbolIndex).placedOrientation=g)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;let n=this.prevPlacement,A=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;let l=n?n.symbolFadeChange(t):1,g=n?n.opacities:{},B=n?n.variableOffsets:{},y=n?n.placedOrientations:{};for(let C in this.placements){let E=this.placements[C],I=g[C];I?(this.opacities[C]=new Mo(I,l,E.text,E.icon),A||(A=E.text!==I.text.placed),A||(A=E.icon!==I.icon.placed)):(this.opacities[C]=new Mo(null,l,E.text,E.icon,E.skipFade),A||(A=E.text||E.icon))}for(let C in g){let E=g[C];if(!this.opacities[C]){let I=new Mo(E,l,!1,!1);I.isHidden()||(this.opacities[C]=I,A||(A=E.text.placed),A||(A=E.icon.placed))}}for(let C in B)this.variableOffsets[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.variableOffsets[C]=B[C]);for(let C in y)this.placedOrientations[C]||!this.opacities[C]||this.opacities[C].isHidden()||(this.placedOrientations[C]=y[C]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");A?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){let A={};for(let l of n){let g=l.getBucket(t);g&&l.latestFeatureIndex&&t.id===g.layerIds[0]&&this.updateBucketOpacities(g,l.tileID,A,l.collisionBoxArray)}}updateBucketOpacities(t,n,A,l){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();let g=t.layers[0],B=g.layout,y=new Mo(null,0,!1,!1,!0),C=B.get("text-allow-overlap"),E=B.get("icon-allow-overlap"),I=g._unevaluatedLayout.hasValue("text-variable-anchor")||g._unevaluatedLayout.hasValue("text-variable-anchor-offset"),b=B.get("text-rotation-alignment")==="map",F=B.get("text-pitch-alignment")==="map",T=B.get("icon-text-fit")!=="none",P=new Mo(null,0,C&&(E||!t.hasIconData()||B.get("icon-optional")),E&&(C||!t.hasTextData()||B.get("text-optional")),!0);!t.collisionArrays&&l&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(l);let R=(N,K,H)=>{for(let j=0;j<K/4;j++)N.opacityVertexArray.emplaceBack(H);N.hasVisibleVertices||(N.hasVisibleVertices=H!==Uo)},Y=this.collisionBoxArrays.get(t.bucketInstanceId);for(let N=0;N<t.symbolInstances.length;N++){let K=t.symbolInstances.get(N),{numHorizontalGlyphVertices:H,numVerticalGlyphVertices:j,crossTileID:z}=K,Z=this.opacities[z];A[z]?Z=y:Z||(Z=P,this.opacities[z]=Z),A[z]=!0;let X=K.numIconVertices>0,te=this.placedOrientations[K.crossTileID],Ae=te===c.ax.vertical,ae=te===c.ax.horizontal||te===c.ax.horizontalOnly;if(H>0||j>0){let me=qA(Z.text);R(t.text,H,Ae?Uo:me),R(t.text,j,ae?Uo:me);let Fe=Z.text.isHidden(),Ie=[K.rightJustifiedTextSymbolIndex,K.centerJustifiedTextSymbolIndex,K.leftJustifiedTextSymbolIndex];for(let Ue of Ie)Ue>=0&&(t.text.placedSymbolArray.get(Ue).hidden=Fe||Ae?1:0);K.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(K.verticalPlacedTextSymbolIndex).hidden=Fe||ae?1:0);let ge=this.variableOffsets[K.crossTileID];ge&&this.markUsedJustification(t,ge.anchor,K,te);let ve=this.placedOrientations[K.crossTileID];ve&&(this.markUsedJustification(t,"left",K,ve),this.markUsedOrientation(t,ve,K))}if(X){let me=qA(Z.icon),Fe=!(T&&K.verticalPlacedIconSymbolIndex&&Ae);K.placedIconSymbolIndex>=0&&(R(t.icon,K.numIconVertices,Fe?me:Uo),t.icon.placedSymbolArray.get(K.placedIconSymbolIndex).hidden=Z.icon.isHidden()),K.verticalPlacedIconSymbolIndex>=0&&(R(t.icon,K.numVerticalIconVertices,Fe?Uo:me),t.icon.placedSymbolArray.get(K.verticalPlacedIconSymbolIndex).hidden=Z.icon.isHidden())}let Be=Y!=null&&Y.has(N)?Y.get(N):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){let me=t.collisionArrays[N];if(me){let Fe=new c.P(0,0);if(me.textBox||me.verticalTextBox){let Ie=!0;if(I){let ge=this.variableOffsets[z];ge?(Fe=xs(ge.anchor,ge.width,ge.height,ge.textOffset,ge.textBoxScale),b&&Fe._rotate(F?-this.transform.bearingInRadians:this.transform.bearingInRadians)):Ie=!1}if(me.textBox||me.verticalTextBox){let ge;me.textBox&&(ge=Ae),me.verticalTextBox&&(ge=ae),ZA(t.textCollisionBox.collisionVertexArray,Z.text.placed,!Ie||ge,Be.text,Fe.x,Fe.y)}}if(me.iconBox||me.verticalIconBox){let Ie=!!(!ae&&me.verticalIconBox),ge;me.iconBox&&(ge=Ie),me.verticalIconBox&&(ge=!Ie),ZA(t.iconCollisionBox.collisionVertexArray,Z.icon.placed,ge,Be.icon,T?Fe.x:0,T?Fe.y:0)}}}}if(t.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);t.bucketInstanceId in this.collisionCircleArrays&&(t.collisionCircleArray=this.collisionCircleArrays[t.bucketInstanceId],delete this.collisionCircleArrays[t.bucketInstanceId])}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,n){let A=this.zoomAtLastRecencyCheck===n?1-this.zoomAdjustment(n):1;return this.zoomAtLastRecencyCheck=n,this.commitTime+this.fadeDuration*A>t}setStale(){this.stale=!0}}function ZA(d,t,n,A,l,g){A&&A.length!==0||(A=[0,0,0,0]);let B=A[0]-St,y=A[1]-St,C=A[2]-St,E=A[3]-St;d.emplaceBack(t?1:0,n?1:0,l||0,g||0,B,y),d.emplaceBack(t?1:0,n?1:0,l||0,g||0,C,y),d.emplaceBack(t?1:0,n?1:0,l||0,g||0,C,E),d.emplaceBack(t?1:0,n?1:0,l||0,g||0,B,E)}let HA=Math.pow(2,25),JA=Math.pow(2,24),ch=Math.pow(2,17),To=Math.pow(2,16),vs=Math.pow(2,9),Il=Math.pow(2,8),zn=Math.pow(2,1);function qA(d){if(d.opacity===0&&!d.placed)return 0;if(d.opacity===1&&d.placed)return 4294967295;let t=d.placed?1:0,n=Math.floor(127*d.opacity);return n*HA+t*JA+n*ch+t*To+n*vs+t*Il+n*zn+t}let Uo=0;class Gr{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,n,A,l,g){let B=this._bucketParts;for(;this._currentTileIndex<t.length;)if(n.getBucketParts(B,l,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,g())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,B.sort(((y,C)=>y.sortKey-C.sortKey)));this._currentPartIndex<B.length;)if(n.placeLayerBucketPart(B[this._currentPartIndex],this._seenCrossTileIDs,A),this._currentPartIndex++,g())return!0;return!1}}class Yn{constructor(t,n,A,l,g,B,y,C){this.placement=new VA(t,n,B,y,C),this._currentPlacementIndex=A.length-1,this._forceFullPlacement=l,this._showCollisionBoxes=g,this._done=!1}isDone(){return this._done}continuePlacement(t,n,A){let l=Pe(),g=()=>!this._forceFullPlacement&&Pe()-l>2;for(;this._currentPlacementIndex>=0;){let B=n[t[this._currentPlacementIndex]],y=this.placement.collisionIndex.transform.zoom;if(c.aQ(B)&&B.layout&&(!B.minzoom||B.minzoom<=y)&&(!B.maxzoom||B.maxzoom>y)){if(this._inProgressLayer||(this._inProgressLayer=new Gr(B)),this._inProgressLayer.continuePlacement(A[B.source],this.placement,this._showCollisionBoxes,B,g))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}let Ve=512/c.a6/2;class WA{constructor(t,n,A){this.tileID=t,this.bucketInstanceId=A,this._symbolsByKey={};let l=new Map;for(let g=0;g<n.length;g++){let B=n.get(g),y=B.key,C=l.get(y);C?C.push(B):l.set(y,[B])}for(let[g,B]of l){let y={positions:B.map((C=>({x:Math.floor(C.anchorX*Ve),y:Math.floor(C.anchorY*Ve)}))),crossTileIDs:B.map((C=>C.crossTileID))};if(y.positions.length>128){let C=new c.aR(y.positions.length,16,Uint16Array);for(let{x:E,y:I}of y.positions)C.add(E,I);C.finish(),delete y.positions,y.index=C}this._symbolsByKey[g]=y}}getScaledCoordinates(t,n){let{x:A,y:l,z:g}=this.tileID.canonical,{x:B,y,z:C}=n.canonical,E=Ve/Math.pow(2,C-g),I=(y*c.a6+t.anchorY)*E,b=l*c.a6*Ve;return{x:Math.floor((B*c.a6+t.anchorX)*E-A*c.a6*Ve),y:Math.floor(I-b)}}findMatches(t,n,A){let l=this.tileID.canonical.z<n.canonical.z?1:Math.pow(2,this.tileID.canonical.z-n.canonical.z);for(let g=0;g<t.length;g++){let B=t.get(g);if(B.crossTileID)continue;let y=this._symbolsByKey[B.key];if(!y)continue;let C=this.getScaledCoordinates(B,n);if(y.index){let E=y.index.range(C.x-l,C.y-l,C.x+l,C.y+l).sort();for(let I of E){let b=y.crossTileIDs[I];if(!A[b]){A[b]=!0,B.crossTileID=b;break}}}else if(y.positions)for(let E=0;E<y.positions.length;E++){let I=y.positions[E],b=y.crossTileIDs[E];if(Math.abs(I.x-C.x)<=l&&Math.abs(I.y-C.y)<=l&&!A[b]){A[b]=!0,B.crossTileID=b;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((({crossTileIDs:t})=>t))}}class hh{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class $A{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){let n=Math.round((t-this.lng)/360);if(n!==0)for(let A in this.indexes){let l=this.indexes[A],g={};for(let B in l){let y=l[B];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+n),g[y.tileID.key]=y}this.indexes[A]=g}this.lng=t}addBucket(t,n,A){var l,g,B;if(!((l=this.indexes[t.overscaledZ])===null||l===void 0)&&l[t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let C=0;C<n.symbolInstances.length;C++)n.symbolInstances.get(C).crossTileID=0;(g=this.usedCrossTileIDs)[B=t.overscaledZ]||(g[B]={});let y=this.usedCrossTileIDs[t.overscaledZ];for(let C in this.indexes){let E=this.indexes[C];if(Number(C)>t.overscaledZ)for(let I in E){let b=E[I];b.tileID.isChildOf(t)&&b.findMatches(n.symbolInstances,t,y)}else{let I=E[t.scaledTo(Number(C)).key];I&&I.findMatches(n.symbolInstances,t,y)}}for(let C=0;C<n.symbolInstances.length;C++){let E=n.symbolInstances.get(C);E.crossTileID||(E.crossTileID=A.generate(),y[E.crossTileID]=!0)}return this.indexes[t.overscaledZ]===void 0&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new WA(t,n.symbolInstances,n.bucketInstanceId),!0}removeBucketCrossTileIDs(t,n){for(let A of n.getCrossTileIDsLists())for(let l of A)delete this.usedCrossTileIDs[t][l]}removeStaleBuckets(t){let n=!1;for(let A in this.indexes){let l=this.indexes[A];for(let g in l)t[l[g].bucketInstanceId]||(this.removeBucketCrossTileIDs(A,l[g]),delete l[g],n=!0)}return n}}class Fi{constructor(){this.layerIndexes={},this.crossTileIDs=new hh,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,n,A){let l=this.layerIndexes[t.id];l===void 0&&(l=this.layerIndexes[t.id]=new $A);let g=!1,B={};l.handleWrapJump(A);for(let y of n){let C=y.getBucket(t);t.id===(C==null?void 0:C.layerIds[0])&&(C.bucketInstanceId||(this.maxBucketInstanceId+=1,C.bucketInstanceId=this.maxBucketInstanceId),l.addBucket(y.tileID,C,this.crossTileIDs)&&(g=!0),B[C.bucketInstanceId]=!0)}return l.removeStaleBuckets(B)&&(g=!0),g}pruneUnusedLayers(t){let n={};for(let A of t)n[A]=!0;for(let A in this.layerIndexes)n[A]||delete this.layerIndexes[A]}}var ai="void main() {fragColor=vec4(1.0);}";let Et={prelude:Ne(`#ifdef GL_ES
|
|
precision mediump float;
|
|
#else
|
|
#if !defined(lowp)
|
|
#define lowp
|
|
#endif
|
|
#if !defined(mediump)
|
|
#define mediump
|
|
#endif
|
|
#if !defined(highp)
|
|
#define highp
|
|
#endif
|
|
#endif
|
|
out highp vec4 fragColor;`,`#ifdef GL_ES
|
|
precision highp float;
|
|
#else
|
|
#if !defined(lowp)
|
|
#define lowp
|
|
#endif
|
|
#if !defined(mediump)
|
|
#define mediump
|
|
#endif
|
|
#if !defined(highp)
|
|
#define highp
|
|
#endif
|
|
#endif
|
|
vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
|
|
);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+ c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+ c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+ c
|
|
);}
|
|
#ifdef TERRAIN3D
|
|
uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;
|
|
#endif
|
|
const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {
|
|
#ifdef TERRAIN3D
|
|
highp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));
|
|
#else
|
|
return 1.0;
|
|
#endif
|
|
}float calculate_visibility(vec4 pos) {
|
|
#ifdef TERRAIN3D
|
|
vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;
|
|
#else
|
|
return 1.0;
|
|
#endif
|
|
}float ele(vec2 pos) {
|
|
#ifdef TERRAIN3D
|
|
vec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
|
|
#else
|
|
return 0.0;
|
|
#endif
|
|
}float get_elevation(vec2 pos) {
|
|
#ifdef TERRAIN3D
|
|
#ifdef GLOBE
|
|
if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}
|
|
#endif
|
|
vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;
|
|
#else
|
|
return 0.0;
|
|
#endif
|
|
}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;`),projectionMercator:Ne("","float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:Ne("",`#define GLOBE_RADIUS 6371008.8
|
|
uniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos
|
|
);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float spherical_y=2.0*atan(exp(PI-(mercator_pos_y*PI*2.0)))-PI*0.5;return cos(spherical_y);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY);
|
|
if (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;vec2 spherical;spherical.x=mercator_pos.x*PI*2.0+PI;spherical.y=2.0*atan(exp(PI-(mercator_pos.y*PI*2.0)))-PI*0.5;float len=cos(spherical.y);vec3 pos=vec3(sin(spherical.x)*len,sin(spherical.y),cos(spherical.x)*len
|
|
);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}`),background:Ne(`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:Ne(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,"uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Ne(`in vec3 v_data;in float v_visibility;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define mediump float radius
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define highp vec4 stroke_color
|
|
#pragma mapbox: define mediump float stroke_width
|
|
#pragma mapbox: define lowp float stroke_opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize mediump float radius
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize highp vec4 stroke_color
|
|
#pragma mapbox: initialize mediump float stroke_width
|
|
#pragma mapbox: initialize lowp float stroke_opacity
|
|
vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;}
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;in vec2 a_pos;out vec3 v_data;out float v_visibility;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define mediump float radius
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define highp vec4 stroke_color
|
|
#pragma mapbox: define mediump float stroke_width
|
|
#pragma mapbox: define lowp float stroke_opacity
|
|
void main(void) {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize mediump float radius
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize highp vec4 stroke_color
|
|
#pragma mapbox: initialize mediump float stroke_width
|
|
#pragma mapbox: initialize lowp float stroke_opacity
|
|
vec2 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) {
|
|
#ifdef GLOBE
|
|
vec3 center_vector=projectToSphere(circle_center);
|
|
#endif
|
|
float angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else {
|
|
#ifdef GLOBE
|
|
vec4 projected_center=interpolateProjection(circle_center,center_vector,ele);
|
|
#else
|
|
vec4 projected_center=projectTileWithElevation(circle_center,ele);
|
|
#endif
|
|
corner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);}
|
|
#ifdef GLOBE
|
|
vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);
|
|
#else
|
|
gl_Position=projectTileWithElevation(corner_position,ele);
|
|
#endif
|
|
} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Ne(ai,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:Ne(`uniform highp float u_intensity;in vec2 v_extrude;
|
|
#pragma mapbox: define highp float weight
|
|
#define GAUSS_COEF 0.3989422804014327
|
|
void main() {
|
|
#pragma mapbox: initialize highp float weight
|
|
float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;in vec2 a_pos;out vec2 v_extrude;
|
|
#pragma mapbox: define highp float weight
|
|
#pragma mapbox: define mediump float radius
|
|
const highp float ZERO=1.0/255.0/16.0;
|
|
#define GAUSS_COEF 0.3989422804014327
|
|
void main(void) {
|
|
#pragma mapbox: initialize highp float weight
|
|
#pragma mapbox: initialize mediump float radius
|
|
vec2 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 circle_center=floor(pos_raw/8.0);
|
|
#ifdef GLOBE
|
|
vec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0);
|
|
#else
|
|
gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));
|
|
#endif
|
|
}`),heatmapTexture:Ne(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(0.0);
|
|
#endif
|
|
}`,"uniform mat4 u_matrix;uniform vec2 u_world;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Ne("in float v_placed;in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}","in vec2 a_anchor_pos;in vec2 a_placed;in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;out float v_placed;out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Ne("in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);fragColor=color*alpha*opacity_t;}","in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),colorRelief:Ne(`#ifdef GL_ES
|
|
precision highp float;
|
|
#endif
|
|
uniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(u_color_ramp_size);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else
|
|
{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0));
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,"uniform vec2 u_dimension;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),debug:Ne("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}","in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}"),depth:Ne(ai,`in vec2 a_pos;void main() {
|
|
#ifdef GLOBE
|
|
gl_Position=projectTileFor3D(a_pos,0.0);
|
|
#else
|
|
gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);
|
|
#endif
|
|
}`),fill:Ne(`#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
fragColor=color*opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform vec2 u_fill_translate;in vec2 a_pos;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
gl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:Ne(`in vec2 v_pos;
|
|
#ifdef GLOBE
|
|
in float v_depth;
|
|
#endif
|
|
#pragma mapbox: define highp vec4 outline_color
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 outline_color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);
|
|
#ifdef GLOBE
|
|
if (v_depth > 1.0) {discard;}
|
|
#endif
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;
|
|
#ifdef GLOBE
|
|
out float v_depth;
|
|
#endif
|
|
#pragma mapbox: define highp vec4 outline_color
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 outline_color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
|
|
#ifdef GLOBE
|
|
v_depth=gl_Position.z/gl_Position.w;
|
|
#endif
|
|
}`),fillOutlinePattern:Ne(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos;
|
|
#ifdef GLOBE
|
|
in float v_depth;
|
|
#endif
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity;
|
|
#ifdef GLOBE
|
|
if (v_depth > 1.0) {discard;}
|
|
#endif
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos;
|
|
#ifdef GLOBE
|
|
out float v_depth;
|
|
#endif
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
|
|
#ifdef GLOBE
|
|
v_depth=gl_Position.z/gl_Position.w;
|
|
#endif
|
|
}`),fillPattern:Ne(`#ifdef GL_ES
|
|
precision highp float;
|
|
#endif
|
|
uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Ne(`in vec4 v_color;void main() {fragColor=v_color;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;in vec2 a_pos;in vec4 a_normal_ed;
|
|
#ifdef TERRAIN3D
|
|
in vec2 a_centroid;
|
|
#endif
|
|
out vec4 v_color;
|
|
#pragma mapbox: define highp float base
|
|
#pragma mapbox: define highp float height
|
|
#pragma mapbox: define highp vec4 color
|
|
void main() {
|
|
#pragma mapbox: initialize highp float base
|
|
#pragma mapbox: initialize highp float height
|
|
#pragma mapbox: initialize highp vec4 color
|
|
vec3 normal=a_normal_ed.xyz;
|
|
#ifdef TERRAIN3D
|
|
float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
|
|
#else
|
|
float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
|
|
#endif
|
|
base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;
|
|
#ifdef GLOBE
|
|
vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
|
|
#else
|
|
gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
|
|
#endif
|
|
float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);
|
|
#ifdef GLOBE
|
|
mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);
|
|
#endif
|
|
directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Ne(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting;
|
|
#pragma mapbox: define lowp float base
|
|
#pragma mapbox: define lowp float height
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float base
|
|
#pragma mapbox: initialize lowp float height
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;in vec2 a_pos;in vec4 a_normal_ed;
|
|
#ifdef TERRAIN3D
|
|
in vec2 a_centroid;
|
|
#endif
|
|
#ifdef GLOBE
|
|
out vec3 v_sphere_pos;
|
|
#endif
|
|
out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;
|
|
#pragma mapbox: define lowp float base
|
|
#pragma mapbox: define lowp float height
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float base
|
|
#pragma mapbox: initialize lowp float height
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;
|
|
#ifdef TERRAIN3D
|
|
float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
|
|
#else
|
|
float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
|
|
#endif
|
|
base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;
|
|
#ifdef GLOBE
|
|
vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
|
|
#else
|
|
gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
|
|
#endif
|
|
vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
|
|
? a_pos
|
|
: vec2(edgedistance,elevation*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Ne(`#ifdef GL_ES
|
|
precision highp float;
|
|
#endif
|
|
uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))*tileSize/pow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:Ne(`uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES];
|
|
#define PI 3.141592653589793
|
|
#define STANDARD 0
|
|
#define COMBINED 1
|
|
#define IGOR 2
|
|
#define MULTIDIRECTIONAL 3
|
|
#define BASIC 4
|
|
float get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else
|
|
{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else
|
|
{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);}
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,"uniform mat4 u_matrix;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),line:Ne(`uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;
|
|
#ifdef GLOBE
|
|
in float v_depth;
|
|
#endif
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);fragColor=color*(alpha*opacity);
|
|
#ifdef GLOBE
|
|
if (v_depth > 1.0) {discard;}
|
|
#endif
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`
|
|
#define scale 0.015873016
|
|
in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar;
|
|
#ifdef GLOBE
|
|
out float v_depth;
|
|
#endif
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define mediump float gapwidth
|
|
#pragma mapbox: define lowp float offset
|
|
#pragma mapbox: define mediump float width
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
#pragma mapbox: initialize lowp float offset
|
|
#pragma mapbox: initialize mediump float width
|
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
|
|
#ifdef GLOBE
|
|
v_depth=gl_Position.z/gl_Position.w;
|
|
#endif
|
|
#ifdef TERRAIN3D
|
|
v_gamma_scale=1.0;
|
|
#else
|
|
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
|
#endif
|
|
v_width2=vec2(outset,inset);}`),lineGradient:Ne(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv;
|
|
#ifdef GLOBE
|
|
in float v_depth;
|
|
#endif
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity);
|
|
#ifdef GLOBE
|
|
if (v_depth > 1.0) {discard;}
|
|
#endif
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`
|
|
#define scale 0.015873016
|
|
in vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;
|
|
#ifdef GLOBE
|
|
out float v_depth;
|
|
#endif
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define mediump float gapwidth
|
|
#pragma mapbox: define lowp float offset
|
|
#pragma mapbox: define mediump float width
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
#pragma mapbox: initialize lowp float offset
|
|
#pragma mapbox: initialize mediump float width
|
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
|
|
#ifdef GLOBE
|
|
v_depth=gl_Position.z/gl_Position.w;
|
|
#endif
|
|
#ifdef TERRAIN3D
|
|
v_gamma_scale=1.0;
|
|
#else
|
|
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
|
#endif
|
|
v_width2=vec2(outset,inset);}`),linePattern:Ne(`#ifdef GL_ES
|
|
precision highp float;
|
|
#endif
|
|
uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width;
|
|
#ifdef GLOBE
|
|
in float v_depth;
|
|
#endif
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity;
|
|
#ifdef GLOBE
|
|
if (v_depth > 1.0) {discard;}
|
|
#endif
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`
|
|
#define scale 0.015873016
|
|
#define LINE_DISTANCE_SCALE 2.0
|
|
in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width;
|
|
#ifdef GLOBE
|
|
out float v_depth;
|
|
#endif
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp float offset
|
|
#pragma mapbox: define mediump float gapwidth
|
|
#pragma mapbox: define mediump float width
|
|
#pragma mapbox: define lowp float floorwidth
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize lowp float offset
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
#pragma mapbox: initialize mediump float width
|
|
#pragma mapbox: initialize lowp float floorwidth
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
|
|
#ifdef GLOBE
|
|
v_depth=gl_Position.z/gl_Position.w;
|
|
#endif
|
|
#ifdef TERRAIN3D
|
|
v_gamma_scale=1.0;
|
|
#else
|
|
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
|
#endif
|
|
v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Ne(`uniform lowp float u_device_pixel_ratio;uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;
|
|
#ifdef GLOBE
|
|
in float v_depth;
|
|
#endif
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define mediump float width
|
|
#pragma mapbox: define lowp float floorwidth
|
|
#pragma mapbox: define mediump vec4 dasharray_from
|
|
#pragma mapbox: define mediump vec4 dasharray_to
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump float width
|
|
#pragma mapbox: initialize lowp float floorwidth
|
|
#pragma mapbox: initialize mediump vec4 dasharray_from
|
|
#pragma mapbox: initialize mediump vec4 dasharray_to
|
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0/u_device_pixel_ratio)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity);
|
|
#ifdef GLOBE
|
|
if (v_depth > 1.0) {discard;}
|
|
#endif
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`
|
|
#define scale 0.015873016
|
|
#define LINE_DISTANCE_SCALE 2.0
|
|
in vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;
|
|
#ifdef GLOBE
|
|
out float v_depth;
|
|
#endif
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define mediump float gapwidth
|
|
#pragma mapbox: define lowp float offset
|
|
#pragma mapbox: define mediump float width
|
|
#pragma mapbox: define lowp float floorwidth
|
|
#pragma mapbox: define mediump vec4 dasharray_from
|
|
#pragma mapbox: define mediump vec4 dasharray_to
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
#pragma mapbox: initialize lowp float offset
|
|
#pragma mapbox: initialize mediump float width
|
|
#pragma mapbox: initialize lowp float floorwidth
|
|
#pragma mapbox: initialize mediump vec4 dasharray_from
|
|
#pragma mapbox: initialize mediump vec4 dasharray_to
|
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
|
|
#ifdef GLOBE
|
|
v_depth=gl_Position.z/gl_Position.w;
|
|
#endif
|
|
#ifdef TERRAIN3D
|
|
v_gamma_scale=1.0;
|
|
#else
|
|
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
|
#endif
|
|
float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),lineGradientSDF:Ne(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv;
|
|
#ifdef GLOBE
|
|
in float v_depth;
|
|
#endif
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define mediump float width
|
|
#pragma mapbox: define lowp float floorwidth
|
|
#pragma mapbox: define mediump vec4 dasharray_from
|
|
#pragma mapbox: define mediump vec4 dasharray_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump float width
|
|
#pragma mapbox: initialize lowp float floorwidth
|
|
#pragma mapbox: initialize mediump vec4 dasharray_from
|
|
#pragma mapbox: initialize mediump vec4 dasharray_to
|
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity);
|
|
#ifdef GLOBE
|
|
if (v_depth > 1.0) {discard;}
|
|
#endif
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`
|
|
#define scale 0.015873016
|
|
#define LINE_DISTANCE_SCALE 2.0
|
|
in vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b;
|
|
#ifdef GLOBE
|
|
out float v_depth;
|
|
#endif
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define mediump float gapwidth
|
|
#pragma mapbox: define lowp float offset
|
|
#pragma mapbox: define mediump float width
|
|
#pragma mapbox: define lowp float floorwidth
|
|
#pragma mapbox: define mediump vec4 dasharray_from
|
|
#pragma mapbox: define mediump vec4 dasharray_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
#pragma mapbox: initialize lowp float offset
|
|
#pragma mapbox: initialize mediump float width
|
|
#pragma mapbox: initialize lowp float floorwidth
|
|
#pragma mapbox: initialize mediump vec4 dasharray_from
|
|
#pragma mapbox: initialize mediump vec4 dasharray_to
|
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;float texel_height=1.0/u_image_height;float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;
|
|
#ifdef GLOBE
|
|
v_depth=gl_Position.z/gl_Position.w;
|
|
#endif
|
|
#ifdef TERRAIN3D
|
|
v_gamma_scale=1.0;
|
|
#else
|
|
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
|
|
#endif
|
|
float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),raster:Ne(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec2 v_pos0;in vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture(u_image0,v_pos0);vec4 color1=texture(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5;
|
|
#ifdef GLOBE
|
|
if (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}
|
|
#endif
|
|
v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),symbolIcon:Ne(`uniform sampler2D u_texture;in vec2 v_tex;in float v_total_opacity;void main() {fragColor=texture(u_texture,v_tex)*v_total_opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_tex;out float v_total_opacity;
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_total_opacity=opacity*max(0.0,min(visibility,fade_opacity[0]+fade_change));if (v_total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;
|
|
#ifdef GLOBE
|
|
if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}
|
|
#endif
|
|
vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;}`),symbolSDF:Ne(`#define SDF_PX 8.0
|
|
uniform bool u_is_halo;uniform bool u_is_plain;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1;
|
|
#pragma mapbox: define highp vec4 fill_color
|
|
#pragma mapbox: define highp vec4 halo_color
|
|
#pragma mapbox: define lowp float halo_width
|
|
#pragma mapbox: define lowp float halo_blur
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 fill_color
|
|
#pragma mapbox: initialize highp vec4 halo_color
|
|
#pragma mapbox: initialize lowp float halo_width
|
|
#pragma mapbox: initialize lowp float halo_blur
|
|
float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float total_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out_text,color_alpha_out_halo;if (u_is_plain){highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);color_alpha_out_text=total_opacity*alpha*fill_color;}if (u_is_halo) {float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);float inner_edge_halo=inner_edge+gamma_halo*gamma_scale;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(inner_edge_halo-gamma_scaled_halo,inner_edge_halo+gamma_scaled_halo,dist);highp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha_halo= min(smoothstep(halo_edge-gamma_scaled_halo,halo_edge+gamma_scaled_halo,dist),1.0-alpha_halo);color_alpha_out_halo=total_opacity*alpha_halo*halo_color;}if (u_is_plain && u_is_halo) {fragColor=color_alpha_out_text+(1.-color_alpha_out_text.a)*color_alpha_out_halo;} else if (u_is_halo){fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out_text;}
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_data0;out vec3 v_data1;
|
|
#pragma mapbox: define highp vec4 fill_color
|
|
#pragma mapbox: define highp vec4 halo_color
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp float halo_width
|
|
#pragma mapbox: define lowp float halo_blur
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 fill_color
|
|
#pragma mapbox: initialize highp vec4 halo_color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize lowp float halo_width
|
|
#pragma mapbox: initialize lowp float halo_blur
|
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy/16.0;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;
|
|
#ifdef GLOBE
|
|
if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}
|
|
#endif
|
|
vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,total_opacity);}`),symbolTextAndIcon:Ne(`#define SDF_PX 8.0
|
|
#define SDF 1.0
|
|
#define ICON 0.0
|
|
uniform bool u_is_halo;uniform bool u_is_text;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in vec4 v_data1;
|
|
#pragma mapbox: define highp vec4 fill_color
|
|
#pragma mapbox: define highp vec4 halo_color
|
|
#pragma mapbox: define lowp float halo_width
|
|
#pragma mapbox: define lowp float halo_blur
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 fill_color
|
|
#pragma mapbox: initialize highp vec4 halo_color
|
|
#pragma mapbox: initialize lowp float halo_width
|
|
#pragma mapbox: initialize lowp float halo_blur
|
|
float total_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;fragColor=texture(u_texture_icon,tex_icon)*total_opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out,color_alpha_out_halo;if (u_is_text) {highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);color_alpha_out=fill_color*(alpha*total_opacity);}if (u_is_halo) {highp float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);lowp float buff_halo=(6.0-halo_width/fontScale)/SDF_PX;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(buff_halo-gamma_scaled_halo,buff_halo+gamma_scaled_halo,dist);color_alpha_out_halo=halo_color*(alpha_halo*total_opacity);}if (u_is_text && u_is_halo) {fragColor=color_alpha_out+(1.-color_alpha_out.a)*color_alpha_out_halo;} else if (u_is_halo) {fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out;}
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
fragColor=vec4(1.0);
|
|
#endif
|
|
}`,`in vec4 a_pos_offset;in vec4 a_data;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec4 v_data0;out vec4 v_data1;
|
|
#pragma mapbox: define highp vec4 fill_color
|
|
#pragma mapbox: define highp vec4 halo_color
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp float halo_width
|
|
#pragma mapbox: define lowp float halo_blur
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 fill_color
|
|
#pragma mapbox: initialize highp vec4 halo_color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize lowp float halo_width
|
|
#pragma mapbox: initialize lowp float halo_blur
|
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;
|
|
#ifdef GLOBE
|
|
if(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}
|
|
#endif
|
|
vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,total_opacity,is_sdf);}`),terrain:Ne("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && u_fog_ground_blend_opacity > 0.0 && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}","in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:Ne("in float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {fragColor=pack(v_depth);}","in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:Ne("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);fragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","in vec3 a_pos3d;uniform float u_ele_delta;out vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}"),projectionErrorMeasurement:Ne("in vec4 v_output_error_encoded;void main() {fragColor=v_output_error_encoded;}","in vec2 a_pos;uniform highp float u_input;uniform highp float u_output_expected;out vec4 v_output_error_encoded;void main() {float real_output=2.0*atan(exp(PI-(u_input*PI*2.0)))-PI*0.5;float error=real_output-u_output_expected;float abs_error=abs(error)*128.0;v_output_error_encoded.x=min(floor(abs_error*256.0),255.0)/255.0;abs_error-=v_output_error_encoded.x;v_output_error_encoded.y=min(floor(abs_error*65536.0),255.0)/255.0;abs_error-=v_output_error_encoded.x/255.0;v_output_error_encoded.z=min(floor(abs_error*16777216.0),255.0)/255.0;v_output_error_encoded.w=error >=0.0 ? 1.0 : 0.0;gl_Position=vec4(a_pos,0.0,1.0);}"),atmosphere:Ne(`#ifdef GL_ES
|
|
precision highp float;
|
|
#endif
|
|
in vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758
|
|
);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}`,"in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:Ne("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function Ne(d,t){let n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,A=t.match(/in ([\w]+) ([\w]+)/g),l=d.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),g=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),B=g?g.concat(l):l,y={};return{fragmentSource:d=d.replace(n,((C,E,I,b,F)=>(y[F]=!0,E==="define"?`
|
|
#ifndef HAS_UNIFORM_u_${F}
|
|
in ${I} ${b} ${F};
|
|
#else
|
|
uniform ${I} ${b} u_${F};
|
|
#endif
|
|
`:`
|
|
#ifdef HAS_UNIFORM_u_${F}
|
|
${I} ${b} ${F} = u_${F};
|
|
#endif
|
|
`))),vertexSource:t=t.replace(n,((C,E,I,b,F)=>{let T=b==="float"?"vec2":"vec4",P=F.match(/color/)?"color":T;return y[F]?E==="define"?`
|
|
#ifndef HAS_UNIFORM_u_${F}
|
|
uniform lowp float u_${F}_t;
|
|
in ${I} ${T} a_${F};
|
|
out ${I} ${b} ${F};
|
|
#else
|
|
uniform ${I} ${b} u_${F};
|
|
#endif
|
|
`:P==="vec4"?`
|
|
#ifndef HAS_UNIFORM_u_${F}
|
|
${F} = a_${F};
|
|
#else
|
|
${I} ${b} ${F} = u_${F};
|
|
#endif
|
|
`:`
|
|
#ifndef HAS_UNIFORM_u_${F}
|
|
${F} = unpack_mix_${P}(a_${F}, u_${F}_t);
|
|
#else
|
|
${I} ${b} ${F} = u_${F};
|
|
#endif
|
|
`:E==="define"?`
|
|
#ifndef HAS_UNIFORM_u_${F}
|
|
uniform lowp float u_${F}_t;
|
|
in ${I} ${T} a_${F};
|
|
#else
|
|
uniform ${I} ${b} u_${F};
|
|
#endif
|
|
`:P==="vec4"?`
|
|
#ifndef HAS_UNIFORM_u_${F}
|
|
${I} ${b} ${F} = a_${F};
|
|
#else
|
|
${I} ${b} ${F} = u_${F};
|
|
#endif
|
|
`:`
|
|
#ifndef HAS_UNIFORM_u_${F}
|
|
${I} ${b} ${F} = unpack_mix_${P}(a_${F}, u_${F}_t);
|
|
#else
|
|
${I} ${b} ${F} = u_${F};
|
|
#endif
|
|
`})),staticAttributes:A,staticUniforms:B}}class ft{constructor(t,n,A){this.vertexBuffer=t,this.indexBuffer=n,this.segments=A}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var Rr=c.aS([{name:"a_pos",type:"Int16",components:2}]);let mi="#define PROJECTION_MERCATOR",ki="mercator";class Bi{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return ki}get shaderDefine(){return mi}get shaderPreludeCode(){return Et.projectionMercator}get vertexShaderPreludeCode(){return Et.projectionMercator.vertexSource}get subdivisionGranularity(){return c.aT.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(t){}getMeshFromTileID(t,n,A,l,g){if(this._cachedMesh)return this._cachedMesh;let B=new c.aU;B.emplaceBack(0,0),B.emplaceBack(c.a6,0),B.emplaceBack(0,c.a6),B.emplaceBack(c.a6,c.a6);let y=t.createVertexBuffer(B,Rr.members),C=c.aV.simpleSegment(0,0,4,2),E=new c.aW;E.emplaceBack(1,0,2),E.emplaceBack(1,2,3);let I=t.createIndexBuffer(E);return this._cachedMesh=new ft(y,I,C),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(t){}}class Kn{constructor(t=0,n=0,A=0,l=0){if(isNaN(t)||t<0||isNaN(n)||n<0||isNaN(A)||A<0||isNaN(l)||l<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=n,this.left=A,this.right=l}interpolate(t,n,A){return n.top!=null&&t.top!=null&&(this.top=c.H.number(t.top,n.top,A)),n.bottom!=null&&t.bottom!=null&&(this.bottom=c.H.number(t.bottom,n.bottom,A)),n.left!=null&&t.left!=null&&(this.left=c.H.number(t.left,n.left,A)),n.right!=null&&t.right!=null&&(this.right=c.H.number(t.right,n.right,A)),this}getCenter(t,n){let A=c.al((this.left+t-this.right)/2,0,t),l=c.al((this.top+n-this.bottom)/2,0,n);return new c.P(A,l)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Kn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function Or(d,t){if(!d.renderWorldCopies||d.lngRange)return;let n=t.lng-d.center.lng;t.lng+=n>180?-360:n<-180?360:0}function kt(d){return Math.max(0,Math.floor(d))}class cn{constructor(t,n){var A;this.applyConstrain=(l,g)=>this._constrainOverride!==null?this._constrainOverride(l,g):this._callbacks.defaultConstrain(l,g),this._callbacks=t,this._tileSize=512,this._renderWorldCopies=(n==null?void 0:n.renderWorldCopies)===void 0||!!(n!=null&&n.renderWorldCopies),this._minZoom=(n==null?void 0:n.minZoom)||0,this._maxZoom=(n==null?void 0:n.maxZoom)||22,this._minPitch=(n==null?void 0:n.minPitch)==null?0:n==null?void 0:n.minPitch,this._maxPitch=(n==null?void 0:n.maxPitch)==null?60:n==null?void 0:n.maxPitch,this._constrainOverride=(A=n==null?void 0:n.constrainOverride)!==null&&A!==void 0?A:null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new c.W(0,0),this._elevation=0,this._zoom=0,this._tileZoom=kt(this._zoom),this._scale=c.ao(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new Kn,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(t,n,A){this._constrainOverride=t.constrainOverride,this._latRange=t.latRange,this._lngRange=t.lngRange,this._width=t.width,this._height=t.height,this._center=t.center,this._elevation=t.elevation,this._minElevationForCurrentTile=t.minElevationForCurrentTile,this._zoom=t.zoom,this._tileZoom=kt(this._zoom),this._scale=c.ao(this._zoom),this._bearingInRadians=t.bearingInRadians,this._fovInRadians=t.fovInRadians,this._pitchInRadians=t.pitchInRadians,this._rollInRadians=t.rollInRadians,this._unmodified=t.unmodified,this._edgeInsets=new Kn(t.padding.top,t.padding.bottom,t.padding.left,t.padding.right),this._minZoom=t.minZoom,this._maxZoom=t.maxZoom,this._minPitch=t.minPitch,this._maxPitch=t.maxPitch,this._renderWorldCopies=t.renderWorldCopies,this._cameraToCenterDistance=t.cameraToCenterDistance,this._nearZ=t.nearZ,this._farZ=t.farZ,this._autoCalculateNearFarZ=!A&&t.autoCalculateNearFarZ,n&&this.constrainInternal(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(t){this._minElevationForCurrentTile=t}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(t){this._minZoom!==t&&(this._minZoom=t,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(t){this._minPitch!==t&&(this._minPitch=t,this.setPitch(Math.max(this.pitch,t)))}get maxPitch(){return this._maxPitch}setMaxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.setPitch(Math.min(this.pitch,t)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get constrainOverride(){return this._constrainOverride}setConstrainOverride(t){t===void 0&&(t=null),this._constrainOverride!==t&&(this._constrainOverride=t,this.constrainInternal(),this._calcMatrices())}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new c.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(t){let n=c.X(t,-180,180)*Math.PI/180;var A,l,g,B,y,C,E,I,b;this._bearingInRadians!==n&&(this._unmodified=!1,this._bearingInRadians=n,this._calcMatrices(),this._rotationMatrix=Me(),A=this._rotationMatrix,g=-this._bearingInRadians,B=(l=this._rotationMatrix)[0],y=l[1],C=l[2],E=l[3],I=Math.sin(g),b=Math.cos(g),A[0]=B*b+C*I,A[1]=y*b+E*I,A[2]=B*-I+C*b,A[3]=y*-I+E*b)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(t){let n=c.al(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==n&&(this._unmodified=!1,this._pitchInRadians=n,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(t){let n=t/180*Math.PI;this._rollInRadians!==n&&(this._unmodified=!1,this._rollInRadians=n,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return c.aX(this._fovInRadians)}setFov(t){t=c.al(t,.1,150),this.fov!==t&&(this._unmodified=!1,this._fovInRadians=c.an(t),this._calcMatrices())}get zoom(){return this._zoom}setZoom(t){let n=this.applyConstrain(this._center,t).zoom;this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this._tileZoom=Math.max(0,Math.floor(n)),this._scale=c.ao(n),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(t){t!==this._elevation&&(this._elevation=t,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(t,n){this._autoCalculateNearFarZ=!1,this._nearZ=t,this._farZ=n,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,n,A){this._unmodified=!1,this._edgeInsets.interpolate(t,n,A),this.constrainInternal(),this._calcMatrices()}resize(t,n,A=!0){this._width=t,this._height=n,A&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){var t,n;return((t=this._latRange)===null||t===void 0?void 0:t.length)!==2||((n=this._lngRange)===null||n===void 0?void 0:n.length)!==2?null:new Oe([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]])}setMaxBounds(t){t?(this._lngRange=[t.getWest(),t.getEast()],this._latRange=[t.getSouth(),t.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-c.am,c.am])}getCameraQueryGeometry(t,n){if(n.length===1)return[n[0],t];{let{minX:A,minY:l,maxX:g,maxY:B}=c.a8.fromPoints(n).extend(t);return[new c.P(A,l),new c.P(g,l),new c.P(g,B),new c.P(A,B),new c.P(A,l)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;let t=this._unmodified,{center:n,zoom:A}=this.applyConstrain(this.center,this.zoom);this.setCenter(n),this.setZoom(A),this._unmodified=t,this._constraining=!1}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let t=c.ap(new Float64Array(16));c.S(t,t,[this._width/2,-this._height/2,1]),c.Q(t,t,[1,-1,0]),this._clipSpaceToPixelsMatrix=t,t=c.ap(new Float64Array(16)),c.S(t,t,[1,-1,1]),c.Q(t,t,[-1,-1,0]),c.S(t,t,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=t,this._cameraToCenterDistance=.5/Math.tan(this.fovInRadians/2)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(t,n,A,l){let g=A!==void 0?A:this.bearing,B=l=l!==void 0?l:this.pitch,{distanceToCenter:y,clampedElevation:C}=this._distanceToCenterFromAltElevationPitch(n,this.elevation,B),{x:E,y:I}=ys(B,g),b=c.a7.fromLngLat(t,n),F,T,P=c.aY(1,b.y),R=0;do{if(R+=1,R>10)break;T=y/P,F=new c.a7(b.x+E*T,b.y+I*T),P=1/F.meterInMercatorCoordinateUnits()}while(Math.abs(y-T*P)>1e-12);return{center:F.toLngLat(),elevation:C,zoom:c.ar(this.height/2/Math.tan(this.fovInRadians/2)/T/this.tileSize)}}recalculateZoomAndCenter(t){if(this.elevation-t==0)return;let n=1/this.worldSize,A=c.aq(1,this.center.lat)*this.worldSize,l=c.a7.fromLngLat(this.center,this.elevation),g=l.x/n,B=l.y/n,y=l.z/n,C=this.pitch,E=this.bearing,{x:I,y:b,z:F}=ys(C,E),T=this.cameraToCenterDistance,P=g+T*-I,R=B+T*-b,Y=y+T*F,{distanceToCenter:N,clampedElevation:K}=this._distanceToCenterFromAltElevationPitch(Y/A,t,C),H=N*A,j=new c.a7((P+I*H)*n,(R+b*H)*n,0).toLngLat(),z=c.aq(1,j.lat),Z=c.ar(this.height/2/Math.tan(this.fovInRadians/2)/N/z/this.tileSize);this._elevation=K,this._center=j,this.setZoom(Z)}_distanceToCenterFromAltElevationPitch(t,n,A){let l=-Math.cos(c.an(A)),g=t-n,B,y=n;return l*g>=0||Math.abs(l)<.1?(B=1e4,y=t+B*l):B=-g/l,{distanceToCenter:B,clampedElevation:y}}getCameraPoint(){let t=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new c.P(t*Math.sin(this.rollInRadians),t*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){let t=c.aq(1,this.center.lat)*this.worldSize;return Gn(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/t).toLngLat()}getMercatorTileCoordinates(t){if(!t)return[0,0,1,1];let n=t.canonical.z>=0?1<<t.canonical.z:Math.pow(2,t.canonical.z);return[t.canonical.x/n,t.canonical.y/n,1/n/c.a6,1/n/c.a6]}}class cr{constructor(t,n){this.min=t,this.max=n,this.center=c.aZ([],c.a_([],this.min,this.max),.5)}quadrant(t){let n=[t%2==0,t<2],A=c.a$(this.min),l=c.a$(this.max);for(let g=0;g<n.length;g++)A[g]=n[g]?this.min[g]:this.center[g],l[g]=n[g]?this.center[g]:this.max[g];return l[2]=this.max[2],new cr(A,l)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersectsFrustum(t){let n=!0;for(let A of t.planes){let l=this.intersectsPlane(A);if(l===0)return 0;l===1&&(n=!1)}return n?2:t.aabb.min[0]>this.max[0]||t.aabb.min[1]>this.max[1]||t.aabb.min[2]>this.max[2]||t.aabb.max[0]<this.min[0]||t.aabb.max[1]<this.min[1]||t.aabb.max[2]<this.min[2]?0:1}intersectsPlane(t){let n=t[3],A=t[3];for(let l=0;l<3;l++)t[l]>0?(n+=t[l]*this.min[l],A+=t[l]*this.max[l]):(A+=t[l]*this.min[l],n+=t[l]*this.max[l]);return n>=0?2:A<0?0:1}}class bs{distanceToTile2d(t,n,A,l){let g=l,B=g.distanceX([t,n]),y=g.distanceY([t,n]);return Math.hypot(B,y)}getWrap(t,n,A){return A}getTileBoundingVolume(t,n,A,l){var g,B;let y=0,C=0;if(l!=null&&l.terrain){let I=new c.a3(t.z,n,t.z,t.x,t.y),b=l.terrain.getMinMaxElevation(I);y=(g=b.minElevation)!==null&&g!==void 0?g:Math.min(0,A),C=(B=b.maxElevation)!==null&&B!==void 0?B:Math.max(0,A)}let E=1<<t.z;return new cr([n+t.x/E,t.y/E,y],[n+(t.x+1)/E,(t.y+1)/E,C])}allowVariableZoom(t,n){let A=t.fov*(Math.abs(Math.cos(t.rollInRadians))*t.height+Math.abs(Math.sin(t.rollInRadians))*t.width)/t.height,l=c.al(78.5-A/2,0,60);return!!n.terrain||t.pitch>l}allowWorldCopies(){return!0}prepareNextFrame(){}}class Di{constructor(t,n,A){this.points=t,this.planes=n,this.aabb=A}static fromInvProjectionMatrix(t,n=1,A=0,l,g){let B=g?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],y=Math.pow(2,A),C=[[-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]].map((F=>(function(T,P,R,Y){let N=c.aE([],T,P),K=1/N[3]/R*Y;return c.b4(N,N,[K,K,1/N[3],K])})(F,t,n,y)));l&&(function(F,T,P,R){let Y=R?4:0,N=R?0:4,K=0,H=[],j=[];for(let X=0;X<4;X++){let te=c.b0([],F[X+N],F[X+Y]),Ae=c.b5(te);c.aZ(te,te,1/Ae),H.push(Ae),j.push(te)}for(let X=0;X<4;X++){let te=c.b6(F[X+Y],j[X],P);K=te!==null&&te>=0?Math.max(K,te):Math.max(K,H[X])}let z=(function(X,te){let Ae=c.b0([],X[te[0]],X[te[1]]),ae=c.b0([],X[te[2]],X[te[1]]),Be=[0,0,0,0];return c.b1(Be,c.b2([],Ae,ae)),Be[3]=-c.b3(Be,X[te[0]]),Be})(F,T),Z=(function(X,te){let Ae=c.b7(X),ae=c.b8([],X,1/Ae),Be=c.b0([],te,c.aZ([],ae,c.b3(te,ae))),me=c.b7(Be);if(me>0){let Fe=Math.sqrt(1-ae[3]*ae[3]),Ie=c.aZ([],ae,-ae[3]),ge=c.a_([],Ie,c.aZ([],Be,Fe/me));return c.b9(te,ge)}return null})(P,z);if(Z!==null){let X=Z/c.b3(j[0],z);K=Math.min(K,X)}for(let X=0;X<4;X++){let te=Math.min(K,H[X]);F[X+N]=[F[X+Y][0]+j[X][0]*te,F[X+Y][1]+j[X][1]*te,F[X+Y][2]+j[X][2]*te,1]}})(C,B[0],l,g);let E=B.map((F=>{let T=c.b0([],C[F[0]],C[F[1]]),P=c.b0([],C[F[2]],C[F[1]]),R=c.b1([],c.b2([],T,P)),Y=-c.b3(R,C[F[1]]);return R.concat(Y)})),I=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],b=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(let F of C)for(let T=0;T<3;T++)I[T]=Math.min(I[T],F[T]),b[T]=Math.max(b[T],F[T]);return new Di(C,E,new cr(I,b))}}class hn{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,n,A){this._helper.interpolatePadding(t,n,A)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,n,A=!0){this._helper.resize(t,n,A)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,n){this._helper.overrideNearFarZ(t,n)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t,n){}constructor(t){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this.defaultConstrain=(n,A)=>{A=c.al(+A,this.minZoom,this.maxZoom);let l={center:new c.W(n.lng,n.lat),zoom:A},g=this._helper._lngRange;if(!this._helper._renderWorldCopies&&g===null){let j=179.9999999999;g=[-j,j]}let B=this.tileSize*c.ao(l.zoom),y=0,C=B,E=0,I=B,b=0,F=0,{x:T,y:P}=this.size;if(this._helper._latRange){let j=this._helper._latRange;y=c.Y(j[1])*B,C=c.Y(j[0])*B,C-y<P&&(b=P/(C-y))}g&&(E=c.X(c.Z(g[0])*B,0,B),I=c.X(c.Z(g[1])*B,0,B),I<E&&(I+=B),I-E<T&&(F=T/(I-E)));let{x:R,y:Y}=ir(B,n),N,K,H=Math.max(F||0,b||0);if(H){let j=new c.P(F?(I+E)/2:R,b?(C+y)/2:Y);return l.center=Pn(B,j).wrap(),l.zoom+=c.ar(H),l}if(this._helper._latRange){let j=P/2;Y-j<y&&(K=y+j),Y+j>C&&(K=C-j)}if(g){let j=(E+I)/2,z=R;this._helper._renderWorldCopies&&(z=c.X(R,j-B/2,j+B/2));let Z=T/2;z-Z<E&&(N=E+Z),z+Z>I&&(N=I-Z)}if(N!==void 0||K!==void 0){let j=new c.P(N!=null?N:R,K!=null?K:Y);l.center=Pn(B,j).wrap()}return l},this.applyConstrain=(n,A)=>this._helper.applyConstrain(n,A),this._helper=new cn({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(n,A)=>this.defaultConstrain(n,A)},t),this._coveringTilesDetailsProvider=new bs}clone(){let t=new hn;return t.apply(this,!1),t}apply(t,n,A){this._helper.apply(t,n,A)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(t){let n=[new c.ba(0,t)];if(this._helper._renderWorldCopies){let A=this.screenPointToMercatorCoordinate(new c.P(0,0)),l=this.screenPointToMercatorCoordinate(new c.P(this._helper._width,0)),g=this.screenPointToMercatorCoordinate(new c.P(this._helper._width,this._helper._height)),B=this.screenPointToMercatorCoordinate(new c.P(0,this._helper._height)),y=Math.floor(Math.min(A.x,l.x,g.x,B.x)),C=Math.floor(Math.max(A.x,l.x,g.x,B.x)),E=1;for(let I=y-E;I<=C+E;I++)I!==0&&n.push(new c.ba(I,t))}return n}getCameraFrustum(){return Di.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){let n=this.screenPointToLocation(this.centerPoint,t),A=t?t.getElevationForLngLatZoom(n,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(A)}setLocationAtPoint(t,n){let A=c.aq(this.elevation,this.center.lat),l=this.screenPointToMercatorCoordinateAtZ(n,A),g=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,A),B=c.a7.fromLngLat(t),y=new c.a7(B.x-(l.x-g.x),B.y-(l.y-g.y));this.setCenter(y==null?void 0:y.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(t,n){return n?this.coordinatePoint(c.a7.fromLngLat(t),n.getElevationForLngLat(t,this),this._pixelMatrix3D):this.coordinatePoint(c.a7.fromLngLat(t))}screenPointToLocation(t,n){var A;return(A=this.screenPointToMercatorCoordinate(t,n))===null||A===void 0?void 0:A.toLngLat()}screenPointToMercatorCoordinate(t,n){if(n){let A=n.pointCoordinate(t);if(A!=null)return A}return this.screenPointToMercatorCoordinateAtZ(t)}screenPointToMercatorCoordinateAtZ(t,n){let A=n||0,l=[t.x,t.y,0,1],g=[t.x,t.y,1,1];c.aE(l,l,this._pixelMatrixInverse),c.aE(g,g,this._pixelMatrixInverse);let B=l[3],y=g[3],C=l[1]/B,E=g[1]/y,I=l[2]/B,b=g[2]/y,F=I===b?0:(A-I)/(b-I);return new c.a7(c.H.number(l[0]/B,g[0]/y,F)/this.worldSize,c.H.number(C,E,F)/this.worldSize,A)}coordinatePoint(t,n=0,A=this._pixelMatrix){let l=[t.x*this.worldSize,t.y*this.worldSize,n,1];return c.aE(l,l,A),new c.P(l[0]/l[3],l[1]/l[3])}getBounds(){let t=Math.max(0,this._helper._height/2-on(this));return new Oe().extend(this.screenPointToLocation(new c.P(0,t))).extend(this.screenPointToLocation(new c.P(this._helper._width,t))).extend(this.screenPointToLocation(new c.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new c.P(0,this._helper._height)))}isPointOnMapSurface(t,n){return n?n.pointCoordinate(t)!=null:t.y>this.height/2-on(this)}calculatePosMatrix(t,n=!1,A){var l;let g=(l=t.key)!==null&&l!==void 0?l:c.bb(t.wrap,t.canonical.z,t.canonical.z,t.canonical.x,t.canonical.y),B=n?this._alignedPosMatrixCache:this._posMatrixCache;if(B.has(g)){let E=B.get(g);return A?E.f32:E.f64}let y=xo(t,this.worldSize);c.U(y,n?this._alignedProjMatrix:this._viewProjMatrix,y);let C={f64:y,f32:new Float32Array(y)};return B.set(g,C),A?C.f32:C.f64}calculateFogMatrix(t){let n=t.key,A=this._fogMatrixCacheF32;if(A.has(n))return A.get(n);let l=xo(t,this.worldSize);return c.U(l,this._fogMatrix,l),A.set(n,new Float32Array(l)),A.get(n)}calculateCenterFromCameraLngLatAlt(t,n,A,l){return this._helper.calculateCenterFromCameraLngLatAlt(t,n,A,l)}_calculateNearFarZIfNeeded(t,n,A){if(!this._helper.autoCalculateNearFarZ)return;let l=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),g=t-l*this._helper._pixelPerMeter/Math.cos(n),B=l<0?g:t,y=Math.PI/2+this.pitchInRadians,C=c.an(this.fov)*(Math.abs(Math.cos(c.an(this.roll)))*this.height+Math.abs(Math.sin(c.an(this.roll)))*this.width)/this.height*(.5+A.y/this.height),E=Math.sin(C)*B/Math.sin(c.al(Math.PI-y-C,.01,Math.PI-.01)),I=on(this),b=Math.atan(I/this._helper.cameraToCenterDistance),F=c.an(.75),T=b>F?2*b*(.5+A.y/(2*I)):F,P=Math.sin(T)*B/Math.sin(c.al(Math.PI-y-T,.01,Math.PI-.01)),R=Math.min(E,P);this._helper._farZ=1.01*(Math.cos(Math.PI/2-n)*R+B),this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;let t=this.centerOffset,n=ir(this.worldSize,this.center),A=n.x,l=n.y;this._helper._pixelPerMeter=c.aq(1,this.center.lat)*this.worldSize;let g=c.an(Math.min(this.pitch,nn)),B=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(g)),y;var C,E;this._calculateNearFarZIfNeeded(B,g,t),y=new Float64Array(16),c.bc(y,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),(C=this._invProjMatrix)[0]=1/(E=y)[0],C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=1/E[5],C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=0,C[11]=1/E[14],C[12]=0,C[13]=0,C[14]=-1,C[15]=E[10]/E[14],y[8]=2*-t.x/this._helper._width,y[9]=2*t.y/this._helper._height,this._projectionMatrix=c.bd(y),c.S(y,y,[1,-1,1]),c.Q(y,y,[0,0,-this._helper.cameraToCenterDistance]),c.be(y,y,-this.rollInRadians),c.bf(y,y,this.pitchInRadians),c.be(y,y,-this.bearingInRadians),c.Q(y,y,[-A,-l,0]),this._mercatorMatrix=c.S([],y,[this.worldSize,this.worldSize,this.worldSize]),c.S(y,y,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=c.U(new Float64Array(16),this.clipSpaceToPixelsMatrix,y),c.Q(y,y,[0,0,-this.elevation]),this._viewProjMatrix=y,this._invViewProjMatrix=c.bg([],y);let I=[0,0,-1,1];c.aE(I,I,this._invViewProjMatrix),this._cameraPosition=[I[0]/I[3],I[1]/I[3],I[2]/I[3]],this._fogMatrix=new Float64Array(16),c.bc(this._fogMatrix,this.fovInRadians,this.width/this.height,B,this._helper._farZ),this._fogMatrix[8]=2*-t.x/this.width,this._fogMatrix[9]=2*t.y/this.height,c.S(this._fogMatrix,this._fogMatrix,[1,-1,1]),c.Q(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),c.be(this._fogMatrix,this._fogMatrix,-this.rollInRadians),c.bf(this._fogMatrix,this._fogMatrix,this.pitchInRadians),c.be(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),c.Q(this._fogMatrix,this._fogMatrix,[-A,-l,0]),c.S(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),c.Q(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=c.U(new Float64Array(16),this.clipSpaceToPixelsMatrix,y);let b=this._helper._width%2/2,F=this._helper._height%2/2,T=Math.cos(this.bearingInRadians),P=Math.sin(-this.bearingInRadians),R=A-Math.round(A)+T*b+P*F,Y=l-Math.round(l)+T*F+P*b,N=new Float64Array(y);if(c.Q(N,N,[R>.5?R-1:R,Y>.5?Y-1:Y,0]),this._alignedProjMatrix=N,y=c.bg(new Float64Array(16),this._pixelMatrix),!y)throw new Error("failed to invert matrix");this._pixelMatrixInverse=y,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;let t=this.screenPointToMercatorCoordinate(new c.P(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return c.aE(n,n,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){let t=c.aq(1,this.center.lat)*this.worldSize;return Gn(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/t).toLngLat()}lngLatToCameraDepth(t,n){let A=c.a7.fromLngLat(t),l=[A.x*this.worldSize,A.y*this.worldSize,n,1];return c.aE(l,l,this._viewProjMatrix),l[2]/l[3]}getProjectionData(t){let{overscaledTileID:n,aligned:A,applyTerrainMatrix:l}=t,g=this._helper.getMercatorTileCoordinates(n),B=n?this.calculatePosMatrix(n,A,!0):null,y;return y=n!=null&&n.terrainRttPosMatrix32f&&l?n.terrainRttPosMatrix32f:B||c.bh(),{mainMatrix:y,tileMercatorCoords:g,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:y}}isLocationOccluded(t){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(t,n,A){return 1}transformLightDirection(t){return c.a$(t)}getRayDirectionFromPixel(t){throw new Error("Not implemented.")}projectTileCoordinates(t,n,A,l){let g=this.calculatePosMatrix(A),B;l?(B=[t,n,l(t,n),1],c.aE(B,B,g)):(B=[t,n,0,1],Is(B,B,g));let y=B[3];return{point:new c.P(B[0]/y,B[1]/y),signedDistanceFromCamera:y,isOccluded:!1}}populateCache(t){for(let n of t)this.calculatePosMatrix(n)}getMatrixForModel(t,n){let A=c.a7.fromLngLat(t,n),l=A.meterInMercatorCoordinateUnits(),g=c.bi();return c.Q(g,g,[A.x,A.y,A.z]),c.be(g,g,Math.PI),c.bf(g,g,Math.PI/2),c.S(g,g,[-l,l,l]),g}getProjectionDataForCustomLayer(t=!0){let n=new c.a3(0,0,0,0,0),A=this.getProjectionData({overscaledTileID:n,applyGlobeMatrix:t}),l=xo(n,this.worldSize);c.U(l,this._viewProjMatrix,l),A.tileMercatorCoords=[0,0,1,1];let g=[c.a6,c.a6,this.worldSize/this._helper.pixelsPerMeter],B=c.bj();return c.S(B,l,g),A.fallbackMatrix=B,A.mainMatrix=B,A}getFastPathSimpleProjectionMatrix(t){return this.calculatePosMatrix(t)}}function _r(){c.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function xl(d){if(d.useSlerp)if(d.k<1){let t=c.bk(d.startEulerAngles.roll,d.startEulerAngles.pitch,d.startEulerAngles.bearing),n=c.bk(d.endEulerAngles.roll,d.endEulerAngles.pitch,d.endEulerAngles.bearing),A=new Float64Array(4);c.bl(A,t,n,d.k);let l=c.bm(A);d.tr.setRoll(l.roll),d.tr.setPitch(l.pitch),d.tr.setBearing(l.bearing)}else d.tr.setRoll(d.endEulerAngles.roll),d.tr.setPitch(d.endEulerAngles.pitch),d.tr.setBearing(d.endEulerAngles.bearing);else d.tr.setRoll(c.H.number(d.startEulerAngles.roll,d.endEulerAngles.roll,d.k)),d.tr.setPitch(c.H.number(d.startEulerAngles.pitch,d.endEulerAngles.pitch,d.k)),d.tr.setBearing(c.H.number(d.startEulerAngles.bearing,d.endEulerAngles.bearing,d.k))}function ea(d,t,n,A,l){let g=l.padding,B=ir(l.worldSize,n.getNorthWest()),y=ir(l.worldSize,n.getNorthEast()),C=ir(l.worldSize,n.getSouthEast()),E=ir(l.worldSize,n.getSouthWest()),I=c.an(-A),b=B.rotate(I),F=y.rotate(I),T=C.rotate(I),P=E.rotate(I),R=new c.P(Math.max(b.x,F.x,P.x,T.x),Math.max(b.y,F.y,P.y,T.y)),Y=new c.P(Math.min(b.x,F.x,P.x,T.x),Math.min(b.y,F.y,P.y,T.y)),N=R.sub(Y),K=(l.width-(g.left+g.right+t.left+t.right))/N.x,H=(l.height-(g.top+g.bottom+t.top+t.bottom))/N.y;if(H<0||K<0)return void _r();let j=Math.min(c.ar(l.scale*Math.min(K,H)),d.maxZoom),z=c.P.convert(d.offset),Z=new c.P((t.left-t.right)/2,(t.top-t.bottom)/2).rotate(c.an(A)),X=z.add(Z).mult(l.scale/c.ao(j));return{center:Pn(l.worldSize,B.add(C).div(2).sub(X)),zoom:j,bearing:A}}class un{get useGlobeControls(){return!1}handlePanInertia(t,n){let A=t.mag(),l=Math.abs(on(n));return{easingOffset:t.mult(Math.min(.75*l/A,1)),easingCenter:n.center}}handleMapControlsRollPitchBearingZoom(t,n){t.bearingDelta&&n.setBearing(n.bearing+t.bearingDelta),t.pitchDelta&&n.setPitch(n.pitch+t.pitchDelta),t.rollDelta&&n.setRoll(n.roll+t.rollDelta),t.zoomDelta&&n.setZoom(n.zoom+t.zoomDelta)}handleMapControlsPan(t,n,A){t.around.distSqr(n.centerPoint)<.01||n.setLocationAtPoint(A,t.around)}cameraForBoxAndBearing(t,n,A,l,g){return ea(t,n,A,l,g)}handleJumpToCenterZoom(t,n){t.zoom!==(n.zoom!==void 0?+n.zoom:t.zoom)&&t.setZoom(+n.zoom),n.center!==void 0&&t.setCenter(c.W.convert(n.center))}handleEaseTo(t,n){let A=t.zoom,l=t.padding,g={roll:t.roll,pitch:t.pitch,bearing:t.bearing},B={roll:n.roll===void 0?t.roll:n.roll,pitch:n.pitch===void 0?t.pitch:n.pitch,bearing:n.bearing===void 0?t.bearing:n.bearing},y=n.zoom!==void 0,C=!t.isPaddingEqual(n.padding),E=!1,I=y?+n.zoom:t.zoom,b=t.centerPoint.add(n.offsetAsPoint),F=t.screenPointToLocation(b),{center:T,zoom:P}=t.applyConstrain(c.W.convert(n.center||F),I!=null?I:A);Or(t,T);let R=ir(t.worldSize,F),Y=ir(t.worldSize,T).sub(R),N=c.ao(P-A);return E=P!==A,{easeFunc:K=>{if(E&&t.setZoom(c.H.number(A,P,K)),c.bn(g,B)||xl({startEulerAngles:g,endEulerAngles:B,tr:t,k:K,useSlerp:g.roll!=B.roll}),C&&(t.interpolatePadding(l,n.padding,K),b=t.centerPoint.add(n.offsetAsPoint)),n.around)t.setLocationAtPoint(n.around,n.aroundPoint);else{let H=c.ao(t.zoom-A),j=P>A?Math.min(2,N):Math.max(.5,N),z=Math.pow(j,1-K),Z=Pn(t.worldSize,R.add(Y.mult(K*z)).mult(H));t.setLocationAtPoint(t.renderWorldCopies?Z.wrap():Z,b)}},isZooming:E,elevationCenter:T}}handleFlyTo(t,n){let A=n.zoom!==void 0,l=t.zoom,g=t.applyConstrain(c.W.convert(n.center||n.locationAtOffset),A?+n.zoom:l),B=g.center,y=g.zoom;Or(t,B);let C=ir(t.worldSize,n.locationAtOffset),E=ir(t.worldSize,B).sub(C),I=E.mag(),b=c.ao(y-l),F;if(n.minZoom!==void 0){let T=Math.min(+n.minZoom,l,y),P=t.applyConstrain(B,T).zoom;F=c.ao(P-l)}return{easeFunc:(T,P,R,Y)=>{t.setZoom(T===1?y:l+c.ar(P));let N=T===1?B:Pn(t.worldSize,C.add(E.mult(R)).mult(P));t.setLocationAtPoint(t.renderWorldCopies?N.wrap():N,Y)},scaleOfZoom:b,targetCenter:B,scaleOfMinZoom:F,pixelPathLength:I}}}class mt{constructor(t,n,A){this.blendFunction=t,this.blendColor=n,this.mask=A}}mt.Replace=[1,0],mt.disabled=new mt(mt.Replace,c.bo.transparent,[!1,!1,!1,!1]),mt.unblended=new mt(mt.Replace,c.bo.transparent,[!0,!0,!0,!0]),mt.alphaBlended=new mt([1,771],c.bo.transparent,[!0,!0,!0,!0]);let jn=2305;class it{constructor(t,n,A){this.enable=t,this.mode=n,this.frontFace=A}}it.disabled=new it(!1,1029,jn),it.backCCW=new it(!0,1029,jn),it.frontCCW=new it(!0,1028,jn);class Xe{constructor(t,n,A){this.func=t,this.mask=n,this.range=A}}Xe.ReadOnly=!1,Xe.ReadWrite=!0,Xe.disabled=new Xe(519,Xe.ReadOnly,[0,1]);let Xn=7680;class ot{constructor(t,n,A,l,g,B){this.test=t,this.ref=n,this.mask=A,this.fail=l,this.depthFail=g,this.pass=B}}function nr(d){return typeof WebGL2RenderingContext!="undefined"&&d instanceof WebGL2RenderingContext}ot.disabled=new ot({func:519,mask:0},0,0,Xn,Xn,Xn);class Vn{get awaitingQuery(){return!!this._readbackQueue}constructor(t){this._readbackWaitFrames=4,this._measureWaitFrames=6,this._texWidth=1,this._texHeight=1,this._measuredError=0,this._updateCount=0,this._lastReadbackFrame=-1e3,this._readbackQueue=null,this._cachedRenderContext=t;let n=t.context,A=n.gl;this._texFormat=A.RGBA,this._texType=A.UNSIGNED_BYTE;let l=new c.aU;l.emplaceBack(-1,-1),l.emplaceBack(2,-1),l.emplaceBack(-1,2);let g=new c.aW;g.emplaceBack(0,1,2),this._fullscreenTriangle=new ft(n.createVertexBuffer(l,Rr.members),n.createIndexBuffer(g),c.aV.simpleSegment(0,0,l.length,g.length)),this._resultBuffer=new Uint8Array(4),n.activeTexture.set(A.TEXTURE1);let B=A.createTexture();A.bindTexture(A.TEXTURE_2D,B),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MIN_FILTER,A.NEAREST),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MAG_FILTER,A.NEAREST),A.texImage2D(A.TEXTURE_2D,0,this._texFormat,this._texWidth,this._texHeight,0,this._texFormat,this._texType,null),this._fbo=n.createFramebuffer(this._texWidth,this._texHeight,!1,!1),this._fbo.colorAttachment.set(B),nr(A)&&(this._pbo=A.createBuffer(),A.bindBuffer(A.PIXEL_PACK_BUFFER,this._pbo),A.bufferData(A.PIXEL_PACK_BUFFER,4,A.STREAM_READ),A.bindBuffer(A.PIXEL_PACK_BUFFER,null))}destroy(){let t=this._cachedRenderContext.context.gl;this._fullscreenTriangle.destroy(),this._fbo.destroy(),t.deleteBuffer(this._pbo),this._fullscreenTriangle=null,this._fbo=null,this._pbo=null,this._resultBuffer=null}updateErrorLoop(t,n){let A=this._updateCount;return this._readbackQueue?A>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():A>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(t,n),this._updateCount++,this._measuredError}_bindFramebuffer(){let t=this._cachedRenderContext.context,n=t.gl;t.activeTexture.set(n.TEXTURE1),n.bindTexture(n.TEXTURE_2D,this._fbo.colorAttachment.get()),t.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(t,n){let A=this._cachedRenderContext.context,l=A.gl;if(this._bindFramebuffer(),A.viewport.set([0,0,this._texWidth,this._texHeight]),A.clear({color:c.bo.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(A,l.TRIANGLES,Xe.disabled,ot.disabled,mt.unblended,it.disabled,((g,B)=>({u_input:g,u_output_expected:B}))(t,n),null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&nr(l)){l.bindBuffer(l.PIXEL_PACK_BUFFER,this._pbo),l.readBuffer(l.COLOR_ATTACHMENT0),l.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),l.bindBuffer(l.PIXEL_PACK_BUFFER,null);let g=l.fenceSync(l.SYNC_GPU_COMMANDS_COMPLETE,0);l.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:g}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){let t=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&nr(t)){let n=t.clientWaitSync(this._readbackQueue.sync,0,0);if(n===t.WAIT_FAILED)return c.w("WebGL2 clientWaitSync failed."),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(n===t.TIMEOUT_EXPIRED)return;t.bindBuffer(t.PIXEL_PACK_BUFFER,this._pbo),t.getBufferSubData(t.PIXEL_PACK_BUFFER,0,this._resultBuffer,0,4),t.bindBuffer(t.PIXEL_PACK_BUFFER,null)}else this._bindFramebuffer(),t.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,this._resultBuffer);this._readbackQueue=null,this._measuredError=Vn._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(t){let n=0;return n+=t[0]/256,n+=t[1]/65536,n+=t[2]/16777216,t[3]<127&&(n=-n),n/128}}let dn=c.a6/128;function Zn(d,t){let n=d.granularity!==void 0?Math.max(d.granularity,1):1,A=n+(d.generateBorders?2:0),l=n+(d.extendToNorthPole||d.generateBorders?1:0)+(d.extendToSouthPole||d.generateBorders?1:0),g=A+1,B=l+1,y=d.generateBorders?-1:0,C=d.generateBorders||d.extendToNorthPole?-1:0,E=n+(d.generateBorders?1:0),I=n+(d.generateBorders||d.extendToSouthPole?1:0),b=g*B,F=A*l*6,T=g*B>65536;if(T&&t==="16bit")throw new Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");let P=T||t==="32bit",R=new Int16Array(2*b),Y=0;for(let H=C;H<=I;H++)for(let j=y;j<=E;j++){let z=j/n*c.a6;j===-1&&(z=-dn),j===n+1&&(z=c.a6+dn);let Z=H/n*c.a6;H===-1&&(Z=d.extendToNorthPole?c.bq:-dn),H===n+1&&(Z=d.extendToSouthPole?c.br:c.a6+dn),R[Y++]=z,R[Y++]=Z}let N=P?new Uint32Array(F):new Uint16Array(F),K=0;for(let H=0;H<l;H++)for(let j=0;j<A;j++){let z=j+1+H*g,Z=j+(H+1)*g,X=j+1+(H+1)*g;N[K++]=j+H*g,N[K++]=Z,N[K++]=z,N[K++]=z,N[K++]=Z,N[K++]=X}return{vertices:R.buffer.slice(0),indices:N.buffer.slice(0),uses32bitIndices:P}}let ta=new c.aT({fill:new c.bs(128,2),line:new c.bs(512,0),tile:new c.bs(128,32),stencil:new c.bs(128,1),circle:3});class Fs{constructor(){this._tileMeshCache={},this._errorCorrectionUsable=0,this._errorMeasurementLastValue=0,this._errorCorrectionPreviousValue=0,this._errorMeasurementLastChangeTime=-1e3}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return Et.projectionGlobe}get vertexShaderPreludeCode(){return Et.projectionMercator.vertexSource}get subdivisionGranularity(){return ta}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(t){this._errorMeasurement||(this._errorMeasurement=new Vn(t));let n=c.Y(this._errorQueryLatitudeDegrees),A=2*Math.atan(Math.exp(Math.PI-n*Math.PI*2))-.5*Math.PI,l=this._errorMeasurement.updateErrorLoop(n,A),g=Pe();l!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=l,this._errorMeasurementLastChangeTime=g);let B=Math.min(Math.max((g-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=c.bt(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,c.bu(B))}_getMeshKey(t){return`${t.granularity.toString(36)}_${t.generateBorders?"b":""}${t.extendToNorthPole?"n":""}${t.extendToSouthPole?"s":""}`}getMeshFromTileID(t,n,A,l,g){let B=(g==="stencil"?ta.stencil:ta.tile).getGranularityForZoomLevel(n.z);return this._getMesh(t,{granularity:B,generateBorders:A,extendToNorthPole:n.y===0&&l,extendToSouthPole:n.y===(1<<n.z)-1&&l})}_getMesh(t,n){let A=this._getMeshKey(n);if(A in this._tileMeshCache)return this._tileMeshCache[A];let l=(function(g,B){let y=Zn(B,"16bit"),C=c.aU.deserialize({arrayBuffer:y.vertices,length:y.vertices.byteLength/2/2}),E=c.aW.deserialize({arrayBuffer:y.indices,length:y.indices.byteLength/2/3});return new ft(g.createVertexBuffer(C,Rr.members),g.createIndexBuffer(E),c.aV.simpleSegment(0,0,C.length,E.length))})(t,n);return this._tileMeshCache[A]=l,l}recalculate(t){}hasTransition(){var t;let n=Pe(),A=!1;return A||(A=(n-this._errorMeasurementLastChangeTime)/1e3<.7),A||(A=(t=this._errorMeasurement)===null||t===void 0?void 0:t.awaitingQuery),A}setErrorQueryLatitudeDegrees(t){this._errorQueryLatitudeDegrees=t}}let vl=new c.u({type:new c.D(c.x.projection.type)});class bl extends c.E{constructor(t){super(),this._transitionable=new c.y(vl,void 0),this.setProjection(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new c.J(0)),this._mercatorProjection=new Bi,this._verticalPerspectiveProjection=new Fs}get transitionState(){let t=this.properties.get("type");if(typeof t=="string"&&t==="mercator")return 0;if(typeof t=="string"&&t==="vertical-perspective")return 1;if(t instanceof c.bv){if(t.from==="vertical-perspective"&&t.to==="mercator")return 1-t.transition;if(t.from==="mercator"&&t.to==="vertical-perspective")return t.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get latitudeErrorCorrectionRadians(){return this._verticalPerspectiveProjection.latitudeErrorCorrectionRadians}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}updateGPUdependent(t){this._mercatorProjection.updateGPUdependent(t),this._verticalPerspectiveProjection.updateGPUdependent(t)}getMeshFromTileID(t,n,A,l,g){return this.currentProjection.getMeshFromTileID(t,n,A,l,g)}setProjection(t){this._transitionable.setValue("type",(t==null?void 0:t.type)||"mercator")}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}setErrorQueryLatitudeDegrees(t){this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(t),this._mercatorProjection.setErrorQueryLatitudeDegrees(t)}}function Fl(d){let t=Pi(d.worldSize,d.center.lat);return 2*Math.PI*t}function Rt(d,t,n,A,l){let g=1/(1<<l),B=t/c.a6*g+A*g,y=c.by((d/c.a6*g+n*g)*Math.PI*2+Math.PI,2*Math.PI),C=2*Math.atan(Math.exp(Math.PI-B*Math.PI*2))-.5*Math.PI,E=Math.cos(C),I=new Float64Array(3);return I[0]=Math.sin(y)*E,I[1]=Math.sin(C),I[2]=Math.cos(y)*E,I}function Zt(d){return(function(t,n){let A=Math.cos(n),l=new Float64Array(3);return l[0]=Math.sin(t)*A,l[1]=Math.sin(n),l[2]=Math.cos(t)*A,l})(d.lng*Math.PI/180,d.lat*Math.PI/180)}function Pi(d,t){return d/(2*Math.PI)/Math.cos(t*Math.PI/180)}function Lo(d){let t=Math.asin(d[1])/Math.PI*180,n=Math.sqrt(d[0]*d[0]+d[2]*d[2]);if(n>1e-6){let A=d[0]/n,l=Math.acos(d[2]/n),g=(A>0?l:-l)/Math.PI*180;return new c.W(c.X(g,-180,180),t)}return new c.W(0,t)}function ko(d){return Math.cos(d*Math.PI/180)}function jt(d,t){let n=ko(d),A=ko(t);return c.ar(A/n)}function gn(d,t){let n=d.rotate(t.bearingInRadians),A=t.zoom+jt(t.center.lat,0),l=c.bt(1/ko(t.center.lat),1/ko(Math.min(Math.abs(t.center.lat),60)),c.bw(A,7,3,0,1)),g=360/Fl({worldSize:t.worldSize,center:{lat:t.center.lat}});return new c.W(t.center.lng-n.x*g*l,c.al(t.center.lat+n.y*g,-c.am,c.am))}function ia(d){let t=.5*d,n=Math.sin(t),A=Math.cos(t);return Math.log(n+A)-Math.log(A-n)}function Dl(d,t,n,A){let l=d.lat+n*A;if(Math.abs(n)>1){let g=(Math.sign(d.lat+n)!==Math.sign(d.lat)?-Math.abs(d.lat):Math.abs(d.lat))*Math.PI/180,B=Math.abs(d.lat+n)*Math.PI/180,y=ia(g+A*(B-g)),C=ia(g),E=ia(B);return new c.W(d.lng+t*((y-C)/(E-C)),l)}return new c.W(d.lng+t*A,l)}class uh{constructor(t){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=t}swapBuffers(){if(!this._hadAnyChanges)return;let t=this._cachePrevious;this._cachePrevious=this._cache,this._cache=t,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(t,n,A,l){let g=`${t.z}_${t.x}_${t.y}_${l!=null&&l.terrain?"t":""}`,B=this._cache.get(g);if(B)return B;let y=this._cachePrevious.get(g);if(y)return this._cache.set(g,y),y;let C=this._boundingVolumeFactory(t,n,A,l);return this._cache.set(g,C),this._hadAnyChanges=!0,C}}class Hn{constructor(t,n,A,l){this.min=A,this.max=l,this.points=t,this.planes=n}static fromAabb(t,n){let A=[];for(let l=0;l<8;l++)A.push([1&~l?t[0]:n[0],(l>>1&1)==1?n[1]:t[1],(l>>2&1)==1?n[2]:t[2]]);return new Hn(A,[[-1,0,0,n[0]],[1,0,0,-t[0]],[0,-1,0,n[1]],[0,1,0,-t[1]],[0,0,-1,n[2]],[0,0,1,-t[2]]],t,n)}static fromCenterSizeAngles(t,n,A){let l=c.bA([],A[0],A[1],A[2]),g=c.bB([],[n[0],0,0],l),B=c.bB([],[0,n[1],0],l),y=c.bB([],[0,0,n[2]],l),C=[...t],E=[...t];for(let b=0;b<8;b++)for(let F=0;F<3;F++){let T=t[F]+g[F]*(1&~b?-1:1)+B[F]*((b>>1&1)==1?1:-1)+y[F]*((b>>2&1)==1?1:-1);C[F]=Math.min(C[F],T),E[F]=Math.max(E[F],T)}let I=[];for(let b=0;b<8;b++){let F=[...t];c.a_(F,F,c.aZ([],g,1&~b?-1:1)),c.a_(F,F,c.aZ([],B,(b>>1&1)==1?1:-1)),c.a_(F,F,c.aZ([],y,(b>>2&1)==1?1:-1)),I.push(F)}return new Hn(I,[[...g,-c.b3(g,I[0])],[...B,-c.b3(B,I[0])],[...y,-c.b3(y,I[0])],[-g[0],-g[1],-g[2],-c.b3(g,I[7])],[-B[0],-B[1],-B[2],-c.b3(B,I[7])],[-y[0],-y[1],-y[2],-c.b3(y,I[7])]],C,E)}intersectsFrustum(t){let n=!0,A=this.points.length,l=this.planes.length,g=t.planes.length,B=t.points.length;for(let y=0;y<g;y++){let C=t.planes[y],E=0;for(let I=0;I<A;I++){let b=this.points[I];C[0]*b[0]+C[1]*b[1]+C[2]*b[2]+C[3]>=0&&E++}if(E===0)return 0;E<A&&(n=!1)}if(n)return 2;for(let y=0;y<l;y++){let C=this.planes[y],E=0;for(let I=0;I<B;I++){let b=t.points[I];C[0]*b[0]+C[1]*b[1]+C[2]*b[2]+C[3]>=0&&E++}if(E===0)return 0}return 1}intersectsPlane(t){let n=this.points.length,A=0;for(let l=0;l<n;l++){let g=this.points[l];t[0]*g[0]+t[1]*g[1]+t[2]*g[2]+t[3]>=0&&A++}return A===n?2:A===0?0:1}}function Ds(d,t,n){let A=d-t;return A<0?-A:Math.max(0,A-n)}function ra(d,t,n,A,l){let g=d-n,B;return B=g<0?Math.min(-g,1+g-l):g>l?Math.min(Math.max(g-l,0),1-g):0,Math.max(B,Ds(t,A,l))}class Ss{constructor(){this._boundingVolumeCache=new uh(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(t,n,A,l){let g=1<<A.z,B=1/g,y=A.x/g,C=A.y/g,E=2;return E=Math.min(E,ra(t,n,y,C,B)),E=Math.min(E,ra(t,n,y+.5,-C-B,B)),E=Math.min(E,ra(t,n,y+.5,2-C-B,B)),E}getWrap(t,n,A){let l=1<<n.z,g=1/l,B=n.x/l,y=Ds(t.x,B,g),C=Ds(t.x,B-1,g),E=Ds(t.x,B+1,g),I=Math.min(y,C,E);return I===E?1:I===C?-1:0}allowVariableZoom(t,n){return bi(t,n)>4}allowWorldCopies(){return!1}getTileBoundingVolume(t,n,A,l){return this._boundingVolumeCache.getTileBoundingVolume(t,n,A,l)}_computeTileBoundingVolume(t,n,A,l){var g,B;let y=0,C=0;if(l!=null&&l.terrain){let E=new c.a3(t.z,n,t.z,t.x,t.y),I=l.terrain.getMinMaxElevation(E);y=(g=I.minElevation)!==null&&g!==void 0?g:Math.min(0,A),C=(B=I.maxElevation)!==null&&B!==void 0?B:Math.max(0,A)}if(y/=c.bD,C/=c.bD,y+=1,C+=1,t.z<=0)return Hn.fromAabb([-C,-C,-C],[C,C,C]);if(t.z===1)return Hn.fromAabb([t.x===0?-C:0,t.y===0?0:-C,-C],[t.x===0?0:C,t.y===0?C:0,C]);{let E=[Rt(0,0,t.x,t.y,t.z),Rt(c.a6,0,t.x,t.y,t.z),Rt(c.a6,c.a6,t.x,t.y,t.z),Rt(0,c.a6,t.x,t.y,t.z)],I=[];for(let Be of E)I.push(c.aZ([],Be,C));if(C!==y)for(let Be of E)I.push(c.aZ([],Be,y));t.y===0&&I.push([0,1,0]),t.y===(1<<t.z)-1&&I.push([0,-1,0]);let b=[1,1,1],F=[-1,-1,-1];for(let Be of I)for(let me=0;me<3;me++)b[me]=Math.min(b[me],Be[me]),F[me]=Math.max(F[me],Be[me]);let T=Rt(c.a6/2,c.a6/2,t.x,t.y,t.z),P=c.b2([],[0,1,0],T);c.b1(P,P);let R=c.b2([],T,P);c.b1(R,R);let Y=c.b2([],E[2],E[1]);c.b1(Y,Y);let N=c.b2([],E[0],E[3]);c.b1(N,N),I.push(c.aZ([],T,C)),t.y>=(1<<t.z)/2&&I.push(c.aZ([],Rt(c.a6/2,0,t.x,t.y,t.z),C)),t.y<(1<<t.z)/2&&I.push(c.aZ([],Rt(c.a6/2,c.a6,t.x,t.y,t.z),C));let K=Ms(T,I),H=Ms(R,I),j=[-T[0],-T[1],-T[2],K.max],z=[T[0],T[1],T[2],-K.min],Z=[-R[0],-R[1],-R[2],H.max],X=[R[0],R[1],R[2],-H.min],te=[...Y,0],Ae=[...N,0],ae=[];return t.y===0?ae.push(c.bC(Ae,te,j),c.bC(Ae,te,z)):ae.push(c.bC(Z,te,j),c.bC(Z,te,z),c.bC(Z,Ae,j),c.bC(Z,Ae,z)),t.y===(1<<t.z)-1?ae.push(c.bC(Ae,te,j),c.bC(Ae,te,z)):ae.push(c.bC(X,te,j),c.bC(X,te,z),c.bC(X,Ae,j),c.bC(X,Ae,z)),new Hn(ae,[j,z,Z,X,te,Ae],b,F)}}}function Ms(d,t){let n=1/0,A=-1/0;for(let l of t){let g=c.b3(d,l);n=Math.min(n,g),A=Math.max(A,g)}return{min:n,max:A}}class pn{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,n,A){this._helper.interpolatePadding(t,n,A)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,n){this._helper.resize(t,n)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,n){this._helper.overrideNearFarZ(t,n)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t){}constructor(t){this._cachedClippingPlane=c.bE(),this._projectionMatrix=c.bi(),this._globeViewProjMatrix32f=c.bh(),this._globeViewProjMatrixNoCorrection=c.bi(),this._globeViewProjMatrixNoCorrectionInverted=c.bi(),this._globeProjMatrixInverted=c.bi(),this._cameraPosition=c.bz(),this._globeLatitudeErrorCorrectionRadians=0,this.defaultConstrain=(n,A)=>{let l=c.al(n.lat,-c.am,c.am),g=c.al(+A,this.minZoom+jt(0,l),this.maxZoom);return{center:new c.W(n.lng,l),zoom:g}},this.applyConstrain=(n,A)=>this._helper.applyConstrain(n,A),this._helper=new cn({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(n,A)=>this.defaultConstrain(n,A)},t),this._coveringTilesDetailsProvider=new Ss}clone(){let t=new pn;return t.apply(this,!1),t}apply(t,n,A){this._globeLatitudeErrorCorrectionRadians=A||0,this._helper.apply(t,n)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){let t=c.bz();return t[0]=this._cameraPosition[0],t[1]=this._cameraPosition[1],t[2]=this._cameraPosition[2],t}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(t){let{overscaledTileID:n,applyGlobeMatrix:A}=t,l=this._helper.getMercatorTileCoordinates(n);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:l,clippingPlane:this._cachedClippingPlane,projectionTransition:A?1:0,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(t){let n=this.pitchInRadians,A=this.cameraToCenterDistance/t,l=Math.sin(n)*A,g=Math.cos(n)*A+1,B=1/Math.sqrt(l*l+g*g)*1,y=-l,C=g,E=Math.sqrt(y*y+C*C);y/=E,C/=E;let I=[0,y,C];c.bF(I,I,[0,0,0],-this.bearingInRadians),c.bG(I,I,[0,0,0],-1*this.center.lat*Math.PI/180),c.bH(I,I,[0,0,0],this.center.lng*Math.PI/180);let b=1/c.b5(I);return c.aZ(I,I,b),[...I,-B*b]}isLocationOccluded(t){return!this.isSurfacePointVisible(Zt(t))}transformLightDirection(t){let n=this._helper._center.lng*Math.PI/180,A=this._helper._center.lat*Math.PI/180,l=Math.cos(A),g=[Math.sin(n)*l,Math.sin(A),Math.cos(n)*l],B=[g[2],0,-g[0]],y=[0,0,0];c.b2(y,B,g),c.b1(B,B),c.b1(y,y);let C=[0,0,0];return c.b1(C,[B[0]*t[0]+y[0]*t[1]+g[0]*t[2],B[1]*t[0]+y[1]*t[1]+g[1]*t[2],B[2]*t[0]+y[2]*t[1]+g[2]*t[2]]),C}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(t,n,A){let l=(function(y,C,E){let I=1/(1<<E.z);return new c.a7(y/c.a6*I+E.x*I,C/c.a6*I+E.y*I)})(t,n,A.canonical),g=(B=l.y,[c.by(l.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-B*Math.PI*2))-.5*Math.PI]);var B;return this.getCircleRadiusCorrection()/Math.cos(g[1])}projectTileCoordinates(t,n,A,l){let g=A.canonical,B=Rt(t,n,g.x,g.y,g.z),y=1+(l?l(t,n):0)/c.bD,C=[B[0]*y,B[1]*y,B[2]*y,1];c.aE(C,C,this._globeViewProjMatrixNoCorrection);let E=this._cachedClippingPlane,I=E[0]*B[0]+E[1]*B[1]+E[2]*B[2]+E[3]<0;return{point:new c.P(C[0]/C[3],C[1]/C[3]),signedDistanceFromCamera:C[3],isOccluded:I}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;let t=Pi(this.worldSize,this.center.lat),n=c.bj(),A=c.bj();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*t),c.bc(n,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);let l=this.centerOffset;n[8]=2*-l.x/this._helper._width,n[9]=2*l.y/this._helper._height,this._projectionMatrix=c.bd(n),this._globeProjMatrixInverted=c.bj(),c.bg(this._globeProjMatrixInverted,n),c.Q(n,n,[0,0,-this.cameraToCenterDistance]),c.be(n,n,this.rollInRadians),c.bf(n,n,-this.pitchInRadians),c.be(n,n,this.bearingInRadians),c.Q(n,n,[0,0,-t]);let g=c.bz();g[0]=t,g[1]=t,g[2]=t,c.bf(A,n,this.center.lat*Math.PI/180),c.bI(A,A,-this.center.lng*Math.PI/180),c.S(A,A,g),this._globeViewProjMatrixNoCorrection=A,c.bf(n,n,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),c.bI(n,n,-this.center.lng*Math.PI/180),c.S(n,n,g),this._globeViewProjMatrix32f=new Float32Array(n),this._globeViewProjMatrixNoCorrectionInverted=c.bj(),c.bg(this._globeViewProjMatrixNoCorrectionInverted,A);let B=c.bz();this._cameraPosition=c.bz(),this._cameraPosition[2]=this.cameraToCenterDistance/t,c.bF(this._cameraPosition,this._cameraPosition,B,-this.rollInRadians),c.bG(this._cameraPosition,this._cameraPosition,B,this.pitchInRadians),c.bF(this._cameraPosition,this._cameraPosition,B,-this.bearingInRadians),c.a_(this._cameraPosition,this._cameraPosition,[0,0,1]),c.bG(this._cameraPosition,this._cameraPosition,B,-this.center.lat*Math.PI/180),c.bH(this._cameraPosition,this._cameraPosition,B,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(t);let y=c.bd(this._globeViewProjMatrixNoCorrectionInverted);c.S(y,y,[1,1,-1]),this._cachedFrustum=Di.fromInvProjectionMatrix(y,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(t){c.w("calculateFogMatrix is not supported on globe projection.");let n=c.bj();return c.ap(n),n}getVisibleUnwrappedCoordinates(t){return[new c.ba(0,t)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){t&&c.w("terrain is not fully supported on vertical perspective projection."),this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,n){if(!this._globeViewProjMatrixNoCorrection)return 1;let A=Zt(t);c.aZ(A,A,1+n/c.bD);let l=c.bE();return c.aE(l,[A[0],A[1],A[2],1],this._globeViewProjMatrixNoCorrection),l[2]/l[3]}populateCache(t){}getBounds(){let t=.5*this.width,n=.5*this.height,A=[new c.P(0,0),new c.P(t,0),new c.P(this.width,0),new c.P(this.width,n),new c.P(this.width,this.height),new c.P(t,this.height),new c.P(0,this.height),new c.P(0,n)],l=[];for(let b of A)l.push(this.unprojectScreenPoint(b));let g=0,B=0,y=0,C=0,E=this.center;for(let b of l){let F=c.bJ(E.lng,b.lng),T=c.bJ(E.lat,b.lat);F<B&&(B=F),F>g&&(g=F),T<C&&(C=T),T>y&&(y=T)}let I=[E.lng+B,E.lat+C,E.lng+g,E.lat+y];return this.isSurfacePointOnScreen([0,1,0])&&(I[3]=90,I[0]=-180,I[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(I[1]=-90,I[0]=-180,I[2]=180),new Oe(I)}calculateCenterFromCameraLngLatAlt(t,n,A,l){return this._helper.calculateCenterFromCameraLngLatAlt(t,n,A,l)}setLocationAtPoint(t,n){let A=Zt(this.unprojectScreenPoint(n)),l=Zt(t),g=c.bz();c.bK(g);let B=c.bz();c.bH(B,A,g,-this.center.lng*Math.PI/180),c.bG(B,B,g,this.center.lat*Math.PI/180);let y=l[0]*l[0]+l[2]*l[2],C=B[0]*B[0];if(y<C)return;let E=Math.sqrt(y-C),I=-E,b=c.bL(l[0],l[2],B[0],E),F=c.bL(l[0],l[2],B[0],I),T=c.bz();c.bH(T,l,g,-b);let P=c.bL(T[1],T[2],B[1],B[2]),R=c.bz();c.bH(R,l,g,-F);let Y=c.bL(R[1],R[2],B[1],B[2]),N=.5*Math.PI,K=P>=-N&&P<=N,H=Y>=-N&&Y<=N,j,z;if(K&&H){let Ae=this.center.lng*Math.PI/180,ae=this.center.lat*Math.PI/180;c.bM(b,Ae)+c.bM(P,ae)<c.bM(F,Ae)+c.bM(Y,ae)?(j=b,z=P):(j=F,z=Y)}else if(K)j=b,z=P;else{if(!H)return;j=F,z=Y}let Z=j/Math.PI*180,X=z/Math.PI*180,te=this.center.lat;this.setCenter(new c.W(Z,c.al(X,-90,90))),this.setZoom(this.zoom+jt(te,this.center.lat))}locationToScreenPoint(t,n){let A=Zt(t);if(n){let l=n.getElevationForLngLatZoom(t,this._helper._tileZoom);c.aZ(A,A,1+l/c.bD)}return this._projectSurfacePointToScreen(A)}_projectSurfacePointToScreen(t){let n=c.bE();return c.aE(n,[...t,1],this._globeViewProjMatrixNoCorrection),n[0]/=n[3],n[1]/=n[3],new c.P((.5*n[0]+.5)*this.width,(.5*-n[1]+.5)*this.height)}screenPointToMercatorCoordinate(t,n){if(n){let A=n.pointCoordinate(t);if(A)return A}return c.a7.fromLngLat(this.unprojectScreenPoint(t))}screenPointToLocation(t,n){var A;return(A=this.screenPointToMercatorCoordinate(t,n))===null||A===void 0?void 0:A.toLngLat()}isPointOnMapSurface(t,n){let A=this._cameraPosition,l=this.getRayDirectionFromPixel(t);return!!this.rayPlanetIntersection(A,l)}getRayDirectionFromPixel(t){let n=c.bE();n[0]=t.x/this.width*2-1,n[1]=-1*(t.y/this.height*2-1),n[2]=1,n[3]=1,c.aE(n,n,this._globeViewProjMatrixNoCorrectionInverted),n[0]/=n[3],n[1]/=n[3],n[2]/=n[3];let A=c.bz();A[0]=n[0]-this._cameraPosition[0],A[1]=n[1]-this._cameraPosition[1],A[2]=n[2]-this._cameraPosition[2];let l=c.bz();return c.b1(l,A),l}isSurfacePointVisible(t){let n=this._cachedClippingPlane;return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]>=0}isSurfacePointOnScreen(t){if(!this.isSurfacePointVisible(t))return!1;let n=c.bE();return c.aE(n,[...t,1],this._globeViewProjMatrixNoCorrection),n[0]/=n[3],n[1]/=n[3],n[2]/=n[3],n[0]>-1&&n[0]<1&&n[1]>-1&&n[1]<1&&n[2]>-1&&n[2]<1}rayPlanetIntersection(t,n){let A=c.b3(t,n),l=c.bz(),g=c.bz();c.aZ(g,n,A),c.b0(l,t,g);let B=1-c.b3(l,l);if(B<0)return null;let y=c.b3(t,t)-1,C=-A+(A<0?1:-1)*Math.sqrt(B),E=y/C,I=C;return{tMin:Math.min(E,I),tMax:Math.max(E,I)}}unprojectScreenPoint(t){let n=this._cameraPosition,A=this.getRayDirectionFromPixel(t),l=this.rayPlanetIntersection(n,A);if(l){let I=c.bz();c.a_(I,n,[A[0]*l.tMin,A[1]*l.tMin,A[2]*l.tMin]);let b=c.bz();return c.b1(b,I),Lo(b)}let g=this._cachedClippingPlane,B=g[0]*A[0]+g[1]*A[1]+g[2]*A[2],y=-c.b9(g,n)/B,C=c.bz();if(y>0)c.a_(C,n,[A[0]*y,A[1]*y,A[2]*y]);else{let I=c.bz();c.a_(I,n,[2*A[0],2*A[1],2*A[2]]);let b=c.b9(this._cachedClippingPlane,I);c.b0(C,I,[this._cachedClippingPlane[0]*b,this._cachedClippingPlane[1]*b,this._cachedClippingPlane[2]*b])}let E=(function(I){let b=c.bz();return b[0]=I[0]*-I[3],b[1]=I[1]*-I[3],b[2]=I[2]*-I[3],{center:b,radius:Math.sqrt(1-I[3]*I[3])}})(g);return Lo((function(I,b,F){let T=c.bz();c.b0(T,F,I);let P=c.bz();return c.bx(P,I,T,b/c.b7(T)),P})(E.center,E.radius,C))}getMatrixForModel(t,n){let A=c.W.convert(t),l=1/c.bD,g=c.bi();return c.bI(g,g,A.lng/180*Math.PI),c.bf(g,g,-A.lat/180*Math.PI),c.Q(g,g,[0,0,1+n/c.bD]),c.bf(g,g,.5*Math.PI),c.S(g,g,[l,l,l]),g}getProjectionDataForCustomLayer(t=!0){let n=this.getProjectionData({overscaledTileID:new c.a3(0,0,0,0,0),applyGlobeMatrix:t});return n.tileMercatorCoords=[0,0,1,1],n}getFastPathSimpleProjectionMatrix(t){}}class Jn{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,n,A){this._helper.interpolatePadding(t,n,A)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,n,A=!0){this._helper.resize(t,n,A)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,n){this._helper.overrideNearFarZ(t,n)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(t,n){this._globeness=t,this._globeLatitudeErrorCorrectionRadians=n,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(t){this._globeLatitudeErrorCorrectionRadians=0,this._globeness=1,this.defaultConstrain=(n,A)=>this.currentTransform.defaultConstrain(n,A),this.applyConstrain=(n,A)=>this._helper.applyConstrain(n,A),this._helper=new cn({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(n,A)=>this.defaultConstrain(n,A)},t),this._globeness=1,this._mercatorTransform=new hn,this._verticalPerspectiveTransform=new pn}clone(){let t=new Jn;return t._globeness=this._globeness,t._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,t.apply(this,!1),t}apply(t,n){this._helper.apply(t,n),this._mercatorTransform.apply(this,!1),this._verticalPerspectiveTransform.apply(this,!1,this._globeLatitudeErrorCorrectionRadians)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(t){let n=this._mercatorTransform.getProjectionData(t),A=this._verticalPerspectiveTransform.getProjectionData(t);return{mainMatrix:this.isGlobeRendering?A.mainMatrix:n.mainMatrix,clippingPlane:A.clippingPlane,tileMercatorCoords:A.tileMercatorCoords,projectionTransition:t.applyGlobeMatrix?this._globeness:0,fallbackMatrix:n.fallbackMatrix}}isLocationOccluded(t){return this.currentTransform.isLocationOccluded(t)}transformLightDirection(t){return this.currentTransform.transformLightDirection(t)}getPixelScale(){return c.bt(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return c.bt(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(t,n,A){let l=this._mercatorTransform.getPitchedTextCorrection(t,n,A),g=this._verticalPerspectiveTransform.getPitchedTextCorrection(t,n,A);return c.bt(l,g,this._globeness)}projectTileCoordinates(t,n,A,l){return this.currentTransform.projectTileCoordinates(t,n,A,l)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,!1,this._globeLatitudeErrorCorrectionRadians),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(t){return this.currentTransform.calculateFogMatrix(t)}getVisibleUnwrappedCoordinates(t){return this.currentTransform.getVisibleUnwrappedCoordinates(t)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(t){this._mercatorTransform.recalculateZoomAndCenter(t),this._verticalPerspectiveTransform.recalculateZoomAndCenter(t)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,n){return this.currentTransform.lngLatToCameraDepth(t,n)}populateCache(t){this._mercatorTransform.populateCache(t),this._verticalPerspectiveTransform.populateCache(t)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(t,n,A,l){return this._helper.calculateCenterFromCameraLngLatAlt(t,n,A,l)}setLocationAtPoint(t,n){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(t,n),void this.apply(this._mercatorTransform,!1);this._verticalPerspectiveTransform.setLocationAtPoint(t,n),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(t,n){return this.currentTransform.locationToScreenPoint(t,n)}screenPointToMercatorCoordinate(t,n){return this.currentTransform.screenPointToMercatorCoordinate(t,n)}screenPointToLocation(t,n){return this.currentTransform.screenPointToLocation(t,n)}isPointOnMapSurface(t,n){return this.currentTransform.isPointOnMapSurface(t,n)}getRayDirectionFromPixel(t){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(t)}getMatrixForModel(t,n){return this.currentTransform.getMatrixForModel(t,n)}getProjectionDataForCustomLayer(t=!0){let n=this._mercatorTransform.getProjectionDataForCustomLayer(t);if(!this.isGlobeRendering)return n;let A=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(t);return A.fallbackMatrix=n.mainMatrix,A}getFastPathSimpleProjectionMatrix(t){return this.currentTransform.getFastPathSimpleProjectionMatrix(t)}}class Gi{get useGlobeControls(){return!0}handlePanInertia(t,n){let A=gn(t,n);return Math.abs(A.lng-n.center.lng)>180&&(A.lng=n.center.lng+179.5*Math.sign(A.lng-n.center.lng)),{easingCenter:A,easingOffset:new c.P(0,0)}}handleMapControlsRollPitchBearingZoom(t,n){let A=t.around,l=n.screenPointToLocation(A);t.bearingDelta&&n.setBearing(n.bearing+t.bearingDelta),t.pitchDelta&&n.setPitch(n.pitch+t.pitchDelta),t.rollDelta&&n.setRoll(n.roll+t.rollDelta);let g=n.zoom;t.zoomDelta&&n.setZoom(n.zoom+t.zoomDelta);let B=n.zoom-g;if(B===0)return;let y=c.bJ(n.center.lng,l.lng),C=y/(Math.abs(y/180)+1),E=c.bJ(n.center.lat,l.lat),I=n.getRayDirectionFromPixel(A),b=n.cameraPosition,F=-1*c.b3(b,I),T=c.bz();c.a_(T,b,[I[0]*F,I[1]*F,I[2]*F]);let P=c.b5(T)-1,R=Math.exp(.5*-Math.max(P-.3,0)),Y=Pi(n.worldSize,n.center.lat)/Math.min(n.width,n.height),N=c.bw(Y,.9,.5,1,.25),K=(1-c.ao(-B))*Math.min(R,N),H=n.center.lat,j=n.zoom,z=new c.W(n.center.lng+C*K,c.al(n.center.lat+E*K,-c.am,c.am));n.setLocationAtPoint(l,A);let Z=n.center,X=c.bw(Math.abs(y),45,85,0,1),te=c.bw(Y,.75,.35,0,1),Ae=Math.pow(Math.max(X,te),.25),ae=c.bJ(Z.lng,z.lng),Be=c.bJ(Z.lat,z.lat);n.setCenter(new c.W(Z.lng+ae*Ae,Z.lat+Be*Ae).wrap()),n.setZoom(j+jt(H,n.center.lat))}handleMapControlsPan(t,n,A){if(!t.panDelta)return;let l=n.center.lat,g=n.zoom;n.setCenter(gn(t.panDelta,n).wrap()),n.setZoom(g+jt(l,n.center.lat))}cameraForBoxAndBearing(t,n,A,l,g){let B=ea(t,n,A,l,g),y=n.left/g.width*2-1,C=(g.width-n.right)/g.width*2-1,E=n.top/g.height*-2+1,I=(g.height-n.bottom)/g.height*-2+1,b=c.bJ(A.getWest(),A.getEast())<0,F=b?A.getEast():A.getWest(),T=b?A.getWest():A.getEast(),P=Math.max(A.getNorth(),A.getSouth()),R=Math.min(A.getNorth(),A.getSouth()),Y=F+.5*c.bJ(F,T),N=P+.5*c.bJ(P,R),K=g.clone();K.setCenter(B.center),K.setBearing(B.bearing),K.setPitch(0),K.setRoll(0),K.setZoom(B.zoom);let H=K.modelViewProjectionMatrix,j=[Zt(A.getNorthWest()),Zt(A.getNorthEast()),Zt(A.getSouthWest()),Zt(A.getSouthEast()),Zt(new c.W(T,N)),Zt(new c.W(F,N)),Zt(new c.W(Y,P)),Zt(new c.W(Y,R))],z=Zt(B.center),Z=Number.POSITIVE_INFINITY;for(let X of j)y<0&&(Z=Gi.getLesserNonNegativeNonNull(Z,Gi.solveVectorScale(X,z,H,"x",y))),C>0&&(Z=Gi.getLesserNonNegativeNonNull(Z,Gi.solveVectorScale(X,z,H,"x",C))),E>0&&(Z=Gi.getLesserNonNegativeNonNull(Z,Gi.solveVectorScale(X,z,H,"y",E))),I<0&&(Z=Gi.getLesserNonNegativeNonNull(Z,Gi.solveVectorScale(X,z,H,"y",I)));if(Number.isFinite(Z)&&Z!==0)return B.zoom=Math.min(K.zoom+c.ar(Z),t.maxZoom),B;_r()}handleJumpToCenterZoom(t,n){let A=t.center.lat,l=t.applyConstrain(n.center?c.W.convert(n.center):t.center,t.zoom).center;t.setCenter(l.wrap());let g=n.zoom!==void 0?+n.zoom:t.zoom+jt(A,l.lat);t.zoom!==g&&t.setZoom(g)}handleEaseTo(t,n){let A=t.zoom,l=t.center,g=t.padding,B={roll:t.roll,pitch:t.pitch,bearing:t.bearing},y={roll:n.roll===void 0?t.roll:n.roll,pitch:n.pitch===void 0?t.pitch:n.pitch,bearing:n.bearing===void 0?t.bearing:n.bearing},C=n.zoom!==void 0,E=!t.isPaddingEqual(n.padding),I=!1,b=n.center?c.W.convert(n.center):l,F=t.applyConstrain(b,A).center;Or(t,F);let T=t.clone();T.setCenter(F),T.setZoom(C?+n.zoom:A+jt(l.lat,b.lat)),T.setBearing(n.bearing);let P=new c.P(c.al(t.centerPoint.x+n.offsetAsPoint.x,0,t.width),c.al(t.centerPoint.y+n.offsetAsPoint.y,0,t.height));T.setLocationAtPoint(F,P);let R=(n.offset&&n.offsetAsPoint.mag())>0?T.center:F,Y=C?+n.zoom:A+jt(l.lat,R.lat),N=A+jt(l.lat,0),K=Y+jt(R.lat,0),H=c.bJ(l.lng,R.lng),j=c.bJ(l.lat,R.lat),z=c.ao(K-N);return I=Y!==A,{easeFunc:Z=>{if(c.bn(B,y)||xl({startEulerAngles:B,endEulerAngles:y,tr:t,k:Z,useSlerp:B.roll!=y.roll}),E&&t.interpolatePadding(g,n.padding,Z),n.around)c.w("Easing around a point is not supported under globe projection."),t.setLocationAtPoint(n.around,n.aroundPoint);else{let X=K>N?Math.min(2,z):Math.max(.5,z),te=Math.pow(X,1-Z),Ae=Dl(l,H,j,Z*te);t.setCenter(Ae.wrap())}if(I){let X=c.H.number(N,K,Z)+jt(0,t.center.lat);t.setZoom(X)}},isZooming:I,elevationCenter:R}}handleFlyTo(t,n){let A=n.zoom!==void 0,l=t.center,g=t.zoom,B=t.padding,y=!t.isPaddingEqual(n.padding),C=t.applyConstrain(c.W.convert(n.center||n.locationAtOffset),g).center,E=A?+n.zoom:t.zoom+jt(t.center.lat,C.lat),I=t.clone();I.setCenter(C),I.setZoom(E),I.setBearing(n.bearing);let b=new c.P(c.al(t.centerPoint.x+n.offsetAsPoint.x,0,t.width),c.al(t.centerPoint.y+n.offsetAsPoint.y,0,t.height));I.setLocationAtPoint(C,b);let F=I.center;Or(t,F);let T=(function(j,z,Z){let X=Zt(z),te=Zt(Z),Ae=c.b3(X,te),ae=Math.acos(Ae),Be=Fl(j);return ae/(2*Math.PI)*Be})(t,l,F),P=g+jt(l.lat,0),R=E+jt(F.lat,0),Y=c.ao(R-P),N;if(typeof n.minZoom=="number"){let j=+n.minZoom+jt(F.lat,0),z=Math.min(j,P,R)+jt(0,F.lat),Z=t.applyConstrain(F,z).zoom+jt(F.lat,0);N=c.ao(Z-P)}let K=c.bJ(l.lng,F.lng),H=c.bJ(l.lat,F.lat);return{easeFunc:(j,z,Z,X)=>{let te=Dl(l,K,H,Z);y&&t.interpolatePadding(B,n.padding,j);let Ae=j===1?F:te;t.setCenter(Ae.wrap());let ae=P+c.ar(z);t.setZoom(j===1?E:ae+jt(0,Ae.lat))},scaleOfZoom:Y,targetCenter:F,scaleOfMinZoom:N,pixelPathLength:T}}static solveVectorScale(t,n,A,l,g){let B=l==="x"?[A[0],A[4],A[8],A[12]]:[A[1],A[5],A[9],A[13]],y=[A[3],A[7],A[11],A[15]],C=t[0]*B[0]+t[1]*B[1]+t[2]*B[2],E=t[0]*y[0]+t[1]*y[1]+t[2]*y[2],I=n[0]*B[0]+n[1]*B[1]+n[2]*B[2],b=n[0]*y[0]+n[1]*y[1]+n[2]*y[2];return I+g*E===C+g*b||y[3]*(C-I)+B[3]*(b-E)+C*b==I*E?null:(I+B[3]-g*b-g*y[3])/(I-C-g*b+g*E)}static getLesserNonNegativeNonNull(t,n){return n!==null&&n>=0&&n<t?n:t}}class or{constructor(t){this._globe=t,this._mercatorCameraHelper=new un,this._verticalPerspectiveCameraHelper=new Gi}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(t,n){return this.currentHelper.handlePanInertia(t,n)}handleMapControlsRollPitchBearingZoom(t,n){this.currentHelper.handleMapControlsRollPitchBearingZoom(t,n)}handleMapControlsPan(t,n,A){this.currentHelper.handleMapControlsPan(t,n,A)}cameraForBoxAndBearing(t,n,A,l,g){return this.currentHelper.cameraForBoxAndBearing(t,n,A,l,g)}handleJumpToCenterZoom(t,n){this.currentHelper.handleJumpToCenterZoom(t,n)}handleEaseTo(t,n){return this.currentHelper.handleEaseTo(t,n)}handleFlyTo(t,n){return this.currentHelper.handleFlyTo(t,n)}}let Ts=(d,t)=>c.C(d,t==null?void 0:t.filter((n=>n.identifier!=="source.canvas"))),na=c.bN();class fn extends c.E{constructor(t,n={}){var A,l;super(),this._rtlPluginLoaded=()=>{for(let B in this.tileManagers){let y=this.tileManagers[B].getSource().type;y!=="vector"&&y!=="geojson"||this.tileManagers[B].reload()}},this.map=t,this.dispatcher=new wo($r(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",((B,y)=>this.getGlyphs(B,y))),this.dispatcher.registerMessageHandler("GI",((B,y)=>this.getImages(B,y))),this.dispatcher.registerMessageHandler("GDA",((B,y)=>this.getDashes(B,y))),this.imageManager=new Co,this.imageManager.setEventedParent(this);let g=((A=t._container)===null||A===void 0?void 0:A.lang)||typeof document!="undefined"&&((l=document.documentElement)===null||l===void 0?void 0:l.lang)||void 0;this.glyphManager=new Se(t._requestManager,n.localIdeographFontFamily,g),this.lineAtlas=new Ge(256,512),this.crossTileSymbolIndex=new Fi,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",c.bO()),kr().on(Io,this._rtlPluginLoaded),this.on("data",(B=>{if(B.dataType!=="source"||B.sourceDataType!=="metadata")return;let y=this.tileManagers[B.sourceId];if(!y)return;let C=y.getSource();if(C!=null&&C.vectorLayerIds)for(let E in this._layers){let I=this._layers[E];I.source===C.id&&this._validateLayer(I)}}))}_setInitialValues(){var t;this._spritesImagesIds={},this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new c.bP,this._availableImages=[],this._globalState={},this._serializedLayers={},this.stylesheet=null,this.light=null,this.sky=null,this.projection&&(this.projection.destroy(),delete this.projection),this._loaded=!1,this._changed=!1,this._updatedLayers={},this._updatedSources={},this._changedImages={},this._glyphsDidChange=!1,this._updatedPaintProps={},this._layerOrderChanged=!1,this.crossTileSymbolIndex=new(((t=this.crossTileSymbolIndex)===null||t===void 0?void 0:t.constructor)||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(t,n){var A,l,g;this._checkLoaded();let B=n===null?(g=(l=(A=this.stylesheet.state)===null||A===void 0?void 0:A[t])===null||l===void 0?void 0:l.default)!==null&&g!==void 0?g:null:n;if(c.bQ(B,this._globalState[t]))return this;this._globalState[t]=B,this._applyGlobalStateChanges([t])}getGlobalState(){return this._globalState}setGlobalState(t){this._checkLoaded();let n=[];for(let A in t)!c.bQ(this._globalState[A],t[A].default)&&(n.push(A),this._globalState[A]=t[A].default);this._applyGlobalStateChanges(n)}_applyGlobalStateChanges(t){if(t.length===0)return;let n=new Set,A={};for(let l of t){A[l]=this._globalState[l];for(let g in this._layers){let B=this._layers[g],y=B.getLayoutAffectingGlobalStateRefs(),C=B.getPaintAffectingGlobalStateRefs(),E=B.getVisibilityAffectingGlobalStateRefs();if(y.has(l)&&n.add(B.source),C.has(l))for(let{name:I,value:b}of C.get(l))this._updatePaintProperty(B,I,b);E!=null&&E.has(l)&&(B.recalculateVisibility(),this._updateLayer(B))}}this.dispatcher.broadcast("UGS",A);for(let l in this.tileManagers)n.has(l)&&(this._reloadSource(l),this._changed=!0)}loadURL(t){return c._(this,arguments,void 0,(function*(n,A={},l){this.fire(new c.n("dataloading",{dataType:"style"})),A.validate=typeof A.validate!="boolean"||A.validate,this._loadStyleRequest=new AbortController;let g=this._loadStyleRequest;try{let B=yield this.map._requestManager.transformRequest(n,"Style");c.bR(g.signal);let y=yield c.k(B,g);this._loadStyleRequest===g&&(this._loadStyleRequest=null),this._load(y.data,A,l)}catch(B){this._loadStyleRequest===g&&(this._loadStyleRequest=null),B&&!g.signal.aborted&&this.fire(new c.l(c.d(B)))}}))}loadJSON(t,n={},A){this.fire(new c.n("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,Je.frameAsync(this._frameRequest,this.map._ownerWindow).then((()=>{this._frameRequest=null,n.validate=n.validate!==!1,this._load(t,n,A)})).catch((()=>{}))}loadEmpty(){this.fire(new c.n("dataloading",{dataType:"style"})),this._load(na,{validate:!1})}_load(t,n,A){var l,g;let B=n.transformStyle?n.transformStyle(A,t):t;if(!n.validate||!Ts(this,c.F(B))){B=Object.assign({},B),this._loaded=!0,this.stylesheet=B;for(let y in B.sources)this.addSource(y,B.sources[y],{validate:!1});B.sprite?this._loadSprite(B.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(B.glyphs),this._createLayers(),this.light=new et(this.stylesheet.light),this._setProjectionInternal(((l=this.stylesheet.projection)===null||l===void 0?void 0:l.type)||"mercator"),this.sky=new st(this.stylesheet.sky),this.map.setTerrain((g=this.stylesheet.terrain)!==null&&g!==void 0?g:null),this.fire(new c.n("data",{dataType:"style"})),this.fire(new c.n("style.load"))}}_createLayers(){var t,n,A;let l=c.bS(this.stylesheet.layers);this.setGlobalState((t=this.stylesheet.state)!==null&&t!==void 0?t:null),this.dispatcher.broadcast("SL",l),this._order=l.map((g=>g.id)),this._layers={},this._serializedLayers=null;for(let g of l){let B=c.bT(g,this._globalState);if(B.setEventedParent(this,{layer:{id:g.id}}),this._layers[g.id]=B,c.bU(B)&&this.tileManagers[B.source]){let y=(A=(n=g.paint)===null||n===void 0?void 0:n["raster-fade-duration"])!==null&&A!==void 0?A:B.paint.get("raster-fade-duration");this.tileManagers[B.source].setRasterFadeDuration(y)}}}_loadSprite(t,n=!1,A=void 0){this.imageManager.setLoaded(!1);let l=new AbortController,g;this._spriteRequest=l,(function(B,y,C,E){return c._(this,void 0,void 0,(function*(){let I=xi(B),b=C>1?"@2x":"",F={},T={};for(let{id:P,url:R}of I){let Y=yield y.transformRequest(Tn(R,b,".json"),"SpriteJSON");F[P]=c.k(Y,E);let N=yield y.transformRequest(Tn(R,b,".png"),"SpriteImage");T[P]=qe.getImage(N,E)}return yield Promise.all([...Object.values(F),...Object.values(T)]),(function(P,R){return c._(this,void 0,void 0,(function*(){let Y={};for(let N in P){Y[N]={};let K=Je.getImageCanvasContext((yield R[N]).data),H=(yield P[N]).data;for(let j in H){let{width:z,height:Z,x:X,y:te,sdf:Ae,pixelRatio:ae,stretchX:Be,stretchY:me,content:Fe,textFitWidth:Ie,textFitHeight:ge}=H[j];Y[N][j]={data:null,pixelRatio:ae,sdf:Ae,stretchX:Be,stretchY:me,content:Fe,textFitWidth:Ie,textFitHeight:ge,spriteData:{width:z,height:Z,x:X,y:te,context:K}}}}return Y}))})(F,T)}))})(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((B=>{if(this._spriteRequest=null,B)for(let y in B){this._spritesImagesIds[y]=[];let C=this._spritesImagesIds[y]?this._spritesImagesIds[y].filter((E=>!(E in B))):[];for(let E of C)this.imageManager.removeImage(E),this._changedImages[E]=!0;for(let E in B[y]){let I=y==="default"?E:`${y}:${E}`;this._spritesImagesIds[y].push(I),I in this.imageManager.images?this.imageManager.updateImage(I,B[y][E],!1):this.imageManager.addImage(I,B[y][E]),n&&(this._changedImages[I]=!0)}}})).catch((B=>{this._spriteRequest=null,g=B,l.signal.aborted||this.fire(new c.l(g))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.n("data",{dataType:"style"})),A&&A(g)}))}_unloadSprite(){for(let t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.n("data",{dataType:"style"}))}_validateLayer(t){let n=this.tileManagers[t.source];if(!n)return;let A=t.sourceLayer;if(!A)return;let l=n.getSource();(l.type==="geojson"||l.vectorLayerIds&&!l.vectorLayerIds.includes(A))&&this.fire(new c.l(new Error(`Source layer "${A}" does not exist on source "${l.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let t in this.tileManagers)if(!this.tileManagers[t].loaded())return!1;return this.imageManager.isLoaded()}_serializeByIds(t,n=!1){let A=this._serializedAllLayers();if(!t||t.length===0)return Object.values(n?c.bV(A):A);let l=[];for(let g of t)if(A[g]){let B=n?c.bV(A[g]):A[g];l.push(B)}return l}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};let n=Object.keys(this._layers);for(let A of n){let l=this._layers[A];l.type!=="custom"&&(t[A]=l.serialize())}return t}hasTransitions(){var t,n,A;if(!((t=this.light)===null||t===void 0)&&t.hasTransition()||!((n=this.sky)===null||n===void 0)&&n.hasTransition()||!((A=this.projection)===null||A===void 0)&&A.hasTransition())return!0;for(let l in this.tileManagers)if(this.tileManagers[l].hasTransition())return!0;for(let l in this._layers)if(this._layers[l].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;let n=this._changed;if(n){let l=Object.keys(this._updatedLayers),g=Object.keys(this._removedLayers);(l.length||g.length)&&this._updateWorkerLayers(l,g);for(let B in this._updatedSources){let y=this._updatedSources[B];if(y==="reload")this._reloadSource(B);else{if(y!=="clear")throw new Error(`Invalid action ${y}`);this._clearSource(B)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let B in this._updatedPaintProps)this._layers[B].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}let A={};for(let l in this.tileManagers){let g=this.tileManagers[l];A[l]=g.used,g.used=!1}for(let l of this._order){let g=this._layers[l];g.recalculate(t,this._availableImages),!g.isHidden(t.zoom)&&g.source&&(this.tileManagers[g.source].used=!0)}for(let l in A){let g=this.tileManagers[l];!!A[l]!=!!g.used&&g.fire(new c.n("data",{sourceDataType:"visibility",dataType:"source",sourceId:l}))}this.light.recalculate(t),this.sky.recalculate(t),this.projection.recalculate(t),this.z=t.zoom,n&&this.fire(new c.n("data",{dataType:"style"}))}_updateTilesForChangedImages(){let t=Object.keys(this._changedImages);if(t.length){for(let n in this.tileManagers)this.tileManagers[n].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let t in this.tileManagers)this.tileManagers[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,n){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,n={}){var A;this._checkLoaded();let l=this.serialize();if(t=n.transformStyle?n.transformStyle(l,t):t,((A=n.validate)===null||A===void 0||A)&&Ts(this,c.F(t)))return!1;(t=c.bV(t)).layers=c.bS(t.layers);let g=c.bW(l,t),B=this._getOperationsToPerform(g);if(B.unimplemented.length>0)throw new Error(`Unimplemented: ${B.unimplemented.join(", ")}.`);if(B.operations.length===0)return!1;for(let y of B.operations)y();return this.stylesheet=t,this._serializedLayers=null,this.fire(new c.n("style.load",{style:this})),!0}_getOperationsToPerform(t){let n=[],A=[];for(let l of t)switch(l.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":n.push((()=>this.addLayer.apply(this,l.args)));break;case"removeLayer":n.push((()=>this.removeLayer.apply(this,l.args)));break;case"setPaintProperty":n.push((()=>this.setPaintProperty.apply(this,l.args)));break;case"setLayoutProperty":n.push((()=>this.setLayoutProperty.apply(this,l.args)));break;case"setFilter":n.push((()=>this.setFilter.apply(this,l.args)));break;case"addSource":n.push((()=>this.addSource.apply(this,l.args)));break;case"removeSource":n.push((()=>this.removeSource.apply(this,l.args)));break;case"setLayerZoomRange":n.push((()=>this.setLayerZoomRange.apply(this,l.args)));break;case"setLight":n.push((()=>this.setLight.apply(this,l.args)));break;case"setGeoJSONSourceData":n.push((()=>this.setGeoJSONSourceData.apply(this,l.args)));break;case"setGlyphs":n.push((()=>this.setGlyphs.apply(this,l.args)));break;case"setSprite":n.push((()=>this.setSprite.apply(this,l.args)));break;case"setTerrain":n.push((()=>this.map.setTerrain.apply(this,l.args)));break;case"setSky":n.push((()=>this.setSky.apply(this,l.args)));break;case"setProjection":this.setProjection.apply(this,l.args);break;case"setGlobalState":n.push((()=>this.setGlobalState.apply(this,l.args)));break;case"setTransition":n.push((()=>{}));break;default:A.push(l.command)}return{operations:n,unimplemented:A}}addImage(t,n){if(this.getImage(t))return this.fire(new c.l(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new c.l(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.n("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,A={}){var l;if(this._checkLoaded(),this.tileManagers[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].includes(n.type)&&this._validate(c.F.source,`sources.${t}`,n,null,A))return;!((l=this.map)===null||l===void 0)&&l._collectResourceTiming&&(n.collectResourceTiming=!0);let g=this.tileManagers[t]=new ri(t,n,this.dispatcher);g.style=this,g.setEventedParent(this,(()=>({isSourceLoaded:g.loaded(),source:g.serialize(),sourceId:t}))),g.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.tileManagers[t]===void 0)throw new Error(`There is no source with this ID=${t}`);for(let A in this._layers)if(this._layers[A].source===t)return this.fire(new c.l(new Error(`Source "${t}" cannot be removed while layer "${A}" is using it.`)));let n=this.tileManagers[t];delete this.tileManagers[t],delete this._updatedSources[t],n.fire(new c.n("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){if(this._checkLoaded(),this.tileManagers[t]===void 0)throw new Error(`There is no source with this ID=${t}`);let A=this.tileManagers[t].getSource();if(A.type!=="geojson")throw new Error(`geojsonSource.type is ${A.type}, which is !== 'geojson`);A.setData(n),this._changed=!0}getSource(t){var n;return(n=this.tileManagers[t])===null||n===void 0?void 0:n.getSource()}addLayer(t,n,A={}){this._checkLoaded();let l=t.id;if(this.getLayer(l))return void this.fire(new c.l(new Error(`Layer "${l}" already exists on this map.`)));let g;if(t.type==="custom"){if(Ts(this,c.bX(t)))return;g=c.bT(t,this._globalState)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(l,t.source),t=c.bV(t),t=c.e(t,{source:l})),this._validate(c.F.layer,`layers.${l}`,t,{arrayIndex:-1},A))return;g=c.bT(t,this._globalState),this._validateLayer(g),g.setEventedParent(this,{layer:{id:l}})}let B=n?this._order.indexOf(n):this._order.length;if(n&&B===-1)this.fire(new c.l(new Error(`Cannot add layer "${l}" before non-existing layer "${n}".`)));else{if(this._order.splice(B,0,l),this._layerOrderChanged=!0,this._layers[l]=g,this._removedLayers[l]&&g.source&&g.type!=="custom"){let y=this._removedLayers[l];delete this._removedLayers[l],y.type!==g.type?this._updatedSources[g.source]="clear":(this._updatedSources[g.source]="reload",this.tileManagers[g.source].pause())}this._updateLayer(g),g.onAdd&&g.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new c.l(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;let A=this._order.indexOf(t);this._order.splice(A,1);let l=n?this._order.indexOf(n):this._order.length;n&&l===-1?this.fire(new c.l(new Error(`Cannot move layer "${t}" before non-existing layer "${n}".`))):(this._order.splice(l,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();let n=this._layers[t];if(!n)return void this.fire(new c.l(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);let A=this._order.indexOf(t);this._order.splice(A,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,n,A){this._checkLoaded();let l=this.getLayer(t);l?l.minzoom===n&&l.maxzoom===A||(n!=null&&(l.minzoom=n),A!=null&&(l.maxzoom=A),this._updateLayer(l)):this.fire(new c.l(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,n,A={}){this._checkLoaded();let l=this.getLayer(t);if(l){if(!c.bQ(l.filter,n))return n==null?(l.setFilter(void 0),void this._updateLayer(l)):void(this._validate(c.F.filter,`layers.${l.id}.filter`,n,null,A)||(l.setFilter(c.bV(n)),this._updateLayer(l)))}else this.fire(new c.l(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return c.bV(this.getLayer(t).filter)}setLayoutProperty(t,n,A,l={}){this._checkLoaded();let g=this.getLayer(t);g?c.bQ(g.getLayoutProperty(n),A)||(g.setLayoutProperty(n,A,l),this._updateLayer(g)):this.fire(new c.l(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){let A=this.getLayer(t);if(A)return A.getLayoutProperty(n);this.fire(new c.l(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,A,l={}){this._checkLoaded();let g=this.getLayer(t);g?c.bQ(g.getPaintProperty(n),A)||this._updatePaintProperty(g,n,A,l):this.fire(new c.l(new Error(`Cannot style non-existing layer "${t}".`)))}_updatePaintProperty(t,n,A,l={}){t.setPaintProperty(n,A,l)&&this._updateLayer(t),c.bU(t)&&n==="raster-fade-duration"&&this.tileManagers[t.source].setRasterFadeDuration(A),this._changed=!0,this._updatedPaintProps[t.id]=!0,this._serializedLayers=null}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,n){this._checkLoaded();let A=t.source,l=t.sourceLayer,g=this.tileManagers[A];if(g===void 0)return void this.fire(new c.l(new Error(`The source '${A}' does not exist in the map's style.`)));let B=g.getSource().type;B==="geojson"&&l?this.fire(new c.l(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):B!=="vector"||l?(t.id===void 0&&this.fire(new c.l(new Error("The feature id parameter must be provided."))),g.setFeatureState(l,t.id,n)):this.fire(new c.l(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();let A=t.source,l=this.tileManagers[A];if(l===void 0)return void this.fire(new c.l(new Error(`The source '${A}' does not exist in the map's style.`)));let g=l.getSource().type,B=g==="vector"?t.sourceLayer:void 0;g!=="vector"||B?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new c.l(new Error("A feature id is required to remove its specific state property."))):l.removeFeatureState(B,t.id,n):this.fire(new c.l(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();let n=t.source,A=t.sourceLayer,l=this.tileManagers[n];if(l!==void 0)return l.getSource().type!=="vector"||A?(t.id===void 0&&this.fire(new c.l(new Error("The feature id parameter must be provided."))),l.getFeatureState(A,t.id)):void this.fire(new c.l(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new c.l(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){var t;return c.e({duration:300,delay:0},(t=this.stylesheet)===null||t===void 0?void 0:t.transition)}serialize(){if(!this._loaded)return;let t=c.bY(this.tileManagers,(g=>g.serialize())),n=this._serializeByIds(this._order,!0),A=this.map.getTerrain()||void 0,l=this.stylesheet;return c.bZ({version:l.version,name:l.name,metadata:l.metadata,light:l.light,sky:l.sky,center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch,sprite:l.sprite,glyphs:l.glyphs,transition:l.transition,projection:l.projection,sources:t,layers:n,terrain:A},(g=>g!==void 0))}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.tileManagers[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.tileManagers[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){let n=B=>this._layers[B].type==="fill-extrusion",A={},l=[];for(let B=this._order.length-1;B>=0;B--){let y=this._order[B];if(n(y)){A[y]=B;for(let C of t){let E=C[y];if(E)for(let I of E)l.push(I)}}}l.sort(((B,y)=>y.intersectionZ-B.intersectionZ));let g=[];for(let B=this._order.length-1;B>=0;B--){let y=this._order[B];if(n(y))for(let C=l.length-1;C>=0;C--){let E=l[C].feature;if(A[E.layer.id]<B)break;g.push(E),l.pop()}else for(let C of t){let E=C[y];if(E)for(let I of E)g.push(I.feature)}}return g}queryRenderedFeatures(t,n,A){n!=null&&n.filter&&this._validate(c.F.filter,"queryRenderedFeatures.filter",n.filter,null,n);let l={};if(n!=null&&n.layers){if(!(Array.isArray(n.layers)||n.layers instanceof Set))return this.fire(new c.l(new Error("parameters.layers must be an Array or a Set of strings"))),[];for(let E of n.layers){let I=this._layers[E];if(!I)return this.fire(new c.l(new Error(`The layer '${E}' does not exist in the map's style and cannot be queried for features.`))),[];l[I.source]=!0}}let g=[];n.availableImages=this._availableImages;let B=this._serializedAllLayers(),y=n.layers instanceof Set?n.layers:Array.isArray(n.layers)?new Set(n.layers):null,C=Object.assign(Object.assign({},n),{layers:y,globalState:this._globalState});for(let E in this.tileManagers)n.layers&&!l[E]||g.push(ji(this.tileManagers[E],this._layers,B,t,C,A,this.map.terrain?(I,b,F)=>this.map.terrain.getElevation(I,b,F):void 0));return this.placement&&g.push((function(E,I,b,F,T,P,R){let Y={},N=P.queryRenderedSymbols(F),K=[];for(let H of Object.keys(N).map(Number))K.push(R[H]);K.sort(Eo);for(let H of K){let j=H.featureIndex.lookupSymbolFeatures(N[H.bucketInstanceId],I,H.bucketIndex,H.sourceLayerIndex,{filterSpec:T.filter,globalState:T.globalState},T.layers,T.availableImages,E);for(let z in j){Y[z]||(Y[z]=[]);let Z=j[z];Z.sort(((X,te)=>{let Ae=H.featureSortOrder;if(Ae){let ae=Ae.indexOf(X.featureIndex);return Ae.indexOf(te.featureIndex)-ae}return te.featureIndex-X.featureIndex}));for(let X of Z)Y[z].push(X)}}return(function(H,j,z){for(let Z in H)for(let X of H[Z])Tr(X,z[j[Z].source]);return H})(Y,E,b)})(this._layers,B,this.tileManagers,t,C,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(g)}querySourceFeatures(t,n){n!=null&&n.filter&&this._validate(c.F.filter,"querySourceFeatures.filter",n.filter,null,n);let A=this.tileManagers[t];return A?(function(l,g){let B=l.getRenderableIds().map((E=>l.getTileByID(E))),y=[],C={};for(let E of B){let I=E.tileID.canonical.key;C[I]||(C[I]=!0,E.querySourceFeatures(y,g))}return y})(A,n?Object.assign(Object.assign({},n),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(t,n={}){this._checkLoaded();let A=this.light.getLight(),l=!1;for(let B in t)if(!c.bQ(t[B],A[B])){l=!0;break}if(!l)return;let g={now:Pe(),transition:c.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,n),this.light.updateTransitions(g)}getProjection(){var t;return(t=this.stylesheet)===null||t===void 0?void 0:t.projection}setProjection(t){this._checkLoaded();let n=t!=null?t:{type:"mercator"};if(this.stylesheet.projection=t,this.projection){if(this.projection.name===n.type)return;this.projection.destroy(),delete this.projection}this._setProjectionInternal(n.type)}getSky(){var t;return(t=this.stylesheet)===null||t===void 0?void 0:t.sky}setSky(t,n={}){this._checkLoaded();let A=this.getSky(),l=!1;if(!t&&!A)return;if(t&&!A)l=!0;else if(!t&&A)l=!0;else for(let B in t)if(!c.bQ(t[B],A[B])){l=!0;break}if(!l)return;let g={now:Pe(),transition:c.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,n),this.sky.updateTransitions(g)}_setProjectionInternal(t){let n=(function(A,l){let g={constrainOverride:l};if(Array.isArray(A)){let B=new bl({type:A});return{projection:B,transform:new Jn(g),cameraHelper:new or(B)}}switch(A){case"mercator":return{projection:new Bi,transform:new hn(g),cameraHelper:new un};case"globe":{let B=new bl({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:B,transform:new Jn(g),cameraHelper:new or(B)}}case"vertical-perspective":return{projection:new Fs,transform:new pn(g),cameraHelper:new Gi};default:return c.w(`Unknown projection name: ${A}. Falling back to mercator projection.`),{projection:new Bi,transform:new hn(g),cameraHelper:new un}}})(t,this.map.transformConstrain);this.projection=n.projection,this.map.migrateProjection(n.transform,n.cameraHelper);for(let A in this.tileManagers)this.tileManagers[A].reload()}_validate(t,n,A,l,g={}){return(g==null?void 0:g.validate)!==!1&&Ts(this,t.call(c.F,c.e({key:n,style:this.serialize(),value:A,styleSpec:c.x},l)))}_remove(t=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),kr().off(Io,this._rtlPluginLoaded);for(let n in this._layers)this._layers[n].setEventedParent(null);for(let n in this.tileManagers){let A=this.tileManagers[n];A.setEventedParent(null),A.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),t&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(t)}_clearSource(t){this.tileManagers[t].clearTiles()}_reloadSource(t){this.tileManagers[t].resume(),this.tileManagers[t].reload()}_updateSources(t){for(let n in this.tileManagers)this.tileManagers[n].update(t,this.map.terrain)}_generateCollisionBoxes(){for(let t in this.tileManagers)this._reloadSource(t)}_updatePlacement(t,n,A,l,g=!1){let B=!1,y=!1,C={};for(let E of this._order){let I=this._layers[E];if(I.type!=="symbol")continue;if(!C[I.source]){let F=this.tileManagers[I.source];C[I.source]=F.getRenderableIds(!0).map((T=>F.getTileByID(T))).sort(((T,P)=>P.tileID.overscaledZ-T.tileID.overscaledZ||(T.tileID.isLessThan(P.tileID)?-1:1)))}let b=this.crossTileSymbolIndex.addLayer(I,C[I.source],t.center.lng);B||(B=b)}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),g||(g=this._layerOrderChanged||A===0),(g||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(Pe(),t.zoom))&&(this.pauseablePlacement=new Yn(t,this.map.terrain,this._order,g,n,A,l,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,C),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(Pe()),y=!0),B&&this.pauseablePlacement.placement.setStale()),y||B)for(let E of this._order){let I=this._layers[E];I.type==="symbol"&&this.placement.updateLayerOpacities(I,C[I.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(Pe())}_releaseSymbolFadeTiles(){for(let t in this.tileManagers)this.tileManagers[t].releaseSymbolFadeTiles()}getImages(t,n){return c._(this,void 0,void 0,(function*(){let A=yield this.imageManager.getImages(n.icons);this._updateTilesForChangedImages();let l=this.tileManagers[n.source];return l&&l.setDependencies(n.tileID.key,n.type,n.icons),A}))}getGlyphs(t,n){return c._(this,void 0,void 0,(function*(){let A=yield this.glyphManager.getGlyphs(n.stacks),l=this.tileManagers[n.source];return l&&l.setDependencies(n.tileID.key,n.type,[""]),A}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,n={}){this._checkLoaded(),t&&this._validate(c.F.glyphs,"glyphs",t,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}getDashes(t,n){return c._(this,void 0,void 0,(function*(){let A={};for(let[l,g]of Object.entries(n.dashes))A[l]=this.lineAtlas.getDash(g.dasharray,g.round);return A}))}addSprite(t,n,A={},l){this._checkLoaded();let g=[{id:t,url:n}],B=[...xi(this.stylesheet.sprite),...g];this._validate(c.F.sprite,"sprite",B,null,A)||(this.stylesheet.sprite=B,this._loadSprite(g,!0,l))}removeSprite(t){this._checkLoaded();let n=xi(this.stylesheet.sprite);if(n.find((A=>A.id===t))){if(this._spritesImagesIds[t])for(let A of this._spritesImagesIds[t])this.imageManager.removeImage(A),this._changedImages[A]=!0;n.splice(n.findIndex((A=>A.id===t)),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new c.n("data",{dataType:"style"}))}else this.fire(new c.l(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return xi(this.stylesheet.sprite)}setSprite(t,n={},A){this._checkLoaded(),t&&this._validate(c.F.sprite,"sprite",t,null,n)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,A):(this._unloadSprite(),A&&A(null)))}destroy(){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null);for(let t in this.tileManagers){let n=this.tileManagers[t];n.setEventedParent(null),n.onRemove(this.map)}this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this._availableImages=[],this._spritesImagesIds={}),this.glyphManager&&this.glyphManager.destroy();for(let t in this._layers){let n=this._layers[t];n.setEventedParent(null),n.onRemove&&n.onRemove(this.map)}this._setInitialValues(),this.setEventedParent(null),this.dispatcher.unregisterMessageHandler("GG"),this.dispatcher.unregisterMessageHandler("GI"),this.dispatcher.unregisterMessageHandler("GDA"),this.dispatcher.remove(!0),this._listeners={},this._oneTimeListeners={}}}var Po=c.aS([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class dh{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,A,l,g,B,y,C,E){this.context=t;let I=this.boundPaintVertexBuffers.length!==l.length;for(let b=0;!I&&b<l.length;b++)this.boundPaintVertexBuffers[b]!==l[b]&&(I=!0);!this.vao||this.boundProgram!==n||this.boundLayoutVertexBuffer!==A||I||this.boundIndexBuffer!==g||this.boundVertexOffset!==B||this.boundDynamicVertexBuffer!==y||this.boundDynamicVertexBuffer2!==C||this.boundDynamicVertexBuffer3!==E?this.freshBind(n,A,l,g,B,y,C,E):(t.bindVertexArray.set(this.vao),y&&y.bind(),g!=null&&g.dynamicDraw&&g.bind(),C&&C.bind(),E&&E.bind())}freshBind(t,n,A,l,g,B,y,C){let E=t.numAttributes,I=this.context,b=I.gl;this.vao&&this.destroy(),this.vao=I.createVertexArray(),I.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=n,this.boundPaintVertexBuffers=A,this.boundIndexBuffer=l,this.boundVertexOffset=g,this.boundDynamicVertexBuffer=B,this.boundDynamicVertexBuffer2=y,this.boundDynamicVertexBuffer3=C,n.enableAttributes(b,t);for(let F of A)F.enableAttributes(b,t);B&&B.enableAttributes(b,t),y&&y.enableAttributes(b,t),C&&C.enableAttributes(b,t),n.bind(),n.setVertexAttribPointers(b,t,g);for(let F of A)F.bind(),F.setVertexAttribPointers(b,t,g);B&&(B.bind(),B.setVertexAttribPointers(b,t,g)),l&&l.bind(),y&&(y.bind(),y.setVertexAttribPointers(b,t,g)),C&&(C.bind(),C.setVertexAttribPointers(b,t,g)),I.currentNumAttributes=E}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}let Us=(d,t,n,A,l)=>({u_texture:0,u_ele_delta:d,u_fog_matrix:t,u_fog_color:n?n.properties.get("fog-color"):c.bo.white,u_fog_ground_blend:n?n.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:l?0:n?n.calculateFogBlendOpacity(A):0,u_horizon_color:n?n.properties.get("horizon-color"):c.bo.white,u_horizon_fog_blend:n?n.properties.get("horizon-fog-blend"):1,u_is_globe_mode:l?1:0}),gh={mainMatrix:"u_projection_matrix",tileMercatorCoords:"u_projection_tile_mercator_coords",clippingPlane:"u_projection_clipping_plane",projectionTransition:"u_projection_transition",fallbackMatrix:"u_projection_fallback_matrix"};function yr(d){let t=[];for(let n of d){if(n===null)continue;let A=n.split(" ");t.push(A.pop())}return t}class ph{constructor(t,n,A,l,g,B,y,C,E=[]){let I=t.gl;this.program=I.createProgram();let b=yr(n.staticAttributes),F=A?A.getBinderAttributes():[],T=b.concat(F),P=Et.prelude.staticUniforms?yr(Et.prelude.staticUniforms):[],R=y.staticUniforms?yr(y.staticUniforms):[],Y=n.staticUniforms?yr(n.staticUniforms):[],N=A?A.getBinderUniforms():[],K=P.concat(R).concat(Y).concat(N),H=[];for(let ae of K)H.includes(ae)||H.push(ae);let j=A?A.defines():[];nr(I)&&j.unshift("#version 300 es"),g&&j.push("#define OVERDRAW_INSPECTOR;"),B&&j.push("#define TERRAIN3D;"),C&&j.push(C),E&&j.push(...E);let z=j.concat(Et.prelude.fragmentSource,y.fragmentSource,n.fragmentSource).join(`
|
|
`),Z=j.concat(Et.prelude.vertexSource,y.vertexSource,n.vertexSource).join(`
|
|
`);nr(I)||(z=(function(ae){return ae.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")})(z),Z=(function(ae){return ae.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")})(Z));let X=I.createShader(I.FRAGMENT_SHADER);if(I.isContextLost())return void(this.failedToCreate=!0);if(I.shaderSource(X,z),I.compileShader(X),!I.getShaderParameter(X,I.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${I.getShaderInfoLog(X)}`);I.attachShader(this.program,X);let te=I.createShader(I.VERTEX_SHADER);if(I.isContextLost())return void(this.failedToCreate=!0);if(I.shaderSource(te,Z),I.compileShader(te),!I.getShaderParameter(te,I.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${I.getShaderInfoLog(te)}`);I.attachShader(this.program,te),this.attributes={};let Ae={};this.numAttributes=T.length;for(let ae=0;ae<this.numAttributes;ae++)T[ae]&&(I.bindAttribLocation(this.program,ae,T[ae]),this.attributes[T[ae]]=ae);if(I.linkProgram(this.program),!I.getProgramParameter(this.program,I.LINK_STATUS))throw new Error(`Program failed to link: ${I.getProgramInfoLog(this.program)}`);I.deleteShader(te),I.deleteShader(X);for(let ae of H)if(ae&&!Ae[ae]){let Be=I.getUniformLocation(this.program,ae);Be&&(Ae[ae]=Be)}this.fixedUniforms=l(t,Ae),this.terrainUniforms=((ae,Be)=>({u_depth:new c.b_(ae,Be.u_depth),u_terrain:new c.b_(ae,Be.u_terrain),u_terrain_dim:new c.bp(ae,Be.u_terrain_dim),u_terrain_matrix:new c.c0(ae,Be.u_terrain_matrix),u_terrain_unpack:new c.c1(ae,Be.u_terrain_unpack),u_terrain_exaggeration:new c.bp(ae,Be.u_terrain_exaggeration)}))(t,Ae),this.projectionUniforms=((ae,Be)=>({u_projection_matrix:new c.c0(ae,Be.u_projection_matrix),u_projection_tile_mercator_coords:new c.c1(ae,Be.u_projection_tile_mercator_coords),u_projection_clipping_plane:new c.c1(ae,Be.u_projection_clipping_plane),u_projection_transition:new c.bp(ae,Be.u_projection_transition),u_projection_fallback_matrix:new c.c0(ae,Be.u_projection_fallback_matrix)}))(t,Ae),this.binderUniforms=A?A.getUniforms(t,Ae):[]}draw(t,n,A,l,g,B,y,C,E,I,b,F,T,P,R,Y,N,K,H){var j;let z=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(A),t.setStencilMode(l),t.setColorMode(g),t.setCullFace(B),C){t.activeTexture.set(z.TEXTURE2),z.bindTexture(z.TEXTURE_2D,C.depthTexture),t.activeTexture.set(z.TEXTURE3),z.bindTexture(z.TEXTURE_2D,C.texture);for(let X in this.terrainUniforms)this.terrainUniforms[X].set(C[X])}if(E)for(let X in E)this.projectionUniforms[gh[X]].set(E[X]);if(y)for(let X in this.fixedUniforms)this.fixedUniforms[X].set(y[X]);Y&&Y.setUniforms(t,this.binderUniforms,P,{zoom:R});let Z=0;switch(n){case z.LINES:Z=2;break;case z.TRIANGLES:Z=3;break;case z.LINE_STRIP:Z=1}for(let X of T.get())X.vaos||(X.vaos={}),(j=X.vaos)[I]||(j[I]=new dh),X.vaos[I].bind(t,this,b,Y?Y.getPaintVertexBuffers():[],F,X.vertexOffset,N,K,H),z.drawElements(n,X.primitiveLength*Z,z.UNSIGNED_SHORT,X.primitiveOffset*Z*2)}}function oa(d,t,n){let A=1/c.aK(n,1,t.transform.tileZoom),l=Math.pow(2,n.tileID.overscaledZ),g=n.tileSize*Math.pow(2,t.transform.tileZoom)/l,B=g*(n.tileID.canonical.x+n.tileID.wrap*l),y=g*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[A,d.fromScale,d.toScale],u_fade:d.t,u_pixel_coord_upper:[B>>16,y>>16],u_pixel_coord_lower:[65535&B,65535&y]}}let Sl=(d,t,n,A)=>{let l=d.style.light,g=l.properties.get("position"),B=[g.x,g.y,g.z],y=c.c4();l.properties.get("anchor")==="viewport"&&c.c5(y,d.transform.bearingInRadians),c.c6(B,B,y);let C=d.transform.transformLightDirection(B),E=l.properties.get("color");return{u_lightpos:B,u_lightpos_globe:C,u_lightintensity:l.properties.get("intensity"),u_lightcolor:[E.r,E.g,E.b],u_vertical_gradient:+t,u_opacity:n,u_fill_translate:A}},Ml=(d,t,n,A,l,g,B)=>c.e(Sl(d,t,n,A),oa(g,d,B),{u_height_factor:-Math.pow(2,l.overscaledZ)/B.tileSize/8}),Ls=(d,t,n,A)=>c.e(oa(t,d,n),{u_fill_translate:A}),Tl=(d,t)=>({u_world:d,u_fill_translate:t}),Ul=(d,t,n,A,l)=>c.e(Ls(d,t,n,l),{u_world:A}),Ll=(d,t,n,A,l)=>{let g=d.transform,B,y,C=0;if(n.paint.get("circle-pitch-alignment")==="map"){let E=c.aK(t,1,g.zoom);B=!0,y=[E,E],C=E/(c.a6*Math.pow(2,t.tileID.overscaledZ))*2*Math.PI*l}else B=!1,y=g.pixelsToGLUnits;return{u_camera_to_center_distance:g.cameraToCenterDistance,u_scale_with_map:+(n.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+B,u_device_pixel_ratio:d.pixelRatio,u_extrude_scale:y,u_globe_extrude_scale:C,u_translate:A}},kl=d=>({u_pixel_extrude_scale:[1/d.width,1/d.height]}),mn=d=>({u_viewport_size:[d.width,d.height]}),sa=(d,t=1)=>({u_color:d,u_overlay:0,u_overlay_scale:t}),Aa=(d,t,n,A)=>{let l=c.aK(d,1,t)/(c.a6*Math.pow(2,d.tileID.overscaledZ))*2*Math.PI*A;return{u_extrude_scale:c.aK(d,1,t),u_intensity:n,u_globe_extrude_scale:l}},qn=(d,t,n,A)=>{let l=c.O();c.c7(l,0,d.width,d.height,0,0,1);let g=d.context.gl;return{u_matrix:l,u_world:[g.drawingBufferWidth,g.drawingBufferHeight],u_image:n,u_color_ramp:A,u_opacity:t.paint.get("heatmap-opacity")}},fh=(d,t,n)=>{let A=n.paint.get("hillshade-accent-color"),l;switch(n.paint.get("hillshade-method")){case"basic":l=4;break;case"combined":l=1;break;case"igor":l=2;break;case"multidirectional":l=3;break;default:l=0}let g=n.getIlluminationProperties();for(let B=0;B<g.directionRadians.length;B++)n.paint.get("hillshade-illumination-anchor")==="viewport"&&(g.directionRadians[B]+=d.transform.bearingInRadians);return{u_image:0,u_latrange:mh(0,t.tileID),u_exaggeration:n.paint.get("hillshade-exaggeration"),u_altitudes:g.altitudeRadians,u_azimuths:g.directionRadians,u_accent:A,u_method:l,u_highlights:g.highlightColor,u_shadows:g.shadowColor}},ks=(d,t)=>{let n=t.stride,A=c.O();return c.c7(A,0,c.a6,-c.a6,0,0,1),c.Q(A,A,[0,-c.a6,0]),{u_matrix:A,u_image:1,u_dimension:[n,n],u_zoom:d.overscaledZ,u_unpack:t.getUnpackVector()}};function mh(d,t){let n=Math.pow(2,t.canonical.z),A=t.canonical.y;return[new c.a7(0,A/n).toLngLat().lat,new c.a7(0,(A+1)/n).toLngLat().lat]}let Bh=(d,t,n=0)=>({u_image:0,u_unpack:t.getUnpackVector(),u_dimension:[t.stride,t.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:n,u_opacity:d.paint.get("color-relief-opacity")}),Go=(d,t,n,A)=>{let l=d.transform;return{u_translation:hr(d,t,n),u_ratio:A/c.aK(t,1,l.zoom),u_device_pixel_ratio:d.pixelRatio,u_units_to_pixels:[1/l.pixelsToGLUnits[0],1/l.pixelsToGLUnits[1]]}},Pl=(d,t,n,A,l)=>c.e(Go(d,t,n,A),{u_image:0,u_image_height:l}),Gl=(d,t,n,A,l)=>{let g=d.transform,B=Wn(t,g);return{u_translation:hr(d,t,n),u_texsize:t.imageAtlasTexture.size,u_ratio:A/c.aK(t,1,g.zoom),u_device_pixel_ratio:d.pixelRatio,u_image:0,u_scale:[B,l.fromScale,l.toScale],u_fade:l.t,u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]]}},aa=(d,t,n,A,l)=>{let g=Wn(t,d.transform);return c.e(Go(d,t,n,A),{u_tileratio:g,u_crossfade_from:l.fromScale,u_crossfade_to:l.toScale,u_image:0,u_mix:l.t,u_lineatlas_width:d.lineAtlas.width,u_lineatlas_height:d.lineAtlas.height})},Rl=(d,t,n,A,l,g)=>{let B=Wn(t,d.transform);return c.e(Go(d,t,n,A),{u_image:0,u_image_height:g,u_tileratio:B,u_crossfade_from:l.fromScale,u_crossfade_to:l.toScale,u_image_dash:1,u_mix:l.t,u_lineatlas_width:d.lineAtlas.width,u_lineatlas_height:d.lineAtlas.height})};function Wn(d,t){return 1/c.aK(d,1,t.tileZoom)}function hr(d,t,n){return c.aL(d.transform,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}let la=(d,t,n,A,l)=>{return{u_tl_parent:d,u_scale_parent:t,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*A.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:A.paint.get("raster-brightness-min"),u_brightness_high:A.paint.get("raster-brightness-max"),u_saturation_factor:(B=A.paint.get("raster-saturation"),B>0?1-1/(1.001-B):-B),u_contrast_factor:(g=A.paint.get("raster-contrast"),g>0?1/(1-g):1+g),u_spin_weights:ca(A.paint.get("raster-hue-rotate")),u_coords_top:[l[0].x,l[0].y,l[1].x,l[1].y],u_coords_bottom:[l[3].x,l[3].y,l[2].x,l[2].y]};var g,B};function ca(d){d*=Math.PI/180;let t=Math.sin(d),n=Math.cos(d);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}let Ps=(d,t,n,A,l,g,B,y,C,E,I,b,F)=>{let T=B.transform;return{u_is_size_zoom_constant:+(d==="constant"||d==="source"),u_is_size_feature_constant:+(d==="constant"||d==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:T.cameraToCenterDistance,u_pitch:T.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:T.width/T.height,u_fade_change:B.options.fadeDuration?B.symbolFadeChange:1,u_label_plane_matrix:y,u_coord_matrix:C,u_is_text:+I,u_pitch_with_map:+A,u_is_along_line:l,u_is_variable_anchor:g,u_texsize:b,u_texture:0,u_translation:E,u_pitched_scale:F}},ha=(d,t,n,A,l,g,B,y,C,E,I,b,F,T)=>{let P=B.transform;return c.e(Ps(d,t,n,A,l,g,B,y,C,E,I,b,T),{u_gamma_scale:A?Math.cos(P.pitch*Math.PI/180)*P.cameraToCenterDistance:1,u_device_pixel_ratio:B.pixelRatio,u_is_halo:F?1:0,u_is_plain:1})},ua=(d,t,n,A,l,g,B,y,C,E,I,b,F)=>c.e(ha(d,t,n,A,l,g,B,y,C,E,!0,I,!0,F),{u_texsize_icon:b,u_texture_icon:1}),Bn=(d,t)=>({u_opacity:d,u_color:t}),da=(d,t,n,A,l)=>c.e((function(g,B,y,C){let E=y.imageManager.getPattern(g.from.toString()),I=y.imageManager.getPattern(g.to.toString()),{width:b,height:F}=y.imageManager.getPixelSize(),T=Math.pow(2,C.tileID.overscaledZ),P=C.tileSize*Math.pow(2,y.transform.tileZoom)/T,R=P*(C.tileID.canonical.x+C.tileID.wrap*T),Y=P*C.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:E.tl,u_pattern_br_a:E.br,u_pattern_tl_b:I.tl,u_pattern_br_b:I.br,u_texsize:[b,F],u_mix:B.t,u_pattern_size_a:E.displaySize,u_pattern_size_b:I.displaySize,u_scale_a:B.fromScale,u_scale_b:B.toScale,u_tile_units_to_pixels:1/c.aK(C,1,y.transform.tileZoom),u_pixel_coord_upper:[R>>16,Y>>16],u_pixel_coord_lower:[65535&R,65535&Y]}})(n,l,t,A),{u_opacity:d}),Ol=(d,t)=>{},_h={fillExtrusion:(d,t)=>({u_lightpos:new c.c2(d,t.u_lightpos),u_lightpos_globe:new c.c2(d,t.u_lightpos_globe),u_lightintensity:new c.bp(d,t.u_lightintensity),u_lightcolor:new c.c2(d,t.u_lightcolor),u_vertical_gradient:new c.bp(d,t.u_vertical_gradient),u_opacity:new c.bp(d,t.u_opacity),u_fill_translate:new c.c3(d,t.u_fill_translate)}),fillExtrusionPattern:(d,t)=>({u_lightpos:new c.c2(d,t.u_lightpos),u_lightpos_globe:new c.c2(d,t.u_lightpos_globe),u_lightintensity:new c.bp(d,t.u_lightintensity),u_lightcolor:new c.c2(d,t.u_lightcolor),u_vertical_gradient:new c.bp(d,t.u_vertical_gradient),u_height_factor:new c.bp(d,t.u_height_factor),u_opacity:new c.bp(d,t.u_opacity),u_fill_translate:new c.c3(d,t.u_fill_translate),u_image:new c.b_(d,t.u_image),u_texsize:new c.c3(d,t.u_texsize),u_pixel_coord_upper:new c.c3(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.c3(d,t.u_pixel_coord_lower),u_scale:new c.c2(d,t.u_scale),u_fade:new c.bp(d,t.u_fade)}),fill:(d,t)=>({u_fill_translate:new c.c3(d,t.u_fill_translate)}),fillPattern:(d,t)=>({u_image:new c.b_(d,t.u_image),u_texsize:new c.c3(d,t.u_texsize),u_pixel_coord_upper:new c.c3(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.c3(d,t.u_pixel_coord_lower),u_scale:new c.c2(d,t.u_scale),u_fade:new c.bp(d,t.u_fade),u_fill_translate:new c.c3(d,t.u_fill_translate)}),fillOutline:(d,t)=>({u_world:new c.c3(d,t.u_world),u_fill_translate:new c.c3(d,t.u_fill_translate)}),fillOutlinePattern:(d,t)=>({u_world:new c.c3(d,t.u_world),u_image:new c.b_(d,t.u_image),u_texsize:new c.c3(d,t.u_texsize),u_pixel_coord_upper:new c.c3(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.c3(d,t.u_pixel_coord_lower),u_scale:new c.c2(d,t.u_scale),u_fade:new c.bp(d,t.u_fade),u_fill_translate:new c.c3(d,t.u_fill_translate)}),circle:(d,t)=>({u_camera_to_center_distance:new c.bp(d,t.u_camera_to_center_distance),u_scale_with_map:new c.b_(d,t.u_scale_with_map),u_pitch_with_map:new c.b_(d,t.u_pitch_with_map),u_extrude_scale:new c.c3(d,t.u_extrude_scale),u_device_pixel_ratio:new c.bp(d,t.u_device_pixel_ratio),u_globe_extrude_scale:new c.bp(d,t.u_globe_extrude_scale),u_translate:new c.c3(d,t.u_translate)}),collisionBox:(d,t)=>({u_pixel_extrude_scale:new c.c3(d,t.u_pixel_extrude_scale)}),collisionCircle:(d,t)=>({u_viewport_size:new c.c3(d,t.u_viewport_size)}),debug:(d,t)=>({u_color:new c.b$(d,t.u_color),u_overlay:new c.b_(d,t.u_overlay),u_overlay_scale:new c.bp(d,t.u_overlay_scale)}),depth:Ol,clippingMask:Ol,heatmap:(d,t)=>({u_extrude_scale:new c.bp(d,t.u_extrude_scale),u_intensity:new c.bp(d,t.u_intensity),u_globe_extrude_scale:new c.bp(d,t.u_globe_extrude_scale)}),heatmapTexture:(d,t)=>({u_matrix:new c.c0(d,t.u_matrix),u_world:new c.c3(d,t.u_world),u_image:new c.b_(d,t.u_image),u_color_ramp:new c.b_(d,t.u_color_ramp),u_opacity:new c.bp(d,t.u_opacity)}),hillshade:(d,t)=>({u_image:new c.b_(d,t.u_image),u_latrange:new c.c3(d,t.u_latrange),u_exaggeration:new c.bp(d,t.u_exaggeration),u_altitudes:new c.c9(d,t.u_altitudes),u_azimuths:new c.c9(d,t.u_azimuths),u_accent:new c.b$(d,t.u_accent),u_method:new c.b_(d,t.u_method),u_shadows:new c.c8(d,t.u_shadows),u_highlights:new c.c8(d,t.u_highlights)}),hillshadePrepare:(d,t)=>({u_matrix:new c.c0(d,t.u_matrix),u_image:new c.b_(d,t.u_image),u_dimension:new c.c3(d,t.u_dimension),u_zoom:new c.bp(d,t.u_zoom),u_unpack:new c.c1(d,t.u_unpack)}),colorRelief:(d,t)=>({u_image:new c.b_(d,t.u_image),u_unpack:new c.c1(d,t.u_unpack),u_dimension:new c.c3(d,t.u_dimension),u_elevation_stops:new c.b_(d,t.u_elevation_stops),u_color_stops:new c.b_(d,t.u_color_stops),u_color_ramp_size:new c.b_(d,t.u_color_ramp_size),u_opacity:new c.bp(d,t.u_opacity)}),line:(d,t)=>({u_translation:new c.c3(d,t.u_translation),u_ratio:new c.bp(d,t.u_ratio),u_device_pixel_ratio:new c.bp(d,t.u_device_pixel_ratio),u_units_to_pixels:new c.c3(d,t.u_units_to_pixels)}),lineGradient:(d,t)=>({u_translation:new c.c3(d,t.u_translation),u_ratio:new c.bp(d,t.u_ratio),u_device_pixel_ratio:new c.bp(d,t.u_device_pixel_ratio),u_units_to_pixels:new c.c3(d,t.u_units_to_pixels),u_image:new c.b_(d,t.u_image),u_image_height:new c.bp(d,t.u_image_height)}),linePattern:(d,t)=>({u_translation:new c.c3(d,t.u_translation),u_texsize:new c.c3(d,t.u_texsize),u_ratio:new c.bp(d,t.u_ratio),u_device_pixel_ratio:new c.bp(d,t.u_device_pixel_ratio),u_image:new c.b_(d,t.u_image),u_units_to_pixels:new c.c3(d,t.u_units_to_pixels),u_scale:new c.c2(d,t.u_scale),u_fade:new c.bp(d,t.u_fade)}),lineSDF:(d,t)=>({u_translation:new c.c3(d,t.u_translation),u_ratio:new c.bp(d,t.u_ratio),u_device_pixel_ratio:new c.bp(d,t.u_device_pixel_ratio),u_units_to_pixels:new c.c3(d,t.u_units_to_pixels),u_image:new c.b_(d,t.u_image),u_mix:new c.bp(d,t.u_mix),u_tileratio:new c.bp(d,t.u_tileratio),u_crossfade_from:new c.bp(d,t.u_crossfade_from),u_crossfade_to:new c.bp(d,t.u_crossfade_to),u_lineatlas_width:new c.bp(d,t.u_lineatlas_width),u_lineatlas_height:new c.bp(d,t.u_lineatlas_height)}),lineGradientSDF:(d,t)=>({u_translation:new c.c3(d,t.u_translation),u_ratio:new c.bp(d,t.u_ratio),u_device_pixel_ratio:new c.bp(d,t.u_device_pixel_ratio),u_units_to_pixels:new c.c3(d,t.u_units_to_pixels),u_image:new c.b_(d,t.u_image),u_image_height:new c.bp(d,t.u_image_height),u_tileratio:new c.bp(d,t.u_tileratio),u_crossfade_from:new c.bp(d,t.u_crossfade_from),u_crossfade_to:new c.bp(d,t.u_crossfade_to),u_image_dash:new c.b_(d,t.u_image_dash),u_mix:new c.bp(d,t.u_mix),u_lineatlas_width:new c.bp(d,t.u_lineatlas_width),u_lineatlas_height:new c.bp(d,t.u_lineatlas_height)}),raster:(d,t)=>({u_tl_parent:new c.c3(d,t.u_tl_parent),u_scale_parent:new c.bp(d,t.u_scale_parent),u_buffer_scale:new c.bp(d,t.u_buffer_scale),u_fade_t:new c.bp(d,t.u_fade_t),u_opacity:new c.bp(d,t.u_opacity),u_image0:new c.b_(d,t.u_image0),u_image1:new c.b_(d,t.u_image1),u_brightness_low:new c.bp(d,t.u_brightness_low),u_brightness_high:new c.bp(d,t.u_brightness_high),u_saturation_factor:new c.bp(d,t.u_saturation_factor),u_contrast_factor:new c.bp(d,t.u_contrast_factor),u_spin_weights:new c.c2(d,t.u_spin_weights),u_coords_top:new c.c1(d,t.u_coords_top),u_coords_bottom:new c.c1(d,t.u_coords_bottom)}),symbolIcon:(d,t)=>({u_is_size_zoom_constant:new c.b_(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.b_(d,t.u_is_size_feature_constant),u_size_t:new c.bp(d,t.u_size_t),u_size:new c.bp(d,t.u_size),u_camera_to_center_distance:new c.bp(d,t.u_camera_to_center_distance),u_pitch:new c.bp(d,t.u_pitch),u_rotate_symbol:new c.b_(d,t.u_rotate_symbol),u_aspect_ratio:new c.bp(d,t.u_aspect_ratio),u_fade_change:new c.bp(d,t.u_fade_change),u_label_plane_matrix:new c.c0(d,t.u_label_plane_matrix),u_coord_matrix:new c.c0(d,t.u_coord_matrix),u_is_text:new c.b_(d,t.u_is_text),u_pitch_with_map:new c.b_(d,t.u_pitch_with_map),u_is_along_line:new c.b_(d,t.u_is_along_line),u_is_variable_anchor:new c.b_(d,t.u_is_variable_anchor),u_texsize:new c.c3(d,t.u_texsize),u_texture:new c.b_(d,t.u_texture),u_translation:new c.c3(d,t.u_translation),u_pitched_scale:new c.bp(d,t.u_pitched_scale)}),symbolSDF:(d,t)=>({u_is_size_zoom_constant:new c.b_(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.b_(d,t.u_is_size_feature_constant),u_size_t:new c.bp(d,t.u_size_t),u_size:new c.bp(d,t.u_size),u_camera_to_center_distance:new c.bp(d,t.u_camera_to_center_distance),u_pitch:new c.bp(d,t.u_pitch),u_rotate_symbol:new c.b_(d,t.u_rotate_symbol),u_aspect_ratio:new c.bp(d,t.u_aspect_ratio),u_fade_change:new c.bp(d,t.u_fade_change),u_label_plane_matrix:new c.c0(d,t.u_label_plane_matrix),u_coord_matrix:new c.c0(d,t.u_coord_matrix),u_is_text:new c.b_(d,t.u_is_text),u_pitch_with_map:new c.b_(d,t.u_pitch_with_map),u_is_along_line:new c.b_(d,t.u_is_along_line),u_is_variable_anchor:new c.b_(d,t.u_is_variable_anchor),u_texsize:new c.c3(d,t.u_texsize),u_texture:new c.b_(d,t.u_texture),u_gamma_scale:new c.bp(d,t.u_gamma_scale),u_device_pixel_ratio:new c.bp(d,t.u_device_pixel_ratio),u_is_halo:new c.b_(d,t.u_is_halo),u_is_plain:new c.b_(d,t.u_is_plain),u_translation:new c.c3(d,t.u_translation),u_pitched_scale:new c.bp(d,t.u_pitched_scale)}),symbolTextAndIcon:(d,t)=>({u_is_size_zoom_constant:new c.b_(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.b_(d,t.u_is_size_feature_constant),u_size_t:new c.bp(d,t.u_size_t),u_size:new c.bp(d,t.u_size),u_camera_to_center_distance:new c.bp(d,t.u_camera_to_center_distance),u_pitch:new c.bp(d,t.u_pitch),u_rotate_symbol:new c.b_(d,t.u_rotate_symbol),u_aspect_ratio:new c.bp(d,t.u_aspect_ratio),u_fade_change:new c.bp(d,t.u_fade_change),u_label_plane_matrix:new c.c0(d,t.u_label_plane_matrix),u_coord_matrix:new c.c0(d,t.u_coord_matrix),u_is_text:new c.b_(d,t.u_is_text),u_pitch_with_map:new c.b_(d,t.u_pitch_with_map),u_is_along_line:new c.b_(d,t.u_is_along_line),u_is_variable_anchor:new c.b_(d,t.u_is_variable_anchor),u_texsize:new c.c3(d,t.u_texsize),u_texsize_icon:new c.c3(d,t.u_texsize_icon),u_texture:new c.b_(d,t.u_texture),u_texture_icon:new c.b_(d,t.u_texture_icon),u_gamma_scale:new c.bp(d,t.u_gamma_scale),u_device_pixel_ratio:new c.bp(d,t.u_device_pixel_ratio),u_is_halo:new c.b_(d,t.u_is_halo),u_translation:new c.c3(d,t.u_translation),u_pitched_scale:new c.bp(d,t.u_pitched_scale)}),background:(d,t)=>({u_opacity:new c.bp(d,t.u_opacity),u_color:new c.b$(d,t.u_color)}),backgroundPattern:(d,t)=>({u_opacity:new c.bp(d,t.u_opacity),u_image:new c.b_(d,t.u_image),u_pattern_tl_a:new c.c3(d,t.u_pattern_tl_a),u_pattern_br_a:new c.c3(d,t.u_pattern_br_a),u_pattern_tl_b:new c.c3(d,t.u_pattern_tl_b),u_pattern_br_b:new c.c3(d,t.u_pattern_br_b),u_texsize:new c.c3(d,t.u_texsize),u_mix:new c.bp(d,t.u_mix),u_pattern_size_a:new c.c3(d,t.u_pattern_size_a),u_pattern_size_b:new c.c3(d,t.u_pattern_size_b),u_scale_a:new c.bp(d,t.u_scale_a),u_scale_b:new c.bp(d,t.u_scale_b),u_pixel_coord_upper:new c.c3(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.c3(d,t.u_pixel_coord_lower),u_tile_units_to_pixels:new c.bp(d,t.u_tile_units_to_pixels)}),terrain:(d,t)=>({u_texture:new c.b_(d,t.u_texture),u_ele_delta:new c.bp(d,t.u_ele_delta),u_fog_matrix:new c.c0(d,t.u_fog_matrix),u_fog_color:new c.b$(d,t.u_fog_color),u_fog_ground_blend:new c.bp(d,t.u_fog_ground_blend),u_fog_ground_blend_opacity:new c.bp(d,t.u_fog_ground_blend_opacity),u_horizon_color:new c.b$(d,t.u_horizon_color),u_horizon_fog_blend:new c.bp(d,t.u_horizon_fog_blend),u_is_globe_mode:new c.bp(d,t.u_is_globe_mode)}),terrainDepth:(d,t)=>({u_ele_delta:new c.bp(d,t.u_ele_delta)}),terrainCoords:(d,t)=>({u_texture:new c.b_(d,t.u_texture),u_terrain_coords_id:new c.bp(d,t.u_terrain_coords_id),u_ele_delta:new c.bp(d,t.u_ele_delta)}),projectionErrorMeasurement:(d,t)=>({u_input:new c.bp(d,t.u_input),u_output_expected:new c.bp(d,t.u_output_expected)}),atmosphere:(d,t)=>({u_sun_pos:new c.c2(d,t.u_sun_pos),u_atmosphere_blend:new c.bp(d,t.u_atmosphere_blend),u_globe_position:new c.c2(d,t.u_globe_position),u_globe_radius:new c.bp(d,t.u_globe_radius),u_inv_proj_matrix:new c.c0(d,t.u_inv_proj_matrix)}),sky:(d,t)=>({u_sky_color:new c.b$(d,t.u_sky_color),u_horizon_color:new c.b$(d,t.u_horizon_color),u_horizon:new c.c3(d,t.u_horizon),u_horizon_normal:new c.c3(d,t.u_horizon_normal),u_sky_horizon_blend:new c.bp(d,t.u_sky_horizon_blend),u_sky_blend:new c.bp(d,t.u_sky_blend)})};class yh{constructor(t,n,A){this.context=t;let l=t.gl;this.buffer=l.createBuffer(),this.dynamicDraw=!!A,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),l.bufferData(l.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?l.DYNAMIC_DRAW:l.STATIC_DRAW),this.dynamicDraw||n.freeBufferAfterUpload()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){let n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Qh={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Nl{constructor(t,n,A,l){this.length=n.length,this.attributes=A,this.itemSize=n.bytesPerElement,this.dynamicDraw=l,this.context=t;let g=t.gl;this.buffer=g.createBuffer(),t.bindVertexBuffer.set(this.buffer),g.bufferData(g.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?g.DYNAMIC_DRAW:g.STATIC_DRAW),this.dynamicDraw||n.freeBufferAfterUpload()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);let n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,n){for(let A of this.attributes){let l=n.attributes[A.name];l!==void 0&&t.enableVertexAttribArray(l)}}setVertexAttribPointers(t,n,A){for(let l of this.attributes){let g=n.attributes[l.name];g!==void 0&&t.vertexAttribPointer(g,l.components,t[Qh[l.type]],!1,this.itemSize,l.offset+this.itemSize*(A||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class at{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class zl extends at{getDefault(){return c.bo.transparent}set(t){let n=this.current;(t.r!==n.r||t.g!==n.g||t.b!==n.b||t.a!==n.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Gs extends at{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class Rs extends at{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class Os extends at{getDefault(){return[!0,!0,!0,!0]}set(t){let n=this.current;(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2]||t[3]!==n[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class ga extends at{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class _n extends at{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class Ro extends at{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){let n=this.current;(t.func!==n.func||t.ref!==n.ref||t.mask!==n.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class $n extends at{getDefault(){let t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){let n=this.current;(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class Vi extends at{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;t?n.enable(n.STENCIL_TEST):n.disable(n.STENCIL_TEST),this.current=t,this.dirty=!1}}class Yl extends at{getDefault(){return[0,1]}set(t){let n=this.current;(t[0]!==n[0]||t[1]!==n[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class Kl extends at{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;t?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST),this.current=t,this.dirty=!1}}class pa extends at{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class yn extends at{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;t?n.enable(n.BLEND):n.disable(n.BLEND),this.current=t,this.dirty=!1}}class Ns extends at{getDefault(){let t=this.gl;return[t.ONE,t.ZERO]}set(t){let n=this.current;(t[0]!==n[0]||t[1]!==n[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class zs extends at{getDefault(){return c.bo.transparent}set(t){let n=this.current;(t.r!==n.r||t.g!==n.g||t.b!==n.b||t.a!==n.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Oo extends at{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class Ys extends at{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;t?n.enable(n.CULL_FACE):n.disable(n.CULL_FACE),this.current=t,this.dirty=!1}}class jl extends at{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class eo extends at{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class to extends at{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class Xl extends at{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class fa extends at{getDefault(){let t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){let n=this.current;(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2]||t[3]!==n[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class He extends at{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.bindFramebuffer(n.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class Ks extends at{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.bindRenderbuffer(n.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Ch extends at{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.bindTexture(n.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class Vl extends at{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.bindBuffer(n.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class No extends at{getDefault(){return null}set(t){let n=this.gl;n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class wh extends at{getDefault(){return null}set(t){var n;if(t===this.current&&!this.dirty)return;let A=this.gl;nr(A)?A.bindVertexArray(t):(n=A.getExtension("OES_vertex_array_object"))===null||n===void 0||n.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class Eh extends at{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.pixelStorei(n.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class Zl extends at{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class Ih extends at{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class zo extends at{constructor(t,n){super(t),this.context=t,this.parent=n}getDefault(){return null}}class js extends zo{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let n=this.gl;n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class Yo extends zo{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let n=this.gl;n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Xs extends zo{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let n=this.gl;n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,t),this.current=t,this.dirty=!1}}let Vs="Framebuffer is not complete";class Hl{constructor(t,n,A,l,g){this.context=t,this.width=n,this.height=A;let B=t.gl,y=this.framebuffer=B.createFramebuffer();if(this.colorAttachment=new js(t,y),l)this.depthAttachment=g?new Xs(t,y):new Yo(t,y);else if(g)throw new Error("Stencil cannot be set without depth");if(B.checkFramebufferStatus(B.FRAMEBUFFER)!==B.FRAMEBUFFER_COMPLETE)throw new Error(Vs)}destroy(){let t=this.context.gl,n=this.colorAttachment.get();if(n&&t.deleteTexture(n),this.depthAttachment){let A=this.depthAttachment.get();A&&t.deleteRenderbuffer(A)}t.deleteFramebuffer(this.framebuffer)}}class Zs{constructor(t){var n,A;if(this.gl=t,this.clearColor=new zl(this),this.clearDepth=new Gs(this),this.clearStencil=new Rs(this),this.colorMask=new Os(this),this.depthMask=new ga(this),this.stencilMask=new _n(this),this.stencilFunc=new Ro(this),this.stencilOp=new $n(this),this.stencilTest=new Vi(this),this.depthRange=new Yl(this),this.depthTest=new Kl(this),this.depthFunc=new pa(this),this.blend=new yn(this),this.blendFunc=new Ns(this),this.blendColor=new zs(this),this.blendEquation=new Oo(this),this.cullFace=new Ys(this),this.cullFaceSide=new jl(this),this.frontFace=new eo(this),this.program=new to(this),this.activeTexture=new Xl(this),this.viewport=new fa(this),this.bindFramebuffer=new He(this),this.bindRenderbuffer=new Ks(this),this.bindTexture=new Ch(this),this.bindVertexBuffer=new Vl(this),this.bindElementBuffer=new No(this),this.bindVertexArray=new wh(this),this.pixelStoreUnpack=new Eh(this),this.pixelStoreUnpackPremultiplyAlpha=new Zl(this),this.pixelStoreUnpackFlipY=new Ih(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),nr(t)){this.HALF_FLOAT=t.HALF_FLOAT;let l=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(n=t.RGBA16F)!==null&&n!==void 0?n:l==null?void 0:l.RGBA16F_EXT,this.RGB16F=(A=t.RGB16F)!==null&&A!==void 0?A:l==null?void 0:l.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");let l=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=l==null?void 0:l.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,n){return new yh(this,t,n)}createVertexBuffer(t,n,A){return new Nl(this,t,n,A)}createRenderbuffer(t,n,A){let l=this.gl,g=l.createRenderbuffer();return this.bindRenderbuffer.set(g),l.renderbufferStorage(l.RENDERBUFFER,t,n,A),this.bindRenderbuffer.set(null),g}createFramebuffer(t,n,A,l){return new Hl(this,t,n,A,l)}clear({color:t,depth:n,stencil:A}){let l=this.gl,g=0;t&&(g|=l.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),n!==void 0&&(g|=l.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),A!==void 0&&(g|=l.STENCIL_BUFFER_BIT,this.clearStencil.set(A),this.stencilMask.set(255)),l.clear(g)}setCullFace(t){t.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){c.bQ(t.blendFunction,mt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){var t;return nr(this.gl)?this.gl.createVertexArray():(t=this.gl.getExtension("OES_vertex_array_object"))===null||t===void 0?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var n;nr(this.gl)?this.gl.deleteVertexArray(t):(n=this.gl.getExtension("OES_vertex_array_object"))===null||n===void 0||n.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}let Qn;function io(d,t,n,A,l){var g,B;let y=d.context,C=d.transform,E=y.gl,I=d.useProgram("collisionBox"),b=[],F=0,T=0;for(let H of A){let j=t.getTile(H).getBucket(n);if(!j)continue;let z=l?j.textCollisionBox:j.iconCollisionBox,Z=j.collisionCircleArray;Z.length>0&&(b.push({circleArray:Z,circleOffset:T,coord:H}),F+=Z.length/4,T=F),z&&I.draw(y,E.LINES,Xe.disabled,ot.disabled,d.colorModeForRenderPass(),it.disabled,kl(d.transform),(g=d.style.map.terrain)===null||g===void 0?void 0:g.getTerrainData(H),C.getProjectionData({overscaledTileID:H,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),n.id,z.layoutVertexBuffer,z.indexBuffer,z.segments,null,d.transform.zoom,null,null,z.collisionVertexBuffer)}if(!l||!b.length)return;let P=d.useProgram("collisionCircle"),R=new c.ca;R.resize(4*F),R._trim();let Y=0;for(let H of b)for(let j=0;j<H.circleArray.length/4;j++){let z=4*j,Z=H.circleArray[z+0],X=H.circleArray[z+1],te=H.circleArray[z+2],Ae=H.circleArray[z+3];R.emplace(Y++,Z,X,te,Ae,0),R.emplace(Y++,Z,X,te,Ae,1),R.emplace(Y++,Z,X,te,Ae,2),R.emplace(Y++,Z,X,te,Ae,3)}(!Qn||Qn.length<2*F)&&(Qn=(function(H){let j=2*H,z=new c.cc;z.resize(j),z._trim();for(let Z=0;Z<j;Z++){let X=6*Z;z.uint16[X+0]=4*Z+0,z.uint16[X+1]=4*Z+1,z.uint16[X+2]=4*Z+2,z.uint16[X+3]=4*Z+2,z.uint16[X+4]=4*Z+3,z.uint16[X+5]=4*Z+0}return z})(F));let N=y.createIndexBuffer(Qn,!0),K=y.createVertexBuffer(R,c.cb.members,!0);for(let H of b){let j=mn(d.transform);P.draw(y,E.TRIANGLES,Xe.disabled,ot.disabled,d.colorModeForRenderPass(),it.disabled,j,(B=d.style.map.terrain)===null||B===void 0?void 0:B.getTerrainData(H.coord),null,n.id,K,N,c.aV.simpleSegment(0,2*H.circleOffset,H.circleArray.length,H.circleArray.length/2),null,d.transform.zoom,null,null,null)}K.destroy(),N.destroy()}let ro=c.ap(new Float32Array(16));function ma(d,t,n,A,l,g){let{horizontalAlign:B,verticalAlign:y}=c.aP(d);return new c.P((-(B-.5)*t/l+A[0])*g,(-(y-.5)*n/l+A[1])*g)}function xh(d,t,n,A,l,g){let B=t.tileAnchorPoint.add(new c.P(t.translation[0],t.translation[1]));if(t.pitchWithMap){let y=A.mult(g);n||(y=y.rotate(-l));let C=B.add(y);return je(C.x,C.y,t.pitchedLabelPlaneMatrix,t.getElevation).point}if(n){let y=ht(t.tileAnchorPoint.x+1,t.tileAnchorPoint.y,t).point.sub(d),C=Math.atan(y.y/y.x)+(y.x<0?Math.PI:0);return d.add(A.rotate(C))}return d.add(A)}function Ko(d,t,n,A,l,g,B,y,C,E,I,b){let F=d.text.placedSymbolArray,T=d.text.dynamicLayoutVertexArray,P=d.icon.dynamicLayoutVertexArray,R={};T.clear();for(let Y=0;Y<F.length;Y++){let N=F.get(Y),K=N.hidden||!N.crossTileID||d.allowVerticalPlacement&&!N.placedOrientation?null:A[N.crossTileID];if(K){let H=new c.P(N.anchorX,N.anchorY),j={getElevation:b,width:l.width,height:l.height,pitchedLabelPlaneMatrix:g,pitchWithMap:n,transform:l,tileAnchorPoint:H,translation:E,unwrappedTileID:I},z=n?Nn(H.x,H.y,j):ht(H.x,H.y,j),Z=vo(l.cameraToCenterDistance,z.signedDistanceFromCamera),X=c.ay(d.textSizeData,y,N)*Z/c.aJ;n&&(X*=d.tilePixelRatio/B);let{width:te,height:Ae,anchor:ae,textOffset:Be,textBoxScale:me}=K,Fe=ma(ae,te,Ae,Be,me,X),Ie=l.getPitchedTextCorrection(H.x+E[0],H.y+E[1],I),ge=xh(z.point,j,t,Fe,-l.bearingInRadians,Ie),ve=d.allowVerticalPlacement&&N.placedOrientation===c.ax.vertical?Math.PI/2:0;for(let Ue=0;Ue<N.numGlyphs;Ue++)c.aD(T,ge,ve);C&&N.associatedIconIndex>=0&&(R[N.associatedIconIndex]={shiftedAnchor:ge,angle:ve})}else ln(N.numGlyphs,T)}if(C){P.clear();let Y=d.icon.placedSymbolArray;for(let N=0;N<Y.length;N++){let K=Y.get(N);if(K.hidden)ln(K.numGlyphs,P);else{let H=R[N];if(H)for(let j=0;j<K.numGlyphs;j++)c.aD(P,H.shiftedAnchor,H.angle);else ln(K.numGlyphs,P)}}d.icon.dynamicLayoutVertexBuffer.updateData(P)}d.text.dynamicLayoutVertexBuffer.updateData(T)}function vh(d,t,n){return n.iconsInText&&t?"symbolTextAndIcon":d?"symbolSDF":"symbolIcon"}function Ba(d,t,n,A,l,g,B,y,C,E,I,b,F){var T,P;let R=d.context,Y=R.gl,N=d.transform,K=y==="map",H=C==="map",j=y!=="viewport"&&n.layout.get("symbol-placement")!=="point",z=K&&!H&&!j,Z=!n.layout.get("symbol-sort-key").isConstant(),X=!1,te=d.getDepthModeForSublayer(0,Xe.ReadOnly),Ae=n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"),ae=[],Be=N.getCircleRadiusCorrection();for(let Ie of A){let ge=t.getTile(Ie),ve=ge.getBucket(n);if(!ve)continue;let Ue=l?ve.text:ve.icon;if(!(Ue!=null&&Ue.segments.get().length)||!Ue.hasVisibleVertices)continue;let lt=Ue.programConfigurations.get(n.id),Gt=l||ve.sdfIcons,gt=l?ve.textSizeData:ve.iconSizeData,Ot=H||N.pitch!==0,zt=d.useProgram(vh(Gt,l,ve),lt),li=c.aw(gt,N.zoom),Mt=(T=d.style.map.terrain)===null||T===void 0?void 0:T.getTerrainData(Ie),yi,oi,Ht,ci,Kr=[0,0],jr=null;if(l)oi=ge.glyphAtlasTexture,Ht=Y.LINEAR,yi=ge.glyphAtlasTexture.size,ve.iconsInText&&(Kr=ge.imageAtlasTexture.size,jr=ge.imageAtlasTexture,ci=Ot||d.options.rotating||d.options.zooming||gt.kind==="composite"||gt.kind==="camera"?Y.LINEAR:Y.NEAREST);else{let vt=n.layout.get("icon-size").constantOr(0)!==1||ve.iconsNeedLinear;oi=ge.imageAtlasTexture,Ht=Gt||d.options.rotating||d.options.zooming||vt||Ot?Y.LINEAR:Y.NEAREST,yi=ge.imageAtlasTexture.size}let Xr=c.aK(ge,1,d.transform.zoom),hi=Li(K,d.transform,Xr),Ir=Cs(H,K,d.transform,Xr),Vr=c.aL(N,ge,g,B),lA=N.getProjectionData({overscaledTileID:Ie,applyGlobeMatrix:!F,applyTerrainMatrix:!0}),gr=Ae&&ve.hasTextData(),pr=n.layout.get("icon-text-fit")!=="none"&&gr&&ve.hasIconData();if(j){let vt=c.O();ze(vt,hi);let vn=d.style.map.terrain?(xr,Na)=>d.style.map.terrain.getElevation(Ie,xr,Na):null,cA=n.layout.get("text-rotation-alignment")==="map";ws(ve,d,l,hi,vt,H,E,cA,Ie.toUnwrapped(),N.width,N.height,Vr,vn)}let Oi=l&&Ae||pr,Ji=j||Oi?ro:H?hi:d.transform.clipSpaceToPixelsMatrix,xt=Gt&&n.paint.get(l?"text-halo-width":"icon-halo-width").constantOr(1)!==0,yt;yt=Gt?ve.iconsInText?ua(gt.kind,li,z,H,j,Oi,d,Ji,Ir,Vr,yi,Kr,Be):ha(gt.kind,li,z,H,j,Oi,d,Ji,Ir,Vr,l,yi,xt,Be):Ps(gt.kind,li,z,H,j,Oi,d,Ji,Ir,Vr,l,yi,Be);let Yt={program:zt,buffers:Ue,uniformValues:yt,projectionData:lA,atlasTexture:oi,atlasTextureIcon:jr,atlasInterpolation:Ht,atlasInterpolationIcon:ci,isSDF:Gt,hasHalo:xt};if(Z&&ve.canOverlap){X=!0;let vt=Ue.segments.get();for(let vn of vt)ae.push({segments:new c.aV([vn]),sortKey:vn.sortKey,state:Yt,terrainData:Mt})}else ae.push({segments:Ue.segments,sortKey:0,state:Yt,terrainData:Mt})}X&&ae.sort(((Ie,ge)=>Ie.sortKey-ge.sortKey));let me=(P=n.paint.get(l?"text-halo-width":"icon-halo-width").constantOr(null))!==null&&P!==void 0?P:1/0,Fe=n.layout.get("text-letter-spacing").constantOr(0)*c.aJ<0||me>1;for(let Ie of ae){let ge=Ie.state;R.activeTexture.set(Y.TEXTURE0),ge.atlasTexture.bind(ge.atlasInterpolation,Y.CLAMP_TO_EDGE),ge.atlasTextureIcon&&(R.activeTexture.set(Y.TEXTURE1),ge.atlasTextureIcon&&ge.atlasTextureIcon.bind(ge.atlasInterpolationIcon,Y.CLAMP_TO_EDGE));let ve=ge.isSDF&&ge.hasHalo;if(ve){let Ue=ge.uniformValues;Ue.u_is_halo=1,Fe&&(Ue.u_is_plain=0,jo(ge.buffers,Ie.segments,n,d,ge.program,te,I,b,Ue,ge.projectionData,Ie.terrainData),Ue.u_is_halo=0,Ue.u_is_plain=1)}jo(ge.buffers,Ie.segments,n,d,ge.program,te,I,b,ge.uniformValues,ge.projectionData,Ie.terrainData),ve&&!Fe&&(ge.uniformValues.u_is_halo=0)}}function jo(d,t,n,A,l,g,B,y,C,E,I){let b=A.context;l.draw(b,b.gl.TRIANGLES,g,B,y,it.backCCW,C,I,E,n.id,d.layoutVertexBuffer,d.indexBuffer,t,n.paint,A.transform.zoom,d.programConfigurations.get(n.id),d.dynamicLayoutVertexBuffer,d.opacityVertexBuffer)}function _a(d,t,n,A,l){let g=d.context,B=g.gl,y=ot.disabled,C=new mt([B.ONE,B.ONE],c.bo.transparent,[!0,!0,!0,!0]),E=t.getBucket(n);if(!E)return;let I=A.key,b=n.heatmapFbos.get(I);b||(b=ya(g,t.tileSize,t.tileSize),n.heatmapFbos.set(I,b)),g.bindFramebuffer.set(b.framebuffer),g.viewport.set([0,0,t.tileSize,t.tileSize]),g.clear({color:c.bo.transparent});let F=E.programConfigurations.get(n.id),T=d.useProgram("heatmap",F,!l),P=d.transform.getProjectionData({overscaledTileID:t.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),R=d.style.map.terrain.getTerrainData(A);T.draw(g,B.TRIANGLES,Xe.disabled,y,C,it.disabled,Aa(t,d.transform.zoom,n.paint.get("heatmap-intensity"),1),R,P,n.id,E.layoutVertexBuffer,E.indexBuffer,E.segments,n.paint,d.transform.zoom,F)}function Jl(d,t,n,A,l){let g=d.context,B=g.gl,y=d.transform;g.setColorMode(d.colorModeForRenderPass());let C=Xo(g,t),E=n.key,I=t.heatmapFbos.get(E);if(!I)return;g.activeTexture.set(B.TEXTURE0),B.bindTexture(B.TEXTURE_2D,I.colorAttachment.get()),g.activeTexture.set(B.TEXTURE1),C.bind(B.LINEAR,B.CLAMP_TO_EDGE);let b=y.getProjectionData({overscaledTileID:n,applyTerrainMatrix:l,applyGlobeMatrix:!A});d.useProgram("heatmapTexture").draw(g,B.TRIANGLES,Xe.disabled,ot.disabled,d.colorModeForRenderPass(),it.disabled,qn(d,t,0,1),null,b,t.id,d.rasterBoundsBuffer,d.quadTriangleIndexBuffer,d.rasterBoundsSegments,t.paint,y.zoom),I.destroy(),t.heatmapFbos.delete(E)}function ya(d,t,n){var A,l;let g=d.gl,B=g.createTexture();g.bindTexture(g.TEXTURE_2D,B),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.LINEAR);let y=(A=d.HALF_FLOAT)!==null&&A!==void 0?A:g.UNSIGNED_BYTE,C=(l=d.RGBA16F)!==null&&l!==void 0?l:g.RGBA;g.texImage2D(g.TEXTURE_2D,0,C,t,n,0,g.RGBA,y,null);let E=d.createFramebuffer(t,n,!1,!1);return E.colorAttachment.set(B),E}function Xo(d,t){return t.colorRampTexture||(t.colorRampTexture=new c.T(d,t.colorRamp,d.gl.RGBA)),t.colorRampTexture}function Hs(d,t,n,A,l,g,B,y){let C=256;if(l.stepInterpolant){let E=t.getSource().maxzoom,I=B.canonical.z===E?Math.ceil(1<<d.transform.maxZoom-B.canonical.z):1;C=c.al(c.ce(g.maxLineLength/c.a6*1024*I),256,n.maxTextureSize)}return y.gradient=c.cf({expression:l.gradientExpression(),evaluationKey:"lineProgress",resolution:C,image:y.gradient||void 0,clips:g.lineClipsArray}),y.texture?y.texture.update(y.gradient):y.texture=new c.T(n,y.gradient,A.RGBA),y.version=l.gradientVersion,y.texture}function bh(d,t,n,A,l){d.activeTexture.set(t.TEXTURE0),n.imageAtlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE),A.updatePaintBuffers(l)}function ql(d,t,n,A,l,g){(l||d.lineAtlas.dirty)&&(t.activeTexture.set(n.TEXTURE0),d.lineAtlas.bind(t)),A.updatePaintBuffers(g)}function Pt(d,t,n,A,l,g,B){let y=g.gradients[l.id],C=y.texture;l.gradientVersion!==y.version&&(C=Hs(d,t,n,A,l,g,B,y)),n.activeTexture.set(A.TEXTURE0),C.bind(l.stepInterpolant?A.NEAREST:A.LINEAR,A.CLAMP_TO_EDGE)}function Cn(d,t,n,A,l,g,B,y,C){let E=g.gradients[l.id],I=E.texture;l.gradientVersion!==E.version&&(I=Hs(d,t,n,A,l,g,B,E)),n.activeTexture.set(A.TEXTURE0),I.bind(l.stepInterpolant?A.NEAREST:A.LINEAR,A.CLAMP_TO_EDGE),n.activeTexture.set(A.TEXTURE1),d.lineAtlas.bind(n),y.updatePaintBuffers(C)}function Si(d,t,n,A,l){if(!n||!(A!=null&&A.imageAtlas))return;let g=A.imageAtlas.patternPositions,B=g[n.to.toString()],y=g[n.from.toString()];if(!B&&y&&(B=y),!y&&B&&(y=B),!B||!y){let C=l.getPaintProperty(t);B=g[C],y=g[C]}B&&y&&d.setConstantPatternPositions(B,y)}function Js(d,t,n,A,l,g,B,y){var C;let E=d.context.gl,I="fill-pattern",b=n.paint.get(I),F=b==null?void 0:b.constantOr(1),T=n.getCrossfadeParameters(),P,R,Y,N,K,H=d.transform,j=n.paint.get("fill-translate"),z=n.paint.get("fill-translate-anchor");B?(R=F&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",P=E.LINES):(R=F?"fillPattern":"fill",P=E.TRIANGLES);let Z=b.constantOr(null);for(let X of A){let te=t.getTile(X);if(F&&!te.patternsLoaded())continue;let Ae=te.getBucket(n);if(!Ae)continue;let ae=Ae.programConfigurations.get(n.id),Be=d.useProgram(R,ae),me=(C=d.style.map.terrain)===null||C===void 0?void 0:C.getTerrainData(X);F&&(d.context.activeTexture.set(E.TEXTURE0),te.imageAtlasTexture.bind(E.LINEAR,E.CLAMP_TO_EDGE),ae.updatePaintBuffers(T)),Si(ae,I,Z,te,n);let Fe=H.getProjectionData({overscaledTileID:X,applyGlobeMatrix:!y,applyTerrainMatrix:!0}),Ie=c.aL(H,te,j,z);if(B){N=Ae.indexBuffer2,K=Ae.segments2;let ve=[E.drawingBufferWidth,E.drawingBufferHeight];Y=R==="fillOutlinePattern"&&F?Ul(d,T,te,ve,Ie):Tl(ve,Ie)}else N=Ae.indexBuffer,K=Ae.segments,Y=F?Ls(d,T,te,Ie):{u_fill_translate:Ie};let ge=d.stencilModeForClipping(X);Be.draw(d.context,P,l,ge,g,it.backCCW,Y,me,Fe,n.id,Ae.layoutVertexBuffer,N,K,n.paint,d.transform.zoom,ae)}}function no(d,t,n,A,l,g,B,y){var C;let E=d.context,I=E.gl,b="fill-extrusion-pattern",F=n.paint.get(b),T=F.constantOr(1),P=n.getCrossfadeParameters(),R=n.paint.get("fill-extrusion-opacity"),Y=F.constantOr(null),N=d.transform;for(let K of A){let H=t.getTile(K),j=H.getBucket(n);if(!j)continue;let z=(C=d.style.map.terrain)===null||C===void 0?void 0:C.getTerrainData(K),Z=j.programConfigurations.get(n.id),X=d.useProgram(T?"fillExtrusionPattern":"fillExtrusion",Z);T&&(d.context.activeTexture.set(I.TEXTURE0),H.imageAtlasTexture.bind(I.LINEAR,I.CLAMP_TO_EDGE),Z.updatePaintBuffers(P));let te=N.getProjectionData({overscaledTileID:K,applyGlobeMatrix:!y,applyTerrainMatrix:!0});Si(Z,b,Y,H,n);let Ae=c.aL(N,H,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),ae=n.paint.get("fill-extrusion-vertical-gradient"),Be=T?Ml(d,ae,R,Ae,K,P,H):Sl(d,ae,R,Ae);X.draw(E,E.gl.TRIANGLES,l,g,B,it.backCCW,Be,z,te,n.id,j.layoutVertexBuffer,j.indexBuffer,j.segments,n.paint,d.transform.zoom,Z,d.style.map.terrain&&j.centroidVertexBuffer)}}function qs(d,t,n,A,l,g,B,y,C){var E;let I=d.style.projection,b=d.context,F=d.transform,T=b.gl,P=[`#define NUM_ILLUMINATION_SOURCES ${n.paint.get("hillshade-highlight-color").values.length}`],R=d.useProgram("hillshade",null,!1,P),Y=!d.options.moving;for(let N of A){let K=t.getTile(N),H=K.fbo;if(!H)continue;let j=I.getMeshFromTileID(b,N.canonical,y,!0,"raster"),z=(E=d.style.map.terrain)===null||E===void 0?void 0:E.getTerrainData(N);b.activeTexture.set(T.TEXTURE0),T.bindTexture(T.TEXTURE_2D,H.colorAttachment.get());let Z=F.getProjectionData({overscaledTileID:N,aligned:Y,applyGlobeMatrix:!C,applyTerrainMatrix:!0});R.draw(b,T.TRIANGLES,g,l[N.overscaledZ],B,it.backCCW,fh(d,K,n),z,Z,n.id,j.vertexBuffer,j.indexBuffer,j.segments)}}let Nr=0;function Vo(d,t,n,A,l,g,B,y,C){var E;let I=d.style.projection,b=d.context,F=d.transform,T=b.gl,P=d.useProgram("colorRelief"),R=!d.options.moving,Y=n.paint.get("resampling")==="nearest"?T.NEAREST:T.LINEAR,N=!0,K=0;for(let H of A){let j=t.getTile(H),z=j.dem;if(N){Nr||(Nr=T.getParameter(T.MAX_TEXTURE_SIZE));let Be=Nr,{elevationTexture:me,colorTexture:Fe}=n.getColorRampTextures(b,Be,z.getUnpackVector());b.activeTexture.set(T.TEXTURE1),me.bind(T.NEAREST,T.CLAMP_TO_EDGE),b.activeTexture.set(T.TEXTURE4),Fe.bind(T.LINEAR,T.CLAMP_TO_EDGE),N=!1,K=me.size[0]}if(!(z!=null&&z.data))continue;let Z=z.stride,X=z.getPixels();if(b.activeTexture.set(T.TEXTURE0),b.pixelStoreUnpackPremultiplyAlpha.set(!1),j.demTexture||(j.demTexture=d.getTileTexture(Z)),j.demTexture){let Be=j.demTexture;Be.update(X,{premultiply:!1}),Be.bind(Y,T.CLAMP_TO_EDGE)}else j.demTexture=new c.T(b,X,T.RGBA,{premultiply:!1}),j.demTexture.bind(Y,T.CLAMP_TO_EDGE);let te=I.getMeshFromTileID(b,H.canonical,y,!0,"raster"),Ae=(E=d.style.map.terrain)===null||E===void 0?void 0:E.getTerrainData(H),ae=F.getProjectionData({overscaledTileID:H,aligned:R,applyGlobeMatrix:!C,applyTerrainMatrix:!0});P.draw(b,T.TRIANGLES,g,l[H.overscaledZ],B,it.backCCW,Bh(n,j.dem,K),Ae,ae,n.id,te.vertexBuffer,te.indexBuffer,te.segments)}}let wn=[new c.P(0,0),new c.P(c.a6,0),new c.P(c.a6,c.a6),new c.P(0,c.a6)];function oo(d,t,n,A,l,g,B,y,C=!1,E=!1){var I;let b=A[A.length-1].overscaledZ,F=d.context,T=F.gl,P=d.useProgram("raster"),R=d.transform,Y=d.style.projection,N=d.colorModeForRenderPass(),K=!d.options.moving,H=n.paint.get("raster-opacity"),j=n.paint.get("resampling")==="nearest"||n.paint.get("raster-resampling")==="nearest"?T.NEAREST:T.LINEAR,z=n.paint.get("raster-fade-duration"),Z=!!d.style.map.terrain;for(let X of A){let te=d.getDepthModeForSublayer(X.overscaledZ-b,H===1?Xe.ReadWrite:Xe.ReadOnly,T.LESS),Ae=t.getTile(X);F.activeTexture.set(T.TEXTURE0),Ae.texture.bind(j,T.CLAMP_TO_EDGE,T.LINEAR_MIPMAP_NEAREST),F.activeTexture.set(T.TEXTURE1);let{parentTile:ae,parentScaleBy:Be,parentTopLeft:me,fadeValues:Fe}=Wl(Ae,t,z,Z);Ae.fadeOpacity=Fe.tileOpacity,ae?(ae.fadeOpacity=Fe.parentTileOpacity,ae.texture.bind(j,T.CLAMP_TO_EDGE,T.LINEAR_MIPMAP_NEAREST)):Ae.texture.bind(j,T.CLAMP_TO_EDGE,T.LINEAR_MIPMAP_NEAREST),Ae.texture.useMipmap&&F.extTextureFilterAnisotropic&&d.transform.pitch>d.options.anisotropicFilterPitch&&T.texParameterf(T.TEXTURE_2D,F.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,F.extTextureFilterAnisotropicMax);let Ie=(I=d.style.map.terrain)===null||I===void 0?void 0:I.getTerrainData(X),ge=R.getProjectionData({overscaledTileID:X,aligned:K,applyGlobeMatrix:!E,applyTerrainMatrix:!0}),ve=la(me,Be,Fe.fadeMix,n,y),Ue=Y.getMeshFromTileID(F,X.canonical,g,B,"raster");P.draw(F,T.TRIANGLES,te,l?l[X.overscaledZ]:ot.disabled,N,C?it.frontCCW:it.backCCW,ve,Ie,ge,n.id,Ue.vertexBuffer,Ue.indexBuffer,Ue.segments)}}function Wl(d,t,n,A){let l={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(n===0||A)return l;if(d.fadingParentID){let g=t.getLoadedTile(d.fadingParentID);if(!g)return l;let B=Math.pow(2,g.tileID.overscaledZ-d.tileID.overscaledZ),y=[d.tileID.canonical.x*B%1,d.tileID.canonical.y*B%1],C=(function(E,I,b){let F=Pe(),T=(F-I.timeAdded)/b,P=E.fadingDirection===Xi.Incoming,R=c.al((F-E.timeAdded)/b,0,1),Y=c.al(1-T,0,1),N=P?R:Y;return{tileOpacity:N,parentTileOpacity:P?Y:R,fadeMix:{opacity:1,mix:1-N}}})(d,g,n);return{parentTile:g,parentScaleBy:B,parentTopLeft:y,fadeValues:C}}if(d.selfFading){let g=(function(B,y){let C=(Pe()-B.timeAdded)/y,E=c.al(C,0,1);return{tileOpacity:E,fadeMix:{opacity:E,mix:0}}})(d,n);return{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:g}}return l}let $l=new c.bo(1,0,0,1),ec=new c.bo(0,1,0,1),tc=new c.bo(0,0,1,1),ic=new c.bo(1,0,1,1),zr=new c.bo(0,1,1,1);function Qa(d,t,n,A){Zo(d,0,t+n/2,d.transform.width,n,A)}function Ca(d,t,n,A){Zo(d,t-n/2,0,n,d.transform.height,A)}function Zo(d,t,n,A,l,g){let B=d.context,y=B.gl;y.enable(y.SCISSOR_TEST),y.scissor(t*d.pixelRatio,n*d.pixelRatio,A*d.pixelRatio,l*d.pixelRatio),B.clear({color:g}),y.disable(y.SCISSOR_TEST)}function rc(d,t,n){var A;let l=d.context,g=l.gl,B=d.useProgram("debug"),y=Xe.disabled,C=ot.disabled,E=d.colorModeForRenderPass(),I="$debug",b=(A=d.style.map.terrain)===null||A===void 0?void 0:A.getTerrainData(n);l.activeTexture.set(g.TEXTURE0);let F=t.getTileByID(n.key).latestRawTileData,T=Math.floor(((F==null?void 0:F.byteLength)||0)/1024),P=t.getTile(n).tileSize,R=512/Math.min(P,512)*(n.overscaledZ/d.transform.zoom)*.5,Y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(Y+=` => ${n.overscaledZ}`),(function(K,H){K.initDebugOverlayCanvas();let j=K.debugOverlayCanvas,z=K.context.gl,Z=K.debugOverlayCanvas.getContext("2d");Z.clearRect(0,0,j.width,j.height),Z.shadowColor="white",Z.shadowBlur=2,Z.lineWidth=1.5,Z.strokeStyle="white",Z.textBaseline="top",Z.font="bold 36px Open Sans, sans-serif",Z.fillText(H,5,5),Z.strokeText(H,5,5),K.debugOverlayTexture.update(j),K.debugOverlayTexture.bind(z.LINEAR,z.CLAMP_TO_EDGE)})(d,`${Y} ${T}kB`);let N=d.transform.getProjectionData({overscaledTileID:n,applyGlobeMatrix:!0,applyTerrainMatrix:!0});B.draw(l,g.TRIANGLES,y,C,mt.alphaBlended,it.disabled,sa(c.bo.transparent,R),null,N,I,d.debugBuffer,d.quadTriangleIndexBuffer,d.debugSegments),B.draw(l,g.LINE_STRIP,y,C,E,it.disabled,sa(c.bo.red),b,N,I,d.debugBuffer,d.tileBorderIndexBuffer,d.debugSegments)}function wa(d,t,n,A){let{isRenderingGlobe:l}=A,g=d.context,B=g.gl,y=d.transform,C=d.colorModeForRenderPass(),E=d.getDepthModeFor3D(),I=d.useProgram("terrain");g.bindFramebuffer.set(null),g.viewport.set([0,0,d.width,d.height]);for(let b of n){let F=t.getTerrainMesh(b.tileID),T=d.renderToTexture.getTexture(b),P=t.getTerrainData(b.tileID);g.activeTexture.set(B.TEXTURE0),B.bindTexture(B.TEXTURE_2D,T.texture);let R=t.getMeshFrameDelta(y.zoom),Y=y.calculateFogMatrix(b.tileID.toUnwrapped()),N=Us(R,Y,d.style.sky,y.pitch,l),K=y.getProjectionData({overscaledTileID:b.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});I.draw(g,B.TRIANGLES,E,ot.disabled,C,it.backCCW,N,P,K,"terrain",F.vertexBuffer,F.indexBuffer,F.segments)}}function Ea(d,t){if(!t.mesh){let n=new c.aU;n.emplaceBack(-1,-1),n.emplaceBack(1,-1),n.emplaceBack(1,1),n.emplaceBack(-1,1);let A=new c.aW;A.emplaceBack(0,1,2),A.emplaceBack(0,2,3),t.mesh=new ft(d.createVertexBuffer(n,Rr.members),d.createIndexBuffer(A),c.aV.simpleSegment(0,0,n.length,A.length))}return t.mesh}let nc={symbol:function(d,t,n,A,l,g){if(d.renderPass!=="translucent")return;let{isRenderingToTexture:B}=g,y=ot.disabled,C=d.colorModeForRenderPass();(n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&(function(E,I,b,F,T,P,R,Y,N){var K;let H=I.transform,j=I.style.map.terrain,z=T==="map",Z=P==="map";for(let X of E){let te=F.getTile(X),Ae=te.getBucket(b);if(!(!((K=Ae==null?void 0:Ae.text)===null||K===void 0)&&K.segments.get().length))continue;let ae=c.aw(Ae.textSizeData,H.zoom),Be=c.aK(te,1,I.transform.zoom),me=Li(z,I.transform,Be),Fe=b.layout.get("icon-text-fit")!=="none"&&Ae.hasIconData();if(ae){let Ie=Math.pow(2,H.zoom-te.tileID.overscaledZ),ge=j?(ve,Ue)=>j.getElevation(X,ve,Ue):null;Ko(Ae,z,Z,N,H,me,Ie,ae,Fe,c.aL(H,te,R,Y),X.toUnwrapped(),ge)}}})(A,d,n,t,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),l),n.paint.get("icon-opacity").constantOr(1)!==0&&Ba(d,t,n,A,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),y,C,B),n.paint.get("text-opacity").constantOr(1)!==0&&Ba(d,t,n,A,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),y,C,B),t.map.showCollisionBoxes&&(io(d,t,n,A,!0),io(d,t,n,A,!1))},circle:function(d,t,n,A,l){var g;if(d.renderPass!=="translucent")return;let{isRenderingToTexture:B}=l,y=n.paint.get("circle-opacity"),C=n.paint.get("circle-stroke-width"),E=n.paint.get("circle-stroke-opacity"),I=!n.layout.get("circle-sort-key").isConstant();if(y.constantOr(1)===0&&(C.constantOr(1)===0||E.constantOr(1)===0))return;let b=d.context,F=b.gl,T=d.transform,P=d.getDepthModeForSublayer(0,Xe.ReadOnly),R=ot.disabled,Y=d.colorModeForRenderPass(),N=[],K=T.getCircleRadiusCorrection();for(let H of A){let j=t.getTile(H),z=j.getBucket(n);if(!z)continue;let Z=n.paint.get("circle-translate"),X=n.paint.get("circle-translate-anchor"),te=c.aL(T,j,Z,X),Ae=z.programConfigurations.get(n.id),ae=d.useProgram("circle",Ae),Be=z.layoutVertexBuffer,me=z.indexBuffer,Fe=(g=d.style.map.terrain)===null||g===void 0?void 0:g.getTerrainData(H),Ie={programConfiguration:Ae,program:ae,layoutVertexBuffer:Be,indexBuffer:me,uniformValues:Ll(d,j,n,te,K),terrainData:Fe,projectionData:T.getProjectionData({overscaledTileID:H,applyGlobeMatrix:!B,applyTerrainMatrix:!0})};if(I){let ge=z.segments.get();for(let ve of ge)N.push({segments:new c.aV([ve]),sortKey:ve.sortKey,state:Ie})}else N.push({segments:z.segments,sortKey:0,state:Ie})}I&&N.sort(((H,j)=>H.sortKey-j.sortKey));for(let H of N){let{programConfiguration:j,program:z,layoutVertexBuffer:Z,indexBuffer:X,uniformValues:te,terrainData:Ae,projectionData:ae}=H.state;z.draw(b,F.TRIANGLES,P,R,Y,it.backCCW,te,Ae,ae,n.id,Z,X,H.segments,n.paint,d.transform.zoom,j)}},heatmap:function(d,t,n,A,l){if(n.paint.get("heatmap-opacity")===0)return;let g=d.context,{isRenderingToTexture:B,isRenderingGlobe:y}=l;if(d.style.map.terrain){for(let C of A){let E=t.getTile(C);t.hasRenderableParent(C)||(d.renderPass==="offscreen"?_a(d,E,n,C,y):d.renderPass==="translucent"&&Jl(d,n,C,B,y))}g.viewport.set([0,0,d.width,d.height])}else d.renderPass==="offscreen"?(function(C,E,I,b){let F=C.context,T=F.gl,P=C.transform,R=ot.disabled,Y=new mt([T.ONE,T.ONE],c.bo.transparent,[!0,!0,!0,!0]);(function(N,K,H){let j=N.gl;N.activeTexture.set(j.TEXTURE1),N.viewport.set([0,0,K.width/4,K.height/4]);let z=H.heatmapFbos.get(c.cd);z?(j.bindTexture(j.TEXTURE_2D,z.colorAttachment.get()),N.bindFramebuffer.set(z.framebuffer)):(z=ya(N,K.width/4,K.height/4),H.heatmapFbos.set(c.cd,z))})(F,C,I),F.clear({color:c.bo.transparent});for(let N of b){if(E.hasRenderableParent(N))continue;let K=E.getTile(N),H=K.getBucket(I);if(!H)continue;let j=H.programConfigurations.get(I.id),z=C.useProgram("heatmap",j),Z=P.getProjectionData({overscaledTileID:N,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),X=P.getCircleRadiusCorrection();z.draw(F,T.TRIANGLES,Xe.disabled,R,Y,it.backCCW,Aa(K,P.zoom,I.paint.get("heatmap-intensity"),X),null,Z,I.id,H.layoutVertexBuffer,H.indexBuffer,H.segments,I.paint,P.zoom,j)}F.viewport.set([0,0,C.width,C.height])})(d,t,n,A):d.renderPass==="translucent"&&(function(C,E){let I=C.context,b=I.gl;I.setColorMode(C.colorModeForRenderPass());let F=E.heatmapFbos.get(c.cd);F&&(I.activeTexture.set(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,F.colorAttachment.get()),I.activeTexture.set(b.TEXTURE1),Xo(I,E).bind(b.LINEAR,b.CLAMP_TO_EDGE),C.useProgram("heatmapTexture").draw(I,b.TRIANGLES,Xe.disabled,ot.disabled,C.colorModeForRenderPass(),it.disabled,qn(C,E,0,1),null,null,E.id,C.viewportBuffer,C.quadTriangleIndexBuffer,C.viewportSegments,E.paint,C.transform.zoom))})(d,n)},line:function(d,t,n,A,l){var g;if(d.renderPass!=="translucent")return;let{isRenderingToTexture:B}=l,y=n.paint.get("line-opacity"),C=n.paint.get("line-width");if(y.constantOr(1)===0||C.constantOr(1)===0)return;let E=d.getDepthModeForSublayer(0,Xe.ReadOnly),I=d.colorModeForRenderPass(),b=n.paint.get("line-dasharray"),F=b.constantOr(1),T=n.paint.get("line-pattern"),P=T.constantOr(1),R=n.paint.get("line-gradient"),Y=n.getCrossfadeParameters(),N;N=P?"linePattern":F&&R?"lineGradientSDF":F?"lineSDF":R?"lineGradient":"line";let K=d.context,H=K.gl,j=d.transform,z=!0;for(let Z of A){let X=t.getTile(Z);if(P&&!X.patternsLoaded())continue;let te=X.getBucket(n);if(!te)continue;let Ae=te.programConfigurations.get(n.id),ae=d.context.program.get(),Be=d.useProgram(N,Ae),me=z||Be.program!==ae,Fe=(g=d.style.map.terrain)===null||g===void 0?void 0:g.getTerrainData(Z),Ie=T.constantOr(null),ge=b==null?void 0:b.constantOr(null);if(Ie&&X.imageAtlas){let gt=X.imageAtlas,Ot=gt.patternPositions[Ie.to.toString()],zt=gt.patternPositions[Ie.from.toString()];Ot&&zt&&Ae.setConstantPatternPositions(Ot,zt)}else if(ge){let gt=n.layout.get("line-cap").constantOr(null)==="round",Ot=d.lineAtlas.getDash(ge.to,gt),zt=d.lineAtlas.getDash(ge.from,gt);Ae.setConstantDashPositions(Ot,zt)}let ve=j.getProjectionData({overscaledTileID:Z,applyGlobeMatrix:!B,applyTerrainMatrix:!0}),Ue=j.getPixelScale(),lt;P?(lt=Gl(d,X,n,Ue,Y),bh(K,H,X,Ae,Y)):F&&R?(lt=Rl(d,X,n,Ue,Y,te.lineClipsArray.length),Cn(d,t,K,H,n,te,Z,Ae,Y)):F?(lt=aa(d,X,n,Ue,Y),ql(d,K,H,Ae,me,Y)):R?(lt=Pl(d,X,n,Ue,te.lineClipsArray.length),Pt(d,t,K,H,n,te,Z)):lt=Go(d,X,n,Ue);let Gt=d.stencilModeForClipping(Z);Be.draw(K,H.TRIANGLES,E,Gt,I,it.disabled,lt,Fe,ve,n.id,te.layoutVertexBuffer,te.indexBuffer,te.segments,n.paint,d.transform.zoom,Ae,te.layoutVertexBuffer2),z=!1}},fill:function(d,t,n,A,l){let g=n.paint.get("fill-color"),B=n.paint.get("fill-opacity");if(B.constantOr(1)===0)return;let{isRenderingToTexture:y}=l,C=d.colorModeForRenderPass(),E=n.paint.get("fill-pattern"),I=d.opaquePassEnabledForLayer()&&!E.constantOr(1)&&g.constantOr(c.bo.transparent).a===1&&B.constantOr(0)===1?"opaque":"translucent";if(d.renderPass===I){let b=d.getDepthModeForSublayer(1,d.renderPass==="opaque"?Xe.ReadWrite:Xe.ReadOnly);Js(d,t,n,A,b,C,!1,y)}if(d.renderPass==="translucent"&&n.paint.get("fill-antialias")){let b=d.getDepthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,Xe.ReadOnly);Js(d,t,n,A,b,C,!0,y)}},fillExtrusion:function(d,t,n,A,l){let g=n.paint.get("fill-extrusion-opacity");if(g===0)return;let{isRenderingToTexture:B}=l;if(d.renderPass==="translucent"){let y=new Xe(d.context.gl.LEQUAL,Xe.ReadWrite,d.depthRangeFor3D);if(g!==1||n.paint.get("fill-extrusion-pattern").constantOr(1))no(d,t,n,A,y,ot.disabled,mt.disabled,B),no(d,t,n,A,y,d.stencilModeFor3D(),d.colorModeForRenderPass(),B);else{let C=d.colorModeForRenderPass();no(d,t,n,A,y,ot.disabled,C,B)}}},hillshade:function(d,t,n,A,l){if(d.renderPass!=="offscreen"&&d.renderPass!=="translucent")return;let{isRenderingToTexture:g}=l,B=d.context,y=d.style.projection.useSubdivision,C=d.getDepthModeForSublayer(0,Xe.ReadOnly),E=d.colorModeForRenderPass();if(d.renderPass==="offscreen")(function(I,b,F,T,P,R,Y){let N=I.context,K=N.gl,H=T.paint.get("resampling")==="nearest"?K.NEAREST:K.LINEAR;for(let j of F){let z=b.getTile(j),Z=z.dem;if(!(Z!=null&&Z.data)||!z.needsHillshadePrepare)continue;let X=Z.dim,te=Z.stride,Ae=Z.getPixels();if(N.activeTexture.set(K.TEXTURE1),N.pixelStoreUnpackPremultiplyAlpha.set(!1),z.demTexture||(z.demTexture=I.getTileTexture(te)),z.demTexture){let Be=z.demTexture;Be.update(Ae,{premultiply:!1}),Be.bind(K.NEAREST,K.CLAMP_TO_EDGE)}else z.demTexture=new c.T(N,Ae,K.RGBA,{premultiply:!1}),z.demTexture.bind(K.NEAREST,K.CLAMP_TO_EDGE);N.activeTexture.set(K.TEXTURE0);let ae=z.fbo;if(!ae){let Be=new c.T(N,{width:X,height:X,data:null},K.RGBA);Be.bind(H,K.CLAMP_TO_EDGE),ae=z.fbo=N.createFramebuffer(X,X,!0,!1),ae.colorAttachment.set(Be.texture)}N.bindFramebuffer.set(ae.framebuffer),N.viewport.set([0,0,X,X]),I.useProgram("hillshadePrepare").draw(N,K.TRIANGLES,P,R,Y,it.disabled,ks(z.tileID,Z),null,null,T.id,I.rasterBoundsBuffer,I.quadTriangleIndexBuffer,I.rasterBoundsSegments),z.needsHillshadePrepare=!1}})(d,t,A,n,C,ot.disabled,E),B.viewport.set([0,0,d.width,d.height]);else if(d.renderPass==="translucent")if(y){let[I,b,F]=d.stencilConfigForOverlapTwoPass(A);qs(d,t,n,F,I,C,E,!1,g),qs(d,t,n,F,b,C,E,!0,g)}else{let[I,b]=d.getStencilConfigForOverlapAndUpdateStencilID(A);qs(d,t,n,b,I,C,E,!1,g)}},colorRelief:function(d,t,n,A,l){if(d.renderPass!=="translucent"||!A.length)return;let{isRenderingToTexture:g}=l,B=d.style.projection.useSubdivision,y=d.getDepthModeForSublayer(0,Xe.ReadOnly),C=d.colorModeForRenderPass();if(B){let[E,I,b]=d.stencilConfigForOverlapTwoPass(A);Vo(d,t,n,b,E,y,C,!1,g),Vo(d,t,n,b,I,y,C,!0,g)}else{let[E,I]=d.getStencilConfigForOverlapAndUpdateStencilID(A);Vo(d,t,n,I,E,y,C,!1,g)}},raster:function(d,t,n,A,l){if(d.renderPass!=="translucent"||n.paint.get("raster-opacity")===0||!A.length)return;let{isRenderingToTexture:g}=l,B=t.getSource(),y=d.style.projection.useSubdivision;if(B instanceof Lr)oo(d,t,n,A,null,!1,!1,B.tileCoords,B.flippedWindingOrder,g);else if(y){let[C,E,I]=d.stencilConfigForOverlapTwoPass(A);oo(d,t,n,I,C,!1,!0,wn,!1,g),oo(d,t,n,I,E,!0,!0,wn,!1,g)}else{let[C,E]=d.getStencilConfigForOverlapAndUpdateStencilID(A);oo(d,t,n,E,C,!1,!0,wn,!1,g)}},background:function(d,t,n,A,l){var g;let B=n.paint.get("background-color"),y=n.paint.get("background-opacity");if(y===0)return;let{isRenderingToTexture:C}=l,E=d.context,I=E.gl,b=d.style.projection,F=d.transform,T=F.tileSize,P=n.paint.get("background-pattern");if(d.isPatternMissing(P))return;let R=!P&&B.a===1&&y===1&&d.opaquePassEnabledForLayer()?"opaque":"translucent";if(d.renderPass!==R)return;let Y=ot.disabled,N=d.getDepthModeForSublayer(0,R==="opaque"?Xe.ReadWrite:Xe.ReadOnly),K=d.colorModeForRenderPass(),H=d.useProgram(P?"backgroundPattern":"background"),j=A||sn(F,{tileSize:T,terrain:d.style.map.terrain});P&&(E.activeTexture.set(I.TEXTURE0),d.imageManager.bind(d.context));let z=n.getCrossfadeParameters();for(let Z of j){let X=F.getProjectionData({overscaledTileID:Z,applyGlobeMatrix:!C,applyTerrainMatrix:!0}),te=P?da(y,d,P,{tileID:Z,tileSize:T},z):Bn(y,B),Ae=(g=d.style.map.terrain)===null||g===void 0?void 0:g.getTerrainData(Z),ae=b.getMeshFromTileID(E,Z.canonical,!1,!0,"raster");H.draw(E,I.TRIANGLES,N,Y,K,it.backCCW,te,Ae,X,n.id,ae.vertexBuffer,ae.indexBuffer,ae.segments)}},sky:function(d,t){let n=d.context,A=n.gl,l=((I,b,F)=>{let T=Math.cos(b.rollInRadians),P=Math.sin(b.rollInRadians),R=on(b),Y=b.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:I.properties.get("sky-color"),u_horizon_color:I.properties.get("horizon-color"),u_horizon:[(b.width/2-R*P)*F,(b.height/2+R*T)*F],u_horizon_normal:[-P,T],u_sky_horizon_blend:I.properties.get("sky-horizon-blend")*b.height/2*F,u_sky_blend:Y}})(t,d.style.map.transform,d.pixelRatio),g=new Xe(A.LEQUAL,Xe.ReadWrite,[0,1]),B=ot.disabled,y=d.colorModeForRenderPass(),C=d.useProgram("sky"),E=Ea(n,t);C.draw(n,A.TRIANGLES,g,B,y,it.disabled,l,null,void 0,"sky",E.vertexBuffer,E.indexBuffer,E.segments)},atmosphere:function(d,t,n){let A=d.context,l=A.gl,g=d.useProgram("atmosphere"),B=new Xe(l.LEQUAL,Xe.ReadOnly,[0,1]),y=d.transform,C=(function(Y,N){let K=Y.properties.get("position"),H=[-K.x,-K.y,-K.z],j=c.ap(new Float64Array(16));return Y.properties.get("anchor")==="map"&&(c.be(j,j,N.rollInRadians),c.bf(j,j,-N.pitchInRadians),c.be(j,j,N.bearingInRadians),c.bf(j,j,N.center.lat*Math.PI/180),c.bI(j,j,-N.center.lng*Math.PI/180)),c.cg(H,H,j),H})(n,d.transform),E=y.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),I=t.properties.get("atmosphere-blend")*E.projectionTransition;if(I===0)return;let b=Pi(y.worldSize,y.center.lat),F=y.inverseProjectionMatrix,T=new Float64Array(4);T[3]=1,c.aE(T,T,y.modelViewProjectionMatrix),T[0]/=T[3],T[1]/=T[3],T[2]/=T[3],T[3]=1,c.aE(T,T,F),T[0]/=T[3],T[1]/=T[3],T[2]/=T[3],T[3]=1;let P=((Y,N,K,H,j)=>({u_sun_pos:Y,u_atmosphere_blend:N,u_globe_position:K,u_globe_radius:H,u_inv_proj_matrix:j}))(C,I,[T[0],T[1],T[2]],b,F),R=Ea(A,t);g.draw(A,l.TRIANGLES,B,ot.disabled,mt.alphaBlended,it.disabled,P,null,null,"atmosphere",R.vertexBuffer,R.indexBuffer,R.segments)},custom:function(d,t,n,A){let{isRenderingGlobe:l}=A,g=d.context,B=n.implementation,y=d.style.projection,C=d.transform,E=C.getProjectionDataForCustomLayer(l),I={farZ:C.farZ,nearZ:C.nearZ,fov:C.fov*Math.PI/180,modelViewProjectionMatrix:C.modelViewProjectionMatrix,projectionMatrix:C.projectionMatrix,shaderData:{variantName:y.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;
|
|
uniform mat4 u_projection_matrix;
|
|
${y.shaderPreludeCode.vertexSource}`,define:y.shaderDefine},defaultProjectionData:E},b=B.renderingMode?B.renderingMode:"2d";if(d.renderPass==="offscreen"){let F=B.prerender;F&&(d.setCustomLayerDefaults(),g.setColorMode(d.colorModeForRenderPass()),F.call(B,g.gl,I),g.setDirty(),d.setBaseState())}else if(d.renderPass==="translucent"){d.setCustomLayerDefaults(),g.setColorMode(d.colorModeForRenderPass()),g.setStencilMode(ot.disabled);let F=b==="3d"?d.getDepthModeFor3D():d.getDepthModeForSublayer(0,Xe.ReadOnly);g.setDepthMode(F),B.render(g.gl,I),g.setDirty(),d.setBaseState(),g.bindFramebuffer.set(null)}},debug:function(d,t,n){for(let A of n)rc(d,t,A)},debugPadding:function(d){let t=d.transform.padding;Qa(d,d.transform.height-(t.top||0),3,$l),Qa(d,t.bottom||0,3,ec),Ca(d,t.left||0,3,tc),Ca(d,d.transform.width-(t.right||0),3,ic);let n=d.transform.centerPoint;(function(A,l,g,B){Zo(A,l-1,g-10,2,20,B),Zo(A,l-10,g-1,20,2,B)})(d,n.x,d.transform.height-n.y,zr)},terrainDepth:function(d,t){let n=d.context,A=n.gl,l=d.transform,g=mt.unblended,B=new Xe(A.LEQUAL,Xe.ReadWrite,[0,1]),y=t.tileManager.getRenderableTiles(),C=d.useProgram("terrainDepth");n.bindFramebuffer.set(t.getFramebuffer("depth").framebuffer),n.viewport.set([0,0,d.width/devicePixelRatio,d.height/devicePixelRatio]),n.clear({color:c.bo.transparent,depth:1});for(let E of y){let I=t.getTerrainMesh(E.tileID),b=t.getTerrainData(E.tileID),F=l.getProjectionData({overscaledTileID:E.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),T={u_ele_delta:t.getMeshFrameDelta(l.zoom)};C.draw(n,A.TRIANGLES,B,ot.disabled,g,it.backCCW,T,b,F,"terrain",I.vertexBuffer,I.indexBuffer,I.segments)}n.bindFramebuffer.set(null),n.viewport.set([0,0,d.width,d.height])},terrainCoords:function(d,t){let n=d.context,A=n.gl,l=d.transform,g=mt.unblended,B=new Xe(A.LEQUAL,Xe.ReadWrite,[0,1]),y=t.getCoordsTexture(),C=t.tileManager.getRenderableTiles(),E=d.useProgram("terrainCoords");n.bindFramebuffer.set(t.getFramebuffer("coords").framebuffer),n.viewport.set([0,0,d.width/devicePixelRatio,d.height/devicePixelRatio]),n.clear({color:c.bo.transparent,depth:1}),t.coordsIndex=[];for(let I of C){let b=t.getTerrainMesh(I.tileID),F=t.getTerrainData(I.tileID);n.activeTexture.set(A.TEXTURE0),A.bindTexture(A.TEXTURE_2D,y.texture);let T={u_terrain_coords_id:(255-t.coordsIndex.length)/255,u_texture:0,u_ele_delta:t.getMeshFrameDelta(l.zoom)},P=l.getProjectionData({overscaledTileID:I.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});E.draw(n,A.TRIANGLES,B,ot.disabled,g,it.backCCW,T,F,P,"terrain",b.vertexBuffer,b.indexBuffer,b.segments),t.coordsIndex.push(I.tileID.key)}n.bindFramebuffer.set(null),n.viewport.set([0,0,d.width,d.height])}};class Ho{constructor(t,n){this.drawFunctions=nc,this.context=new Zs(t),this.transform=n,this._tileTextures={},this.terrainFacilitator={depthDirty:!0,coordsDirty:!1,matrix:c.ap(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=ri.maxOverzooming+ri.maxUnderzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Fi}resize(t,n,A){if(this.width=Math.floor(t*A),this.height=Math.floor(n*A),this.pixelRatio=A,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let l of this.style._order)this.style._layers[l].resize()}setup(){let t=this.context,n=new c.aU;n.emplaceBack(0,0),n.emplaceBack(c.a6,0),n.emplaceBack(0,c.a6),n.emplaceBack(c.a6,c.a6),this.tileExtentBuffer=t.createVertexBuffer(n,Rr.members),this.tileExtentSegments=c.aV.simpleSegment(0,0,4,2);let A=new c.aU;A.emplaceBack(0,0),A.emplaceBack(c.a6,0),A.emplaceBack(0,c.a6),A.emplaceBack(c.a6,c.a6),this.debugBuffer=t.createVertexBuffer(A,Rr.members),this.debugSegments=c.aV.simpleSegment(0,0,4,5);let l=new c.ch;l.emplaceBack(0,0,0,0),l.emplaceBack(c.a6,0,c.a6,0),l.emplaceBack(0,c.a6,0,c.a6),l.emplaceBack(c.a6,c.a6,c.a6,c.a6),this.rasterBoundsBuffer=t.createVertexBuffer(l,Po.members),this.rasterBoundsSegments=c.aV.simpleSegment(0,0,4,2);let g=new c.aU;g.emplaceBack(0,0),g.emplaceBack(c.a6,0),g.emplaceBack(0,c.a6),g.emplaceBack(c.a6,c.a6),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(g,Rr.members),this.rasterBoundsSegmentsPosOnly=c.aV.simpleSegment(0,0,4,5);let B=new c.aU;B.emplaceBack(0,0),B.emplaceBack(1,0),B.emplaceBack(0,1),B.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(B,Rr.members),this.viewportSegments=c.aV.simpleSegment(0,0,4,2);let y=new c.ci;y.emplaceBack(0),y.emplaceBack(1),y.emplaceBack(3),y.emplaceBack(2),y.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(y);let C=new c.aW;C.emplaceBack(1,0,2),C.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(C);let E=this.context.gl;this.stencilClearMode=new ot({func:E.ALWAYS,mask:0},0,255,E.ZERO,E.ZERO,E.ZERO),this.tileExtentMesh=new ft(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let A=c.O();c.c7(A,0,this.width,this.height,0,0,1),c.S(A,A,[n.drawingBufferWidth,n.drawingBufferHeight,0]);let l={mainMatrix:A,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:A};this.useProgram("clippingMask",null,!0).draw(t,n.TRIANGLES,Xe.disabled,this.stencilClearMode,mt.disabled,it.disabled,null,null,l,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,n,A){if(this.currentStencilSource===t.source||!t.isTileClipped()||!(n!=null&&n.length))return;this.currentStencilSource=t.source,this.nextStencilID+n.length>256&&this.clearStencil();let l=this.context;l.setColorMode(mt.disabled),l.setDepthMode(Xe.disabled);let g={};for(let B of n)g[B.key]=this.nextStencilID++;this._renderTileMasks(g,n,A,!0),this._renderTileMasks(g,n,A,!1),this._tileClippingMaskIDs=g}_renderTileMasks(t,n,A,l){var g;let B=this.context,y=B.gl,C=this.style.projection,E=this.transform,I=this.useProgram("clippingMask");for(let b of n){let F=t[b.key],T=(g=this.style.map.terrain)===null||g===void 0?void 0:g.getTerrainData(b),P=C.getMeshFromTileID(this.context,b.canonical,l,!0,"stencil"),R=E.getProjectionData({overscaledTileID:b,applyGlobeMatrix:!A,applyTerrainMatrix:!0});I.draw(B,y.TRIANGLES,Xe.disabled,new ot({func:y.ALWAYS,mask:0},F,255,y.KEEP,y.KEEP,y.REPLACE),mt.disabled,A?it.disabled:it.backCCW,null,T,R,"$clipping",P.vertexBuffer,P.indexBuffer,P.segments)}}_renderTilesDepthBuffer(){var t;let n=this.context,A=n.gl,l=this.style.projection,g=this.transform,B=this.useProgram("depth"),y=this.getDepthModeFor3D(),C=sn(g,{tileSize:g.tileSize});for(let E of C){let I=(t=this.style.map.terrain)===null||t===void 0?void 0:t.getTerrainData(E),b=l.getMeshFromTileID(this.context,E.canonical,!0,!0,"raster"),F=g.getProjectionData({overscaledTileID:E,applyGlobeMatrix:!0,applyTerrainMatrix:!0});B.draw(n,A.TRIANGLES,y,ot.disabled,mt.disabled,it.backCCW,null,I,F,"$clipping",b.vertexBuffer,b.indexBuffer,b.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,n=this.context.gl;return new ot({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){let n=this.context.gl;return new ot({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){let n=this.context.gl,A=t.sort(((B,y)=>y.overscaledZ-B.overscaledZ)),l=A[A.length-1].overscaledZ,g=A[0].overscaledZ-l+1;if(g>1){this.currentStencilSource=void 0,this.nextStencilID+g>256&&this.clearStencil();let B={};for(let y=0;y<g;y++)B[y+l]=new ot({func:n.GEQUAL,mask:255},y+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=g,[B,A]}return[{[l]:ot.disabled},A]}stencilConfigForOverlapTwoPass(t){let n=this.context.gl,A=t.sort(((B,y)=>y.overscaledZ-B.overscaledZ)),l=A[A.length-1].overscaledZ,g=A[0].overscaledZ-l+1;if(this.clearStencil(),g>1){let B={},y={};for(let C=0;C<g;C++)B[C+l]=new ot({func:n.GREATER,mask:255},g+1+C,255,n.KEEP,n.KEEP,n.REPLACE),y[C+l]=new ot({func:n.GREATER,mask:255},1+C,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID=2*g+1,[B,y,A]}return this.nextStencilID=3,[{[l]:new ot({func:n.GREATER,mask:255},2,255,n.KEEP,n.KEEP,n.REPLACE)},{[l]:new ot({func:n.GREATER,mask:255},1,255,n.KEEP,n.KEEP,n.REPLACE)},A]}colorModeForRenderPass(){let t=this.context.gl;return this._showOverdrawInspector?new mt([t.CONSTANT_COLOR,t.ONE],new c.bo(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?mt.unblended:mt.alphaBlended}getDepthModeForSublayer(t,n,A){if(!this.opaquePassEnabledForLayer())return Xe.disabled;let l=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Xe(A||this.context.gl.LEQUAL,n,[l,l])}getDepthModeFor3D(){return new Xe(this.context.gl.LEQUAL,Xe.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,n){var A,l,g;this.style=t,this.options=n,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(Pe()),this.imageManager.beginFrame();let B=this.style._order,y=this.style.tileManagers,C={},E={},I={},b={isRenderingToTexture:!1,isRenderingGlobe:((A=t.projection)===null||A===void 0?void 0:A.transitionState)>0};for(let T in y){let P=y[T];P.used&&P.prepare(this.context),C[T]=P.getVisibleCoordinates(!1),E[T]=C[T].slice().reverse(),I[T]=P.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let T=0;T<B.length;T++)if(this.style._layers[B[T]].is3D()){this.opaquePassCutoff=T;break}this.maybeDrawDepth(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(let T of B){let P=this.style._layers[T];if(!P.hasOffscreenPass()||P.isHidden(this.transform.zoom))continue;let R=E[P.source];(P.type==="custom"||R.length)&&this.renderLayer(this,y[P.source],P,R,b)}if((l=this.style.projection)===null||l===void 0||l.updateGPUdependent({context:this.context,useProgram:T=>this.useProgram(T)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?c.bo.black:c.bo.transparent,depth:1}),this.clearStencil(),this.style.sky&&this.drawFunctions.sky(this,this.style.sky),this._showOverdrawInspector=n.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=B.length-1;this.currentLayer>=0;this.currentLayer--){let T=this.style._layers[B[this.currentLayer]],P=y[T.source],R=C[T.source];this._renderTileClippingMasks(T,R,!1),this.renderLayer(this,P,T,R,b)}this.renderPass="translucent";let F=!1;for(this.currentLayer=0;this.currentLayer<B.length;this.currentLayer++){let T=this.style._layers[B[this.currentLayer]],P=y[T.source];if(!((g=this.renderToTexture)===null||g===void 0)&&g.renderLayer(T,b))continue;this.opaquePassEnabledForLayer()||F||(F=!0,b.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let R=(T.type==="symbol"?I:E)[T.source];this._renderTileClippingMasks(T,C[T.source],!!this.renderToTexture),this.renderLayer(this,P,T,R,b)}if(b.isRenderingGlobe&&this.drawFunctions.atmosphere(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let T=(function(P,R){let Y=null,N=Object.values(P._layers).flatMap((z=>z.source&&!z.isHidden(R)?[P.tileManagers[z.source]]:[])),K=N.filter((z=>z.getSource().type==="vector")),H=N.filter((z=>z.getSource().type!=="vector")),j=z=>{(!Y||Y.getSource().maxzoom<z.getSource().maxzoom)&&(Y=z)};for(let z of K)j(z);if(!Y)for(let z of H)j(z);return Y})(this.style,this.transform.zoom);T&&this.drawFunctions.debug(this,T,T.getVisibleCoordinates())}this.options.showPadding&&this.drawFunctions.debugPadding(this),this.context.setDefault()}maybeDrawDepth(t){var n,A;if(!(!((A=(n=this.style)===null||n===void 0?void 0:n.map)===null||A===void 0)&&A.terrain))return;let l=this.terrainFacilitator.matrix,g=this.transform.modelViewProjectionMatrix,B=this.terrainFacilitator.depthDirty;B||(B=t?!c.cj(l,g):!c.ck(l,g)),B||(B=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),B&&(c.cl(l,g),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.depthDirty=!1,this.terrainFacilitator.coordsDirty=!0,this.drawFunctions.terrainDepth(this,this.style.map.terrain))}maybeDrawCoords(){var t,n;!((n=(t=this.style)===null||t===void 0?void 0:t.map)===null||n===void 0)&&n.terrain&&this.terrainFacilitator.coordsDirty&&(this.terrainFacilitator.coordsDirty=!1,this.drawFunctions.terrainCoords(this,this.style.map.terrain))}renderLayer(t,n,A,l,g){if(A.isHidden(this.transform.zoom)||A.type!=="background"&&A.type!=="custom"&&!(l||[]).length)return;this.id=A.id;let B=this.drawFunctions;c.aQ(A)?B.symbol(t,n,A,l,this.style.placement.variableOffsets,g):c.cm(A)?B.circle(t,n,A,l,g):c.cn(A)?B.heatmap(t,n,A,l,g):c.co(A)?B.line(t,n,A,l,g):c.cp(A)?B.fill(t,n,A,l,g):c.cq(A)?B.fillExtrusion(t,n,A,l,g):c.cr(A)?B.hillshade(t,n,A,l,g):c.cs(A)?B.colorRelief(t,n,A,l,g):c.bU(A)?B.raster(t,n,A,l,g):c.ct(A)?B.background(t,n,A,l,g):c.cu(A)&&B.custom(t,n,A,g)}saveTileTexture(t){let n=this._tileTextures[t.size[0]];n?n.length<Ho.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?n.push(t):t.destroy():this._tileTextures[t.size[0]]=[t]}getTileTexture(t){let n=this._tileTextures[t];return n&&n.length>0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let n=this.imageManager.getPattern(t.from.toString()),A=this.imageManager.getPattern(t.to.toString());return!n||!A}useProgram(t,n,A=!1,l=[]){var g;this.cache||(this.cache={});let B=!!this.style.map.terrain,y=this.style.projection,C=A?Et.projectionMercator:y.shaderPreludeCode,E=A?mi:y.shaderDefine,I=t+(n?n.cacheKey:"")+`/${A?ki:y.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(B?"/terrain":"")+(l?`/${l.join("/")}`:"");return(g=this.cache)[I]||(g[I]=new ph(this.context,Et[t],n,_h[t],this._showOverdrawInspector,B,C,E,l)),this.cache[I]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new c.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){var t,n;if(this._tileTextures){for(let A in this._tileTextures){let l=this._tileTextures[A];if(l)for(let g of l)g.destroy()}this._tileTextures={}}if(this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&((t=this.tileExtentMesh.vertexBuffer)===null||t===void 0||t.destroy()),this.tileExtentMesh&&((n=this.tileExtentMesh.indexBuffer)===null||n===void 0||n.destroy()),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.cache){for(let A in this.cache){let l=this.cache[A];l!=null&&l.program&&this.context.gl.deleteProgram(l.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:n}=this.context.gl;return this.width!==t||this.height!==n}}function Ia(d,t){let n,A=!1,l=null,g=()=>{l=null,A&&(d(...n),l=setTimeout(g,t),A=!1)};return(...B)=>(A=!0,n=B,l||g(),l)}Ho.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50;class Jo{constructor(t){this._getCurrentHash=()=>{let n=window.location.hash.replace("#","");if(this._hashName){let A,l=n.split("&").map((g=>g.split("=")));for(let g of l)g[0]===this._hashName&&(A=g);return(A&&A[1]||"").split("/")}return n.split("/")},this._onHashChange=()=>{let n=this._getCurrentHash();if(!this._isValidHash(n))return!1;let A=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(n[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:A,pitch:+(n[4]||0)}),!0},this._updateHashUnthrottled=()=>{let n=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,n)},this._removeHash=()=>{let n=this._getCurrentHash();if(n.length===0)return;let A=n.join("/"),l=A;l.split("&").length>0&&(l=l.split("&")[0]),this._hashName&&(l=`${this._hashName}=${A}`);let g=window.location.hash.replace(l,"");g.startsWith("#&")?g=g.slice(0,1)+g.slice(2):g==="#"&&(g="");let B=window.location.href.replace(/(#.+)?$/,g);B=B.replace("&&","&"),window.history.replaceState(window.history.state,null,B)},this._updateHash=Ia(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(t){let n=this._map.getCenter(),A=Math.round(100*this._map.getZoom())/100,l=Math.ceil((A*Math.LN2+Math.log(512/360/.5))/Math.LN10),g=Math.pow(10,l),B=Math.round(n.lng*g)/g,y=Math.round(n.lat*g)/g,C=this._map.getBearing(),E=this._map.getPitch(),I="";if(I+=t?`/${B}/${y}/${A}`:`${A}/${y}/${B}`,(C||E)&&(I+="/"+Math.round(10*C)/10),E&&(I+=`/${Math.round(E)}`),this._hashName){let b=this._hashName,F=!1,T=window.location.hash.slice(1).split("&").map((P=>{let R=P.split("=")[0];return R===b?(F=!0,`${R}=${I}`):P})).filter((P=>P));return F||T.push(`${b}=${I}`),`#${T.join("&")}`}return`#${I}`}_isValidHash(t){if(t.length<3||t.some(isNaN))return!1;try{new c.W(+t[2],+t[1])}catch(g){return!1}let n=+t[0],A=+(t[3]||0),l=+(t[4]||0);return n>=this._map.getMinZoom()&&n<=this._map.getMaxZoom()&&A>=-180&&A<=180&&l>=this._map.getMinPitch()&&l<=this._map.getMaxPitch()}}let so={linearity:.3,easing:c.cv(0,0,.3,1)},Zi=c.e({deceleration:2500,maxSpeed:1400},so),sr=c.e({deceleration:20,maxSpeed:1400},so),oc=c.e({deceleration:1e3,maxSpeed:360},so),Ar=c.e({deceleration:1e3,maxSpeed:90},so),Fh=c.e({deceleration:1e3,maxSpeed:360},so);class Dh{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:Pe(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,n=Pe();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let n={zoom:0,bearing:0,pitch:0,roll:0,pan:new c.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:g}of this._inertiaBuffer)n.zoom+=g.zoomDelta||0,n.bearing+=g.bearingDelta||0,n.pitch+=g.pitchDelta||0,n.roll+=g.rollDelta||0,g.panDelta&&n.pan._add(g.panDelta),g.around&&(n.around=g.around),g.pinchAround&&(n.pinchAround=g.pinchAround);let A=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,l={};if(n.pan.mag()){let g=ur(n.pan.mag(),A,c.e({},Zi,t||{})),B=n.pan.mult(g.amount/n.pan.mag()),y=this._map.cameraHelper.handlePanInertia(B,this._map.transform);l.center=y.easingCenter,l.offset=y.easingOffset,qo(l,g)}if(n.zoom){let g=ur(n.zoom,A,sr);l.zoom=c.cw(this._map.transform.zoom+g.amount,this._map.getZoomSnap(),g.amount),qo(l,g)}if(n.bearing){let g=ur(n.bearing,A,oc);l.bearing=this._map.transform.bearing+c.al(g.amount,-179,179),qo(l,g)}if(n.pitch){let g=ur(n.pitch,A,Ar);l.pitch=this._map.transform.pitch+g.amount,qo(l,g)}if(n.roll){let g=ur(n.roll,A,Fh);l.roll=this._map.transform.roll+c.al(g.amount,-179,179),qo(l,g)}if(l.zoom||l.bearing){let g=n.pinchAround===void 0?n.around:n.pinchAround;l.around=g?this._map.unproject(g):this._map.getCenter()}return this.clear(),c.e(l,{noMoveStart:!0})}}function qo(d,t){(!d.duration||d.duration<t.duration)&&(d.duration=t.duration,d.easing=t.easing)}function ur(d,t,n){let{maxSpeed:A,linearity:l,deceleration:g}=n,B=c.al(d*l/(t/1e3),-A,A),y=Math.abs(B)/(g*l);return{easing:n.easing,duration:1e3*y,amount:B*(y/2)}}class Ri extends c.n{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,A,l={}){A=A instanceof MouseEvent?A:new MouseEvent(t,A);let g=de.mousePos(n.getCanvas(),A),B=n.unproject(g);super(t,c.e({point:g,lngLat:B,originalEvent:A},l)),this._defaultPrevented=!1,this.target=n}}class Wo extends c.n{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,A){let l=t==="touchend"?A.changedTouches:A.touches,g=de.touchPos(n.getCanvasContainer(),l),B=g.map((C=>n.unproject(C))),y=g.reduce(((C,E,I,b)=>C.add(E.div(b.length))),new c.P(0,0));super(t,{points:g,point:y,lngLats:B,lngLat:n.unproject(y),originalEvent:A}),this._defaultPrevented=!1}}class sc extends c.n{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,A){super(t,{originalEvent:A}),this._defaultPrevented=!1}}class Sh{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new sc(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new Ri(t.type,this._map,t))}mouseup(t){this._map.fire(new Ri(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new Ri(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Ri(t.type,this._map,t))}mouseover(t){this._map.fire(new Ri(t.type,this._map,t))}mouseout(t){this._map.fire(new Ri(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Wo(t.type,this._map,t))}touchmove(t){this._map.fire(new Wo(t.type,this._map,t))}touchend(t){this._map.fire(new Wo(t.type,this._map,t))}touchcancel(t){this._map.fire(new Wo(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ac{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Ri(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ri("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Ri(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Qr{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.screenPointToLocation(c.P.convert(t),this._map.terrain)}}class dr{constructor(t,n){this._map=t,this._tr=new Qr(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1,n.boxZoom&&typeof n.boxZoom=="object"&&(this._boxZoomEnd=n.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&t.button===0&&(de.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active)return;let A=n;if(this._lastPos.equals(A)||!this._box&&A.dist(this._startPos)<this._clickTolerance)return;let l=this._startPos;this._lastPos=A,this._box||(this._box=de.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));let g=Math.min(l.x,A.x),B=Math.max(l.x,A.x),y=Math.min(l.y,A.y),C=Math.max(l.y,A.y);this._box.style.transform=`translate(${g}px,${y}px)`,this._box.style.width=B-g+"px",this._box.style.height=C-y+"px"}mouseupWindow(t,n){if(!this._active||t.button!==0)return;let A=this._startPos,l=n;if(this.reset(),de.suppressClick(),A.x!==l.x||A.y!==l.y)return this._map.fire(new c.n("boxzoomend",{originalEvent:t})),this._boxZoomEnd?void this._boxZoomEnd(this._map,A,l,t):{cameraAnimation:g=>g.fitScreenCoordinates(A,l,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(this._box.remove(),this._box=null),de.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new c.n(t,{originalEvent:n}))}}function be(d,t){if(d.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${d.length}, points ${t.length}`);let n={};for(let A=0;A<d.length;A++)n[d[A].identifier]=t[A];return n}class ac{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,n,A){(this.centroid||A.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),A.length===this.numTouches&&(this.centroid=(function(l){let g=new c.P(0,0);for(let B of l)g._add(B);return g.div(l.length)})(n),this.touches=be(A,n)))}touchmove(t,n,A){if(this.aborted||!this.centroid)return;let l=be(A,n);for(let g in this.touches){let B=l[g];(!B||B.dist(this.touches[g])>30)&&(this.aborted=!0)}}touchend(t,n,A){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),A.length===0){let l=!this.aborted&&this.centroid;if(this.reset(),l)return l}}}class $o{constructor(t){this.singleTap=new ac(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,A){this.singleTap.touchstart(t,n,A)}touchmove(t,n,A){this.singleTap.touchmove(t,n,A)}touchend(t,n,A){let l=this.singleTap.touchend(t,n,A);if(l){let g=t.timeStamp-this.lastTime<500,B=!this.lastTap||this.lastTap.dist(l)<30;if(g&&B||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=l,this.count===this.numTaps)return this.reset(),l}}}class lc{constructor(t){this._tr=new Qr(t),this._zoomIn=new $o({numTouches:1,numTaps:2}),this._zoomOut=new $o({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,A){this._zoomIn.touchstart(t,n,A),this._zoomOut.touchstart(t,n,A)}touchmove(t,n,A){this._zoomIn.touchmove(t,n,A),this._zoomOut.touchmove(t,n,A)}touchend(t,n,A){let l=this._zoomIn.touchend(t,n,A),g=this._zoomOut.touchend(t,n,A),B=this._tr;return l?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:y=>y.easeTo({duration:300,zoom:c.cw(B.zoom+1,y.getZoomSnap()),around:B.unproject(l)},{originalEvent:t})}):g?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:y=>y.easeTo({duration:300,zoom:c.cw(B.zoom-1,y.getZoomSnap()),around:B.unproject(g)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Cr{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){let n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.rollDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(n)?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;let A=this._lastPoint;if(!A)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let l=Array.isArray(n)?n[0]:n;return!this._moved&&l.dist(A)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=l,this._move(A,l))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&de.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let es=0,xa=2,Mh={[es]:1,[xa]:2};class En{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){this._eventButton=t.button}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!(function(n,A){let l=Mh[A];return n.buttons===void 0||(n.buttons&l)!==l})(t,this._eventButton)}isValidEndEvent(t){return t.button===this._eventButton}}class cc{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return t.targetTouches.length===1}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}class va{constructor(t=new En({checkCorrectEvent:()=>!0}),n=new cc){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=n}_executeRelevantHandler(t,n,A){return t instanceof MouseEvent?n(t):typeof TouchEvent!="undefined"&&t instanceof TouchEvent?A(t):void 0}startMove(t){this._executeRelevantHandler(t,(n=>{this.mouseMoveStateManager.startMove(n)}),(n=>{this.oneFingerTouchMoveStateManager.startMove(n)}))}endMove(t){this._executeRelevantHandler(t,(n=>{this.mouseMoveStateManager.endMove(n)}),(n=>{this.oneFingerTouchMoveStateManager.endMove(n)}))}isValidStartEvent(t){return this._executeRelevantHandler(t,(n=>this.mouseMoveStateManager.isValidStartEvent(n)),(n=>this.oneFingerTouchMoveStateManager.isValidStartEvent(n)))}isValidMoveEvent(t){return this._executeRelevantHandler(t,(n=>this.mouseMoveStateManager.isValidMoveEvent(n)),(n=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(n)))}isValidEndEvent(t){return this._executeRelevantHandler(t,(n=>this.mouseMoveStateManager.isValidEndEvent(n)),(n=>this.oneFingerTouchMoveStateManager.isValidEndEvent(n)))}}let Ws=d=>{d.mousedown=d.dragStart,d.mousemoveWindow=d.dragMove,d.mouseup=d.dragEnd,d.contextmenu=t=>{t.preventDefault()}};class hc{constructor(t,n){this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new c.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,n,A){return this._calculateTransform(t,n,A)}touchmove(t,n,A){if(this._active){if(!this._shouldBePrevented(A.length))return t.preventDefault(),this._calculateTransform(t,n,A);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,n,A){this._calculateTransform(t,n,A),this._active&&this._shouldBePrevented(A.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,n,A){A.length>0&&(this._active=!0);let l=be(A,n),g=new c.P(0,0),B=new c.P(0,0),y=0;for(let E in l){let I=l[E],b=this._touches[E];b&&(g._add(I),B._add(I.sub(b)),y++,l[E]=I)}if(this._touches=l,this._shouldBePrevented(y)||!B.mag())return;let C=B.div(y);return this._sum._add(C),this._sum.mag()<this._clickTolerance?void 0:{around:g.div(y),panDelta:C}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ba{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,n,A){this._firstTwoTouches||A.length<2||(this._firstTwoTouches=[A[0].identifier,A[1].identifier],this._start([n[0],n[1]]))}touchmove(t,n,A){if(!this._firstTwoTouches)return;t.preventDefault();let[l,g]=this._firstTwoTouches,B=$s(A,n,l),y=$s(A,n,g);if(!B||!y)return;let C=this._aroundCenter?null:B.add(y).div(2);return this._move([B,y],C,t)}touchend(t,n,A){if(!this._firstTwoTouches)return;let[l,g]=this._firstTwoTouches,B=$s(A,n,l),y=$s(A,n,g);B&&y||(this._active&&de.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&t.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function $s(d,t,n){for(let A=0;A<d.length;A++)if(d[A].identifier===n)return t[A]}function Fa(d,t){return Math.log(d/t)/Math.LN2}class uc extends ba{constructor(){super(),this._zoomRate=1,this._zoomThreshold=.1}setZoomRate(t){this._zoomRate=t!=null?t:1}setZoomThreshold(t){this._zoomThreshold=t!=null?t:.1}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,n){let A=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Fa(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:Fa(this._distance,A)*this._zoomRate,pinchAround:n}}}function Da(d,t){return 180*d.angleWith(t)/Math.PI}class dc extends ba{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,n,A){let l=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Da(this._vector,l),pinchAround:n}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());let n=25/(Math.PI*this._minDiameter)*360,A=Da(t,this._startVector);return Math.abs(A)<n}}function Sa(d){return Math.abs(d.y)>Math.abs(d.x)}class wr extends ba{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,A){super.touchstart(t,n,A),this._currentTouchCount=A.length}_start(t){this._lastPoints=t,Sa(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,A){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let l=t[0].sub(this._lastPoints[0]),g=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(l,g,A.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(l.y+g.y)/2*-.5}):void 0}gestureBeginsVertically(t,n,A){if(this._valid!==void 0)return this._valid;let l=t.mag()>=2,g=n.mag()>=2;if(!l&&!g)return;if(!l||!g)return this._firstMove===void 0&&(this._firstMove=A),A-this._firstMove<100&&void 0;let B=t.y>0==n.y>0;return Sa(t)&&Sa(n)&&B}}let Bt={panStep:100,bearingStep:15,pitchStep:10};class gc{constructor(t){this._tr=new Qr(t);let n=Bt;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,A=0,l=0,g=0,B=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?A=-1:(t.preventDefault(),g=-1);break;case 39:t.shiftKey?A=1:(t.preventDefault(),g=1);break;case 38:t.shiftKey?l=1:(t.preventDefault(),B=-1);break;case 40:t.shiftKey?l=-1:(t.preventDefault(),B=1);break;default:return}return this._rotationDisabled&&(A=0,l=0),{cameraAnimation:y=>{let C=this._tr;y.easeTo({duration:300,easeId:"keyboardHandler",easing:eA,zoom:n?c.cw(C.zoom+n*(t.shiftKey?2:1),y.getZoomSnap()):C.zoom,bearing:C.bearing+A*this._bearingStep,pitch:C.pitch+l*this._pitchStep,offset:[-g*this._panStep,-B*this._panStep],center:C.center},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function eA(d){return d*(2-d)}let ts=4.000244140625,Ma=1/450;class Ta{constructor(t,n){this._onTimeout=A=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(A)},this._map=t,this._tr=new Qr(t),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=Ma}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,A=Pe(),l=A-(this._lastWheelEventTime||0);this._lastWheelEventTime=A,n!==0&&n%ts==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":l>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(l*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let n=de.mousePos(this._map.getCanvas(),t),A=this._tr;this._aroundPoint=this._aroundCenter?A.transform.locationToScreenPoint(c.W.convert(A.center)):n,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let t=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){let y=t.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=y),typeof this._targetZoom=="number"&&(this._targetZoom+=y)}if(this._delta!==0){let y=this._type==="wheel"&&Math.abs(this._delta)>ts?this._wheelZoomRate:this._defaultZoomRate,C=2/(1+Math.exp(-Math.abs(this._delta*y)));this._delta<0&&C!==0&&(C=1/C);let E=typeof this._targetZoom!="number"?t.scale:c.ao(this._targetZoom),I=t.applyConstrain(t.getCameraLngLat(),c.ar(E*C)).zoom,b=this._map.getZoomSnap();if(this._type==="wheel"&&b>0){let F=c.cw(t.zoom,b);this._targetZoom=c.cw(I,b,I-F)}else this._targetZoom=I;this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let n=typeof this._targetZoom!="number"?t.zoom:this._targetZoom,A=this._startZoom,l=this._easing,g,B=!1;if(this._type==="wheel"&&A&&l){let y=Pe()-this._lastWheelEventTime,C=Math.min((y+5)/200,1),E=l(C);g=c.H.number(A,n,E),C<1?this._needsRerender=!0:B=!0}else g=n,B=!0;return this._active=!0,B&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout}),200)),this._lastExpectedZoom=g,{noInertia:!0,needsRenderFrame:!B,zoomDelta:g-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=c.cy;if(this._prevEase){let A=this._prevEase,l=(Pe()-A.start)/A.duration,g=A.easing(l+.01)-A.easing(l),B=.27/Math.sqrt(g*g+1e-4)*.01,y=Math.sqrt(.0729-B*B);n=c.cv(B,y,.25,1)}return this._prevEase={start:Pe(),duration:t,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Ua{constructor(t,n){this._clickZoom=t,this._tapZoom=n}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class pc{constructor(t){this._tr=new Qr(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:A=>{A.easeTo({duration:300,zoom:c.cw(this._tr.zoom+(t.shiftKey?-1:1),A.getZoomSnap()),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Th{constructor(){this._tap=new $o({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(t){this._zoomRate=t!=null?t:1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,n,A){if(!this._swipePoint)if(this._tapTime){let l=n[0],g=t.timeStamp-this._tapTime<500,B=this._tapPoint.dist(l)<30;g&&B?A.length>0&&(this._swipePoint=l,this._swipeTouch=A[0].identifier):this.reset()}else this._tap.touchstart(t,n,A)}touchmove(t,n,A){if(this._tapTime){if(this._swipePoint){if(A[0].identifier!==this._swipeTouch)return;let l=n[0],g=l.y-this._swipePoint.y;return this._swipePoint=l,t.preventDefault(),this._active=!0,{zoomDelta:g/128*this._zoomRate}}}else this._tap.touchmove(t,n,A)}touchend(t,n,A){if(this._tapTime)this._swipePoint&&A.length===0&&this.reset();else{let l=this._tap.touchend(t,n,A);l&&(this._tapTime=t.timeStamp,this._tapPoint=l)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ar{constructor(t,n,A){this._el=t,this._mousePan=n,this._touchPan=A}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class is{constructor(t,n,A,l){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=n,this._mousePitch=A,this._mouseRoll=l}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class De{constructor(t,n,A,l){this._el=t,this._touchZoom=n,this._touchRotate=A,this._tapDragZoom=l,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}setZoomRate(t){this._touchZoom.setZoomRate(t),this._tapDragZoom.setZoomRate(t)}setZoomThreshold(t){this._touchZoom.setZoomThreshold(t)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Le{constructor(t,n){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=n,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=de.create("div","maplibregl-cooperative-gesture-screen",t);let n=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(n=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let A=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),l=document.createElement("div");l.className="maplibregl-desktop-message",l.textContent=n,this._container.appendChild(l);let g=document.createElement("div");g.className="maplibregl-mobile-message",g.textContent=A,this._container.appendChild(g),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(t){return t[this._bypassKey]}notifyGestureBlocked(t,n){this._enabled&&(this._map.fire(new c.n("cooperativegestureprevented",{gestureType:t,originalEvent:n})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}let Yr=d=>d.zoom||d.drag||d.roll||d.pitch||d.rotate;class fc extends c.n{}function Ao(d){var t;return((t=d.panDelta)===null||t===void 0?void 0:t.mag())||d.zoomDelta||d.bearingDelta||d.pitchDelta||d.rollDelta}class _i{get _ownerDocument(){var t;return((t=this._el)===null||t===void 0?void 0:t.ownerDocument)||document}get _ownerWindow(){var t,n;return((n=(t=this._el)===null||t===void 0?void 0:t.ownerDocument)===null||n===void 0?void 0:n.defaultView)||window}constructor(t,n){this.handleWindowEvent=l=>{this.handleEvent(l,`${l.type}Window`)},this.handleEvent=(l,g)=>{if(l.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let B=l.type==="renderFrame"?void 0:l,y={needsRenderFrame:!1},C={},E={};for(let{handlerName:F,handler:T,allowed:P}of this._handlers){if(!T.isEnabled())continue;let R;if(this._blockedByActive(E,P,F))T.reset();else if(T[g||l.type]){if(c.cz(l,g||l.type)){let Y=de.mousePos(this._map.getCanvas(),l);R=T[g||l.type](l,Y)}else if(c.cA(l,g||l.type)){let Y=this._getMapTouches(l.touches),N=de.touchPos(this._map.getCanvas(),Y);R=T[g||l.type](l,N,Y)}else c.cB(g||l.type)||(R=T[g||l.type](l));this.mergeHandlerResult(y,C,R,F,B),R!=null&&R.needsRenderFrame&&this._triggerRenderFrame()}(R||T.isActive())&&(E[F]=T)}let I={};for(let F in this._previousActiveHandlers)E[F]||(I[F]=B);this._previousActiveHandlers=E,(Object.keys(I).length||Ao(y))&&(this._changes.push([y,C,I]),this._triggerRenderFrame()),(Object.keys(E).length||Ao(y))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:b}=y;b&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],b(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Dh(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);let A=this._el;this._listeners=[[A,"touchstart",{passive:!0}],[A,"touchmove",{passive:!1}],[A,"touchend",void 0],[A,"touchcancel",void 0],[A,"mousedown",void 0],[A,"mousemove",void 0],[A,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[A,"mouseover",void 0],[A,"mouseout",void 0],[A,"dblclick",void 0],[A,"click",void 0],[A,"keydown",{capture:!1}],[A,"keyup",void 0],[A,"wheel",{passive:!1}],[A,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]];for(let[l,g,B]of this._listeners)l.addEventListener(g,l===this._ownerDocument?this.handleWindowEvent:this.handleEvent,B)}destroy(){for(let[t,n,A]of this._listeners)t.removeEventListener(n,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,A)}_addDefaultHandlers(t){let n=this._map,A=n.getCanvasContainer();this._add("mapEvent",new Sh(n,t));let l=n.boxZoom=new dr(n,t);this._add("boxZoom",l),t.interactive&&t.boxZoom&&l.enable();let g=n.cooperativeGestures=new Le(n,t.cooperativeGestures);this._add("cooperativeGestures",g),t.cooperativeGestures&&g.enable();let B=new lc(n),y=new pc(n);n.doubleClickZoom=new Ua(y,B),this._add("tapZoom",B),this._add("clickZoom",y),t.interactive&&t.doubleClickZoom&&n.doubleClickZoom.enable();let C=new Th;this._add("tapDragZoom",C);let E=n.touchPitch=new wr(n);this._add("touchPitch",E),t.interactive&&t.touchPitch&&n.touchPitch.enable(t.touchPitch);let I=()=>n.project(n.getCenter()),b=(function({enable:j,clickTolerance:z,aroundCenter:Z=!0,minPixelCenterThreshold:X=100,rotateDegreesPerPixelMoved:te=.8},Ae){let ae=new En({checkCorrectEvent:Be=>Be.button===0&&Be.ctrlKey||Be.button===2&&!Be.ctrlKey});return new Cr({clickTolerance:z,move:(Be,me)=>{let Fe=Ae();if(Z&&Math.abs(Fe.y-Be.y)>X)return{bearingDelta:c.cx(new c.P(Be.x,me.y),me,Fe)};let Ie=(me.x-Be.x)*te;return Z&&me.y<Fe.y&&(Ie=-Ie),{bearingDelta:Ie}},moveStateManager:ae,enable:j,assignEvents:Ws})})(t,I),F=(function({enable:j,clickTolerance:z,pitchDegreesPerPixelMoved:Z=-.5}){let X=new En({checkCorrectEvent:te=>te.button===0&&te.ctrlKey||te.button===2});return new Cr({clickTolerance:z,move:(te,Ae)=>({pitchDelta:(Ae.y-te.y)*Z}),moveStateManager:X,enable:j,assignEvents:Ws})})(t),T=(function({enable:j,clickTolerance:z,rollDegreesPerPixelMoved:Z=.3},X){let te=new En({checkCorrectEvent:Ae=>Ae.button===2&&Ae.ctrlKey});return new Cr({clickTolerance:z,move:(Ae,ae)=>{let Be=X(),me=(ae.x-Ae.x)*Z;return ae.y<Be.y&&(me=-me),{rollDelta:me}},moveStateManager:te,enable:j,assignEvents:Ws})})(t,I);n.dragRotate=new is(t,b,F,T),this._add("mouseRotate",b,["mousePitch"]),this._add("mousePitch",F,["mouseRotate","mouseRoll"]),this._add("mouseRoll",T,["mousePitch"]),t.interactive&&t.dragRotate&&n.dragRotate.enable();let P=(function({enable:j,clickTolerance:z}){let Z=new En({checkCorrectEvent:X=>X.button===0&&!X.ctrlKey});return new Cr({clickTolerance:z,move:(X,te)=>({around:te,panDelta:te.sub(X)}),activateOnStart:!0,moveStateManager:Z,enable:j,assignEvents:Ws})})(t),R=new hc(t,n);n.dragPan=new ar(A,P,R),this._add("mousePan",P),this._add("touchPan",R,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&n.dragPan.enable(t.dragPan);let Y=new dc,N=new uc;n.touchZoomRotate=new De(A,N,Y,C),this._add("touchRotate",Y,["touchPan","touchZoom"]),this._add("touchZoom",N,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&n.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new Ac(n));let K=n.scrollZoom=new Ta(n,(()=>this._triggerRenderFrame()));this._add("scrollZoom",K,["mousePan"]),t.interactive&&t.scrollZoom&&n.scrollZoom.enable(t.scrollZoom);let H=n.keyboard=new gc(n);this._add("keyboard",H),t.interactive&&t.keyboard&&n.keyboard.enable()}_add(t,n,A){this._handlers.push({handlerName:t,handler:n,allowed:A}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(let{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(let{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Yr(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,A){for(let l in t)if(l!==A&&!(n!=null&&n.includes(l)))return!0;return!1}_getMapTouches(t){let n=[];for(let A of t)this._el.contains(A.target)&&n.push(A);return n}mergeHandlerResult(t,n,A,l,g){if(!A)return;c.e(t,A);let B={handlerName:l,originalEvent:A.originalEvent||g};A.zoomDelta!==void 0&&(n.zoom=B),A.panDelta!==void 0&&(n.drag=B),A.rollDelta!==void 0&&(n.roll=B),A.pitchDelta!==void 0&&(n.pitch=B),A.bearingDelta!==void 0&&(n.rotate=B)}_applyChanges(){let t={},n={},A={};for(let[l,g,B]of this._changes)l.panDelta&&(t.panDelta=(t.panDelta||new c.P(0,0))._add(l.panDelta)),l.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+l.zoomDelta),l.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+l.bearingDelta),l.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+l.pitchDelta),l.rollDelta&&(t.rollDelta=(t.rollDelta||0)+l.rollDelta),l.around!==void 0&&(t.around=l.around),l.pinchAround!==void 0&&(t.pinchAround=l.pinchAround),l.noInertia&&(t.noInertia=l.noInertia),c.e(n,g),c.e(A,B);this._updateMapTransform(t,n,A),this._changes=[]}_updateMapTransform(t,n,A){let l=this._map,g=l._getTransformForUpdate(),B=l.terrain;if(!(Ao(t)||B&&this._terrainMovement))return void this._fireEvents(n,A,!0);l._stop(!0);let{panDelta:y,zoomDelta:C,bearingDelta:E,pitchDelta:I,rollDelta:b,around:F,pinchAround:T}=t;T!==void 0&&(F=T),F||(F=l.transform.centerPoint),B&&!g.isPointOnMapSurface(F)&&(F=g.centerPoint);let P={panDelta:y,zoomDelta:C,rollDelta:b,pitchDelta:I,bearingDelta:E,around:F};this._map.cameraHelper.useGlobeControls&&!g.isPointOnMapSurface(F)&&(F=g.centerPoint);let R=F.distSqr(g.centerPoint)<.01?g.center:g.screenPointToLocation(y?F.sub(y):F);this._handleMapControls({terrain:B,tr:g,deltasForHelper:P,preZoomAroundLoc:R,combinedEventsInProgress:n,panDelta:y}),l._applyUpdatedTransform(g),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,A,!0)}_handleMapControls({terrain:t,tr:n,deltasForHelper:A,preZoomAroundLoc:l,combinedEventsInProgress:g,panDelta:B}){let y=this._map.cameraHelper;if(y.handleMapControlsRollPitchBearingZoom(A,n),t)return y.useGlobeControls?(this._terrainMovement||!g.drag&&!g.zoom||(this._terrainMovement=!0,this._map._elevationFreeze=!0),void y.handleMapControlsPan(A,n,l)):this._terrainMovement||!g.drag&&!g.zoom?void(g.drag&&this._terrainMovement&&B?n.setCenter(n.screenPointToLocation(n.centerPoint.sub(B))):y.handleMapControlsPan(A,n,l)):(this._terrainMovement=!0,this._map._elevationFreeze=!0,void y.handleMapControlsPan(A,n,l));y.handleMapControlsPan(A,n,l)}_fireEvents(t,n,A){let l=Yr(this._eventsInProgress),g=Yr(t),B={};for(let b in t){let{originalEvent:F}=t[b];this._eventsInProgress[b]||(B[`${b}start`]=F),this._eventsInProgress[b]=t[b]}!l&&g&&this._fireEvent("movestart",g.originalEvent);for(let b in B)this._fireEvent(b,B[b]);g&&this._fireEvent("move",g.originalEvent);for(let b in t){let{originalEvent:F}=t[b];this._fireEvent(b,F)}let y={},C;for(let b in this._eventsInProgress){let{handlerName:F,originalEvent:T}=this._eventsInProgress[b];this._handlersById[F].isActive()||(delete this._eventsInProgress[b],C=n[F]||T,y[`${b}end`]=C)}for(let b in y)this._fireEvent(b,y[b]);let E=Yr(this._eventsInProgress),I=(l||g)&&!E;if(I&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let b=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&b.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(b)}if(A&&I){this._updatingCamera=!0;let b=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),F=T=>T!==0&&-this._bearingSnap<T&&T<this._bearingSnap;!b||!b.essential&&Je.prefersReducedMotion?(this._map.fire(new c.n("moveend",{originalEvent:C})),F(this._map.getBearing())&&this._map.resetNorth()):(F(b.bearing||this._map.getBearing())&&(b.bearing=0),b.freezeElevation=!0,this._map.easeTo(b,{originalEvent:C})),this._updatingCamera=!1}}_fireEvent(t,n){this._map.fire(new c.n(t,n?{originalEvent:n}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((t=>{delete this._frameId,this.handleEvent(new fc("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class mc extends c.E{constructor(t,n,A){super(),this._renderFrameCallback=()=>{let l=Math.min((Pe()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(l)),l<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=A.bearingSnap,this._zoomSnap=A.zoomSnap,this.cameraHelper=n,this.on("moveend",(()=>{delete this._requestedCameraState}))}migrateProjection(t,n){t.apply(this.transform,!0),this.transform=t,this.cameraHelper=n}getCenter(){return new c.W(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,n){return this.jumpTo({elevation:t},n),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,n,A){return t=c.P.convert(t).mult(-1),this.panTo(this.transform.center,c.e({offset:t},n),A)}panTo(t,n,A){return this.easeTo(c.e({center:t},n),A)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,A){return this.easeTo(c.e({zoom:t},n),A)}zoomIn(t,n){return this.zoomTo(c.cw(this.getZoom()+1,this._zoomSnap),t,n),this}zoomOut(t,n){return this.zoomTo(c.cw(this.getZoom()-1,this._zoomSnap),t,n),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,n){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new c.n("movestart",n)).fire(new c.n("move",n)).fire(new c.n("moveend",n))),this}getBearing(){return this.transform.bearing}setZoomSnap(t){return this._zoomSnap=t,this}getZoomSnap(){return this._zoomSnap}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,A){return this.easeTo(c.e({bearing:t},n),A)}resetNorth(t,n){return this.rotateTo(0,c.e({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(c.e({bearing:0,pitch:0,roll:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,n):this}getPitch(){return this.transform.pitch}setPitch(t,n){return this.jumpTo({pitch:t},n),this}getRoll(){return this.transform.roll}setRoll(t,n){return this.jumpTo({roll:t},n),this}cameraForBounds(t,n){t=Oe.convert(t).adjustAntiMeridian();let A=(n==null?void 0:n.bearing)||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),A,n)}_cameraForBoxAndBearing(t,n,A,l){let g={top:0,bottom:0,right:0,left:0};if(typeof(l=c.e({padding:g,offset:[0,0],maxZoom:this.transform.maxZoom},l)).padding=="number"){let I=l.padding;l.padding={top:I,bottom:I,right:I,left:I}}let B=c.e(g,l.padding);l.padding=B;let y=this.transform,C=new Oe(t,n),E=this.cameraHelper.cameraForBoxAndBearing(l,B,C,A,y);return E&&this._zoomSnap&&(E.zoom=c.cw(E.zoom,this._zoomSnap,-1)),E}fitBounds(t,n,A){return this._fitInternal(this.cameraForBounds(t,n),n,A)}fitScreenCoordinates(t,n,A,l,g){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(c.P.convert(t)),this.transform.screenPointToLocation(c.P.convert(n)),A,l),l,g)}_fitInternal(t,n,A){return t?(delete(n=c.e(t,n)).padding,n.linear?this.easeTo(n,A):this.flyTo(n,A)):this}jumpTo(t,n){this.stop(),"zoom"in t&&this._zoomSnap&&(t.zoom=c.cw(t.zoom,this._zoomSnap));let A=this._getTransformForUpdate(),l=!1,g=!1,B=!1,y=A.zoom;this.terrain&&A.setElevation(this.terrain.getElevationForLngLatZoom(t.center?c.W.convert(t.center):A.center,t.zoom||A.tileZoom)),this.cameraHelper.handleJumpToCenterZoom(A,t);let C=A.zoom!==y;return"elevation"in t&&A.elevation!==+t.elevation&&A.setElevation(+t.elevation),"bearing"in t&&A.bearing!==+t.bearing&&(l=!0,A.setBearing(+t.bearing)),"pitch"in t&&A.pitch!==+t.pitch&&(g=!0,A.setPitch(+t.pitch)),"roll"in t&&A.roll!==+t.roll&&(B=!0,A.setRoll(+t.roll)),t.padding==null||A.isPaddingEqual(t.padding)||A.setPadding(t.padding),this._applyUpdatedTransform(A),this.fire(new c.n("movestart",n)).fire(new c.n("move",n)),C&&this.fire(new c.n("zoomstart",n)).fire(new c.n("zoom",n)).fire(new c.n("zoomend",n)),l&&this.fire(new c.n("rotatestart",n)).fire(new c.n("rotate",n)).fire(new c.n("rotateend",n)),g&&this.fire(new c.n("pitchstart",n)).fire(new c.n("pitch",n)).fire(new c.n("pitchend",n)),B&&this.fire(new c.n("rollstart",n)).fire(new c.n("roll",n)).fire(new c.n("rollend",n)),this.fire(new c.n("moveend",n))}calculateCameraOptionsFromTo(t,n,A,l=0){let g=c.a7.fromLngLat(t,n),B=c.a7.fromLngLat(A,l),y=B.x-g.x,C=B.y-g.y,E=B.z-g.z,I=Math.hypot(y,C,E);if(I===0)throw new Error("Can't calculate camera options with same From and To");let b=Math.hypot(y,C),F=c.ar(this.transform.cameraToCenterDistance/I/this.transform.tileSize),T=180*Math.atan2(y,-C)/Math.PI,P=180*Math.acos(b/I)/Math.PI;return P=E<0?90-P:90+P,{center:B.toLngLat(),elevation:l,zoom:F,pitch:P,bearing:T}}calculateCameraOptionsFromCameraLngLatAltRotation(t,n,A,l,g){let B=this.transform.calculateCenterFromCameraLngLatAlt(t,n,A,l);return{center:B.center,elevation:B.elevation,zoom:B.zoom,bearing:A,pitch:l,roll:g}}easeTo(t,n){this._stop(!1,t.easeId),"zoom"in(t=c.e({offset:[0,0],duration:500,easing:c.cy},t))&&this._zoomSnap&&(t.zoom=c.cw(t.zoom,this._zoomSnap)),(t.animate===!1||!t.essential&&Je.prefersReducedMotion)&&(t.duration=0);let A=this._getTransformForUpdate(),l=this.getBearing(),g=A.pitch,B=A.roll,y="bearing"in t?this._normalizeBearing(t.bearing,l):l,C="pitch"in t?+t.pitch:g,E="roll"in t?this._normalizeBearing(t.roll,B):B,I="padding"in t?t.padding:A.padding,b=c.P.convert(t.offset),F,T;t.around&&(F=c.W.convert(t.around),T=A.locationToScreenPoint(F));let P={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},R=this.cameraHelper.handleEaseTo(A,{bearing:y,pitch:C,roll:E,padding:I,around:F,aroundPoint:T,offsetAsPoint:b,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating||(this._rotating=l!==y),this._pitching||(this._pitching=C!==g),this._rolling||(this._rolling=E!==B),this._padding=!A.isPaddingEqual(I),this._zooming||(this._zooming=R.isZooming),this._easeId=t.easeId,this._prepareEase(n,t.noMoveStart,P),this.terrain&&this._prepareElevation(R.elevationCenter),this._ease((Y=>{R.easeFunc(Y),this.terrain&&!t.freezeElevation&&this._updateElevation(Y),this._applyUpdatedTransform(A),this._fireMoveEvents(n)}),(Y=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(n,Y)}),t),this}_prepareEase(t,n,A={}){this._moving=!0,n||A.moving||this.fire(new c.n("movestart",t)),this._zooming&&!A.zooming&&this.fire(new c.n("zoomstart",t)),this._rotating&&!A.rotating&&this.fire(new c.n("rotatestart",t)),this._pitching&&!A.pitching&&this.fire(new c.n("pitchstart",t)),this._rolling&&!A.rolling&&this.fire(new c.n("rollstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this._elevationStart!==void 0&&this._elevationCenter!==void 0||this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&n!==this._elevationTarget){let A=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(A-(n-(A*t+this._elevationStart))/(1-t)),this._elevationTarget=n}this.transform.setElevation(c.H.number(this._elevationStart,this._elevationTarget,t))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){if(!this.terrain&&t.elevation>=0&&t.pitch<=90)return{};let n=t.getCameraLngLat(),A=t.getCameraAltitude(),l=this.terrain?this.terrain.getElevationForLngLatZoom(n,t.zoom):0;if(A<l){let g=this.calculateCameraOptionsFromTo(n,l,t.center,t.elevation);return{pitch:g.pitch,zoom:g.zoom}}return{}}_applyUpdatedTransform(t){let n=[];if(n.push((l=>this._elevateCameraIfInsideTerrain(l))),this.transformCameraUpdate&&n.push((l=>this.transformCameraUpdate(l))),!n.length)return;let A=t.clone();for(let l of n){let g=A.clone(),{center:B,zoom:y,roll:C,pitch:E,bearing:I,elevation:b}=l(g);B&&g.setCenter(B),b!==void 0&&g.setElevation(b),y!==void 0&&g.setZoom(y),C!==void 0&&g.setRoll(C),E!==void 0&&g.setPitch(E),I!==void 0&&g.setBearing(I),A.apply(g,!1)}this.transform.apply(A,!1)}_fireMoveEvents(t){this.fire(new c.n("move",t)),this._zooming&&this.fire(new c.n("zoom",t)),this._rotating&&this.fire(new c.n("rotate",t)),this._pitching&&this.fire(new c.n("pitch",t)),this._rolling&&this.fire(new c.n("roll",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;let A=this._zooming,l=this._rotating,g=this._pitching,B=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,A&&this.fire(new c.n("zoomend",t)),l&&this.fire(new c.n("rotateend",t)),g&&this.fire(new c.n("pitchend",t)),B&&this.fire(new c.n("rollend",t)),this.fire(new c.n("moveend",t))}flyTo(t,n){if(!t.essential&&Je.prefersReducedMotion){let me=c.V(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(me,n)}this.stop(),"zoom"in(t=c.e({offset:[0,0],speed:1.2,curve:1.42,easing:c.cy},t))&&this._zoomSnap&&(t.zoom=c.cw(t.zoom,this._zoomSnap));let A=this._getTransformForUpdate(),l=A.bearing,g=A.pitch,B=A.roll,y=A.padding,C="bearing"in t?this._normalizeBearing(t.bearing,l):l,E="pitch"in t?+t.pitch:g,I="roll"in t?this._normalizeBearing(t.roll,B):B,b="padding"in t?t.padding:A.padding,F=c.P.convert(t.offset),T=A.centerPoint.add(F),P=A.screenPointToLocation(T),R=this.cameraHelper.handleFlyTo(A,{bearing:C,pitch:E,roll:I,padding:b,locationAtOffset:P,offsetAsPoint:F,center:t.center,minZoom:t.minZoom,zoom:t.zoom}),Y=t.curve,N=Math.max(A.width,A.height),K=N/R.scaleOfZoom,H=R.pixelPathLength;typeof R.scaleOfMinZoom=="number"&&(Y=Math.sqrt(N/R.scaleOfMinZoom/H*2));let j=Y*Y;function z(me){let Fe=(K*K-N*N+(me?-1:1)*j*j*H*H)/(2*(me?K:N)*j*H);return Math.log(Math.sqrt(Fe*Fe+1)-Fe)}function Z(me){return(Math.exp(me)-Math.exp(-me))/2}function X(me){return(Math.exp(me)+Math.exp(-me))/2}let te=z(!1),Ae=function(me){return X(te)/X(te+Y*me)},ae=function(me){return N*((X(te)*(Z(Fe=te+Y*me)/X(Fe))-Z(te))/j)/H;var Fe},Be=(z(!0)-te)/Y;if(Math.abs(H)<2e-6||!isFinite(Be)){if(Math.abs(N-K)<1e-6)return this.easeTo(t,n);let me=K<N?-1:1;Be=Math.abs(Math.log(K/N))/Y,ae=()=>0,Ae=Fe=>Math.exp(me*Y*Fe)}return t.duration="duration"in t?+t.duration:1e3*Be/("screenSpeed"in t?+t.screenSpeed/Y:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=l!==C,this._pitching=E!==g,this._rolling=I!==B,this._padding=!A.isPaddingEqual(b),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(R.targetCenter),this._ease((me=>{let Fe=me*Be,Ie=1/Ae(Fe),ge=ae(Fe);this._rotating&&A.setBearing(c.H.number(l,C,me)),this._pitching&&A.setPitch(c.H.number(g,E,me)),this._rolling&&A.setRoll(c.H.number(B,I,me)),this._padding&&(A.interpolatePadding(y,b,me),T=A.centerPoint.add(F)),R.easeFunc(me,Ie,ge,T),this.terrain&&!t.freezeElevation&&this._updateElevation(me),this._applyUpdatedTransform(A),this._fireMoveEvents(n)}),(()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(n)}),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){var A;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let l=this._onEaseEnd;delete this._onEaseEnd,l.call(this,n)}return t||(A=this.handlers)===null||A===void 0||A.stop(!1),this}_ease(t,n,A){A.animate===!1||A.duration===0?(t(1),n()):(this._easeStart=Pe(),this._easeOptions=A,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,n){t=c.X(t,-180,180);let A=Math.abs(t-n);return Math.abs(t-360-n)<A&&(t-=360),Math.abs(t+360-n)<A&&(t+=360),t}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLat(c.W.convert(t),this.transform):null}}let tA={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Hi{constructor(t=tA){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=n=>{!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"&&n.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=de.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=de.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=de.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,n){let A=this._map._getUIString(`AttributionControl.${n}`);t.title=A,t.setAttribute("aria-label",A)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((l=>typeof l!="string"?"":l))):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let l=this._map.style.stylesheet;this.styleOwner=l.owner,this.styleId=l.id}let n=this._map.style.tileManagers;for(let l in n){let g=n[l];if(g.used||g.usedForTerrain){let B=g.getSource();B.attribution&&!t.includes(B.attribution)&&t.push(B.attribution)}}t=t.filter((l=>String(l).trim())),t.sort(((l,g)=>l.length-g.length)),t=t.filter(((l,g)=>{for(let B=g+1;B<t.length;B++)if(t[B].includes(l))return!1;return!0}));let A=t.join(" | ");A!==this._attribHTML&&(this._attribHTML=A,t.length?(this._innerContainer.innerHTML=de.sanitize(A),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class La{constructor(t={}){this._updateCompact=()=>{let n=this._container.children;if(n.length){let A=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&A.classList.add("maplibregl-compact"):A.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){var n;this._map=t,this._compact=(n=this.options)===null||n===void 0?void 0:n.compact,this._container=de.create("div","maplibregl-ctrl");let A=de.create("a","maplibregl-ctrl-logo");return A.target="_blank",A.rel="noopener nofollow",A.href="https://maplibre.org/",A.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),A.setAttribute("rel","noopener nofollow"),this._container.appendChild(A),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Uh{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){let n=this._currentlyRunning,A=n?this._queue.concat(n):this._queue;for(let l of A)if(l.id===t)return void(l.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let n=this._currentlyRunning=this._queue;this._queue=[];for(let A of n)if(!A.cancelled&&(A.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Lh=c.aS([{name:"a_pos3d",type:"Int16",components:3}]);class kh extends c.E{constructor(t){super(),this._lastTilesetChange=Pe(),this.tileManager=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=t._source.tileSize*2**this.deltaZoom,t.usedForTerrain=!0,t.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null}getSource(){return this.tileManager._source}update(t,n){this.tileManager.update(t,n),this._renderableTilesKeys=[];let A={};for(let l of sn(t,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n,calculateTileZoom:this.tileManager._source.calculateTileZoom}))A[l.key]=!0,this._renderableTilesKeys.push(l.key),this._tiles[l.key]||(l.terrainRttPosMatrix32f=new Float64Array(16),c.c7(l.terrainRttPosMatrix32f,0,c.a6,c.a6,0,0,1),this._tiles[l.key]=new kn(l,this.tileSize),this._lastTilesetChange=Pe());for(let l in this._tiles)A[l]||delete this._tiles[l]}freeRtt(t){for(let n in this._tiles){let A=this._tiles[n];(!t||A.tileID.equals(t)||A.tileID.isChildOf(t)||t.isChildOf(A.tileID))&&(A.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((t=>this.getTileByID(t)))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t,n){return n?this._getTerrainCoordsForTileRanges(t,n):this._getTerrainCoordsForRegularTile(t)}_getTerrainCoordsForRegularTile(t){let n={};for(let A of this._renderableTilesKeys){let l=this._tiles[A].tileID,g=t.clone(),B=c.bj();if(l.canonical.equals(t.canonical))c.c7(B,0,c.a6,c.a6,0,0,1);else if(l.canonical.isChildOf(t.canonical)){let y=l.canonical.z-t.canonical.z,C=l.canonical.x-(l.canonical.x>>y<<y),E=l.canonical.y-(l.canonical.y>>y<<y),I=c.a6>>y;c.c7(B,0,I,I,0,0,1),c.Q(B,B,[-C*I,-E*I,0])}else{if(!t.canonical.isChildOf(l.canonical))continue;{let y=t.canonical.z-l.canonical.z,C=t.canonical.x-(t.canonical.x>>y<<y),E=t.canonical.y-(t.canonical.y>>y<<y),I=c.a6>>y;c.c7(B,0,c.a6,c.a6,0,0,1),c.Q(B,B,[C*I,E*I,0]),c.S(B,B,[1/2**y,1/2**y,0])}}g.terrainRttPosMatrix32f=new Float32Array(B),n[A]=g}return n}_getTerrainCoordsForTileRanges(t,n){let A={};for(let l of this._renderableTilesKeys){let g=this._tiles[l].tileID;if(!this._isWithinTileRanges(g,n))continue;let B=t.clone(),y=c.bj();if(g.canonical.z===t.canonical.z){let C=t.canonical.x-g.canonical.x+t.wrap*(1<<t.canonical.z),E=t.canonical.y-g.canonical.y;c.c7(y,0,c.a6,c.a6,0,0,1),c.Q(y,y,[C*c.a6,E*c.a6,0])}else if(g.canonical.z>t.canonical.z){let C=g.canonical.z-t.canonical.z,E=g.canonical.x-(g.canonical.x>>C<<C)+t.wrap*(1<<g.canonical.z),I=g.canonical.y-(g.canonical.y>>C<<C),b=t.canonical.x-(g.canonical.x>>C),F=t.canonical.y-(g.canonical.y>>C),T=c.a6>>C;c.c7(y,0,T,T,0,0,1),c.Q(y,y,[-E*T+b*c.a6,-I*T+F*c.a6,0])}else{let C=t.canonical.z-g.canonical.z,E=t.canonical.x-(t.canonical.x>>C<<C)+t.wrap*(1<<t.canonical.z),I=t.canonical.y-(t.canonical.y>>C<<C),b=(t.canonical.x>>C)-g.canonical.x,F=(t.canonical.y>>C)-g.canonical.y,T=c.a6<<C;c.c7(y,0,T,T,0,0,1),c.Q(y,y,[E*c.a6+b*T,I*c.a6+F*T,0])}B.terrainRttPosMatrix32f=new Float32Array(y),A[l]=B}return A}getSourceTile(t,n){var A,l;let g=this.tileManager._source,B=t.overscaledZ-this.deltaZoom;if(B>g.maxzoom&&(B=g.maxzoom),B<g.minzoom)return;(A=this._sourceTileCache)[l=t.key]||(A[l]=t.scaledTo(B).key);let y=this.findTileInCaches(this._sourceTileCache[t.key]);if(!(y!=null&&y.dem)&&n)for(;B>=g.minzoom&&!(y!=null&&y.dem);)y=this.findTileInCaches(t.scaledTo(B--).key);return y}findTileInCaches(t){let n=this.tileManager.getTileByID(t);return n||(n=this.tileManager._outOfViewCache.getByKey(t),n)}anyTilesAfterTime(t=Date.now()){return this._lastTilesetChange>=t}_isWithinTileRanges(t,n){let A=n[t.canonical.z];return!!A&&(t.wrap>A.minWrap||t.wrap<A.maxWrap||t.canonical.x>=A.minTileXWrapped&&t.canonical.x<=A.maxTileXWrapped&&t.canonical.y>=A.minTileY&&t.canonical.y<=A.maxTileY)}}class rs{constructor(t,n,A){this._meshCache={},this.painter=t,this.tileManager=new kh(n),this.options=A,this.exaggeration=typeof A.exaggeration=="number"?A.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}destroy(){this._fbo&&(this._fbo.destroy(),this._fbo=null),this._fboCoordsTexture&&(this._fboCoordsTexture.destroy(),this._fboCoordsTexture=null),this._fboDepthTexture&&(this._fboDepthTexture.destroy(),this._fboDepthTexture=null),this._emptyDemTexture&&(this._emptyDemTexture.destroy(),this._emptyDemTexture=null),this._emptyDepthTexture&&(this._emptyDepthTexture.destroy(),this._emptyDepthTexture=null),this._coordsTexture&&(this._coordsTexture.destroy(),this._coordsTexture=null);for(let t in this._meshCache)this._meshCache[t].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(t,n,A,l=c.a6){var g;let B=t.normalizeCoordinates(n,A,l);if(!B)return 0;let y=this.getTerrainData(B.tileID),C=(g=y.tile)===null||g===void 0?void 0:g.dem;if(!C)return 0;let E=c.cC([],[B.x/l*c.a6,B.y/l*c.a6],y.u_terrain_matrix),I=[E[0]*C.dim,E[1]*C.dim],b=Math.floor(I[0]),F=Math.floor(I[1]),T=I[0]-b,P=I[1]-F;return C.get(b,F)*(1-T)*(1-P)+C.get(b+1,F)*T*(1-P)+C.get(b,F+1)*(1-T)*P+C.get(b+1,F+1)*T*P}getElevationForLngLatZoom(t,n){if(!c.cD(n,t.wrap()))return 0;let{tileID:A,mercatorX:l,mercatorY:g}=this._getOverscaledTileIDFromLngLatZoom(t,n);return this.getElevation(A,l%c.a6,g%c.a6,c.a6)}getElevationForLngLat(t,n){let A=sn(n,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this}),l=0;for(let g of A)g.canonical.z>l&&(l=Math.min(g.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(t,l)}getElevation(t,n,A,l=c.a6){return this.getDEMElevation(t,n,A,l)*this.exaggeration}getTerrainData(t){var n,A;if(!this._emptyDemTexture){let B=this.painter.context,y=new c.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new c.T(B,y,B.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new c.T(B,new c.R({width:1,height:1}),B.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(B.gl.NEAREST,B.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=c.ap([])}let l=this.tileManager.getSourceTile(t,!0);if(l!=null&&l.dem&&(!l.demTexture||l.needsTerrainPrepare)){let B=this.painter.context;l.demTexture=this.painter.getTileTexture(l.dem.stride),l.demTexture?l.demTexture.update(l.dem.getPixels(),{premultiply:!1}):l.demTexture=new c.T(B,l.dem.getPixels(),B.gl.RGBA,{premultiply:!1}),l.demTexture.bind(B.gl.NEAREST,B.gl.CLAMP_TO_EDGE),l.needsTerrainPrepare=!1}let g=l&&l.toString()+l.tileID.key+t.key;if(g&&!this._demMatrixCache[g]){let B=this.tileManager.getSource().maxzoom,y=t.canonical.z-l.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=B?y=t.canonical.z-B:c.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let C=t.canonical.x-(t.canonical.x>>y<<y),E=t.canonical.y-(t.canonical.y>>y<<y),I=c.cE(new Float64Array(16),[1/(c.a6<<y),1/(c.a6<<y),0]);c.Q(I,I,[C*c.a6,E*c.a6,0]),this._demMatrixCache[g]={matrix:I,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:((n=l==null?void 0:l.dem)===null||n===void 0?void 0:n.dim)||1,u_terrain_matrix:g?this._demMatrixCache[g].matrix:this._emptyDemMatrix,u_terrain_unpack:((A=l==null?void 0:l.dem)===null||A===void 0?void 0:A.getUnpackVector())||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:((l==null?void 0:l.demTexture)||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:l}}getFramebuffer(t){let n=this.painter,A=n.width/devicePixelRatio,l=n.height/devicePixelRatio;return!this._fbo||this._fbo.width===A&&this._fbo.height===l||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new c.T(n.context,{width:A,height:l,data:null},n.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(n.context.gl.NEAREST,n.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new c.T(n.context,{width:A,height:l,data:null},n.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(n.context.gl.NEAREST,n.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=n.context.createFramebuffer(A,l,!0,!1),this._fbo.depthAttachment.set(n.context.createRenderbuffer(n.context.gl.DEPTH_COMPONENT16,A,l))),this._fbo.colorAttachment.set(t==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let n=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let g=0,B=0;g<this._coordsTextureSize;g++)for(let y=0;y<this._coordsTextureSize;y++,B+=4)n[B+0]=255&y,n[B+1]=255&g,n[B+2]=y>>8<<4|g>>8,n[B+3]=0;let A=new c.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),l=new c.T(t,A,t.gl.RGBA,{premultiply:!1});return l.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=l,l}pointCoordinate(t){this.painter.maybeDrawDepth(!0),this.painter.maybeDrawCoords();let n=new Uint8Array(4),A=this.painter.context,l=A.gl,g=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),B=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),y=Math.round(this.painter.height/devicePixelRatio);A.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),l.readPixels(g,y-B-1,1,1,l.RGBA,l.UNSIGNED_BYTE,n),A.bindFramebuffer.set(null);let C=n[0]+(n[2]>>4<<8),E=n[1]+((15&n[2])<<8),I=this.coordsIndex[255-n[3]],b=I&&this.tileManager.getTileByID(I);if(!b)return null;let F=this._coordsTextureSize,T=(1<<b.tileID.canonical.z)*F;return new c.a7((b.tileID.canonical.x*F+C)/T+b.tileID.wrap,(b.tileID.canonical.y*F+E)/T,this.getElevation(b.tileID,C,E,F))}depthAtPoint(t){let n=new Uint8Array(4),A=this.painter.context,l=A.gl;return A.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),l.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,n),A.bindFramebuffer.set(null),(n[0]/16777216+n[1]/65536+n[2]/256+n[3])/256}getTerrainMesh(t){var n;let A=((n=this.painter.style.projection)===null||n===void 0?void 0:n.transitionState)>0,l=A&&t.canonical.y===0,g=A&&t.canonical.y===(1<<t.canonical.z)-1,B=`m_${l?"n":""}_${g?"s":""}`;if(this._meshCache[B])return this._meshCache[B];let y=this.painter.context,C=new c.cF,E=new c.aW,I=this.meshSize,b=c.a6/I,F=I*I;for(let X=0;X<=I;X++)for(let te=0;te<=I;te++)C.emplaceBack(te*b,X*b,0);for(let X=0;X<F;X+=I+1)for(let te=0;te<I;te++)E.emplaceBack(te+X,I+te+X+1,I+te+X+2),E.emplaceBack(te+X,I+te+X+2,te+X+1);let T=C.length,P=T+(I+1),R=(I+1)*I,Y=l?c.bq:0,N=l?0:1,K=g?c.br:c.a6,H=g?0:1;for(let X=0;X<=I;X++)C.emplaceBack(X*b,Y,N);for(let X=0;X<=I;X++)C.emplaceBack(X*b,K,H);for(let X=0;X<I;X++)E.emplaceBack(R+X,P+X,P+X+1),E.emplaceBack(R+X,P+X+1,R+X+1),E.emplaceBack(0+X,T+X+1,T+X),E.emplaceBack(0+X,0+X+1,T+X+1);let j=C.length,z=j+2*(I+1);for(let X of[0,1])for(let te=0;te<=I;te++)for(let Ae of[0,1])C.emplaceBack(X*c.a6,te*b,Ae);for(let X=0;X<2*I;X+=2)E.emplaceBack(j+X,j+X+1,j+X+3),E.emplaceBack(j+X,j+X+3,j+X+2),E.emplaceBack(z+X,z+X+3,z+X+1),E.emplaceBack(z+X,z+X+2,z+X+3);let Z=new ft(y.createVertexBuffer(C,Lh.members),y.createIndexBuffer(E),c.aV.simpleSegment(0,0,C.length,E.length));return this._meshCache[B]=Z,Z}getMeshFrameDelta(t){return 2*Math.PI*c.bD/Math.pow(2,Math.max(t,0))/5}getMinTileElevationForLngLatZoom(t,n){var A;if(!c.cD(n,t.wrap()))return 0;let{tileID:l}=this._getOverscaledTileIDFromLngLatZoom(t,n);return(A=this.getMinMaxElevation(l).minElevation)!==null&&A!==void 0?A:0}getMinMaxElevation(t){let n=this.getTerrainData(t).tile,A={minElevation:null,maxElevation:null};return n!=null&&n.dem&&(A.minElevation=n.dem.min*this.exaggeration,A.maxElevation=n.dem.max*this.exaggeration),A}_getOverscaledTileIDFromLngLatZoom(t,n){let A=c.a7.fromLngLat(t.wrap()),l=(1<<n)*c.a6,g=A.x*l,B=A.y*l,y=Math.floor(g/c.a6),C=Math.floor(B/c.a6);return{tileID:new c.a3(n,0,n,y,C),mercatorX:g,mercatorY:B}}}class It{constructor(t,n,A){this._context=t,this._size=n,this._tileSize=A,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){let n=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),A=new c.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return A.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),n.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),n.colorAttachment.set(A.texture),{id:t,fbo:n,texture:A,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((n=>t.id!==n)),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(let n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(let t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&this._objects.some((t=>!t.inUse))===!1}}let _t={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class Bc{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new It(t.context,30,n.tileManager.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,n){var A,l,g;this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter((B=>!t._layers[B].isHidden(n))),this._coordsAscending={};for(let B in t.tileManagers){this._coordsAscending[B]={};let y=t.tileManagers[B].getVisibleCoordinates(),C=t.tileManagers[B].getSource(),E=C instanceof Lr?C.terrainTileRanges:null;for(let I of y){let b=this.terrain.tileManager.getTerrainCoords(I,E);for(let F in b)(g=this._coordsAscending[B])[F]||(g[F]=[]),this._coordsAscending[B][F].push(b[F])}}this._rttFingerprints={};for(let B of t._order){let y=t._layers[B],C=y.source;if(_t[y.type]&&!this._rttFingerprints[C]){this._rttFingerprints[C]={};let E=(l=(A=t.tileManagers[C])===null||A===void 0?void 0:A.getState().revision)!==null&&l!==void 0?l:0;for(let I in this._coordsAscending[C])this._rttFingerprints[C][I]=`${this._coordsAscending[C][I].map((b=>b.key)).sort().join()}#${E}`}}for(let B of this._renderableTiles)for(let y in this._rttFingerprints){let C=this._rttFingerprints[y][B.tileID.key];C&&C!==B.rttFingerprint[y]&&(B.rtt=[])}}renderLayer(t,n){if(t.isHidden(this.painter.transform.zoom))return!1;let A=Object.assign(Object.assign({},n),{isRenderingToTexture:!0}),l=t.type,g=this.painter,B=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(_t[l]&&(this._prevType&&_t[this._prevType]||this._stacks.push([]),this._prevType=l,this._stacks[this._stacks.length-1].push(t.id),!B))return!0;if(_t[this._prevType]||_t[l]&&B){this._prevType=l;let y=this._stacks.length-1,C=this._stacks[y]||[];for(let E of this._renderableTiles){if(this.pool.isFull()&&(wa(this.painter,this.terrain,this._rttTiles,A),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(E),E.rtt[y]){let b=this.pool.getObjectForId(E.rtt[y].id);if(b.stamp===E.rtt[y].stamp){this.pool.useObject(b);continue}}let I=this.pool.getOrCreateFreeObject();this.pool.useObject(I),this.pool.stampObject(I),E.rtt[y]={id:I.id,stamp:I.stamp},g.context.bindFramebuffer.set(I.fbo.framebuffer),g.context.clear({color:c.bo.transparent,stencil:0}),g.currentStencilSource=void 0;for(let b of C){let F=g.style._layers[b],T=F.source?this._coordsAscending[F.source][E.tileID.key]:[E.tileID];g.context.viewport.set([0,0,I.fbo.width,I.fbo.height]),g._renderTileClippingMasks(F,T,!0),g.renderLayer(g,g.style.tileManagers[F.source],F,T,A),F.source&&(E.rttFingerprint[F.source]=this._rttFingerprints[F.source][E.tileID.key])}}return wa(this.painter,this.terrain,this._rttTiles,A),this._rttTiles=[],this.pool.freeAllObjects(),_t[l]}return!1}}let ns={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Drag to rotate map, click to reset north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},iA=se,rA={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:tA,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:c.c.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,experimentalZoomLevelsToOverscale:void 0,anisotropicFilterPitch:20},nA=class extends mc{get _ownerWindow(){var d,t;return((t=(d=this._container)===null||d===void 0?void 0:d.ownerDocument)===null||t===void 0?void 0:t.defaultView)||window}constructor(d){var t,n,A;let l=Object.assign(Object.assign(Object.assign({},rA),d),{canvasContextAttributes:Object.assign(Object.assign({},rA.canvasContextAttributes),d.canvasContextAttributes)});if(l.minZoom!=null&&l.maxZoom!=null&&l.minZoom>l.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(l.minPitch!=null&&l.maxPitch!=null&&l.minPitch>l.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(l.minPitch!=null&&l.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(l.maxPitch!=null&&l.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");let g=new hn,B=new un;l.minZoom!==void 0&&g.setMinZoom(l.minZoom),l.maxZoom!==void 0&&g.setMaxZoom(l.maxZoom),l.minPitch!==void 0&&g.setMinPitch(l.minPitch),l.maxPitch!==void 0&&g.setMaxPitch(l.maxPitch),l.renderWorldCopies!==void 0&&g.setRenderWorldCopies(l.renderWorldCopies),l.transformConstrain!==null&&g.setConstrainOverride(l.transformConstrain),super(g,B,{bearingSnap:l.bearingSnap,zoomSnap:l.zoomSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Uh,this._controls=[],this._mapId=c.ad(),this._lostContextStyle={style:null,images:null},this._contextLost=C=>{if(C.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),this.style){for(let E of Object.values(this.style._layers))if(E.type==="custom"&&console.warn(`Custom layer with id '${E.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),E._listeners)for(let[I]of Object.entries(E._listeners))console.warn(`Custom layer with id '${E.id}' had event listeners for event '${I}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new c.n("webglcontextlost",{originalEvent:C}))}else this.fire(new c.n("webglcontextlost",{originalEvent:C}))},this._contextRestored=C=>{this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style&&(this.style.imageManager.images=this._lostContextStyle.images),this._lostContextStyle={style:null,images:null},this._setupPainter(),this.resize(),this._update(),this._resizeInternal(),this.fire(new c.n("webglcontextrestored",{originalEvent:C}))},this._onMapScroll=C=>{if(C.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=l.interactive,this._maxTileCacheSize=l.maxTileCacheSize,this._maxTileCacheZoomLevels=l.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},l.canvasContextAttributes),this._trackResize=l.trackResize===!0,this._bearingSnap=l.bearingSnap,this._zoomSnap=l.zoomSnap,this._centerClampedToGround=l.centerClampedToGround,this._refreshExpiredTiles=l.refreshExpiredTiles===!0,this._fadeDuration=l.fadeDuration,this._crossSourceCollisions=l.crossSourceCollisions===!0,this._collectResourceTiming=l.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},ns),l.locale),this._clickTolerance=l.clickTolerance,this._overridePixelRatio=l.pixelRatio,this._maxCanvasSize=l.maxCanvasSize,this._zoomLevelsToOverscale=l.experimentalZoomLevelsToOverscale,this.transformCameraUpdate=l.transformCameraUpdate,this.transformConstrain=l.transformConstrain,this.cancelPendingTileRequestsWhileZooming=l.cancelPendingTileRequestsWhileZooming===!0,this.setAnisotropicFilterPitch(l.anisotropicFilterPitch),l.reduceMotion!==void 0&&(Je.prefersReducedMotion=l.reduceMotion),this._imageQueueHandle=qe.addThrottleControl((()=>this.isMoving())),this._requestManager=new dt(l.transformRequest),this._container=this._resolveContainer(l.container),l.maxBounds&&this.setMaxBounds(l.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),this.on("terrain",(()=>{this.painter.terrainFacilitator.depthDirty=!0,this._update(!0)})),this.once("idle",(()=>this._idleTriggered=!0)),typeof window!="undefined"&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver()),this.handlers=new _i(this,l),this._hash=l.hash?new Jo(typeof l.hash=="string"&&l.hash||void 0).addTo(this):void 0,!((t=this._hash)===null||t===void 0)&&t._onHashChange()||(this.jumpTo({center:l.center,elevation:l.elevation,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch,roll:l.roll}),l.bounds&&(this.resize(),this.fitBounds(l.bounds,c.e({},l.fitBoundsOptions,{duration:0}))));let y=typeof l.style=="string"||((A=(n=l.style)===null||n===void 0?void 0:n.projection)===null||A===void 0?void 0:A.type)!=="globe";this.resize(null,y),this._localIdeographFontFamily=l.localIdeographFontFamily,this._validateStyle=l.validateStyle,l.style&&this.setStyle(l.style,{localIdeographFontFamily:l.localIdeographFontFamily}),l.attributionControl&&this.addControl(new Hi(typeof l.attributionControl=="boolean"?void 0:l.attributionControl)),l.maplibreLogo&&this.addControl(new La,l.logoPosition),this.on("style.load",(()=>{if(y||this._resizeTransform(),this.transform.unmodified){let C=c.V(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(C)}})),this.on("data",(C=>{this._update(C.dataType==="style"),this.fire(new c.n(`${C.dataType}data`,C))})),this.on("dataloading",(C=>{this.fire(new c.n(`${C.dataType}dataloading`,C))})),this.on("dataabort",(C=>{this.fire(new c.n("sourcedataabort",C))}))}_getMapId(){return this._mapId}setGlobalStateProperty(d,t){return this.style.setGlobalStateProperty(d,t),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(d,t){if(t===void 0&&(t=d.getDefaultPosition?d.getDefaultPosition():"top-right"),!(d!=null&&d.onAdd))return this.fire(new c.l(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let n=d.onAdd(this);this._controls.push(d);let A=this._controlPositions[t];return t.includes("bottom")?A.insertBefore(n,A.firstChild):A.appendChild(n),this}removeControl(d){if(!(d!=null&&d.onRemove))return this.fire(new c.l(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let t=this._controls.indexOf(d);return t>-1&&this._controls.splice(t,1),d.onRemove(this),this}hasControl(d){return this._controls.includes(d)}coveringTiles(d){return sn(this.transform,d)}calculateCameraOptionsFromTo(d,t,n,A){return A==null&&this.terrain&&(A=this.terrain.getElevationForLngLat(n,this.transform)),super.calculateCameraOptionsFromTo(d,t,n,A)}resize(d,t=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(t);let n=!this._moving;return n&&(this.stop(),this.fire(new c.n("movestart",d)).fire(new c.n("move",d))),this.fire(new c.n("resize",d)),n&&this.fire(new c.n("moveend",d)),this}_resizeInternal(d=!0){let[t,n]=this._containerDimensions(),A=this._getClampedPixelRatio(t,n);if(this._resizeCanvas(t,n,A),this.painter.resize(t,n,A),this.painter.overLimit()){let l=this.painter.context.gl;this._maxCanvasSize=[l.drawingBufferWidth,l.drawingBufferHeight];let g=this._getClampedPixelRatio(t,n);this._resizeCanvas(t,n,g),this.painter.resize(t,n,g)}this._resizeTransform(d)}_resizeTransform(d=!0){var t;let[n,A]=this._containerDimensions();this.transform.resize(n,A,d),(t=this._requestedCameraState)===null||t===void 0||t.resize(n,A,d)}_getClampedPixelRatio(d,t){let{0:n,1:A}=this._maxCanvasSize,l=this.getPixelRatio(),g=d*l,B=t*l;return Math.min(g>n?n/g:1,B>A?A/B:1)*l}getPixelRatio(){var d;return(d=this._overridePixelRatio)!==null&&d!==void 0?d:devicePixelRatio}setPixelRatio(d){this._overridePixelRatio=d,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(d){return this.transform.setMaxBounds(Oe.convert(d)),this._update()}setMinZoom(d){if((d=d==null?-2:d)>=-2&&d<=this.transform.maxZoom){let t=this.transform.zoom,n=this._getTransformForUpdate();return n.setMinZoom(d),this._applyUpdatedTransform(n),this._update(),t!==this.transform.zoom&&this.fire(new c.n("zoomstart")).fire(new c.n("zoom")).fire(new c.n("zoomend")).fire(new c.n("movestart")).fire(new c.n("move")).fire(new c.n("moveend")),this}throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(d){if((d=d==null?22:d)>=this.transform.minZoom){let t=this.transform.zoom,n=this._getTransformForUpdate();return n.setMaxZoom(d),this._applyUpdatedTransform(n),this._update(),t!==this.transform.zoom&&this.fire(new c.n("zoomstart")).fire(new c.n("zoom")).fire(new c.n("zoomend")).fire(new c.n("movestart")).fire(new c.n("move")).fire(new c.n("moveend")),this}throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(d){if((d=d==null?0:d)<0)throw new Error("minPitch must be greater than or equal to 0");if(d>=0&&d<=this.transform.maxPitch){let t=this.transform.pitch,n=this._getTransformForUpdate();return n.setMinPitch(d),this._applyUpdatedTransform(n),this._update(),t!==this.transform.pitch&&this.fire(new c.n("pitchstart")).fire(new c.n("pitch")).fire(new c.n("pitchend")).fire(new c.n("movestart")).fire(new c.n("move")).fire(new c.n("moveend")),this}throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(d){if((d=d==null?60:d)>180)throw new Error("maxPitch must be less than or equal to 180");if(d>=this.transform.minPitch){let t=this.transform.pitch,n=this._getTransformForUpdate();return n.setMaxPitch(d),this._applyUpdatedTransform(n),this._update(),t!==this.transform.pitch&&this.fire(new c.n("pitchstart")).fire(new c.n("pitch")).fire(new c.n("pitchend")).fire(new c.n("movestart")).fire(new c.n("move")).fire(new c.n("moveend")),this}throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(d){if((d=d==null?20:d)>180)throw new Error("anisotropicFilterPitch must be less than or equal to 180");if(d<0)throw new Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=d,this._update()}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(d){return this.transform.setRenderWorldCopies(d),this._update()}setTransformConstrain(d){return this.transform.setConstrainOverride(d),this._update()}project(d){return this.transform.locationToScreenPoint(c.W.convert(d),this.style&&this.terrain)}unproject(d){return this.transform.screenPointToLocation(c.P.convert(d),this.terrain)}isMoving(){var d;return this._moving||((d=this.handlers)===null||d===void 0?void 0:d.isMoving())}isZooming(){var d;return this._zooming||((d=this.handlers)===null||d===void 0?void 0:d.isZooming())}isRotating(){var d;return this._rotating||((d=this.handlers)===null||d===void 0?void 0:d.isRotating())}_createDelegatedListener(d,t,n){if(d==="mouseenter"||d==="mouseover"){let A=!1;return{layers:t,listener:n,delegates:{mousemove:g=>{let B=t.filter((C=>this.getLayer(C))),y=B.length!==0?this.queryRenderedFeatures(g.point,{layers:B}):[];y.length?A||(A=!0,n.call(this,new Ri(d,this,g.originalEvent,{features:y}))):A=!1},mouseout:()=>{A=!1}}}}if(d==="mouseleave"||d==="mouseout"){let A=!1;return{layers:t,listener:n,delegates:{mousemove:B=>{let y=t.filter((C=>this.getLayer(C)));(y.length!==0?this.queryRenderedFeatures(B.point,{layers:y}):[]).length?A=!0:A&&(A=!1,n.call(this,new Ri(d,this,B.originalEvent)))},mouseout:B=>{A&&(A=!1,n.call(this,new Ri(d,this,B.originalEvent)))}}}}{let A=l=>{let g=t.filter((y=>this.getLayer(y))),B=g.length!==0?this.queryRenderedFeatures(l.point,{layers:g}):[];B.length&&(l.features=B,n.call(this,l),delete l.features)};return{layers:t,listener:n,delegates:{[d]:A}}}}_saveDelegatedListener(d,t){var n;this._delegatedListeners||(this._delegatedListeners={}),(n=this._delegatedListeners)[d]||(n[d]=[]),this._delegatedListeners[d].push(t)}_removeDelegatedListener(d,t,n){var A;if(!(!((A=this._delegatedListeners)===null||A===void 0)&&A[d]))return;let l=this._delegatedListeners[d];for(let g=0;g<l.length;g++){let B=l[g];if(B.listener===n&&B.layers.length===t.length&&B.layers.every((y=>t.includes(y)))){for(let y in B.delegates)this.off(y,B.delegates[y]);return void l.splice(g,1)}}}on(d,t,n){if(n===void 0)return super.on(d,t);let A=typeof t=="string"?[t]:t,l=this._createDelegatedListener(d,A,n);this._saveDelegatedListener(d,l);for(let g in l.delegates)this.on(g,l.delegates[g]);return{unsubscribe:()=>{this._removeDelegatedListener(d,A,n)}}}once(d,t,n){if(n===void 0)return super.once(d,t);let A=typeof t=="string"?[t]:t,l=this._createDelegatedListener(d,A,n);for(let g in l.delegates){let B=l.delegates[g];l.delegates[g]=(...y)=>{this._removeDelegatedListener(d,A,n),B(...y)}}this._saveDelegatedListener(d,l);for(let g in l.delegates)this.once(g,l.delegates[g]);return this}off(d,t,n){return n===void 0?super.off(d,t):(this._removeDelegatedListener(d,typeof t=="string"?[t]:t,n),this)}queryRenderedFeatures(d,t){if(!this.style)return[];let n,A=d instanceof c.P||Array.isArray(d),l=A?d:[[0,0],[this.transform.width,this.transform.height]];if(t||(t=(A?{}:d)||{}),l instanceof c.P||typeof l[0]=="number")n=[c.P.convert(l)];else{let g=c.P.convert(l[0]),B=c.P.convert(l[1]);n=[g,new c.P(B.x,g.y),B,new c.P(g.x,B.y),g]}return this.style.queryRenderedFeatures(n,t,this.transform)}querySourceFeatures(d,t){return this.style.querySourceFeatures(d,t)}setStyle(d,t){return(t=c.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},t)).diff!==!1&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&d?(this._diffStyle(d,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(d,t))}setTransformRequest(d){return this._requestManager.setTransformRequest(d),this}_getUIString(d){let t=this._locale[d];if(t==null)throw new Error(`Missing UI string '${d}'`);return t}_updateStyle(d,t){var n,A,l;if((n=this._diffStyleRequest)===null||n===void 0||n.abort(),this._diffStyleRequest=null,t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(d,t)));let g=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!d)),d?(this.style=new fn(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof d=="string"?this.style.loadURL(d,t,g):this.style.loadJSON(d,t,g),this):(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),(l=(A=this.style)===null||A===void 0?void 0:A.projection)===null||l===void 0||l.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new fn(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(d,t){return c._(this,void 0,void 0,(function*(){var n;if((n=this._diffStyleRequest)===null||n===void 0||n.abort(),typeof d=="string"){let A=d;this._diffStyleRequest=new AbortController;let l=this._diffStyleRequest;try{let g=yield this._requestManager.transformRequest(A,"Style");if(l.signal.aborted)return void(this._diffStyleRequest=null);let B=yield c.k(g,l);this._diffStyleRequest=null,this._updateDiff(B.data,t)}catch(g){this._diffStyleRequest=null,c.$(g)||this.fire(new c.l(c.d(g)))}}else typeof d=="object"&&(this._diffStyleRequest=null,this._updateDiff(d,t))}))}_updateDiff(d,t){try{this.style.setState(d,t)&&this._update(!0)}catch(n){c.w(`Unable to perform style diff: ${c.d(n).message}. Rebuilding the style from scratch.`),this._updateStyle(d,t)}}getStyle(){if(this.style)return this.style.serialize()}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){if(this.style)return this.style.loaded();c.w("There is no style added to the map.")}addSource(d,t){return this._lazyInitEmptyStyle(),this.style.addSource(d,t),this._update(!0)}isSourceLoaded(d){var t;let n=(t=this.style)===null||t===void 0?void 0:t.tileManagers[d];if(n!==void 0)return n.loaded();this.fire(new c.l(new Error(`There is no tile manager with ID '${d}'`)))}setTerrain(d){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),d){let t=this.style.tileManagers[d.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${d.source}`);this.terrain===null&&t.reload();for(let n in this.style._layers){let A=this.style._layers[n];A.type==="hillshade"&&A.source===d.source&&c.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),A.type==="color-relief"&&A.source===d.source&&c.w("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new rs(this.painter,t,d),this.painter.renderToTexture=new Bc(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=n=>{var A;n.dataType==="style"?this.terrain.tileManager.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId!==d.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),((A=n.source)===null||A===void 0?void 0:A.type)==="image"?this.terrain.tileManager.freeRtt():this.terrain.tileManager.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0);return this.fire(new c.n("terrain",{terrain:d})),this}getTerrain(){var d,t;return(t=(d=this.terrain)===null||d===void 0?void 0:d.options)!==null&&t!==void 0?t:null}areTilesLoaded(){var d;let t=(d=this.style)===null||d===void 0?void 0:d.tileManagers;for(let n of Object.values(t))if(!n.areTilesLoaded())return!1;return!0}removeSource(d){return this.style.removeSource(d),this._update(!0)}getSource(d){return this.style.getSource(d)}setSourceTileLodParams(d,t,n){if(n){let A=this.getSource(n);if(!A)throw new Error(`There is no source with ID "${n}", cannot set LOD parameters`);A.calculateTileZoom=KA(Math.max(1,d),Math.max(1,t))}else for(let A in this.style.tileManagers)this.style.tileManagers[A].getSource().calculateTileZoom=KA(Math.max(1,d),Math.max(1,t));return this._update(!0),this}refreshTiles(d,t){let n=this.style.tileManagers[d];if(!n)throw new Error(`There is no tile manager with ID "${d}", cannot refresh tile`);t===void 0?n.reload(!0):n.refreshTiles(t.map((A=>new c.aa(A.z,A.x,A.y))))}addImage(d,t,n={}){let{pixelRatio:A=1,sdf:l=!1,stretchX:g,stretchY:B,content:y,textFitWidth:C,textFitHeight:E}=n;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||c.b(t))){if(t.width===void 0||t.height===void 0)return this.fire(new c.l(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:I,height:b,data:F}=t,T=t;return this.style.addImage(d,{data:new c.R({width:I,height:b},new Uint8Array(F)),pixelRatio:A,stretchX:g,stretchY:B,content:y,textFitWidth:C,textFitHeight:E,sdf:l,version:0,userImage:T}),T.onAdd&&T.onAdd(this,d),this}}{let{width:I,height:b,data:F}=Je.getImageData(t);this.style.addImage(d,{data:new c.R({width:I,height:b},F),pixelRatio:A,stretchX:g,stretchY:B,content:y,textFitWidth:C,textFitHeight:E,sdf:l,version:0})}}updateImage(d,t){let n=this.style.getImage(d);if(!n)return this.fire(new c.l(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let A=t instanceof HTMLImageElement||c.b(t)?Je.getImageData(t):t,{width:l,height:g,data:B}=A;if(l===void 0||g===void 0)return this.fire(new c.l(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(l!==n.data.width||g!==n.data.height)return this.fire(new c.l(new Error("The width and height of the updated image must be that same as the previous version of the image")));let y=!(t instanceof HTMLImageElement||c.b(t));return n.data.replace(B,y),this.style.updateImage(d,n),this}getImage(d){return this.style.getImage(d)}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new c.l(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d){return c._(this,void 0,void 0,(function*(){return qe.getImage(yield this._requestManager.transformRequest(d,"Image"),new AbortController)}))}listImages(){return this.style.listImages()}addLayer(d,t){return this._lazyInitEmptyStyle(),this.style.addLayer(d,t),this._update(!0)}moveLayer(d,t){return this.style.moveLayer(d,t),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(d,t,n){return this.style.setLayerZoomRange(d,t,n),this._update(!0)}setFilter(d,t,n={}){return this.style.setFilter(d,t,n),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,t,n,A={}){return this.style.setPaintProperty(d,t,n,A),this._update(!0)}getPaintProperty(d,t){return this.style.getPaintProperty(d,t)}setLayoutProperty(d,t,n,A={}){return this.style.setLayoutProperty(d,t,n,A),this._update(!0)}getLayoutProperty(d,t){return this.style.getLayoutProperty(d,t)}setGlyphs(d,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(d,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(d,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(d,t,n,(A=>{A||this._update(!0)})),this}removeSprite(d){return this._lazyInitEmptyStyle(),this.style.removeSprite(d),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(d,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(d,t,(n=>{n||this._update(!0)})),this}setLight(d,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(d,t={}){return this._lazyInitEmptyStyle(),this.style.setSky(d,t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(d,t){return this.style.setFeatureState(d,t),this._update()}removeFeatureState(d,t){return this.style.removeFeatureState(d,t),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let d=0,t=0;return this._container&&(d=this._container.clientWidth||400,t=this._container.clientHeight||300),[d,t]}_setupResizeObserver(){var d;let t=!1,n=Ia((l=>{this._trackResize&&!this._removed&&(this.resize(l),this.redraw())}),50),A=(d=this._ownerWindow.ResizeObserver)!==null&&d!==void 0?d:ResizeObserver;this._resizeObserver=new A((l=>{t?n(l):t=!0})),this._resizeObserver.observe(this._container)}_resolveContainer(d){if(typeof d=="string"){let t=document.getElementById(d);if(!t)throw new Error(`Container '${d}' not found.`);return t}if(d instanceof HTMLElement||d&&typeof d=="object"&&d.nodeType===1)return d;throw new Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let d=this._container;d.classList.add("maplibregl-map");let t=this._canvasContainer=de.create("div","maplibregl-canvas-container",d);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=de.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let n=this._containerDimensions(),A=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],A);let l=this._controlContainer=de.create("div","maplibregl-control-container",d),g=this._controlPositions={};for(let B of["top-left","top-right","bottom-left","bottom-right"])g[B]=de.create("div",`maplibregl-ctrl-${B} `,l);this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(d,t,n){this._canvas.width=Math.floor(n*d),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${d}px`,this._canvas.style.height=`${t}px`}_setupPainter(){let d=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0}),t=null;this._canvas.addEventListener("webglcontextcreationerror",(A=>{t={requestedAttributes:d},A&&(t.statusMessage=A.statusMessage,t.type=A.type)}),{once:!0});let n=null;if(n=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,d):this._canvas.getContext("webgl2",d)||this._canvas.getContext("webgl",d),!n){let A="Failed to initialize WebGL";throw t?(t.message=A,new Error(JSON.stringify(t))):new Error(A)}this.painter=new Ho(n,this.transform)}migrateProjection(d,t){super.migrateProjection(d,t),this.painter.transform=d,this.fire(new c.n("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){var t;return!((t=this.style)===null||t===void 0)&&t._loaded?(this._styleDirty||(this._styleDirty=d),this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_render(d){var t,n,A,l,g,B;let y=this._idleTriggered?this._fadeDuration:0,C=((t=this.style.projection)===null||t===void 0?void 0:t.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(d),this._removed)return;let E=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let F=this.transform.zoom,T=Pe();this.style.zoomHistory.update(F,T);let P=new c.J(F,{now:T,fadeDuration:y,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),R=P.crossFadingFactor();R===1&&R===this._crossFadingFactor||(E=!0,this._crossFadingFactor=R),this.style.update(P)}let I=((n=this.style.projection)===null||n===void 0?void 0:n.transitionState)>0!==C;(A=this.style.projection)===null||A===void 0||A.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((l=this.style.projection)===null||l===void 0?void 0:l.transitionState,(g=this.style.projection)===null||g===void 0?void 0:g.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||I)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.tileManager.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0)),this._placementDirty=(B=this.style)===null||B===void 0?void 0:B._updatePlacement(this.transform,this.showCollisionBoxes,y,this._crossSourceCollisions,I),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:y,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new c.n("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new c.n("load"))),this.style&&(this.style.hasTransitions()||E)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let b=this._sourcesDirty||this._styleDirty||this._placementDirty;return b||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new c.n("idle")),!this._loaded||this._fullyLoaded||b||(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var d,t;this._hash&&this._hash.remove();for(let A of this._controls)A.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),(d=this._diffStyleRequest)===null||d===void 0||d.abort(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window!="undefined"&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),qe.removeThrottleControl(this._imageQueueHandle),(t=this._resizeObserver)===null||t===void 0||t.disconnect();let n=this.painter.context.gl.getExtension("WEBGL_lose_context");n!=null&&n.loseContext&&n.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),this._removed=!0,this.fire(new c.n("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,Je.frame(this._frameRequest,(d=>{this._frameRequest=null;try{this._render(d)}catch(t){if(!c.$(t)&&!(function(n){return n.message===Vs})(t))throw t}}),(()=>{}),this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}get version(){return iA}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(d){return this._lazyInitEmptyStyle(),this.style.setProjection(d),this._update(!0)}},ka={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class os{constructor(t,n,A=!1){this.mousedown=g=>{this.startMove(g,de.mousePos(this.element,g)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)},this.mousemove=g=>{this.move(g,de.mousePos(this.element,g))},this.mouseup=g=>{this._rotatePitchHandler.dragEnd(g),this.offTemp()},this.touchstart=g=>{g.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=de.touchPos(this.element,g.targetTouches)[0],this.startMove(g,this._startPos),window.addEventListener("touchmove",this.touchmove,{passive:!1}),window.addEventListener("touchend",this.touchend))},this.touchmove=g=>{g.targetTouches.length!==1?this.reset():(this._lastPos=de.touchPos(this.element,g.targetTouches)[0],this.move(g,this._lastPos))},this.touchend=g=>{g.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=n;let l=new va;this._rotatePitchHandler=new Cr({clickTolerance:3,move:(g,B)=>{let y=n.getBoundingClientRect(),C=new c.P((y.bottom-y.top)/2,(y.right-y.left)/2);return{bearingDelta:c.cx(new c.P(g.x,B.y),B,C),pitchDelta:A?-.5*(B.y-g.y):void 0}},moveStateManager:l,enable:!0,assignEvents:()=>{}}),this.map=t,n.addEventListener("mousedown",this.mousedown),n.addEventListener("touchstart",this.touchstart,{passive:!1}),n.addEventListener("touchcancel",this.reset)}startMove(t,n){this._rotatePitchHandler.dragStart(t,n),de.disableDrag()}move(t,n){let A=this.map,{bearingDelta:l,pitchDelta:g}=this._rotatePitchHandler.dragMove(t,n)||{};l&&A.setBearing(A.getBearing()+l),g&&A.setPitch(A.getPitch()+g)}off(){let t=this.element;t.removeEventListener("mousedown",this.mousedown),t.removeEventListener("touchstart",this.touchstart),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){de.enableDrag(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend)}}let Er;function oA(d,t,n,A=!1){if(A||!n.getCoveringTilesDetailsProvider().allowWorldCopies())return d==null?void 0:d.wrap();let l=new c.W(d.lng,d.lat);if(d=new c.W(d.lng,d.lat),t){let g=new c.W(d.lng-360,d.lat),B=new c.W(d.lng+360,d.lat),y=n.locationToScreenPoint(d).distSqr(t);n.locationToScreenPoint(g).distSqr(t)<y?d=g:n.locationToScreenPoint(B).distSqr(t)<y&&(d=B)}for(;Math.abs(d.lng-n.center.lng)>180;){let g=n.locationToScreenPoint(d);if(g.x>=0&&g.y>=0&&g.x<=n.width&&g.y<=n.height)break;d.lng>n.center.lng?d.lng-=360:d.lng+=360}return d.lng!==l.lng&&n.isPointOnMapSurface(n.locationToScreenPoint(d))?d:l}let ss={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function sA(d,t,n){let A=d.classList;for(let l in ss)A.remove(`maplibregl-${n}-anchor-${l}`);A.add(`maplibregl-${n}-anchor-${t}`)}class As extends c.E{constructor(t){if(super(),this._onClick=n=>{this.fire(new c.n("click",{originalEvent:n}))},this._onKeyPress=n=>{n.code!=="Space"&&n.code!=="Enter"||this.togglePopup()},this._onMapClick=n=>{let A=n.originalEvent.target,l=this._element;this._popup&&(A===l||l.contains(A))&&this.togglePopup()},this._update=n=>{if(!this._map)return;let A=this._map.loaded()&&!this._map.isMoving();((n==null?void 0:n.type)==="terrain"||(n==null?void 0:n.type)==="render"&&!A)&&this._map.once("render",this._update),this._lngLat=oA(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let l="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?l=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(l=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let g="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?g="rotateX(0deg)":this._pitchAlignment==="map"&&(g=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||n&&n.type!=="moveend"||(this._pos=this._pos.round()),this._element.style.transform=`${ss[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${g} ${l}`,Je.frameAsync(new AbortController,this._map._ownerWindow).then((()=>{this._updateOpacity((n==null?void 0:n.type)==="moveend")})).catch((()=>{}))},this._onMove=n=>{if(!this._isDragging){let A=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=A}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new c.n("dragstart"))),this.fire(new c.n("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new c.n("dragend")),this._state="inactive"},this._addDragHandler=n=>{this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=(t==null?void 0:t.anchor)||"center",this._color=(t==null?void 0:t.color)||"#3FB1CE",this._scale=(t==null?void 0:t.scale)||1,this._draggable=(t==null?void 0:t.draggable)||!1,this._clickTolerance=(t==null?void 0:t.clickTolerance)||0,this._subpixelPositioning=(t==null?void 0:t.subpixelPositioning)||!1,this._isDragging=!1,this._state="inactive",this._rotation=(t==null?void 0:t.rotation)||0,this._rotationAlignment=(t==null?void 0:t.rotationAlignment)||"auto",this._pitchAlignment=t!=null&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,this.setOpacity(t==null?void 0:t.opacity,t==null?void 0:t.opacityWhenCovered),t==null?void 0:t.element)this._element=t.element,this._offset=c.P.convert((t==null?void 0:t.offset)||[0,0]);else{this._defaultMarker=!0,this._element=de.create("div");let n=de.createNS("http://www.w3.org/2000/svg","svg"),A=41,l=27;n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height",`${A}px`),n.setAttributeNS(null,"width",`${l}px`),n.setAttributeNS(null,"viewBox",`0 0 ${l} ${A}`);let g=de.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"stroke","none"),g.setAttributeNS(null,"stroke-width","1"),g.setAttributeNS(null,"fill","none"),g.setAttributeNS(null,"fill-rule","evenodd");let B=de.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"fill-rule","nonzero");let y=de.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(3.0, 29.0)"),y.setAttributeNS(null,"fill","#000000");let C=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let N of C){let K=de.createNS("http://www.w3.org/2000/svg","ellipse");K.setAttributeNS(null,"opacity","0.04"),K.setAttributeNS(null,"cx","10.5"),K.setAttributeNS(null,"cy","5.80029008"),K.setAttributeNS(null,"rx",N.rx),K.setAttributeNS(null,"ry",N.ry),y.appendChild(K)}let E=de.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"fill",this._color);let I=de.createNS("http://www.w3.org/2000/svg","path");I.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),E.appendChild(I);let b=de.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"opacity","0.25"),b.setAttributeNS(null,"fill","#000000");let F=de.createNS("http://www.w3.org/2000/svg","path");F.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),b.appendChild(F);let T=de.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"transform","translate(6.0, 7.0)"),T.setAttributeNS(null,"fill","#FFFFFF");let P=de.createNS("http://www.w3.org/2000/svg","g");P.setAttributeNS(null,"transform","translate(8.0, 8.0)");let R=de.createNS("http://www.w3.org/2000/svg","circle");R.setAttributeNS(null,"fill","#000000"),R.setAttributeNS(null,"opacity","0.25"),R.setAttributeNS(null,"cx","5.5"),R.setAttributeNS(null,"cy","5.5"),R.setAttributeNS(null,"r","5.4999962");let Y=de.createNS("http://www.w3.org/2000/svg","circle");Y.setAttributeNS(null,"fill","#FFFFFF"),Y.setAttributeNS(null,"cx","5.5"),Y.setAttributeNS(null,"cy","5.5"),Y.setAttributeNS(null,"r","5.4999962"),P.appendChild(R),P.appendChild(Y),B.appendChild(y),B.appendChild(E),B.appendChild(b),B.appendChild(T),B.appendChild(P),n.appendChild(B),n.setAttributeNS(null,"height",A*this._scale+"px"),n.setAttributeNS(null,"width",l*this._scale+"px"),this._element.appendChild(n),this._offset=c.P.convert((t==null?void 0:t.offset)||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(n=>{n.preventDefault()})),this._element.addEventListener("mousedown",(n=>{n.preventDefault()})),sA(this._element,this._anchor,"marker"),t==null?void 0:t.className)for(let n of t.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),this._element.hasAttribute("role")||this._element.setAttribute("role","button"),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),t.on("projectiontransition",this._update),this._element.addEventListener("click",this._onClick),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),this._element.removeEventListener("click",this._onClick),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=c.W.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){let l=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[l,-1*(38.1-13.5+l)],"bottom-right":[-l,-1*(38.1-13.5+l)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){let t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(t=!1){var n,A;let l=(n=this._map)===null||n===void 0?void 0:n.terrain,g=this._map.transform.isLocationOccluded(this._lngLat);if(!l||g){let T=g?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==T&&(this._element.style.opacity=T,this._element.classList.toggle("maplibregl-marker-covered",g)))}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}let B=this._map,y=B.terrain.depthAtPoint(this._pos),C=B.terrain.getElevationForLngLat(this._lngLat,B.transform);if(B.transform.lngLatToCameraDepth(this._lngLat,C)-y<.006)return this._element.style.opacity=this._opacity,void this._element.classList.remove("maplibregl-marker-covered");let E=-this._offset.y/B.transform.pixelsPerMeter,I=Math.sin(B.getPitch()*Math.PI/180)*E,b=B.terrain.depthAtPoint(new c.P(this._pos.x,this._pos.y-this._offset.y)),F=B.transform.lngLatToCameraDepth(this._lngLat,C+I)-b>.006;!((A=this._popup)===null||A===void 0)&&A.isOpen()&&F&&this._popup.remove(),this._element.style.opacity=F?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",F)}getOffset(){return this._offset}setOffset(t){return this._offset=c.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,n){return(this._opacity===void 0||t===void 0&&n===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),t!==void 0&&(this._opacity=String(t)),n!==void 0&&(this._opacityWhenCovered=String(n)),this._map&&this._updateOpacity(!0),this}}let Pa={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ao=0,In=!1,Ga={maxWidth:100,unit:"metric"};function as(d,t,n){let A=(n==null?void 0:n.maxWidth)||100,l=d._container.clientHeight/2,g=d._container.clientWidth/2,B=d.unproject([g-A/2,l]),y=d.unproject([g+A/2,l]),C=Math.round(d.project(y).x-d.project(B).x),E=Math.min(A,C,d._container.clientWidth),I=B.distanceTo(y);if((n==null?void 0:n.unit)==="imperial"){let b=3.2808*I;b>5280?xn(t,E,b/5280,d._getUIString("ScaleControl.Miles")):xn(t,E,b,d._getUIString("ScaleControl.Feet"))}else(n==null?void 0:n.unit)==="nautical"?xn(t,E,I/1852,d._getUIString("ScaleControl.NauticalMiles")):I>=1e3?xn(t,E,I/1e3,d._getUIString("ScaleControl.Kilometers")):xn(t,E,I,d._getUIString("ScaleControl.Meters"))}function xn(d,t,n,A){let l=(function(g){let B=Math.pow(10,`${Math.floor(g)}`.length-1),y=g/B;return y=y>=10?10:y>=5?5:y>=3?3:y>=2?2:y>=1?1:(function(C){let E=Math.pow(10,Math.ceil(-Math.log(C)/Math.LN10));return Math.round(C*E)/E})(y),B*y})(n);d.style.width=t*(l/n)+"px",d.innerHTML=`${l} ${A}`}let Ra={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0},AA=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function aA(d){if(d){if(typeof d=="number"){let t=Math.round(Math.abs(d)/Math.SQRT2);return{center:new c.P(0,0),top:new c.P(0,d),"top-left":new c.P(t,t),"top-right":new c.P(-t,t),bottom:new c.P(0,-d),"bottom-left":new c.P(t,-t),"bottom-right":new c.P(-t,-t),left:new c.P(d,0),right:new c.P(-d,0)}}if(d instanceof c.P||Array.isArray(d)){let t=c.P.convert(d);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:c.P.convert(d.center||[0,0]),top:c.P.convert(d.top||[0,0]),"top-left":c.P.convert(d["top-left"]||[0,0]),"top-right":c.P.convert(d["top-right"]||[0,0]),bottom:c.P.convert(d.bottom||[0,0]),"bottom-left":c.P.convert(d["bottom-left"]||[0,0]),"bottom-right":c.P.convert(d["bottom-right"]||[0,0]),left:c.P.convert(d.left||[0,0]),right:c.P.convert(d.right||[0,0])}}return aA(new c.P(0,0))}let Oa=se;D.AJAXError=c.cG,D.EXTENT=c.a6,D.Event=c.n,D.Evented=c.E,D.LngLat=c.W,D.MercatorCoordinate=c.a7,D.Point=c.P,D.addProtocol=c.cH,D.config=c.c,D.removeProtocol=c.cI,D.AttributionControl=Hi,D.BoxZoomHandler=dr,D.CanvasSource=OA,D.CooperativeGesturesHandler=Le,D.DoubleClickZoomHandler=Ua,D.DragPanHandler=ar,D.DragRotateHandler=is,D.EdgeInsets=Kn,D.FullscreenControl=class extends c.E{constructor(d={}){var t;super(),this._onFullscreenChange=()=>{var n;let A=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;!((n=A==null?void 0:A.shadowRoot)===null||n===void 0)&&n.fullscreenElement;)A=A.shadowRoot.fullscreenElement;A===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=(t=d.pseudo)!==null&&t!==void 0&&t,d!=null&&d.container&&(d.container instanceof HTMLElement?this._container=d.container:c.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=de.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let d=this._fullscreenButton=de.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);de.create("span","maplibregl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.title=d}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new c.n("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new c.n("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},D.GeoJSONSource=ms,D.GeolocateControl=class extends c.E{constructor(d){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new c.n("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(t),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new c.n("geolocate",t)),this._finish()}},this._updateCamera=t=>{let n=new c.W(t.coords.longitude,t.coords.latitude),A=t.coords.accuracy,l=this._map.getBearing(),g=c.e({bearing:l},this.options.fitBoundsOptions),B=Oe.fromLngLat(n,A);this._map.fitBounds(B,g,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let n=new c.W(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=t=>{if(this._map){if(t.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&In)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new c.n("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=t=>{if(!this._map)return;let n=(t==null?void 0:t[0])instanceof ResizeObserverEntry;t.geolocateSource||this._watchState!=="ACTIVE_LOCK"||n||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new c.n("trackuserlocationend")),this.fire(new c.n("userlocationlostfocus")))},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(t=>{t.preventDefault()})),this._geolocateButton=de.create("button","maplibregl-ctrl-geolocate",this._container),de.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(t===!1){c.w("Geolocation support is not available so the GeolocateControl will be disabled.");let n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{let n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=de.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new As({element:this._dotElement}),this._circleElement=de.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new As({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",(()=>this.trigger())),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",this._onMoveStart)}},this.options=c.e({},Pa,d)}onAdd(d){return this._map=d,this._container=de.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return c._(this,arguments,void 0,(function*(t=!1){if(Er!==void 0&&!t)return Er;if(window.navigator.permissions===void 0)return Er=!!window.navigator.geolocation,Er;try{Er=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch(n){Er=!!window.navigator.geolocation}return Er}))})().then((t=>this._finishSetupUI(t))),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("movestart",this._onMoveStart),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,ao=0,In=!1}_isOutOfMapMaxBounds(d){let t=this._map.getMaxBounds(),n=d.coords;return t&&(n.longitude<t.getWest()||n.longitude>t.getEast()||n.latitude<t.getSouth()||n.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let d=this._userLocationDotMarker.getLngLat();if(!(this.options.showUserLocation&&this.options.showAccuracyCircle&&this._accuracy&&d))return;let t=this._map.project(d),n=this._map.unproject([t.x+100,t.y]),A=d.distanceTo(n)/100,l=2*this._accuracy/A;this._circleElement.style.width=`${l.toFixed(2)}px`,this._circleElement.style.height=`${l.toFixed(2)}px`}trigger(){if(!this._setup)return c.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new c.n("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ao--,In=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new c.n("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new c.n("trackuserlocationstart")),this.fire(new c.n("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let d;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ao++,ao>1?(d={maximumAge:6e5,timeout:0},In=!0):(d=this.options.positionOptions,In=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,d)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},D.GlobeControl=class{constructor(){this._toggleProjection=()=>{var d;let t=(d=this._map.getProjection())===null||d===void 0?void 0:d.type;this._map.setProjection(t!=="mercator"&&t?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var d;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((d=this._map.getProjection())===null||d===void 0?void 0:d.type)==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(d){return this._map=d,this._container=de.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=de.create("button","maplibregl-ctrl-globe",this._container),de.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},D.Hash=Jo,D.ImageSource=Lr,D.KeyboardHandler=gc,D.LngLatBounds=Oe,D.LogoControl=La,D.Map=nA,D.MapLibreMap=nA,D.MapMouseEvent=Ri,D.MapTouchEvent=Wo,D.MapWheelEvent=sc,D.Marker=As,D.NavigationControl=class{constructor(d){this._updateZoomButtons=()=>{let t=this._map.getZoom(),n=t===this._map.getMaxZoom(),A=t===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=A,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",A.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(t,n)=>{let A=this._map._getUIString(`NavigationControl.${n}`);t.title=A,t.setAttribute("aria-label",A)},this.options=c.e({},ka,d),this._container=de.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(t=>this._map.zoomIn({},{originalEvent:t}))),de.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(t=>this._map.zoomOut({},{originalEvent:t}))),de.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})})),this._compassIcon=de.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(d){return this._map=d,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new os(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(d,t){let n=de.create("button",d,this._container);return n.type="button",n.addEventListener("click",t),n}},D.Popup=class extends c.E{constructor(d){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:"")},this.remove=()=>(this._content&&this._content.remove(),this._container&&(this._container.remove(),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousemove",this._update),this._map.off("mouseup",this._update),this._map.off("drag",this._update),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new c.n("close"))),this),this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=de.create("div","maplibregl-popup",this._map.getContainer()),this._tip=de.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let y of this.options.className.split(" "))this._container.classList.add(y);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}let n;if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=oA(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),t&&"point"in t&&t.point&&(n=t.point),this._trackPointer&&!n)return;let A=this._flatPos=this._pos=this._trackPointer&&n?n:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&n?n:this._map.transform.locationToScreenPoint(this._lngLat));let l=this.options.anchor,g=aA(this.options.offset);if(!l){let y=this._container.offsetWidth,C=this._container.offsetHeight,E=(function(b){var F,T,P,R;return b?{top:(F=b.top)!==null&&F!==void 0?F:0,right:(T=b.right)!==null&&T!==void 0?T:0,bottom:(P=b.bottom)!==null&&P!==void 0?P:0,left:(R=b.left)!==null&&R!==void 0?R:0}:{top:0,right:0,bottom:0,left:0}})(this.options.padding),I;I=A.y+g.bottom.y<C+E.top?["top"]:A.y>this._map.transform.height-C-E.bottom?["bottom"]:[],A.x<y/2+E.left?I.push("left"):A.x>this._map.transform.width-y/2-E.right&&I.push("right"),l=I.length===0?"bottom":I.join("-")}let B=A.add(g[l]);this.options.subpixelPositioning||(B=B.round()),this._container.style.transform=`${ss[l]} translate(${B.x}px,${B.y}px)`,sA(this._container,l,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=c.e(Object.create(Ra),d)}addTo(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._map.on("terrain",this._update),this._map.on("projectiontransition",this._update),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._update),this._map.on("mouseup",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new c.n("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(d){return this._lngLat=c.W.convert(d),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._update),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._update),this._map.on("drag",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(d){return this.setDOMContent(document.createTextNode(d))}setHTML(d){let t=document.createDocumentFragment(),n=document.createElement("body"),A;for(n.innerHTML=d;A=n.firstChild,A;)t.appendChild(A);return this.setDOMContent(t)}getMaxWidth(){var d;return(d=this._container)===null||d===void 0?void 0:d.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=de.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(d),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(d){return this._container&&this._container.classList.add(d),this}removeClassName(d){return this._container&&this._container.classList.remove(d),this}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){if(this._container)return this._container.classList.toggle(d)}setSubpixelPositioning(d){this.options.subpixelPositioning=d}setPadding(d){this.options.padding=d,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=de.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let d=this._container.querySelector(AA);d&&d.focus()}},D.RasterDEMTileSource=ii,D.RasterTileSource=Ui,D.ScaleControl=class{constructor(d){this._onMove=()=>{as(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,as(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Ga),d)}getDefaultPosition(){return"bottom-left"}onAdd(d){return this._map=d,this._container=de.create("div","maplibregl-ctrl maplibregl-ctrl-scale",d.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._onMove),this._map=void 0}},D.ScrollZoomHandler=Ta,D.Style=fn,D.TerrainControl=class{constructor(d){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=d}onAdd(d){return this._map=d,this._container=de.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=de.create("button","maplibregl-ctrl-terrain",this._container),de.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){this._container.remove(),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},D.TwoFingersTouchPitchHandler=wr,D.TwoFingersTouchRotateHandler=dc,D.TwoFingersTouchZoomHandler=uc,D.TwoFingersTouchZoomRotateHandler=De,D.VectorTileSource=ti,D.VideoSource=rn,D.addSourceType=(d,t)=>c._(void 0,void 0,void 0,(function*(){if(Bs(d))throw new Error(`A source type called "${d}" already exists.`);((n,A)=>{NA[n]=A})(d,t)})),D.clearPrewarmedResources=function(){let d=Ki;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(Ft),Ki=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},D.createTileMesh=Zn,D.getGlobalDispatcher=fi,D.getMaxParallelImageRequests=function(){return c.c.MAX_PARALLEL_IMAGE_REQUESTS},D.getRTLTextPluginStatus=function(){return kr().getRTLTextPluginStatus()},D.getVersion=function(){return Oa},D.getWorkerCount=function(){return Dt.workerCount},D.getWorkerUrl=function(){return c.c.WORKER_URL},D.importScriptInWorkers=function(d){return fi().broadcast("IS",d)},D.isTimeFrozen=function(){return Qt.isFrozen()},D.now=Pe,D.prewarm=function(){$r().acquire(Ft)},D.restoreNow=function(){Qt.restoreNow()},D.setMaxParallelImageRequests=function(d){c.c.MAX_PARALLEL_IMAGE_REQUESTS=d},D.setNow=function(d){Qt.setNow(d)},D.setRTLTextPlugin=function(d,t){return kr().setRTLTextPlugin(d,t)},D.setWorkerCount=function(d){Dt.workerCount=d},D.setWorkerUrl=function(d){c.c.WORKER_URL=d}}));var le=pe;return le}))});var jB={};UB(jB,{default:()=>ah});module.exports=LB(jB);var Wr=require("obsidian");var er=require("obsidian"),oh=Xc(ll());var wp=[0,0],Vu=4;var Zu=require("obsidian"),Vc=class{constructor(){this.containerEl=createDiv("maplibregl-ctrl maplibregl-ctrl-group canvas-control-group mod-raised")}onAdd($){let J=this.containerEl.createDiv({cls:"maplibregl-ctrl-zoom-in canvas-control-item",attr:{"aria-label":"Zoom in"}});(0,Zu.setIcon)(J,"plus"),J.addEventListener("click",()=>{$.zoomIn()});let le=this.containerEl.createDiv({cls:"maplibregl-ctrl-zoom-out canvas-control-item",attr:{"aria-label":"Zoom out"}});return(0,Zu.setIcon)(le,"minus"),le.addEventListener("click",()=>{$.zoomOut()}),this.containerEl}onRemove(){this.containerEl.detach()}};var _o=require("obsidian"),Ip=Xc(ll());var fs=require("obsidian");function Hc(pe){let $=null,J=null;if(pe instanceof fs.ListValue)pe.length()>=2&&($=Zc(pe.get(0)),J=Zc(pe.get(1)));else if(pe instanceof fs.StringValue){let le=pe.toString().trim().split(",");le.length>=2&&($=Zc(le[0].trim()),J=Zc(le[1].trim()))}return $!=null&&J!=null&&kB($,J)?[$,J]:null}function kB(pe,$){return!isNaN(pe)&&!isNaN($)&&pe>=-90&&pe<=90&&$>=-180&&$<=180}function Zc(pe){if(pe instanceof fs.NumberValue){let $=Number(pe.toString());return isNaN($)?null:$}if(pe instanceof fs.StringValue){let $=parseFloat(pe.toString());return isNaN($)?null:$}if(typeof pe=="string"){let $=parseFloat(pe);return isNaN($)?null:$}return typeof pe=="number"?isNaN(pe)?null:pe:null}function Bo([pe,$]){return[$,pe]}function Ep(pe,$){return!pe||!$?pe===$:pe[0]===$[0]&&pe[1]===$[1]}function Hu(pe){return Number(pe.toFixed(5))}function Jc(pe,$){return`${pe}, ${$}`}var qc={enableHighAccuracy:!0,timeout:1e4,maximumAge:5e3};function Wc(pe){switch(pe.code){case pe.PERMISSION_DENIED:return"Location permission denied";case pe.POSITION_UNAVAILABLE:return"Location information unavailable";case pe.TIMEOUT:return"Location request timed out";default:return"Failed to get location"}}function cl(pe,$){return pe!=null&&typeof pe=="object"&&Object.hasOwn(pe,$)}var PB=15,$c=class{constructor(){this.locateButton=null;this.map=null;this.userMarker=null;this.watchId=null;this.isTracking=!1;this.isLocked=!1;this.zoomOnNextRecenter=!1;this.lastPosition=null;this.lastErrorCode=null;this.onMoveStart=$=>{!this.isLocked||!$.originalEvent||$.originalEvent.type!=="resize"&&(this.isLocked=!1,this.locateButton&&(0,_o.setIcon)(this.locateButton,"locate"))};this.containerEl=createDiv("maplibregl-ctrl maplibregl-ctrl-group canvas-control-group mod-raised")}onAdd($){return this.map=$,this.locateButton=this.containerEl.createDiv({cls:"maplibregl-ctrl-geolocate canvas-control-item",attr:{"aria-label":"Locate user"}}),(0,_o.setIcon)(this.locateButton,"locate-fixed"),this.locateButton.addEventListener("click",()=>{this.isTracking?this.isLocked?this.stopTracking():(this.lock(),this.recenter()):this.startTracking()}),$.on("movestart",this.onMoveStart),this.containerEl}startTracking(){if(!navigator.geolocation){new _o.Notice("Location services are not available");return}!this.map||!this.locateButton||(this.isTracking=!0,this.lastErrorCode=null,this.locateButton.addClass("is-active"),this.lock(),this.watchId=navigator.geolocation.watchPosition($=>{this.updatePosition($.coords.latitude,$.coords.longitude)},$=>{this.handleError($)},qc))}stopTracking(){this.watchId!==null&&(navigator.geolocation.clearWatch(this.watchId),this.watchId=null),this.isTracking=!1,this.isLocked=!1,this.lastPosition=null,this.lastErrorCode=null,this.locateButton&&(this.locateButton.removeClass("is-active"),(0,_o.setIcon)(this.locateButton,"locate-fixed")),this.userMarker&&(this.userMarker.remove(),this.userMarker=null)}lock(){this.isLocked=!0,this.zoomOnNextRecenter=!0,this.locateButton&&(0,_o.setIcon)(this.locateButton,"locate-fixed")}updatePosition($,J){if(this.map){if(this.lastPosition=[$,J],this.lastErrorCode=null,this.userMarker)this.userMarker.setLngLat([J,$]);else{let le=createDiv("user-location-marker");le.createSvg("svg",{attr:{width:"20",height:"20",viewBox:"0 0 20 20"}}).createSvg("circle",{attr:{cx:"10",cy:"10",r:"6"}}),this.userMarker=new Ip.Marker({element:le}).setLngLat([J,$]).addTo(this.map)}this.isLocked&&this.recenter()}}recenter(){if(!this.map||!this.lastPosition)return;let[$,J]=this.lastPosition,le={center:[J,$],duration:1e3};this.zoomOnNextRecenter&&(le.zoom=Math.max(this.map.getZoom(),PB),this.zoomOnNextRecenter=!1),this.map.flyTo(le)}handleError($){this.lastErrorCode!==$.code&&(this.lastErrorCode=$.code,new _o.Notice(Wc($)),console.warn("Geolocation error:",$)),$.code===$.PERMISSION_DENIED&&this.stopTracking()}onRemove(){this.stopTracking(),this.map&&this.map.off("movestart",this.onMoveStart),this.containerEl.detach(),this.map=null,this.locateButton=null}};var th=require("obsidian"),eh=class{constructor($,J,le){this.tileSets=$,this.currentTileSetId=J,this.onSwitch=le,this.containerEl=createDiv("maplibregl-ctrl maplibregl-ctrl-group canvas-control-group mod-raised")}onAdd(){let $=this.containerEl.createDiv({cls:"canvas-control-item",attr:{"aria-label":"Switch background"}});return(0,th.setIcon)($,"layers"),$.addEventListener("click",J=>{J.stopPropagation();let le=new th.Menu;for(let D of this.tileSets)le.addItem(c=>{c.setTitle(D.name).setChecked(this.currentTileSetId===D.id).onClick(()=>{this.currentTileSetId=D.id,this.onSwitch(D.id)})});le.showAtMouseEvent(J)}),this.containerEl}onRemove(){this.containerEl.detach()}};var vp=require("obsidian");function Ju(pe){return pe.indexOf("mapbox:")===0}function xp(pe,$){var J,le,D;if(pe.projection&&"name"in pe.projection&&delete pe.projection.name,pe.sources)for(let c in pe.sources){let se=pe.sources[c];se.url&&Ju(se.url)&&(se.url=(J=qu(se.url,"Source",$))!=null?J:se.url)}return pe.sprite&&typeof pe.sprite=="string"&&Ju(pe.sprite)&&(pe.sprite=(le=qu(pe.sprite,"Sprite",$))!=null?le:pe.sprite),pe.glyphs&&Ju(pe.glyphs)&&(pe.glyphs=(D=qu(pe.glyphs,"Glyphs",$))!=null?D:pe.glyphs),pe}function qu(pe,$,J){if(pe.indexOf("/styles/")>-1&&pe.indexOf("/sprite")===-1)return GB(pe,J);if(pe.indexOf("/sprites/")>-1)return NB(pe,J);if(pe.indexOf("/fonts/")>-1)return RB(pe,J);if(pe.indexOf("/v4/")>-1||$==="Source")return OB(pe,J)}function ul(pe){let $=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/,J=pe.match($);if(!J)throw new Error("Unable to parse URL object");return{protocol:J[1],authority:J[2],path:J[3]||"/",params:J[4]?J[4].split("&"):[]}}function hl(pe,$){let J=ul("https://api.mapbox.com");pe.protocol=J.protocol,pe.authority=J.authority,pe.params.push(`access_token=${$}`);let le=pe.params.length?`?${pe.params.join("&")}`:"";return`${pe.protocol}://${pe.authority}${pe.path}${le}`}function GB(pe,$){let J=ul(pe);return J.path=`/styles/v1${J.path}`,hl(J,$)}function RB(pe,$){let J=ul(pe);return J.path=`/fonts/v1${J.path}`,hl(J,$)}function OB(pe,$){let J=ul(pe);return J.path=`/v4/${J.authority}.json`,J.params.push("secure"),hl(J,$)}function NB(pe,$){let J=ul(pe),le=J.path.split("/").filter(Me=>Me.length>0),D=le[0],c=le[1];if(!D||!c){let Me=J.path.split("."),Te=Me[0],Ye=Me[1]||"json",rt="";return Te.indexOf("@2x")>-1&&(Te=Te.split("@2x")[0],rt="@2x"),J.path=`/styles/v1${Te}/sprite${rt}.${Ye}`,hl(J,$)}let se="";return pe.indexOf("@2x")>-1&&(se="@2x"),J.path=`/styles/v1/${D}/${c}/sprite${se}`,hl(J,$)}var ih=class{constructor($){this.app=$}async getMapStyle($,J){let le=this.app.isDarkMode(),D=le&&J.length>0?J:$,c;if(D.length===0?c=le?"https://tiles.openfreemap.org/styles/dark":"https://tiles.openfreemap.org/styles/bright":D.length===1&&!this.isTileTemplateUrl(D[0])?c=D[0]:c="",c){try{let Me=await(0,vp.requestUrl)({url:c,throw:!1});if(Me.status>=200&&Me.status<300){let Te=Me.json,Ye=c.match(/access_token=([^&]+)/),rt=Ye?Ye[1]:"";return rt?xp(Te,rt):Te}}catch(Me){console.warn("Failed to fetch style JSON, falling back to URL:",Me)}return c}let se={version:8,sources:{},layers:[]};return D.forEach((Me,Te)=>{let Ye=`custom-tiles-${Te}`;se.sources[Ye]={type:"raster",tiles:[Me],tileSize:256},se.layers.push({id:`custom-layer-${Te}`,type:"raster",source:Ye})}),se}isTileTemplateUrl($){return $.includes("{z}")||$.includes("{x}")||$.includes("{y}")}};var bp=require("obsidian"),Fp=Xc(ll()),zB=20,rh=class{constructor($,J){this.map=null;this.sharedPopup=null;this.popupHideTimeout=null;this.popupHideTimeoutWin=null;this.containerEl=$,this.app=J}setMap($){this.map=$}showPopup($,J,le,D,c){if(!this.map)return;let se=this.collectDisplayProperties($,le,D);if(se.length===0)return;if(this.clearPopupHideTimeout(),!this.sharedPopup){let rt=this.sharedPopup=new Fp.Popup({closeButton:!1,closeOnClick:!1,offset:25});rt.on("open",()=>{let Je=rt.getElement();Je&&(Je.addEventListener("mouseenter",()=>{this.clearPopupHideTimeout()}),Je.addEventListener("mouseleave",()=>{this.hidePopup()}))})}let[Me,Te]=J,Ye=this.createPopupContent($,se,c);this.sharedPopup.setDOMContent(Ye).setLngLat([Te,Me]).addTo(this.map)}hidePopup(){this.clearPopupHideTimeout();let $=this.popupHideTimeoutWin=this.containerEl.win;this.popupHideTimeout=$.setTimeout(()=>{this.sharedPopup&&this.sharedPopup.remove(),this.popupHideTimeout=null,this.popupHideTimeoutWin=null},150)}clearPopupHideTimeout(){this.popupHideTimeout&&(this.popupHideTimeoutWin||this.containerEl.win).clearTimeout(this.popupHideTimeout),this.popupHideTimeoutWin=null,this.popupHideTimeout=null}destroy(){this.clearPopupHideTimeout(),this.sharedPopup&&(this.sharedPopup.remove(),this.sharedPopup=null)}collectDisplayProperties($,J,le){if(!J)return[];let D=[];for(let c of J.slice(0,zB))if(!le.includes(c))try{let se=$.getValue(c);se&&this.hasNonEmptyValue(se)&&D.push({prop:c,value:se})}catch(se){}return D}createPopupContent($,J,le){let D=createDiv("bases-map-popup");if(J.length>0){let c=J[0],Me=D.createDiv("bases-map-popup-title").createEl("a",{href:$.file.path,cls:"internal-link"});c.value.renderTo(Me,this.app.renderContext);let Te=J.slice(1);if(Te.length>0){let Ye=D.createDiv("bases-map-popup-properties");for(let{prop:rt,value:Je}of Te){let Qt=Ye.createDiv("bases-map-popup-property"),Pe=Qt.createDiv("bases-map-popup-property-label");Pe.textContent=le(rt);let Lt=Qt.createDiv("bases-map-popup-property-value");Je.renderTo(Lt,this.app.renderContext)}}}return D}hasNonEmptyValue($){if(!$||!$.isTruthy())return!1;if($ instanceof bp.ListValue){for(let J=0;J<$.length();J++){let le=$.get(J);if(le&&this.hasNonEmptyValue(le))return!0}return!1}return!0}};var PA=require("obsidian"),Dp=Xc(ll());var YB="var(--bases-map-marker-background)",nh=class{constructor($,J,le,D,c,se,Me){this.map=null;this.markers=[];this.bounds=null;this.loadedIcons=new Set;this.resolvedColors=new Map;this.interactionsBound=!1;this.app=$,this.mapEl=J,this.popupManager=le,this.onOpenFile=D,this.getData=c,this.getMapConfig=se,this.getDisplayName=Me}setMap($){this.map=$,this.interactionsBound=!1}getBounds(){return this.bounds}clearLoadedIcons(){this.loadedIcons.clear(),this.resolvedColors.clear()}async updateMarkers($){let J=this.getMapConfig();if(!this.map||!$||!J||!J.coordinatesProp)return;let le=[];for(let Me of $.data){if(!Me)continue;let Te=null;try{let Ye=Me.getValue(J.coordinatesProp);Te=Hc(Ye)}catch(Ye){console.error(`Error extracting coordinates for ${Me.file.name}:`,Ye)}if(Te){let Ye=this.getCustomIcon(Me,J),rt=this.getCustomColor(Me,J)||YB;le.push({entry:Me,coordinates:Te,icon:Ye,color:rt,imageKey:this.getCompositeImageKey(Ye,rt)})}}this.markers=le;let D=this.bounds=new Dp.LngLatBounds;le.forEach(Me=>D.extend(Bo(Me.coordinates))),await this.loadCustomIcons(le);let c=this.createGeoJSONFeatures(le),se=this.map.getSource("markers");se?se.setData({type:"FeatureCollection",features:c}):(this.map.addSource("markers",{type:"geojson",data:{type:"FeatureCollection",features:c}}),this.addMarkerLayers(),this.setupMarkerInteractions())}getStringProp($,J,le){if(!J)return null;try{let D=$.getValue(J);return!D||!D.isTruthy()?null:D.toString().trim()||null}catch(D){return console.warn(`${le} for ${$.file.name}`,D),null}}getCustomIcon($,J){var D;let le=this.getStringProp($,(D=J==null?void 0:J.markerIconProp)!=null?D:null,'Could not extract icon. The marker icon property should be a simple text value (e.g., "map", "star"),');return le==="null"||le==="undefined"?null:le}getCustomColor($,J){var le;return this.getStringProp($,(le=J==null?void 0:J.markerColorProp)!=null?le:null,'Could not extract color. The marker color property should be a simple text value (e.g., "#ff0000", "red", "var(--color-accent)"),')}async loadCustomIcons($){if(!this.map)return;let J=new Map;for(let{icon:le,color:D,imageKey:c}of $)this.loadedIcons.has(c)||J.has(c)||J.set(c,{icon:le,color:D});await Promise.all(Array.from(J,async([le,{icon:D,color:c}])=>{try{let se=await this.createCompositeMarkerImage(D,c);this.map&&(this.map.hasImage(le)&&this.map.removeImage(le),this.map.addImage(le,se),this.loadedIcons.add(le))}catch(se){console.warn(`Failed to create composite marker for icon ${D}:`,se)}}))}getCompositeImageKey($,J){return`marker-${$||"dot"}-${J.replace(/[^a-zA-Z0-9]/g,"")}`}resolveColor($){let J=this.resolvedColors.get($);if(J!==void 0)return J;let le=document.body.createDiv("bases-map-color-probe");le.setCssStyles({color:$});let D=getComputedStyle(le).color;return le.remove(),this.resolvedColors.set($,D),D}async createCompositeMarkerImage($,J){let le=this.resolveColor(J),D=this.resolveColor("var(--bases-map-marker-icon-color)"),c=4,se=48*c,Me=createEl("canvas");Me.width=se,Me.height=se;let Te=Me.getContext("2d");if(!Te)throw new Error("Failed to get canvas context");Te.imageSmoothingEnabled=!0,Te.imageSmoothingQuality="high";let Ye=se/2,rt=se/2,Je=12*c;if(Te.fillStyle=le,Te.beginPath(),Te.arc(Ye,rt,Je,0,2*Math.PI),Te.fill(),Te.strokeStyle="rgba(255, 255, 255, 0.3)",Te.lineWidth=1*c,Te.stroke(),$){let Qt=createDiv();(0,PA.setIcon)(Qt,$);let Pe=Qt.querySelector("svg");if(Pe){Pe.setAttribute("stroke","currentColor"),Pe.setAttribute("fill","none"),Pe.setAttribute("stroke-width","2"),Pe.style.color=D;let Lt=new XMLSerializer().serializeToString(Pe),qe=new Image;qe.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(Lt),await new Promise((de,dt)=>{qe.onload=()=>{let xi=Je*1.2;Te.drawImage(qe,Ye-xi/2,rt-xi/2,xi,xi),de()},qe.onerror=dt})}}else{let Qt=4*c;Te.fillStyle=D,Te.beginPath(),Te.arc(Ye,rt,Qt,0,2*Math.PI),Te.fill()}return new Promise((Qt,Pe)=>{Me.toBlob(Lt=>{if(!Lt){Pe(new Error("Failed to create image blob"));return}let qe=new Image,de=URL.createObjectURL(Lt);qe.onload=()=>{URL.revokeObjectURL(de),Qt(qe)},qe.onerror=()=>{URL.revokeObjectURL(de),Pe(new Error("Failed to decode composite marker image"))},qe.src=de})})}createGeoJSONFeatures($){return $.map((J,le)=>{let D={entryIndex:le,icon:J.imageKey};return{type:"Feature",geometry:{type:"Point",coordinates:Bo(J.coordinates)},properties:D}})}addMarkerLayers(){this.map&&this.map.addLayer({id:"marker-pins",type:"symbol",source:"markers",layout:{"icon-image":["get","icon"],"icon-size":["interpolate",["linear"],["zoom"],0,.12,4,.18,14,.22,18,.24],"icon-allow-overlap":!0,"icon-ignore-placement":!0,"icon-padding":0}})}markerFromEvent($){var le,D,c,se;let J=(c=(D=(le=$.features)==null?void 0:le[0])==null?void 0:D.properties)==null?void 0:c.entryIndex;return typeof J!="number"?null:(se=this.markers[J])!=null?se:null}setupMarkerInteractions(){!this.map||this.interactionsBound||(this.interactionsBound=!0,this.map.on("mouseenter","marker-pins",()=>{var $;($=this.map)==null||$.getCanvas().addClass("is-over-marker")}),this.map.on("mouseleave","marker-pins",()=>{var $;($=this.map)==null||$.getCanvas().removeClass("is-over-marker")}),this.map.on("mouseenter","marker-pins",$=>{let J=this.markerFromEvent($);if(!J)return;let le=this.getData(),D=this.getMapConfig();!le||!le.properties||!D||this.popupManager.showPopup(J.entry,J.coordinates,le.properties,this.getMarkerDrivenProps(D),this.getDisplayName)}),this.map.on("mouseleave","marker-pins",()=>{this.popupManager.hidePopup()}),this.map.on("click","marker-pins",$=>{let J=this.markerFromEvent($);if(!J)return;let le=$.originalEvent?!!PA.Keymap.isModEvent($.originalEvent):!1;this.onOpenFile(J.entry.file.path,le)}),this.map.on("contextmenu","marker-pins",$=>{$.preventDefault();let J=this.markerFromEvent($);if(!J)return;let[le,D]=J.coordinates,c=J.entry.file,se=PA.Menu.forEvent($.originalEvent);this.app.workspace.handleLinkContextMenu(se,c.path,""),se.addItem(Me=>Me.setSection("action").setTitle("Copy coordinates").setIcon("map-pin").onClick(()=>{navigator.clipboard.writeText(Jc(le,D))})),se.addItem(Me=>Me.setSection("danger").setTitle("Delete file").setIcon("trash-2").setWarning(!0).onClick(()=>this.app.fileManager.promptForDeletion(c)))}),this.map.on("mouseover","marker-pins",$=>{let J=this.markerFromEvent($);J&&this.app.workspace.trigger("hover-link",{event:$.originalEvent,source:"bases",hoverParent:this.app.renderContext,targetEl:this.mapEl,linktext:J.entry.file.path})}))}getMarkerDrivenProps($){return[$.coordinatesProp,$.markerIconProp,$.markerColorProp].filter(J=>J!=null)}};var Sp='var A,B;A=this,B=function(){var A,B="undefined"!=typeof document?document.currentScript:null,Q=(A="undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:B&&B.src||new URL("mapbox-gl-rtl-text.js",document.baseURI).href,function(B={}){var Q,g,C=B,E=new Promise(((A,B)=>{Q=A,g=B})),I="object"==typeof window,F="function"==typeof importScripts;"object"==typeof process&&"object"==typeof process.versions&&process.versions.node;var w,U=Object.assign({},C),D="";(I||F)&&(F?D=self.location.href:"undefined"!=typeof document&&document.currentScript&&(D=document.currentScript.src),A&&(D=A),D=D.startsWith("blob:")?"":D.substr(0,D.replace(/[?#].*/,"").lastIndexOf("/")+1),F&&(w=A=>{var B=new XMLHttpRequest;return B.open("GET",A,!1),B.responseType="arraybuffer",B.send(null),new Uint8Array(B.response)})),C.print||console.log.bind(console);var G,s,Y=C.printErr||console.error.bind(console);function o(A){if(h(A))return function(A){for(var B=atob(A),Q=new Uint8Array(B.length),g=0;g<B.length;++g)Q[g]=B.charCodeAt(g);return Q}(A.slice(J.length))}Object.assign(C,U),U=null,C.arguments&&C.arguments,C.thisProgram&&C.thisProgram,C.quit&&C.quit,C.wasmBinary&&(G=C.wasmBinary);var c,L,K,i,N=!1;function n(){var A=s.buffer;C.HEAP8=c=new Int8Array(A),C.HEAP16=K=new Int16Array(A),C.HEAPU8=L=new Uint8Array(A),C.HEAPU16=i=new Uint16Array(A),C.HEAP32=new Int32Array(A),C.HEAPU32=new Uint32Array(A),C.HEAPF32=new Float32Array(A),C.HEAPF64=new Float64Array(A)}if(C.wasmMemory)s=C.wasmMemory;else{var k=C.INITIAL_MEMORY||16777216;s=new WebAssembly.Memory({initial:k/65536,maximum:32768})}n();var S=[],X=[],d=[],M=0,y=null;function a(A){C.onAbort?.(A),Y(A="Aborted("+A+")"),N=!0,A+=". Build with -sASSERTIONS for more info.";var B=new WebAssembly.RuntimeError(A);throw g(B),B}var O,J="data:application/octet-stream;base64,",h=A=>A.startsWith(J);function R(A){return Promise.resolve().then((()=>function(A){if(A==O&&G)return new Uint8Array(G);var B=o(A);if(B)return B;if(w)return w(A);throw"both async and sync fetching of the wasm failed"}(A)))}function x(A,B,Q,g){return function(A,B,Q){return R(A).then((A=>WebAssembly.instantiate(A,B))).then(Q,(A=>{Y(`failed to asynchronously prepare wasm: ${A}`),a(A)}))}(B,Q,g)}var H=A=>{for(;A.length>0;)A.shift()(C)};C.noExitRuntime;var b=A=>{var B=(A-s.buffer.byteLength+65535)/65536;try{return s.grow(B),n(),1}catch(A){}},r="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,t=A=>T(A),e=A=>{var B=(A=>{for(var B=0,Q=0;Q<A.length;++Q){var g=A.charCodeAt(Q);g<=127?B++:g<=2047?B+=2:g>=55296&&g<=57343?(B+=4,++Q):B+=3}return B})(A)+1,Q=t(B);return((A,B,Q)=>{((A,B,Q,g)=>{if(!(g>0))return 0;for(var C=Q+g-1,E=0;E<A.length;++E){var I=A.charCodeAt(E);if(I>=55296&&I<=57343&&(I=65536+((1023&I)<<10)|1023&A.charCodeAt(++E)),I<=127){if(Q>=C)break;B[Q++]=I}else if(I<=2047){if(Q+1>=C)break;B[Q++]=192|I>>6,B[Q++]=128|63&I}else if(I<=65535){if(Q+2>=C)break;B[Q++]=224|I>>12,B[Q++]=128|I>>6&63,B[Q++]=128|63&I}else{if(Q+3>=C)break;B[Q++]=240|I>>18,B[Q++]=128|I>>12&63,B[Q++]=128|I>>6&63,B[Q++]=128|63&I}}B[Q]=0})(A,L,B,Q)})(A,Q,B),Q},j="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,f=(A,B)=>A?((A,B,Q)=>{for(var g=B+Q,C=B;A[C]&&!(C>=g);)++C;if(C-B>16&&A.buffer&&j)return j.decode(A.subarray(B,C));for(var E="";B<C;){var I=A[B++];if(128&I){var F=63&A[B++];if(192!=(224&I)){var w=63&A[B++];if((I=224==(240&I)?(15&I)<<12|F<<6|w:(7&I)<<18|F<<12|w<<6|63&A[B++])<65536)E+=String.fromCharCode(I);else{var U=I-65536;E+=String.fromCharCode(55296|U>>10,56320|1023&U)}}else E+=String.fromCharCode((31&I)<<6|F)}else E+=String.fromCharCode(I)}return E})(L,A,B):"",q={c:()=>{a("")},b:A=>{var B=L.length,Q=2147483648;if((A>>>=0)>Q)return!1;for(var g,C,E=1;E<=4;E*=2){var I=B*(1+.2/E);I=Math.min(I,A+100663296);var F=Math.min(Q,(g=Math.max(A,I))+((C=65536)-g%C)%C);if(b(F))return!0}return!1},a:s},Z=function(){var A={a:q};function B(A,B){var Q;return Z=A.exports,Q=Z.d,X.unshift(Q),function(A){if(M--,C.monitorRunDependencies?.(M),0==M&&y){var B=y;y=null,B()}}(),Z}if(M++,C.monitorRunDependencies?.(M),C.instantiateWasm)try{return C.instantiateWasm(A,B)}catch(A){Y(`Module.instantiateWasm callback failed with error: ${A}`),g(A)}return O||(O="data:application/octet-stream;base64,AGFzbQEAAAABUw1gAn9/AX9gAX8Bf2ADf39/AX9gAn9/AGAFf39/f38AYAF/AGAEf39/fwF/YAAAYAZ/f39/f38Bf2AFf39/f38Bf2ADf39/AGAEf39/fwBgAAF/AhgDAWEBYgABAWEBYwAHAWEBYQIBgAKAgAIDNzYBAgABAgoAAQQFBQYBCAYGBwgFAQoEAgIBAgsMBgMICQsACQEJAAQCAAMEBwACDAEFAAIBAAAEBQFwAQEBBggBfwFBkMMICwc5DgFkAC0BZQA3AWYABQFnAAwBaAA2AWkANQFqADQBawAzAWwALwFtAC4BbgEAAW8AMgFwADEBcQAwCurCAjYtAQF/IABFBEBBgAgPC0GIvwQoAgAiAQRAQYy/BCgCACAAIAERAAAPCyAAEAULKQEBfyACBEAgACEDA0AgAyABOgAAIANBAWohAyACQQFrIgINAAsLIAALjAkBC39BgAghAgJAIABBgAhGBEAgAUUNAUGIvwQoAgAiAARAQYy/BCgCACABIAARAAAPCyABEAUPCyABRQRAQZC/BCgCACIBBEBBjL8EKAIAIAAgAREDAEGACA8LIAAQDEGACA8LQZS/BCgCACICBEBBjL8EKAIAIAAgASACEQIADwsCfyAARQRAIAEQBQwBCyABQUBPBEBBmL8EQTA2AgBBAAwBCwJ/QRAgAUELakF4cSABQQtJGyEFQQAhAiAAQQhrIgQoAgQiCUF4cSEIAkAgCUEDcUUEQCAFQYACSQ0BIAVBBGogCE0EQCAEIQIgCCAFa0H8wgQoAgBBAXRNDQILQQAMAgsgBCAIaiEGAkAgBSAITQRAIAggBWsiA0EQSQ0BIAQgCUEBcSAFckECcjYCBCAEIAVqIgIgA0EDcjYCBCAGIAYoAgRBAXI2AgQgAiADEB8MAQtBtL8EKAIAIAZGBEBBqL8EKAIAIAhqIgggBU0NAiAEIAlBAXEgBXJBAnI2AgQgBCAFaiIDIAggBWsiAkEBcjYCBEGovwQgAjYCAEG0vwQgAzYCAAwBC0GwvwQoAgAgBk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IBNgLwASAAKAL0ASABQQR0aiIAIAo7AQwgCCgCFCEBIAAgCTYCBCAAIAE2AgggACAIKAIINgIADAELIAAgCCAHQf8BcSACIAIQCgsgCEEgaiQACwIAC8kBAQR/IwBBEGsiAyQAIANBADYCDEGEvwQoAgAiAkUEQEGEvwQQHSICNgIAC0GAvwQoAgAgACABIAIgA0EMaiIEECgCQCADKAIMQQBKDQBBACEBAkBBhL8EKAIAIgBFDQAgACAAKAIAIgJHBEAgAkUNASACKAIAIAJHDQELIAAoAgwhAQsgAUEBaiICQQF0EAUhAEGEvwQoAgAgACACQQogBBAmGiADKAIMQQBKDQAgACABQQF0akEAOwEAIAAhBQsgA0EQaiQAIAUL/wEBBH8jAEEQayIFJAAgBUEANgIMAn8gACABQQF0aiEDIAJBAXRBAmoQBSEBIAIhAEEAIAVBDGoiBEUNABogBCgCAEEATAR/IANFIAJBf0hyIAJBAEhyQQEgASACRXIbBEAgBEEBNgIAQQAMAgsgAUUgASADTSABIABBAXRqIANLcUUgASADSSADIAJBAXRqIAFNcnFyRQRAIARBATYCAEEADAILIAJBf0YEQCADEA4hAgsgASAAIAJBAEwEf0EABSADIAIgASAAQQogBBAPCyAEEA0FQQALCyEAIAUoAgxBAEwEQCABIABBAXRqQQA7AQAgASEGCyAFQRBqJAAgBgsEACMACxAAIwAgAGtBcHEiACQAIAALBgAgACQAC3UBA38jAEEQayICJAAgAkEANgIMQYS/BCgCACIERQRAQYS/BBAdIgQ2AgALQYC/BCgCACAAIAEgBCACQQxqIgAQKCACKAIMQQBMBEAgAkEANgIMQYS/BCgCACAAECdBACACKAIMQQBMGyEDCyACQRBqJAAgAwsUAEGEvwQoAgAgACABIAIQEEEBRgvjAQEGfyMAQRBrIgEkACABQQA2AgwgAUEANgIIQYC/BCgCACEDIAFBCGohBQJAIAFBDGoiBEUNACAEKAIAQQBKDQACQAJAIANFDQAgAygCACICIANGDQEgAkUNACACKAIAIAJGDQELIARBGzYCAAwBCwJAIABBAE4EQCADKAKEASAAS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LQwtDC0MLQwtDC0MLQwtDC0MLQwtDC0MLQwtDC0MLQwtDC0MLQwtDC0MLQwtDC0MLQwtDC0MLQwtDC0MLQwtDC0MLQwtDC0MLQwtDC0MLQx7A3sDewMSABIAEgASABIAEgASABIAEgAIAAcACAAJAAcAEgASABIAEgASABIAEgASABIAEgASABIAEgASAAcABwAHAAgACQAKAAoABAAEAAQACgAKAAoxCvIKAAMABgADAAYABgACAAIAAgACAAIAAgACAAIAAgACAAYACgAKUAoACtAKAAoAQebLAAsLClEKAArSCgAKAAoAQabMAAsJClEKAArSCgASAEGwzQALfxIAEgASABIAEgAHABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgAGAAoABAAEAAQABAAKAAoACgAKAAAACpAKALIACgAKAAQABAACAAIACgAAAAoACgAKAAIAAAAKkAoACgAKAAoAQd7OAAsBCgBBns8ACwEKAEGS0AALAwoACgBBpNAACzsKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoAAAAAAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgBB6tAAC7UBCgAKAAoACgAKAAoACgAKAAoAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQBBqNIACwMKAAoAQbzSAAsBCgBByNIACwcKAAoAAAAKAEHE0wALAQoAQd7TAAsNsQCxALEAsQCxALEAsQBB3NQAC+kMCgAAAAAACgAKAAQAAQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQABALEAAQCxALEAAQCxALEAAQCxAAEAAQABAAEAAQABAAEA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sQCxAEGm5QALFbEAsQAAAAAAsQCxALEAAAAAAAAAsQBB4OUACwuxALEAAAAAAAAAsQBBguYACw+xALEAsQCxALEAAACxALEAQZrmAAsBsQBBxOYACwOxALEAQeLmAAsBBABB9OYACwuxALEAsQCxALEAsQBBuOcACxGxAAAAAACxAAAAsQCxALEAsQBB2ucACwGxAEHq5wALA7EAsQBBhOgACwGxAEHA6AALAbEAQdroAAsBsQBBhukACw8KAAoACgAKAAoACgAEAAoAQaDpAAsJsQAAAAAAAACxAEHs6QALBbEAsQCxAEH86QALD7EAsQCxAAAAsQCxALEAsQBBmuoACwOxALEAQbTqAAsDsQCxAEHg6gALDQoACgAKAAoACgAKAAoAQajrAAsHsQAAAAAAoABBvOsACwGgAEHI6wALA7EAsQBBhuwACwOxALEAQaTsAAsBsQBBtOwACwmxALEAsQAAALEAQeLsAAsTsQAAAAAAsQCxALEAsQCxALEAsQBB/uwACwEEAEGO7QALD7EAsQCxALEAsQCxALEAsQBBwu0ACxexAAAAAACxALEAsQCxALEAsQCxALEAsQBB8O0ACwuxALEAsQCxALEAsQBBsO4ACwOxALEAQeLuAAsSsQAAALEAAACxAAoxCvIKMQryAEGa7wALLbEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQAAALEAsQCxALEAsQAAALEAsQBB0u8AC1exALEAsQCxALEAsQCxALEAsQCxALEAAACxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAQcrwAAsjsQCxALEAsQAAALEAsQCxALEAsQCxAAAAsQCxAAAAAACxALEAQaDxAAsDsQCxAEGs8QALBbEAsQCxAEHS8QALB7EAsQCxALEAQfTxAAsJsQAAAAAAsQCxAEGK8gALAbEAQaryAAsBsQBB6vIACwWxALEAsQBBkPMACxMKAAoACgAKAAoACgAKAAoACgAKAEGw8wALAQoAQfDzAAsBCQBBpvQACwQKMQryAEHU9AALBbEAsQCxAEGI9QALE7EAsQAAALEAsQCxALEAsQCxALEAQaz1AAsbsQAAAAAAsQCxALEAsQCxALEAsQCxALEAsQCxAEHW9QALTwQAAACxAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACxAEAAQdD2AAsdCgAKAAoACgAKAAoACgBKAAoACgAqALEAsQCxABIAQZD3AAsxQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABB0vcACzuxALEAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACxALEAsQBBlvgACwOxALEAQaz4AAsBsQBBuvgACwWxALEAsQBByPgACwsKAAAAAAAAAAoACgBBlPkAC0MKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAEGG+gALCbEAsQAAAAAAsQBBvPoACy2xAAAAsQCxALEAsQCxALEAsQAAALEAAACxAAAAAACxALEAsQCxALEAsQCxALEAQfb6AAsZsQCxALEAsQCxALEAsQCxALEAsQAAAAAAsQBBsPsACx+xALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxAEH4+wALEbEAAACxALEAsQCxALEAAACxAEGm/AALEbEAsQCxALEAsQCxALEAsQCxAEHU/AALF7EAsQCxALEAAAAAALEAsQAAALEAsQCxAEGU/QALF7EAAACxALEAAAAAAAAAsQAAALEAsQCxAEHI/QALF7EAsQCxALEAsQCxALEAsQAAAAAAsQCxAEGA/gALMbEAsQCxAAAAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQAAALEAsQCxALEAsQCxALEAQbr+AAsBsQBByP4ACwuxAAAAAAAAALEAsQBB4P4ACz+xALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAAACxALEAsQCxALEAQdr/AAsJCgAAAAoACgAKAEH6/wALBQoACgAKAEGagAELBQoACgAKAEG6gAELlAIKAAoAAAAKAAoACgAKAAYACjEK8goACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAkAsgCyALIAsgCyABIAFAgVCBMIFgiyALIAsgCyALIAsgACAAAAAAAAAAIAAgACAAIAAgACAAMAAwAKAAoxCvIAAAkACQAJAAkACQAJAAkACQAJAAkACQCyABIEMgSgCKEICgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAJAAcAqwiuCLAIrAivCAYABAAEAAQABAAEAAoACgAKAAoACjAK8AoACgAKAAoACgACAAIAAgACAAIAAgACAAIAAgACAAMAAwAKAAoxCvIAQfCCAQtzBAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEACgAKAAAACgAKAAoACgAAAAoACgBB+IMBCwkKAAAACgAKAAoAQYyEAQsXCgAKAAoACgAKAAoAAAAKAAAACgAAAAoAQayEAQsBBABBxIQBCwMKAAoAQdCEAQsJChAKAAoACgAKAEHkhAELKwoACgAKAAoAAAAAAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoAQaKFAQsFCgAKAAoAQbCFAQvzBAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACjAK8AowCvAKMArwCjAK8AowCvAKMArwCjAK8AoACgAKMArwCpAKkAqQChAKkAqQChAKEAqQCpAKkAqQCpAKEAoAChAKEAoQChAKAAoACgAKcApwCnAKsAqwCrAKAAoACgAKEAMABAAKAAqQChAKAAoACgAKEAoQChAKEAoACpAKkAqQCpAKAAqQCgAKEAoACgAKAAoAChAKEAoQChAKEAoQChAKEAoQCgAKAAoACgAKAAoQCgAKEAowCvAKEAoQChAKEAoQCpAKEAqQChAKEAoQChAKEAoQCpAKAAoACgAKAAoACjAK8AowCvAKAAoACgAKAAoACgAKAAoACgAKEAoQCgAKEAoACjAK8AowCvAKMArwCjAK8AoACgAKMArwCjAK8AowCvAKMArwCjAK8AowCvAKMArwCjAK8AowCvAKEAoACgAKMArwCjAK8AoACgAKAAoACgAKkAoACgAKAAoACgAKAAoACgAKAAowCvAKAAoACpAKEAqQCpAKEAqQChAKEAoQChAKMArwCjAK8AowCvAKMArwCpAKAAoACgAKAAoAChAKEAoACgAKAAoACgAKAAoACgAKAAowCvAKMArwCpAKAAoACjAK8AoACgAKAAoACjAK8AowCvAKMArwCjAK8AowCvAKAAoACgAKAAoACgAKAAoACjEK8goxCvIKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoAChAKEAoACgAKAAoACgAKAAoACjEK8goACgAKAAoACgAKAAoACgAKAAoACgBB3ooBC0cKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAAACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgBB0IsBCzcKAAoACgAKAAoACgAKAAoAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAEGQjAEL3wgKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACjEK8goxCvIKMQryCjEK8goxCvIKMQryCjEK8goACgAKAAoACgAKAAoACgAKAAoAChAKAAoACjAK8AoxCvIKAAowCvAKAApQChAK0AoACgAKAAoACgAKEAoQCjAK8AoACgAKAAoACgAKkAowCvAKAAoACgAKMArwCjAK8AoxCvIKMQryCjEK8goxCvIKMQryCgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoQCgAKEAoQChAKAAoACjAK8AoACgAKAAoACgAKAAoACgAKAAoAChAKkAoQChAKMArwCgAKAAoxCvIKAAoACgAKAAoACjEK8goxCvIKMQryCjEK8goxCvIKcQoyCvEKsgoxCvIKMQryCjEK8goxCvIKAAoACpAKEAoQChAKEAqQCgAKEAqQCjAK8AoQChAKMArwCjAK8AowCvAKMArwCgAKAAoACgAKAAoACgAKAAqQCgAKAAoACgAKAAoACgAKMArwChAKEAowCvAKAAoACgAKEAoACgAKAAoAChAKMArwCjAK8AoACjAK8AoACgAKMQryCjEK8goQCgAKAAoACgAKAAoQCpAKkAqQChAKAAoACgAKAAoACjAK8AqQCgAKAAoACgAKEAoACgAKAAowCvAKMArwChAKAAoQCgAKAAoACgAKAAoACgAKAAoACgAKAAoAChAKEAoQChAKEAoQChAKEAoQChAKEAoQChAKEAoQChAKEAoQChAKAAoQChAKEAoQCgAKAAoQCgAKEAoACgAKEAoACjAK8AowCvAKAAoACgAKAAoACjAK8AoACgAKAAoACgAKAAowCvAKEAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoQChAKAAoACgAKAAoACgAKAAowCvAKAAoACgAKAAoQChAKEAoQCgAKEAoQCgAKAAoQChAKAAoACgAKAAowCvAKMArwCjAK8AowCvAKMArwCjAK8AowCvAKMArwCjAK8AowCvAKMArwCjAK8AowCvAKMArwCjAK8AowCvAKMArwCjAK8AowCvAKEAoACgAKMArwCjAK8AowCvAKMArwCgAKMArwCjAK8AowCvAKMArwCjAK8AowCvAKMArwCjAK8AowCvAKMArwCjAK8AowCvAKAAoACgAKAAoAChAKAAqQCgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoAAAAAAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAAACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKkAoAQfqUAQsLCgAKAAoACgAKAAoAQY6VAQsFsQCxALEAQaKVAQsNCgAKAAoACgAKAAoACgBB7pUBC4cBsQAKAAoACjAK8AowCvAKAAoACgAKMArwCgAKMArwCgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAowCvAKAAoACjAK8AoxCvIKMQryCjEK8goxCvIKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAEGQlwELYwoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgBBmJgBCxcKAAoACgAKAAoACgAKAAoACgAKAAoACgBBuJgBCwEKAEHMmAELDbEAsQCxALEAAAAAAAoAQeSYAQsDCgAKAEHymAELRQoACgAKAAkACgAKAAoACgAAAAAAAAAKMQryCjEK8goxCvIKMQryCjEK8goACgAKMQryCjEK8goxCvIKMQryCgAKAAoACgBB6pkBCwexALEACgAKAEGYmgELHwoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoAQfCaAQsFCgAKAAoAQZqbAQsdCgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoAQdCbAQsHCgAKAAoACgBBhpwBCwcKAAoACgAKAEGqnAELBQoACgAKAEHWnAELIbEAsQCxALEACgCxALEAsQCxALEAsQCxALEAsQCxAAoACgBBiJ0BCwEKAEG8nQELCbEAAAAAAAAAsQBBzp0BCwGxAEH6nQELD7EAsQAAAAoACgAKAAoAsQBBoJ4BCwMEAAQAQbCeAQsvQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAYAAAAAoACgAKAAoAQfCeAQsjsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAQa6fAQsBsQBBvJ8BCw+xALEAsQCxALEAsQCxALEAQfafAQsVsQCxALEAsQCxALEAsQCxALEAsQCxAEG2oAELFbEAAAAAALEAsQCxALEAAAAAALEAsQBB4qABCxuxALEAsQCxALEAsQAAAAAAsQCxAAAAAACxALEAQZahAQsBsQBBqKEBCwGxAEHQoQELEbEAAACxALEAsQAAAAAAsQCxAEHsoQELA7EAsQBBiKIBCwOxALEAQZyiAQsBsQBBtKIBCwMKAAoAQeKiAQsHsQAAAAAAsQBB8qIBCwGxAEGYowELXwEAAQABAAEAAQABAAEAAQABAAMAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAEGypAEL2QEBALEAAQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQAKAAoADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ACgANAA0AsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQAKAAoACgAKAAoACgAKAAoACgAKAEGYpgELd7EAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAGAAoABgAAAAoABgAKAAoACgAKMQryCjEK8goxCvIEAAoACgADAAMACjAK8AoAAAAKAAQABAAKAEGYpwELgQENAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANALIAAAAKAAoABAAEAAQACgAKAAoxCvIKAAMABgADAAYABgACAAIAAgACAAIAAgACAAIAAgACAAYACgAKUAoACtAKAAoAQc6oAQsVClEKAArSCgAKMQryCgAKMQryCgAKAEGYqQELQwQABAAKAAoACgAEAAQAAAAKAAoACgAKAAoACgAKAAAAEgASABIAEgASABIAEgASABIAqgCqAKoACgAKABIAEgAAAAoAQZiqAQt3CgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAAAAAAAALEAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAQbyrAQsJsQCxALEAsQCxAEHQqwELtwcBAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAoAAQCxALEAsQABALEAsQABAAEAAQABAAEAsQCxALEAsQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQCxALEAsQABAAEAAQABALEAQQCBAAEAAQCBALEAsQABAAEAAQABAEEAQQBBAEEAgQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAEEAQQBBAEEAQQCBAAEAgQABAIEAgQABAAEAYQCBAIEAgQCBAIEAQQBBAEEAQQBhAEEAQQBBAEEAQQCBAEEAQQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAoACgAKAAoACgAKAAoAQQCBAEEAgQCBAIEAQQBBAEEAgQBBAEEAgQBBAIEAgQBBAIEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAgQCBAIEAgQBBAEEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAE0ATQCNAE0AsQCxALEAsQANAA0ADQANAA0ADQANAA0ABQAFAAUABQAFAAUABQAFAAUABQANAA0ADQANAA0ADQBtAE0ATQBNAE0ATQBNAE0ATQBNAE0ATQBNAE0ATQBNAE0ATQBNAE0ATQBNAE0ATQBNAE0ATQBNAE0ATQBNAE0ABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABAAEAAQABAAEAAQABAAEAAQABAAEAAQCxALEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQBNAE0ATQCNAE0ATQBNAE0ATQBNAE0ATQBNAE0ATQBNAE0ADQCxALEAsQCxALEAsQCxALEAsQCxALEATQBNAE0AjQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAQQABAEEAQQCBAIEAgQABAEEAgQCBAEEAQQCBAEEAQQABAEEAgQCBAEEAAQABAAEAAQCBAEEAYQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAQbizAQsVsQCxALEAsQCxALEAsQCxALEAsQCxAEHkswELHwoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoAQba0AQsPsQCxALEAsQAAAAAAsQCxAEHWtAELG7EAsQCxALEAsQAAALEAsQCxALEAsQCxALEAsQBBnrUBCwGxAEHMtQELEbEAsQCxALEAsQCxALEAsQCxAEHytQELDbEAsQCxALEAAAAAALEAQaa2AQsRsQCxALEAAAAAALEAAACxALEAQcS2AQsBsQBBzrYBCw+xALEAsQCxALEAsQCxALEAQYy3AQsdsQCxALEAsQCxALEAsQAAAAAAAACxALEAsQCxALEAQcS3AQsJsQCxALEAAACxAEH8twELAbEAQaa4AQsPsQCxALEAsQCxALEAAACxAEG+uAELCbEAsQAAALEAsQBBhLkBCwexALEAsQCxAEGYuQELCbEAsQAAALEAsQBB2LkBCwOxALEAQYa6AQszsQCxALEAsQCxALEAsQCxAAAAAACxAAAAsQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAEHmugELGbEAAACxAAAAAACxALEAsQCxALEAsQAAALEAQZS7AQsTsQCxALEAsQAAALEAsQCxALEAsQBB1rsBCxexALEAsQCxALEAsQCxALEAsQAAALEAsQBBprwBCwexALEAAACxAEG2vAELAbEAQfC8AQsPsQCxALEAsQAAAAAAsQCxAEGKvQELE7EAsQCxALEAsQCxAKAAoACxALEAQc69AQsXsQCxALEAsQCxALEAAAAAALEAsQCxALEAQfa9AQsBsQBBir4BCxWxALEAsQCxALEAsQAAAAAAsQCxALEAQbS+AQsfsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQAAALEAsQBB+L4BC02xALEAsQCxALEAsQCxAAAAsQCxALEAsQCxALEAAACgALEAsQCxALEAsQCxALEAsQAAAAAAsQCxALEAsQCxALEAsQAAALEAsQAAALEAsQBB7L8BCxuxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAQarAAQstsQCxALEAsQCxALEAAAAAAAAAsQAAALEAsQAAALEAsQCxALEAsQCxALEAAACxAEGIwQELD7EAsQAAAAAAAACxAAAAsQBBqMEBCyMEAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgBB+sEBCxUKAAoACgAKAAoACgAKAAoABAAEAAQAQbDCAQsRoACgAKAAoACgAKAAoACgAKAAQejCAQsJsQCxALEAsQCxAEGYwwELDbEAsQCxALEAsQCxALEAQcbDAQsHsQCxALEAsQBB7MMBCwUKAAAAsQBBqMQBCweyALIAsgCyAEHuxAELBbEAsQCxAEGGxQELMbIAsgCyALIAsgCyALIAsgCxALEAsQCxALEAsQCxALEAAAAAALEAsQCxALEAsQCxALEAQeTFAQsHsQCxALEAsQBBkMYBCwsKAAoAsQCxALEACgBB1sYBCwIKEABBgscBCwIKEABBtscBCwIKEABBzMcBC3ECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQBBxsgBCxuxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAQfLIAQsBsQBBiMkBCwGxAEG2yQELKbEAsQCxALEAsQAAALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxAEGAygELVbEAsQCxALEAsQCxALEAAACxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAsQCxALEAAAAAALEAsQCxALEAsQCxALEAAACxALEAAACxALEAsQCxALEAQYDLAQsHsQCxALEAsQBBpssBC5ECBAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABALEAsQCxALEAsQCxALEAAQABAAEAAQABAAEAAQABAAEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBALEAsQCxALEAsQCxALEAoQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQAKAAoADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAAoACgAKAAoACgAKAAoACgAKAAoACgAKAEHAzQELhwEKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAIAAgACAAIAAgACAAIAAgACAAIAAgAKAAoACgAKAAoAQezOAQsLCgAKAAoACgAKAAoAQZrPAQsBCgBBwM8BCzEKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAEGA0AELDwoACgAKAAoACgAKAAoACgBBoNABCxMKAAoACgAKAAoACgAKAAoACgAKAEHA0AELDwoACgAKAAoACgAKAAoACgBB4NABCysKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAACgAKAEGo0QELbQoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAAAAAAKAAoACgAKAAoAAAAAAAAACgAKAAoAQaDSAQsNCgAKAAoACgAKAAoACgBBwNIBCyEKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoAQfDSAQsNCgAKAAoACgAKAAoACgBBmNMBCw0KAAoACgAKAAoACgAKAEG40wELPwoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgBBmNQBCxMCAAIAAgACAAIAAgACAAIAAgACAEHs1AELywESABIAsgCyALIAsgCyALIAsgCyALIAsgCyALIAsgCyALIAsgCyALIA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ApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACjMRQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAoABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB3MRAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAdzEY0EjQSNBI0EjQSNBI0EjQSNBI0EjQSNBI0EjQSNBI0EjQSNBI0EjQSNBI0EjQSNBI0EjQSNBI0EjQSNBI0EjQSNBI0EjQSNBI0EjQSNBI0EjQSNBI0EjQSNBI0EjQSNBI0EjQSNBI0EjQSNBI0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AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAXABUAGgAWABoAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABQAGAAVABgADwBBqKACC9cKDwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAwAFwAZABkAGQAZABsAFwAaABsABQAcABgAEAAbABoAGwAYAEsDiwMaAAIAFwAXABoACwMFAB0AyzRLNMs8FwABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAGAABAAEAAQABAAEAAQABAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgAAgACAAIAAgACAAIAAgACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgACAAEAAgABAAIAAQACAAEAAgACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQABAAIAAQACAAEAAgACAAIAAQABAAIAAQACAAEAAQACAAEAAQABAAIAAgABAAEAAQABAAIAAQABAAIAAQABAAEAAgACAAIAAQABAAIAAQABAAIAAQACAAEAAgABAAEAAgABAAIAAgABAAIAAQABAAIAAQABAAEAAgABAAIAAQABAAIAAgAFAAEAAgACAAIABQAFAAUABQABAAMAAgABAAMAAgABAAMAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAgABAAMAAgABAAIAAQABAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAgACAAIAAgACAAIAAQABAAIAAQABAAIAAgABAAIAAQABAAEAAQACAAEAAgABAAIAAQACAAEAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAFAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEABoAGgAaABoABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaAAQABAAEAAQABAAaABoAGgAaABoAGgAaAAQAGgAEABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAEAAgABAAIABAAaAAEAAgAAAAAABAACAAIAAgAXAAEAQYirAgvHBxoAGgABABcAAQABAAEAAAABAAAAAQABAAIAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAQABAAEAAQABAAEAAQABAAEAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAEAAgACAAEAAQABAAIAAgACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAIAAgACAAIAAQACABgAAQACAAEAAQACAAIAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAGwAGAAYABgAGAAYABwAHAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAAAAAAQAFwAXABcAFwAXABcAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAFwATAAAAAAAbABsAGQAAAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGABMABgAXAAYABgAXAAYABgAXAAYAQeCyAgs1BQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAQZ6zAgsLBQAFAAUABQAXABcAQcCzAgvLBRAAEAAQABAAEAAQABgAGAAYABcAFwAZABcAFwAbABsABgAGAAYABgAGAAYABgAGAAYABgAGABcAEAAAABcAFwAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAFAAUABQAFAAUABQAFAAUABQAFAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAEkAiQDJAAkBSQGJAckBCQJJAokCFwAXABcAFwAFAAUABgAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFABcABQAGAAYABgAGAAYABgAGABAAGwAGAAYABgAGAAYABgAEAAQABgAGABsABgAGAAYABgAFAAUASQCJAMkACQFJAYkByQEJAkkCiQIFAAUABQAbABsABQAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAAAAQAAUABgAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABgAGAAYABgAGAAYABgAGAAYABgAGAAUAQai5AgvVAkkAiQDJAAkBSQGJAckBCQJJAokCBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABgAGAAYABgAGAAYABgAGAAYABAAEABsAFwAXABcABAAAAAAABgAZABkABgAGAAYABgAEAAYABgAGAAQABgAGAAYABgAGAAAAAAAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABgAGAAYABgAEAAYABgAGAAYABgAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAYABgAGAAAAAAAXAAAABQAFAAUABQAFAAUABQAFAAUABQAFAEGovAILfwYABgAQAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUAQb69Agu3AwYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABQAFAAYABgAXABcASQCJAMkACQFJAYkByQEJAkkCiQIXAAQABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAYABgAGAAgABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABgAIAAYABQAIAAgACAAGAAYABgAGAAYABgAGAAYACAAIAAgACAAGAAgACAAFAAYABgAGAAYABgAGAAYABQAFAAUABQAFAAUABQAFAAUABQAGAAYAAAAAAEkAiQDJAAkBSQGJAckBCQJJAokCBQAFABkAGQDLN8s1yz/LNMs8SwkbABkABQAXAAYAAAAFAAYACAAIAAAABQAFAAUABQAFAAUABQAFAAAAAAAFAAUAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUAAAAFAAAAAAAAAAUABQAFAAUAAAAAAAYABQAIAAgACAAGAAYABgAGAAAAAAAIAAgAAAAAAAgACAAGAAUAQYbBAgsBCABBkMECCwcFAAUAAAAFAEGkwQILIUkAiQDJAAkBSQGJAckBCQJJAokCBgAGAAUABQAFAAYAFwBB2sECCxMGAAYACAAAAAUABQAFAAUABQAFAEH2wQILVwUABQAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAUABQAAAAUABQA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FAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAABQAGAAYABgAIAAgACAAIAAAABgAGAAYAAAAGAAYABgAGAEHCygILCwYABgAAAAUABQAFAEHYygILJQUABQAGAAYAAAAAAEkAiQDJAAkBSQGJAckBCQJJAokCAAAFAAUAQZjLAguLAQUABgAIAAgAFwAFAAUABQAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAAAAAABgAFAAgABgAIAAgACAAIAAgAAAAGAAgACAAAAAgACAAGAAYAQbLMAgsDCAAIAEHEzAILywEFAAAABQAFAAYABgAAAAAASQCJAMkACQFJAYkByQEJAkkCiQLLB0seS3jLNEs0yzzLN8s1yz8bAAUABQAFAAUABQAFAAYABgAIAAgABQAFAAUABQAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAGAAYABQAIAAgACAAGAAYABgAGAAAACAAIAAgAAAAIAAgACAAGAAUAGwBBmM4CCxcFAAUABQAIAAvMC8pLywvJSzZLyQs1BQBBvM4CCx1JAIkAyQAJAUkBiQHJAQkCSQKJAgAAAAAIAAgAFwBB8s4CC4sBBgAIAAgAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAABgBBhtACC1cIAAgACAAGAAYABgAAAAYAAAAIAAgACAAIAAgACAAIAAgABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAYABQAFAAYABgAGAAYABgAGAAYAQebQAgs5GQAFAAUABQAFAAUABQAEAAYABgAGAAYABgAGAAYABgAXAEkAiQDJAAkBSQGJAckBCQJJAokCFwAXAEGq0QIL9wIFAAUAAAAFAAAABQAFAAUABQAFAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAAAAUABQAFAAUABQAFAAUABQAFAAUABgAFAAUABgAGAAYABgAGAAYABgAGAAYABQAAAAAABQAFAAUABQAFAAAABAAAAAYABgAGAAYABgAGAAAAAABJAIkAyQAJAUkBiQHJAQkCSQKJAgAAAAAFAAUABQAFAAUAGwAbABsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAGwAXABsAGwAbAAYABgAbABsAGwAbABsAGwBJAIkAyQAJAUkBiQHJAQkCSQKJAks0SzxLREtMS1RLXEtkS2xLdEssGwAGABsABgAbAAYAFAAVABQAFQAIAAgABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAQarUAgvLAQYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAIAAYABgAGAAYABgAXAAYABgAFAAUABQAFAAUABgAGAAYABgAGAAYABgAGAAYABgAGAAAABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAAAGwAbABsAGwAbABsAGwAbAAYAGwAbABsAGwAbABsAAAAbABsAFwAXABcAFwAXABsAGwAbABsAFwAXAEGA1gILzwIFAAUABQAFAAUABQAFAAUABQAFAAUACAAIAAYABgAGAAYACAAGAAYABgAGAAYABgAIAAYABgAIAAgABgAGAAUASQCJAMkACQFJAYkByQEJAkkCiQIXABcAFwAXABcAFwAFAAUABQAFAAUABQAIAAgABgAGAAUABQAFAAUABgAGAAYABQAIAAgACAAFAAUACAAIAAgACAAIAAgACAAFAAUABQAGAAYABgAGAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABgAIAAgABgAGAAgACAAIAAgACAAIAAYABQAIAEkAiQDJAAkBSQGJAckBCQJJAokCCAAIAAgABgAbABsAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAFwAEAAIAAgACAAEAAQABAAEAAQABAAAAAQBB2tgCC9kDAQAAAAAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUAAAAAAAUABQAFAAUABQAFAAUAAAAFAAAABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAFAAUAAAAFAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAFAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAABQAAAAUABQAFAAUAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAYABgAGABcAFwAXABcAFwAXABcAFwAXAAsDSwOLA8sDCwRLBIsEywQLBcsHSwrLDEsPyxFLFMsWSxnLG0sei3gAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFABsAGwAbABsAGwAbABsAGwAbABsAQcDcAguZAgEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAAAAAAIAAgACAAIAAgACAAAAAAATAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAbABcABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAwABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFABQAFQAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAFwAXABcAignKCQoKBQAFAAUABQAFAAUABQAFAEHo3gILKQUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAFAAUABQAFAAYABgAGAEGo3wILLQUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAYABgAGABcAFwBB6N8CCycFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAGAAYAQajgAgsnBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAAABgAGAEHo4AILlAEFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABgAGAAgABgAGAAYABgAGAAYABgAIAAgACAAIAAgACAAIAAgABgAIAAgABgAGAAYABgAGAAYABgAGAAYABgAGABcAFwAXAAQAFwAXABcAGQAFAAYAAAAAAEkAiQDJAAkBSQGJAckBCQJJAokCAEGI4gILFEsFiwXLBQsGSwaLBssGCwdLB4sHAEGo4gILFQUABQAFAAUABQAFAAUABQAFAAYABQBByOICC1QFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFABcAFwAXABcAFwAXABMAFwAXABcAFwAGAAYABgAQAAAASQCJAMkACQFJAYkByQEJAkkCiQIAQajjAgtBBQAFAAUABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAQfjjAgtDBQAFAAUABQAFAAYABgAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQBB0OQCCxcGAAYABgAIAAgACAAIAAYABgAIAAgACABB8OQCCxcIAAgABgAIAAgACAAIAAgACAAGAAYABgBBkOUCC4kBGwAAAAAAAAAXABcASQCJAMkACQFJAYkByQEJAkkCiQIFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAFAAUABQAFAAUAQbDmAgsXBQAFAAUABQAFAAUABQAFAAUABQAFAAUAQdDmAgsjBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAQYDnAgv0AkkAiQDJAAkBSQGJAckBCQJJAokCCwMAAAAAAAAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAGAAYACAAIAAYAAAAAABcAFwAXABcAFwAXABcAFwAXAAQAFwAXABcAFwAXABcAAAAAAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAHAAYABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUACAAGAAgABgAGAAYABgAGAAYABgAAAAYACAAGAAgACAAGAAYABgAGAAYABgAGAAYACAAIAAgACAAIAAgABgAGAAYABgAGAAYABgAGAAYABgAAAAAABgBJAIkAyQAJAUkBiQHJAQkCSQKJAgBBgOoCCxRJAIkAyQAJAUkBiQHJAQkCSQKJAgBBoOoCC0EXABsAGwAbABsAGwAbABsAGwAbABsABgAGAAYABgAGAAYABgAGAAYAGwAbABsAGwAbABsAGwAbABsAAAAAAAAABgBBoOsCC28GAAYABgAGAAgABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABgAIAAYABgAGAAYABgAIAAYACAAIAAgACAAIAAYACAAIAAUABQAFAAUABQAFAAUAQZjsAgu/AUkAiQDJAAkBSQGJAckBCQJJAokCFwAXABcAFwAXABcABQAIAAYABgAGAAYACAAIAAYABgAIAAYABgAGAAUABQBJAIkAyQAJAUkBiQHJAQkCSQKJAgUABQAFAAUABQAFAAYABgAIAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABgAIAAYABgAIAAgACAAGAAgABgAGAAYACAAIAEHo7QIL0QEXABcAFwAXAEkAiQDJAAkBSQGJAckBCQJJAokCAAAAAAAABQAFAAUASQCJAMkACQFJAYkByQEJAkkCiQIFAAUABQAFAAUABQAIAAgACAAIAAgACAAIAAgABgAGAAYABgAGAAYABgAGAAgACAAGAAYAAAAAAAAAFwAXABcAFwAXAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAQABAAEAAQABAAEABcAFwACAAIAAgACAAIAAgACAAIAAgBByO8CC08BAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAQABAAEAFwAXABcAFwAXABcAFwAXAEGo8AILVQYABgAGABcABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAIAAYABgAGAAYABgAGAAYABQAFAAUABQAGAAUABQAFAAUABQAFAAYABQAFAAgABgAGAAUAQYjxAgufCQIAAgACAAIAAgACAAIAAgACAAIAAgACAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAQAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIABAAEAAQABAAEAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAAAAYABgAGAAYABgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAIAAgACAAIAAgACAAIAAgABAAIAAgACAAIAAgACAAIAAgACAAEAAQABAAEAAQAaABoAGgAAAAAAAgACAAIAAAACAAIAAQABAAEAAQADABoAGgAAAAIAAgACAAIAAgACAAIAAgABAAEAAQABAAEAAQABAAEAAgACAAIAAgACAAIAAAAAAAEAAQABAAEAAQABAAAAAAACAAIAAgACAAIAAgACAAIAAQABAAEAAQABAAEAAQABAAIAAgACAAIAAgACAAIAAgABAAEAAQABAAEAAQABAAEAAgACAAIAAgACAAIAAAAAAAEAAQABAAEAAQABAAAAAAACAAIAAgACAAIAAgACAAIAAAABAAAAAQAAAAEAAAABAAIAAgACAAIAAgACAAIAAgABAAEAAQABAAEAAQABAAEAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAAAAAACAAIAAgACAAIAAgACAAIAAwADAAMAAwADAAMAAwADAAIAAgACAAIAAgACAAIAAgADAAMAAwADAAMAAwADAAMAAgACAAIAAgACAAAAAgACAAEAAQABAAEAAwAaAAIAGgAaABoAAgACAAIAAAACAAIAAQABAAEAAQADABoAGgAaAAIAAgACAAIAAAAAAAIAAgABAAEAAQABAAAAGgAaABoAFgAXABcAFwAYABQAFQAXABcAFwAXABcAFwAXABcAFwAXABcAGAAXABYAFwAXABcAFwAXABcAFwAXABcAFwAMABAAEAAQABAAEAAAABAAEAAQABAAEAAQABAAEAAQABAAywIEAAAAAADLAwsESwSLBMsECwUYABgAGAAUABUABAAMAAwADAAMAAwADAAMAAwADAAMAAwAEAAQABAAEAAQABMAEwATABMAEwATABcAFwAcAB0AFAAcABwAHQAUABwAFwAXABcAFwAXABcAFwAXAA0ADgAQABAAEAAQABAADAAXABcAFwAXABcAFwAXABcAFwAcAB0AFwAXABcAFwAWAMsCCwNLA4sDywMLBEsEiwTLBAsFGAAYABgAFAAVAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAGQAZABkAQcj6AgtBBgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAHAAcABwAHAAYABwAHAAcABgAGAAYABgAGAAYABgAGAAYABgAGAAYAQaj7AguXAhsAGwAbABsAAQAbAAEAGwABABsAAQABAAEAAQAbAAIAAQABAAEAAQACAAUABQAFAAUAAgAbABsAAgACAAEAAQAYABgAGAAYABgAAQACAAIAAgACABsAGAAbABsAAgAbAIs1CzZLNos0izgLNQs5Cz0LQUs1S0XLNcs9y0XLTYsFGwAbAAEAGwAbABsAGwABABsAGwACAAEAAQABAAIAAgABAAEAAQACABsAAQAbABsAGAABAAEAAQABAAEAGwAbAIoFygUKBkoGigbKBgoHSgeKB8oHCghKCMoRSh4KmEp4igXKBQoGSgaKBsoGCgdKB4oHygcKCEoIyhFKHgqYSnhKeEqYingBAAIAygbKEYqYynhLBRsAGwBByP0CC/0EGAAYABgAGAAYABsAGwAbABsAGwAYABgAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGwAbABgAGwAbABgAGwAbABsAGwAbABsAGwAYABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGAAYABsAGwAYABsAGAAbABsAGwAbABsAGwAbABsAGwAbABsAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABsAGwAbABsAGwAbABsAGwAUABUAFAAVABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAYABgAGwAbABsAGwAbABsAGwAUABUAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABgAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAYABgAGAAYABgAGAAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwBB+IIDC78JGwAbABsAGwAbABsAGwAbABsAGwDLAgsISwiLCMsICwlLCYsJywkLCksKCwNLA4sDywMLBEsEiwTLBAsFywfLAgsDSwOLA8sDCwRLBIsEywQLBcsHCwhLCIsIywgLCUsJiwnLCQsKSwoLA0sDiwPLAwsESwSLBMsECwXLBwsISwiLCMsICwlLCYsJywkLCksKGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGAAYABgAGAAYABgAGAAYABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAYABsAGwAbABsAGwAbABsAGwAbABgAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGAAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABQAFQAUABUAFAAVABQAFQAUABUAFAAVABQAFQALA0sDiwPLAwsESwSLBMsECwXLBwsDSwOLA8sDCwRLBIsEywQLBcsHCwNLA4sDywMLBEsEiwTLBAsFywcbABsAGwAbABsAGwAbABsAGwAbABsAGwAYABgAGAAYABgAFAAVABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABQAFQAUABUAFAAVABQAFQAUABUAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAUABUAFAAVABQAFQAUABUAFAAVABQAFQAUABUAFAAVABQAFQAUABUAFAAVABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABQAFQAUABUAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAUABUAGAAYABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABsAGwAYABgAGAAYABgAGAAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAAAAAABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAAAGwAbABsAGwAbABsAGwAbABsAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAAAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgABAAIAAQABAAEAAgACAAEAAgABAAIAAQACAAEAAQABAAEAAgABAAIAAgABAAIAAgACAAIAAgACAAQABAABAAEAAQACAAEAAgACABsAGwAbABsAGwAbAAEAAgABAAIABgAGAAYAAQACAEHCjAMLHRcAFwAXABcASzQXABcAAgACAAIAAgACAAIAAAACAEHqjAMLJQIAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAQZ6NAwsDBAAXAEG+jQMLbwYABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQBBwI4DC6UBFwAXABwAHQAcAB0AFwAXABcAHAAdABcAHAAdABcAFwAXABcAFwAXABcAFwAXABMAFwAXABMAFwAcAB0AFwAXABwAHQAUABUAFAAVABQAFQAUABUAFwAXABcAFwAXAAQAFwAXABcAFwAXABcAFwAXABcAFwATABMAFwAXABcAFwATABcAFAAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABsAGwAXAEGAkAMLXxsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAAABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAEH4kAMLKxsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAQciRAwsXGwAbABsAGwAbABsAGwAbABsAGwAbABsAQeiRAwv/ARsAigXKBQoGSgaKBsoGCgdKB4oHBgAGAAYABgAIAAgAEwAEAAQABAAEAAQAGwAbAMoHSgrKDAQABQAXABsAGwAMABcAFwAXABsABAAFAEoFFAAVABQAFQAUABUAFAAVABQAFQAbABsAFAAVABQAFQAUABUAFAAVABMAFAAVABUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAGAAYAGgAaAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFABcABAAEAAQABQBB8pMDC30FAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAGwAbAIsFywULBksGGwAbABsAGwAbABsAGwAbABsAGwBBiJUDC70QBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQCLBcsFCwZLBosGywYLB0sHiwfLBxsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAywdLCssMSw/LEUsUyxZLGRsAiwrLCgsLSwuLC8sLCwxLDIsMywwLDUsNiw3LDQsOGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAEsOiw7LDgsPSw+LD8sPCxBLEIsQyxALEUsRixHLEQUABQAFAAUABQCFBgUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQDFBQUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAIUGBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFBwUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAIUFBQAFAAUHBQAFAAUAhXgFAAUGBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQCFBwUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQDFBQUABQAFAAUABQAFAAUAhQYFAEUGBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAIV5xQcFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQBFeAUABQAFAAUABQAFAAUABQAFBgUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAIUGBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUARR4FAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQCFeQUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQCFegUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQDFBQUARQcFAMUGBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQDFBwUARXhFCsUMBQAFAAUABQAFAAUARQ8FAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQYFBgUGBQYFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQBFBgUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQCFBQUABQAFAAUABQAFAAUAhQUFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAIUFBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQCFB0UKBQAFAAUABQAFAAUABQAFAAUABQAFAAUAhQXFBQUGBQDFBQUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAMUHBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQBFBwUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUHBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAhQcFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAEUeBQAFAAUABQAFAAUABQBFBgUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAhXgFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQDFBQUABQAFAAUAxQUFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAMUFBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQBFeAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQDFBgUABQAFAAUABQBFHgUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAMUGBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQBFBQUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAQABQAFAAUABQAFAAUABQAFAAUABQAbABsAGwAbABsAGwAbAEHYpQMLXwUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAXABcAFwAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAEkAiQDJAAkBSQGJAckBCQJJAokCBQAFAEHgpgMLrwEBAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAQABAAGAAYAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAUABgAHAAcABwAXAAYABgAGAAYABgAGAAYABgAGAAYAFwAEAAUABQAFAAUABQAFAIoFygUKBkoGigbKBgoHSgeKB0oFBgAGABcAFwAXABcAFwAXAEGgqAMLPxoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAEAAQABAAEAAQABAAEAAQABABBiqkDC4MCAQACAAUABAAEAAIABQAFAAUABQAFABoAGgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAgACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAQAAgACAAIAAgACAAIAAgACAAEAAgABAAIAAQABAAIAAQACAAEAAgABAAIAAQACAAQAGgAaAAEAAgABAAIABQABAAIAAQACAAIAAgABAAIAAQACAAEAAgABAAIAAQACAAEAAgABAAEAAQABAAEAAgABAAEAAQABAAEAAgABAAIAAQACAAEAAgABAAIAAQACAAAAAAABAAIAAQABAAEAAQACAAEAAgBBuKsDC3MFAAUABgAFAAUABQAGAAUABQAFAAUABgAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUACAAIAAYABgAIABsAGwAbABsABgAAAAAAAADLNEs0yzzLN8s1yz8bABsAGQAbAEG4rAMLLwUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAXABcAFwAXAEH4rAMLCwgACAAIAAgABgAGAEGUrQMLGBcAFwBJAIkAyQAJAUkBiQHJAQkCSQKJAgBBuK0DC/cBCAAIAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAUABQAFAAUABQAFABcAFwAXAAUAFwAFAAUABgAFAAUABQAFAAUABQAGAAYABgAGAAYABgAGAAYAFwAXAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABgAGAAYABgAGAAYABgAGAAYABgAGAAgACABBxq8DC+8BFwAIABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAAAAEAEkAiQDJAAkBSQGJAckBCQJJAokCAAAAAAAAAAAXABcABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAGAAgACAAGAAYABgAGAAgACAAGAAYACAAIAAUABQAFAAUABQAGAAQABQAFAAUABQAFAAUABQAFAAUASQCJAMkACQFJAYkByQEJAkkCiQIFAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAGAAYABgAGAAYABgAIAAgABgAGAAgACAAGAAYAQcixAwvFAQUABQAFAAYABQAFAAUABQAFAAUABQAFAAYACAAAAAAASQCJAMkACQFJAYkByQEJAkkCiQIAAAAAFwAXABcAFwAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAQABQAFAAUABQAFAAUAGwAbABsABQAIAAYACAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAGAAUABgAGAAYABQAFAAYABgAFAAUABQAFAAUABgAGAAUABgAFAEG+swMLNwUABQAEABcAFwAFAAUABQAFAAUABQAFAAUABQAFAAUACAAGAAYACAAIABcAFwAFAAQABAAIAAYAQYq0AwsrBQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAFAAAAAAAFAAUABQAFAAUABQBByLQDC3cFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAUABQAAAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoABAAEAAQABAACAAIAAgACAAIAAgACAAIAAgAEABoAGgBByLUDC1QCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAUABQAFAAgACAAGAAgACAAGAAgACAAXAAgABgAAAAAASQCJAMkACQFJAYkByQEJAkkCiQIAQai2AwsHBQAFAAUABQBByLYDCzcFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAEGItwMLDQUABQAFAAUABQAFAAUAQZ63AwuHBAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgASABIAEgARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEAEQARABEABQAFAAUABQAFAAUABQAFAAUABQAFAAUGBQAFAAUABQAFAAUABQDFBwUABQAFAAUAxQUFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAxQYFAMUGBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAMUHBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFABgABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAgACAAIAAgACAAIAAgBBvrsDCwkCAAIAAgACAAIAQdK7AwtJBQAGAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgBBvrwDC0EFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFABUAFABBoL0DCz8FAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAQZC+AwtTBQAFAAUABQAFAAUABQAFAAUABQAFAAUAGQAbAAAAAAAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGABcAFwAXABcAFwAXABcAFAAVABcAQfC+AwuPAQYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAFwATABMAFgAWABQAFQAUABUAFAAVABQAFQAUABUAFAAVABcAFwAUABUAFwAXABcAFwAWABYAFgAXABcAFwAAABcAFwAXABcAEwAUABUAFAAVABQAFQAXABcAFwAYABMAGAAYABgAAAAXABkAFwAXAEGIwAMLrQEFAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAQAAAAAAAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAFAAAAAAAFAAUABQAAAAAAAAAZABkAGAAaABsAGQAZAAAAGwAYABgAGAAYABsAGwBBysEDC+MDEAAQABAAGwAbAAAAAAAAABcAFwAXABkAFwAXABcAFAAVABcAGAAXABMAFwAXAEkAiQDJAAkBSQGJAckBCQJJAokCFwAXABgAGAAYABcAGgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAFAAYABUAGAAUABUAFwAUABUAFwAXAAUABQAFAAUABQAFAAUABQAFAAUABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEAAQABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAEG4xQMLRQuwC7hLeEuAS4hLkEuYS6BLqEuwS7iLeIuAi4iLkIuYi6CLqIuwi7gAAAAAAAAbABsAGwAbABsAGwAbABsAGwAXABcAFwBBhsYDC+sBiwXLBQsGSwaLBssGCwdLB4sHywdLCssMSw/LEUsUyxZLGcsbSx4LgAuIC5ALmAugC6jKB8oHygfKB8oHygzKEcoRyhHKEUoeCogKmAqYCpgKmAqYSnhKmIoGyhFLNEs0izjLPBsAGwAbABsAGwAbABsAGwAbABsAGwAbABsASwXLNBsAGwAbAAAAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAAAAAAAADKNEo0igWKBsoRCphKmIqYigbKB8oRSh4KmEp4SpiKBsoHyhFKHgqYSniKeIqYygeKBYoFigXKBcoFygXKBYoGGwBBsMgDC2EbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsABgAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAEGwyQMLSAYAiwXLBQsGSwaLBssGCwdLB4sHywdLCssMSw/LEUsUyxZLGcsbSx4LgAuIC5ALmAugC6gLsAu4AAAAAAAAAACLBYsGywfLEQBBisoDCzwFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAyhsFAAUABQAFAAUABQAFAAUACrgAQdDKAws1BQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAGAAYABgAGAAYAQZDLAwtHBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAXAAUABQAFAAUAQeDLAwscBQAFAAUABQAFAAUABQAFABcAigXKBcoHSgpKHgBBkMwDC3QCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAABJAIkAyQAJAUkBiQHJAQkCSQKJAgBBkM0DC1cBAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAQfDNAwsnAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAEGgzgMLHwIAAgACAAIAAgACAAIAAgAFAAUABQAFAAUABQAFAAUAQdDOAwsfBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQBBhs8DCwEXAEGozwML2AEFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAAAAAAAAAUAAAAAAAUABQAFAAUABQAFAAUAAAAAAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAABcAiwXLBQsGywdLCkseS3iLeAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAbABsAiwXLBQsGSwaLBssHSwoAQY7RAwsSiwXLBQsGSwZLBosGywdLCkseAEHA0QMLKwUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAFAAUAQfbRAwt9iwWLBssHSwpLHgUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAiwXLB0sKSx7LBQsGAAAAAAAAFwAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAQf7SAwtxFwBLoEuoS7BLuIt4i4CLiIuQi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LbQUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABgAGAAYABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAYAFwAXAAUAQdjjAwuqAQgABQAFAAUABQAXABcAFwAXAAYABgAGAAYAFwAIAAYASQCJAMkACQFJAYkByQEJAkkCiQIFABcABQAXABcAFwAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAgACAAIAAYABgAGAAYABgAGAAYABgAGAAgAAACLBcsFCwZLBosGywYLB0sHiwfLB0sKywxLD8sRSxTLFksZyxtLHkt4AEGY5QMLywEFAAUABQAFAAUABQAFAAUABQAFAAUABQAIAAgACAAGAAYABgAIAAgABgAIAAYABgAXABcAFwAXABcAFwAGAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUAFwBB8OYDCzUFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAgACAAIAAYABgAGAAYABgAGAAYABgBBsOcDCxRJAIkAyQAJAUkBiQHJAQkCSQKJAgBB0OcDCykFAAUACAAIAAAAAAAGAAYABgAGAAYABgAGAAAAAAAAAAYABgAGAAYABgBBkOgDC5EBBgAGAAgACAAAAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAAABQAFAAAABQAFAAUABQAFAAAABgAGAAUACAAIAAYACAAIAAgACAAAAAAACAAIAAAAAAAIAAgACAAAAAAABQBBrukDCwEIAEG66QMLiQEFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAIAAgACAAGAAYABgAGAAYABgAGAAYACAAIAAYABgAGAAgABgAFAAUABQAFABcAFwAXABcAFwBJAIkAyQAJAUkBiQHJAQkCSQKJAhcAFwAAABcABgAFAAUABQBBgOsDC08FAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAgACAAIAAYABgAGAAYABgAGAAgABgAIAAgACAAIAAYABgAIAAYABgAFAAUAFwAFAEHg6wMLFEkAiQDJAAkBSQGJAckBCQJJAokCAEGA7AMLyQEFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAIAAgACAAGAAYABgAGAAAAAAAIAAgACAAIAAYABgAIAAYABgAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcABQAFAAUABQAGAAYAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUACAAIAAgABgAGAAYABgAGAAYABgAGAAgACAAGAAgABgAGABcAFwAXAAUAQeDtAwsUSQCJAMkACQFJAYkByQEJAkkCiQIAQYDuAwsZFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwBBwO4DCxRJAIkAyQAJAUkBiQHJAQkCSQKJAgBBgO8DCzEFAAUABQAFAAUABQAFAAUABQAFAAUABgAIAAYACAAIAAYABgAGAAYABgAGAAgABgAFAEHA7wMLFwgACAAGAAYABgAGAAgABgAGAAYABgAGAEHg7wMLV0kAiQDJAAkBSQGJAckBCQJJAokCywdLChcAFwAXABsABQAFAAUABQAFAAUABQAFAAUABQAFAAUACAAIAAgABgAGAAYABgAGAAYABgAGAAYACAAGAAYAFwBBwPADCyZJAIkAyQAJAUkBiQHJAQkCSQKJAssHSwrLDEsPyxFLFMsWSxnLGwBB/vADCw8FAAgABQAIAAYAFwAXABcAQaDxAwsUSQCJAMkACQFJAYkByQEJAkkCiQIAQcDxAwt5BQAFAAUABQAFAAUABQAAAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAAABQAFAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAIAAgACAAIAAgACAAAAAgACAAAAAAABgAGAAgABgAFAAYABQAXAAUACABB8PIDC68BBQAFAAUABQAFAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUACAAIAAgABgAGAAYABgAAAAAABgAGAAgACAAIAAgABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAGAAYABgAGAAYABgAIAAUABgAGAAYABgAXABcAFwAXABcAFwAXABcABgBBsPQDC2UFAAYABgAGAAYABgAGAAgACAAGAAYABgAFAAUABQAFAAUABgAGAAYABgAGAAYABgAGAAYABgAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAXABcAFwBB0PUDC0sFAAUABQAFAAUABQAFAAUABQAFAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYACAAGAAYAFwAXABcABQAXABcABQAXABcAFwAXABcAQbD2AwvlAUkAiQDJAAkBSQGJAckBCQJJAokCiwXLBQsGSwaLBssGCwdLB4sHywdLCssMSw/LEUsUyxZLGcsbSx4AAAAAAAAXABcABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAgABgAGAAYABgAGAAYABgAAAAYABgAGAAYABgAGAAgABgAGAAYABgAGAAYABgAGAAYAAAAIAAYABgAGAAYABgAGAAYACAAGAAYACAAGAAYAQaj4AwtHBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAFAAYAQYD5AwsUSQCJAMkACQFJAYkByQEJAkkCiQIAQaD5AwuRAQUABQAFAAUABQAFAAUAAAAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAYABgAGAAYABgAGAAAAAAAAAAYAAAAGAAYAAAAGAA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AAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAEGSgwQLOwUABQAFAEsFiwXLBQsGSwaLBssGCwdLB4sHywcLCEsIiwjLCAsJSwmLCcsJCwqLBcsFCwYXABcAFwAXAEHYgwQLFQUABQAFAAUABQAFAAUABQAFAAUABQBB9oMEC0kGAAUACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEHOhAQLKwYABgAGAAYABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAFwAEAAYAQZCFBAsDCAAIAEGwhQQLLwUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAEGAhgQLBQUABQAFAEGghgQLBwUABQAFAAUAQbiGBAslBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQBB6IYECxkFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAEGQhwQLJwUABQAFAAUABQAFAAUABQAFAAUAAAAAABsABgAGABcAEAAQABAAEABB8IcEC+kBGwAbABsAGwAbABsAGwAAAAAAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsACAAIAAYABgAGABsAGwAbAAgACAAIAAgACAAIABAAEAAQABAAEAAQABAAEAAGAAYABgAGAAYABgAGAAYAGwAbAAYABgAGAAYABgAGAAYAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAGAAYABgAGABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAQYiKBAsLGwAbAAYABgAGABsAQciKBAsoSwWLBcsFCwZLBosGywYLB0sHiwfLBwsISwiLCMsICwlLCYsJywkLCgBBiIsECzKLBcsFCwZLBosGywYLB0sHiwfLB0sKywxLD8sRSxTLFksZyxuLBcsFCwZLBosGiwWLBgBByIsEC/8ISQKJAkkAiQDJAAkBSQGJAckBCQJJAokCSQCJAMkACQFJAYkByQEJAkkCiQJJAIkAyQAJAUkBiQHJAQkCSQKJAgEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACAAIAAgACAAIAAgACAAAAAgACAAIAAgACAAIAAgACAAIAAgABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAEAAAABAAEAAAAAAAEAAAAAAAEAAQAAAAAAAQABAAEAAQAAAAEAAQABAAEAAQABAAEAAQACAAIAAgACAAAAAgAAAAIAAgACAAIAAgACAAIAAAACAAIAAgACAAIAAgACAAIAAgACAAIAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACAAIAAgACAAEAAQAAAAEAAQABAAEAAAAAAAEAAQABAAEAAQABAAEAAQAAAAEAAQABAAEAAQABAAEAAAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAQABAAAAAQABAAEAAQAAAAEAAQABAAEAAQAAAAEAAAAAAAAAAQABAAEAAQABAAEAAQAAAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAIAAgACAAIAAgACAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABgAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAYAAIAAgACAAIAAgACAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAGAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAYAAIAAgACAAIAAgACAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAgACAAIAGAACAAIAAgACAAIAAgABAAIAAAAAAEkAiQDJAAkBSQGJAckBCQJJAokCSQCJAMkACQFJAYkByQEJAgAABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAQeiUBAuHAQYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAbABsAGwAbAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAbABsAGwAbABsAGwAbABsABgAbABsAGwAbABsAGwAbABsAGwAbAAYAGwAbABcAFwAXABcAFwBBjpYEC1cGAAYABgAGAAYABgAGAAYAAAAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAAAAAAAYABgAGAAYABgAGAAYAAAAGAAYAAAAGAAYABgAGAAYAQZCXBAsfSQCJAMkACQFJAYkByQEJAkkCiQIAAAAAAAAAAAUAGwBB0JcEC3QFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAYABgAGAAYABgAGAAYABAAEAAQABAAEAAQABAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABgAGAAYABgBJAIkAyQAJAUkBiQHJAQkCSQKJAgBBzpgECy8ZAAUABQAFAAUABQAAAAAAiwXLBQsGSwaLBssGCwdLB4sHBgAGAAYABgAGAAYABgBBkJkECxcCAAIAAgACAAYABgAGAAYABgAGAAYABABBsJkEC19JAIkAyQAJAUkBiQHJAQkCSQKJAgAAAAAAAAAAFwAXAAEAAQACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAI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AGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAQeShBAs5GwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAEG4ogQLNxsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAQfiiBAsRGwAbABsAGwAbABsAGwAbABsAQZijBAsDGwAbAEG4owQLCxsAGwAbABsAGwAbAEH4owQLbxsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABoAGgAaABoAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwBB+KQEC3EbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAAAAAAAABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAAAAAAAAAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwBB+KUECxcbABsAGwAbABsAGwAbABsAGwAbABsAGwBBuKYECw8bABsAGwAbABsAGwAbABsAQdimBAsTGwAbABsAGwAbABsAGwAbABsAGwBB+KYECw8bABsAGwAbABsAGwAbABsAQZinBAsrGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAAAAAABsAGwBB4KcEC5UBGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAAABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAAABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAAAAAAbABsAGwAbABsAAAAAAAAAGwAbABsAQYCpBAsNGwAbABsAGwAbABsAGwBBoKkECyEbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAQdCpBAsNGwAbABsAGwAbABsAGwBB+KkECw0bABsAGwAbABsAGwAbAEGYqgQLqQUbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAAAGwAbABsAGwAbABsAGwAbABsAGwAbABsABQAFBwUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAEUGBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAEUGBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAhQYFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQDFDAUABQAFAAUABQAFAAUABQBFDwUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAEUPBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQDFBgUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUGBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQYFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQYFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFBgUABQAFAAUABQAFAAUABQAFAAUABQAFAAUARQYFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAQYCwBAuDAQUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAhQcFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAQAEHAsQQLHwYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAQYCyBAs7EQ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wZMBkwGTQZNBk4GTgZPBk8GUAZQBlEGUQZSBlIGIQYiBiIGIwYjBiQGJAYlBiUGJgYmBiYGJgYnBicGKAYoBigGKAYpBikGKgYqBioGKgYrBisGKwYrBiwGLAYsBiwGLQYtBi0GLQYuBi4GLgYuBi8GLwYwBjAGMQYxBjIGMgYzBjMGMwYzBjQGNAY0BjQGNQY1BjUGNQY2BjYGNgY2BjcGNwY3BjcGOAY4BjgGOAY5BjkGOQY5BjoGOgY6BjoGQQZBBkEGQQZCBkIGQgZCBkMGQwZDBkMGRAZEBkQGRAZFBkUGRQZFBkYGRgZGBkYGRwZHBkcGRwZIBkgGSQZJBkoGSgZKBkoGXAZcBl0GXQZeBl4GXwZfBgBB+b0ECxcBAAMAAQABAAACAgAAAQIAAQECAAEBAwBBmb4ECzsBAAMAAQADAAABAgAAAQIAAQECAAEBAwACBAYICgwOAAAAAAAAAAAiBiIGIwYjBiUGJQYnBicG7/7w/gBB4b4ECxsBAAAAAAABAAEAAQABAAFcBl0GXAZeBlwGXwYAQfy+BAsDkCEC"),x(0,O,A,(function(A){B(A.instance)})).catch(g),{}}();C._ushape_arabic=(A,B)=>(C._ushape_arabic=Z.e)(A,B),C._malloc=A=>(C._malloc=Z.f)(A),C._free=A=>(C._free=Z.g)(A),C._bidi_processText=(A,B)=>(C._bidi_processText=Z.h)(A,B),C._bidi_getParagraphEndIndex=A=>(C._bidi_getParagraphEndIndex=Z.i)(A),C._bidi_getVisualRun=(A,B,Q)=>(C._bidi_getVisualRun=Z.j)(A,B,Q),C._bidi_setLine=(A,B)=>(C._bidi_setLine=Z.k)(A,B),C._bidi_writeReverse=(A,B,Q)=>(C._bidi_writeReverse=Z.l)(A,B,Q),C._bidi_getLine=(A,B)=>(C._bidi_getLine=Z.m)(A,B);var p,u=A=>(u=Z.o)(A),T=A=>(T=Z.p)(A),v=()=>(v=Z.q)();function m(){function A(){p||(p=!0,C.calledRun=!0,N||(H(X),Q(C),C.onRuntimeInitialized&&C.onRuntimeInitialized(),function(){if(C.postRun)for("function"==typeof C.postRun&&(C.postRun=[C.postRun]);C.postRun.length;)A=C.postRun.shift(),d.unshift(A);var A;H(d)}()))}M>0||(function(){if(C.preRun)for("function"==typeof C.preRun&&(C.preRun=[C.preRun]);C.preRun.length;)A=C.preRun.shift(),S.unshift(A);var A;H(S)}(),M>0||(C.setStatus?(C.setStatus("Running..."),setTimeout((function(){setTimeout((function(){C.setStatus("")}),1),A()}),1)):A()))}if(C.ccall=(A,B,Q,g,E)=>{var I={string:A=>{var B=0;return null!=A&&0!==A&&(B=e(A)),B},array:A=>{var B,Q,g=t(A.length);return B=A,Q=g,c.set(B,Q),g}},F=(A=>C["_"+A])(A),w=[],U=0;if(g)for(var D=0;D<g.length;D++){var G=I[Q[D]];G?(0===U&&(U=v()),w[D]=G(g[D])):w[D]=g[D]}var s=F(...w);return s=function(A){return 0!==U&&u(U),function(A){return"string"===B?f(A):"boolean"===B?Boolean(A):A}(A)}(s)},C.UTF16ToString=(A,B)=>{for(var Q=A,g=Q>>1,C=g+B/2;!(g>=C)&&i[g];)++g;if((Q=g<<1)-A>32&&r)return r.decode(L.subarray(A,Q));for(var E="",I=0;!(I>=B/2);++I){var F=K[A+2*I>>1];if(0==F)break;E+=String.fromCharCode(F)}return E},C.stringToUTF16=(A,B,Q)=>{if(Q??=2147483647,Q<2)return 0;for(var g=B,C=(Q-=2)<2*A.length?Q/2:A.length,E=0;E<C;++E){var I=A.charCodeAt(E);K[B>>1]=I,B+=2}return K[B>>1]=0,B-g},y=function A(){p||m(),p||(y=A)},C.preInit)for("function"==typeof C.preInit&&(C.preInit=[C.preInit]);C.preInit.length>0;)C.preInit.pop()();return m(),E});return async function(){const A=await Q();function B(B){if(!B)return B;const Q=2*(B.length+1),g=A._malloc(Q);A.stringToUTF16(B,g,Q);const C=A.ccall("ushape_arabic","number",["number","number"],[g,B.length]);if(A._free(g),0===C)return B;const E=A.UTF16ToString(C);return A._free(C),E}function g(B,Q){const g=[];for(let C=0;C<Q;C++){const Q=A.ccall("bidi_getParagraphEndIndex","number",["number"],[C]);for(const A of B)A<Q&&(!g[g.length-1]||A>g[g.length-1])&&g.push(A);g.push(Q)}for(const A of B)A>g[g.length-1]&&g.push(A);return g}function C(B,Q,g){if(!B)return null;A.stringToUTF16(B,Q,g);const C=A.ccall("bidi_processText","number",["number","number"],[Q,B.length]);return 0===C?(A._free(Q),null):C}function E(B,Q){const E=2*(B.length+1),I=A._malloc(E),F=C(B,I,E);if(!F)return[B];const w=g(Q,F);let U=0;const D=[];for(const B of w){const Q=A.ccall("bidi_getLine","number",["number","number"],[U,B]);if(0===Q)return A._free(I),[];D.push(A.UTF16ToString(Q)),A._free(Q),U=B}return A._free(I),D}function I(){return A._malloc(4)}function F(B){const Q=new Int32Array(A.HEAPU8.buffer,B,1)[0];return A._free(B),Q}function w(B,Q,g){const C=A.ccall("bidi_writeReverse","number",["number","number","number"],[B,Q,g-Q]);if(0===C)return null;const E=A.UTF16ToString(C);return A._free(C),E}function U(B,Q,E){const U=2*(B.length+1),D=A._malloc(U),G=C(B,D,U);if(!G)return[{text:B,styleIndices:Q}];const s=g(E,G);let Y=0;const o=[];for(const g of s){let C="",E=[];const U=A.ccall("bidi_setLine","number",["number","number"],[Y,g]);if(!U)return A._free(D),[];for(let g=0;g<U;g++){const U=I(),G=I(),s=A.ccall("bidi_getVisualRun","number",["number","number","number"],[g,U,G]),o=Y+F(U),c=o+F(G);if(s){let B=c,g=Q[B-1];for(let I=c-1;I>=o;I--)if(g!==Q[I]||I===o){const F=I===o?I:I+1,U=w(D,F,B);if(!U)return A._free(D),[];C+=U;for(let A=0;A<U.length;A++)E.push(g);g=Q[I],B=F}}else C+=B.substring(o,c),E=E.concat(Q.slice(o,c))}o.push([C,E]),Y=g}return A._free(D),o}return"undefined"!=typeof self&&self.registerRTLTextPlugin&&self.registerRTLTextPlugin({applyArabicShaping:B,processBidirectionalText:E,processStyledBidirectionalText:U}),{applyArabicShaping:B,processBidirectionalText:E,processStyledBidirectionalText:U}}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=B():"function"==typeof define&&define.amd?define(B):(A="undefined"!=typeof globalThis?globalThis:A||self)["mapbox-gl-rtl-text"]=B();\n';var KB="map",dl=class dl extends er.BasesView{constructor(J,le,D){super(J);this.type=KB;this.map=null;this.mapConfig=null;this.pendingMapState=null;this.isFirstLoad=!0;this.lastConfigSnapshot=null;this.lastEvaluatedCenter=null;this.onResizeDebounce=(0,er.debounce)(()=>{this.map&&this.map.resize()},100,!0);this.onThemeChange=()=>{this.map&&this.updateMapStyle()};this.scrollEl=le,this.plugin=D,this.containerEl=le.createDiv({cls:"bases-map-container is-loading",attr:{tabIndex:0}}),this.mapEl=this.containerEl.createDiv("bases-map"),this.styleManager=new ih(this.app),this.popupManager=new rh(this.containerEl,this.app),this.markerManager=new nh(this.app,this.mapEl,this.popupManager,(c,se)=>void this.app.workspace.openLinkText(c,"",se),()=>this.data,()=>this.mapConfig,c=>this.config.getDisplayName(c))}onload(){this.registerEvent(this.app.workspace.on("css-change",this.onThemeChange,this)),this.registerDomEvent(this.mapEl,"contextmenu",J=>{J.preventDefault(),this.showMapContextMenu(J)})}onunload(){this.destroyMap()}onResize(){this.onResizeDebounce()}focus(){this.containerEl.focus({preventScroll:!0})}async updateMapStyle(){if(!this.map||!this.mapConfig)return;let J=await this.styleManager.getMapStyle(this.mapConfig.mapTiles,this.mapConfig.mapTilesDark);this.map.setStyle(J),this.markerManager.clearLoadedIcons(),this.map.once("styledata",()=>{this.markerManager.updateMarkers(this.data)})}async switchToTileSet(J){let le=this.plugin.settings.tileSets.find(D=>D.id===J);!le||!this.mapConfig||(this.mapConfig.currentTileSetId=J,this.mapConfig.mapTiles=le.lightTiles?[le.lightTiles]:[],this.mapConfig.mapTilesDark=le.darkTiles?[le.darkTiles]:le.lightTiles?[le.lightTiles]:[],await this.updateMapStyle())}async initializeMap(){var Te,Ye,rt,Je,Qt,Pe,Lt;if(this.map)return;if(!dl.rtlPluginInitialized)try{let qe=new Blob([Sp],{type:"application/javascript"}),de=URL.createObjectURL(qe);(0,oh.setRTLTextPlugin)(de,!1),dl.rtlPluginInitialized=!0}catch(qe){console.warn("Failed to initialize RTL text plugin:",qe)}let J=((Te=this.mapConfig)==null?void 0:Te.currentTileSetId)||null;this.mapConfig=this.loadConfig(J),this.applyMapHeight();let le=await this.styleManager.getMapStyle(this.mapConfig.mapTiles,this.mapConfig.mapTilesDark),D=Bo((Ye=this.mapConfig.center)!=null?Ye:wp),c=this.mapConfig.defaultZoom,se=this.pendingMapState!==null,Me=(rt=this.pendingMapState)==null?void 0:rt.center;if(Me&&(D=[Me.lng,Me.lat]),c=(Qt=(Je=this.pendingMapState)==null?void 0:Je.zoom)!=null?Qt:c,this.map=new oh.Map({container:this.mapEl,style:le,center:D,zoom:c,minZoom:this.mapConfig.minZoom,maxZoom:this.mapConfig.maxZoom}),this.popupManager.setMap(this.map),this.markerManager.setMap(this.map),this.map.addControl(new Vc,"top-right"),er.Platform.isMobileApp&&this.map.addControl(new $c,"top-right"),this.plugin.settings.tileSets.length>1){let qe=this.mapConfig.currentTileSetId||((Pe=this.plugin.settings.tileSets[0])==null?void 0:Pe.id)||"";qe&&this.map.addControl(new eh(this.plugin.settings.tileSets,qe,de=>void this.switchToTileSet(de)),"top-right")}this.map.on("error",qe=>{console.warn("Map error:",qe)}),this.map.on("load",()=>{if(!this.map||!this.mapConfig||se||this.pendingMapState)return;let qe=this.mapConfig.center;if(qe)this.map.setCenter(Bo(qe));else{let de=this.markerManager.getBounds();de&&this.map.setCenter(de.getCenter())}if(this.hasConfiguredZoom())this.map.setZoom(this.mapConfig.defaultZoom);else{let de=this.markerManager.getBounds();de&&this.map.fitBounds(de,{padding:20})}}),(Lt=this.mapEl.querySelector("canvas"))==null||Lt.setCssProps({"--no-tooltip":"true"})}destroyMap(){this.popupManager.destroy(),this.map&&(this.map.remove(),this.map=null),this.markerManager.setMap(null)}onDataUpdated(){var se;this.containerEl.removeClass("is-loading");let J=this.getConfigSnapshot(),le=JSON.stringify(this.lastConfigSnapshot)!==JSON.stringify(J),D=((se=this.mapConfig)==null?void 0:se.currentTileSetId)||null;this.mapConfig=this.loadConfig(D);let c=!Ep(this.mapConfig.center,this.lastEvaluatedCenter);this.initializeMap().then(async()=>{if(le?(await this.applyConfigToMap(this.lastConfigSnapshot,J),this.lastConfigSnapshot=J,this.isFirstLoad=!1):this.map&&!this.isFirstLoad&&c&&this.pendingMapState===null&&this.updateCenter(),this.map&&this.data&&(await this.markerManager.updateMarkers(this.data),this.pendingMapState&&this.map)){let{center:Me,zoom:Te}=this.pendingMapState;Me&&this.map.setCenter(Me),Te!=null&&this.map.setZoom(Te),this.pendingMapState=null}if(this.mapConfig){let Me=this.mapConfig.center;this.lastEvaluatedCenter=Me&&[Me[0],Me[1]]}})}hasConfiguredZoom(){return Number.isNumber(this.config.get("defaultZoom"))}updateZoom(){!this.map||!this.mapConfig||this.hasConfiguredZoom()&&this.map.setZoom(this.mapConfig.defaultZoom)}updateCenter(){if(!this.map||!this.mapConfig)return;let J=this.mapConfig.center;if(J){let le=this.map.getCenter();if(!le)return;let D=Bo(J);(Math.abs(le.lng-D[0])>1e-5||Math.abs(le.lat-D[1])>1e-5)&&this.map.setCenter(D)}}async applyConfigToMap(J,le){if(!this.map||!this.mapConfig)return;let D=(J==null?void 0:J.center)!==le.center,c=(J==null?void 0:J.defaultZoom)!==le.defaultZoom,se=JSON.stringify(J==null?void 0:J.mapTiles)!==JSON.stringify(le.mapTiles)||JSON.stringify(J==null?void 0:J.mapTilesDark)!==JSON.stringify(le.mapTilesDark),Me=(J==null?void 0:J.mapHeight)!==le.mapHeight;this.map.setMinZoom(this.mapConfig.minZoom),this.map.setMaxZoom(this.mapConfig.maxZoom);let Te=this.map.getZoom();Te<this.mapConfig.minZoom?this.map.setZoom(this.mapConfig.minZoom):Te>this.mapConfig.maxZoom&&this.map.setZoom(this.mapConfig.maxZoom);let Ye=this.pendingMapState!==null;if(!Ye&&(this.isFirstLoad||c)&&this.updateZoom(),!Ye&&(this.isFirstLoad||D)&&this.updateCenter(),this.isFirstLoad||se){let rt=await this.styleManager.getMapStyle(this.mapConfig.mapTiles,this.mapConfig.mapTilesDark),Je=this.map.getStyle();JSON.stringify(rt)!==JSON.stringify(Je)&&(this.map.setStyle(rt),this.markerManager.clearLoadedIcons())}(this.isFirstLoad||Me)&&(this.applyMapHeight(),this.map.resize())}isEmbedded(){var J;return((J=this.scrollEl.parentElement)==null?void 0:J.matchParent(".bases-embed, .block-language-base"))!=null}applyMapHeight(){this.mapEl.style.height=this.isEmbedded()&&this.mapConfig?this.mapConfig.mapHeight+"px":""}loadConfig(J){let le=this.config.getAsPropertyId("coordinates"),D=this.config.getAsPropertyId("markerIcon"),c=this.config.getAsPropertyId("markerColor"),se=this.getNumericConfig("minZoom",0,0,24),Me=this.getNumericConfig("maxZoom",18,0,24),Te=this.getNumericConfig("defaultZoom",Vu,se,Me),Ye=this.getCenterFromConfig(),rt=this.isEmbedded()?this.getNumericConfig("mapHeight",400,100,2e3):400,Je=this.getArrayConfig("mapTiles"),Qt=this.getArrayConfig("mapTilesDark"),Pe,Lt,qe;if(Je.length>0)Pe=Je,Lt=Qt,qe=null;else if(this.plugin.settings.tileSets.length>0){let dt=(J?this.plugin.settings.tileSets.find(xi=>xi.id===J):null)||this.plugin.settings.tileSets[0];qe=dt.id,Pe=dt.lightTiles?[dt.lightTiles]:[],Lt=dt.darkTiles?[dt.darkTiles]:dt.lightTiles?[dt.lightTiles]:[]}else Pe=[],Lt=[],qe=null;return{coordinatesProp:le,markerIconProp:D,markerColorProp:c,mapHeight:rt,defaultZoom:Te,center:Ye,maxZoom:Me,minZoom:se,mapTiles:Pe,mapTilesDark:Lt,currentTileSetId:qe}}getNumericConfig(J,le,D,c){let se=this.config.get(J);return se==null||typeof se!="number"?le:Math.min(c,Math.max(D,se))}getArrayConfig(J){let le=this.config.get(J);return le?Array.isArray(le)?le.filter(D=>typeof D=="string"&&D.trim().length>0):typeof le=="string"&&le.trim().length>0?[le.trim()]:[]:[]}getCenterFromConfig(){let J=null;try{J=this.config.getEvaluatedFormula(this,"center")}catch(le){}if(!J||er.Value.equals(J,er.NullValue.value)){let le=this.config.get("center");if(!String.isString(le))return null;J=new er.StringValue(le)}return Hc(J)}getConfigSnapshot(){return{center:this.config.get("center"),defaultZoom:this.config.get("defaultZoom"),minZoom:this.config.get("minZoom"),maxZoom:this.config.get("maxZoom"),mapHeight:this.config.get("mapHeight"),mapTiles:this.config.get("mapTiles"),mapTilesDark:this.config.get("mapTilesDark")}}showMapContextMenu(J){if(!this.map||!this.mapConfig)return;let le=Math.round(this.map.getZoom()*10)/10,D=[J.offsetX,J.offsetY],c=this.map.unproject(D),se=Hu(c.lat),Me=Hu(c.lng),Te=er.Menu.forEvent(J);Te.addItem(Ye=>Ye.setTitle("New note").setSection("action").setIcon("square-pen").onClick(()=>{this.createFileForView("",rt=>{var Je;if((Je=this.mapConfig)!=null&&Je.coordinatesProp){let Qt=this.mapConfig.coordinatesProp.startsWith("note.")?this.mapConfig.coordinatesProp.slice(5):this.mapConfig.coordinatesProp;rt[Qt]=[se.toString(),Me.toString()]}})})),Te.addItem(Ye=>Ye.setTitle("Copy coordinates").setSection("action").setIcon("copy").onClick(()=>{navigator.clipboard.writeText(Jc(se,Me))})),Te.addItem(Ye=>Ye.setTitle("Set default center point").setSection("action").setIcon("map-pin").onClick(()=>{var Je;let rt=`[${se}, ${Me}]`;this.mapConfig&&(this.mapConfig.center=[se,Me]),this.config.set("center",rt),(Je=this.map)==null||Je.setCenter(Bo([se,Me]))})),Te.addItem(Ye=>Ye.setTitle(`Set default zoom (${le})`).setSection("action").setIcon("crosshair").onClick(()=>{this.config.set("defaultZoom",le)}))}setEphemeralState(J){if(!J){this.pendingMapState=null;return}if(this.pendingMapState={},cl(J,"center")&&cl(J.center,"lng")&&cl(J.center,"lat")){let le=J.center.lng,D=J.center.lat;typeof le=="number"&&typeof D=="number"&&(this.pendingMapState.center={lng:le,lat:D})}cl(J,"zoom")&&typeof J.zoom=="number"&&(this.pendingMapState.zoom=J.zoom)}getEphemeralState(){if(!this.map)return{};let J=this.map.getCenter();return{center:{lng:J.lng,lat:J.lat},zoom:this.map.getZoom()}}static getViewOptions(){return[{displayName:"Embedded height",type:"slider",key:"mapHeight",min:200,max:800,step:20,default:400},{displayName:"Display",type:"group",items:[{displayName:"Center coordinates",type:"formula",key:"center",placeholder:"[latitude, longitude]"},{displayName:"Default zoom",type:"slider",key:"defaultZoom",min:1,max:18,step:1,default:Vu},{displayName:"Minimum zoom",type:"slider",key:"minZoom",min:0,max:24,step:1,default:0},{displayName:"Maximum zoom",type:"slider",key:"maxZoom",min:0,max:24,step:1,default:18}]},{displayName:"Markers",type:"group",items:[{displayName:"Marker coordinates",type:"property",key:"coordinates",filter:J=>!J.startsWith("file."),placeholder:"Property"},{displayName:"Marker icon",type:"property",key:"markerIcon",filter:J=>!J.startsWith("file."),placeholder:"Property"},{displayName:"Marker color",type:"property",key:"markerColor",filter:J=>!J.startsWith("file."),placeholder:"Property"}]},{displayName:"Background",type:"group",items:[{displayName:"Map tiles",type:"multitext",key:"mapTiles"},{displayName:"Map tiles in dark mode",type:"multitext",key:"mapTilesDark"}]}]}};dl.rtlPluginInitialized=!1;var gl=dl;var yo=require("obsidian"),Mp={tileSets:[]},sh=class extends yo.Modal{constructor($,J,le){super($),this.isNew=!J,this.tileSet=J||{id:Date.now().toString(),name:"",lightTiles:"",darkTiles:""},this.onSave=le}onOpen(){let{contentEl:$,modalEl:J}=this;this.setTitle(this.isNew?"Add background":"Edit background"),new yo.Setting($).setName("Name").setDesc("A name for this background.").addText(D=>D.setPlaceholder("e.g. Terrain, satellite").setValue(this.tileSet.name).onChange(c=>{this.tileSet.name=c})),new yo.Setting($).setName("Light mode").setDesc(createFragment(D=>{D.appendText("Tile URL or style URL for light mode. See the "),D.createEl("a",{href:"https://help.obsidian.md/bases/views/map",text:"Map view documentation"}),D.appendText(" for examples.")})).addText(D=>D.setPlaceholder("https://tiles.openfreemap.org/styles/bright").setValue(this.tileSet.lightTiles).onChange(c=>{this.tileSet.lightTiles=c})),new yo.Setting($).setName("Dark mode (optional)").setDesc("Tile URL or style URL for dark mode. If not specified, light mode tiles will be used.").addText(D=>D.setPlaceholder("https://tiles.openfreemap.org/styles/dark").setValue(this.tileSet.darkTiles).onChange(c=>{this.tileSet.darkTiles=c}));let le=J.createDiv("modal-button-container");le.createEl("button",{cls:"mod-cta",text:"Save"}).addEventListener("click",()=>{this.onSave(this.tileSet),this.close()}),le.createEl("button",{text:"Cancel"}).addEventListener("click",()=>{this.close()})}onClose(){let{contentEl:$}=this;$.empty()}},Ah=class extends yo.PluginSettingTab{constructor($,J){super($,J),this.plugin=J}getSettingDefinitions(){return[{type:"list",heading:"Backgrounds",emptyState:"Add background sets available to all maps.",addItem:{name:"Add background",action:()=>{new sh(this.app,null,$=>{this.plugin.settings.tileSets.push($),this.saveAndRefresh()}).open()}},onReorder:($,J)=>{let le=this.plugin.settings.tileSets;le.splice(J,0,...le.splice($,1)),this.saveAndRefresh()},items:this.plugin.settings.tileSets.map(($,J)=>({name:$.name||"Untitled",render:le=>{le.addExtraButton(D=>D.setIcon("lucide-pen-line").setTooltip("Edit").onClick(()=>{new sh(this.app,{...$},c=>{this.plugin.settings.tileSets[J]=c,this.saveAndRefresh()}).open()})).addExtraButton(D=>D.setIcon("lucide-trash-2").setTooltip("Delete").onClick(()=>{this.plugin.settings.tileSets.splice(J,1),this.saveAndRefresh()}))}}))}]}async saveAndRefresh(){await this.plugin.saveSettings(),this.update()}};var ah=class extends Wr.Plugin{async onload(){await this.loadSettings(),this.registerBasesView("map",{name:"Map",icon:"lucide-map",factory:($,J)=>new gl($,J,this),options:()=>gl.getViewOptions()}),Wr.Platform.isMobileApp&&this.addCommand({id:"copy-current-location",name:"Copy current location to clipboard",callback:()=>{this.getCurrentLocationAndCopy()}}),this.addSettingTab(new Ah(this.app,this))}async loadSettings(){let $=await this.loadData();this.settings=Object.assign({},Mp,$)}async saveSettings(){await this.saveData(this.settings)}getCurrentLocationAndCopy(){if(!navigator.geolocation){new Wr.Notice("Location services are not available");return}let $=new Wr.Notice("Getting your location\u2026",0);navigator.geolocation.getCurrentPosition(J=>{$.hide();let le=Number(J.coords.latitude.toFixed(5)),D=Number(J.coords.longitude.toFixed(5));this.copyToClipboard(`[${le}, ${D}]`)},J=>{$.hide(),console.warn("Geolocation error:",J),new Wr.Notice(Wc(J))},qc)}async copyToClipboard($){try{await navigator.clipboard.writeText($),new Wr.Notice(`Location copied: ${$}`)}catch(J){console.error("Failed to copy to clipboard:",J),new Wr.Notice("Failed to copy to clipboard")}}};
|
|
/*! Bundled license information:
|
|
|
|
maplibre-gl/dist/maplibre-gl.js:
|
|
(**
|
|
* MapLibre GL JS
|
|
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.24.0/LICENSE.txt
|
|
*)
|
|
*/
|
|
|
|
/* nosourcemap */ |